merge with pret

This commit is contained in:
ghoulslash
2021-10-26 13:21:50 -04:00
692 changed files with 42456 additions and 41968 deletions

View File

@@ -1,9 +1,15 @@
#!/usr/bin/perl
use IPC::Cmd qw[ run ];
use Getopt::Long;
my $usage = "Usage: calcrom.pl file.map [--data]\n";
my $showData;
GetOptions("data" => \$showData) or die $usage;
(@ARGV == 1)
or die "ERROR: no map file specified.\n";
or die $usage;
open(my $file, $ARGV[0])
or die "ERROR: could not open file '$ARGV[0]'.\n";
@@ -149,17 +155,13 @@ else
print "$undocumented symbols undocumented ($undocPct%)\n";
}
print "\n";
my $dataTotal = $srcdata + $data;
my $srcDataPct = sprintf("%.4f", 100 * $srcdata / $dataTotal);
my $dataPct = sprintf("%.4f", 100 * $data / $dataTotal);
if ($showData)
{
print "\n";
my $dataTotal = $srcdata + $data;
my $srcDataPct = sprintf("%.4f", 100 * $srcdata / $dataTotal);
my $dataPct = sprintf("%.4f", 100 * $data / $dataTotal);
if ($data == 0)
{
print "Data porting to C is 100% complete\n"
}
else
{
print "$dataTotal total bytes of data\n";
print "$srcdata bytes of data in src ($srcDataPct%)\n";
print "$data bytes of data in data ($dataPct%)\n";

2
.gitignore vendored
View File

@@ -34,3 +34,5 @@ porymap.project.cfg
*.a
.fuse_hidden*
*.sna
*.diff
*.sym

View File

@@ -28,4 +28,4 @@ Other disassembly and/or decompilation projects:
## Contacts
You can find us on [Discord](https://discord.gg/d5dubZ3) and [IRC](https://kiwiirc.com/client/irc.freenode.net/?#pret).
You can find us on [Discord](https://discord.gg/d5dubZ3) and [IRC](https://web.libera.chat/?#pret).

View File

@@ -14,7 +14,7 @@
.byte 0x02
.4byte \template
.if \anim_battler == ANIM_TARGET
.byte 0x80 | (\subpriority_offset & 0x7F)
.byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F)
.else
.byte (\subpriority_offset & 0x7F)
.endif
@@ -34,20 +34,20 @@
.Lcreatetask_\@_2:
.endm
.macro delay param0:req
.macro delay frames:req
.byte 0x4
.byte \param0
.byte \frames
.endm
.macro waitforvisualfinish
.byte 0x5
.endm
.macro hang1
.macro nop
.byte 0x6
.endm
.macro hang2
.macro nop2
.byte 0x7
.endm
@@ -79,30 +79,30 @@
.byte 0xd
.endm
.macro call param0:req
.macro call ptr:req
.byte 0xe
.4byte \param0
.4byte \ptr
.endm
.macro return
.byte 0xf
.endm
.macro setarg param0:req, param1:req
.macro setarg argId:req, value:req
.byte 0x10
.byte \param0
.2byte \param1
.byte \argId
.2byte \value
.endm
.macro choosetwoturnanim param0:req, param1:req
.macro choosetwoturnanim ptr1:req, ptr2:req
.byte 0x11
.4byte \param0
.4byte \param1
.4byte \ptr1
.4byte \ptr2
.endm
.macro jumpifmoveturn param0:req, ptr:req
.macro jumpifmoveturn value:req, ptr:req
.byte 0x12
.byte \param0
.byte \value
.4byte \ptr
.endm
@@ -144,13 +144,13 @@
.byte \pan
.endm
.macro panse_1B se:req, param1:req, param2:req, param3:req, param4:req
.macro panse se:req, currentPan:req, targetPan:req, incrementPan:req, delay:req
.byte 0x1b
.2byte \se
.byte \param1
.byte \param2
.byte \param3
.byte \param4
.byte \currentPan
.byte \targetPan
.byte \incrementPan
.byte \delay
.endm
.macro loopsewithpan se:req, pan:req, wait:req, times:req
@@ -168,9 +168,9 @@
.byte \wait
.endm
.macro setbldcnt param0:req
.macro setbldcnt bldcnt:req
.byte 0x1e
.2byte \param0
.2byte \bldcnt
.endm
.macro createsoundtask addr:req, argv:vararg
@@ -186,19 +186,19 @@
.byte 0x20
.endm
.macro jumpargeq param0:req, param1:req, ptr:req
.macro jumpargeq argId:req, value:req, ptr:req
.byte 0x21
.byte \param0
.2byte \param1
.byte \argId
.2byte \value
.4byte \ptr
.endm
.macro monbg_22 battler:req
.macro monbg_static battler:req
.byte 0x22
.byte \battler
.endm
.macro clearmonbg_23 battler:req
.macro clearmonbg_static battler:req
.byte 0x23
.byte \battler
.endm
@@ -208,41 +208,41 @@
.4byte \ptr
.endm
.macro fadetobgfromset param0:req, param1:req, param2:req
.macro fadetobgfromset bgOpponent:req, bgPlayer:req, bgContest:req
.byte 0x25
.byte \param0
.byte \param1
.byte \param2
.byte \bgOpponent
.byte \bgPlayer
.byte \bgContest
.endm
.macro panse_26 se:req, param1:req, param2:req, param3:req, param4:req
.macro panse_adjustnone se:req, currentPan:req, targetPan:req, incrementPan:req, delay:req
.byte 0x26
.2byte \se
.byte \param1
.byte \param2
.byte \param3
.byte \param4
.byte \currentPan
.byte \targetPan
.byte \incrementPan
.byte \delay
.endm
.macro panse_27 se:req, param1:req, param2:req, param3:req, param4:req
.macro panse_adjustall se:req, currentPan:req, targetPan:req, incrementPan:req, delay:req
.byte 0x27
.2byte \se
.byte \param1
.byte \param2
.byte \param3
.byte \param4
.byte \currentPan
.byte \targetPan
.byte \incrementPan
.byte \delay
.endm
.macro monbgprio_28 battler:req
.macro splitbgprio battler:req
.byte 0x28
.byte \battler
.endm
.macro monbgprio_29
.macro splitbgprio_all
.byte 0x29
.endm
.macro monbgprio_2A battler:req
.macro splitbgprio_foes battler:req
.byte 0x2a
.byte \battler
.endm
@@ -257,12 +257,12 @@
.byte \battler
.endm
.macro doublebattle_2D battler:req
.macro teamattack_moveback battler:req
.byte 0x2d
.byte \battler
.endm
.macro doublebattle_2E battler:req
.macro teamattack_movefwd battler:req
.byte 0x2e
.byte \battler
.endm

View File

@@ -53,7 +53,7 @@
special CallApprenticeFunction
.endm
@ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason
@ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason
.macro apprentice_shouldcheckgone
setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE
special CallApprenticeFunction
@@ -109,7 +109,7 @@
special CallApprenticeFunction
.endm
@ Set which mon the Apprentice should lead with
@ Set which mon the Apprentice should lead with
.macro apprentice_setleadmon monId:req
copyvar VAR_0x8005, \monId
setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON
@@ -141,7 +141,7 @@
special CallApprenticeFunction
.endm
@ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason
@ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason
.macro apprentice_shouldleave
setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE
special CallApprenticeFunction

View File

@@ -88,7 +88,7 @@
.endm
@ Return the FACTORY_STYLE_* dependent on what types of moves the opponents team has, or FACTORY_NUM_STYLES if multiple styles tie for the same amount of moves
.macro factory_getopponentstyle
.macro factory_getopponentstyle
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE
special CallBattleFactoryFunction
.endm

View File

@@ -31,7 +31,7 @@
special CallBattlePalaceFunction
.endm
@ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory
@ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory
.macro palace_getopponentintro
setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO
special CallBattlePalaceFunction

View File

@@ -1,7 +1,7 @@
@ Initialize the Battle Pyramid challenge
.macro pyramid_init
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT
special CallBattlePyramidFunction
special CallBattlePyramidFunction
.endm
@ Get the value of some PYRAMID_DATA_*. See GetBattlePyramidData for the data types that can be retrieved
@@ -59,7 +59,7 @@
@ Set the facility trainers to gBattleFrontierTrainers
.macro pyramid_settrainers
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_TRAINERS
special CallBattlePyramidFunction
special CallBattlePyramidFunction
.endm
@ Show the post-battle hint text
@@ -68,11 +68,11 @@
special CallBattlePyramidFunction
.endm
@ VAR_RESULT is 1 if player is on a Pyramid floor, 2 if on the Pyramid peak, 0 otherwise
@ VAR_RESULT is 1 if player is on a Pyramid floor, 2 if on the Pyramid peak, 0 otherwise
.macro pyramid_inchallenge
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN
special CallBattlePyramidFunction
.endm
.endm
@ Update the light around the player. 2 different modes, for setting or incrementing light. See PYRAMID_LIGHT_*
.macro pyramid_updatelight radius:req, mode:req, sound=0xFFFF
@@ -83,7 +83,7 @@
setvar VAR_0x8007, \sound
.endif
special CallBattlePyramidFunction
.endm
.endm
@ Reset the held items to what they were at the start of the challenge
.macro pyramid_clearhelditems
@@ -100,5 +100,5 @@
@ Reset sketched moves and update the party order in the saveblock
.macro pyramid_resetparty
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY
special CallBattlePyramidFunction
special CallBattlePyramidFunction
.endm

View File

@@ -3,10 +3,10 @@
.byte 0x0
.endm
.macro accuracycheck param0:req, param1:req
.macro accuracycheck failPtr:req, move:req
.byte 0x1
.4byte \param0
.2byte \param1
.4byte \failPtr
.2byte \move
.endm
.macro attackstring
@@ -77,9 +77,9 @@
.2byte \id
.endm
.macro waitmessage param0:req
.macro waitmessage time:req
.byte 0x12
.2byte \param0
.2byte \time
.endm
.macro printfromtable ptr:req
@@ -109,10 +109,17 @@
.byte \battler
.endm
.macro tryfaintmon battler:req, param1:req, ptr:req
.macro tryfaintmon battler:req
.byte 0x19
.byte \battler
.byte \param1
.byte FALSE
.4byte NULL
.endm
.macro tryfaintmon_spikes battler:req, ptr:req
.byte 0x19
.byte \battler
.byte TRUE
.4byte \ptr
.endm
@@ -140,9 +147,9 @@
.4byte \ptr
.endm
.macro jumpifability param0:req, ability:req, ptr:req
.macro jumpifability battler:req, ability:req, ptr:req
.byte 0x1e
.byte \param0
.byte \battler
.byte \ability
.4byte \ptr
.endm
@@ -163,11 +170,11 @@
.4byte \ptr
.endm
.macro jumpifstatus3condition battler:req, status3:req, param2:req, ptr:req
.macro jumpifstatus3condition battler:req, status3:req, condition:req, ptr:req
.byte 0x21
.byte \battler
.4byte \status3
.byte \param2
.byte \condition
.4byte \ptr
.endm
@@ -183,7 +190,7 @@
.byte \battler
.endm
.macro atk24 ptr:req
.macro checkteamslost ptr:req
.byte 0x24
.4byte \ptr
.endm
@@ -207,118 +214,118 @@
.4byte \ptr
.endm
.macro jumpifbyte ifflag:req, param1:req, param2:req, param3:req
.macro jumpifbyte ifflag:req, val:req, byte:req, ptr:req
.byte 0x29
.byte \ifflag
.4byte \param1
.byte \param2
.4byte \param3
.4byte \val
.byte \byte
.4byte \ptr
.endm
.macro jumpifhalfword ifflag:req, param1:req, param2:req, param3:req
.macro jumpifhalfword ifflag:req, val:req, hword:req, ptr:req
.byte 0x2a
.byte \ifflag
.4byte \param1
.2byte \param2
.4byte \param3
.4byte \val
.2byte \hword
.4byte \ptr
.endm
.macro jumpifword ifflag:req, param1:req, param2:req, param3:req
.macro jumpifword ifflag:req, val:req, word:req, ptr:req
.byte 0x2b
.byte \ifflag
.4byte \param1
.4byte \param2
.4byte \param3
.4byte \val
.4byte \word
.4byte \ptr
.endm
.macro jumpifarrayequal param0:req, param1:req, param2:req, param3:req
.macro jumpifarrayequal val1:req, val2:req, size:req, ptr:req
.byte 0x2c
.4byte \param0
.4byte \param1
.byte \param2
.4byte \param3
.4byte \val1
.4byte \val2
.byte \size
.4byte \ptr
.endm
.macro jumpifarraynotequal param0:req, param1:req, param2:req, param3:req
.macro jumpifarraynotequal val1:req, val2:req, size:req, ptr:req
.byte 0x2d
.4byte \param0
.4byte \param1
.byte \param2
.4byte \param3
.4byte \val1
.4byte \val2
.byte \size
.4byte \ptr
.endm
.macro setbyte ptr:req, param1:req
.macro setbyte ptr:req, byte:req
.byte 0x2e
.4byte \ptr
.byte \param1
.byte \byte
.endm
.macro addbyte ptr:req, param1:req
.macro addbyte ptr:req, byte:req
.byte 0x2f
.4byte \ptr
.byte \param1
.byte \byte
.endm
.macro subbyte ptr:req, param1:req
.macro subbyte ptr:req, byte:req
.byte 0x30
.4byte \ptr
.byte \param1
.byte \byte
.endm
.macro copyarray param0:req, param1:req, param2:req
.macro copyarray dest:req, src:req, size:req
.byte 0x31
.4byte \param0
.4byte \param1
.byte \param2
.4byte \dest
.4byte \src
.byte \size
.endm
.macro copyarraywithindex param0:req, param1:req, param2:req, param3:req
.macro copyarraywithindex dest:req, src:req, index:req, size:req
.byte 0x32
.4byte \param0
.4byte \param1
.4byte \param2
.byte \param3
.4byte \dest
.4byte \src
.4byte \index
.byte \size
.endm
.macro orbyte ptr:req, param1:req
.macro orbyte ptr:req, byte:req
.byte 0x33
.4byte \ptr
.byte \param1
.byte \byte
.endm
.macro orhalfword ptr:req, param1:req
.macro orhalfword ptr:req, hword:req
.byte 0x34
.4byte \ptr
.2byte \param1
.2byte \hword
.endm
.macro orword ptr:req, param1:req
.macro orword ptr:req, word:req
.byte 0x35
.4byte \ptr
.4byte \param1
.4byte \word
.endm
.macro bicbyte ptr:req, param1:req
.macro bicbyte ptr:req, byte:req
.byte 0x36
.4byte \ptr
.byte \param1
.byte \byte
.endm
.macro bichalfword ptr:req, param1:req
.macro bichalfword ptr:req, hword:req
.byte 0x37
.4byte \ptr
.2byte \param1
.2byte \hword
.endm
.macro bicword ptr:req, param1:req
.macro bicword ptr:req, word:req
.byte 0x38
.4byte \ptr
.4byte \param1
.4byte \word
.endm
.macro pause param0:req
.macro pause time:req
.byte 0x39
.2byte \param0
.2byte \time
.endm
.macro waitstate
@@ -373,18 +380,18 @@
.byte 0x44
.endm
.macro playanimation battler:req, param1:req, param2:req
.macro playanimation battler:req, animType:req, arg=NULL
.byte 0x45
.byte \battler
.byte \param1
.4byte \param2
.byte \animType
.4byte \arg
.endm
.macro playanimation2 battler:req, param1:req, param2:req
.macro playanimation_var battler:req, animType:req, arg=NULL
.byte 0x46
.byte \battler
.4byte \param1
.4byte \param2
.4byte \animType
.4byte \arg
.endm
.macro setgraphicalstatchangevalues
@@ -398,10 +405,10 @@
.byte \statchange
.endm
.macro moveend param0:req, param1:req
.macro moveend endMode:req, endState:req
.byte 0x49
.byte \param0
.byte \param1
.byte \endMode
.byte \endState
.endm
@ Help macros for 5 uses of moveend command
@@ -466,16 +473,16 @@
.4byte \ptr
.endm
.macro openpartyscreen param0:req, param1:req
.macro openpartyscreen battler:req, ptr:req
.byte 0x50
.byte \param0
.4byte \param1
.byte \battler
.4byte \ptr
.endm
.macro switchhandleorder battler:req, param1:req
.macro switchhandleorder battler:req, state:req
.byte 0x51
.byte \battler
.byte \param1
.byte \state
.endm
.macro switchineffects battler:req
@@ -488,14 +495,14 @@
.byte \battler
.endm
.macro playse param0:req
.macro playse song:req
.byte 0x54
.2byte \param0
.2byte \song
.endm
.macro fanfare param0:req
.macro fanfare song:req
.byte 0x55
.2byte \param0
.2byte \song
.endm
.macro playfaintcry battler:req
@@ -512,21 +519,21 @@
.byte \battler
.endm
.macro handlelearnnewmove param0:req, param1:req, param2:req
.macro handlelearnnewmove learnedMovePtr:req, nothingToLearnPtr:req, isFirstMove:req
.byte 0x59
.4byte \param0
.4byte \param1
.byte \param2
.4byte \learnedMovePtr
.4byte \nothingToLearnPtr
.byte \isFirstMove
.endm
.macro yesnoboxlearnmove param0:req
.macro yesnoboxlearnmove forgotMovePtr:req
.byte 0x5a
.4byte \param0
.4byte \forgotMovePtr
.endm
.macro yesnoboxstoplearningmove param0:req
.macro yesnoboxstoplearningmove noPtr:req
.byte 0x5b
.4byte \param0
.4byte \noPtr
.endm
.macro hitanimation battler:req
@@ -538,7 +545,7 @@
.byte 0x5d
.endm
.macro atk5E battler:req
.macro updatebattlermoves battler:req
.byte 0x5e
.byte \battler
.endm
@@ -547,9 +554,9 @@
.byte 0x5f
.endm
.macro incrementgamestat param0:req
.macro incrementgamestat stat:req
.byte 0x60
.byte \param0
.byte \stat
.endm
.macro drawpartystatussummary battler:req
@@ -562,9 +569,9 @@
.byte \battler
.endm
.macro jumptocalledmove param0:req
.macro jumptocalledmove notChosenMove:req
.byte 0x63
.byte \param0
.byte \notChosenMove
.endm
.macro statusanimation battler:req
@@ -578,11 +585,11 @@
.4byte \status2
.endm
.macro chosenstatusanimation battler:req, param1:req, param2:req
.macro chosenstatusanimation battler:req, isStatus2:req, status:req
.byte 0x66
.byte \battler
.byte \param1
.4byte \param2
.byte \isStatus2
.4byte \status
.endm
.macro yesnobox
@@ -651,10 +658,10 @@
.byte 0x75
.endm
.macro various battler:req, param1:req
.macro various battler:req, id:req
.byte 0x76
.byte \battler
.byte \param1
.byte \id
.endm
.macro setprotectlike
@@ -674,9 +681,9 @@
.4byte \ptr
.endm
.macro tryhealhalfhealth param0:req, battler:req
.macro tryhealhalfhealth ptr:req, battler:req
.byte 0x7b
.4byte \param0
.4byte \ptr
.byte \battler
.endm
@@ -696,14 +703,14 @@
.byte 0x7f
.endm
.macro manipulatedamage param0:req
.macro manipulatedamage mode:req
.byte 0x80
.byte \param0
.byte \mode
.endm
.macro trysetrest param0:req
.macro trysetrest ptr:req
.byte 0x81
.4byte \param0
.4byte \ptr
.endm
.macro jumpifnotfirstturn ptr:req
@@ -715,23 +722,23 @@
.byte 0x83
.endm
.macro jumpifcantmakeasleep param0:req
.macro jumpifcantmakeasleep ptr:req
.byte 0x84
.4byte \param0
.4byte \ptr
.endm
.macro stockpile
.byte 0x85
.endm
.macro stockpiletobasedamage param0:req
.macro stockpiletobasedamage ptr:req
.byte 0x86
.4byte \param0
.4byte \ptr
.endm
.macro stockpiletohpheal param0:req
.macro stockpiletohpheal ptr:req
.byte 0x87
.4byte \param0
.4byte \ptr
.endm
.macro negativedamage
@@ -756,23 +763,23 @@
.byte 0x8c
.endm
.macro setmultihitcounter param0:req
.macro setmultihitcounter val:req
.byte 0x8d
.byte \param0
.byte \val
.endm
.macro initmultihitstring
.byte 0x8e
.endm
.macro forcerandomswitch param0:req
.macro forcerandomswitch ptr:req
.byte 0x8f
.4byte \param0
.4byte \ptr
.endm
.macro tryconversiontypechange param0:req
.macro tryconversiontypechange ptr:req
.byte 0x90
.4byte \param0
.4byte \ptr
.endm
.macro givepaydaymoney
@@ -783,9 +790,9 @@
.byte 0x92
.endm
.macro tryKO param0:req
.macro tryKO ptr:req
.byte 0x93
.4byte \param0
.4byte \ptr
.endm
.macro damagetohalftargethp
@@ -800,9 +807,9 @@
.byte 0x96
.endm
.macro tryinfatuating param0:req
.macro tryinfatuating ptr:req
.byte 0x97
.4byte \param0
.4byte \ptr
.endm
.macro updatestatusicon battler:req
@@ -826,9 +833,9 @@
.byte 0x9c
.endm
.macro mimicattackcopy param0:req
.macro mimicattackcopy ptr:req
.byte 0x9d
.4byte \param0
.4byte \ptr
.endm
.macro metronome
@@ -843,48 +850,48 @@
.byte 0xa0
.endm
.macro counterdamagecalculator param0:req
.macro counterdamagecalculator ptr:req
.byte 0xa1
.4byte \param0
.4byte \ptr
.endm
.macro mirrorcoatdamagecalculator param0:req
.macro mirrorcoatdamagecalculator ptr:req
.byte 0xa2
.4byte \param0
.4byte \ptr
.endm
.macro disablelastusedattack param0:req
.macro disablelastusedattack ptr:req
.byte 0xa3
.4byte \param0
.4byte \ptr
.endm
.macro trysetencore param0:req
.macro trysetencore ptr:req
.byte 0xa4
.4byte \param0
.4byte \ptr
.endm
.macro painsplitdmgcalc param0:req
.macro painsplitdmgcalc ptr:req
.byte 0xa5
.4byte \param0
.4byte \ptr
.endm
.macro settypetorandomresistance param0:req
.macro settypetorandomresistance ptr:req
.byte 0xa6
.4byte \param0
.4byte \ptr
.endm
.macro setalwayshitflag
.byte 0xa7
.endm
.macro copymovepermanently param0:req
.macro copymovepermanently ptr:req
.byte 0xa8
.4byte \param0
.4byte \ptr
.endm
.macro trychoosesleeptalkmove param0:req
.macro trychoosesleeptalkmove ptr:req
.byte 0xa9
.4byte \param0
.4byte \ptr
.endm
.macro setdestinybond
@@ -899,32 +906,32 @@
.byte 0xac
.endm
.macro tryspiteppreduce param0:req
.macro tryspiteppreduce ptr:req
.byte 0xad
.4byte \param0
.4byte \ptr
.endm
.macro healpartystatus
.byte 0xae
.endm
.macro cursetarget param0:req
.macro cursetarget ptr:req
.byte 0xaf
.4byte \param0
.4byte \ptr
.endm
.macro trysetspikes param0:req
.macro trysetspikes ptr:req
.byte 0xb0
.4byte \param0
.4byte \ptr
.endm
.macro setforesight
.byte 0xb1
.endm
.macro trysetperishsong param0:req
.macro trysetperishsong ptr:req
.byte 0xb2
.4byte \param0
.4byte \ptr
.endm
.macro rolloutdamagecalculation
@@ -957,23 +964,23 @@
.byte 0xb9
.endm
.macro jumpifnopursuitswitchdmg param0:req
.macro jumpifnopursuitswitchdmg ptr:req
.byte 0xba
.4byte \param0
.4byte \ptr
.endm
.macro setsunny
.byte 0xbb
.endm
.macro maxattackhalvehp param0:req
.macro maxattackhalvehp ptr:req
.byte 0xbc
.4byte \param0
.4byte \ptr
.endm
.macro copyfoestats param0:req
.macro copyfoestats ptr:req
.byte 0xbd
.4byte \param0
.4byte \ptr
.endm
.macro rapidspinfree
@@ -984,9 +991,9 @@
.byte 0xbf
.endm
.macro recoverbasedonsunlight param0:req
.macro recoverbasedonsunlight ptr:req
.byte 0xc0
.4byte \param0
.4byte \ptr
.endm
.macro hiddenpowercalc
@@ -997,15 +1004,15 @@
.byte 0xc2
.endm
.macro trysetfutureattack param0:req
.macro trysetfutureattack ptr:req
.byte 0xc3
.4byte \param0
.4byte \ptr
.endm
.macro trydobeatup param0:req, param1:req
.macro trydobeatup endPtr:req, failPtr:req
.byte 0xc4
.4byte \param0
.4byte \param1
.4byte \endPtr
.4byte \failPtr
.endm
.macro setsemiinvulnerablebit
@@ -1041,107 +1048,107 @@
.byte 0xcc
.endm
.macro cureifburnedparalysedorpoisoned param0:req
.macro cureifburnedparalysedorpoisoned ptr:req
.byte 0xcd
.4byte \param0
.4byte \ptr
.endm
.macro settorment param0:req
.macro settorment ptr:req
.byte 0xce
.4byte \param0
.4byte \ptr
.endm
.macro jumpifnodamage param0:req
.macro jumpifnodamage ptr:req
.byte 0xcf
.4byte \param0
.4byte \ptr
.endm
.macro settaunt param0:req
.macro settaunt ptr:req
.byte 0xd0
.4byte \param0
.4byte \ptr
.endm
.macro trysethelpinghand param0:req
.macro trysethelpinghand ptr:req
.byte 0xd1
.4byte \param0
.4byte \ptr
.endm
.macro tryswapitems param0:req
.macro tryswapitems ptr:req
.byte 0xd2
.4byte \param0
.4byte \ptr
.endm
.macro trycopyability param0:req
.macro trycopyability ptr:req
.byte 0xd3
.4byte \param0
.4byte \ptr
.endm
.macro trywish param0:req, param1:req
.macro trywish turnNumber:req, ptr:req
.byte 0xd4
.byte \param0
.4byte \param1
.byte \turnNumber
.4byte \ptr
.endm
.macro trysetroots param0:req
.macro trysetroots ptr:req
.byte 0xd5
.4byte \param0
.4byte \ptr
.endm
.macro doubledamagedealtifdamaged
.byte 0xd6
.endm
.macro setyawn param0:req
.macro setyawn ptr:req
.byte 0xd7
.4byte \param0
.4byte \ptr
.endm
.macro setdamagetohealthdifference param0:req
.macro setdamagetohealthdifference ptr:req
.byte 0xd8
.4byte \param0
.4byte \ptr
.endm
.macro scaledamagebyhealthratio
.byte 0xd9
.endm
.macro tryswapabilities param0:req
.macro tryswapabilities ptr:req
.byte 0xda
.4byte \param0
.4byte \ptr
.endm
.macro tryimprison param0:req
.macro tryimprison ptr:req
.byte 0xdb
.4byte \param0
.4byte \ptr
.endm
.macro trysetgrudge param0:req
.macro trysetgrudge ptr:req
.byte 0xdc
.4byte \param0
.4byte \ptr
.endm
.macro weightdamagecalculation
.byte 0xdd
.endm
.macro assistattackselect param0:req
.macro assistattackselect ptr:req
.byte 0xde
.4byte \param0
.4byte \ptr
.endm
.macro trysetmagiccoat param0:req
.macro trysetmagiccoat ptr:req
.byte 0xdf
.4byte \param0
.4byte \ptr
.endm
.macro trysetsnatch param0:req
.macro trysetsnatch ptr:req
.byte 0xe0
.4byte \param0
.4byte \ptr
.endm
.macro trygetintimidatetarget param0:req
.macro trygetintimidatetarget ptr:req
.byte 0xe1
.4byte \param0
.4byte \ptr
.endm
.macro switchoutabilities battler:req
@@ -1149,10 +1156,10 @@
.byte \battler
.endm
.macro jumpifhasnohp battler:req, param1:req
.macro jumpifhasnohp battler:req, ptr:req
.byte 0xe3
.byte \battler
.4byte \param1
.4byte \ptr
.endm
.macro getsecretpowereffect
@@ -1171,28 +1178,28 @@
.byte 0xe7
.endm
.macro settypebasedhalvers param0:req
.macro settypebasedhalvers ptr:req
.byte 0xe8
.4byte \param0
.4byte \ptr
.endm
.macro setweatherballtype
.byte 0xe9
.endm
.macro tryrecycleitem param0:req
.macro tryrecycleitem ptr:req
.byte 0xea
.4byte \param0
.4byte \ptr
.endm
.macro settypetoterrain param0:req
.macro settypetoterrain ptr:req
.byte 0xeb
.4byte \param0
.4byte \ptr
.endm
.macro pursuitrelated param0:req
.macro pursuitdoubles ptr:req
.byte 0xec
.4byte \param0
.4byte \ptr
.endm
.macro snatchsetbattlers
@@ -1211,18 +1218,18 @@
.byte 0xf0
.endm
.macro trysetcaughtmondexflags param0:req
.macro trysetcaughtmondexflags ptr:req
.byte 0xf1
.4byte \param0
.4byte \ptr
.endm
.macro displaydexinfo
.byte 0xf2
.endm
.macro trygivecaughtmonnick param0:req
.macro trygivecaughtmonnick ptr:req
.byte 0xf3
.4byte \param0
.4byte \ptr
.endm
.macro subattackerhpbydmg
@@ -1241,9 +1248,9 @@
.byte 0xf7
.endm
.macro trainerslideout param0:req
.macro trainerslideout position:req
.byte 0xf8
.byte \param0
.byte \position
.endm
@ various command changed to more readable macros
@@ -1275,8 +1282,8 @@
various \battler, VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP
.endm
.macro various7 battler:req
various \battler, 7
.macro resetplayerfainted
various BS_ATTACKER, VARIOUS_RESET_PLAYER_FAINTED
.endm
.macro palaceflavortext battler:req
@@ -1303,12 +1310,12 @@
various \battler, VARIOUS_EMIT_YESNOBOX
.endm
.macro various14 battler:req
various \battler, 14
.macro arenadrawreftextbox
various BS_ATTACKER, VARIOUS_DRAW_ARENA_REF_TEXT_BOX
.endm
.macro various15 battler:req
various \battler, 15
.macro arenaerasereftextbox
various BS_ATTACKER, VARIOUS_ERASE_ARENA_REF_TEXT_BOX
.endm
.macro arenajudgmentstring id:req
@@ -1340,11 +1347,11 @@
.endm
.macro setalreadystatusedmoveattempt battler:req
various \battler, 23
various \battler, VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT
.endm
.macro various24 battler:req
various \battler, 24
.macro palacetryescapestatus battler:req
various \battler, VARIOUS_PALACE_TRY_ESCAPE_STATUS
.endm
.macro setoutcomeonteleport battler:req
@@ -1357,11 +1364,11 @@
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7
setbyte sSTATCHANGER, \stat | \stages << 4 | \down << 7
.endm
.macro setmoveeffect effect:req
setbyte cEFFECT_CHOOSER \effect
setbyte cEFFECT_CHOOSER, \effect
.endm
.macro chosenstatus1animation battler:req, status:req
@@ -1413,11 +1420,11 @@
.endm
.macro jumpifstatus3 battler:req, status:req, jumpptr:req
jumpifstatus3condition \battler, \status, 0x0, \jumpptr
jumpifstatus3condition \battler, \status, FALSE, \jumpptr
.endm
.macro jumpifnostatus3 battler:req, status:req, jumpptr:req
jumpifstatus3condition \battler, \status, 0x1, \jumpptr
jumpifstatus3condition \battler, \status, TRUE, \jumpptr
.endm
.macro jumpifmovehadnoeffect jumpptr:req

View File

@@ -26,7 +26,7 @@
special CallVerdanturfTentFunction
.endm
@ Buffers the opponents intro speech to STR_VAR_4. Despite being a Verdanturf Tent function, it serves the same purpose for all 3 tents.
@ Buffers the opponents intro speech to STR_VAR_4. Despite being a Verdanturf Tent function, it serves the same purpose for all 3 tents.
.macro battletent_getopponentintro
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO
special CallVerdanturfTentFunction
@@ -36,7 +36,7 @@
.macro verdanturftent_save challengeStatus:req
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SAVE
setvar VAR_0x8005, \challengeStatus
special CallVerdanturfTentFunction
special CallVerdanturfTentFunction
.endm
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
@@ -49,7 +49,7 @@
.macro verdanturftent_giveprize
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GIVE_PRIZE
special CallVerdanturfTentFunction
.endm
.endm
@ Fallarbor Tent
@@ -79,7 +79,7 @@
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SAVE
setvar VAR_0x8005, \challengeStatus
special CallFallarborTentFunction
.endm
.endm
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
.macro fallarbortent_setrandomprize
@@ -97,7 +97,7 @@
.macro fallarbortent_getopponentname
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME
special CallFallarborTentFunction
.endm
.endm
@ Slateport Tent
@@ -127,15 +127,15 @@
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SAVE
setvar VAR_0x8005, \challengeStatus
special CallSlateportTentFunction
.endm
.endm
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
.macro slateporttent_setrandomprize
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE
special CallSlateportTentFunction
.endm
@ Give the current prize item. FALSE if no room for prize
@ Give the current prize item. FALSE if no room for prize
.macro slateporttent_giveprize
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GIVE_PRIZE
special CallSlateportTentFunction
@@ -157,7 +157,7 @@
.macro slateporttent_generateopponentmons
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS
special CallSlateportTentFunction
.endm
.endm
@ Slateport Tent's version of factory_generaterentalmons
.macro slateporttent_generaterentalmons

View File

@@ -274,8 +274,8 @@
.2byte \functionId
.endm
@ Blocks script execution until a command or ASM code manually unblocks it. Generally used with specific
@ commands and specials. If this command runs, and a subsequent command or piece of ASM does not unblock
@ Blocks script execution until a command or ASM code manually unblocks it. Generally used with specific
@ commands and specials. If this command runs, and a subsequent command or piece of ASM does not unblock
@ state, the script will remain blocked indefinitely (essentially a hang).
.macro waitstate
.byte 0x27
@@ -317,7 +317,7 @@
.byte 0x2d
.endm
@ Sets the values of variables 0x8000, 0x8001, and 0x8002 to the current hour, minute, and second. In FRLG,
@ Sets the values of variables 0x8000, 0x8001, and 0x8002 to the current hour, minute, and second. In FRLG,
@ this command sets those variables to zero.
.macro gettime
.byte 0x2e
@@ -382,7 +382,7 @@
.byte \speed
.endm
@ Sends the player to Warp warp on Map bank.map. If the specified warp is 0xFF,
@ Sends the player to Warp warp on Map bank.map. If the specified warp is 0xFF,
@ then the player will instead be sent to (X, Y) on the map.
.macro warp map:req, warp:req, X:req, Y:req
.byte 0x39
@@ -434,7 +434,7 @@
.2byte \Y
.endm
@ Sets the warp destination that a warp to Warp 127 on Map 127.127 will connect to.
@ Sets the warp destination that a warp to Warp 127 on Map 127.127 will connect to.
@ Useful when a map has warps that need to go to script-controlled locations (i.e. elevators).
.macro setdynamicwarp map:req, warp:req, X:req, Y:req
.byte 0x3f
@@ -474,7 +474,7 @@
.byte 0x43
.endm
@ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and
@ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and
@ VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE.
.macro additem index:req, quantity=1
.byte 0x44
@@ -489,7 +489,7 @@
.2byte \quantity
.endm
@ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets VAR_RESULT to
@ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets VAR_RESULT to
@ TRUE if there is room, or FALSE is there is no room.
.macro checkitemspace index:req, quantity:req
.byte 0x46
@@ -505,7 +505,7 @@
.2byte \quantity
.endm
@ Checks which Bag pocket the specified item belongs in, and writes the pocket value (POCKET_*) to VAR_RESULT.
@ Checks which Bag pocket the specified item belongs in, and writes the pocket value (POCKET_*) to VAR_RESULT.
@ This script is used to show the name of the proper Bag pocket when the player receives an item via callstd (simplified to giveitem in XSE).
.macro checkitemtype index:req
.byte 0x48
@@ -544,7 +544,7 @@
.2byte \decoration
.endm
@ Checks if the player has enough space in their PC to hold decoration. Sets VAR_RESULT to TRUE if there is room, or
@ Checks if the player has enough space in their PC to hold decoration. Sets VAR_RESULT to TRUE if there is room, or
@ FALSE is there is no room. In FireRed, this command is a nop. (The argument is read, but not used for anything.)
.macro checkdecorspace decoration:req
.byte 0x4e
@@ -567,9 +567,9 @@
.endif
.endm
@ Blocks script execution until the movements being applied to the specified (index) Object finish.
@ If the specified Object is 0x0000, then the command will block script execution until all Objects
@ affected by applymovement finish their movements. If the specified Object is not currently being
@ Blocks script execution until the movements being applied to the specified (index) Object finish.
@ If the specified Object is 0x0000, then the command will block script execution until all Objects
@ affected by applymovement finish their movements. If the specified Object is not currently being
@ manipulated with applymovement, then this command does nothing.
@ If no map is specified, then the current map is used.
.macro waitmovement index:req, map
@@ -583,8 +583,8 @@
.endif
.endm
@ Attempts to hide the specified (index) Object on the specified (map_group, map_num) map,
@ by setting its visibility flag if it has a valid one. If the Object does not have a valid
@ Attempts to hide the specified (index) Object on the specified (map_group, map_num) map,
@ by setting its visibility flag if it has a valid one. If the Object does not have a valid
@ visibility flag, this command does nothing.
@ If no map is specified, then the current map is used.
.macro removeobject index:req, map
@@ -598,7 +598,7 @@
.endif
.endm
@ Unsets the specified (index) Object's visibility flag on the specified (map_group, map_num) map if it has a valid one.
@ Unsets the specified (index) Object's visibility flag on the specified (map_group, map_num) map if it has a valid one.
@ If the Object does not have a valid visibility flag, this command does nothing.
@ If no map is specified, then the current map is used.
.macro addobject index:req, map
@@ -740,7 +740,7 @@
.endm
@ Starts a trainer battle using the battle information stored in RAM (usually by trainerbattle, which actually calls this
@ Starts a trainer battle using the battle information stored in RAM (usually by trainerbattle, which actually calls this
@ command behind-the-scenes), and blocks script execution until the battle finishes.
.macro trainerbattlebegin
.byte 0x5d
@@ -781,7 +781,7 @@
.2byte \y
.endm
@ Copies a live object event's xy position to its template, so that if the sprite goes off screen,
@ Copies a live object event's xy position to its template, so that if the sprite goes off screen,
@ it'll still be there when it comes back on screen.
.macro copyobjectxytoperm index:req
.byte 0x64
@@ -794,14 +794,14 @@
.byte \byte
.endm
@ If a standard message box (or its text) is being drawn on-screen, this command blocks script execution until the
@ If a standard message box (or its text) is being drawn on-screen, this command blocks script execution until the
@ box and its text have been fully drawn.
.macro waitmessage
.byte 0x66
.endm
@ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at
@ that offset will be loaded and used. If text is script bank 0, then the value of script bank 0 will be treated as
@ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at
@ that offset will be loaded and used. If text is script bank 0, then the value of script bank 0 will be treated as
@ a pointer to the text. (You can use loadpointer to place a string pointer in a script bank.)
.macro message text:req
.byte 0x67
@@ -846,7 +846,7 @@
.byte \y
.endm
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
@ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
@ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
.macro multichoice x:req, y:req, multichoiceId:req, ignoreBPress:req
@@ -859,7 +859,7 @@
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
@ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
@ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00.
@ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00.
@ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
.macro multichoicedefault x:req, y:req, multichoiceId:req, default:req, ignoreBPress:req
.byte 0x70
@@ -925,8 +925,8 @@
.byte \winnerId
.endm
@ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille
@ characters and needs to provide six extra starting characters that are skipped (in RS, these characters determined the
@ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille
@ characters and needs to provide six extra starting characters that are skipped (in RS, these characters determined the
@ box's size and position, but in Emerald these are calculated automatically).
.macro braillemessage text:req
.byte 0x78
@@ -996,7 +996,7 @@
.2byte \slot
.endm
@ Writes the name of the item at index item to the specified buffer. If the specified index is larger than
@ Writes the name of the item at index item to the specified buffer. If the specified index is larger than
@ the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead.
.macro bufferitemname out:req, item:req
.byte 0x80
@@ -1112,7 +1112,7 @@
.byte \check
.endm
@ If check is 0x00, this command will check if the player has money >= value; VAR_RESULT is set to TRUE if the player
@ If check is 0x00, this command will check if the player has money >= value; VAR_RESULT is set to TRUE if the player
@ has enough money, or FALSE if they do not.
.macro checkmoney value:req, check:req
.byte 0x92
@@ -1446,7 +1446,7 @@
.2byte \box
.endm
@ Sets the color of the text in standard message boxes. 0x00 produces blue (male) text, 0x01 produces red (female) text,
@ Sets the color of the text in standard message boxes. 0x00 produces blue (male) text, 0x01 produces red (female) text,
@ 0xFF resets the color to the default for the current OW's gender, and all other values produce black text.
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro textcolor color:req
@@ -1454,7 +1454,7 @@
.byte \color
.endm
@ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom
@ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom
@ of the screen when the Main Menu is opened.
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro loadhelp pointer:req
@@ -1643,7 +1643,7 @@
.macro goto_if_lt dest:req @ LESS THAN
goto_if 0, \dest
.endm
.endm
.macro goto_if_eq dest:req @ EQUAL
goto_if 1, \dest
@@ -1677,7 +1677,7 @@
.macro call_if_lt dest:req @ LESS THAN
call_if 0, \dest
.endm
.endm
.macro call_if_eq dest:req @ EQUAL
call_if 1, \dest

View File

@@ -6,17 +6,18 @@
// global.h from pokemon ruby
// IDE support
#if defined(__APPLE__) || defined(__CYGWIN__)
#define _(x) x
#define __(x) x
#define INCBIN(x) {0}
#define INCBIN_U8 INCBIN
#define INCBIN_U16 INCBIN
#define INCBIN_U32 INCBIN
#define INCBIN_S8 INCBIN
#define INCBIN_S16 INCBIN
#define INCBIN_S32 INCBIN
#endif
#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__INTELLISENSE__)
// We define these when using certain IDEs to fool preproc
#define _(x) (x)
#define __(x) (x)
#define INCBIN(...) {0}
#define INCBIN_U8 INCBIN
#define INCBIN_U16 INCBIN
#define INCBIN_U32 INCBIN
#define INCBIN_S8 INCBIN
#define INCBIN_S16 INCBIN
#define INCBIN_S32 INCBIN
#endif // IDE support
// Prevent cross-jump optimization.
#define BLOCK_CROSS_JUMP asm("");

View File

@@ -1 +1 @@
gUnneededFireRedVariable
gWindowTileAutoAllocEnabled

View File

@@ -1,2 +1,2 @@
gf_rfu_REQ_api
Rfu
gRfuAPIBuffer
gRfu

View File

@@ -622,7 +622,7 @@ Move_BODY_SLAM:
Move_SUPERSONIC:
loadspritegfx ANIM_TAG_GOLD_RING
monbg ANIM_ATK_PARTNER
monbgprio_2A ANIM_ATTACKER
splitbgprio_foes ANIM_ATTACKER
setalpha 12, 8
createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 2, 0, 8, 1
call SupersonicRing
@@ -659,7 +659,7 @@ ScreechRing:
Move_FLAME_WHEEL:
loadspritegfx ANIM_TAG_SMALL_EMBER
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 0
playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER
delay 2
@@ -702,7 +702,7 @@ Move_PIN_MISSILE:
loadspritegfx ANIM_TAG_NEEDLE
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER
createsprite gPinMissileSpriteTemplate, ANIM_ATTACKER, 2, 20, -8, -8, -8, 20, -32
@@ -731,7 +731,7 @@ Move_ICICLE_SPEAR:
loadspritegfx ANIM_TAG_ICICLE_SPEAR
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_ICY_WIND, SOUND_PAN_ATTACKER
createsprite gIcicleSpearSpriteTemplate, ANIM_ATTACKER, 2, 20, -8, -8, -8, 20, -32
@@ -817,7 +817,7 @@ Move_POISON_STING:
loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_POISON_BUBBLE
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER
createsprite gLinearStingerSpriteTemplate, ANIM_TARGET, 2, 20, 0, -8, 0, 20
@@ -836,7 +836,7 @@ Move_TWINEEDLE:
loadspritegfx ANIM_TAG_NEEDLE
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
loopsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER, 6, 2
createsprite gLinearStingerSpriteTemplate, ANIM_TARGET, 2, 10, -4, 0, -4, 20
@@ -1029,7 +1029,7 @@ Move_SONIC_BOOM:
loadspritegfx ANIM_TAG_AIR_WAVE
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
call SonicBoomProjectile
call SonicBoomProjectile
@@ -1300,7 +1300,7 @@ Move_SPIKE_CANNON:
loadspritegfx ANIM_TAG_NEEDLE
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -4, 0, 4, 6, 8, 4
waitforvisualfinish
@@ -1668,7 +1668,7 @@ Move_DEFENSE_CURL:
Move_PROTECT:
loadspritegfx ANIM_TAG_PROTECT
monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 16
createsprite gProtectSpriteTemplate, ANIM_ATTACKER, 2, 24, 0, 90
waitforvisualfinish
@@ -1882,7 +1882,7 @@ Move_PAY_DAY:
loadspritegfx ANIM_TAG_COIN
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER
createsprite gCoinThrowSpriteTemplate, ANIM_ATTACKER, 2, 20, 0, 0, 0, 1152
@@ -2190,7 +2190,7 @@ Move_BUBBLE_BEAM:
loadspritegfx ANIM_TAG_BUBBLE
loadspritegfx ANIM_TAG_SMALL_BUBBLES
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
delay 1
call BulbblebeamCreateBubbles
@@ -2234,7 +2234,7 @@ Move_ICY_WIND:
playsewithpan SE_M_ICY_WIND, 0
waitbgfadein
waitforvisualfinish
panse_1B SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
call IcyWindSwirlingSnowballs
delay 5
call IcyWindSwirlingSnowballs
@@ -2287,7 +2287,7 @@ Move_SMOKESCREEN:
Move_CONVERSION:
loadspritegfx ANIM_TAG_CONVERSION
monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 16, 0
delay 0
playsewithpan SE_M_SWIFT, SOUND_PAN_ATTACKER
@@ -2339,7 +2339,7 @@ Move_CONVERSION:
Move_CONVERSION_2:
loadspritegfx ANIM_TAG_CONVERSION
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
setalpha 0, 16
delay 0
playsewithpan SE_M_BARRIER, SOUND_PAN_TARGET
@@ -2551,7 +2551,7 @@ Move_SING:
monbg ANIM_DEF_PARTNER
createvisualtask AnimTask_MusicNotesRainbowBlend, 2
waitforvisualfinish
panse_1B SE_M_SING, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_SING, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
createsprite gWavyMusicNotesSpriteTemplate, ANIM_TARGET, 2, 7, 0, 12
delay 5
createsprite gWavyMusicNotesSpriteTemplate, ANIM_TARGET, 2, 6, 1, 12
@@ -2657,7 +2657,7 @@ DigSetUp:
loadspritegfx ANIM_TAG_DIRT_MOUND
createsprite gDirtMoundSpriteTemplate, ANIM_ATTACKER, 1, 0, 0, 180
createsprite gDirtMoundSpriteTemplate, ANIM_ATTACKER, 1, 0, 1, 180
monbg_22 ANIM_ATTACKER
monbg_static ANIM_ATTACKER
delay 1
createvisualtask AnimTask_DigDownMovement, 2, FALSE
delay 6
@@ -2667,7 +2667,7 @@ DigSetUp:
call DigThrowDirt
call DigThrowDirt
waitforvisualfinish
clearmonbg_23 ANIM_ATTACKER
clearmonbg_static ANIM_ATTACKER
delay 1
createvisualtask AnimTask_DigDownMovement, 2, TRUE
goto DigEnd
@@ -3156,7 +3156,7 @@ MachPunchAgainstPlayer:
Move_FORESIGHT:
loadspritegfx ANIM_TAG_MAGNIFYING_GLASS
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 16, 0
createsprite gForesightMagnifyingGlassSpriteTemplate, ANIM_TARGET, 2, ANIM_TARGET
delay 17
@@ -3236,7 +3236,7 @@ Move_ROLLOUT:
loadspritegfx ANIM_TAG_MUD_SAND
loadspritegfx ANIM_TAG_ROCKS
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_Rollout, 2
waitforvisualfinish
@@ -3460,7 +3460,7 @@ Move_HEAT_WAVE:
createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_FLYING_DIRT, 0, 6, 6, RGB_RED
createvisualtask AnimTask_LoadSandstormBackground, 5, TRUE
createvisualtask AnimTask_BlendBackground, 6, 6, RGB_RED
panse_1B SE_M_HEAT_WAVE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_HEAT_WAVE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
delay 4
createvisualtask AnimTask_MoveHeatWaveTargets, 5
delay 12
@@ -3514,15 +3514,15 @@ Move_MEMENTO:
delay 48
playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER
waitforvisualfinish
createvisualtask sub_8114470, 2
createvisualtask AnimTask_MementoHandleBg, 2
delay 12
setalpha 0, 16
delay 1
monbg_22 ANIM_TARGET
monbg_static ANIM_TARGET
createvisualtask AnimTask_MoveTargetMementoShadow, 5
playsewithpan SE_M_PSYBEAM, SOUND_PAN_TARGET
waitforvisualfinish
clearmonbg_23 ANIM_TARGET
clearmonbg_static ANIM_TARGET
delay 1
blendoff
delay 1
@@ -3654,7 +3654,7 @@ Move_SUPERPOWER:
loadspritegfx ANIM_TAG_METEOR
loadspritegfx ANIM_TAG_FLAT_ROCK
monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 12, 8
createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 2, ANIM_ATTACKER
playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER
@@ -3853,7 +3853,7 @@ Move_IMPRISON:
Move_GRUDGE:
loadspritegfx ANIM_TAG_PURPLE_FLAME
monbg ANIM_ATTACKER
monbgprio_29
splitbgprio_all
fadetobg BG_GHOST
playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER
waitbgfadein
@@ -3870,7 +3870,7 @@ Move_GRUDGE:
Move_CAMOUFLAGE:
monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 16, 0
createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 3, 0, 14
delay 16
@@ -3968,7 +3968,7 @@ Move_MIST_BALL:
Move_FEATHER_DANCE:
loadspritegfx ANIM_TAG_WHITE_FEATHER
monbg ANIM_DEF_PARTNER
monbgprio_29
splitbgprio_all
playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_TARGET
delay 0
createsprite gFallingFeatherSpriteTemplate, ANIM_TARGET, 0, 0, -16, 64, 2, 104, 11304, 32, 1
@@ -4232,7 +4232,7 @@ Move_GRASS_WHISTLE:
waitforvisualfinish
createvisualtask AnimTask_MusicNotesRainbowBlend, 2
waitforvisualfinish
panse_1B SE_M_GRASSWHISTLE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_GRASSWHISTLE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
createsprite gWavyMusicNotesSpriteTemplate, ANIM_TARGET, 2, 7, 1, 0
delay 5
createsprite gWavyMusicNotesSpriteTemplate, ANIM_TARGET, 2, 6, 1, 0
@@ -4464,7 +4464,7 @@ Move_WATER_SPORT:
delay 44
playsewithpan SE_M_SURF, SOUND_PAN_ATTACKER
delay 44
panse_1B SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
end
Move_CALM_MIND:
@@ -4518,7 +4518,7 @@ Move_LEAF_BLADE:
Move_DRAGON_DANCE:
loadspritegfx ANIM_TAG_HOLLOW_ORB
monbg ANIM_ATTACKER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
delay 1
createvisualtask AnimTask_DragonDanceWaver, 5
playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER
@@ -4924,7 +4924,7 @@ Move_SCRATCH:
Move_DRAGON_BREATH:
loadspritegfx ANIM_TAG_SMALL_EMBER
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
loopsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER, 7, 7
createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20
delay 2
@@ -4958,7 +4958,7 @@ Move_DRAGON_BREATH:
Move_ROAR:
loadspritegfx ANIM_TAG_NOISE_LINE
monbg ANIM_ATTACKER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 8, 8
createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, 2
createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 10, ANIM_ATTACKER, 1
@@ -5122,7 +5122,7 @@ Move_BUBBLE:
Move_SMOG:
loadspritegfx ANIM_TAG_PURPLE_GAS_CLOUD
monbg ANIM_DEF_PARTNER
monbgprio_29
splitbgprio_all
setalpha 12, 8
loopsewithpan SE_M_MIST, SOUND_PAN_TARGET, 17, 10
call SmogCloud
@@ -5185,7 +5185,7 @@ Move_FAINT_ATTACK:
Move_SAND_ATTACK:
loadspritegfx ANIM_TAG_MUD_SAND
monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 12, 8
playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_ATTACKER
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, -10, 0, 0, 3
@@ -5343,7 +5343,7 @@ Move_CLAMP:
Move_ICE_BEAM:
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
loadspritegfx ANIM_TAG_ICE_CRYSTALS
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK
@@ -5475,7 +5475,7 @@ SolarBeamAbsorbEffect:
return
SolarBeamUnleash:
call SetSolarbeamBg
panse_1B SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
createvisualtask AnimTask_CreateSmallSolarbeamOrbs, 5
createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 0
delay 4
@@ -5527,7 +5527,7 @@ BlizzardContinue:
createvisualtask AnimTask_StartSlidingBg, 5, -2304, 0, 1, -1
waitbgfadein
waitforvisualfinish
panse_1B SE_M_BLIZZARD, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_BLIZZARD, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
call BlizzardIceCrystals
call BlizzardIceCrystals
playsewithpan SE_M_BLIZZARD2, SOUND_PAN_TARGET
@@ -5573,7 +5573,7 @@ Move_POWDER_SNOW:
monbg ANIM_DEF_PARTNER
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 1, 0, 3, RGB_BLACK
waitforvisualfinish
panse_1B SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
call PowderSnowSnowballs
call PowderSnowSnowballs
playsewithpan SE_M_GUST2, SOUND_PAN_TARGET
@@ -5606,11 +5606,11 @@ Move_HYDRO_PUMP:
loadspritegfx ANIM_TAG_WATER_ORB
loadspritegfx ANIM_TAG_WATER_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 40, 1
delay 6
panse_1B SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
createvisualtask AnimTask_StartSinAnimTimer, 5, 100
call HydroPumpBeams
call HydroPumpBeams
@@ -5655,7 +5655,7 @@ Move_SIGNAL_BEAM:
loadspritegfx ANIM_TAG_DUCK
createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 25, 1
delay 6
panse_1B SE_M_BUBBLE_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0
panse SE_M_BUBBLE_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0
createvisualtask AnimTask_StartSinAnimTimer, 5, 100
call SignalBeamOrbs
call SignalBeamOrbs
@@ -5695,7 +5695,7 @@ Move_ABSORB:
loadspritegfx ANIM_TAG_BLUE_STAR
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
setalpha 12, 8
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB(13, 31, 12)
waitforvisualfinish
@@ -5748,7 +5748,7 @@ Move_MEGA_DRAIN:
loadspritegfx ANIM_TAG_BLUE_STAR
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
setalpha 12, 8
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 8, RGB(13, 31, 12)
waitforvisualfinish
@@ -5809,7 +5809,7 @@ Move_GIGA_DRAIN:
loadspritegfx ANIM_TAG_BLUE_STAR
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
setalpha 12, 8
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 12, RGB(13, 31, 12)
waitforvisualfinish
@@ -5880,7 +5880,7 @@ Move_LEECH_LIFE:
loadspritegfx ANIM_TAG_BLUE_STAR
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
setalpha 12, 8
delay 1
createsprite gLeechLifeNeedleSpriteTemplate, ANIM_ATTACKER, 2, -20, 15, 12
@@ -6032,7 +6032,7 @@ Move_BONEMERANG:
loadspritegfx ANIM_TAG_BONE
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_BONEMERANG, SOUND_PAN_ATTACKER
createsprite gBonemerangSpriteTemplate, ANIM_ATTACKER, 2
@@ -6052,7 +6052,7 @@ Move_BONE_CLUB:
loadspritegfx ANIM_TAG_BONE
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_BONEMERANG, SOUND_PAN_TARGET
createsprite gSpinningBoneSpriteTemplate, ANIM_ATTACKER, 2, -42, -25, 0, 0, 15
@@ -6146,7 +6146,7 @@ Move_GUST:
loadspritegfx ANIM_TAG_GUST
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_GUST, SOUND_PAN_TARGET
createsprite gEllipticalGustSpriteTemplate, ANIM_ATTACKER, 2, 0, -16
@@ -6164,7 +6164,7 @@ Move_WING_ATTACK:
loadspritegfx ANIM_TAG_GUST
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
loopsewithpan SE_M_WING_ATTACK, SOUND_PAN_ATTACKER, 20, 2
createvisualtask AnimTask_TranslateMonElliptical, 2, 0, 12, 4, 1, 4
@@ -6197,7 +6197,7 @@ Move_AEROBLAST:
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
call SetSkyBg
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
call AeroblastBeam
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 5, 0, 50, 1
@@ -6237,7 +6237,7 @@ Move_WATER_GUN:
loadspritegfx ANIM_TAG_SMALL_BUBBLES
loadspritegfx ANIM_TAG_WATER_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createsprite gWaterGunProjectileSpriteTemplate, ANIM_ATTACKER, 2, 20, 0, 0, 0, 40, -25
playsewithpan SE_M_BUBBLE, SOUND_PAN_ATTACKER
@@ -6297,19 +6297,19 @@ Move_CRABHAMMER:
Move_SURF:
createvisualtask AnimTask_CreateSurfWave, 2, FALSE
delay 24
panse_1B SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
waitforvisualfinish
end
Move_FLAMETHROWER:
loadspritegfx ANIM_TAG_SMALL_EMBER
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 46, 1
delay 6
createvisualtask AnimTask_StartSinAnimTimer, 5, 100
panse_1B SE_M_FLAMETHROWER, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_FLAMETHROWER, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
call FlamethrowerCreateFlames
call FlamethrowerCreateFlames
call FlamethrowerCreateFlames
@@ -6358,7 +6358,7 @@ Move_SANDSTORM:
Move_WHIRLPOOL:
loadspritegfx ANIM_TAG_WATER_ORB
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
delay 0
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(0, 13, 23)
@@ -6445,7 +6445,7 @@ Move_KARATE_CHOP:
loadspritegfx ANIM_TAG_HANDS_AND_FEET
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET
createsprite gKarateChopSpriteTemplate, ANIM_ATTACKER, 2, -16, 0, 0, 0, 10, 1, 3, 0
@@ -6722,7 +6722,7 @@ Move_SUNNY_DAY:
setalpha 13, 3
createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 1, 0, 6, RGB_WHITE
waitforvisualfinish
panse_26 SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0
panse_adjustnone SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0
call SunnyDayLightRay
call SunnyDayLightRay
call SunnyDayLightRay
@@ -6742,7 +6742,7 @@ SunnyDayLightRay:
Move_COTTON_SPORE:
loadspritegfx ANIM_TAG_SPORE
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
loopsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET, 18, 10
call CreateCottonSpores
call CreateCottonSpores
@@ -6988,7 +6988,7 @@ FireSpreadEffect:
Move_LEER:
loadspritegfx ANIM_TAG_LEER
monbg ANIM_ATTACKER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 8, 8
playsewithpan SE_M_LEER, SOUND_PAN_ATTACKER
createsprite gLeerSpriteTemplate, ANIM_ATTACKER, 2, 24, -12
@@ -7008,7 +7008,7 @@ Move_DREAM_EATER:
loadspritegfx ANIM_TAG_ORBS
loadspritegfx ANIM_TAG_BLUE_STAR
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER
call SetPsychicBackground
setalpha 8, 8
@@ -7076,7 +7076,7 @@ Move_POISON_GAS:
loadspritegfx ANIM_TAG_POISON_BUBBLE
delay 0
monbg ANIM_DEF_PARTNER
monbgprio_29
splitbgprio_all
setalpha 12, 8
delay 0
playsewithpan SE_M_MIST, SOUND_PAN_ATTACKER
@@ -7221,7 +7221,7 @@ Move_STEEL_WING:
createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0
waitforvisualfinish
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
loopsewithpan SE_M_WING_ATTACK, SOUND_PAN_ATTACKER, 20, 2
createvisualtask AnimTask_TranslateMonElliptical, 2, 0, 12, 4, 1, 4
@@ -7304,7 +7304,7 @@ Move_METAL_CLAW:
Move_NIGHT_SHADE:
monbg ANIM_ATTACKER
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER
fadetobg BG_GHOST
waitbgfadein
@@ -7475,7 +7475,7 @@ Move_SPIDER_WEB:
delay 0
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 0, 9, RGB_BLACK
waitforvisualfinish
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
loopsewithpan SE_M_STRING_SHOT, SOUND_PAN_ATTACKER, 9, 6
call SpiderWebThread
call SpiderWebThread
@@ -7546,7 +7546,7 @@ RazorWindUnleash:
Move_DISABLE:
loadspritegfx ANIM_TAG_SPARKLE_4
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 8, 8
playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER
createsprite gSpinningSparkleSpriteTemplate, ANIM_ATTACKER, 13, 24, -16
@@ -7597,9 +7597,9 @@ RecoverAbsorbEffect:
Move_MIMIC:
loadspritegfx ANIM_TAG_ORBS
setalpha 11, 5
monbg_22 ANIM_DEF_PARTNER
monbgprio_29
panse_1B SE_M_MINIMIZE, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0
monbg_static ANIM_DEF_PARTNER
splitbgprio_all
panse SE_M_MINIMIZE, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0
createvisualtask AnimTask_ShrinkTargetCopy, 5, 128, 24
delay 15
createsprite gMimicOrbSpriteTemplate, ANIM_TARGET, 2, -12, 24
@@ -7609,7 +7609,7 @@ Move_MIMIC:
playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER
createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 11, RGB_WHITE
waitforvisualfinish
clearmonbg_23 ANIM_DEF_PARTNER
clearmonbg_static ANIM_DEF_PARTNER
blendoff
end
@@ -7943,7 +7943,7 @@ Move_PERISH_SONG:
createsprite gPerishSongMusicNoteSpriteTemplate, ANIM_ATTACKER, 4, 15, 0, 240
createsprite gPerishSongMusicNote2SpriteTemplate, ANIM_ATTACKER, 4, 15, 0, 0
delay 20
panse_1B SE_M_PERISH_SONG, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_PERISH_SONG, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
delay 80
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_BLACK
createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 4, 0
@@ -8070,7 +8070,7 @@ Move_WILL_O_WISP:
loadspritegfx ANIM_TAG_WISP_FIRE
loadspritegfx ANIM_TAG_WISP_ORB
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER
waitplaysewithpan SE_M_EMBER, SOUND_PAN_ATTACKER, 10
createvisualtask SoundTask_AdjustPanningVar, 2, SOUND_PAN_ATTACKER, SOUND_PAN_ATTACKER, 1, 0
@@ -8084,7 +8084,7 @@ Move_WILL_O_WISP:
delay 40
createvisualtask SoundTask_AdjustPanningVar, 2, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0
waitforvisualfinish
monbgprio_29
splitbgprio_all
playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 13, 1
createsprite gWillOWispFireSpriteTemplate, ANIM_ATTACKER, 2, 0
@@ -8150,7 +8150,7 @@ Move_WISH:
loadspritegfx ANIM_TAG_SPARKLE_2
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 10, RGB_BLACK
waitforvisualfinish
panse_27 SE_M_REFLECT, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0
panse_adjustall SE_M_REFLECT, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0
createsprite gWishStarSpriteTemplate, ANIM_ATTACKER, 40
waitforvisualfinish
delay 60
@@ -8552,7 +8552,7 @@ Move_SHEER_COLD:
waitbgfadein
loadspritegfx ANIM_TAG_ICE_CUBE
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_FrozenIceCube, 2
waitplaysewithpan SE_M_HAIL, SOUND_PAN_TARGET, 17
@@ -8566,7 +8566,7 @@ Move_SHEER_COLD:
Move_ARM_THRUST:
loadspritegfx ANIM_TAG_HANDS_AND_FEET
loadspritegfx ANIM_TAG_IMPACT
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_RotateMonSpriteToSide, 5, 8, 5, 0, 0
delay 6
@@ -8591,7 +8591,7 @@ ArmThrustLeft:
goto ArmThrustContinue
Move_MUDDY_WATER:
panse_1B SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
createvisualtask AnimTask_CreateSurfWave, 2, TRUE
waitforvisualfinish
end
@@ -8684,12 +8684,12 @@ DragonClawFireSpiral:
Move_MUD_SHOT:
loadspritegfx ANIM_TAG_BROWN_ORB
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 46, 1
delay 6
createvisualtask AnimTask_StartSinAnimTimer, 5, 100
panse_1B SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0
panse SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0
call MudShotOrbs
call MudShotOrbs
call MudShotOrbs
@@ -8717,7 +8717,7 @@ Move_METEOR_MASH:
loadspritegfx ANIM_TAG_GOLD_STARS
loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_HANDS_AND_FEET
panse_1B SE_M_BARRIER, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +3, 0
panse SE_M_BARRIER, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +3, 0
fadetobg BG_COSMIC
waitbgfadein
waitforvisualfinish
@@ -8789,7 +8789,7 @@ Move_FRENZY_PLANT:
loadspritegfx ANIM_TAG_ROOTS
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 2, 0, 5, RGB_BLACK
waitforvisualfinish
@@ -8848,7 +8848,7 @@ Move_FRENZY_PLANT:
Move_METAL_SOUND:
loadspritegfx ANIM_TAG_METAL_SOUND_WAVES
monbg ANIM_DEF_PARTNER
monbgprio_2A ANIM_TARGET
splitbgprio_foes ANIM_TARGET
createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 2, 0, 8, 1
call MetalSoundRings
call MetalSoundRings
@@ -8860,7 +8860,7 @@ Move_METAL_SOUND:
waitforvisualfinish
end
MetalSoundRings:
panse_1B SE_M_SCREECH, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_SCREECH, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
createsprite gMetalSoundSpriteTemplate, ANIM_TARGET, 2, 16, 0, 0, 0, 30, 0
delay 2
return
@@ -9154,11 +9154,11 @@ Move_ROCK_TOMB:
Move_SILVER_WIND:
loadspritegfx ANIM_TAG_SPARKLE_6
panse_1B SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
playsewithpan SE_M_MORNING_SUN, 0
delay 0
monbg ANIM_DEF_PARTNER
monbgprio_29
splitbgprio_all
delay 0
createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, ANIM_TARGET, 0, 0, 4, RGB_BLACK
createvisualtask AnimTask_GetTargetSide, 2
@@ -9368,7 +9368,7 @@ Move_HYDRO_CANNON:
delay 10
createvisualtask AnimTask_InvertScreenColor, 2, 257, 257, 257
delay 30
panse_1B SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
panse SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
call HydroCannonBeam
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 10, 0, 40, 1
createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, ANIM_TARGET, 0
@@ -9494,7 +9494,7 @@ Move_WATER_PULSE:
loadspritegfx ANIM_TAG_SMALL_BUBBLES
loadspritegfx ANIM_TAG_BLUE_RING_2
monbg ANIM_TARGET
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
playsewithpan SE_M_BUBBLE3, SOUND_PAN_ATTACKER
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 7, RGB(0, 25, 28)
delay 10
@@ -9531,7 +9531,7 @@ Move_PSYCHO_BOOST:
delay 6
createvisualtask AnimTask_BlendColorCycle, 2, 1, 2, 8, 0, 10, RGB_BLACK
delay 0
monbgprio_28 ANIM_ATTACKER
splitbgprio ANIM_ATTACKER
setalpha 8, 8
delay 10
createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 3, 0, 240, 0
@@ -9591,7 +9591,7 @@ Move_DOOM_DESIRE:
Move_SKY_UPPERCUT:
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
fadetobg BG_IN_AIR
waitbgfadeout
playsewithpan SE_M_SKY_UPPERCUT, SOUND_PAN_ATTACKER
@@ -9650,7 +9650,7 @@ Move_TWISTER:
loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_ROCKS
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
playsewithpan SE_M_TWISTER, SOUND_PAN_TARGET
createsprite gTwisterLeafSpriteTemplate, ANIM_TARGET, 2, 120, 70, 5, 70, 30
delay 1
@@ -10267,7 +10267,7 @@ Status_Freeze:
playsewithpan SE_M_ICY_WIND, 0
loadspritegfx ANIM_TAG_ICE_CUBE
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
waitplaysewithpan SE_M_HAIL, SOUND_PAN_TARGET, 17
createvisualtask AnimTask_FrozenIceCube, 2
waitforvisualfinish
@@ -10296,7 +10296,7 @@ Status_Nightmare:
General_CastformChange:
createvisualtask AnimTask_IsMonInvisible, 2
jumpreteq 1, CastformChangeSkipAnim
jumpreteq TRUE, CastformChangeSkipAnim
goto CastformChangeContinue
CastformChangeContinue:
monbg ANIM_ATTACKER
@@ -10384,7 +10384,7 @@ Status_FireSpin:
Status_Whirlpool:
loadspritegfx ANIM_TAG_WATER_ORB
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
splitbgprio ANIM_TARGET
setalpha 12, 8
delay 0
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(0, 13, 23)

View File

@@ -262,7 +262,7 @@ BattleScript_HitFromAtkAnimation::
resultmessage
waitmessage B_WAIT_TIME_LONG
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
BattleScript_MoveEnd::
moveendall
end
@@ -354,8 +354,8 @@ BattleScript_AbsorbUpdateHp::
printfromtable gAbsorbDrainStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_AbsorbTryFainting::
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_ATTACKER
tryfaintmon BS_TARGET
goto BattleScript_MoveEnd
BattleScript_EffectBurnHit::
@@ -399,10 +399,10 @@ BattleScript_ExplosionLoop:
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_ExplosionLoop
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
end
BattleScript_ExplosionMissed:
effectivenesssound
@@ -410,7 +410,7 @@ BattleScript_ExplosionMissed:
waitmessage B_WAIT_TIME_LONG
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_ExplosionLoop
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
end
BattleScript_PreserveMissedBitDoMoveAnim:
@@ -456,7 +456,7 @@ BattleScript_DreamEaterWorked:
printstring STRINGID_PKMNDREAMEATEN
waitmessage B_WAIT_TIME_LONG
BattleScript_DreamEaterTryFaintEnd:
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
goto BattleScript_MoveEnd
BattleScript_EffectMirrorMove::
@@ -647,7 +647,7 @@ BattleScript_MultiHitPrintStrings::
waitmessage B_WAIT_TIME_LONG
BattleScript_MultiHitEnd::
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
moveendcase MOVEEND_SYNCHRONIZE_TARGET
moveendfrom MOVEEND_IMMUNITY_ABILITIES
end
@@ -865,7 +865,7 @@ BattleScript_MoveMissedDoDamage::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
orbyte gMoveResultFlags, MOVE_RESULT_MISSED
goto BattleScript_MoveEnd
@@ -1431,7 +1431,7 @@ BattleScript_TripleKickPrintStrings::
waitmessage B_WAIT_TIME_LONG
BattleScript_TripleKickEnd::
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
moveendfrom MOVEEND_UPDATE_LAST_MOVES
end
@@ -1524,7 +1524,7 @@ BattleScript_DoGhostCurse::
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNLAIDCURSE
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_EffectProtect::
@@ -1862,7 +1862,7 @@ BattleScript_DoHitAllWithUndergroundBonus::
waitmessage B_WAIT_TIME_LONG
printstring STRINGID_EMPTYSTRING3
waitmessage 1
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop
end
@@ -1901,7 +1901,7 @@ BattleScript_EffectStomp::
BattleScript_EffectSolarbeam::
jumpifabilitypresent ABILITY_CLOUD_NINE, BattleScript_SolarbeamDecideTurn
jumpifabilitypresent ABILITY_AIR_LOCK, BattleScript_SolarbeamDecideTurn
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT, BattleScript_SolarbeamOnFirstTurn
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_SUN, BattleScript_SolarbeamOnFirstTurn
BattleScript_SolarbeamDecideTurn::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
@@ -1962,7 +1962,7 @@ BattleScript_BeatUpAttack::
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
moveendto MOVEEND_NEXT_TARGET
goto BattleScript_BeatUpLoop
BattleScript_BeatUpEnd::
@@ -2227,7 +2227,7 @@ BattleScript_EffectMementoTrySpAtk:
printfromtable gStatDownStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_EffectMementoTryFaint:
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_EffectMementoPrintNoEffect:
printstring STRINGID_BUTNOEFFECT
@@ -2243,7 +2243,7 @@ BattleScript_MementoFailEnd:
effectivenesssound
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_EffectFacade::
@@ -2442,7 +2442,7 @@ BattleScript_BrickBreakDoHit::
resultmessage
waitmessage B_WAIT_TIME_LONG
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
goto BattleScript_MoveEnd
BattleScript_EffectYawn::
@@ -2825,35 +2825,40 @@ BattleScript_GiveExp::
end2
BattleScript_HandleFaintedMon::
atk24 BattleScript_HandleFaintedMonMultiple
checkteamslost BattleScript_LinkHandleFaintedMonMultiple
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChooseAnother
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonTryChooseAnother
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChoose
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonTryChoose
@ Yes/No for sending out a new Pokémon if one is defeated in a wild battle
printstring STRINGID_USENEXTPKMN
setbyte gBattleCommunication, 0
yesnobox
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0, BattleScript_FaintedMonTryChooseAnother
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0, BattleScript_FaintedMonTryChoose
@ Player said no, try to run
jumpifplayerran BattleScript_FaintedMonEnd
printstring STRINGID_CANTESCAPE2
BattleScript_FaintedMonTryChooseAnother::
BattleScript_FaintedMonTryChoose::
openpartyscreen BS_FAINTED, BattleScript_FaintedMonEnd
switchhandleorder BS_FAINTED, 2
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother
jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonChooseAnother
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonSendOutNew
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonSendOutNew
jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonSendOutNew
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonSendOutNew
@ Yes/No for sending out a new Pokémon when the opponent is switching
printstring STRINGID_ENEMYABOUTTOSWITCHPKMN
setbyte gBattleCommunication, 0
yesnobox
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 1, BattleScript_FaintedMonChooseAnother
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 1, BattleScript_FaintedMonSendOutNew
@ Player said yes, go to party screen (note optional flag, player may exit the menu instead)
setatktoplayer0
openpartyscreen BS_ATTACKER | PARTY_SCREEN_OPTIONAL, BattleScript_FaintedMonChooseAnother
openpartyscreen BS_ATTACKER | PARTY_SCREEN_OPTIONAL, BattleScript_FaintedMonSendOutNew
switchhandleorder BS_ATTACKER, 2
jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonChooseAnother
jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonSendOutNew
@ Switch Pokémon before opponent
atknameinbuff1
resetintimidatetracebits BS_ATTACKER
hpthresholds2 BS_ATTACKER
@@ -2872,7 +2877,7 @@ BattleScript_FaintedMonTryChooseAnother::
waitstate
switchineffects BS_ATTACKER
resetsentmonsvalue
BattleScript_FaintedMonChooseAnother::
BattleScript_FaintedMonSendOutNew::
drawpartystatussummary BS_FAINTED
getswitchedmondata BS_FAINTED
switchindataupdate BS_FAINTED
@@ -2881,20 +2886,20 @@ BattleScript_FaintedMonChooseAnother::
hidepartystatussummary BS_FAINTED
switchinanim BS_FAINTED, FALSE
waitstate
various7 BS_ATTACKER
resetplayerfainted
switchineffects BS_FAINTED
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonEnd
cancelallactions
BattleScript_FaintedMonEnd::
end2
BattleScript_HandleFaintedMonMultiple::
openpartyscreen BS_UNK_5, BattleScript_HandleFaintedMonMultipleStart
BattleScript_HandleFaintedMonMultipleStart::
BattleScript_LinkHandleFaintedMonMultiple::
openpartyscreen BS_FAINTED_LINK_MULTIPLE_1, BattleScript_LinkHandleFaintedMonMultipleStart
BattleScript_LinkHandleFaintedMonMultipleStart::
switchhandleorder BS_FAINTED, 0
openpartyscreen BS_UNK_6, BattleScript_HandleFaintedMonMultipleEnd
openpartyscreen BS_FAINTED_LINK_MULTIPLE_2, BattleScript_LinkHandleFaintedMonMultipleEnd
switchhandleorder BS_FAINTED, 0
BattleScript_HandleFaintedMonLoop::
BattleScript_LinkHandleFaintedMonLoop::
switchhandleorder BS_FAINTED, 3
drawpartystatussummary BS_FAINTED
getswitchedmondata BS_FAINTED
@@ -2904,9 +2909,9 @@ BattleScript_HandleFaintedMonLoop::
hidepartystatussummary BS_FAINTED
switchinanim BS_FAINTED, FALSE
waitstate
switchineffects 5
jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_HandleFaintedMonLoop
BattleScript_HandleFaintedMonMultipleEnd::
switchineffects BS_FAINTED_LINK_MULTIPLE_1
jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_LinkHandleFaintedMonLoop
BattleScript_LinkHandleFaintedMonMultipleEnd::
end2
BattleScript_LocalTrainerBattleWon::
@@ -3040,7 +3045,7 @@ BattleScript_FrontierTrainerBattleWon_End:
end2
BattleScript_SmokeBallEscape::
playanimation BS_ATTACKER, B_ANIM_SMOKEBALL_ESCAPE, NULL
playanimation BS_ATTACKER, B_ANIM_SMOKEBALL_ESCAPE
printstring STRINGID_PKMNFLEDUSINGITS
waitmessage B_WAIT_TIME_LONG
end2
@@ -3131,7 +3136,7 @@ BattleScript_PursuitDmgOnSwitchOut::
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE
getbattlerfainted BS_TARGET
jumpifbyte CMP_EQUAL, gBattleCommunication, FALSE, BattleScript_PursuitDmgOnSwitchOutRet
@@ -3185,14 +3190,14 @@ BattleScript_RainContinuesOrEnds::
printfromtable gRainContinuesStringIds
waitmessage B_WAIT_TIME_LONG
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd
playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES, NULL
playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES
BattleScript_RainContinuesOrEndsEnd::
end2
BattleScript_DamagingWeatherContinues::
printfromtable gSandStormHailContinuesStringIds
waitmessage B_WAIT_TIME_LONG
playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL
playanimation_var BS_ATTACKER, sB_ANIM_ARG1
setbyte gBattleCommunication, 0
BattleScript_DamagingWeatherLoop::
copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1
@@ -3200,19 +3205,19 @@ BattleScript_DamagingWeatherLoop::
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
printfromtable gSandStormHailDmgStringIds
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
effectivenesssound
hitanimation BS_ATTACKER
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
atk24 BattleScript_DamagingWeatherLoopIncrement
tryfaintmon BS_ATTACKER
checkteamslost BattleScript_DamagingWeatherLoopIncrement
BattleScript_DamagingWeatherLoopIncrement::
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_DamagingWeatherContinuesEnd
addbyte gBattleCommunication, 1
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
BattleScript_DamagingWeatherContinuesEnd::
bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
end2
BattleScript_SandStormHailEnds::
@@ -3223,7 +3228,7 @@ BattleScript_SandStormHailEnds::
BattleScript_SunlightContinues::
printstring STRINGID_SUNLIGHTSTRONG
waitmessage B_WAIT_TIME_LONG
playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES, NULL
playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES
end2
BattleScript_SunlightFaded::
@@ -3234,7 +3239,7 @@ BattleScript_SunlightFaded::
BattleScript_OverworldWeatherStarts::
printfromtable gWeatherStartsStringIds
waitmessage B_WAIT_TIME_LONG
playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL
playanimation_var BS_ATTACKER, sB_ANIM_ARG1
end3
BattleScript_SideStatusWoreOff::
@@ -3256,7 +3261,7 @@ BattleScript_SafeguardEnds::
BattleScript_LeechSeedTurnDrain::
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
copyword gBattleMoveDamage, gHpDealt
@@ -3267,13 +3272,13 @@ BattleScript_LeechSeedTurnDrain::
BattleScript_LeechSeedTurnPrintLiquidOoze::
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
BattleScript_LeechSeedTurnPrintAndUpdateHp::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printfromtable gLeechSeedStringIds
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_ATTACKER
tryfaintmon BS_TARGET
end2
BattleScript_BideStoringEnergy::
@@ -3302,7 +3307,7 @@ BattleScript_BideAttack::
datahpupdate BS_TARGET
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET
goto BattleScript_MoveEnd
BattleScript_BideNoEnergyToAttack::
@@ -3371,19 +3376,19 @@ BattleScript_EncoredNoMore::
BattleScript_DestinyBondTakesLife::
printstring STRINGID_PKMNTOOKFOE
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
return
BattleScript_SpikesOnAttacker::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
call BattleScript_PrintHurtBySpikes
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER, TRUE, BattleScript_SpikesOnAttackerFainted
tryfaintmon BS_ATTACKER
tryfaintmon_spikes BS_ATTACKER, BattleScript_SpikesOnAttackerFainted
return
BattleScript_SpikesOnAttackerFainted::
@@ -3393,12 +3398,12 @@ BattleScript_SpikesOnAttackerFainted::
goto BattleScript_HandleFaintedMon
BattleScript_SpikesOnTarget::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
call BattleScript_PrintHurtBySpikes
tryfaintmon BS_TARGET, FALSE, NULL
tryfaintmon BS_TARGET, TRUE, BattleScript_SpikesOnTargetFainted
tryfaintmon BS_TARGET
tryfaintmon_spikes BS_TARGET, BattleScript_SpikesOnTargetFainted
return
BattleScript_SpikesOnTargetFainted::
@@ -3408,12 +3413,12 @@ BattleScript_SpikesOnTargetFainted::
goto BattleScript_HandleFaintedMon
BattleScript_SpikesOnFaintedBattler::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_FAINTED
datahpupdate BS_FAINTED
call BattleScript_PrintHurtBySpikes
tryfaintmon BS_FAINTED, FALSE, NULL
tryfaintmon BS_FAINTED, TRUE, BattleScript_SpikesOnFaintedBattlerFainted
tryfaintmon BS_FAINTED
tryfaintmon_spikes BS_FAINTED, BattleScript_SpikesOnFaintedBattlerFainted
return
BattleScript_SpikesOnFaintedBattlerFainted::
@@ -3430,10 +3435,10 @@ BattleScript_PrintHurtBySpikes::
BattleScript_PerishSongTakesLife::
printstring STRINGID_PKMNPERISHCOUNTFELL
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
end2
BattleScript_PerishSongCountGoesDown::
@@ -3508,10 +3513,10 @@ BattleScript_CheckDoomDesireMiss::
BattleScript_FutureAttackAnimate::
adjustnormaldamage2
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_FUTURE_SIGHT, BattleScript_FutureHitAnimDoomDesire
playanimation BS_ATTACKER, B_ANIM_FUTURE_SIGHT_HIT, NULL
playanimation BS_ATTACKER, B_ANIM_FUTURE_SIGHT_HIT
goto BattleScript_DoFutureAttackHit
BattleScript_FutureHitAnimDoomDesire::
playanimation BS_ATTACKER, B_ANIM_DOOM_DESIRE_HIT, NULL
playanimation BS_ATTACKER, B_ANIM_DOOM_DESIRE_HIT
BattleScript_DoFutureAttackHit::
effectivenesssound
hitanimation BS_TARGET
@@ -3520,8 +3525,8 @@ BattleScript_DoFutureAttackHit::
datahpupdate BS_TARGET
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
atk24 BattleScript_FutureAttackEnd
tryfaintmon BS_TARGET
checkteamslost BattleScript_FutureAttackEnd
BattleScript_FutureAttackEnd::
moveendcase MOVEEND_RAGE
moveendfromto MOVEEND_ITEM_EFFECTS_ALL, MOVEEND_UPDATE_LAST_MOVES
@@ -3580,7 +3585,7 @@ BattleScript_SelectingNotAllowedMoveTauntInPalace::
BattleScript_WishComesTrue::
trywish 1, BattleScript_WishButFullHp
playanimation BS_TARGET, B_ANIM_WISH_HEAL, NULL
playanimation BS_TARGET, B_ANIM_WISH_HEAL
printstring STRINGID_PKMNWISHCAMETRUE
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
@@ -3599,7 +3604,7 @@ BattleScript_WishButFullHp::
end2
BattleScript_IngrainTurnHeal::
playanimation BS_ATTACKER, B_ANIM_INGRAIN_HEAL, NULL
playanimation BS_ATTACKER, B_ANIM_INGRAIN_HEAL
printstring STRINGID_PKMNABSORBEDNUTRIENTS
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
@@ -3633,7 +3638,7 @@ BattleScript_AtkDefDown_End::
return
BattleScript_KnockedOff::
playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF, NULL
playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF
printstring STRINGID_PKMNKNOCKEDOFF
waitmessage B_WAIT_TIME_LONG
return
@@ -3662,7 +3667,7 @@ BattleScript_MagicCoatBounce::
pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNMOVEBOUNCED
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_ALLOW_NO_PP
setmagiccoattarget BS_ATTACKER
return
@@ -3670,10 +3675,10 @@ BattleScript_SnatchedMove::
attackstring
ppreduce
snatchsetbattlers
playanimation BS_TARGET, B_ANIM_SNATCH_MOVE, NULL
playanimation BS_TARGET, B_ANIM_SNATCH_MOVE
printstring STRINGID_PKMNSNATCHEDMOVE
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_ALLOW_NO_PP
swapattackerwithtarget
return
@@ -3701,7 +3706,7 @@ BattleScript_SAtkDown2End::
BattleScript_FocusPunchSetUp::
printstring STRINGID_EMPTYSTRING3
waitmessage 1
playanimation BS_ATTACKER, B_ANIM_FOCUS_PUNCH_SETUP, NULL
playanimation BS_ATTACKER, B_ANIM_FOCUS_PUNCH_SETUP
printstring STRINGID_PKMNTIGHTENINGFOCUS
waitmessage B_WAIT_TIME_LONG
end2
@@ -3713,7 +3718,7 @@ BattleScript_MoveUsedIsAsleep::
goto BattleScript_MoveEnd
BattleScript_MoveUsedWokeUp::
bicword gHitMarker, HITMARKER_x10
bicword gHitMarker, HITMARKER_WAKE_UP_CLEAR
printfromtable gWokeUpStringIds
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
@@ -3731,11 +3736,11 @@ BattleScript_PoisonTurnDmg::
BattleScript_DoStatusTurnDmg::
statusanimation BS_ATTACKER
BattleScript_DoTurnDmg::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
atk24 BattleScript_DoTurnDmgEnd
tryfaintmon BS_ATTACKER
checkteamslost BattleScript_DoTurnDmgEnd
BattleScript_DoTurnDmgEnd::
end2
@@ -3798,12 +3803,12 @@ BattleScript_DoSelfConfusionDmg::
effectivenesssound
hitanimation BS_ATTACKER
waitstate
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_MoveUsedIsConfusedRet::
return
@@ -3931,17 +3936,17 @@ BattleScript_MoveEffectRecoil::
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
BattleScript_DoRecoil::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHITWITHRECOIL
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
BattleScript_RecoilEnd::
return
BattleScript_ItemSteal::
playanimation BS_TARGET, B_ANIM_ITEM_STEAL, NULL
playanimation BS_TARGET, B_ANIM_ITEM_STEAL
printstring STRINGID_PKMNSTOLEITEM
waitmessage B_WAIT_TIME_LONG
return
@@ -3950,7 +3955,7 @@ BattleScript_DrizzleActivates::
pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNMADEITRAIN
waitstate
playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL
playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES
call BattleScript_WeatherFormChanges
end3
@@ -3978,7 +3983,7 @@ BattleScript_SandstreamActivates::
pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM
waitstate
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES
call BattleScript_WeatherFormChanges
end3
@@ -4043,7 +4048,7 @@ BattleScript_DroughtActivates::
pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXINTENSIFIEDSUN
waitstate
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES
call BattleScript_WeatherFormChanges
end3
@@ -4174,12 +4179,12 @@ BattleScript_ColorChangeActivates::
return
BattleScript_RoughSkinActivates::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHURTSWITH
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_ATTACKER
return
BattleScript_CuteCharmActivates::
@@ -4222,9 +4227,10 @@ BattleScript_IgnoresAndUsesRandomMove::
jumptocalledmove FALSE
BattleScript_MoveUsedLoafingAround::
@ Skip ahead if not the Battle Palace message
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER, BattleScript_MoveUsedLoafingAroundMsg
setbyte gBattleCommunication, 0
various24 BS_ATTACKER
palacetryescapestatus BS_ATTACKER
setbyte cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER
BattleScript_MoveUsedLoafingAroundMsg::
printfromtable gInobedientStringIds
@@ -4246,7 +4252,7 @@ BattleScript_IgnoresAndHitsItself::
goto BattleScript_DoSelfConfusionDmg
BattleScript_SubstituteFade::
playanimation BS_TARGET, B_ANIM_SUBSTITUTE_FADE, NULL
playanimation BS_TARGET, B_ANIM_SUBSTITUTE_FADE
printstring STRINGID_PKMNSUBSTITUTEFADED
return
@@ -4255,7 +4261,7 @@ BattleScript_BerryCurePrlzEnd2::
end2
BattleScript_BerryCureParRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMCUREDPARALYSIS
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
@@ -4267,7 +4273,7 @@ BattleScript_BerryCurePsnEnd2::
end2
BattleScript_BerryCurePsnRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMCUREDPOISON
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
@@ -4279,7 +4285,7 @@ BattleScript_BerryCureBrnEnd2::
end2
BattleScript_BerryCureBrnRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMHEALEDBURN
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
@@ -4291,7 +4297,7 @@ BattleScript_BerryCureFrzEnd2::
end2
BattleScript_BerryCureFrzRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMDEFROSTEDIT
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
@@ -4303,7 +4309,7 @@ BattleScript_BerryCureSlpEnd2::
end2
BattleScript_BerryCureSlpRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMWOKEIT
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
@@ -4315,7 +4321,7 @@ BattleScript_BerryCureConfusionEnd2::
end2
BattleScript_BerryCureConfusionRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMSNAPPEDOUT
waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
@@ -4326,7 +4332,7 @@ BattleScript_BerryCureChosenStatusEnd2::
end2
BattleScript_BerryCureChosenStatusRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printfromtable gBerryEffectStringIds
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
@@ -4338,14 +4344,14 @@ BattleScript_WhiteHerbEnd2::
end2
BattleScript_WhiteHerbRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMRESTOREDSTATUS
waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
return
BattleScript_ItemHealHP_RemoveItem::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
@@ -4355,7 +4361,7 @@ BattleScript_ItemHealHP_RemoveItem::
end2
BattleScript_BerryPPHealEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMRESTOREDPP
waitmessage B_WAIT_TIME_LONG
removeitem BS_ATTACKER
@@ -4366,7 +4372,7 @@ BattleScript_ItemHealHP_End2::
end2
BattleScript_ItemHealHP_Ret::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
@@ -4379,13 +4385,13 @@ BattleScript_SelectingNotAllowedMoveChoiceItem::
endselectionscript
BattleScript_FocusBandActivates::
playanimation BS_TARGET, B_ANIM_FOCUS_BAND, NULL
playanimation BS_TARGET, B_ANIM_FOCUS_BAND
printstring STRINGID_PKMNHUNGONWITHX
waitmessage B_WAIT_TIME_LONG
return
BattleScript_BerryConfuseHealEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
@@ -4399,7 +4405,7 @@ BattleScript_BerryConfuseHealEnd2::
end2
BattleScript_BerryStatRaiseEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BerryStatRaiseDoStatUp
BattleScript_BerryStatRaiseDoStatUp::
setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM
@@ -4408,7 +4414,7 @@ BattleScript_BerryStatRaiseDoStatUp::
end2
BattleScript_BerryFocusEnergyEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
printstring STRINGID_PKMNUSEDXTOGETPUMPED
waitmessage B_WAIT_TIME_LONG
removeitem BS_ATTACKER
@@ -4442,22 +4448,22 @@ BattleScript_ArenaTurnBeginning::
playse SE_ARENA_TIMEUP1
pause 8
playse SE_ARENA_TIMEUP1
various14 BS_ATTACKER
arenadrawreftextbox
arenajudgmentstring B_MSG_REF_COMMENCE_BATTLE
arenawaitmessage B_MSG_REF_COMMENCE_BATTLE
pause B_WAIT_TIME_LONG
various15 BS_ATTACKER
arenaerasereftextbox
volumeup
end2
@ Unused
BattleScript_ArenaNothingDecided::
playse SE_DING_DONG
various14 BS_ATTACKER
arenadrawreftextbox
arenajudgmentstring B_MSG_REF_NOTHING_IS_DECIDED
arenawaitmessage B_MSG_REF_NOTHING_IS_DECIDED
pause B_WAIT_TIME_LONG
various15 BS_ATTACKER
arenaerasereftextbox
end2
BattleScript_ArenaDoJudgment::
@@ -4470,7 +4476,7 @@ BattleScript_ArenaDoJudgment::
pause 8
playse SE_ARENA_TIMEUP1
pause B_WAIT_TIME_LONG
various14 BS_ATTACKER
arenadrawreftextbox
arenajudgmentstring B_MSG_REF_THATS_IT
arenawaitmessage B_MSG_REF_THATS_IT
pause B_WAIT_TIME_LONG
@@ -4492,7 +4498,7 @@ BattleScript_ArenaDoJudgment::
arenajudgmentstring B_MSG_REF_PLAYER_WON
arenawaitmessage B_MSG_REF_PLAYER_WON
arenajudgmentwindow
various15 BS_ATTACKER
arenaerasereftextbox
printstring STRINGID_DEFEATEDOPPONENTBYREFEREE
waitmessage B_WAIT_TIME_LONG
playfaintcry BS_OPPONENT1
@@ -4506,7 +4512,7 @@ BattleScript_ArenaJudgmentPlayerLoses:
arenajudgmentstring B_MSG_REF_OPPONENT_WON
arenawaitmessage B_MSG_REF_OPPONENT_WON
arenajudgmentwindow
various15 BS_ATTACKER
arenaerasereftextbox
printstring STRINGID_LOSTTOOPPONENTBYREFEREE
waitmessage B_WAIT_TIME_LONG
playfaintcry BS_PLAYER1
@@ -4520,7 +4526,7 @@ BattleScript_ArenaJudgmentDraw:
arenajudgmentstring B_MSG_REF_DRAW
arenawaitmessage B_MSG_REF_DRAW
arenajudgmentwindow
various15 BS_ATTACKER
arenaerasereftextbox
printstring STRINGID_TIEDOPPONENTBYREFEREE
waitmessage B_WAIT_TIME_LONG
playfaintcry BS_PLAYER1

View File

@@ -48,7 +48,7 @@ gContestAI_ScriptsTable::
.4byte AI_Nothing @ CONTEST_AI_DUMMY_25
@ Unused. Encourages improving condition on the 1st appeal, or startling mons if the users turn is later
@ Unused. Encourages improving condition on the 1st appeal, or startling mons if the users turn is later
AI_CheckTiming:
if_appeal_num_not_eq 0, AI_CheckTiming_SkipCondition
if_effect_not_eq CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, AI_CheckTiming_SkipCondition
@@ -388,7 +388,7 @@ AI_CGM_AppealAsGoodAsPrevOnes_Last:
score +20
end
@ Encourages move more for each opponent who will have a turn before the user
@ Encourages move more for each opponent who will have a turn before the user
AI_CGM_AppealAsGoodAsPrevOne:
if_user_order_eq MON_1, AI_CGM_AppealAsGoodAsPrevOne_1stUp
if_user_order_eq MON_2, AI_CGM_AppealAsGoodAsPrevOne_2ndUp
@@ -456,7 +456,7 @@ AI_CGM_BetterWhenAudienceExcited_Not1stUp:
score +10
end
@ Encourage move more for each condition star the prev mons have
@ Encourage move more for each condition star the prev mons have
AI_CGM_WorsenConditionOfPrevMons:
if_user_order_eq MON_1, AI_CGM_End
goto AI_CGM_WorsenConditionOfPrevMons_CheckMon1

View File

@@ -956,7 +956,7 @@ gText_LegendaryFlewAway::
.string "The {STR_VAR_1} flew away!$"
.include "data/text/pc_transfer.inc"
.include "data/text/mevent.inc"
.include "data/text/questionnaire.inc"
.include "data/text/abnormal_weather.inc"
EventScript_SelectWithoutRegisteredItem::
@@ -1006,7 +1006,7 @@ Common_EventScript_LegendaryFlewAway::
end
.include "data/scripts/pc_transfer.inc"
.include "data/scripts/mevent.inc"
.include "data/scripts/questionnaire.inc"
.include "data/scripts/abnormal_weather.inc"
.include "data/scripts/trainer_script.inc"
.include "data/scripts/berry_tree.inc"

View File

@@ -2,7 +2,7 @@ BattleFrontier_Lounge2_MapScripts::
.byte 0
@ This NPC gives hints about a random facility or battle mode.
@ For battle modes he gives generic advice
@ For battle modes he gives generic advice
@ For facilities, depending on how far the player has progressed he will say either
@ The name of the Frontier Brain there
@ The type and description of the 3 pokemon they use in their silver battle

View File

@@ -4,7 +4,7 @@
.equ LOCALID_BRINEY_DEWFORD, 2
.equ LOCALID_BOAT_DEWFORD, 4
.equ LOCALID_BOAT_R109, 1
.equ LOCALID_BOAT_R109, 1
.equ LOCALID_BRINEY_R109, 2
.equ LOCALID_BOAT_R104, 7

View File

@@ -33,7 +33,7 @@ LilycoveCity_DepartmentStore_5F_Pokemart_Dolls:
.2byte DECOR_PIKACHU_DOLL
.2byte DECOR_MARILL_DOLL
.2byte DECOR_JIGGLYPUFF_DOLL
.2byte DECOR_DUSKULL_DOLL
.2byte DECOR_DUSKULL_DOLL
.2byte DECOR_WYNAUT_DOLL
.2byte DECOR_BALTOY_DOLL
.2byte DECOR_KECLEON_DOLL

View File

@@ -29,7 +29,7 @@ LilycoveCity_Harbor_EventScript_FerryAttendant::
goto_if_eq LilycoveCity_Harbor_EventScript_AuroraTicketFirstTime
compare VAR_TEMP_B, 4
goto_if_eq LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime
compare VAR_TEMP_B, 8
compare VAR_TEMP_B, 8
goto_if_eq LilycoveCity_Harbor_EventScript_MysticTicketFirstTime
compare VAR_TEMP_B, 0
goto_if_ne LilycoveCity_Harbor_EventScript_MultipleEventTicketsFirstTime

View File

@@ -12,7 +12,7 @@ MauvilleCity_PokemonCenter_1F_OnTransition:
end
MauvilleCity_PokemonCenter_1F_EventScript_SetMauvilleOldManGfx::
special ScrSpecial_SetMauvilleOldManObjEventGfx
special SetMauvilleOldManObjEventGfx
end
MauvilleCity_PokemonCenter_1F_EventScript_Nurse::

View File

@@ -1,4 +1,4 @@
@ NOTE: Route 104's sail to Dewford script references local IDs from Dewford's map.
@ NOTE: Route 104's sail to Dewford script references local IDs from Dewford's map.
@ These are labeled in DewfordTown/scripts.inc
.set LOCALID_RIVAL, 34

View File

@@ -1,4 +1,4 @@
@ NOTE: Route 109's sail to Dewford script references local IDs from Dewford's map.
@ NOTE: Route 109's sail to Dewford script references local IDs from Dewford's map.
@ These are labeled in DewfordTown/scripts.inc
Route109_MapScripts::

View File

@@ -84,7 +84,7 @@ VictoryRoad_1F_EventScript_EntranceWally::
msgbox VictoryRoad_1F_Text_WallyPostEntranceBattle, MSGBOX_NPC
end
@ This Wally appears and remains at the exit after the Hall of Fame is entered
@ This Wally appears and remains at the exit after the Hall of Fame is entered
VictoryRoad_1F_EventScript_ExitWally::
trainerbattle_single TRAINER_WALLY_VR_2, VictoryRoad_1F_Text_WallyIntro, VictoryRoad_1F_Text_WallyDefeat
specialvar VAR_RESULT, ShouldTryRematchBattle

View File

@@ -2,7 +2,7 @@
#include "constants/flags.h"
#include "constants/items.h"
#include "constants/map_scripts.h"
#include "constants/mevent.h"
#include "constants/mystery_gift.h"
#include "constants/moves.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
@@ -15,11 +15,11 @@
.section .rodata
.align 2
.include "data/scripts/mevent_stamp_card.inc"
.include "data/scripts/mevent_pichu.inc"
.include "data/scripts/mevent_trainer.inc"
.include "data/scripts/mevent_battle_card.inc"
.include "data/scripts/mevent_aurora_ticket.inc"
.include "data/scripts/mevent_mystic_ticket.inc"
.include "data/scripts/mevent_altering_cave.inc"
.include "data/scripts/mevent_old_sea_map.inc"
.include "data/scripts/gift_stamp_card.inc"
.include "data/scripts/gift_pichu.inc"
.include "data/scripts/gift_trainer.inc"
.include "data/scripts/gift_battle_card.inc"
.include "data/scripts/gift_aurora_ticket.inc"
.include "data/scripts/gift_mystic_ticket.inc"
.include "data/scripts/gift_altering_cave.inc"
.include "data/scripts/gift_old_sea_map.inc"

View File

@@ -641,7 +641,7 @@ BerryBlender_EventScript_DoLinkBerryBlending:
fadescreen FADE_TO_BLACK
removeobject 240 @ Unclear where these local IDs come from,
removeobject 239 @ but presumably they'd be the 4 link players
removeobject 238
removeobject 238
removeobject 237
special DoBerryBlending
waitstate

View File

@@ -6,7 +6,7 @@ CableClub_EventScript_HideOrShowMysteryGiftMan::
specialvar VAR_RESULT, ShouldDistributeEonTicket
compare VAR_RESULT, TRUE
goto_if_eq CableClub_EventScript_ShowMysteryGiftMan
specialvar VAR_RESULT, ValidateReceivedWonderCard
specialvar VAR_RESULT, ValidateSavedWonderCard
compare VAR_RESULT, FALSE
goto_if_eq CableClub_EventScript_HideMysteryGiftMan
goto CableClub_EventScript_ShowMysteryGiftMan
@@ -40,11 +40,11 @@ CableClub_EventScript_DistributeEonTicket::
compare VAR_RESULT, TRUE
goto_if_eq CableClub_EventScript_AlreadyGotEonTicket
goto_if_set FLAG_ENABLE_SHIP_SOUTHERN_ISLAND, CableClub_EventScript_AlreadyGotEonTicket
msgbox Mevent_Text_TheresATicketForYou, MSGBOX_DEFAULT
msgbox MysteryGift_Text_TheresATicketForYou, MSGBOX_DEFAULT
giveitem ITEM_EON_TICKET
setflag FLAG_ENABLE_SHIP_SOUTHERN_ISLAND
setvar VAR_DISTRIBUTE_EON_TICKET, 0
msgbox Mevent_Text_TryUsingItAtLilycovePort, MSGBOX_DEFAULT
msgbox MysteryGift_Text_TryUsingItAtLilycovePort, MSGBOX_DEFAULT
release
end

View File

@@ -1,10 +1,10 @@
MysteryEventScript_AlteringCave::
setvaddress MysteryEventScript_AlteringCave
MysteryGiftScript_AlteringCave::
setvaddress MysteryGiftScript_AlteringCave
addvar VAR_ALTERING_CAVE_WILD_SET, 1
compare VAR_ALTERING_CAVE_WILD_SET, 10
vgoto_if_ne MysteryEventScript_AlteringCave_
vgoto_if_ne MysteryGiftScript_AlteringCave_
setvar VAR_ALTERING_CAVE_WILD_SET, 0
MysteryEventScript_AlteringCave_:
MysteryGiftScript_AlteringCave_:
lock
faceplayer
vmessage sText_MysteryGiftAlteringCave

View File

@@ -1,5 +1,5 @@
MysteryEventScript_AuroraTicket::
setvaddress MysteryEventScript_AuroraTicket
MysteryGiftScript_AuroraTicket::
setvaddress MysteryGiftScript_AuroraTicket
lock
faceplayer
vgoto_if_set FLAG_RECEIVED_AURORA_TICKET, AuroraTicket_Obtained

View File

@@ -1,10 +1,10 @@
MysteryEventScript_BattleCard::
setvaddress MysteryEventScript_BattleCard
vgoto_if_set FLAG_MYSTERY_EVENT_DONE, MysteryEventScript_BattleCardInfo
MysteryGiftScript_BattleCard::
setvaddress MysteryGiftScript_BattleCard
vgoto_if_set FLAG_MYSTERY_GIFT_DONE, MysteryGiftScript_BattleCardInfo
setorcopyvar VAR_RESULT, GET_CARD_BATTLES_WON
specialvar VAR_0x8008, GetMysteryEventCardVal
specialvar VAR_0x8008, GetMysteryGiftCardStat
compare VAR_0x8008, REQUIRED_CARD_BATTLES
vgoto_if_ne MysteryEventScript_BattleCardInfo
vgoto_if_ne MysteryGiftScript_BattleCardInfo
lock
faceplayer
vmessage sText_MysteryGiftBattleCountCard_WonPrize
@@ -12,10 +12,10 @@ MysteryEventScript_BattleCard::
waitbuttonpress
giveitem ITEM_POTION
release
setflag FLAG_MYSTERY_EVENT_DONE
setflag FLAG_MYSTERY_GIFT_DONE
end
MysteryEventScript_BattleCardInfo:
MysteryGiftScript_BattleCardInfo:
lock
faceplayer
vmessage sText_MysteryGiftBattleCountCard

View File

@@ -1,5 +1,5 @@
MysteryEventScript_MysticTicket::
setvaddress MysteryEventScript_MysticTicket
MysteryGiftScript_MysticTicket::
setvaddress MysteryGiftScript_MysticTicket
lock
faceplayer
vgoto_if_set FLAG_RECEIVED_MYSTIC_TICKET, MysticTicket_Obtained

View File

@@ -1,5 +1,5 @@
MysteryEventScript_OldSeaMap::
setvaddress MysteryEventScript_OldSeaMap
MysteryGiftScript_OldSeaMap::
setvaddress MysteryGiftScript_OldSeaMap
lock
faceplayer
vgoto_if_set FLAG_RECEIVED_OLD_SEA_MAP, OldSeaMap_Obtained

View File

@@ -1,13 +1,13 @@
MysteryEventScript_SurfPichu::
setvaddress MysteryEventScript_SurfPichu
vgoto_if_unset FLAG_MYSTERY_EVENT_DONE, SurfPichu_GiveIfPossible
MysteryGiftScript_SurfPichu::
setvaddress MysteryGiftScript_SurfPichu
vgoto_if_unset FLAG_MYSTERY_GIFT_DONE, SurfPichu_GiveIfPossible
returnram
SurfPichu_GiveIfPossible:
specialvar VAR_EVENT_PICHU_SLOT, CalculatePlayerPartyCount
compare VAR_EVENT_PICHU_SLOT, PARTY_SIZE
specialvar VAR_GIFT_PICHU_SLOT, CalculatePlayerPartyCount
compare VAR_GIFT_PICHU_SLOT, PARTY_SIZE
vgoto_if_eq SurfPichu_FullParty
setflag FLAG_MYSTERY_EVENT_DONE
setflag FLAG_MYSTERY_GIFT_DONE
vcall SurfPichu_GiveEgg
lock
faceplayer
@@ -30,17 +30,17 @@ SurfPichu_FullParty:
SurfPichu_GiveEgg:
giveegg SPECIES_PICHU
setmoneventlegal VAR_EVENT_PICHU_SLOT
setmonmetlocation VAR_EVENT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER
compare VAR_EVENT_PICHU_SLOT, 1
setmoneventlegal VAR_GIFT_PICHU_SLOT
setmonmetlocation VAR_GIFT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER
compare VAR_GIFT_PICHU_SLOT, 1
vgoto_if_eq SurfPichu_Slot1
compare VAR_EVENT_PICHU_SLOT, 2
compare VAR_GIFT_PICHU_SLOT, 2
vgoto_if_eq SurfPichu_Slot2
compare VAR_EVENT_PICHU_SLOT, 3
compare VAR_GIFT_PICHU_SLOT, 3
vgoto_if_eq SurfPichu_Slot3
compare VAR_EVENT_PICHU_SLOT, 4
compare VAR_GIFT_PICHU_SLOT, 4
vgoto_if_eq SurfPichu_Slot4
compare VAR_EVENT_PICHU_SLOT, 5
compare VAR_GIFT_PICHU_SLOT, 5
vgoto_if_eq SurfPichu_Slot5
return

View File

@@ -1,9 +1,9 @@
MysteryEventScript_StampCard::
setvaddress MysteryEventScript_StampCard
MysteryGiftScript_StampCard::
setvaddress MysteryGiftScript_StampCard
setorcopyvar VAR_RESULT, GET_MAX_STAMPS
specialvar VAR_0x8008, GetMysteryEventCardVal
specialvar VAR_0x8008, GetMysteryGiftCardStat
setorcopyvar VAR_RESULT, GET_NUM_STAMPS
specialvar VAR_0x8009, GetMysteryEventCardVal
specialvar VAR_0x8009, GetMysteryGiftCardStat
subvar VAR_0x8008, VAR_0x8009
buffernumberstring 0, VAR_0x8008
lock

View File

@@ -1,8 +1,8 @@
MysteryEventScript_VisitingTrainer::
setvaddress MysteryEventScript_VisitingTrainer
MysteryGiftScript_VisitingTrainer::
setvaddress MysteryGiftScript_VisitingTrainer
special ValidateEReaderTrainer
compare VAR_RESULT, 0
vgoto_if_eq MysteryEventScript_VisitingTrainerArrived
vgoto_if_eq MysteryGiftScript_VisitingTrainerArrived
lock
faceplayer
vmessage sText_MysteryGiftVisitingTrainerInstructions
@@ -11,7 +11,7 @@ MysteryEventScript_VisitingTrainer::
release
end
MysteryEventScript_VisitingTrainerArrived:
MysteryGiftScript_VisitingTrainerArrived:
lock
faceplayer
vmessage sText_MysteryGiftVisitingTrainerArrived

View File

@@ -1,5 +1,5 @@
MauvilleCity_PokemonCenter_1F_EventScript_MauvilleOldMan::
special ScrSpecial_GetCurrentMauvilleMan
special Script_GetCurrentMauvilleMan
switch VAR_RESULT
case MAUVILLE_MAN_BARD, MauvilleCity_PokemonCenter_1F_EventScript_Bard
case MAUVILLE_MAN_HIPSTER, MauvilleCity_PokemonCenter_1F_EventScript_Hipster
@@ -21,9 +21,9 @@ MauvilleCity_PokemonCenter_1F_EventScript_Bard::
MauvilleCity_PokemonCenter_1F_EventScript_PlaySong::
setvar VAR_0x8004, 0
special ScrSpecial_PlayBardSong
special PlayBardSong
delay 60
special ScrSpecial_HasBardSongBeenChanged
special HasBardSongBeenChanged
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AskToWriteLyrics
msgbox MauvilleCity_PokemonCenter_1F_Text_WishICouldPlaySongForOthers, MSGBOX_DEFAULT
@@ -52,12 +52,12 @@ MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics::
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineWritingLyrics
msgbox MauvilleCity_PokemonCenter_1F_Text_LetMeSingItForYou, MSGBOX_DEFAULT
setvar VAR_0x8004, 1
special ScrSpecial_PlayBardSong
special PlayBardSong
delay 60
msgbox MauvilleCity_PokemonCenter_1F_Text_ThatHowYouWantedSongToGo, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics
special ScrSpecial_SaveBardSongLyrics
special SaveBardSongLyrics
msgbox MauvilleCity_PokemonCenter_1F_Text_IllSingThisSongForAWhile, MSGBOX_DEFAULT
release
end
@@ -73,7 +73,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Hipster::
faceplayer
setflag FLAG_SYS_HIPSTER_MEET
msgbox MauvilleCity_PokemonCenter_1F_Text_TeachWhatsHipAndHappening, MSGBOX_DEFAULT
special ScrSpecial_GetHipsterSpokenFlag
special GetHipsterSpokenFlag
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord
msgbox MauvilleCity_PokemonCenter_1F_Text_IAlreadyTaughtYou, MSGBOX_DEFAULT
@@ -81,7 +81,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Hipster::
end
MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord::
special ScrSpecial_HipsterTeachWord
special HipsterTryTeachWord
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TeachWord
msgbox MauvilleCity_PokemonCenter_1F_Text_IveGotNothingNewToTeach, MSGBOX_DEFAULT
@@ -90,7 +90,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord::
MauvilleCity_PokemonCenter_1F_EventScript_TeachWord::
msgbox MauvilleCity_PokemonCenter_1F_Text_HaveYouHeardOfPhrase, MSGBOX_DEFAULT
special ScrSpecial_SetHipsterSpokenFlag
special SetHipsterSpokenFlag
release
end
@@ -160,7 +160,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Trader::
msgbox MauvilleCity_PokemonCenter_1F_Text_WantToTradeDecor, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineTrade
special ScrSpecial_GetTraderTradedFlag
special GetTraderTradedFlag
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded
message MauvilleCity_PokemonCenter_1F_Text_PickADecorItem
@@ -179,7 +179,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded::
end
MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToReceive::
special ScrSpecial_TraderMenuGetDecoration
special TraderMenuGetDecoration
waitstate
compare VAR_0x8004, 0
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelPickDecor
@@ -188,7 +188,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToReceive::
msgbox MauvilleCity_PokemonCenter_1F_Text_OnceBelongedToPlayerDoYouWantIt, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PickDifferentDecor
special ScrSpecial_DoesPlayerHaveNoDecorations
special DoesPlayerHaveNoDecorations
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DontHaveAnyDecor
goto MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive
@@ -218,19 +218,19 @@ MauvilleCity_PokemonCenter_1F_EventScript_DontHaveAnyDecor::
MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive::
msgbox MauvilleCity_PokemonCenter_1F_Text_PickTheDecorToTrade, MSGBOX_DEFAULT
special ScrSpecial_TraderMenuGiveDecoration
special TraderShowDecorationMenu
waitstate
compare VAR_0x8006, 0
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelGiveDecor
compare VAR_0x8006, 0xFFFF
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DecorInUse
special ScrSpecial_IsDecorationFull
special IsDecorationCategoryFull
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_NoRoomForDecor
msgbox MauvilleCity_PokemonCenter_1F_Text_SoWellTradeTheseDecor, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive
special ScrSpecial_TraderDoDecorationTrade
special TraderDoDecorationTrade
msgbox MauvilleCity_PokemonCenter_1F_Text_SendDecorToYourPC, MSGBOX_DEFAULT
release
end
@@ -818,20 +818,20 @@ MauvilleCity_PokemonCenter_1F_EventScript_Storyteller::
msgbox MauvilleCity_PokemonCenter_1F_Text_WillYouHearMyTale, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller
specialvar VAR_RESULT, ScrSpecial_StorytellerGetFreeStorySlot
specialvar VAR_RESULT, StorytellerGetFreeStorySlot
compare VAR_RESULT, 0
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_KnowNoTales
message MauvilleCity_PokemonCenter_1F_Text_WhichTaleToTell
waitmessage
special ScrSpecial_StorytellerStoryListMenu
special StorytellerStoryListMenu
waitstate
compare VAR_RESULT, 0
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection
setvar VAR_0x8008, 1
special ScrSpecial_StorytellerDisplayStory
special Script_StorytellerDisplayStory
waitmessage
waitbuttonpress
specialvar VAR_RESULT, ScrSpecial_StorytellerUpdateStat
specialvar VAR_RESULT, StorytellerUpdateStat
compare VAR_RESULT, 0
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales
goto MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale
@@ -842,7 +842,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection::
MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales::
msgbox MauvilleCity_PokemonCenter_1F_Text_CouldThereBeOtherLegends, MSGBOX_DEFAULT
specialvar VAR_RESULT, ScrSpecial_HasStorytellerAlreadyRecorded
specialvar VAR_RESULT, HasStorytellerAlreadyRecorded
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_StorytellerEnd
goto MauvilleCity_PokemonCenter_1F_EventScript_DoYouHaveAnyTales
@@ -853,7 +853,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_DoYouHaveAnyTales::
msgbox MauvilleCity_PokemonCenter_1F_Text_HaveYouAnyLegendaryTales, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller
specialvar VAR_RESULT, ScrSpecial_StorytellerInitializeRandomStat
specialvar VAR_RESULT, Script_StorytellerInitializeRandomStat
compare VAR_RESULT, 1
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale
msgbox MauvilleCity_PokemonCenter_1F_Text_NotWorthyOfLegend, MSGBOX_DEFAULT
@@ -909,7 +909,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Giddy::
end
MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale::
special ScrSpecial_GiddyShouldTellAnotherTale
special GiddyShouldTellAnotherTale
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale
compare VAR_RESULT, FALSE
@@ -917,7 +917,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale::
end
MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale::
special ScrSpecial_GiddyShouldTellAnotherTale
special GiddyShouldTellAnotherTale
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale
compare VAR_RESULT, FALSE
@@ -929,15 +929,16 @@ MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale::
goto MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale
end
@ Regardless of whether yes or no is selected below, Giddy will continue to tell stories until he's told 10
@ Giddy will continue to tell stories regardless of whether yes or no is selected below.
@ Each story there is a 10% chance it will be his last. Otherwise he will stop at 10 stories.
MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale::
special ScrSpecial_GenerateGiddyLine
special GenerateGiddyLine
special ShowFieldMessageStringVar4
waitmessage
yesnobox 20, 8
compare VAR_RESULT, 1
compare VAR_RESULT, YES
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale
compare VAR_RESULT, 0
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale
end

View File

@@ -1,62 +0,0 @@
EventScript_Questionnaire::
lockall
msgbox Mevent_Text_FillOutQuestionnaire, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq Mevent_EventScript_Release
setvar VAR_0x8004, EASY_CHAT_TYPE_QUESTIONNAIRE
call Common_ShowEasyChatScreen
lock
faceplayer
specialvar VAR_0x8008, GetMartEmployeeObjectEventId
compare VAR_0x8004, 1
goto_if_eq Mevent_EventScript_PlayerInputMysteryEventPhrase
compare VAR_0x8004, 2
goto_if_eq Mevent_EventScript_PlayerInputMysteryGiftPhrase
compare VAR_RESULT, 0
goto_if_eq Mevent_EventScript_Release
compare VAR_RESULT, 1
goto_if_eq Mevent_EventScript_QuestionnaireThankYou
end
Mevent_EventScript_PlayerInputMysteryEventPhrase::
goto_if_unset FLAG_SYS_POKEDEX_GET, Mevent_EventScript_QuestionnaireThankYou
goto_if_set FLAG_SYS_MYSTERY_EVENT_ENABLE, Mevent_EventScript_QuestionnaireThankYou
applymovement VAR_0x8008, Common_Movement_FaceDown
waitmovement 0
playse SE_PIN
applymovement VAR_0x8008, Common_Movement_ExclamationMark
waitmovement 0
applymovement VAR_0x8008, Common_Movement_Delay48
waitmovement 0
msgbox Mevent_Text_YouKnowThoseWordsEvent, MSGBOX_DEFAULT
setflag FLAG_SYS_MYSTERY_EVENT_ENABLE
msgbox Mevent_Text_YouCanAccessMysteryEvent, MSGBOX_DEFAULT
releaseall
end
Mevent_EventScript_PlayerInputMysteryGiftPhrase::
goto_if_unset FLAG_SYS_POKEDEX_GET, Mevent_EventScript_QuestionnaireThankYou
goto_if_set FLAG_SYS_MYSTERY_GIFT_ENABLE, Mevent_EventScript_QuestionnaireThankYou
applymovement VAR_0x8008, Common_Movement_FaceDown
waitmovement 0
playse SE_PIN
applymovement VAR_0x8008, Common_Movement_ExclamationMark
waitmovement 0
applymovement VAR_0x8008, Common_Movement_Delay48
waitmovement 0
msgbox Mevent_Text_YouKnowThoseWordsGift, MSGBOX_DEFAULT
setflag FLAG_SYS_MYSTERY_GIFT_ENABLE
msgbox Mevent_Text_YouCanAccessMysteryGift, MSGBOX_DEFAULT
releaseall
end
Mevent_EventScript_Release::
releaseall
end
Mevent_EventScript_QuestionnaireThankYou::
applymovement VAR_0x8008, Common_Movement_FaceDown
waitmovement 0
msgbox Mevent_Text_QuestionnaireThankYou, MSGBOX_DEFAULT
releaseall
end

View File

@@ -0,0 +1,62 @@
EventScript_Questionnaire::
lockall
msgbox Questionnaire_Text_FillOut, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq Questionnaire_EventScript_Release
setvar VAR_0x8004, EASY_CHAT_TYPE_QUESTIONNAIRE
call Common_ShowEasyChatScreen
lock
faceplayer
specialvar VAR_0x8008, GetMartEmployeeObjectEventId
compare VAR_0x8004, 1
goto_if_eq Questionnaire_EventScript_PlayerInputMysteryEventPhrase
compare VAR_0x8004, 2
goto_if_eq Questionnaire_EventScript_PlayerInputMysteryGiftPhrase
compare VAR_RESULT, 0
goto_if_eq Questionnaire_EventScript_Release
compare VAR_RESULT, 1
goto_if_eq Questionnaire_EventScript_ThankYou
end
Questionnaire_EventScript_PlayerInputMysteryEventPhrase::
goto_if_unset FLAG_SYS_POKEDEX_GET, Questionnaire_EventScript_ThankYou
goto_if_set FLAG_SYS_MYSTERY_EVENT_ENABLE, Questionnaire_EventScript_ThankYou
applymovement VAR_0x8008, Common_Movement_FaceDown
waitmovement 0
playse SE_PIN
applymovement VAR_0x8008, Common_Movement_ExclamationMark
waitmovement 0
applymovement VAR_0x8008, Common_Movement_Delay48
waitmovement 0
msgbox Questionnaire_Text_YouKnowThoseWordsEvent, MSGBOX_DEFAULT
setflag FLAG_SYS_MYSTERY_EVENT_ENABLE
msgbox Questionnaire_Text_YouCanAccessMysteryEvent, MSGBOX_DEFAULT
releaseall
end
Questionnaire_EventScript_PlayerInputMysteryGiftPhrase::
goto_if_unset FLAG_SYS_POKEDEX_GET, Questionnaire_EventScript_ThankYou
goto_if_set FLAG_SYS_MYSTERY_GIFT_ENABLE, Questionnaire_EventScript_ThankYou
applymovement VAR_0x8008, Common_Movement_FaceDown
waitmovement 0
playse SE_PIN
applymovement VAR_0x8008, Common_Movement_ExclamationMark
waitmovement 0
applymovement VAR_0x8008, Common_Movement_Delay48
waitmovement 0
msgbox Questionnaire_Text_YouKnowThoseWordsGift, MSGBOX_DEFAULT
setflag FLAG_SYS_MYSTERY_GIFT_ENABLE
msgbox Questionnaire_Text_YouCanAccessMysteryGift, MSGBOX_DEFAULT
releaseall
end
Questionnaire_EventScript_Release::
releaseall
end
Questionnaire_EventScript_ThankYou::
applymovement VAR_0x8008, Common_Movement_FaceDown
waitmovement 0
msgbox Questionnaire_Text_ThankYou, MSGBOX_DEFAULT
releaseall
end

View File

@@ -43,7 +43,7 @@ gSpecials::
def_special CloseLink
def_special ColosseumPlayerSpotTriggered
def_special PlayerEnteredTradeSeat
def_special nullsub_37
def_special Script_StartWiredTrade
def_special CableClubSaveGame
def_special TryBerryBlenderLinkup
def_special GetLinkPartnerNames
@@ -108,28 +108,28 @@ gSpecials::
def_special DoWateringBerryTreeAnim
def_special ShowEasyChatScreen
def_special ShowEasyChatProfile
def_special ScrSpecial_GetCurrentMauvilleMan
def_special ScrSpecial_HasBardSongBeenChanged
def_special ScrSpecial_SaveBardSongLyrics
def_special ScrSpecial_GetHipsterSpokenFlag
def_special ScrSpecial_SetHipsterSpokenFlag
def_special ScrSpecial_HipsterTeachWord
def_special ScrSpecial_PlayBardSong
def_special ScrSpecial_SetMauvilleOldManObjEventGfx
def_special ScrSpecial_GenerateGiddyLine
def_special ScrSpecial_GiddyShouldTellAnotherTale
def_special ScrSpecial_StorytellerGetFreeStorySlot
def_special ScrSpecial_StorytellerDisplayStory
def_special ScrSpecial_StorytellerStoryListMenu
def_special ScrSpecial_StorytellerUpdateStat
def_special ScrSpecial_StorytellerInitializeRandomStat
def_special ScrSpecial_HasStorytellerAlreadyRecorded
def_special ScrSpecial_TraderMenuGetDecoration
def_special ScrSpecial_GetTraderTradedFlag
def_special ScrSpecial_DoesPlayerHaveNoDecorations
def_special ScrSpecial_IsDecorationFull
def_special ScrSpecial_TraderMenuGiveDecoration
def_special ScrSpecial_TraderDoDecorationTrade
def_special Script_GetCurrentMauvilleMan
def_special HasBardSongBeenChanged
def_special SaveBardSongLyrics
def_special GetHipsterSpokenFlag
def_special SetHipsterSpokenFlag
def_special HipsterTryTeachWord
def_special PlayBardSong
def_special SetMauvilleOldManObjEventGfx
def_special GenerateGiddyLine
def_special GiddyShouldTellAnotherTale
def_special StorytellerGetFreeStorySlot
def_special Script_StorytellerDisplayStory
def_special StorytellerStoryListMenu
def_special StorytellerUpdateStat
def_special Script_StorytellerInitializeRandomStat
def_special HasStorytellerAlreadyRecorded
def_special TraderMenuGetDecoration
def_special GetTraderTradedFlag
def_special DoesPlayerHaveNoDecorations
def_special IsDecorationCategoryFull
def_special TraderShowDecorationMenu
def_special TraderDoDecorationTrade
def_special GetSeedotSizeRecordInfo
def_special CompareSeedotSize
def_special GetLotadSizeRecordInfo
@@ -400,7 +400,7 @@ gSpecials::
def_special ClearQuizLadyQuestionAndAnswer
def_special QuizLadySetCustomQuestion
def_special QuizLadyTakePrizeForCustomQuiz
def_special GetMysteryEventCardVal
def_special GetMysteryGiftCardStat
def_special QuizLadyRecordCustomQuizData
def_special QuizLadySetWaitingForChallenger
def_special BufferQuizCorrectAnswer
@@ -430,11 +430,11 @@ gSpecials::
def_special ShowWirelessCommunicationScreen
def_special InitUnionRoom
def_special BufferUnionRoomPlayerName
def_special sub_801DC20
def_special RetrieveWonderNewsVal
def_special ChooseMonForWirelessMinigame
def_special Script_ResetUnionRoomTrade
def_special IsBadEggInParty
def_special ValidateReceivedWonderCard
def_special ValidateSavedWonderCard
def_special HasAtLeastOneBerry
def_special IsPokemonJumpSpeciesInParty
def_special ShowPokemonJumpRecords
@@ -455,7 +455,7 @@ gSpecials::
def_special ClearLinkContestFlags
def_special TryContestEModeLinkup
def_special ShowScrollableMultichoice
def_special sub_813A630
def_special ScrollableMultichoice_TryReturnToList
def_special BufferBattleTowerElevatorFloors
def_special TryStoreHeldItemsInPyramidBag
def_special ChooseItemsToTossFromPyramidBag
@@ -484,10 +484,10 @@ gSpecials::
def_special CountPlayerTrainerStars
def_special BufferBattleFrontierTutorMoveName
def_special CloseBattleFrontierTutorWindow
def_special sub_813ADD4
def_special ScrollableMultichoice_RedrawPersistentMenu
def_special ChooseMonForMoveTutor
def_special GetBattleFrontierTutorMoveIndex
def_special sub_813AF48
def_special ScrollableMultichoice_ClosePersistentMenu
def_special DoDeoxysRockInteraction
def_special SetDeoxysRockPalette
def_special CreateEventLegalEnemyMon

View File

@@ -1,63 +1,63 @@
@ Only contains a portion of the mauville_man text. The rest is in scripts/mauville_man.inc
gText_SoPretty::
@ Only contains the text for the Mauville Man named Giddy. The rest is in scripts/mauville_man.inc
GiddyText_SoPretty::
.string " so pretty!$"
gText_SoDarling::
GiddyText_SoDarling::
.string " so darling!$"
gText_SoRelaxed::
GiddyText_SoRelaxed::
.string " so relaxed!$"
gText_SoSunny::
GiddyText_SoSunny::
.string " so sunny!$"
gText_SoDesirable::
GiddyText_SoDesirable::
.string " so desirable!$"
gText_SoExciting::
GiddyText_SoExciting::
.string " so exciting!$"
gText_SoAmusing::
GiddyText_SoAmusing::
.string " so amusing!$"
gText_SoMagical::
GiddyText_SoMagical::
.string " so magical!$"
gOtherText_Is::
GiddyText_Is::
.string " is$"
gOtherText_DontYouAgree::
GiddyText_DontYouAgree::
.string "\n"
.string "Don't you agree?$"
gMauvilleManText_ISoWantToGoOnAVacation::
GiddyText_ISoWantToGoOnAVacation::
.string "I so want to go on a vacation.\n"
.string "Would you happen to know a nice place?$"
gMauvilleManText_IBoughtCrayonsWith120Colors::
GiddyText_IBoughtCrayonsWith120Colors::
.string "I bought crayons with 120 colors!\n"
.string "Don't you think that's nice?$"
gMauvilleManText_WouldntItBeNiceIfWeCouldFloat::
GiddyText_WouldntItBeNiceIfWeCouldFloat::
.string "Wouldn't it be nice if we could float\n"
.string "away on a cloud of bubbles?$"
gMauvilleManText_WhenYouWriteOnASandyBeach::
GiddyText_WhenYouWriteOnASandyBeach::
.string "When you write on a sandy beach,\n"
.string "they wash away. It makes me sad.$"
gMauvilleManText_WhatsTheBottomOfTheSeaLike::
GiddyText_WhatsTheBottomOfTheSeaLike::
.string "What's the bottom of the sea like?\n"
.string "Just once I would so love to go!$"
gMauvilleManText_WhenYouSeeTheSettingSunDoesIt::
GiddyText_WhenYouSeeTheSettingSunDoesIt::
.string "When you see the setting sun, does it\n"
.string "make you want to go home?$"
gMauvilleManText_LyingBackInTheGreenGrass::
GiddyText_LyingBackInTheGreenGrass::
.string "Lying back in the green grass…\n"
.string "Oh, it's so, so nice!$"
gMauvilleManText_SecretBasesAreSoWonderful::
GiddyText_SecretBasesAreSoWonderful::
.string "SECRET BASES are so wonderful!\n"
.string "Can't you feel the excitement?$"

View File

@@ -1,14 +1,14 @@
Mevent_Text_FillOutQuestionnaire::
Questionnaire_Text_FillOut::
.string "There is a questionnaire.\n"
.string "Would you like to fill it out?$"
Mevent_Text_QuestionnaireThankYou::
Questionnaire_Text_ThankYou::
.string "Thank you for taking the time to\n"
.string "fill out our questionnaire.\p"
.string "Your feedback will be used for\n"
.string "future reference.$"
Mevent_Text_YouKnowThoseWordsGift::
Questionnaire_Text_YouKnowThoseWordsGift::
.string "Oh, hello!\n"
.string "You know those words?\p"
.string "That means you must know about\n"
@@ -16,27 +16,27 @@ Mevent_Text_YouKnowThoseWordsGift::
.string "From now on, you should be\n"
.string "receiving MYSTERY GIFTS!$"
Mevent_Text_YouCanAccessMysteryGift::
Questionnaire_Text_YouCanAccessMysteryGift::
.string "Once you save your game, you can\n"
.string "access the MYSTERY GIFT.$"
Mevent_Text_YouKnowThoseWordsEvent::
Questionnaire_Text_YouKnowThoseWordsEvent::
.string "Oh, hello!\n"
.string "You know those words?\p"
.string "That means you must know about\n"
.string "the MYSTERY EVENT.$"
Mevent_Text_YouCanAccessMysteryEvent::
Questionnaire_Text_YouCanAccessMysteryEvent::
.string "Once you save your game, you can\n"
.string "access the MYSTERY EVENT.$"
Mevent_Text_TheresATicketForYou::
MysteryGift_Text_TheresATicketForYou::
.string "Thank you for using the MYSTERY\n"
.string "EVENT System.\p"
.string "You must be {PLAYER}.\n"
.string "There is a ticket here for you.$"
Mevent_Text_TryUsingItAtLilycovePort::
MysteryGift_Text_TryUsingItAtLilycovePort::
.string "It appears to be for use at\n"
.string "the LILYCOVE CITY port.\p"
.string "Why not give it a try and see what\n"

View File

@@ -42,10 +42,12 @@ static struct BgControl sGpuBgConfigs;
static struct BgConfig2 sGpuBgConfigs2[NUM_BACKGROUNDS];
static u32 sDmaBusyBitfield[NUM_BACKGROUNDS];
u32 gUnneededFireRedVariable;
u32 gWindowTileAutoAllocEnabled;
static const struct BgConfig sZeroedBgControlStruct = { 0 };
static u32 GetBgType(u8 bg);
void ResetBgs(void)
{
ResetBgControlStructs();
@@ -288,7 +290,8 @@ bool8 IsInvalidBg(u8 bg)
return FALSE;
}
int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4)
// From FRLG. Dummied out.
int BgTileAllocOp(int bg, int offset, int count, int mode)
{
return 0;
}
@@ -303,7 +306,7 @@ void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable)
sDmaBusyBitfield[i] = 0;
}
gUnneededFireRedVariable = leftoverFireRedLeafGreenVariable;
gWindowTileAutoAllocEnabled = leftoverFireRedLeafGreenVariable;
}
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates)
@@ -392,10 +395,8 @@ u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset)
sDmaBusyBitfield[cursor / 0x20] |= (1 << (cursor % 0x20));
if (gUnneededFireRedVariable == 1)
{
DummiedOutFireRedLeafGreenTileAllocFunc(bg, tileOffset / 0x20, size / 0x20, 1);
}
if (gWindowTileAutoAllocEnabled == TRUE)
BgTileAllocOp(bg, tileOffset / 0x20, size / 0x20, 1);
return cursor;
}
@@ -523,9 +524,9 @@ u16 GetBgAttribute(u8 bg, u8 attributeId)
case BG_ATTR_METRIC:
switch (GetBgType(bg))
{
case 0:
case BG_TYPE_NORMAL:
return GetBgMetricTextMode(bg, 0) * 0x800;
case 1:
case BG_TYPE_AFFINE:
return GetBgMetricAffineMode(bg, 0) * 0x100;
default:
return 0;
@@ -552,14 +553,14 @@ s32 ChangeBgX(u8 bg, s32 value, u8 op)
switch (op)
{
case 0:
case BG_COORD_SET:
default:
sGpuBgConfigs2[bg].bg_x = value;
break;
case 1:
case BG_COORD_ADD:
sGpuBgConfigs2[bg].bg_x += value;
break;
case 2:
case BG_COORD_SUB:
sGpuBgConfigs2[bg].bg_x -= value;
break;
}
@@ -632,14 +633,14 @@ s32 ChangeBgY(u8 bg, s32 value, u8 op)
switch (op)
{
case 0:
case BG_COORD_SET:
default:
sGpuBgConfigs2[bg].bg_y = value;
break;
case 1:
case BG_COORD_ADD:
sGpuBgConfigs2[bg].bg_y += value;
break;
case 2:
case BG_COORD_SUB:
sGpuBgConfigs2[bg].bg_y -= value;
break;
}
@@ -702,14 +703,14 @@ s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op)
switch (op)
{
case 0:
case BG_COORD_SET:
default:
sGpuBgConfigs2[bg].bg_y = value;
break;
case 1:
case BG_COORD_ADD:
sGpuBgConfigs2[bg].bg_y += value;
break;
case 2:
case BG_COORD_SUB:
sGpuBgConfigs2[bg].bg_y -= value;
break;
}
@@ -891,10 +892,10 @@ void CopyBgTilemapBufferToVram(u8 bg)
{
switch (GetBgType(bg))
{
case 0:
case BG_TYPE_NORMAL:
sizeToLoad = GetBgMetricTextMode(bg, 0) * 0x800;
break;
case 1:
case BG_TYPE_AFFINE:
sizeToLoad = GetBgMetricAffineMode(bg, 0) * 0x100;
break;
default:
@@ -915,7 +916,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
{
switch (GetBgType(bg))
{
case 0:
case BG_TYPE_NORMAL:
{
const u16 * srcCopy = src;
for (destY16 = destY; destY16 < (destY + height); destY16++)
@@ -927,7 +928,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
}
break;
}
case 1:
case BG_TYPE_AFFINE:
{
const u8 * srcCopy = src;
mode = GetBgMetricAffineMode(bg, 0x1);
@@ -963,7 +964,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
screenHeight = GetBgMetricTextMode(bg, 0x2) * 0x20;
switch (GetBgType(bg))
{
case 0:
case BG_TYPE_NORMAL:
srcPtr = src + ((srcY * srcWidth) + srcX) * 2;
for (i = destX; i < (destX + rectWidth); i++)
{
@@ -976,7 +977,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
srcPtr += (srcWidth - destY) * 2;
}
break;
case 1:
case BG_TYPE_AFFINE:
srcPtr = src + ((srcY * srcWidth) + srcX);
var = GetBgMetricAffineMode(bg, 0x1);
for (i = destX; i < (destX + rectWidth); i++)
@@ -1003,7 +1004,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
{
switch (GetBgType(bg))
{
case 0:
case BG_TYPE_NORMAL:
for (y16 = y; y16 < (y + height); y16++)
{
for (x16 = x; x16 < (x + width); x16++)
@@ -1012,7 +1013,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
}
}
break;
case 1:
case BG_TYPE_AFFINE:
mode = GetBgMetricAffineMode(bg, 0x1);
for (y16 = y; y16 < (y + height); y16++)
{
@@ -1046,7 +1047,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
mode2 = GetBgMetricTextMode(bg, 0x2) * 0x20;
switch (GetBgType(bg))
{
case 0:
case BG_TYPE_NORMAL:
for (y16 = y; y16 < (y + height); y16++)
{
for (x16 = x; x16 < (x + width); x16++)
@@ -1056,7 +1057,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
}
}
break;
case 1:
case BG_TYPE_AFFINE:
mode3 = GetBgMetricAffineMode(bg, 0x1);
for (y16 = y; y16 < (y + height); y16++)
{
@@ -1190,7 +1191,7 @@ void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s
*dest = var;
}
u32 GetBgType(u8 bg)
static u32 GetBgType(u8 bg)
{
u8 mode = GetBgMode();
@@ -1202,31 +1203,31 @@ u32 GetBgType(u8 bg)
{
case 0:
case 1:
return 0;
return BG_TYPE_NORMAL;
}
break;
case 2:
switch (mode)
{
case 0:
return 0;
return BG_TYPE_NORMAL;
case 1:
case 2:
return 1;
return BG_TYPE_AFFINE;
}
break;
case 3:
switch (mode)
{
case 0:
return 0;
return BG_TYPE_NORMAL;
case 2:
return 1;
return BG_TYPE_AFFINE;
}
break;
}
return 0xFFFF;
return BG_TYPE_NONE;
}
bool32 IsInvalidBg32(u8 bg)

View File

@@ -1,16 +1,6 @@
#ifndef GUARD_BG_H
#define GUARD_BG_H
struct BGCntrlBitfield // for the I/O registers
{
volatile u16 priority:2;
volatile u16 charBaseBlock:2;
volatile u16 field_0_2:4;
volatile u16 field_1_0:5;
volatile u16 areaOverflowMode:1;
volatile u16 screenSize:2;
};
enum
{
BG_ATTR_CHARBASEINDEX = 1,
@@ -25,6 +15,18 @@ enum
BG_ATTR_BASETILE,
};
enum {
BG_TYPE_NORMAL,
BG_TYPE_AFFINE,
BG_TYPE_NONE = 0xFFFF
};
enum {
BG_COORD_SET,
BG_COORD_ADD,
BG_COORD_SUB,
};
struct BgTemplate
{
u16 bg:2; // 0x1, 0x2 -> 0x3
@@ -43,7 +45,7 @@ void Unused_ResetBgControlStruct(u8 bg);
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode);
void SetTextModeAndHideBgs(void);
bool8 IsInvalidBg(u8 bg);
int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4);
int BgTileAllocOp(int bg, int offset, int count, int mode);
void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable);
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates);
void InitBgFromTemplate(const struct BgTemplate *template);
@@ -78,7 +80,6 @@ u16 GetBgMetricTextMode(u8 bg, u8 whichMetric);
u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric);
u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight);
void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2);
u32 GetBgType(u8 bg);
bool32 IsInvalidBg32(u8 bg);
bool32 IsTileMapOutsideWram(u8 bg);

View File

@@ -17,8 +17,8 @@ static const u32 sUnused[] = {
(1 << 26) | (1 << 4) | (1 << 2) | (1 << 1),
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 1),
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1),
(1 << 25) | (1 << 8),
(1 << 27) | (1 << 10),
(1 << 25) | (1 << 8),
(1 << 27) | (1 << 10),
};
const u16 gOverworldBackgroundLayerFlags[] = {

View File

@@ -210,7 +210,7 @@ const union AffineAnimCmd * const gDummySpriteAffineAnimTable[] = { &sDummyAffin
const struct SpriteTemplate gDummySpriteTemplate =
{
.tileTag = 0,
.paletteTag = 0xFFFF,
.paletteTag = TAG_NONE,
.oam = &gDummyOamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
@@ -248,7 +248,7 @@ static const AffineAnimCmdFunc sAffineAnimCmdFuncs[] =
static const struct OamDimensions32 sOamDimensions32[3][4] =
{
[ST_OAM_SQUARE] =
[ST_OAM_SQUARE] =
{
[SPRITE_SIZE(8x8)] = { 8, 8 },
[SPRITE_SIZE(16x16)] = { 16, 16 },
@@ -262,7 +262,7 @@ static const struct OamDimensions32 sOamDimensions32[3][4] =
[SPRITE_SIZE(32x16)] = { 32, 16 },
[SPRITE_SIZE(64x32)] = { 64, 32 },
},
[ST_OAM_V_RECTANGLE] =
[ST_OAM_V_RECTANGLE] =
{
[SPRITE_SIZE(8x16)] = { 8, 16 },
[SPRITE_SIZE(8x32)] = { 8, 32 },
@@ -273,7 +273,7 @@ static const struct OamDimensions32 sOamDimensions32[3][4] =
static const struct OamDimensions sOamDimensions[3][4] =
{
[ST_OAM_SQUARE] =
[ST_OAM_SQUARE] =
{
[SPRITE_SIZE(8x8)] = { 8, 8 },
[SPRITE_SIZE(16x16)] = { 16, 16 },
@@ -287,7 +287,7 @@ static const struct OamDimensions sOamDimensions[3][4] =
[SPRITE_SIZE(32x16)] = { 32, 16 },
[SPRITE_SIZE(64x32)] = { 64, 32 },
},
[ST_OAM_V_RECTANGLE] =
[ST_OAM_V_RECTANGLE] =
{
[SPRITE_SIZE(8x16)] = { 8, 16 },
[SPRITE_SIZE(8x32)] = { 8, 32 },
@@ -588,7 +588,7 @@ u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y,
CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode);
if (template->tileTag == 0xFFFF)
if (template->tileTag == TAG_NONE)
{
s16 tileNum;
sprite->images = template->images;
@@ -611,7 +611,7 @@ u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y,
if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)
InitSpriteAffineAnim(sprite);
if (template->paletteTag != 0xFFFF)
if (template->paletteTag != TAG_NONE)
sprite->oam.paletteNum = IndexOfSpritePaletteTag(template->paletteTag);
return index;
@@ -893,7 +893,7 @@ void ResetAllSprites(void)
// UB: template pointer may point to freed temporary storage
void FreeSpriteTiles(struct Sprite *sprite)
{
if (sprite->template->tileTag != 0xFFFF)
if (sprite->template->tileTag != TAG_NONE)
FreeSpriteTilesByTag(sprite->template->tileTag);
}
@@ -1540,7 +1540,7 @@ void FreeSpriteTilesByTag(u16 tag)
for (i = start; i < start + count; i++)
FREE_SPRITE_TILE(i);
sSpriteTileRangeTags[index] = 0xFFFF;
sSpriteTileRangeTags[index] = TAG_NONE;
}
}
@@ -1550,7 +1550,7 @@ void FreeSpriteTileRanges(void)
for (i = 0; i < MAX_SPRITES; i++)
{
sSpriteTileRangeTags[i] = 0xFFFF;
sSpriteTileRangeTags[i] = TAG_NONE;
SET_SPRITE_TILE_RANGE(i, 0, 0);
}
}
@@ -1580,16 +1580,16 @@ u16 GetSpriteTileTagByTileStart(u16 start)
for (i = 0; i < MAX_SPRITES; i++)
{
if (sSpriteTileRangeTags[i] != 0xFFFF && sSpriteTileRanges[i * 2] == start)
if (sSpriteTileRangeTags[i] != TAG_NONE && sSpriteTileRanges[i * 2] == start)
return sSpriteTileRangeTags[i];
}
return 0xFFFF;
return TAG_NONE;
}
void AllocSpriteTileRange(u16 tag, u16 start, u16 count)
{
u8 freeIndex = IndexOfSpriteTileTag(0xFFFF);
u8 freeIndex = IndexOfSpriteTileTag(TAG_NONE);
sSpriteTileRangeTags[freeIndex] = tag;
SET_SPRITE_TILE_RANGE(freeIndex, start, count);
}
@@ -1599,7 +1599,7 @@ void FreeAllSpritePalettes(void)
u8 i;
gReservedSpritePaletteCount = 0;
for (i = 0; i < 16; i++)
sSpritePaletteTags[i] = 0xFFFF;
sSpritePaletteTags[i] = TAG_NONE;
}
u8 LoadSpritePalette(const struct SpritePalette *palette)
@@ -1609,7 +1609,7 @@ u8 LoadSpritePalette(const struct SpritePalette *palette)
if (index != 0xFF)
return index;
index = IndexOfSpritePaletteTag(0xFFFF);
index = IndexOfSpritePaletteTag(TAG_NONE);
if (index == 0xFF)
{
@@ -1638,7 +1638,7 @@ void DoLoadSpritePalette(const u16 *src, u16 paletteOffset)
u8 AllocSpritePalette(u16 tag)
{
u8 index = IndexOfSpritePaletteTag(0xFFFF);
u8 index = IndexOfSpritePaletteTag(TAG_NONE);
if (index == 0xFF)
{
return 0xFF;
@@ -1669,7 +1669,7 @@ void FreeSpritePaletteByTag(u16 tag)
{
u8 index = IndexOfSpritePaletteTag(tag);
if (index != 0xFF)
sSpritePaletteTags[index] = 0xFFFF;
sSpritePaletteTags[index] = TAG_NONE;
}
void SetSubspriteTables(struct Sprite *sprite, const struct SubspriteTable *subspriteTables)

View File

@@ -3,7 +3,7 @@
#define MAX_SPRITES 64
#define SPRITE_NONE 0xFF
#define SPRITE_INVALID_TAG 0xFFFF
#define TAG_NONE 0xFFFF
struct SpriteSheet
{

View File

@@ -384,18 +384,18 @@ u8 *StringExpandPlaceholders(u8 *dest, const u8 *src)
u8 *StringBraille(u8 *dest, const u8 *src)
{
const u8 setBrailleFont[] = {
EXT_CTRL_CODE_BEGIN,
EXT_CTRL_CODE_SIZE,
6,
EOS
const u8 setBrailleFont[] = {
EXT_CTRL_CODE_BEGIN,
EXT_CTRL_CODE_SIZE,
6,
EOS
};
const u8 gotoLine2[] = {
CHAR_NEWLINE,
EXT_CTRL_CODE_BEGIN,
EXT_CTRL_CODE_SHIFT_DOWN,
2,
EOS
const u8 gotoLine2[] = {
CHAR_NEWLINE,
EXT_CTRL_CODE_BEGIN,
EXT_CTRL_CODE_SHIFT_DOWN,
2,
EOS
};
dest = StringCopy(dest, setBrailleFont);
@@ -630,7 +630,7 @@ bool32 IsStringJapanese(u8 *str)
{
while (*str != EOS)
{
if (*str < CHAR_0)
if (*str <= JAPANESE_CHAR_END)
if (*str != CHAR_SPACE)
return TRUE;
str++;
@@ -639,13 +639,13 @@ bool32 IsStringJapanese(u8 *str)
return FALSE;
}
bool32 sub_800924C(u8 *str, s32 n)
bool32 IsStringNJapanese(u8 *str, s32 n)
{
s32 i;
for (i = 0; *str != EOS && i < n; i++)
{
if (*str < CHAR_0)
if (*str <= JAPANESE_CHAR_END)
if (*str != CHAR_SPACE)
return TRUE;
str++;

View File

@@ -37,7 +37,7 @@ u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n);
u32 StringLength_Multibyte(const u8 *str);
u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color);
bool32 IsStringJapanese(u8 *str);
bool32 sub_800924C(u8 *str, s32 n);
bool32 IsStringNJapanese(u8 *str, s32 n);
u8 GetExtCtrlCodeLength(u8 code);
s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2);
void ConvertInternationalString(u8 *s, u8 language);

View File

@@ -18,7 +18,7 @@
#define CHAR_O_ACUTE 0x0E
#define CHAR_O_CIRCUMFLEX 0x0F
#define CHAR_OE 0x10
#define CHAR_U_GRAVE 0x11
#define CHAR_U_GRAVE 0x11
#define CHAR_U_ACUTE 0x12
#define CHAR_U_CIRCUMFLEX 0x13
#define CHAR_N_TILDE 0x14
@@ -52,7 +52,7 @@
#define CHAR_LV 0x34
#define CHAR_EQUALS 0x35
#define CHAR_SEMICOLON 0x36
//
#define CHAR_BARD_WORD_DELIMIT 0x37 // Empty space to separate words in Bard's song
#define CHAR_INV_QUESTION_MARK 0x51
#define CHAR_INV_EXCL_MARK 0x52
#define CHAR_PK 0x53
@@ -71,7 +71,7 @@
//
#define CHAR_i_ACUTE 0x6F
//
#define CHAR_GENDERLESS 0x77 // Empty space for lack of gender icon
#define CHAR_SPACER 0x77 // Empty space
//
#define CHAR_UP_ARROW 0x79
#define CHAR_DOWN_ARROW 0x7A
@@ -258,13 +258,17 @@
#define PLACEHOLDER_ID_VERSION 0x7
#define PLACEHOLDER_ID_AQUA 0x8
#define PLACEHOLDER_ID_MAGMA 0x9
#define PLACEHOLDER_ID_ARCHIE 0xA
#define PLACEHOLDER_ID_ARCHIE 0xA
#define PLACEHOLDER_ID_MAXIE 0xB
#define PLACEHOLDER_ID_KYOGRE 0xC
#define PLACEHOLDER_ID_GROUDON 0xD
// battle placeholders are located in battle_message.h
// Hiragana from 0x1-0x50, Katakana from 0x51-0xA0.
// This excludes Japanese punctuation, which end at 0xB0
#define JAPANESE_CHAR_END 0xA0
#define NUM_TEXT_PRINTERS 32
#define TEXT_SPEED_FF 0xFF

View File

@@ -10,7 +10,7 @@ u32 gUnusedWindowVar2;
u8 gTransparentTileNumber;
u32 gUnusedWindowVar3;
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
extern u32 gUnneededFireRedVariable;
extern u32 gWindowTileAutoAllocEnabled;
#define WINDOWS_MAX 32
@@ -55,9 +55,9 @@ bool16 InitWindows(const struct WindowTemplate *templates)
for (i = 0, allocatedBaseBlock = 0, bgLayer = templates[i].bg; bgLayer != 0xFF && i < WINDOWS_MAX; ++i, bgLayer = templates[i].bg)
{
if (gUnneededFireRedVariable == 1)
if (gWindowTileAutoAllocEnabled == TRUE)
{
allocatedBaseBlock = DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, 0, templates[i].width * templates[i].height, 0);
allocatedBaseBlock = BgTileAllocOp(bgLayer, 0, templates[i].width * templates[i].height, 0);
if (allocatedBaseBlock == -1)
return FALSE;
}
@@ -100,10 +100,10 @@ bool16 InitWindows(const struct WindowTemplate *templates)
gWindows[i].tileData = allocatedTilemapBuffer;
gWindows[i].window = templates[i];
if (gUnneededFireRedVariable == 1)
if (gWindowTileAutoAllocEnabled == TRUE)
{
gWindows[i].window.baseBlock = allocatedBaseBlock;
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, allocatedBaseBlock, templates[i].width * templates[i].height, 1);
BgTileAllocOp(bgLayer, allocatedBaseBlock, templates[i].width * templates[i].height, 1);
}
}
@@ -132,9 +132,9 @@ u16 AddWindow(const struct WindowTemplate *template)
bgLayer = template->bg;
allocatedBaseBlock = 0;
if (gUnneededFireRedVariable == 1)
if (gWindowTileAutoAllocEnabled == TRUE)
{
allocatedBaseBlock = DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, 0, template->width * template->height, 0);
allocatedBaseBlock = BgTileAllocOp(bgLayer, 0, template->width * template->height, 0);
if (allocatedBaseBlock == -1)
return WINDOW_NONE;
@@ -174,10 +174,10 @@ u16 AddWindow(const struct WindowTemplate *template)
gWindows[win].tileData = allocatedTilemapBuffer;
gWindows[win].window = *template;
if (gUnneededFireRedVariable == 1)
if (gWindowTileAutoAllocEnabled == TRUE)
{
gWindows[win].window.baseBlock = allocatedBaseBlock;
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
BgTileAllocOp(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
}
return win;
@@ -201,9 +201,9 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template)
bgLayer = template->bg;
allocatedBaseBlock = 0;
if (gUnneededFireRedVariable == 1)
if (gWindowTileAutoAllocEnabled == TRUE)
{
allocatedBaseBlock = DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, 0, template->width * template->height, 0);
allocatedBaseBlock = BgTileAllocOp(bgLayer, 0, template->width * template->height, 0);
if (allocatedBaseBlock == -1)
return WINDOW_NONE;
@@ -211,10 +211,10 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template)
gWindows[win].window = *template;
if (gUnneededFireRedVariable == 1)
if (gWindowTileAutoAllocEnabled == TRUE)
{
gWindows[win].window.baseBlock = allocatedBaseBlock;
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
BgTileAllocOp(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
}
return win;
@@ -224,10 +224,8 @@ void RemoveWindow(u8 windowId)
{
u8 bgLayer = gWindows[windowId].window.bg;
if (gUnneededFireRedVariable == 1)
{
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, gWindows[windowId].window.baseBlock, gWindows[windowId].window.width * gWindows[windowId].window.height, 2);
}
if (gWindowTileAutoAllocEnabled == TRUE)
BgTileAllocOp(bgLayer, gWindows[windowId].window.baseBlock, gWindows[windowId].window.width * gWindows[windowId].window.height, 2);
gWindows[windowId].window = sDummyWindowTemplate;

View File

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

View File

Before

Width:  |  Height:  |  Size: 144 B

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B

View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 311 B

View File

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 279 B

View File

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 279 B

View File

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 279 B

View File

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 279 B

View File

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

View File

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 534 B

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 225 B

View File

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

@@ -120,10 +120,10 @@ typedef struct InitializeParametersTag {
// rfu_REQ_configSystem argument
u8 maxMFrame; // Maximum number of times to re-transmit of RFU level
u8 MC_TimerCount; // MC_Timer count (x16.7ms)
u16 availSlot_flag; // Use RFU-API constant "AVAIL_SLOT1-4" to specify the maximum number of child devices (1 - 4) that can be connected to a parent device.
u16 availSlot_flag; // Use RFU-API constant "AVAIL_SLOT1-4" to specify the maximum number of child devices (1 - 4) that can be connected to a parent device.
// rfu_REQB_configGameData argument
u8 mboot_flag; // Multiplayer boot flag
u8 mboot_flag; // Multiplayer boot flag
u16 serialNo; // Game serial number
u8 *gameName; // Game name
u8 *userName; // User name
@@ -132,8 +132,8 @@ typedef struct InitializeParametersTag {
u8 fastSearchParent_flag; // Flag indicating whether parent fast search operation to be performed by child.
// Link recovery settings
u8 linkRecovery_enable; // Determines whether or not to execute the link recovery process when a link cut occurs
u16 linkRecovery_period; // Time to spend on the link recovery process (x 16.7 ms) Note: Runs for unlimited time when specifying 0.
u8 linkRecovery_enable; // Determines whether or not to execute the link recovery process when a link cut occurs
u16 linkRecovery_period; // Time to spend on the link recovery process (x 16.7 ms) Note: Runs for unlimited time when specifying 0.
// Setting for NI-type data transmit/receive period
u16 NI_failCounter_limit; // Limit for failCounter during NI type data transmit/receive (x 16.7 ms) Note: Runs for unlimited time when specifying 0.
@@ -142,44 +142,49 @@ typedef struct InitializeParametersTag {
// Timer that counts with the V-Blank cycle
typedef struct VblankTimerTag {
u8 active; // Timer ON/OFF (bits 0 - 3 indicate ON/OFF for each connected slot)
u16 count_max; // Maximum count value (x16.7ms)
u8 active; // Timer ON/OFF (bits 0 - 3 indicate ON/OFF for each connected slot)
u16 count_max; // Maximum count value (x16.7ms)
u16 count[RFU_CHILD_MAX]; // Current count value (x 16.7 ms) for each connected slot
}VBL_TIMER;
typedef struct linkManagerTag
{
/* 0x000 */ u8 acceptSlot_flag;
/* 0x001 */ u8 acceptCount;
/* 0x002 */ vu8 childClockSlave_flag;
/* 0x003 */ vu8 parentAck_flag;
/* 0x004 */ u8 state;
/* 0x005 */ u8 next_state;
/* 0x006 */ u8 parent_child;
/* 0x007 */ u8 pcswitch_flag;
/* 0x008 */ u8 RFU_powerOn_flag;
/* 0x009 */ u8 linkRecovery_enable;
/* 0x00a */ u8 linkRecovery_start_flag;
/* 0x00b */ u8 fastSearchParent_flag;
/* 0x00c */ u8 connectSlot_flag_old;
/* 0x00d */ u8 reserveDisconnectSlot_flag;
/* 0x00e */ u8 active;
/* 0x00f */ u8 msc_exe_flag;
/* 0x010 */ u8 child_slot;
/* 0x011 */ u8 state_bak[2];
/* 0x014 */ u16 param[2];
/* 0x018 */ u16 NI_failCounter_limit;
/* 0x01a */ u16 connect_period;
/* 0x01c */ u16 pcswitch_period_bak;
/* 0x01e */ u16 work;
/* 0x020 */ u16 *acceptable_serialNo_list;
/* 0x024 */ VBL_TIMER nameAcceptTimer;
/* 0x030 */ VBL_TIMER linkRecoveryTimer;
/* 0x03c */ INIT_PARAM *init_param;
/* 0x040 */ void (*LMAN_callback)(u8, u8);
/* 0x044 */ void (*MSC_callback)(u16);
u8 acceptSlot_flag; // Connection slot of child for which Link Manager accepted connection, expressed in bits. (This bit is not dropped for a broken link but is dropped with complete disconnection.)
u8 acceptCount; // Number of child devices for which connections accepted by Link Manager.
vu8 childClockSlave_flag; // Flag indicating whether AGB clock slave state is currently being maintained by child.
vu8 parentAck_flag; // Flag indicating the child devices for which the parent received ACK by UNI commmunication.
u8 state; // Current link manager state
u8 next_state; // State that the link manager transitions to when it is next called.
u8 parent_child; // Shows whether operating on a parent or child.
u8 pcswitch_flag; // Flag for parent-child switching search.
u8 RFU_powerOn_flag; // Flag indicating whether RFU has been powered down.
u8 linkRecovery_enable; // ON/OFF flag for the link recovery process.
u8 linkRecovery_start_flag; // Link recovery start flag
u8 fastSearchParent_flag; // ON/OFF flag for parent fast search by child.
u8 connectSlot_flag_old; // Value of rfuLinkStatus->connectSlot_flag (internally used by the API) when the link manager was called previously.
u8 reserveDisconnectSlot_flag; // Bit indication of the child slot that was reject by child connection authentication and is waiting for disconnect.
u8 active; // Link manager operating flag (internally used by the API)
u8 msc_exe_flag; // MSC callback executing flag (internally used by the API)
u8 child_slot; // Slot number where child device connected (internally used by the API)
u8 state_bak[2]; // Backup of link manager state (internally used by the API)
u16 param[2]; // Region where parameters returned when LMAN callback occurs are stored.
u16 NI_failCounter_limit; // Period of failCounter during NI type data transmit/receive (x 16.7 ms) Note: Runs for unlimited time when specifying 0
u16 connect_period; // Count for the period to execute a connection process (x 16.7 ms). Note: Runs for unlimited time when specifying 0.
u16 pcswitch_period_bak; // Backup for No. 3 SC period during parent-child switching search.
u16 work; // Work region used by the link manager.
u16 *acceptable_serialNo_list; // List of game serial numbers that can accept connections. (See Note below)
VBL_TIMER nameAcceptTimer; // Timer for period to receive game names from child device.
VBL_TIMER linkRecoveryTimer; // Timer for the link recovery process period for both parent and child. Note: Runs for unlimited time when specifying 0.
INIT_PARAM *init_param; // Pointer to parameter when executing initial setting process.
void (*LMAN_callback)(u8 msg,u8 param_count); // Pointer to user-defined LMAN callback routine generated by link manager operation.
void (*MSC_callback)(u16 REQ_commandID); // User-defined MSC callback function. (When defining the link manager, defines the MSC callback using rfu_LMAN_initializeManager or rfu_LMAN_setMSCCallback without using rfu_setMSCCallback.)
} LINK_MANAGER;
/* Note: The acceptable_serialNo_list uses the following format to specify a list of game serial numbers that the parent device can accept connections from and terminates with 0xffff. (maximum 16 devices)
u16 acceptable_serialNo_list[]={0x0001, 0x0002, 0x0003, 0xffff};
*/
extern struct linkManagerTag lman;
u32 rfu_LMAN_REQBN_softReset_and_checkID(void);

View File

@@ -17,6 +17,11 @@
#define GET_BATTLER_SIDE(battler) (GetBattlerPosition(battler) & BIT_SIDE)
#define GET_BATTLER_SIDE2(battler) (GET_BATTLER_POSITION(battler) & BIT_SIDE)
// Used to exclude moves learned temporarily by Transform or Mimic
#define MOVE_IS_PERMANENT(battler, moveSlot) \
(!(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) \
&& !(gDisableStructs[battler].mimickedMoves & gBitTable[moveSlot]))
// Battle Actions
// These determine what each battler will do in a turn
#define B_ACTION_USE_MOVE 0
@@ -32,34 +37,21 @@
#define B_ACTION_EXEC_SCRIPT 10
#define B_ACTION_TRY_FINISH 11
#define B_ACTION_FINISHED 12
#define B_ACTION_CANCEL_PARTNER 12 // when choosing an action
#define B_ACTION_NOTHING_FAINTED 13 // when choosing an action
#define B_ACTION_NONE 0xFF
#define MAX_TRAINER_ITEMS 4
#define MOVE_TARGET_SELECTED 0
#define MOVE_TARGET_DEPENDS (1 << 0)
#define MOVE_TARGET_USER_OR_SELECTED (1 << 1)
#define MOVE_TARGET_RANDOM (1 << 2)
#define MOVE_TARGET_BOTH (1 << 3)
#define MOVE_TARGET_USER (1 << 4)
#define MOVE_TARGET_FOES_AND_ALLY (1 << 5)
#define MOVE_TARGET_OPPONENTS_FIELD (1 << 6)
// array entries for battle communication
#define MULTIUSE_STATE 0
#define CURSOR_POSITION 1
#define TASK_ID 1 // task Id and cursor position share the same field
#define SPRITES_INIT_STATE1 1 // shares the Id as well
#define SPRITES_INIT_STATE2 2
#define MOVE_EFFECT_BYTE 3
#define ACTIONS_CONFIRMED_COUNT 4
#define MULTISTRING_CHOOSER 5
#define MISS_TYPE 6
#define MSG_DISPLAY 7
#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8
#define MOVE_TARGET_SELECTED 0x0
#define MOVE_TARGET_DEPENDS 0x1
#define MOVE_TARGET_USER_OR_SELECTED 0x2
#define MOVE_TARGET_RANDOM 0x4
#define MOVE_TARGET_BOTH 0x8
#define MOVE_TARGET_USER 0x10
#define MOVE_TARGET_FOES_AND_ALLY 0x20
#define MOVE_TARGET_OPPONENTS_FIELD 0x40
// For the second argument of GetMoveTarget, when no target override is needed
#define NO_TARGET_OVERRIDE 0
#define BATTLE_BUFFER_LINK_SIZE 0x1000
@@ -117,7 +109,7 @@ struct ProtectStruct
u32 confusionSelfDmg:1;
u32 targetNotAffected:1;
u32 chargingTurn:1;
u32 fleeFlag:2; // For RunAway and Smoke Ball.
u32 fleeType:2; // 0: Normal, 1: FLEE_ITEM, 2: FLEE_ABILITY
u32 usedImprisonedMove:1;
u32 loveImmobility:1;
u32 usedDisabledMove:1;
@@ -140,7 +132,7 @@ struct SpecialStatus
u32 intimidatedMon:1;
u32 traced:1;
u32 ppNotAffectedByPressure:1;
u32 flag40:1;
u32 faintedHasReplacement:1;
u32 focusBanded:1;
s32 dmg;
s32 physicalDmg;
@@ -379,9 +371,9 @@ struct BattleStruct
u8 field_52;
u8 sentInPokes;
bool8 selectionScriptFinished[MAX_BATTLERS_COUNT];
u8 field_58[4];
u8 battlerPartyIndexes[MAX_BATTLERS_COUNT];
u8 monToSwitchIntoId[MAX_BATTLERS_COUNT];
u8 field_60[4][3];
u8 battlerPartyOrders[MAX_BATTLERS_COUNT][PARTY_SIZE / 2];
u8 runTries;
u8 caughtMonNick[POKEMON_NAME_LENGTH + 1];
u8 unused_2;
@@ -400,7 +392,7 @@ struct BattleStruct
u8 stringMoveType;
u8 expGetterBattlerId;
u8 unused_5;
u8 field_91; // related to gAbsentBattlerFlags, possibly absent flags turn ago?
u8 absentBattlerFlags;
u8 palaceFlags; // First 4 bits are "is < 50% HP and not asleep" for each battler, last 4 bits are selected moves to pass to AI
u8 field_93; // related to choosing pokemon?
u8 wallyBattleState;
@@ -428,7 +420,7 @@ struct BattleStruct
u8 unused_6[3];
u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party.
u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte]
u16 castformPalette[MAX_BATTLERS_COUNT][16];
u16 castformPalette[NUM_CASTFORM_FORMS][16];
union {
struct LinkBattlerHeader linkBattlerHeader;
u32 battleVideo[2];
@@ -449,12 +441,16 @@ struct BattleStruct
u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed pokemon.
};
#define GET_MOVE_TYPE(move, typeArg) \
{ \
if (gBattleStruct->dynamicMoveType) \
typeArg = gBattleStruct->dynamicMoveType & 0x3F; \
else \
typeArg = gBattleMoves[move].type; \
#define F_DYNAMIC_TYPE_1 (1 << 6)
#define F_DYNAMIC_TYPE_2 (1 << 7)
#define DYNAMIC_TYPE_MASK (F_DYNAMIC_TYPE_1 - 1)
#define GET_MOVE_TYPE(move, typeArg) \
{ \
if (gBattleStruct->dynamicMoveType) \
typeArg = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; \
else \
typeArg = gBattleMoves[move].type; \
}
#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY)
@@ -478,6 +474,8 @@ struct BattleStruct
#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
// NOTE: The members of this struct have hard-coded offsets
// in include/constants/battle_script_commands.h
struct BattleScripting
{
s32 painSplitHp;
@@ -500,18 +498,15 @@ struct BattleScripting
u8 battleStyle;
u8 drawlvlupboxState;
u8 learnMoveState;
u8 field_20;
u8 pursuitDoublesAttacker;
u8 reshowMainState;
u8 reshowHelperState;
u8 levelUpHP;
u8 windowsType; // 0 - normal, 1 - battle arena
u8 windowsType; // B_WIN_TYPE_*
u8 multiplayerId;
u8 specialTrainerBattleType;
};
// rom_80A5C6C
struct BattleSpriteInfo
{
u16 invisible:1; // 0x1
@@ -594,16 +589,15 @@ struct BattleSpriteData
struct MonSpritesGfx
{
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
union
{
void* ptr[4];
u8* byte[4];
union {
void* ptr[MAX_BATTLERS_COUNT];
u8* byte[MAX_BATTLERS_COUNT];
} sprites;
struct SpriteTemplate templates[4];
struct SpriteFrameImage field_74[4][4];
u8 field_F4[0x80];
struct SpriteTemplate templates[MAX_BATTLERS_COUNT];
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][4];
u8 unusedArr[0x80];
u8 *barFontGfx;
void *field_178;
void *unusedPtr;
u16 *buffer;
};
@@ -627,8 +621,8 @@ extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT];
extern u32 gBattleTypeFlags;
extern u8 gBattleTerrain;
extern u32 gUnusedFirstBattleVar1;
extern u8 *gUnknown_0202305C;
extern u8 *gUnknown_02023060;
extern u8 *gBattleAnimBgTileBuffer;
extern u8 *gBattleAnimBgTilemapBuffer;
extern u8 gBattleBufferA[MAX_BATTLERS_COUNT][0x200];
extern u8 gBattleBufferB[MAX_BATTLERS_COUNT][0x200];
extern u8 gActiveBattler;

View File

@@ -64,12 +64,12 @@ s8 BattleAnimAdjustPanning(s8 pan);
s8 BattleAnimAdjustPanning2(s8 pan);
s16 KeepPanInRange(s16 a, int oldPan);
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
void sub_80A4720(u16 a, u16 *b, u32 c, u8 d);
void RelocateBattleBgPal(u16 paletteNum, u16 *dest, u32 offset, bool8 largeScreen);
void ResetBattleAnimBg(bool8);
// battle_intro.c
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);
void sub_8118FBC(int bgId, u8 arg1, u8 arg2, u8 battlerPosition, u8 arg4, u8 *arg5, u16 *arg6, u16 arg7);
void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8 *tiles, u16 *tilemap, u16 tilesOffset);
void HandleIntroSlide(u8 terrainId);
int GetAnimBgAttribute(u8 bgId, u8 attributeId);
@@ -107,7 +107,7 @@ void AnimTranslateLinear_WaitEnd(struct Sprite *sprite);
u8 GetBattlerSpriteBGPriority(u8 battlerId);
void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
void sub_80A8278(void);
void InitPrioritiesForVisibleBattlers(void);
void GetBattleAnimBg1Data(struct BattleAnimBgData*);
void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1);
u8 GetBattlerSpriteSubpriority(u8 battlerId);
@@ -125,7 +125,7 @@ u8 AnimDummyReturnArg(u8 battler);
s16 CloneBattlerSpriteWithBlend(u8);
void obj_delete_but_dont_free_vram(struct Sprite*);
u8 CreateInvisibleSpriteCopy(int, u8, int);
void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32);
void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, bool32);
void AnimLoadCompressedBgGfx(u32, const u32*, u32);
void UpdateAnimBg3ScreenSize(bool8);
void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *);

View File

@@ -7,8 +7,7 @@ void BattleArena_InitPoints(void);
void BattleArena_AddMindPoints(u8 battler);
void BattleArena_AddSkillPoints(u8 battler);
void BattleArena_DeductMindPoints(u8 battler, u16 stringId);
void sub_81A586C(u8 battler);
void DrawArenaRefereeTextBox(void);
void RemoveArenaRefereeTextBox(void);
void EraseArenaRefereeTextBox(void);
#endif //GUARD_BATTLE_ARENA_H

View File

@@ -1,8 +1,7 @@
#ifndef GUARD_BATTLE_CONTROLLERS_H
#define GUARD_BATTLE_CONTROLLERS_H
enum
{
enum {
REQUEST_ALL_BATTLE,
REQUEST_SPECIES_BATTLE,
REQUEST_HELDITEM_BATTLE,
@@ -67,19 +66,36 @@ enum
// Special arguments for Battle Controller functions.
#define RESET_ACTION_MOVE_SELECTION 0
#define RESET_ACTION_SELECTION 1
#define RESET_MOVE_SELECTION 2
enum { // Values given to the emit functions to choose gBattleBufferA or gBattleBufferB
BUFFER_A,
BUFFER_B
};
#define BALL_NO_SHAKES 0
#define BALL_1_SHAKE 1
#define BALL_2_SHAKES 2
#define BALL_3_SHAKES_FAIL 3
#define BALL_3_SHAKES_SUCCESS 4
#define BALL_TRAINER_BLOCK 5
enum {
RESET_ACTION_MOVE_SELECTION,
RESET_ACTION_SELECTION,
RESET_MOVE_SELECTION,
};
enum {
BALL_NO_SHAKES,
BALL_1_SHAKE,
BALL_2_SHAKES,
BALL_3_SHAKES_FAIL,
BALL_3_SHAKES_SUCCESS,
BALL_TRAINER_BLOCK,
};
enum {
LINK_STANDBY_MSG_STOP_BOUNCE,
LINK_STANDBY_STOP_BOUNCE_ONLY,
LINK_STANDBY_MSG_ONLY,
};
#define INSTANT_HP_BAR_DROP 32767
#define PARTY_SUMM_SKIP_DRAW_DELAY (1 << 7)
// Special return values in gBattleBufferB from Battle Controller functions.
#define RET_VALUE_LEVELED_UP 11
@@ -191,7 +207,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data); // unused
void BtlController_EmitLoadMonSprite(u8 bufferId);
void BtlController_EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
void BtlController_EmitReturnMonToBall(u8 bufferId, u8 arg1);
void BtlController_EmitReturnMonToBall(u8 bufferId, bool8 skipAnim);
void BtlController_EmitDrawTrainerPic(u8 bufferId);
void BtlController_EmitTrainerSlide(u8 bufferId);
void BtlController_EmitTrainerSlideBack(u8 bufferId);
@@ -203,11 +219,11 @@ void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data); // unused
void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit);
void BtlController_EmitPrintString(u8 bufferId, u16 stringId);
void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
void BtlController_EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId);
void BtlController_EmitYesNoBox(u8 bufferId);
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
void BtlController_EmitChooseItem(u8 bufferId, u8* arg1);
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4);
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8* data);
void BtlController_EmitCmd23(u8 bufferId); // unused
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
@@ -216,7 +232,7 @@ void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused
void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data);
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *unusedDumbDataParameter); // unused
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *c); // unused
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c);
@@ -233,7 +249,7 @@ void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM);
void BtlController_EmitFaintingCry(u8 bufferId);
void BtlController_EmitIntroSlide(u8 bufferId, u8 terrainId);
void BtlController_EmitIntroTrainerBallThrow(u8 bufferId);
void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 flags);
void BtlController_EmitHidePartyStatusSummary(u8 bufferId);
void BtlController_EmitEndBounceEffect(u8 bufferId);
void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);

View File

@@ -18,7 +18,6 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId);
void DecompressTrainerBackPic(u16 backPicId, u8 battlerId);
void BattleGfxSfxDummy3(u8 gender);
void FreeTrainerFrontPicPalette(u16 frontPicId);
void sub_805DFFC(void);
bool8 BattleLoadAllHealthBoxesGfx(u8 state);
void LoadBattleBarGfx(u8 arg0);
bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId);
@@ -39,7 +38,7 @@ void LoadAndCreateEnemyShadowSprites(void);
void SpriteCB_SetInvisible(struct Sprite *sprite);
void SetBattlerShadowSpriteCallback(u8 battlerId, u16 species);
void HideBattlerShadowSprite(u8 battlerId);
void sub_805EF14(void);
void FillAroundBattleWindows(void);
void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute);
void AllocateMonSpritesGfx(void);
void FreeMonSpritesGfx(void);

View File

@@ -7,7 +7,8 @@ struct TrainerMoney
u8 value;
};
struct UnknownPokemonStruct4
// For displaying a multi battle partner's Pokémon in the party menu
struct MultiPartnerMenuPokemon
{
/*0x00*/ u16 species;
/*0x02*/ u16 heldItem;
@@ -46,8 +47,6 @@ struct UnknownPokemonStruct4
void CB2_InitBattle(void);
void BattleMainCB2(void);
void CB2_QuitRecordedBattle(void);
void sub_8038528(struct Sprite* sprite);
void sub_8038A04(void); // unused
void VBlankCB_Battle(void);
void SpriteCB_VsLetterDummy(struct Sprite *sprite);
void SpriteCB_VsLetterInit(struct Sprite *sprite);
@@ -59,13 +58,12 @@ void SpriteCallbackDummy_2(struct Sprite *sprite);
void SpriteCB_FaintOpponentMon(struct Sprite *sprite);
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite);
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite);
void SpriteCb_OpponentMonFromBall(struct Sprite *sprite);
void SpriteCB_OpponentMonFromBall(struct Sprite *sprite);
void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite);
void SpriteCB_FaintSlideAnim(struct Sprite *sprite);
void DoBounceEffect(u8 battlerId, u8 b, s8 c, s8 d);
void EndBounceEffect(u8 battlerId, bool8 b);
void SpriteCb_PlayerMonFromBall(struct Sprite *sprite);
void sub_8039E60(struct Sprite *sprite);
void SpriteCB_PlayerMonFromBall(struct Sprite *sprite);
void SpriteCB_TrainerThrowObject(struct Sprite *sprite);
void sub_8039E9C(struct Sprite *sprite);
void BeginBattleIntroDummy(void);
@@ -82,9 +80,9 @@ void RunBattleScriptCommands(void);
bool8 TryRunFromBattle(u8 battlerId);
void SpecialStatusesClear(void);
extern struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE];
extern struct MultiPartnerMenuPokemon gMultiPartnerParty[MULTI_PARTY_SIZE];
extern const struct SpriteTemplate gUnknown_0831AC88;
extern const struct SpriteTemplate gUnusedBattleInitSprite;
extern const struct OamData gOamData_BattleSpriteOpponentSide;
extern const struct OamData gOamData_BattleSpritePlayerSide;
extern const u8 gTypeEffectiveness[336];

View File

@@ -63,7 +63,6 @@ void CB2_PyramidBagMenuFromStartMenu(void);
void CB2_ReturnToPyramidBagMenu(void);
void UpdatePyramidBagList(void);
void UpdatePyramidBagCursorPos(void);
void sub_81C4EFC(void);
void GoToBattlePyramidBagMenu(u8 location, void (*exitCallback)(void));
void Task_CloseBattlePyramidBagMessage(u8 taskId);
void TryStoreHeldItemsInPyramidBag(void);

Some files were not shown because too many files have changed in this diff Show More