diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 86dd652f4..164131896 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -29,11 +29,11 @@ .byte 0x6 .endm - .macro adjustnormaldamage + .macro adjustdamage .byte 0x7 .endm - .macro adjustnormaldamage2 + .macro multihitresultmessage .byte 0x8 .endm @@ -92,15 +92,21 @@ .4byte \ptr .endm - .macro seteffectwithchance + .macro setadditionaleffects .byte 0x15 .endm - .macro seteffectprimary + .macro seteffectprimary moveEffect=0 + .if \moveEffect != 0 + setmoveeffect \moveEffect + .endif .byte 0x16 .endm - .macro seteffectsecondary + .macro seteffectsecondary moveEffect=0 + .if \moveEffect != 0 + setmoveeffect \moveEffect + .endif .byte 0x17 .endm @@ -116,11 +122,11 @@ .4byte NULL .endm - .macro tryfaintmon_spikes battler:req, ptr:req + .macro tryfaintmon_spikes battler:req, instr:req .byte 0x19 .byte \battler .byte TRUE - .4byte \ptr + .4byte \instr .endm .macro dofaintanimation battler:req @@ -133,56 +139,65 @@ .byte \battler .endm - .macro jumpifstatus battler:req, status1:req, ptr:req + .macro jumpifstatus battler:req, flags:req, jumpInstr:req .byte 0x1c .byte \battler - .4byte \status1 - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifstatus2 battler:req, status2:req, ptr:req + .macro jumpifstatus2 battler:req, flags:req, jumpInstr:req .byte 0x1d .byte \battler - .4byte \status2 - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifability param0:req, ability:req, ptr:req + .macro jumpifability battler:req, ability:req, jumpInstr:req .byte 0x1e - .byte \param0 + .byte \battler .2byte \ability - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifsideaffecting battler:req, sidestatus:req, ptr:req + .macro jumpifsideaffecting battler:req, flags:req, jumpInstr:req .byte 0x1f .byte \battler - .2byte \sidestatus - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifstat battler:req, ifflag:req, stat:req, value:req, ptr + .macro jumpifstat battler:req, comparison:req, stat:req, value:req, jumpInstr:req .byte 0x20 .byte \battler - .byte \ifflag + .byte \comparison .byte \stat .byte \value - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifstatus3condition battler:req, status3:req, param2:req, ptr:req + .macro jumpifstatus3condition battler:req, flags:req, jumpIfTrue:req, jumpInstr:req .byte 0x21 .byte \battler - .4byte \status3 - .byte \param2 - .4byte \ptr + .4byte \flags + .byte \jumpIfTrue + .4byte \jumpInstr .endm - .macro jumpiftype battler:req, type:req, ptr:req + .macro jumpbasedontype battler:req, type:req, jumpIfType:req, jumpInstr:req .byte 0x22 .byte \battler .byte \type - .4byte \ptr + .byte \jumpIfType + .4byte \jumpInstr + .endm + + .macro jumpiftype battler:req, type:req, jumpInstr:req + jumpbasedontype \battler, \type, TRUE, \jumpInstr + .endm + + .macro jumpifnottype battler:req, type:req, jumpInstr:req + jumpbasedontype \battler, \type, FALSE, \jumpInstr .endm .macro getexp battler:req @@ -190,9 +205,9 @@ .byte \battler .endm - .macro checkteamslost ptr:req + .macro checkteamslost jumpInstr:req .byte 0x24 - .4byte \ptr + .4byte \jumpInstr .endm .macro movevaluescleanup @@ -204,128 +219,128 @@ .byte \value .endm - .macro decrementmultihit value:req + .macro decrementmultihit loopInstr:req .byte 0x27 + .4byte \loopInstr + .endm + + .macro goto instr:req + .byte 0x28 + .4byte \instr + .endm + + .macro jumpifbyte comparison:req, bytePtr:req, value:req, jumpInstr:req + .byte 0x29 + .byte \comparison + .4byte \bytePtr + .byte \value + .4byte \jumpInstr + .endm + + .macro jumpifhalfword comparison:req, halfwordPtr:req, value:req, jumpInstr:req + .byte 0x2a + .byte \comparison + .4byte \halfwordPtr + .2byte \value + .4byte \jumpInstr + .endm + + .macro jumpifword comparison:req, wordPtr:req, value:req, jumpInstr:req + .byte 0x2b + .byte \comparison + .4byte \wordPtr + .4byte \value + .4byte \jumpInstr + .endm + + .macro jumpifarrayequal array1:req, array2:req, size:req, jumpInstr:req + .byte 0x2c + .4byte \array1 + .4byte \array2 + .byte \size + .4byte \jumpInstr + .endm + + .macro jumpifarraynotequal array1:req, array2:req, size:req, jumpInstr:req + .byte 0x2d + .4byte \array1 + .4byte \array2 + .byte \size + .4byte \jumpInstr + .endm + + .macro setbyte bytePtr:req, value:req + .byte 0x2e + .4byte \bytePtr + .byte \value + .endm + + .macro addbyte bytePtr:req, value:req + .byte 0x2f + .4byte \bytePtr + .byte \value + .endm + + .macro subbyte bytePtr:req, value:req + .byte 0x30 + .4byte \bytePtr + .byte \value + .endm + + .macro copyarray dest:req, src:req, size:req + .byte 0x31 + .4byte \dest + .4byte \src + .byte \size + .endm + + .macro copyarraywithindex dest:req, src:req, indexPtr:req, size:req + .byte 0x32 + .4byte \dest + .4byte \src + .4byte \indexPtr + .byte \size + .endm + + .macro orbyte bytePtr:req, value:req + .byte 0x33 + .4byte \bytePtr + .byte \value + .endm + + .macro orhalfword halfwordPtr:req, value:req + .byte 0x34 + .4byte \halfwordPtr + .2byte \value + .endm + + .macro orword wordPtr:req, value:req + .byte 0x35 + .4byte \wordPtr .4byte \value .endm - .macro goto ptr:req - .byte 0x28 - .4byte \ptr - .endm - - .macro jumpifbyte ifflag:req, param1:req, param2:req, param3:req - .byte 0x29 - .byte \ifflag - .4byte \param1 - .byte \param2 - .4byte \param3 - .endm - - .macro jumpifhalfword ifflag:req, param1:req, param2:req, param3:req - .byte 0x2a - .byte \ifflag - .4byte \param1 - .2byte \param2 - .4byte \param3 - .endm - - .macro jumpifword ifflag:req, param1:req, param2:req, param3:req - .byte 0x2b - .byte \ifflag - .4byte \param1 - .4byte \param2 - .4byte \param3 - .endm - - .macro jumpifarrayequal param0:req, param1:req, param2:req, param3:req - .byte 0x2c - .4byte \param0 - .4byte \param1 - .byte \param2 - .4byte \param3 - .endm - - .macro jumpifarraynotequal param0:req, param1:req, param2:req, param3:req - .byte 0x2d - .4byte \param0 - .4byte \param1 - .byte \param2 - .4byte \param3 - .endm - - .macro setbyte ptr:req, param1:req - .byte 0x2e - .4byte \ptr - .byte \param1 - .endm - - .macro addbyte ptr:req, param1:req - .byte 0x2f - .4byte \ptr - .byte \param1 - .endm - - .macro subbyte ptr:req, param1:req - .byte 0x30 - .4byte \ptr - .byte \param1 - .endm - - .macro copyarray param0:req, param1:req, param2:req - .byte 0x31 - .4byte \param0 - .4byte \param1 - .byte \param2 - .endm - - .macro copyarraywithindex param0:req, param1:req, param2:req, param3:req - .byte 0x32 - .4byte \param0 - .4byte \param1 - .4byte \param2 - .byte \param3 - .endm - - .macro orbyte ptr:req, param1:req - .byte 0x33 - .4byte \ptr - .byte \param1 - .endm - - .macro orhalfword ptr:req, param1:req - .byte 0x34 - .4byte \ptr - .2byte \param1 - .endm - - .macro orword ptr:req, param1:req - .byte 0x35 - .4byte \ptr - .4byte \param1 - .endm - - .macro bicbyte ptr:req, param1:req + .macro bicbyte bytePtr:req, value:req .byte 0x36 - .4byte \ptr - .byte \param1 + .4byte \bytePtr + .byte \value .endm - .macro bichalfword ptr:req, param1:req + .macro bichalfword halfwordPtr:req, value:req .byte 0x37 - .4byte \ptr - .2byte \param1 + .4byte \halfwordPtr + .2byte \value .endm - .macro bicword ptr:req, param1:req + .macro bicword wordPtr:req, value:req .byte 0x38 - .4byte \ptr - .4byte \param1 + .4byte \wordPtr + .4byte \value .endm - .macro pause param0:req + .macro pause frames:req .byte 0x39 - .2byte \param0 + .2byte \frames .endm .macro waitstate @@ -353,62 +368,60 @@ .byte 0x3f .endm - .macro jumpifaffectedbyprotect ptr:req - .byte 0x40 - .4byte \ptr - .endm + @ unused5 + @.macro jumpifaffectedbyprotect ptr:req + @.byte 0x40 + @.4byte \ptr + @.endm - .macro call ptr:req + .macro call instr:req .byte 0x41 - .4byte \ptr + .4byte \instr .endm - .macro jumpiftype2 battler:req, type:req, ptr:req + .macro setroost .byte 0x42 - .byte \battler - .byte \type - .4byte \ptr .endm - .macro jumpifabilitypresent ability:req, ptr:req + .macro jumpifabilitypresent ability:req, jumpInstr:req .byte 0x43 .2byte \ability - .4byte \ptr + .4byte \jumpInstr .endm .macro endselectionscript .byte 0x44 .endm - .macro playanimation battler:req, animType:req, arg=NULL + .macro playanimation battler:req, animId:req, argPtr=NULL .byte 0x45 .byte \battler - .byte \animType - .4byte \arg + .byte \animId + .4byte \argPtr .endm - .macro playanimation_var battler:req, animType:req, arg=NULL + .macro playanimation_var battler:req, animIdPtr:req, argPtr=NULL .byte 0x46 .byte \battler - .4byte \animType - .4byte \arg + .4byte \animIdPtr + .4byte \argPtr .endm .macro setgraphicalstatchangevalues .byte 0x47 .endm - .macro playstatchangeanimation battler:req, param1:req, param2:req + .macro playstatchangeanimation battler:req, stats:req, flags:req .byte 0x48 .byte \battler - .byte \param1 - .byte \param2 + .byte \stats + .byte \flags .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 @@ -443,8 +456,9 @@ moveend 2, \to .endm - .macro typecalc2 + .macro sethealblock failInstr:req .byte 0x4a + .4byte \failInstr .endm .macro returnatktoball @@ -461,28 +475,28 @@ .byte \battler .endm - .macro switchinanim battler:req, dontclearsubstitutebit:req + .macro switchinanim battler:req, dontClearSubstitute:req .byte 0x4e .byte \battler - .byte \dontclearsubstitutebit + .byte \dontClearSubstitute .endm - .macro jumpifcantswitch battler:req, ptr:req + .macro jumpifcantswitch battler:req, jumpInstr:req .byte 0x4f .byte \battler - .4byte \ptr + .4byte \jumpInstr .endm - .macro openpartyscreen param0:req, param1:req + .macro openpartyscreen battler:req, failInstr:req .byte 0x50 - .byte \param0 - .4byte \param1 + .byte \battler + .4byte \failInstr .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 @@ -514,26 +528,27 @@ .byte 0x57 .endm - .macro returntoball battler:req + .macro returntoball battler:req, changingForm:req .byte 0x58 .byte \battler + .byte \changingForm .endm - .macro handlelearnnewmove param0:req, param1:req, param2:req + .macro handlelearnnewmove learnedMoveInstr:req, nothingToLearnInstr:req, isFirstMove:req .byte 0x59 - .4byte \param0 - .4byte \param1 - .byte \param2 + .4byte \learnedMoveInstr + .4byte \nothingToLearnInstr + .byte \isFirstMove .endm - .macro yesnoboxlearnmove param0:req + .macro yesnoboxlearnmove forgotMoveInstr:req .byte 0x5a - .4byte \param0 + .4byte \forgotMoveInstr .endm - .macro yesnoboxstoplearningmove param0:req + .macro yesnoboxstoplearningmove noInstr:req .byte 0x5b - .4byte \param0 + .4byte \noInstr .endm .macro hitanimation battler:req @@ -541,9 +556,8 @@ .byte \battler .endm - .macro getmoneyreward addr + .macro getmoneyreward .byte 0x5d - .4byte \addr .endm .macro updatebattlermoves battler:req @@ -555,9 +569,9 @@ .byte 0x5f .endm - .macro incrementgamestat param0:req + .macro incrementgamestat stat:req .byte 0x60 - .byte \param0 + .byte \stat .endm .macro drawpartystatussummary battler:req @@ -570,9 +584,9 @@ .byte \battler .endm - .macro jumptocalledmove param0:req + .macro jumptocalledmove notChosenMove:req .byte 0x63 - .byte \param0 + .byte \notChosenMove .endm .macro statusanimation battler:req @@ -586,11 +600,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 @@ -601,8 +615,9 @@ .byte 0x68 .endm - .macro adjustsetdamage + .macro setgravity failInstr:req .byte 0x69 + .4byte \failInstr .endm .macro removeitem battler:req @@ -631,7 +646,7 @@ .byte \battler .endm - .macro recordlastability battler:req + .macro recordability battler:req .byte 0x70 .byte \battler .endm @@ -640,9 +655,9 @@ .byte 0x71 .endm - .macro jumpifplayerran ptr:req + .macro jumpifplayerran jumpInstr:req .byte 0x72 - .4byte \ptr + .4byte \jumpInstr .endm .macro hpthresholds battler:req @@ -659,10 +674,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 @@ -677,14 +692,14 @@ .byte 0x79 .endm - .macro jumpifnexttargetvalid ptr:req + .macro jumpifnexttargetvalid jumpInstr:req .byte 0x7a - .4byte \ptr + .4byte \jumpInstr .endm - .macro tryhealhalfhealth param0:req, battler:req + .macro tryhealhalfhealth failInstr:req, battler:req .byte 0x7b - .4byte \param0 + .4byte \failInstr .byte \battler .endm @@ -704,52 +719,54 @@ .byte 0x7f .endm - .macro manipulatedamage param0:req + .macro manipulatedamage mode:req .byte 0x80 - .byte \param0 + .byte \mode .endm - .macro trysetrest param0:req + .macro trysetrest failInstr:req .byte 0x81 - .4byte \param0 + .4byte \failInstr .endm - .macro jumpifnotfirstturn ptr:req + .macro jumpifnotfirstturn jumpInstr:req .byte 0x82 - .4byte \ptr + .4byte \jumpInstr .endm - .macro nop + .macro setmiracleeye failInstr:req .byte 0x83 + .4byte \failInstr .endm - .macro jumpifcantmakeasleep param0:req + .macro jumpifuproarwakes jumpInstr:req .byte 0x84 - .4byte \param0 + .4byte \jumpInstr .endm - .macro stockpile + .macro stockpile id:req .byte 0x85 + .byte \id .endm - .macro stockpiletobasedamage param0:req + .macro stockpiletobasedamage failInstr:req .byte 0x86 - .4byte \param0 + .4byte \failInstr .endm - .macro stockpiletohpheal param0:req + .macro stockpiletohpheal failInstr:req .byte 0x87 - .4byte \param0 + .4byte \failInstr .endm - .macro negativedamage + .macro setdrainedhp .byte 0x88 .endm - .macro statbuffchange param0:req, param1:req + .macro statbuffchange flags:req, failInstr:req .byte 0x89 - .byte \param0 - .4byte \param1 + .2byte \flags + .4byte \failInstr .endm .macro normalisebuffs @@ -760,27 +777,40 @@ .byte 0x8b .endm - .macro confuseifrepeatingattackends + .macro twoturnmoveschargestringandanimation .byte 0x8c + .4byte 1f @animation then attack string + @default - attack string then animation + printsavedstring + waitmessage B_WAIT_TIME_LONG + attackanimation + waitanimation + goto 2f + 1: + attackanimation + waitanimation + printsavedstring + waitmessage B_WAIT_TIME_LONG + 2: .endm - .macro setmultihitcounter param0:req + .macro setmultihitcounter value:req .byte 0x8d - .byte \param0 + .byte \value .endm .macro initmultihitstring .byte 0x8e .endm - .macro forcerandomswitch param0:req + .macro forcerandomswitch failInstr:req .byte 0x8f - .4byte \param0 + .4byte \failInstr .endm - .macro tryconversiontypechange param0:req + .macro tryconversiontypechange failInstr:req .byte 0x90 - .4byte \param0 + .4byte \failInstr .endm .macro givepaydaymoney @@ -791,9 +821,9 @@ .byte 0x92 .endm - .macro tryKO param0:req + .macro tryKO failInstr:req .byte 0x93 - .4byte \param0 + .4byte \failInstr .endm .macro damagetohalftargethp @@ -808,9 +838,9 @@ .byte 0x96 .endm - .macro tryinfatuating param0:req + .macro tryinfatuating failInstr:req .byte 0x97 - .4byte \param0 + .4byte \failInstr .endm .macro updatestatusicon battler:req @@ -834,9 +864,9 @@ .byte 0x9c .endm - .macro mimicattackcopy param0:req + .macro mimicattackcopy failInstr:req .byte 0x9d - .4byte \param0 + .4byte \failInstr .endm .macro metronome @@ -851,48 +881,48 @@ .byte 0xa0 .endm - .macro counterdamagecalculator param0:req + .macro counterdamagecalculator failInstr:req .byte 0xa1 - .4byte \param0 + .4byte \failInstr .endm - .macro mirrorcoatdamagecalculator param0:req + .macro mirrorcoatdamagecalculator failInstr:req .byte 0xa2 - .4byte \param0 + .4byte \failInstr .endm - .macro disablelastusedattack param0:req + .macro disablelastusedattack failInstr:req .byte 0xa3 - .4byte \param0 + .4byte \failInstr .endm - .macro trysetencore param0:req + .macro trysetencore failInstr:req .byte 0xa4 - .4byte \param0 + .4byte \failInstr .endm - .macro painsplitdmgcalc param0:req + .macro painsplitdmgcalc failInstr:req .byte 0xa5 - .4byte \param0 + .4byte \failInstr .endm - .macro settypetorandomresistance param0:req + .macro settypetorandomresistance failInstr:req .byte 0xa6 - .4byte \param0 + .4byte \failInstr .endm .macro setalwayshitflag .byte 0xa7 .endm - .macro copymovepermanently param0:req + .macro copymovepermanently failInstr:req .byte 0xa8 - .4byte \param0 + .4byte \failInstr .endm - .macro trychoosesleeptalkmove param0:req + .macro trychoosesleeptalkmove failInstr:req .byte 0xa9 - .4byte \param0 + .4byte \failInstr .endm .macro setdestinybond @@ -903,39 +933,40 @@ .byte 0xab .endm - .macro remaininghptopower + .macro settailwind failInstr:req .byte 0xac + .4byte \failInstr .endm - .macro tryspiteppreduce param0:req + .macro tryspiteppreduce failInstr:req .byte 0xad - .4byte \param0 + .4byte \failInstr .endm .macro healpartystatus .byte 0xae .endm - .macro cursetarget param0:req + .macro cursetarget failInstr:req .byte 0xaf - .4byte \param0 + .4byte \failInstr .endm - .macro trysetspikes param0:req + .macro trysetspikes failInstr:req .byte 0xb0 - .4byte \param0 + .4byte \failInstr .endm .macro setforesight .byte 0xb1 .endm - .macro trysetperishsong param0:req + .macro trysetperishsong failInstr:req .byte 0xb2 - .4byte \param0 + .4byte \failInstr .endm - .macro rolloutdamagecalculation + .macro handlerollout .byte 0xb3 .endm @@ -945,12 +976,13 @@ .4byte \ptr .endm - .macro furycuttercalc + .macro handlefurycutter .byte 0xb5 .endm - .macro friendshiptodamagecalculation + .macro setembargo failInstr:req .byte 0xb6 + .4byte \failInstr .endm .macro presentdamagecalculation @@ -965,23 +997,23 @@ .byte 0xb9 .endm - .macro jumpifnopursuitswitchdmg param0:req + .macro jumpifnopursuitswitchdmg jumpInstr:req .byte 0xba - .4byte \param0 + .4byte \jumpInstr .endm .macro setsunny .byte 0xbb .endm - .macro maxattackhalvehp param0:req + .macro halvehp failInstr:req .byte 0xbc - .4byte \param0 + .4byte \failInstr .endm - .macro copyfoestats param0:req + .macro copyfoestats unused:req .byte 0xbd - .4byte \param0 + .4byte \unused .endm .macro rapidspinfree @@ -992,36 +1024,53 @@ .byte 0xbf .endm - .macro recoverbasedonsunlight param0:req + .macro recoverbasedonsunlight failInstr:req .byte 0xc0 - .4byte \param0 + .4byte \failInstr .endm - .macro hiddenpowercalc + .macro setstickyweb failInstr:req .byte 0xc1 + .4byte \failInstr .endm .macro selectfirstvalidtarget .byte 0xc2 .endm - .macro trysetfutureattack param0:req + .macro trysetfutureattack failInstr:req .byte 0xc3 - .4byte \param0 + .4byte \failInstr .endm - .macro trydobeatup param0:req, param1:req + .macro trydobeatup endInstr, failInstr .byte 0xc4 - .4byte \param0 - .4byte \param1 + .4byte \endInstr + .4byte \failInstr .endm - .macro setsemiinvulnerablebit + .macro setsemiinvulnerablebit clear=FALSE .byte 0xc5 + .byte \clear .endm .macro clearsemiinvulnerablebit + setsemiinvulnerablebit TRUE + .endm + + .macro tryfiretwoturnmovenowbyeffect battler:req, checkChargeTurnEffects:req, jumpInstr:req .byte 0xc6 + .byte \battler + .byte \checkChargeTurnEffects + .4byte \jumpInstr + .endm + + .macro tryfiretwoturnmovewithoutcharging battler:req, jumpInstr:req + tryfiretwoturnmovenowbyeffect \battler, TRUE, \jumpInstr + .endm + + .macro tryfiretwoturnmoveaftercharging battler:req, jumpInstr:req + tryfiretwoturnmovenowbyeffect \battler, FALSE, \jumpInstr .endm .macro setminimize @@ -1032,124 +1081,129 @@ .byte 0xc8 .endm - .macro trymemento ptr:req + .macro trymemento failInstr:req .byte 0xc9 - .4byte \ptr + .4byte \failInstr .endm .macro setforcedtarget .byte 0xca .endm - .macro setcharge + .macro setcharge battler:req .byte 0xcb + .byte \battler .endm .macro callterrainattack .byte 0xcc .endm - .macro cureifburnedparalysedorpoisoned param0:req + .macro cureifburnedparalysedorpoisoned failInstr:req .byte 0xcd - .4byte \param0 + .4byte \failInstr .endm - .macro settorment param0:req + .macro settorment failInstr:req .byte 0xce - .4byte \param0 + .4byte \failInstr .endm - .macro jumpifnodamage param0:req + .macro jumpifnodamage jumpInstr:req .byte 0xcf - .4byte \param0 + .4byte \jumpInstr .endm - .macro settaunt param0:req + .macro settaunt failInstr:req .byte 0xd0 - .4byte \param0 + .4byte \failInstr .endm - .macro trysethelpinghand param0:req + .macro trysethelpinghand failInstr:req .byte 0xd1 - .4byte \param0 + .4byte \failInstr .endm - .macro tryswapitems param0:req + .macro tryswapitems failInstr:req .byte 0xd2 - .4byte \param0 + .4byte \failInstr .endm - .macro trycopyability param0:req + .macro trycopyability battler:req, failInstr:req .byte 0xd3 - .4byte \param0 + .byte \battler + .4byte \failInstr .endm - .macro trywish param0:req, param1:req + .macro trywish turnNumber:req, failInstr:req .byte 0xd4 - .byte \param0 - .4byte \param1 + .byte \turnNumber + .4byte \failInstr .endm - .macro trysetroots param0:req + .macro settoxicspikes failInstr:req .byte 0xd5 - .4byte \param0 + .4byte \failInstr .endm - .macro doubledamagedealtifdamaged + .macro setgastroacid failInstr:req .byte 0xd6 + .4byte \failInstr .endm - .macro setyawn param0:req + .macro setyawn failInstr:req .byte 0xd7 - .4byte \param0 + .4byte \failInstr .endm - .macro setdamagetohealthdifference param0:req + .macro setdamagetohealthdifference failInstr:req .byte 0xd8 - .4byte \param0 + .4byte \failInstr .endm - .macro scaledamagebyhealthratio + .macro setroom .byte 0xd9 .endm - .macro tryswapabilities param0:req + .macro tryswapabilities failInstr:req .byte 0xda - .4byte \param0 + .4byte \failInstr .endm - .macro tryimprison param0:req + .macro tryimprison failInstr:req .byte 0xdb - .4byte \param0 + .4byte \failInstr .endm - .macro trysetgrudge param0:req + .macro setstealthrock failInstr:req .byte 0xdc - .4byte \param0 + .4byte \failInstr .endm - .macro weightdamagecalculation + .macro setuserstatus3 flags:req, failInstr:req .byte 0xdd + .4byte \flags + .4byte \failInstr .endm - .macro assistattackselect param0:req + .macro assistattackselect failInstr:req .byte 0xde - .4byte \param0 + .4byte \failInstr .endm - .macro trysetmagiccoat param0:req + .macro trysetmagiccoat failInstr:req .byte 0xdf - .4byte \param0 + .4byte \failInstr .endm - .macro trysetsnatch param0:req + .macro trysetsnatch failInstr:req .byte 0xe0 - .4byte \param0 + .4byte \failInstr .endm - .macro trygetintimidatetarget param0:req + .macro unused2 ptr:req .byte 0xe1 - .4byte \param0 + .4byte \ptr .endm .macro switchoutabilities battler:req @@ -1157,50 +1211,53 @@ .byte \battler .endm - .macro jumpifhasnohp battler:req, param1:req + .macro jumpifhasnohp battler:req, jumpInstr:req .byte 0xe3 .byte \battler - .4byte \param1 + .4byte \jumpInstr .endm - .macro getsecretpowereffect + .macro jumpifnotcurrentmoveargtype battler:req, failInstr:req .byte 0xe4 + .byte \battler + .4byte \failInstr .endm .macro pickup .byte 0xe5 .endm - .macro docastformchangeanimation + .macro unused3 .byte 0xe6 .endm - .macro trycastformdatachange + .macro unused4 .byte 0xe7 .endm - .macro settypebasedhalvers param0:req + .macro settypebasedhalvers failInstr:req .byte 0xe8 - .4byte \param0 + .4byte \failInstr .endm - .macro setweatherballtype + .macro jumpifsubstituteblocks jumpInstr:req .byte 0xe9 + .4byte \jumpInstr .endm - .macro tryrecycleitem param0:req + .macro tryrecycleitem failInstr:req .byte 0xea - .4byte \param0 + .4byte \failInstr .endm - .macro settypetoterrain param0:req + .macro settypetoterrain failInstr:req .byte 0xeb - .4byte \param0 + .4byte \failInstr .endm - .macro pursuitrelated param0:req + .macro pursuitdoubles failInstr:req .byte 0xec - .4byte \param0 + .4byte \failInstr .endm .macro snatchsetbattlers @@ -1219,18 +1276,18 @@ .byte 0xf0 .endm - .macro trysetcaughtmondexflags param0:req + .macro trysetcaughtmondexflags failInstr:req .byte 0xf1 - .4byte \param0 + .4byte \failInstr .endm .macro displaydexinfo .byte 0xf2 .endm - .macro trygivecaughtmonnick param0:req + .macro trygivecaughtmonnick successInstr:req .byte 0xf3 - .4byte \param0 + .4byte \successInstr .endm .macro subattackerhpbydmg @@ -1249,6 +1306,41 @@ .byte 0xf7 .endm + .macro trainerslideout position:req + .byte 0xf8 + .byte \position + .endm + + .macro settelekinesis failInstr:req + .byte 0xf9 + .4byte \failInstr + .endm + + .macro swapstatstages stat:req + .byte 0xfa + .byte \stat + .endm + + .macro averagestats stat:req + .byte 0xfb + .byte \stat + .endm + + .macro jumpifoppositegenders jumpInstr:req + .byte 0xfc + .4byte \jumpInstr + .endm + + .macro unused ptr:req + .byte 0xfd + .4byte \ptr + .endm + + .macro tryworryseed failInstr:req + .byte 0xfe + .4byte \failInstr + .endm + .macro callnative func:req .byte 0xff .4byte \func @@ -1259,6 +1351,11 @@ various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES .endm + @ Stores Healing Wish effect. + .macro storehealingwish battler:req + various \battler, VARIOUS_STORE_HEALING_WISH + .endm + .macro setmagiccoattarget battler:req various \battler, VARIOUS_SET_MAGIC_COAT_TARGET .endm @@ -1275,8 +1372,8 @@ various \battler, VARIOUS_GET_BATTLER_FAINTED .endm - .macro resetintimidatetracebits battler:req - various \battler, VARIOUS_RESET_INTIMIDATE_TRACE_BITS + .macro resetswitchinabilitybits battler:req + various \battler, VARIOUS_RESET_SWITCH_IN_ABILITY_BITS .endm .macro updatechoicemoveonlvlup battler:req @@ -1287,18 +1384,613 @@ various BS_ATTACKER, VARIOUS_RESET_PLAYER_FAINTED .endm + .macro palaceflavortext battler:req + various \battler, VARIOUS_PALACE_FLAVOR_TEXT + .endm + + .macro arenajudgmentwindow + various BS_ATTACKER, VARIOUS_ARENA_JUDGMENT_WINDOW + .endm + + .macro arenaopponentmonlost + various BS_ATTACKER, VARIOUS_ARENA_OPPONENT_MON_LOST + .endm + + .macro arenaplayermonlost + various BS_ATTACKER, VARIOUS_ARENA_PLAYER_MON_LOST + .endm + + .macro arenabothmonlost + various BS_ATTACKER, VARIOUS_ARENA_BOTH_MONS_LOST + .endm + + .macro forfeityesnobox battler:req + various \battler, VARIOUS_EMIT_YESNOBOX + .endm + + .macro arenadrawreftextbox + various BS_ATTACKER, VARIOUS_DRAW_ARENA_REF_TEXT_BOX + .endm + + .macro arenaerasereftextbox + various BS_ATTACKER, VARIOUS_ERASE_ARENA_REF_TEXT_BOX + .endm + + .macro arenajudgmentstring id:req + various \id, VARIOUS_ARENA_JUDGMENT_STRING + .endm + + .macro arenawaitmessage id:req + various \id, VARIOUS_ARENA_WAIT_STRING + .endm + + .macro waitcry battler:req + various \battler, VARIOUS_WAIT_CRY + .endm + + .macro returnopponentmon1toball battler:req + various \battler, VARIOUS_RETURN_OPPONENT_MON1 + .endm + + .macro returnopponentmon2toball battler:req + various \battler, VARIOUS_RETURN_OPPONENT_MON2 + .endm + + .macro volumedown + various BS_ATTACKER, VARIOUS_VOLUME_DOWN + .endm + + .macro volumeup + various BS_ATTACKER, VARIOUS_VOLUME_UP + .endm + + .macro setalreadystatusedmoveattempt battler:req + various \battler, VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT + .endm + + .macro palacetryescapestatus battler:req + various \battler, VARIOUS_PALACE_TRY_ESCAPE_STATUS + .endm + + .macro setoutcomeonteleport battler:req + various \battler, VARIOUS_SET_TELEPORT_OUTCOME + .endm + + .macro playtrainerdefeatbgm battler:req + various \battler, VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC + .endm + + .macro stattextbuffer battler:req + various \battler, VARIOUS_STAT_TEXT_BUFFER + .endm + + .macro switchinabilities battler:req + various \battler, VARIOUS_SWITCHIN_ABILITIES + .endm + + .macro savetarget + various BS_TARGET, VARIOUS_SAVE_TARGET + .endm + + .macro restoretarget + various BS_TARGET, VARIOUS_RESTORE_TARGET + .endm + + .macro instanthpdrop battler:req + various \battler, VARIOUS_INSTANT_HP_DROP + .endm + + .macro clearstatus battler:req + various \battler, VARIOUS_CLEAR_STATUS + .endm + + .macro restorepp battler:req + various \battler, VARIOUS_RESTORE_PP + .endm + + .macro tryactivatemoxie battler:req + various \battler, VARIOUS_TRY_ACTIVATE_MOXIE + .endm + + .macro tryactivatebeastboost battler:req + various \battler, VARIOUS_TRY_ACTIVATE_BEAST_BOOST + .endm + + .macro tryactivatereceiver battler:req + various \battler, VARIOUS_TRY_ACTIVATE_RECEIVER + .endm + + .macro tryactivatesoulheart + various BS_ATTACKER, VARIOUS_TRY_ACTIVATE_SOULHEART + .endm + + .macro tryactivatefellstinger battler:req + various \battler, VARIOUS_TRY_ACTIVATE_FELL_STINGER + .endm + + .macro playmoveanimation battler:req, move:req + various \battler, VARIOUS_PLAY_MOVE_ANIMATION + .2byte \move + .endm + + .macro setluckychant battler:req, failInstr:req + various \battler VARIOUS_SET_LUCKY_CHANT + .4byte \failInstr + .endm + + .macro suckerpunchcheck failInstr:req + various BS_ATTACKER, VARIOUS_SUCKER_PUNCH_CHECK + .4byte \failInstr + .endm + + .macro setabilitysimple battler:req, failInstr:req + various \battler VARIOUS_SET_SIMPLE_BEAM + .4byte \failInstr + .endm + + .macro tryentrainment failInstr:req + various BS_ATTACKER, VARIOUS_TRY_ENTRAINMENT + .4byte \failInstr + .endm + + .macro setlastusedability battler:req + various \battler, VARIOUS_SET_LAST_USED_ABILITY + .endm + + .macro tryafteryou failInstr:req + various BS_ATTACKER, VARIOUS_AFTER_YOU + .4byte \failInstr + .endm + + .macro trybestow failInstr:req + various BS_ATTACKER, VARIOUS_BESTOW + .4byte \failInstr + .endm + + .macro invertstatstages battler:req + various \battler, VARIOUS_INVERT_STAT_STAGES + .endm + + .macro trymefirst failInstr:req + various BS_ATTACKER, VARIOUS_TRY_ME_FIRST + .4byte \failInstr + .endm + + .macro jumpifbattleend jumpInstr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_BATTLE_END + .4byte \jumpInstr + .endm + + .macro tryelectrify failInstr:req + various BS_ATTACKER, VARIOUS_TRY_ELECTRIFY + .4byte \failInstr + .endm + + .macro trysoak failInstr:req + various BS_ATTACKER, VARIOUS_TRY_SOAK + .4byte \failInstr + .endm + + .macro handleformchange battler:req, case:req + various \battler, VARIOUS_HANDLE_FORM_CHANGE + .byte \case + .endm + + .macro jumpifcantuselastresort battler:req, jumpInstr:req + various \battler, VARIOUS_TRY_LAST_RESORT + .4byte \jumpInstr + .endm + + .macro setargtobattledamage + various BS_ATTACKER, VARIOUS_SET_ARG_TO_BATTLE_DAMAGE + .endm + + .macro tryhitswitchtarget failInstr:req + various BS_ATTACKER, VARIOUS_TRY_HIT_SWITCH_TARGET + .4byte \failInstr + .endm + + .macro tryautotomize battler:req, failInstr:req + various \battler, VARIOUS_TRY_AUTOTOMIZE + .4byte \failInstr + .endm + + .macro jumpifcantusesynchronoise jumpInstr:req + various BS_ATTACKER, VARIOUS_TRY_SYNCHRONOISE + .4byte \jumpInstr + .endm + + .macro showabilitypopup battler:req + various \battler, VARIOUS_ABILITY_POPUP + .endm + + .macro updateabilitypopup battler:req + various \battler, VARIOUS_UPDATE_ABILITY_POPUP + .endm + + .macro jumpiftargetally jumpInstr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_TARGET_ALLY + .4byte \jumpInstr + .endm + + .macro trypsychoshift failInstr:req + various BS_ATTACKER, VARIOUS_PSYCHO_SHIFT + .4byte \failInstr + .endm + + .macro curestatus battler:req + various \battler, VARIOUS_CURE_STATUS + .endm + + .macro powertrick battler:req + various \battler, VARIOUS_POWER_TRICK + .endm + + .macro jumpifnotgrounded battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_NOT_GROUNDED + .4byte \jumpInstr + .endm + + .macro handletrainerslidemsg battler:req, case:req + various \battler, VARIOUS_HANDLE_TRAINER_SLIDE_MSG + .byte \case + .endm + + .macro trytrainerslidefirstdownmsg battler:req + various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF + .endm + + .macro trytrainerslidelastonmsg battler:req + various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON + .endm + + .macro setauroraveil battler:req + various \battler, VARIOUS_SET_AURORA_VEIL + .endm + + .macro trysetthirdtype battler:req, failInstr:req + various \battler, VARIOUS_TRY_THIRD_TYPE + .4byte \failInstr + .endm + + .macro tryaccupressure battler:req, failInstr:req + various \battler, VARIOUS_ACUPRESSURE + .4byte \failInstr + .endm + + .macro setpowder battler:req + various \battler, VARIOUS_SET_POWDER + .endm + + .macro spectralthiefprintstats + various BS_ATTACKER, VARIOUS_SPECTRAL_THIEF + .endm + + .macro bringdownairbornebattler battler:req + various \battler, VARIOUS_GRAVITY_ON_AIRBORNE_MONS + .endm + + .macro checkgrassyterrainheal battler:req, failInstr:req + various \battler, VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS + .4byte \failInstr + .endm + + .macro jumpifnotberry battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_NOT_BERRY + .4byte \jumpInstr + .endm + + .macro jumpifroarfails jumpInstr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_ROAR_FAILS + .4byte \jumpInstr + .endm + + .macro tryinstruct failInstr:req + various BS_ATTACKER, VARIOUS_TRY_INSTRUCT + .4byte \failInstr + .endm + + .macro settracedability battler:req + various \battler, VARIOUS_TRACE_ABILITY + .endm + + .macro updatenick battler:req + various \battler, VARIOUS_UPDATE_NICK + .endm + + .macro tryillusionoff battler:req + various \battler, VARIOUS_TRY_ILLUSION_OFF + .endm + + .macro spriteignore0hp value:req + various BS_ATTACKER, VARIOUS_SET_SPRITEIGNORE0HP + .byte \value + .endm + + .macro getstatvalue battler:req, stat:req + various \battler, VARIOUS_GET_STAT_VALUE + .byte \stat + .endm + + .macro jumpiffullhp battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_FULL_HP + .4byte \jumpInstr + .endm + + .macro losetype battler:req, type:req + various \battler, VARIOUS_LOSE_TYPE + .byte \type + .endm + + .macro tryfriskmsg battler:req + various \battler, VARIOUS_TRY_FRISK + .endm + + .macro jumpifshieldsdown battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED + .4byte \jumpInstr + .endm + + .macro trypoisontype attacker:req, target:req, failInstr:req + various \attacker, VARIOUS_POISON_TYPE_IMMUNITY + .byte \target + .4byte \failInstr + .endm + + .macro tryparalyzetype attacker:req, target:req, failInstr:req + various \attacker, VARIOUS_PARALYZE_TYPE_IMMUNITY + .byte \target + .4byte \failInstr + .endm + + .macro trysetfairylock failInstr:req + various BS_ATTACKER, VARIOUS_TRY_FAIRY_LOCK + .4byte \failInstr + .endm + + .macro jumpifnoally battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_NO_ALLY + .4byte \jumpInstr + .endm + + .macro jumpifholdeffect battler:req, holdEffect:req, jumpInstr:req, equal=TRUE + various \battler, VARIOUS_JUMP_IF_HOLD_EFFECT + .byte \holdEffect + .4byte \jumpInstr + .byte \equal + .endm + + .macro jumpifnoholdeffect battler:req, holdEffect:req, jumpInstr:req + jumpifholdeffect \battler, \holdEffect, \jumpInstr, FALSE + .endm + + .macro infatuatewithbattler battler:req, infatuateWith:req + various \battler, VARIOUS_INFATUATE_WITH_BATTLER + .byte \infatuateWith + .endm + + .macro setlastuseditem battler:req + various \battler, VARIOUS_SET_LAST_USED_ITEM + .endm + + .macro jumpifabsent battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_ABSENT + .4byte \jumpInstr + .endm + + .macro destroyabilitypopup + various BS_ABILITY_BATTLER, VARIOUS_DESTROY_ABILITY_POPUP + .endm + + .macro gettotemboost jumpInstr:req + various BS_ATTACKER, VARIOUS_TOTEM_BOOST + .4byte \jumpInstr + .endm + + .macro tryactivategrimneigh, battler:req + various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH + .endm + + .macro consumeberry battler:req, fromBattler:req + various \battler, VARIOUS_CONSUME_BERRY + .byte \fromBattler + .endm + + .macro activateitemeffects battler:req + various \battler, VARIOUS_MOVEEND_ITEM_EFFECTS + .endm + + .macro pickpocketsteal + various 0, VARIOUS_PICKPOCKET + .endm + + .macro doterrainseed battler:req, failInstr:req + various \battler, VARIOUS_TERRAIN_SEED + .4byte \failInstr + .endm + + .macro makeinvisible battler:req + various \battler, VARIOUS_MAKE_INVISIBLE + .endm + + .macro tryroomservice battler:req, failInstr:req + various \battler, VARIOUS_ROOM_SERVICE + .4byte \failInstr + .endm + + .macro jumpifpranksterblocked battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_PRANKSTER_BLOCKED + .4byte \jumpInstr + .endm + + .macro eeriespellppreduce failInstr:req + various BS_TARGET, VARIOUS_EERIE_SPELL_PP_REDUCE + .4byte \failInstr + .endm + + .macro jumpifteamhealthy battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_TEAM_HEALTHY + .4byte \jumpInstr + .endm + + .macro tryhealquarterhealth battler:req, failInstr:req + various \battler, VARIOUS_TRY_HEAL_QUARTER_HP + .4byte \failInstr + .endm + + .macro removeterrain + various BS_ATTACKER, VARIOUS_REMOVE_TERRAIN + .endm + + .macro trytoclearprimalweather + various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER + .endm + + .macro setattackertostickywebuser + various BS_TARGET, VARIOUS_SET_ATTACKER_STICKY_WEB_USER + .endm + + .macro getrototillertargets failInstr:req + various BS_ATTACKER, VARIOUS_GET_ROTOTILLER_TARGETS + .4byte \failInstr + .endm + + .macro jumpifnotrototilleraffected battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED + .4byte \jumpInstr + .endm + + .macro tryactivatebattlebond battler:req + various \battler, VARIOUS_TRY_ACTIVATE_BATTLE_BOND + .endm + + .macro jumpifcantreverttoprimal jumpInstr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL + .4byte \jumpInstr + .endm + + .macro jumpifweatheraffected battler:req, flags:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_WEATHER_AFFECTED + .4byte \flags + .4byte \jumpInstr + .endm + + .macro jumpifspecies battler:req, species:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_SPECIES + .2byte \species + .4byte \jumpInstr + .endm + + .macro tryendneutralizinggas battler:req + various \battler, VARIOUS_TRY_END_NEUTRALIZING_GAS + .endm + + .macro trynoretreat battler:req, failInstr:req + various \battler, VARIOUS_TRY_NO_RETREAT + .4byte \failInstr + .endm + + .macro trytarshot battler:req, failInstr:req + various \battler, VARIOUS_TRY_TAR_SHOT + .4byte \failInstr + .endm + + .macro cantarshotwork battler:req, failInstr:req + various \battler, VARIOUS_CAN_TAR_SHOT_WORK + .4byte \failInstr + .endm + + .macro checkpoltergeist battler:req, failInstr:req + various \battler, VARIOUS_CHECK_POLTERGEIST + .4byte \failInstr + .endm + + .macro cutonethirdhpraisestats failInstr:req + various BS_ATTACKER, VARIOUS_CUT_1_3_HP_RAISE_STATS + .4byte \failInstr + .endm + + .macro shellsidearmcheck + various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK + .endm + + .macro jumpifteanoberry jumpInstr:req + various BS_ATTACKER, VARIOUS_TEATIME_TARGETS + .4byte \jumpInstr + .endm + + .macro jumpifteainvulnerable battler:req, jumpInstr:req + various \battler, VARIOUS_TEATIME_INVUL + .4byte \jumpInstr + .endm + + .macro curecertainstatuses battler:req + various \battler, VARIOUS_CURE_CERTAIN_STATUSES + .endm + + .macro tryresetnegativestatstages battler:req + various \battler, VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES + .endm + + .macro jumpiflastuseditemberry jumpInstr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY + .4byte \jumpInstr + .endm + + .macro jumpiflastuseditemholdeffect battler:req, holdEffect:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT + .byte \holdEffect + .4byte \jumpInstr + .endm + + .macro savebattleritem battler:req + various \battler, VARIOUS_SAVE_BATTLER_ITEM + .endm + + .macro restorebattleritem battler:req + various \battler, VARIOUS_RESTORE_BATTLER_ITEM + .endm + + .macro battleritemtolastuseditem battler:req + various \battler, VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM + .endm + + .macro setbeakblast battler:req + various \battler, VARIOUS_SET_BEAK_BLAST + .endm + + .macro swapsidestatuses + various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES + .endm + + .macro swapstats stat:req + various BS_ATTACKER, VARIOUS_SWAP_STATS + .byte \stat + .endm + + .macro trywindriderpower battler:req, failInstr:req + various \battler, VARIOUS_TRY_WIND_RIDER_POWER + .4byte \failInstr + .endm + + .macro activateweatherchangeabilities battler:req + various \battler, VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES + .endm + + .macro activateterrainchangeabilities battler:req + various \battler, VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES + .endm + + .macro jumpifleafguardprotected battler:req, jumpInstr:req + various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED + .4byte \jumpInstr + .endm + +@ various remaining from pokefirered .macro getbattlersforrecall various BS_ATTACKER, VARIOUS_GET_BATTLERS_FOR_RECALL .endm - .macro returnopponentmon1toball - various BS_ATTACKER, VARIOUS_RETURN_OPPONENT_MON1 - .endm - - .macro returnopponentmon2toball - various BS_ATTACKER, VARIOUS_RETURN_OPPONENT_MON2 - .endm - .macro checkpokeflute battler:req various \battler, VARIOUS_CHECK_POKEFLUTE .endm @@ -1307,21 +1999,13 @@ various \battler, VARIOUS_WAIT_FANFARE .endm - @ pokeemerald - - .macro playmoveanimation battler:req, move:req - various \battler, VARIOUS_PLAY_MOVE_ANIMATION - .2byte \move - .endm - - @ helpful macros .macro setstatchanger stat:req, stages:req, down:req - setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7 + setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7 .endm .macro setmoveeffect effect:req - setbyte cEFFECT_CHOOSER, \effect + sethword sMOVE_EFFECT, \effect .endm .macro chosenstatus1animation battler:req, status:req @@ -1392,13 +2076,69 @@ jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr .endm -@ callnative macros - .macro itemrestorehp - callnative BS_ItemRestoreHP + @ Tries to increase or decrease a battler's stat's stat stage by a specified amount. If impossible, jumps to \script. + .macro modifybattlerstatstage battler:req, stat:req, mode:req, amount:req, script:req, animation:req, customString + + @ \mode parameters + INCREASE = FALSE + DECREASE = TRUE + + @ \animation parameters + ANIM_OFF = FALSE + ANIM_ON = TRUE + + setstatchanger \stat, \amount, \mode + statbuffchange STAT_CHANGE_ALLOW_PTR, \script + setgraphicalstatchangevalues + .if \animation == TRUE + playanimation \battler, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + .endif + .ifnb \customString + printstring \customString + .else + .if \mode == DECREASE + printfromtable gStatDownStringIds + .else + .if \mode == INCREASE + printfromtable gStatUpStringIds + .endif + .endif + .endif + waitmessage B_WAIT_TIME_LONG .endm - .macro itemcurestatus + .macro setallytonexttarget jumpInstr:req + jumpifbyte CMP_GREATER_THAN, gBattlerTarget, 0x1, 1f + addbyte gBattlerTarget, 0x2 + goto \jumpInstr + 1: + subbyte gBattlerTarget, 0x2 + goto \jumpInstr + .endm + + .macro dmg_1_8_targethp + manipulatedamage DMG_1_8_TARGET_HP + .endm + + .macro jumpifsafeguard jumpInstr:req + jumpifability BS_ATTACKER, ABILITY_INFILTRATOR, 1f + jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, \jumpInstr + 1: + .endm + + .macro dmgtomaxattackerhp + manipulatedamage DMG_FULL_ATTACKER_HP + .endm + +@ callnative macros + .macro itemrestorehp jumpInstr:req + callnative BS_ItemRestoreHP + .4byte \jumpInstr + .endm + + .macro itemcurestatus jumpInstr:req callnative BS_ItemCureStatus + .4byte \jumpInstr .endm .macro itemincreasestat @@ -1414,3 +2154,67 @@ callnative BS_GetBattlerSide .byte \battler .endm + + .macro flushtextbox + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 + .endm + + .macro tryrevertweatherform + callnative BS_TryRevertWeatherForm + .endm + + @ Used by effects that may proc Symbiosis but do not call removeitem. + .macro trysymbiosis + callnative BS_TrySymbiosis + .endm + + @ Will jump to script pointer if the specified battler has or has not fainted. + .macro jumpiffainted battler:req, value:req, ptr:req + getbattlerfainted \battler + jumpifbyte CMP_EQUAL, gBattleCommunication, \value, \ptr + .endm + + .macro jumpifflowerveil jumpInstr:req + jumpifnottype BS_TARGET, TYPE_GRASS, 1f + jumpifability BS_TARGET_SIDE, ABILITY_FLOWER_VEIL, \jumpInstr + 1: + .endm + + .macro jumpifflowerveilattacker jumpInstr:req + jumpifnottype BS_ATTACKER, TYPE_GRASS, 1f + jumpifability BS_ATTACKER_SIDE, ABILITY_FLOWER_VEIL, \jumpInstr + 1: + .endm + + .macro itemstatchangeeffects battler:req + callnative BS_RunStatChangeItems + .byte \battler + .endm + + .macro dostockpilestatchangeswearoff, battler:req, statChangeInstr:req + callnative BS_DoStockpileStatChangesWearOff + .byte \battler + .4byte \statChangeInstr + .endm + + .macro handleprimalreversion battler:req, case:req + callnative BS_HandlePrimalReversion + .byte \battler + .byte \case + .endm + + .macro jumpifterrainaffected battler:req, terrainFlags:req, jumpInstr:req + callnative BS_JumpIfTerrainAffected + .byte \battler + .4byte \terrainFlags + .4byte \jumpInstr + .endm + + .macro checkparentalbondcounter counter:req, ptr:req + callnative BS_CheckParentalBondCounter + .byte \counter + .4byte \ptr + .endm + + diff --git a/charmap.txt b/charmap.txt index b9d0ed9de..4b1b3008c 100644 --- a/charmap.txt +++ b/charmap.txt @@ -406,6 +406,8 @@ B_DEF_PREFIX3 = FD 2D B_TRAINER2_LOSE_TEXT = FD 2E B_TRAINER2_WIN_TEXT = FD 2F B_BUFF3 = FD 30 +B_ATK_TEAM2 = FD 38 +B_DEF_TEAM2 = FD 3B @ indicates the end of a town/city name (before " TOWN" or " CITY") NAME_END = FC 00 diff --git a/common_syms/random.txt b/common_syms/random.txt index 794439ea5..8037c6958 100644 --- a/common_syms/random.txt +++ b/common_syms/random.txt @@ -1 +1,2 @@ gRngValue +gRng2Value diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 503bee8cc..d8fb0aa62 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -982,7 +982,7 @@ gBattleAnims_StatusConditions:: .align 2 gBattleAnims_General:: - .4byte General_CastformChange @ B_ANIM_CASTFORM_CHANGE + .4byte General_FormChange @ B_ANIM_FORM_CHANGE .4byte General_StatsChange @ B_ANIM_STATS_CHANGE .4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE .4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR @@ -991,7 +991,7 @@ gBattleAnims_General:: .4byte General_TurnTrap @ B_ANIM_TURN_TRAP .4byte General_HeldItemEffect @ B_ANIM_HELD_ITEM_EFFECT .4byte General_SmokeballEscape @ B_ANIM_SMOKEBALL_ESCAPE - .4byte General_FocusBand @ B_ANIM_FOCUS_BAND + .4byte General_FocusBand @ B_ANIM_HANGED_ON .4byte General_Rain @ B_ANIM_RAIN_CONTINUES .4byte General_Sun @ B_ANIM_SUN_CONTINUES .4byte General_Sandstorm @ B_ANIM_SANDSTORM_CONTINUES @@ -1010,6 +1010,8 @@ gBattleAnims_General:: .4byte General_SilphScoped @ B_ANIM_SILPH_SCOPED .4byte General_SafariRockThrow @ B_ANIM_ROCK_THROW .4byte General_SafariReaction @ B_ANIM_SAFARI_REACTION + .4byte General_RestoreBg @ B_ANIM_RESTORE_BG + .4byte General_SlideOffScreen @ B_ANIM_SLIDE_OFFSCREEN .align 2 gBattleAnims_Special:: @@ -11696,16 +11698,9 @@ Status_Nightmare: clearmonbg ANIM_DEF_PARTNER end -General_CastformChange: - createvisualtask AnimTask_IsMonInvisible, 2 - jumpreteq TRUE, CastformChangeSkipAnim - goto CastformChangeContinue - -CastformChangeContinue: +General_FormChange: monbg ANIM_ATTACKER - playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER - waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48 - createvisualtask AnimTask_TransformMon, 2, 1 + createvisualtask AnimTask_TransformMon, 2, 1, 0 waitforvisualfinish clearmonbg ANIM_ATTACKER end @@ -12278,3 +12273,17 @@ Special_SubstituteToMon: Special_MonToSubstitute: createvisualtask AnimTask_SwapMonSpriteToFromSubstitute, 2, FALSE end + +General_RestoreBg: + restorebg + waitbgfadein + end + +General_SlideOffScreen: + createvisualtask AnimTask_SlideOffScreen, 5, ANIM_TARGET, 3 + waitforvisualfinish + createvisualtask AnimTask_SetInvisible, 1, ANIM_TARGET, TRUE + waitforvisualfinish + end + + diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8aa0a1004..49e668d90 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1,3 +1,5 @@ +#include "config.h" +#include "config/battle.h" #include "constants/global.h" #include "constants/moves.h" #include "constants/battle.h" @@ -6,6 +8,7 @@ #include "constants/battle_anim.h" #include "constants/items.h" #include "constants/abilities.h" +#include "constants/hold_effects.h" #include "constants/species.h" #include "constants/pokemon.h" #include "constants/songs.h" @@ -20,227 +23,7 @@ .section script_data, "aw", %progbits .align 2 -gBattleScriptsForMoveEffects:: - .4byte BattleScript_EffectHit @ EFFECT_HIT - .4byte BattleScript_EffectSleep @ EFFECT_SLEEP - .4byte BattleScript_EffectPoisonHit @ EFFECT_POISON_HIT - .4byte BattleScript_EffectAbsorb @ EFFECT_ABSORB - .4byte BattleScript_EffectBurnHit @ EFFECT_BURN_HIT - .4byte BattleScript_EffectFreezeHit @ EFFECT_FREEZE_HIT - .4byte BattleScript_EffectParalyzeHit @ EFFECT_PARALYZE_HIT - .4byte BattleScript_EffectExplosion @ EFFECT_EXPLOSION - .4byte BattleScript_EffectDreamEater @ EFFECT_DREAM_EATER - .4byte BattleScript_EffectMirrorMove @ EFFECT_MIRROR_MOVE - .4byte BattleScript_EffectAttackUp @ EFFECT_ATTACK_UP - .4byte BattleScript_EffectDefenseUp @ EFFECT_DEFENSE_UP - .4byte BattleScript_EffectHit @ EFFECT_SPEED_UP - .4byte BattleScript_EffectSpecialAttackUp @ EFFECT_SPECIAL_ATTACK_UP - .4byte BattleScript_EffectHit @ EFFECT_SPECIAL_DEFENSE_UP - .4byte BattleScript_EffectHit @ EFFECT_ACCURACY_UP - .4byte BattleScript_EffectEvasionUp @ EFFECT_EVASION_UP - .4byte BattleScript_EffectHit @ EFFECT_ALWAYS_HIT - .4byte BattleScript_EffectAttackDown @ EFFECT_ATTACK_DOWN - .4byte BattleScript_EffectDefenseDown @ EFFECT_DEFENSE_DOWN - .4byte BattleScript_EffectSpeedDown @ EFFECT_SPEED_DOWN - .4byte BattleScript_EffectHit @ EFFECT_SPECIAL_ATTACK_DOWN - .4byte BattleScript_EffectHit @ EFFECT_SPECIAL_DEFENSE_DOWN - .4byte BattleScript_EffectAccuracyDown @ EFFECT_ACCURACY_DOWN - .4byte BattleScript_EffectEvasionDown @ EFFECT_EVASION_DOWN - .4byte BattleScript_EffectHaze @ EFFECT_HAZE - .4byte BattleScript_EffectBide @ EFFECT_BIDE - .4byte BattleScript_EffectRampage @ EFFECT_RAMPAGE - .4byte BattleScript_EffectRoar @ EFFECT_ROAR - .4byte BattleScript_EffectMultiHit @ EFFECT_MULTI_HIT - .4byte BattleScript_EffectConversion @ EFFECT_CONVERSION - .4byte BattleScript_EffectFlinchHit @ EFFECT_FLINCH_HIT - .4byte BattleScript_EffectRestoreHp @ EFFECT_RESTORE_HP - .4byte BattleScript_EffectToxic @ EFFECT_TOXIC - .4byte BattleScript_EffectPayDay @ EFFECT_PAY_DAY - .4byte BattleScript_EffectLightScreen @ EFFECT_LIGHT_SCREEN - .4byte BattleScript_EffectTriAttack @ EFFECT_TRI_ATTACK - .4byte BattleScript_EffectRest @ EFFECT_REST - .4byte BattleScript_EffectOHKO @ EFFECT_OHKO - .4byte BattleScript_EffectRazorWind @ EFFECT_RAZOR_WIND - .4byte BattleScript_EffectSuperFang @ EFFECT_SUPER_FANG - .4byte BattleScript_EffectDragonRage @ EFFECT_DRAGON_RAGE - .4byte BattleScript_EffectTrap @ EFFECT_TRAP - .4byte BattleScript_EffectHit @ EFFECT_HIGH_CRITICAL - .4byte BattleScript_EffectDoubleHit @ EFFECT_DOUBLE_HIT - .4byte BattleScript_EffectRecoilIfMiss @ EFFECT_RECOIL_IF_MISS - .4byte BattleScript_EffectMist @ EFFECT_MIST - .4byte BattleScript_EffectFocusEnergy @ EFFECT_FOCUS_ENERGY - .4byte BattleScript_EffectRecoil @ EFFECT_RECOIL - .4byte BattleScript_EffectConfuse @ EFFECT_CONFUSE - .4byte BattleScript_EffectAttackUp2 @ EFFECT_ATTACK_UP_2 - .4byte BattleScript_EffectDefenseUp2 @ EFFECT_DEFENSE_UP_2 - .4byte BattleScript_EffectSpeedUp2 @ EFFECT_SPEED_UP_2 - .4byte BattleScript_EffectSpecialAttackUp2 @ EFFECT_SPECIAL_ATTACK_UP_2 - .4byte BattleScript_EffectSpecialDefenseUp2 @ EFFECT_SPECIAL_DEFENSE_UP_2 - .4byte BattleScript_EffectHit @ EFFECT_ACCURACY_UP_2 - .4byte BattleScript_EffectHit @ EFFECT_EVASION_UP_2 - .4byte BattleScript_EffectTransform @ EFFECT_TRANSFORM - .4byte BattleScript_EffectAttackDown2 @ EFFECT_ATTACK_DOWN_2 - .4byte BattleScript_EffectDefenseDown2 @ EFFECT_DEFENSE_DOWN_2 - .4byte BattleScript_EffectSpeedDown2 @ EFFECT_SPEED_DOWN_2 - .4byte BattleScript_EffectHit @ EFFECT_SPECIAL_ATTACK_DOWN_2 - .4byte BattleScript_EffectSpecialDefenseDown2 @ EFFECT_SPECIAL_DEFENSE_DOWN_2 - .4byte BattleScript_EffectHit @ EFFECT_ACCURACY_DOWN_2 - .4byte BattleScript_EffectHit @ EFFECT_EVASION_DOWN_2 - .4byte BattleScript_EffectReflect @ EFFECT_REFLECT - .4byte BattleScript_EffectPoison @ EFFECT_POISON - .4byte BattleScript_EffectParalyze @ EFFECT_PARALYZE - .4byte BattleScript_EffectAttackDownHit @ EFFECT_ATTACK_DOWN_HIT - .4byte BattleScript_EffectDefenseDownHit @ EFFECT_DEFENSE_DOWN_HIT - .4byte BattleScript_EffectSpeedDownHit @ EFFECT_SPEED_DOWN_HIT - .4byte BattleScript_EffectSpecialAttackDownHit @ EFFECT_SPECIAL_ATTACK_DOWN_HIT - .4byte BattleScript_EffectSpecialDefenseDownHit @ EFFECT_SPECIAL_DEFENSE_DOWN_HIT - .4byte BattleScript_EffectAccuracyDownHit @ EFFECT_ACCURACY_DOWN_HIT - .4byte BattleScript_EffectHit @ EFFECT_EVASION_DOWN_HIT - .4byte BattleScript_EffectSkyAttack @ EFFECT_SKY_ATTACK - .4byte BattleScript_EffectConfuseHit @ EFFECT_CONFUSE_HIT - .4byte BattleScript_EffectTwineedle @ EFFECT_TWINEEDLE - .4byte BattleScript_EffectHit @ EFFECT_VITAL_THROW - .4byte BattleScript_EffectSubstitute @ EFFECT_SUBSTITUTE - .4byte BattleScript_EffectRecharge @ EFFECT_RECHARGE - .4byte BattleScript_EffectRage @ EFFECT_RAGE - .4byte BattleScript_EffectMimic @ EFFECT_MIMIC - .4byte BattleScript_EffectMetronome @ EFFECT_METRONOME - .4byte BattleScript_EffectLeechSeed @ EFFECT_LEECH_SEED - .4byte BattleScript_EffectSplash @ EFFECT_SPLASH - .4byte BattleScript_EffectDisable @ EFFECT_DISABLE - .4byte BattleScript_EffectLevelDamage @ EFFECT_LEVEL_DAMAGE - .4byte BattleScript_EffectPsywave @ EFFECT_PSYWAVE - .4byte BattleScript_EffectCounter @ EFFECT_COUNTER - .4byte BattleScript_EffectEncore @ EFFECT_ENCORE - .4byte BattleScript_EffectPainSplit @ EFFECT_PAIN_SPLIT - .4byte BattleScript_EffectSnore @ EFFECT_SNORE - .4byte BattleScript_EffectConversion2 @ EFFECT_CONVERSION_2 - .4byte BattleScript_EffectLockOn @ EFFECT_LOCK_ON - .4byte BattleScript_EffectSketch @ EFFECT_SKETCH - .4byte BattleScript_EffectHit @ EFFECT_UNUSED_60 - .4byte BattleScript_EffectSleepTalk @ EFFECT_SLEEP_TALK - .4byte BattleScript_EffectDestinyBond @ EFFECT_DESTINY_BOND - .4byte BattleScript_EffectFlail @ EFFECT_FLAIL - .4byte BattleScript_EffectSpite @ EFFECT_SPITE - .4byte BattleScript_EffectHit @ EFFECT_FALSE_SWIPE - .4byte BattleScript_EffectHealBell @ EFFECT_HEAL_BELL - .4byte BattleScript_EffectHit @ EFFECT_QUICK_ATTACK - .4byte BattleScript_EffectTripleKick @ EFFECT_TRIPLE_KICK - .4byte BattleScript_EffectThief @ EFFECT_THIEF - .4byte BattleScript_EffectMeanLook @ EFFECT_MEAN_LOOK - .4byte BattleScript_EffectNightmare @ EFFECT_NIGHTMARE - .4byte BattleScript_EffectMinimize @ EFFECT_MINIMIZE - .4byte BattleScript_EffectCurse @ EFFECT_CURSE - .4byte BattleScript_EffectHit @ EFFECT_UNUSED_6E - .4byte BattleScript_EffectProtect @ EFFECT_PROTECT - .4byte BattleScript_EffectSpikes @ EFFECT_SPIKES - .4byte BattleScript_EffectForesight @ EFFECT_FORESIGHT - .4byte BattleScript_EffectPerishSong @ EFFECT_PERISH_SONG - .4byte BattleScript_EffectSandstorm @ EFFECT_SANDSTORM - .4byte BattleScript_EffectEndure @ EFFECT_ENDURE - .4byte BattleScript_EffectRollout @ EFFECT_ROLLOUT - .4byte BattleScript_EffectSwagger @ EFFECT_SWAGGER - .4byte BattleScript_EffectFuryCutter @ EFFECT_FURY_CUTTER - .4byte BattleScript_EffectAttract @ EFFECT_ATTRACT - .4byte BattleScript_EffectReturn @ EFFECT_RETURN - .4byte BattleScript_EffectPresent @ EFFECT_PRESENT - .4byte BattleScript_EffectFrustration @ EFFECT_FRUSTRATION - .4byte BattleScript_EffectSafeguard @ EFFECT_SAFEGUARD - .4byte BattleScript_EffectThawHit @ EFFECT_THAW_HIT - .4byte BattleScript_EffectMagnitude @ EFFECT_MAGNITUDE - .4byte BattleScript_EffectBatonPass @ EFFECT_BATON_PASS - .4byte BattleScript_EffectHit @ EFFECT_PURSUIT - .4byte BattleScript_EffectRapidSpin @ EFFECT_RAPID_SPIN - .4byte BattleScript_EffectSonicboom @ EFFECT_SONICBOOM - .4byte BattleScript_EffectHit @ EFFECT_UNUSED_83 - .4byte BattleScript_EffectMorningSun @ EFFECT_MORNING_SUN - .4byte BattleScript_EffectSynthesis @ EFFECT_SYNTHESIS - .4byte BattleScript_EffectMoonlight @ EFFECT_MOONLIGHT - .4byte BattleScript_EffectHiddenPower @ EFFECT_HIDDEN_POWER - .4byte BattleScript_EffectRainDance @ EFFECT_RAIN_DANCE - .4byte BattleScript_EffectSunnyDay @ EFFECT_SUNNY_DAY - .4byte BattleScript_EffectDefenseUpHit @ EFFECT_DEFENSE_UP_HIT - .4byte BattleScript_EffectAttackUpHit @ EFFECT_ATTACK_UP_HIT - .4byte BattleScript_EffectAllStatsUpHit @ EFFECT_ALL_STATS_UP_HIT - .4byte BattleScript_EffectHit @ EFFECT_UNUSED_8D - .4byte BattleScript_EffectBellyDrum @ EFFECT_BELLY_DRUM - .4byte BattleScript_EffectPsychUp @ EFFECT_PSYCH_UP - .4byte BattleScript_EffectMirrorCoat @ EFFECT_MIRROR_COAT - .4byte BattleScript_EffectSkullBash @ EFFECT_SKULL_BASH - .4byte BattleScript_EffectTwister @ EFFECT_TWISTER - .4byte BattleScript_EffectEarthquake @ EFFECT_EARTHQUAKE - .4byte BattleScript_EffectFutureSight @ EFFECT_FUTURE_SIGHT - .4byte BattleScript_EffectGust @ EFFECT_GUST - .4byte BattleScript_EffectStomp @ EFFECT_FLINCH_MINIMIZE_HIT - .4byte BattleScript_EffectSolarBeam @ EFFECT_SOLAR_BEAM - .4byte BattleScript_EffectThunder @ EFFECT_THUNDER - .4byte BattleScript_EffectTeleport @ EFFECT_TELEPORT - .4byte BattleScript_EffectBeatUp @ EFFECT_BEAT_UP - .4byte BattleScript_EffectSemiInvulnerable @ EFFECT_SEMI_INVULNERABLE - .4byte BattleScript_EffectDefenseCurl @ EFFECT_DEFENSE_CURL - .4byte BattleScript_EffectSoftboiled @ EFFECT_SOFTBOILED - .4byte BattleScript_EffectFakeOut @ EFFECT_FAKE_OUT - .4byte BattleScript_EffectUproar @ EFFECT_UPROAR - .4byte BattleScript_EffectStockpile @ EFFECT_STOCKPILE - .4byte BattleScript_EffectSpitUp @ EFFECT_SPIT_UP - .4byte BattleScript_EffectSwallow @ EFFECT_SWALLOW - .4byte BattleScript_EffectHit @ EFFECT_UNUSED_A3 - .4byte BattleScript_EffectHail @ EFFECT_HAIL - .4byte BattleScript_EffectTorment @ EFFECT_TORMENT - .4byte BattleScript_EffectFlatter @ EFFECT_FLATTER - .4byte BattleScript_EffectWillOWisp @ EFFECT_WILL_O_WISP - .4byte BattleScript_EffectMemento @ EFFECT_MEMENTO - .4byte BattleScript_EffectFacade @ EFFECT_FACADE - .4byte BattleScript_EffectFocusPunch @ EFFECT_FOCUS_PUNCH - .4byte BattleScript_EffectSmellingsalt @ EFFECT_SMELLINGSALT - .4byte BattleScript_EffectFollowMe @ EFFECT_FOLLOW_ME - .4byte BattleScript_EffectNaturePower @ EFFECT_NATURE_POWER - .4byte BattleScript_EffectCharge @ EFFECT_CHARGE - .4byte BattleScript_EffectTaunt @ EFFECT_TAUNT - .4byte BattleScript_EffectHelpingHand @ EFFECT_HELPING_HAND - .4byte BattleScript_EffectTrick @ EFFECT_TRICK - .4byte BattleScript_EffectRolePlay @ EFFECT_ROLE_PLAY - .4byte BattleScript_EffectWish @ EFFECT_WISH - .4byte BattleScript_EffectAssist @ EFFECT_ASSIST - .4byte BattleScript_EffectIngrain @ EFFECT_INGRAIN - .4byte BattleScript_EffectSuperpower @ EFFECT_SUPERPOWER - .4byte BattleScript_EffectMagicCoat @ EFFECT_MAGIC_COAT - .4byte BattleScript_EffectRecycle @ EFFECT_RECYCLE - .4byte BattleScript_EffectRevenge @ EFFECT_REVENGE - .4byte BattleScript_EffectBrickBreak @ EFFECT_BRICK_BREAK - .4byte BattleScript_EffectYawn @ EFFECT_YAWN - .4byte BattleScript_EffectKnockOff @ EFFECT_KNOCK_OFF - .4byte BattleScript_EffectEndeavor @ EFFECT_ENDEAVOR - .4byte BattleScript_EffectEruption @ EFFECT_ERUPTION - .4byte BattleScript_EffectSkillSwap @ EFFECT_SKILL_SWAP - .4byte BattleScript_EffectImprison @ EFFECT_IMPRISON - .4byte BattleScript_EffectRefresh @ EFFECT_REFRESH - .4byte BattleScript_EffectGrudge @ EFFECT_GRUDGE - .4byte BattleScript_EffectSnatch @ EFFECT_SNATCH - .4byte BattleScript_EffectLowKick @ EFFECT_LOW_KICK - .4byte BattleScript_EffectSecretPower @ EFFECT_SECRET_POWER - .4byte BattleScript_EffectDoubleEdge @ EFFECT_DOUBLE_EDGE - .4byte BattleScript_EffectTeeterDance @ EFFECT_TEETER_DANCE - .4byte BattleScript_EffectBurnHit @ EFFECT_BLAZE_KICK - .4byte BattleScript_EffectMudSport @ EFFECT_MUD_SPORT - .4byte BattleScript_EffectPoisonFang @ EFFECT_POISON_FANG - .4byte BattleScript_EffectWeatherBall @ EFFECT_WEATHER_BALL - .4byte BattleScript_EffectOverheat @ EFFECT_OVERHEAT - .4byte BattleScript_EffectTickle @ EFFECT_TICKLE - .4byte BattleScript_EffectCosmicPower @ EFFECT_COSMIC_POWER - .4byte BattleScript_EffectSkyUppercut @ EFFECT_SKY_UPPERCUT - .4byte BattleScript_EffectBulkUp @ EFFECT_BULK_UP - .4byte BattleScript_EffectPoisonHit @ EFFECT_POISON_TAIL - .4byte BattleScript_EffectWaterSport @ EFFECT_WATER_SPORT - .4byte BattleScript_EffectCalmMind @ EFFECT_CALM_MIND - .4byte BattleScript_EffectDragonDance @ EFFECT_DRAGON_DANCE - .4byte BattleScript_EffectCamouflage @ EFFECT_CAMOUFLAGE - BattleScript_EffectHit:: - jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler - jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler - orword gHitMarker, HITMARKER_IGNORE_UNDERWATER - setbyte sDMG_MULTIPLIER, 2 BattleScript_HitFromAtkCanceler:: attackcanceler BattleScript_HitFromAccCheck:: @@ -251,21 +34,10 @@ BattleScript_HitFromAtkString:: BattleScript_HitFromCritCalc:: critcalc damagecalc - typecalc - adjustnormaldamage + adjustdamage BattleScript_HitFromAtkAnimation:: - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG - seteffectwithchance + call BattleScript_Hit_RetFromAtkAnimation +BattleScript_TryFaintMon:: tryfaintmon BS_TARGET BattleScript_MoveEnd:: moveendall @@ -288,16 +60,25 @@ BattleScript_EffectSleep:: attackcanceler attackstring ppreduce - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed + jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_AlreadyAsleep - jumpifcantmakeasleep BattleScript_CantMakeAsleep + jumpifuproarwakes BattleScript_CantMakeAsleep + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_AbilityProtectsDoesntAffect + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect + jumpifflowerveil BattleScript_FlowerVeilProtects + jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed + jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents + jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE - jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected + jumpifsafeguard BattleScript_SafeguardProtected attackanimation waitanimation - setmoveeffect MOVE_EFFECT_SLEEP - seteffectprimary + seteffectprimary MOVE_EFFECT_SLEEP goto BattleScript_MoveEnd BattleScript_AlreadyAsleep:: @@ -323,31 +104,16 @@ BattleScript_EffectPoisonHit:: goto BattleScript_EffectHit BattleScript_EffectAbsorb:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - typecalc - adjustnormaldamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG - negativedamage - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + call BattleScript_EffectHit_Ret + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock + setdrainedhp + manipulatedamage DMG_BIG_ROOT + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB goto BattleScript_AbsorbUpdateHp BattleScript_AbsorbLiquidOoze:: + call BattleScript_AbilityPopUpTarget manipulatedamage DMG_CHANGE_SIGN setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB_OOZE BattleScript_AbsorbUpdateHp:: @@ -358,6 +124,7 @@ BattleScript_AbsorbUpdateHp:: waitmessage B_WAIT_TIME_LONG BattleScript_AbsorbTryFainting:: tryfaintmon BS_ATTACKER +BattleScript_AbsorbHealBlock:: tryfaintmon BS_TARGET goto BattleScript_MoveEnd @@ -392,7 +159,7 @@ BattleScript_ExplosionLoop: critcalc damagecalc typecalc - adjustnormaldamage + adjustdamage accuracycheck BattleScript_ExplosionMissed, ACC_CURR_MOVE effectivenesssound hitanimation BS_TARGET @@ -426,8 +193,9 @@ BattleScript_PreserveMissedBitDoMoveAnim: BattleScript_EffectDreamEater:: attackcanceler - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_DreamEaterNoEffect + jumpifsubstituteblocks BattleScript_DreamEaterNoEffect jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_DreamEaterWorked + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_DreamEaterWorked BattleScript_DreamEaterNoEffect: attackstring ppreduce @@ -439,8 +207,7 @@ BattleScript_DreamEaterWorked: ppreduce critcalc damagecalc - typecalc - adjustnormaldamage + adjustdamage attackanimation waitanimation effectivenesssound @@ -452,7 +219,9 @@ BattleScript_DreamEaterWorked: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG - negativedamage + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_DreamEaterTryFaintEnd + setdrainedhp + manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -511,6 +280,7 @@ BattleScript_StatUpEnd:: BattleScript_StatUp:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 +BattleScript_StatUpMsg:: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG return @@ -535,7 +305,7 @@ BattleScript_EffectEvasionDown:: setstatchanger STAT_EVASION, 1, TRUE BattleScript_EffectStatDown:: attackcanceler - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailedAtkStringPpReduce + jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_FailedFromAtkString accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce @@ -582,16 +352,6 @@ BattleScript_EffectBide:: setbide goto BattleScript_MoveEnd -BattleScript_EffectRampage:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_EffectRampage2 - ppreduce -BattleScript_EffectRampage2: - confuseifrepeatingattackends - goto BattleScript_HitFromCritCalc - BattleScript_EffectRoar:: attackcanceler attackstring @@ -609,7 +369,7 @@ BattleScript_EffectMultiHit:: ppreduce setmultihitcounter 0 initmultihitstring - setbyte sMULTIHIT_EFFECT, 0 + sethword sMULTIHIT_EFFECT, 0 BattleScript_MultiHitLoop:: jumpifhasnohp BS_ATTACKER, BattleScript_MultiHitEnd jumpifhasnohp BS_TARGET, BattleScript_MultiHitPrintStrings @@ -617,12 +377,11 @@ BattleScript_MultiHitLoop:: jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_MultiHitPrintStrings BattleScript_DoMultiHit:: movevaluescleanup - copybyte cEFFECT_CHOOSER, sMULTIHIT_EFFECT + copyhword sMOVE_EFFECT, sMULTIHIT_EFFECT critcalc damagecalc - typecalc jumpifmovehadnoeffect BattleScript_MultiHitNoMoreHits - adjustnormaldamage + adjustdamage attackanimation waitanimation effectivenesssound @@ -632,8 +391,8 @@ BattleScript_DoMultiHit:: datahpupdate BS_TARGET critmessage waitmessage B_WAIT_TIME_LONG - printstring STRINGID_EMPTYSTRING3 - waitmessage 1 + multihitresultmessage + flushtextbox addbyte sMULTIHIT_STRING + 4, 1 moveendto MOVEEND_NEXT_TARGET jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings @@ -648,11 +407,13 @@ BattleScript_MultiHitPrintStrings:: copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG + return + BattleScript_MultiHitEnd:: - seteffectwithchance + setadditionaleffects tryfaintmon BS_TARGET moveendcase MOVEEND_SYNCHRONIZE_TARGET - moveendfrom MOVEEND_IMMUNITY_ABILITIES + moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES end BattleScript_EffectConversion:: @@ -737,7 +498,14 @@ BattleScript_EffectRest:: attackstring ppreduce jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_RestIsAlreadyAsleep - jumpifcantmakeasleep BattleScript_RestCantSleep + jumpifability BS_ATTACKER, ABILITY_COMATOSE, BattleScript_RestIsAlreadyAsleep + jumpifuproarwakes BattleScript_RestCantSleep + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects + jumpifability BS_ATTACKER, ABILITY_PURIFYING_SALT, BattleScript_InsomniaProtects +.if B_LEAF_GUARD_PREVENTS_REST >= GEN_5 + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardPreventsRest +.endif trysetrest BattleScript_AlreadyAtFullHp pause B_WAIT_TIME_SHORT printfromtable gRestUsedStringIds @@ -774,13 +542,6 @@ BattleScript_KOFail:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectRazorWind:: - jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn - jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_RAZOR_WIND - call BattleScriptFirstChargingTurn - goto BattleScript_MoveEnd - BattleScript_TwoTurnMovesSecondTurn:: attackcanceler setmoveeffect MOVE_EFFECT_CHARGING @@ -791,20 +552,6 @@ BattleScript_TwoTurnMovesSecondTurn:: setmoveeffect MOVE_EFFECT_FLINCH goto BattleScript_HitFromAccCheck -BattleScriptFirstChargingTurn:: - attackcanceler - printstring STRINGID_EMPTYSTRING3 - ppreduce - attackanimation - waitanimation - orword gHitMarker, HITMARKER_CHARGING - setmoveeffect MOVE_EFFECT_CHARGING | MOVE_EFFECT_AFFECTS_USER - seteffectprimary - copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID - printfromtable gFirstTurnOfTwoStringIds - waitmessage B_WAIT_TIME_LONG - return - BattleScript_EffectSuperFang:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -823,7 +570,7 @@ BattleScript_EffectDragonRage:: typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE setword gBattleMoveDamage, 40 - adjustsetdamage + adjustdamage goto BattleScript_HitFromAtkAnimation BattleScript_EffectTrap:: @@ -860,7 +607,7 @@ BattleScript_MoveMissedDoDamage:: waitmessage B_WAIT_TIME_LONG damagecalc typecalc - adjustnormaldamage + adjustdamage manipulatedamage DMG_RECOIL_FROM_MISS bicbyte gMoveResultFlags, MOVE_RESULT_MISSED orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE @@ -893,12 +640,6 @@ BattleScript_EffectFocusEnergy:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectRecoil:: - setmoveeffect MOVE_EFFECT_RECOIL_25 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN - jumpifnotmove MOVE_STRUGGLE, BattleScript_EffectHit - incrementgamestat GAME_STAT_USED_STRUGGLE - goto BattleScript_EffectHit - BattleScript_EffectConfuse:: attackcanceler attackstring @@ -1058,13 +799,6 @@ BattleScript_EffectAccuracyDownHit:: setmoveeffect MOVE_EFFECT_ACC_MINUS_1 goto BattleScript_EffectHit -BattleScript_EffectSkyAttack:: - jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn - jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKY_ATTACK - call BattleScriptFirstChargingTurn - goto BattleScript_MoveEnd - BattleScript_EffectConfuseHit:: setmoveeffect MOVE_EFFECT_CONFUSION goto BattleScript_EffectHit @@ -1165,16 +899,32 @@ BattleScript_DoLeechSeed:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectSplash:: +BattleScript_EffectDoNothing:: attackcanceler attackstring ppreduce + jumpifmove MOVE_HOLD_HANDS, BattleScript_EffectHoldHands attackanimation waitanimation + jumpifmove MOVE_CELEBRATE, BattleScript_EffectCelebrate + jumpifmove MOVE_HAPPY_HOUR, BattleScript_EffectHappyHour incrementgamestat GAME_STAT_USED_SPLASH printstring STRINGID_BUTNOTHINGHAPPENED waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_EffectHoldHands: + jumpifsideaffecting BS_TARGET, SIDE_STATUS_CRAFTY_SHIELD, BattleScript_ButItFailed + jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_ButItFailed + attackanimation + waitanimation + goto BattleScript_MoveEnd +BattleScript_EffectCelebrate: + printstring STRINGID_CELEBRATEMESSAGE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd +BattleScript_EffectHappyHour: + seteffectprimary MOVE_EFFECT_HAPPY_HOUR + goto BattleScript_MoveEnd BattleScript_EffectDisable:: attackcanceler @@ -1196,7 +946,7 @@ BattleScript_EffectLevelDamage:: typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE dmgtolevel - adjustsetdamage + adjustdamage goto BattleScript_HitFromAtkAnimation BattleScript_EffectPsywave:: @@ -1207,17 +957,18 @@ BattleScript_EffectPsywave:: typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE psywavedamageeffect - adjustsetdamage + adjustdamage goto BattleScript_HitFromAtkAnimation BattleScript_EffectCounter:: attackcanceler - counterdamagecalculator BattleScript_ButItFailedAtkStringPpReduce + counterdamagecalculator BattleScript_FailedFromAtkString accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - typecalc2 - adjustsetdamage + typecalc + bichalfword gMoveResultFlags, MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE + adjustdamage goto BattleScript_HitFromAtkAnimation BattleScript_EffectEncore:: @@ -1338,10 +1089,6 @@ BattleScript_EffectDestinyBond:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectFlail:: - remaininghptopower - goto BattleScript_EffectHit - BattleScript_EffectSpite:: attackcanceler attackstring @@ -1377,62 +1124,6 @@ BattleScript_PartyHealEnd:: waitstate goto BattleScript_MoveEnd -BattleScript_EffectTripleKick:: - attackcanceler - attackstring - ppreduce - sethword sTRIPLE_KICK_POWER, 0 - initmultihitstring - setmultihit 3 -BattleScript_TripleKickLoop:: - jumpifhasnohp BS_ATTACKER, BattleScript_TripleKickEnd - jumpifhasnohp BS_TARGET, BattleScript_TripleKickNoMoreHits - jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoTripleKickAttack - jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_TripleKickNoMoreHits -BattleScript_DoTripleKickAttack:: - accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE - movevaluescleanup - addbyte sTRIPLE_KICK_POWER, 10 - addbyte sMULTIHIT_STRING + 4, 1 - copyhword gDynamicBasePower, sTRIPLE_KICK_POWER - critcalc - damagecalc - typecalc - adjustnormaldamage - jumpifmovehadnoeffect BattleScript_TripleKickNoMoreHits - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - printstring STRINGID_EMPTYSTRING3 - waitmessage 1 - moveendto MOVEEND_NEXT_TARGET - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_TripleKickPrintStrings - decrementmultihit BattleScript_TripleKickLoop - goto BattleScript_TripleKickPrintStrings -BattleScript_TripleKickNoMoreHits:: - pause B_WAIT_TIME_SHORT - jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickPrintStrings - bicbyte gMoveResultFlags, MOVE_RESULT_MISSED -BattleScript_TripleKickPrintStrings:: - resultmessage - waitmessage B_WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickEnd - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd - copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 - printstring STRINGID_HITXTIMES - waitmessage B_WAIT_TIME_LONG -BattleScript_TripleKickEnd:: - seteffectwithchance - tryfaintmon BS_TARGET - moveendfrom MOVEEND_UPDATE_LAST_MOVES - end - BattleScript_EffectThief:: setmoveeffect MOVE_EFFECT_STEAL_ITEM goto BattleScript_EffectHit @@ -1441,7 +1132,7 @@ BattleScript_EffectMeanLook:: attackcanceler attackstring ppreduce - accuracycheck BattleScript_ButItFailed, NO_ACC_CALC + accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_ButItFailed jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed attackanimation @@ -1476,7 +1167,7 @@ BattleScript_EffectMinimize:: goto BattleScript_EffectStatUpAfterAtkCanceler BattleScript_EffectCurse:: - jumpiftype2 BS_ATTACKER, TYPE_GHOST, BattleScript_GhostCurse + jumpiftype BS_ATTACKER, TYPE_GHOST, BattleScript_GhostCurse attackcanceler attackstring ppreduce @@ -1539,7 +1230,7 @@ BattleScript_EffectEndure:: BattleScript_EffectSpikes:: attackcanceler - trysetspikes BattleScript_ButItFailedAtkStringPpReduce + trysetspikes BattleScript_FailedFromAtkString attackstring ppreduce attackanimation @@ -1589,18 +1280,6 @@ BattleScript_EffectSandstorm:: setsandstorm goto BattleScript_MoveWeatherChange -BattleScript_EffectRollout:: - attackcanceler - attackstring - jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_RolloutCheckAccuracy - ppreduce -BattleScript_RolloutCheckAccuracy:: - accuracycheck BattleScript_RolloutHit, ACC_CURR_MOVE -BattleScript_RolloutHit:: - typecalc2 - rolloutdamagecalculation - goto BattleScript_HitFromCritCalc - BattleScript_EffectSwagger:: attackcanceler jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_MakeMoveMissed @@ -1630,12 +1309,12 @@ BattleScript_EffectFuryCutter:: ppreduce accuracycheck BattleScript_FuryCutterHit, ACC_CURR_MOVE BattleScript_FuryCutterHit:: - furycuttercalc + handlefurycutter critcalc damagecalc typecalc jumpifmovehadnoeffect BattleScript_FuryCutterHit - adjustnormaldamage + adjustdamage goto BattleScript_HitFromAtkAnimation BattleScript_EffectAttract:: @@ -1650,13 +1329,6 @@ BattleScript_EffectAttract:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectReturn:: -BattleScript_EffectFrustration:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - friendshiptodamagecalculation - goto BattleScript_HitFromAtkString - BattleScript_EffectPresent:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -1698,7 +1370,7 @@ BattleScript_EffectBatonPass:: switchoutabilities BS_ATTACKER waitstate switchhandleorder BS_ATTACKER, 2 - returntoball BS_ATTACKER + returntoball BS_ATTACKER, FALSE getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER @@ -1720,7 +1392,7 @@ BattleScript_EffectSonicboom:: typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE setword gBattleMoveDamage, 20 - adjustsetdamage + adjustdamage goto BattleScript_HitFromAtkAnimation BattleScript_EffectMorningSun:: @@ -1732,22 +1404,16 @@ BattleScript_EffectMoonlight:: recoverbasedonsunlight BattleScript_AlreadyAtFullHp goto BattleScript_PresentHealTarget -BattleScript_EffectHiddenPower:: - attackcanceler - hiddenpowercalc - goto BattleScript_HitFromAccCheck - BattleScript_EffectRainDance:: attackcanceler attackstring ppreduce + call BattleScript_CheckPrimalWeather setrain BattleScript_MoveWeatherChange:: attackanimation waitanimation - printfromtable gMoveWeatherChangeStringIds - waitmessage B_WAIT_TIME_LONG - call BattleScript_WeatherFormChanges + call BattleScript_MoveWeatherChangeRet goto BattleScript_MoveEnd BattleScript_EffectSunnyDay:: @@ -1773,12 +1439,16 @@ BattleScript_EffectBellyDrum:: attackcanceler attackstring ppreduce - maxattackhalvehp BattleScript_ButItFailed + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_ATK, MAX_STAT_STAGE, BattleScript_ButItFailed + halvehp BattleScript_ButItFailed orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE attackanimation waitanimation healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER + playstatchangeanimation BS_ATTACKER, BIT_ATK, STAT_CHANGE_BY_TWO + setstatchanger STAT_ATK, MAX_STAT_STAGE, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_MoveEnd printstring STRINGID_PKMNCUTHPMAXEDATTACK waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd @@ -1796,29 +1466,15 @@ BattleScript_EffectPsychUp:: BattleScript_EffectMirrorCoat:: attackcanceler - mirrorcoatdamagecalculator BattleScript_ButItFailedAtkStringPpReduce + mirrorcoatdamagecalculator BattleScript_FailedFromAtkString accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - typecalc2 - adjustsetdamage + typecalc + bichalfword gMoveResultFlags, MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE + adjustdamage goto BattleScript_HitFromAtkAnimation -BattleScript_EffectSkullBash:: - jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn - jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKULL_BASH - call BattleScriptFirstChargingTurn - setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_SkullBashEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SkullBashEnd - setgraphicalstatchangevalues - playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 - printfromtable gStatUpStringIds - waitmessage B_WAIT_TIME_LONG -BattleScript_SkullBashEnd:: - goto BattleScript_MoveEnd - BattleScript_EffectTwister:: jumpifnostatus3 BS_TARGET, STATUS3_ON_AIR, BattleScript_FlinchEffect orword gHitMarker, HITMARKER_IGNORE_ON_AIR @@ -1846,7 +1502,7 @@ BattleScript_DoHitAllWithUndergroundBonus:: critcalc damagecalc typecalc - adjustnormaldamage + adjustdamage attackanimation waitanimation effectivenesssound @@ -1896,23 +1552,6 @@ BattleScript_EffectStomp:: setbyte sDMG_MULTIPLIER, 2 goto BattleScript_FlinchEffect -BattleScript_EffectSolarBeam:: - jumpifabilitypresent ABILITY_CLOUD_NINE, BattleScript_SolarBeamDecideTurn - jumpifabilitypresent ABILITY_AIR_LOCK, BattleScript_SolarBeamDecideTurn - 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 - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SOLAR_BEAM - call BattleScriptFirstChargingTurn - goto BattleScript_MoveEnd -BattleScript_SolarBeamOnFirstTurn:: - orword gHitMarker, HITMARKER_CHARGING - setmoveeffect MOVE_EFFECT_CHARGING | MOVE_EFFECT_AFFECTS_USER - seteffectprimary - ppreduce - goto BattleScript_TwoTurnMovesSecondTurn - BattleScript_EffectThunder:: setmoveeffect MOVE_EFFECT_PARALYSIS orword gHitMarker, HITMARKER_IGNORE_ON_AIR @@ -1932,10 +1571,25 @@ BattleScript_EffectTeleport:: waitmessage B_WAIT_TIME_LONG setbyte gBattleOutcome, B_OUTCOME_PLAYER_TELEPORTED goto BattleScript_MoveEnd + +BattleScript_PrintAbilityMadeIneffective:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_PKMNSXMADEITINEFFECTIVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd BattleScript_EffectBeatUp:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE +.if B_BEAT_UP >= GEN_5 + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + trydobeatup + goto BattleScript_HitFromAtkAnimation +.else attackstring pause B_WAIT_TIME_SHORT ppreduce @@ -1945,10 +1599,10 @@ BattleScript_BeatUpLoop:: trydobeatup BattleScript_BeatUpEnd, BattleScript_ButItFailed printstring STRINGID_PKMNATTACK critcalc - jumpifbyte CMP_NOT_EQUAL, gCritMultiplier, 2, BattleScript_BeatUpAttack + jumpifbyte CMP_NOT_EQUAL, gIsCriticalHit, TRUE, BattleScript_BeatUpAttack manipulatedamage DMG_DOUBLED BattleScript_BeatUpAttack:: - adjustnormaldamage + adjustdamage attackanimation waitanimation effectivenesssound @@ -1965,47 +1619,7 @@ BattleScript_BeatUpAttack:: goto BattleScript_BeatUpLoop BattleScript_BeatUpEnd:: end - -BattleScript_EffectSemiInvulnerable:: - jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_SecondTurnSemiInvulnerable - jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_SecondTurnSemiInvulnerable - jumpifmove MOVE_FLY, BattleScript_FirstTurnFly - jumpifmove MOVE_DIVE, BattleScript_FirstTurnDive - jumpifmove MOVE_BOUNCE, BattleScript_FirstTurnBounce - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_DIG - goto BattleScript_FirstTurnSemiInvulnerable - -BattleScript_FirstTurnBounce:: - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_BOUNCE - goto BattleScript_FirstTurnSemiInvulnerable - -BattleScript_FirstTurnDive:: - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_DIVE - goto BattleScript_FirstTurnSemiInvulnerable - -BattleScript_FirstTurnFly:: - setbyte sTWOTURN_STRINGID, B_MSG_TURN1_FLY -BattleScript_FirstTurnSemiInvulnerable:: - call BattleScriptFirstChargingTurn - setsemiinvulnerablebit - goto BattleScript_MoveEnd - -BattleScript_SecondTurnSemiInvulnerable:: - attackcanceler - setmoveeffect MOVE_EFFECT_CHARGING - setbyte sB_ANIM_TURN, 1 - clearstatusfromeffect BS_ATTACKER - orword gHitMarker, HITMARKER_NO_PPDEDUCT - jumpifnotmove MOVE_BOUNCE, BattleScript_SemiInvulnerableTryHit - setmoveeffect MOVE_EFFECT_PARALYSIS -BattleScript_SemiInvulnerableTryHit:: - accuracycheck BattleScript_SemiInvulnerableMiss, ACC_CURR_MOVE - clearsemiinvulnerablebit - goto BattleScript_HitFromAtkString - -BattleScript_SemiInvulnerableMiss:: - clearsemiinvulnerablebit - goto BattleScript_PrintMoveMissed +.endif BattleScript_EffectDefenseCurl:: attackcanceler @@ -2043,13 +1657,15 @@ BattleScript_AlreadyAtFullHp:: BattleScript_EffectFakeOut:: attackcanceler - jumpifnotfirstturn BattleScript_ButItFailedAtkStringPpReduce + jumpifnotfirstturn BattleScript_FailedFromAtkString setmoveeffect MOVE_EFFECT_FLINCH | MOVE_EFFECT_CERTAIN goto BattleScript_EffectHit -BattleScript_ButItFailedAtkStringPpReduce:: +BattleScript_FailedFromAtkCanceler:: + attackcanceler +BattleScript_FailedFromAtkString:: attackstring -BattleScript_ButItFailedPpReduce:: +BattleScript_FailedFromPpReduce:: ppreduce BattleScript_ButItFailed:: pause B_WAIT_TIME_SHORT @@ -2068,23 +1684,43 @@ BattleScript_NotAffected:: BattleScript_EffectUproar:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - setmoveeffect MOVE_EFFECT_UPROAR | MOVE_EFFECT_AFFECTS_USER attackstring jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_UproarHit ppreduce BattleScript_UproarHit:: - nop goto BattleScript_HitFromCritCalc BattleScript_EffectStockpile:: attackcanceler attackstring ppreduce - stockpile + stockpile 0 attackanimation waitanimation printfromtable gStockpileUsedStringIds waitmessage B_WAIT_TIME_LONG + .if B_STOCKPILE_RAISES_DEFS < GEN_4 + goto BattleScript_EffectStockpileEnd + .endif + jumpifmovehadnoeffect BattleScript_EffectStockpileEnd + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_EffectStockpileDef + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_EffectStockpileEnd +BattleScript_EffectStockpileDef: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0 + setstatchanger STAT_DEF, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_EffectStockpileSpDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectStockpileSpDef + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_EffectStockpileSpDef:: + setstatchanger STAT_SPDEF, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_EffectStockpileEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectStockpileEnd + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_EffectStockpileEnd: + stockpile 1 goto BattleScript_MoveEnd BattleScript_EffectSpitUp:: @@ -2093,14 +1729,17 @@ BattleScript_EffectSpitUp:: attackstring ppreduce accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + setbyte gIsCriticalHit, FALSE + damagecalc + adjustdamage stockpiletobasedamage BattleScript_SpitUpFail - typecalc - adjustsetdamage goto BattleScript_HitFromAtkAnimation BattleScript_SpitUpFail:: + checkparentalbondcounter 2, BattleScript_SpitUpEnd pause B_WAIT_TIME_SHORT printstring STRINGID_FAILEDTOSPITUP waitmessage B_WAIT_TIME_LONG +BattleScript_SpitUpEnd: goto BattleScript_MoveEnd BattleScript_SpitUpFailProtect:: @@ -2293,9 +1932,19 @@ BattleScript_EffectCharge:: attackcanceler attackstring ppreduce - setcharge + setcharge BS_ATTACKER attackanimation waitanimation +.if B_CHARGE_SPDEF_RAISE >= GEN_5 + setstatchanger STAT_SPDEF, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_EffectChargeString + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectChargeString + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_EffectChargeString: +.endif printstring STRINGID_PKMNCHARGINGPOWER waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd @@ -2327,7 +1976,7 @@ BattleScript_EffectTrick:: attackcanceler attackstring ppreduce - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed + jumpifsubstituteblocks BattleScript_ButItFailed accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE tryswapitems BattleScript_ButItFailed attackanimation @@ -2343,11 +1992,22 @@ BattleScript_EffectRolePlay:: attackstring ppreduce accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON - trycopyability BattleScript_ButItFailed + trycopyability BS_ATTACKER, BattleScript_ButItFailed attackanimation waitanimation +.if B_ABILITY_POP_UP == TRUE + setbyte sFIXED_ABILITY_POPUP, TRUE + showabilitypopup BS_ATTACKER + pause 60 + sethword sABILITY_OVERWRITE, 0 + updateabilitypopup BS_ATTACKER + pause 20 + destroyabilitypopup + pause 40 +.endif printstring STRINGID_PKMNCOPIEDFOE waitmessage B_WAIT_TIME_LONG + switchinabilities BS_ATTACKER goto BattleScript_MoveEnd BattleScript_EffectWish:: @@ -2362,7 +2022,7 @@ BattleScript_EffectWish:: BattleScript_EffectAssist:: attackcanceler attackstring - assistattackselect BattleScript_ButItFailedPpReduce + assistattackselect BattleScript_FailedFromPpReduce attackanimation waitanimation setbyte sB_ANIM_TURN, 0 @@ -2373,7 +2033,7 @@ BattleScript_EffectIngrain:: attackcanceler attackstring ppreduce - trysetroots BattleScript_ButItFailed + settoxicspikes BattleScript_ButItFailed attackanimation waitanimation printstring STRINGID_PKMNPLANTEDROOTS @@ -2386,7 +2046,7 @@ BattleScript_EffectSuperpower:: BattleScript_EffectMagicCoat:: attackcanceler - trysetmagiccoat BattleScript_ButItFailedAtkStringPpReduce + trysetmagiccoat BattleScript_FailedFromAtkString attackstring ppreduce attackanimation @@ -2407,7 +2067,7 @@ BattleScript_EffectRecycle:: goto BattleScript_MoveEnd BattleScript_EffectRevenge:: - doubledamagedealtifdamaged + setgastroacid BattleScript_CoreEnforcerRet goto BattleScript_EffectHit BattleScript_EffectBrickBreak:: @@ -2418,10 +2078,9 @@ BattleScript_EffectBrickBreak:: removelightscreenreflect critcalc damagecalc - typecalc - adjustnormaldamage + adjustdamage jumpifbyte CMP_EQUAL, sB_ANIM_TURN, 0, BattleScript_BrickBreakAnim - bicbyte gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE BattleScript_BrickBreakAnim:: attackanimation waitanimation @@ -2429,7 +2088,7 @@ BattleScript_BrickBreakAnim:: printstring STRINGID_THEWALLSHATTERED waitmessage B_WAIT_TIME_LONG BattleScript_BrickBreakDoHit:: - typecalc2 + typecalc effectivenesssound hitanimation BS_TARGET waitstate @@ -2439,34 +2098,10 @@ BattleScript_BrickBreakDoHit:: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG - seteffectwithchance + setadditionaleffects tryfaintmon BS_TARGET goto BattleScript_MoveEnd -BattleScript_EffectYawn:: - attackcanceler - attackstring - ppreduce - jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_PrintBankAbilityMadeIneffective - jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed - jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected - accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON - jumpifcantmakeasleep BattleScript_ButItFailed - setyawn BattleScript_ButItFailed - attackanimation - waitanimation - printstring STRINGID_PKMNWASMADEDROWSY - waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd -BattleScript_PrintBankAbilityMadeIneffective:: - copybyte sBATTLER, sBATTLER_WITH_ABILITY -BattleScript_PrintAbilityMadeIneffective:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNSXMADEITINEFFECTIVE - waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd - BattleScript_EffectKnockOff:: setmoveeffect MOVE_EFFECT_KNOCK_OFF goto BattleScript_EffectHit @@ -2482,13 +2117,9 @@ BattleScript_EffectEndeavor:: jumpifmovehadnoeffect BattleScript_HitFromAtkAnimation bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE copyword gBattleMoveDamage, gHpDealt - adjustsetdamage + adjustdamage goto BattleScript_HitFromAtkAnimation -BattleScript_EffectEruption:: - scaledamagebyhealthratio - goto BattleScript_EffectHit - BattleScript_EffectSkillSwap:: attackcanceler attackstring @@ -2528,7 +2159,7 @@ BattleScript_EffectGrudge:: attackcanceler attackstring ppreduce - trysetgrudge BattleScript_ButItFailed + setstealthrock BattleScript_ButItFailed attackanimation waitanimation printstring STRINGID_PKMNWANTSGRUDGE @@ -2537,7 +2168,7 @@ BattleScript_EffectGrudge:: BattleScript_EffectSnatch:: attackcanceler - trysetsnatch BattleScript_ButItFailedAtkStringPpReduce + trysetsnatch BattleScript_FailedFromAtkString attackstring ppreduce attackanimation @@ -2547,18 +2178,6 @@ BattleScript_EffectSnatch:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectLowKick:: - attackcanceler - attackstring - ppreduce - weightdamagecalculation - accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE - goto BattleScript_HitFromCritCalc - -BattleScript_EffectSecretPower:: - getsecretpowereffect - goto BattleScript_EffectHit - BattleScript_EffectDoubleEdge:: setmoveeffect MOVE_EFFECT_RECOIL_33 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN goto BattleScript_EffectHit @@ -2633,10 +2252,6 @@ BattleScript_EffectPoisonFang:: setmoveeffect MOVE_EFFECT_TOXIC goto BattleScript_EffectHit -BattleScript_EffectWeatherBall:: - setweatherballtype - goto BattleScript_EffectHit - BattleScript_EffectOverheat:: setmoveeffect MOVE_EFFECT_SP_ATK_TWO_DOWN | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN goto BattleScript_EffectHit @@ -2822,17 +2437,20 @@ BattleScript_GiveExp:: end2 BattleScript_HandleFaintedMon:: + setbyte sSHIFT_SWITCHED, 0 checkteamslost BattleScript_LinkHandleFaintedMonMultiple jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd - jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChoose + jumpifbattletype BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE, 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_FaintedMonTryChoose +@ Player said no, try to run jumpifplayerran BattleScript_FaintedMonEnd printstring STRINGID_CANTESCAPE2 -BattleScript_FaintedMonTryChoose:: +BattleScript_FaintedMonTryChoose: openpartyscreen BS_FAINTED, BattleScript_FaintedMonEnd switchhandleorder BS_FAINTED, 2 jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonSendOutNew @@ -2842,6 +2460,7 @@ BattleScript_FaintedMonTryChoose:: 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 + setbyte sILLUSION_NICK_HACK, 1 @ Yes/No for sending out a new Pokémon when the opponent is switching printstring STRINGID_ENEMYABOUTTOSWITCHPKMN setbyte gBattleCommunication, 0 @@ -2854,7 +2473,7 @@ BattleScript_FaintedMonTryChoose:: jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonSendOutNew @ Switch Pokémon before opponent atknameinbuff1 - resetintimidatetracebits BS_ATTACKER + resetswitchinabilitybits BS_ATTACKER hpthresholds2 BS_ATTACKER printstring STRINGID_RETURNMON switchoutabilities BS_ATTACKER @@ -2865,27 +2484,39 @@ BattleScript_FaintedMonTryChoose:: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + flushtextbox printstring STRINGID_SWITCHINMON hidepartystatussummary BS_ATTACKER switchinanim BS_ATTACKER, 0 waitstate - switchineffects BS_ATTACKER - resetsentmonsvalue -BattleScript_FaintedMonSendOutNew:: + setbyte sSHIFT_SWITCHED, 1 +BattleScript_FaintedMonSendOutNew: drawpartystatussummary BS_FAINTED getswitchedmondata BS_FAINTED switchindataupdate BS_FAINTED hpthresholds BS_FAINTED + trytoclearprimalweather + flushtextbox printstring STRINGID_SWITCHINMON hidepartystatussummary BS_FAINTED switchinanim BS_FAINTED, FALSE waitstate resetplayerfainted + trytrainerslidelastonmsg BS_FAINTED + jumpifbytenotequal sSHIFT_SWITCHED, sZero, BattleScript_FaintedMonShiftSwitched +BattleScript_FaintedMonSendOutNewEnd: switchineffects BS_FAINTED jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonEnd cancelallactions BattleScript_FaintedMonEnd:: end2 +BattleScript_FaintedMonShiftSwitched: + copybyte sSAVED_BATTLER, gBattlerTarget + switchineffects BS_ATTACKER + resetsentmonsvalue + copybyte gBattlerTarget, sSAVED_BATTLER + goto BattleScript_FaintedMonSendOutNewEnd BattleScript_LinkHandleFaintedMonMultiple:: openpartyscreen BS_FAINTED_LINK_MULTIPLE_1, BattleScript_LinkHandleFaintedMonMultipleStart @@ -2913,7 +2544,7 @@ BattleScript_LocalTrainerBattleWon:: trainerslidein BS_ATTACKER waitstate printstring STRINGID_TRAINER1LOSETEXT - getmoneyreward BattleScript_LocalTrainerBattleWonGotMoney + getmoneyreward BattleScript_LocalTrainerBattleWonGotMoney:: printstring STRINGID_PLAYERGOTMONEY waitmessage B_WAIT_TIME_LONG @@ -2931,7 +2562,7 @@ BattleScript_LocalBattleLostPrintWhiteOut:: jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalBattleLostEnd printstring STRINGID_PLAYERWHITEOUT waitmessage B_WAIT_TIME_LONG - getmoneyreward BattleScript_LocalBattleLostPrintTrainersWinText + getmoneyreward printstring STRINGID_PLAYERWHITEOUT2 waitmessage B_WAIT_TIME_LONG goto BattleScript_EReaderOrSecretBaseTrainerEnd @@ -2939,7 +2570,7 @@ BattleScript_LocalBattleLostPrintWhiteOut:: BattleScript_LocalBattleLostEnd:: printstring STRINGID_PLAYERLOSTAGAINSTENEMYTRAINER waitmessage B_WAIT_TIME_LONG - getmoneyreward BattleScript_LocalBattleLostPrintTrainersWinText + getmoneyreward printstring STRINGID_PLAYERPAIDPRIZEMONEY waitmessage B_WAIT_TIME_LONG BattleScript_EReaderOrSecretBaseTrainerEnd:: @@ -2968,9 +2599,9 @@ BattleScript_BattleTowerLost:: jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0, BattleScript_BattleTowerLostLostSkipMonRecall printfromtable gDoubleBattleRecallStrings waitmessage B_WAIT_TIME_LONG - returnopponentmon1toball + returnopponentmon1toball BS_ATTACKER waitstate - returnopponentmon2toball + returnopponentmon2toball BS_ATTACKER waitstate BattleScript_BattleTowerLostLostSkipMonRecall:: trainerslidein BS_ATTACKER @@ -3045,8 +2676,8 @@ BattleScript_PrintFullBox:: BattleScript_ActionSwitch:: hpthresholds2 BS_ATTACKER + copybyte sSAVED_BATTLER, gBattlerAttacker printstring STRINGID_RETURNMON - setbyte sDMG_MULTIPLIER, 2 jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit setmultihit 1 goto BattleScript_PursuitSwitchDmgLoop @@ -3061,7 +2692,9 @@ BattleScript_PursuitSwitchDmgLoop:: BattleScript_DoSwitchOut:: decrementmultihit BattleScript_PursuitSwitchDmgLoop switchoutabilities BS_ATTACKER + @ updatedynamax @ TODO: Dynamax waitstate + copybyte gBattlerAttacker, sSAVED_BATTLER returnatktoball waitstate drawpartystatussummary BS_ATTACKER @@ -3069,12 +2702,14 @@ BattleScript_DoSwitchOut:: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + flushtextbox printstring STRINGID_SWITCHINMON hidepartystatussummary BS_ATTACKER switchinanim BS_ATTACKER, FALSE waitstate switchineffects BS_ATTACKER - moveendcase MOVEEND_IMMUNITY_ABILITIES + moveendcase MOVEEND_STATUS_IMMUNITY_ABILITIES moveendcase MOVEEND_MIRROR_MOVE end2 @@ -3084,8 +2719,7 @@ BattleScript_PursuitDmgOnSwitchOut:: ppreduce critcalc damagecalc - typecalc - adjustnormaldamage + adjustdamage attackanimation waitanimation effectivenesssound @@ -3098,9 +2732,8 @@ BattleScript_PursuitDmgOnSwitchOut:: resultmessage waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET - moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE - getbattlerfainted BS_TARGET - jumpifbyte CMP_EQUAL, gBattleCommunication, FALSE, BattleScript_PursuitDmgOnSwitchOutRet + moveendfromto MOVEEND_ABILITIES, MOVEEND_CHOICE_MOVE + jumpiffainted BS_TARGET, FALSE, BattleScript_PursuitDmgOnSwitchOutRet setbyte sGIVEEXP_STATE, 0 getexp BS_TARGET BattleScript_PursuitDmgOnSwitchOutRet: @@ -3258,7 +2891,7 @@ BattleScript_BideAttack:: typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE copyword gBattleMoveDamage, sBIDE_DMG - adjustsetdamage + adjustdamage setbyte sB_ANIM_TURN, 1 attackanimation waitanimation @@ -3284,7 +2917,7 @@ BattleScript_SuccessForceOut:: attackanimation waitanimation switchoutabilities BS_TARGET - returntoball BS_TARGET + returntoball BS_TARGET, FALSE waitstate jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_TrainerBattleForceOut setbyte gBattleOutcome, B_OUTCOME_PLAYER_TELEPORTED @@ -3458,6 +3091,26 @@ BattleScript_SpikesFree:: waitmessage B_WAIT_TIME_LONG return +BattleScript_ToxicSpikesFree:: + printstring STRINGID_PKMNBLEWAWAYTOXICSPIKES + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_StickyWebFree:: + printstring STRINGID_PKMNBLEWAWAYSTICKYWEB + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_StealthRockFree:: + printstring STRINGID_PKMNBLEWAWAYSTEALTHROCK + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SteelsurgeFree:: + printstring STRINGID_PKMNBLEWAWAYSHARPSTEEL + waitmessage B_WAIT_TIME_LONG + return + BattleScript_MonTookFutureAttack:: printstring STRINGID_PKMNTOOKATTACK waitmessage B_WAIT_TIME_LONG @@ -3467,7 +3120,9 @@ BattleScript_MonTookFutureAttack:: BattleScript_CheckDoomDesireMiss:: accuracycheck BattleScript_FutureAttackMiss, MOVE_DOOM_DESIRE BattleScript_FutureAttackAnimate:: - adjustnormaldamage2 + critcalc + damagecalc + adjustdamage jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_FUTURE_SIGHT, BattleScript_FutureHitAnimDoomDesire playanimation BS_ATTACKER, B_ANIM_FUTURE_SIGHT_HIT goto BattleScript_DoFutureAttackHit @@ -3584,6 +3239,25 @@ BattleScript_AtkDefDownAtkFail:: BattleScript_AtkDefDownDefFail:: return +BattleScript_DefSpDefDown:: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_MULTIPLE_STATS + playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE + setstatchanger STAT_DEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_DefSpDefDownTrySpDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_DefSpDefDownTrySpDef + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefSpDefDownTrySpDef:: + playstatchangeanimation BS_ATTACKER, BIT_SPDEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE + setstatchanger STAT_SPDEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_DefSpDefDownRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_DefSpDefDownRet + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefSpDefDownRet:: + return + BattleScript_KnockedOff:: playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF printstring STRINGID_PKMNKNOCKEDOFF @@ -3608,12 +3282,27 @@ BattleScript_MagicCoatBounce:: attackstring ppreduce pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNMOVEBOUNCED + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0, BattleScript_MagicCoatBounce_Print + call BattleScript_AbilityPopUp +BattleScript_MagicCoatBounce_Print: + printfromtable gMagicCoatBounceStringIds waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_ALLOW_NO_PP + bicword gHitMarker, HITMARKER_NO_ATTACKSTRING setmagiccoattarget BS_ATTACKER return +BattleScript_MagicCoatBouncePrankster:: + attackstring + ppreduce + pause B_WAIT_TIME_SHORT + printfromtable gMagicCoatBounceStringIds + waitmessage B_WAIT_TIME_LONG + printstring STRINGID_ITDOESNTAFFECT + waitmessage B_WAIT_TIME_LONG + orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + goto BattleScript_MoveEnd + BattleScript_SnatchedMove:: attackstring ppreduce @@ -3740,7 +3429,7 @@ BattleScript_MoveUsedIsConfused:: jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, FALSE, BattleScript_MoveUsedIsConfusedRet BattleScript_DoSelfConfusionDmg:: cancelmultiturnmoves BS_ATTACKER - adjustnormaldamage2 + adjustdamage printstring STRINGID_ITHURTCONFUSION waitmessage B_WAIT_TIME_LONG effectivenesssound @@ -3857,6 +3546,12 @@ BattleScript_MoveEffectBurn:: waitmessage B_WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet +BattleScript_MoveEffectFrostbite:: + statusanimation BS_EFFECT_BATTLER + printfromtable gGotFrostbiteStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_UpdateEffectStatusIconRet + BattleScript_MoveEffectFreeze:: statusanimation BS_EFFECT_BATTLER printfromtable gGotFrozenStringIds @@ -3917,10 +3612,11 @@ BattleScript_ItemSteal:: BattleScript_DrizzleActivates:: pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp printstring STRINGID_PKMNMADEITRAIN waitstate playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES - call BattleScript_WeatherFormChanges + call BattleScript_ActivateWeatherAbilities end3 BattleScript_SpeedBoostActivates:: @@ -3945,10 +3641,11 @@ BattleScript_RainDishActivates:: BattleScript_SandstreamActivates:: pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM waitstate playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES - call BattleScript_WeatherFormChanges + call BattleScript_ActivateWeatherAbilities end3 BattleScript_ShedSkinActivates:: @@ -3957,65 +3654,72 @@ BattleScript_ShedSkinActivates:: updatestatusicon BS_ATTACKER end3 -BattleScript_WeatherFormChanges:: - setbyte sBATTLER, 0 -BattleScript_WeatherFormChangesLoop:: - trycastformdatachange - addbyte sBATTLER, 1 - jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_WeatherFormChangesLoop - return - -BattleScript_CastformChange:: - call BattleScript_DoCastformChangeAnim - end3 - -BattleScript_DoCastformChangeAnim:: - docastformchangeanimation - waitstate - printstring STRINGID_PKMNTRANSFORMED - waitmessage B_WAIT_TIME_LONG - return - -BattleScript_IntimidateActivatesEnd3:: - call BattleScript_DoIntimidateActivationAnim - end3 - -BattleScript_DoIntimidateActivationAnim:: - pause B_WAIT_TIME_SHORT BattleScript_IntimidateActivates:: + copybyte sSAVED_BATTLER, gBattlerTarget +.if B_ABILITY_POP_UP == TRUE + showabilitypopup BS_ATTACKER + pause B_WAIT_TIME_LONG + destroyabilitypopup +.endif setbyte gBattlerTarget, 0 +BattleScript_IntimidateLoop: + jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_IntimidateLoopIncrement + jumpiftargetally BattleScript_IntimidateLoopIncrement + jumpifabsent BS_TARGET, BattleScript_IntimidateLoopIncrement + jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_IntimidateLoopIncrement + jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_IntimidateInReverse +BattleScript_IntimidateEffect: + copybyte sBATTLER, gBattlerAttacker setstatchanger STAT_ATK, 1, TRUE -BattleScript_IntimidateActivationAnimLoop:: - trygetintimidatetarget BattleScript_IntimidateEnd - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_IntimidateFail - jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_IntimidateAbilityFail - jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidateAbilityFail - jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_IntimidateAbilityFail - statbuffchange STAT_CHANGE_ALLOW_PTR | STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_IntimidateFail - jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 1, BattleScript_IntimidateFail + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_IntimidateLoopIncrement setgraphicalstatchangevalues + jumpifability BS_TARGET, ABILITY_CONTRARY, BattleScript_IntimidateContrary + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_IntimidateWontDecrease playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printstring STRINGID_PKMNCUTSATTACKWITH +BattleScript_IntimidateEffect_WaitString: waitmessage B_WAIT_TIME_LONG -BattleScript_IntimidateFail:: + copybyte sBATTLER, gBattlerTarget + call BattleScript_TryIntimidateHoldEffects +BattleScript_IntimidateLoopIncrement: addbyte gBattlerTarget, 1 - goto BattleScript_IntimidateActivationAnimLoop + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_IntimidateLoop +BattleScript_IntimidateEnd: + copybyte sBATTLER, gBattlerAttacker + destroyabilitypopup + copybyte gBattlerTarget, sSAVED_BATTLER + pause B_WAIT_TIME_MED + end3 -BattleScript_IntimidateEnd:: - return +BattleScript_IntimidateWontDecrease: + printstring STRINGID_STATSWONTDECREASE + goto BattleScript_IntimidateEffect_WaitString -BattleScript_IntimidateAbilityFail:: +BattleScript_IntimidateContrary: + call BattleScript_AbilityPopUpTarget + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_IntimidateContrary_WontIncrease + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + goto BattleScript_IntimidateEffect_WaitString +BattleScript_IntimidateContrary_WontIncrease: + printstring STRINGID_TARGETSTATWONTGOHIGHER + goto BattleScript_IntimidateEffect_WaitString + +BattleScript_IntimidateInReverse: + copybyte sBATTLER, gBattlerTarget + call BattleScript_AbilityPopUpTarget pause B_WAIT_TIME_SHORT - printstring STRINGID_PREVENTEDFROMWORKING - waitmessage B_WAIT_TIME_LONG - goto BattleScript_IntimidateFail + modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_IntimidateLoopIncrement, ANIM_ON + call BattleScript_TryIntimidateHoldEffects + goto BattleScript_IntimidateLoopIncrement BattleScript_DroughtActivates:: pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp printstring STRINGID_PKMNSXINTENSIFIEDSUN waitstate playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES - call BattleScript_WeatherFormChanges + call BattleScript_ActivateWeatherAbilities end3 BattleScript_TookAttack:: @@ -4185,11 +3889,14 @@ BattleScript_IgnoresAndUsesRandomMove:: printstring STRINGID_PKMNIGNOREDORDERS waitmessage B_WAIT_TIME_LONG jumptocalledmove 0 -BattleScript_MoveUsedLoafingAround:: +BattleScript_MoveUsedLoafingAroundMsg:: printfromtable gInobedientStringIds waitmessage B_WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET end +BattleScript_TruantLoafingAround:: + call BattleScript_AbilityPopUp + goto BattleScript_MoveUsedLoafingAroundMsg BattleScript_IgnoresAndFallsAsleep:: printstring STRINGID_PKMNBEGANTONAP @@ -4338,7 +4045,7 @@ BattleScript_SelectingNotAllowedMoveChoiceItem:: endselectionscript BattleScript_FocusBandActivates:: - playanimation BS_TARGET, B_ANIM_FOCUS_BAND + playanimation BS_TARGET, B_ANIM_HANGED_ON printstring STRINGID_PKMNHUNGONWITHX waitmessage B_WAIT_TIME_LONG return @@ -4380,3 +4087,2339 @@ BattleScript_ActionSelectionItemsCantBeUsed:: BattleScript_FlushMessageBox:: printstring STRINGID_EMPTYSTRING3 return + +@ pokeemerald +BattleScript_AbilityPopUpTarget: + copybyte gBattlerAbility, gBattlerTarget +BattleScript_AbilityPopUp: + .if B_ABILITY_POP_UP == TRUE + showabilitypopup BS_ABILITY_BATTLER + pause 40 + .endif + recordability BS_ABILITY_BATTLER + sethword sABILITY_OVERWRITE, 0 + return + +BattleScript_ProteanActivates:: + pause B_WAIT_TIME_SHORTEST + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNCHANGEDTYPE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MoveUsedPsychicTerrainPrevents:: + printstring STRINGID_POKEMONCANNOTUSEMOVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_FlingFailConsumeItem:: + removeitem BS_ATTACKER + goto BattleScript_FailedFromAtkString + +BattleScript_MoveUsedHealBlockPrevents:: + printstring STRINGID_HEALBLOCKPREVENTSUSAGE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_MoveUsedGravityPrevents:: + printstring STRINGID_GRAVITYPREVENTSUSAGE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_MoveUsedUnfrostbite:: + printfromtable gFrostbiteHealedStringIds + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_ATTACKER + return + +BattleScript_PowderMoveNoEffect:: + attackstring + ppreduce + pause B_WAIT_TIME_SHORT + jumpiftype BS_TARGET, TYPE_GRASS, BattleScript_PowderMoveNoEffectPrint + jumpifability BS_TARGET, ABILITY_OVERCOAT, BattleScript_PowderMoveNoEffectOvercoat + printstring STRINGID_SAFETYGOGGLESPROTECTED + goto BattleScript_PowderMoveNoEffectWaitMsg +BattleScript_PowderMoveNoEffectOvercoat: + call BattleScript_AbilityPopUp +BattleScript_PowderMoveNoEffectPrint: + printstring STRINGID_ITDOESNTAFFECT +BattleScript_PowderMoveNoEffectWaitMsg: + waitmessage B_WAIT_TIME_LONG + cancelmultiturnmoves BS_ATTACKER + sethword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_MoveUsedPowder:: + bicword gHitMarker, HITMARKER_NO_ATTACKSTRING | HITMARKER_ATTACKSTRING_PRINTED + attackstring + ppreduce + pause B_WAIT_TIME_SHORT + cancelmultiturnmoves BS_ATTACKER + status2animation BS_ATTACKER, STATUS2_POWDER + waitanimation + effectivenesssound + hitanimation BS_ATTACKER + waitstate + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printstring STRINGID_POWDEREXPLODES + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_ATTACKER + goto BattleScript_MoveEnd + +BattleScript_MoveUsedIsThroatChopPrevented:: + printstring STRINGID_PKMNCANTUSEMOVETHROATCHOP + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_PrimalWeatherBlocksMove:: + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_ATTACKSTRING_PRINTED, BattleScript_MoveEnd @in case of multi-target moves, if move fails once, no point in printing the message twice + accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON + attackstring + pause B_WAIT_TIME_SHORT + ppreduce + printfromtable gPrimalWeatherBlocksStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_BerryReduceDmg:: + playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT + waitanimation + setlastuseditem BS_TARGET + printstring STRINGID_TARGETATEITEM + waitmessage B_WAIT_TIME_LONG + removeitem BS_TARGET + return + +BattleScript_GemActivates:: + playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT + waitanimation + setlastuseditem BS_ATTACKER + printstring STRINGID_GEMACTIVATES + waitmessage B_WAIT_TIME_LONG + removeitem BS_ATTACKER + return + +BattleScript_AttackWeakenedByStrongWinds:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SturdiedMsg:: + pause B_WAIT_TIME_SHORTEST + call BattleScript_AbilityPopUpTarget + printstring STRINGID_ENDUREDSTURDY + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_HangedOnMsg:: + playanimation BS_TARGET, B_ANIM_HANGED_ON + printstring STRINGID_PKMNHUNGONWITHX + waitmessage B_WAIT_TIME_LONG + jumpifnoholdeffect BS_TARGET, HOLD_EFFECT_FOCUS_SASH, BattleScript_HangedOnMsgRet + removeitem BS_TARGET +BattleScript_HangedOnMsgRet: + return + +BattleScript_PrintBerryReduceString:: + waitmessage B_WAIT_TIME_LONG + printstring STRINGID_BERRYDMGREDUCES + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_TargetFormChangeNoPopup: + flushtextbox + handleformchange BS_SCRIPTING, 0 + handleformchange BS_SCRIPTING, 1 + playanimation BS_TARGET, B_ANIM_FORM_CHANGE + waitanimation + handleformchange BS_SCRIPTING, 2 + .if B_DISGUISE_HP_LOSS >= GEN_8 + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + .endif + return + +BattleScript_TargetFormChange:: + pause 5 + call BattleScript_AbilityPopUpTarget + call BattleScript_TargetFormChangeNoPopup + return + +BattleScript_TargetFormChangeWithString:: + pause 5 + call BattleScript_AbilityPopUpTarget + call BattleScript_TargetFormChangeNoPopup + printstring STRINGID_PKMNTRANSFORMED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_TargetFormChangeWithStringNoPopup:: + call BattleScript_TargetFormChangeNoPopup + printstring STRINGID_PKMNTRANSFORMED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_IceFaceNullsDamage:: + call BattleScript_TargetFormChangeWithString + return + +BattleScript_AffectionBasedEndurance:: +@ playanimation BS_TARGET, B_ANIM_AFFECTION_HANGED_ON @ TODO: Animation + printstring STRINGID_TARGETTOUGHEDITOUT + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MoveEffectClearSmog:: + printstring STRINGID_RESETSTARGETSSTATLEVELS + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MoveEffectFlameBurst:: + tryfaintmon BS_TARGET + copybyte sBATTLER, sSAVED_BATTLER + printstring STRINGID_BURSTINGFLAMESHIT + waitmessage B_WAIT_TIME_LONG + savetarget + copybyte gBattlerTarget, sSAVED_BATTLER + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + tryfaintmon BS_TARGET + restoretarget + goto BattleScript_MoveEnd + +BattleScript_HyperspaceFuryRemoveProtect:: + printstring STRINGID_BROKETHROUGHPROTECTION + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MoveEffectFeint:: + printstring STRINGID_FELLFORFEINT + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SpectralThiefSteal:: + printstring STRINGID_SPECTRALTHIEFSTEAL + waitmessage B_WAIT_TIME_LONG + setbyte sB_ANIM_ARG2, 0 + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + spectralthiefprintstats + return + +BattleScript_VCreateStatLoss:: + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_VCreateStatAnim + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_VCreateStatAnim + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MIN_STAT_STAGE, BattleScript_VCreateStatLossRet +BattleScript_VCreateStatAnim: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF | BIT_SPEED, STAT_CHANGE_NEGATIVE | STAT_CHANGE_CANT_PREVENT + setstatchanger STAT_DEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, BattleScript_VCreateTrySpDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_VCreateTrySpDef + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_VCreateTrySpDef: + setstatchanger STAT_SPDEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, BattleScript_VCreateTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_VCreateTrySpeed + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_VCreateTrySpeed: + setstatchanger STAT_SPEED, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, BattleScript_VCreateStatLossRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_VCreateStatLossRet + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_VCreateStatLossRet: + return + +BattleScript_MoveEffectCoreEnforcer:: + setgastroacid BattleScript_CoreEnforcerRet + printstring STRINGID_PKMNSABILITYSUPPRESSED + waitmessage B_WAIT_TIME_LONG + trytoclearprimalweather + tryrevertweatherform + flushtextbox +BattleScript_CoreEnforcerRet: + return + +BattleScript_MoveEffectIncinerate:: + printstring STRINGID_INCINERATEBURN + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MoveEffectBugBite:: + printstring STRINGID_BUGBITE + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_DISABLE_ANIMATION + setbyte sBERRY_OVERRIDE, 1 @ override the requirements for eating berries + savetarget + consumeberry BS_ATTACKER, FALSE + bicword gHitMarker, HITMARKER_DISABLE_ANIMATION + setbyte sBERRY_OVERRIDE, 0 + trysymbiosis + restoretarget + return + +BattleScript_BothCanNoLongerEscape:: + printstring STRINGID_BOTHCANNOLONGERESCAPE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_RemoveFireType:: + printstring STRINGID_ATTACKERLOSTFIRETYPE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_RemoveElectricType:: + printstring STRINGID_ATTACKERLOSTELECTRICTYPE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_RemoveGenericType:: + printstring STRINGID_ATTACKERLOSTITSTYPE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_StealthRockActivates:: + setstealthrock BattleScript_MoveEnd + printfromtable gDmgHazardsStringIds + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SpikesActivates:: + trysetspikes BattleScript_MoveEnd + printfromtable gDmgHazardsStringIds + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SyrupBombActivates:: + printstring STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_AromaVeilProtectsRet:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_AROMAVEILPROTECTED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_EffectPsychicNoise:: + printstring STRINGID_PKMNPREVENTEDFROMHEALING + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SymbiosisActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_SYMBIOSISITEMPASS + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_NoItemSteal:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_PKMNSXMADEYINEFFECTIVE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_OverworldStatusStarts:: + printfromtable gStartingStatusStringIds + waitmessage B_WAIT_TIME_LONG + playanimation_var BS_ATTACKER, sB_ANIM_ARG1 + call BattleScript_OverworldStatusStarts_TryActivations + end3 + +BattleScript_OverworldStatusStarts_TryActivations: + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TRICK_ROOM, BattleScript_TryRoomServiceLoop + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TAILWIND_PLAYER, BattleScript_TryTailwindAbilitiesLoop + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TAILWIND_OPPONENT, BattleScript_TryTailwindAbilitiesLoop + return + +BattleScript_TryRoomServiceLoop: + savetarget + setbyte gBattlerTarget, 0 +BattleScript_RoomServiceLoop: + copybyte sBATTLER, gBattlerTarget + tryroomservice BS_TARGET, BattleScript_RoomServiceLoop_NextBattler + removeitem BS_TARGET +BattleScript_RoomServiceLoop_NextBattler: + addbyte gBattlerTarget, 0x1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_RoomServiceLoop + restoretarget + return + +BattleScript_TryTailwindAbilitiesLoop: + savetarget + setbyte gBattlerTarget, 0 +BattleScript_TryTailwindAbilitiesLoop_Iter: + trywindriderpower BS_TARGET, BattleScript_TryTailwindAbilitiesLoop_Increment + jumpifability BS_TARGET, ABILITY_WIND_RIDER, BattleScript_TryTailwindAbilitiesLoop_WindRider + jumpifability BS_TARGET, ABILITY_WIND_POWER, BattleScript_TryTailwindAbilitiesLoop_WindPower +BattleScript_TryTailwindAbilitiesLoop_Increment: + addbyte gBattlerTarget, 0x1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TryTailwindAbilitiesLoop_Iter +BattleScript_TryTailwindAbilitiesLoop_Ret: + restoretarget + return + +BattleScript_TryTailwindAbilitiesLoop_WindRider: + call BattleScript_AbilityPopUp + modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_TryTailwindAbilitiesLoop_Increment, ANIM_ON + goto BattleScript_TryTailwindAbilitiesLoop_Increment + +BattleScript_TryTailwindAbilitiesLoop_WindPower: + call BattleScript_AbilityPopUp + setcharge BS_TARGET + printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER + waitmessage B_WAIT_TIME_LONG + goto BattleScript_TryTailwindAbilitiesLoop_Increment + +BattleScript_OverworldTerrain:: + printfromtable gTerrainStringIds + waitmessage B_WAIT_TIME_LONG + playanimation BS_BATTLER_0, B_ANIM_RESTORE_BG + call BattleScript_ActivateTerrainEffects + end3 + +BattleScript_ImposterActivates:: + call BattleScript_AbilityPopUp + transformdataexecution + playmoveanimation BS_ATTACKER, MOVE_TRANSFORM + waitanimation + printstring STRINGID_IMPOSTERTRANSFORM + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_SwitchInAbilityMsg:: + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_SwitchInAbilityMsgRet:: + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_ActivateAsOne:: + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + @ show unnerve + sethword sABILITY_OVERWRITE, ABILITY_UNNERVE + setbyte cMULTISTRING_CHOOSER, B_MSG_SWITCHIN_UNNERVE + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_PastelVeilActivates:: + setbyte gBattleCommunication, 0 + setbyte gBattleCommunication + 1, 0 +BattleScript_PastelVeil_TryCurePoison: + jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_PastelVeilCurePoison + goto BattleScript_PastelVeilLoopIncrement +BattleScript_PastelVeilCurePoison: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_PastelVeilCurePoisonNoPopUp + call BattleScript_AbilityPopUp + setbyte gBattleCommunication + 1, 1 +BattleScript_PastelVeilCurePoisonNoPopUp: @ Only show Pastel Veil pop up once if it cures two mons + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + curestatus BS_TARGET + updatestatusicon BS_TARGET +BattleScript_PastelVeilLoopIncrement: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_PastelVeilEnd + addbyte gBattleCommunication, 1 + jumpifnoally BS_TARGET, BattleScript_PastelVeilEnd + setallytonexttarget BattleScript_PastelVeil_TryCurePoison + goto BattleScript_PastelVeilEnd +BattleScript_PastelVeilEnd: + end3 + +BattleScript_FriskActivates:: + tryfriskmsg BS_ATTACKER + end3 + +BattleScript_AttackerAbilityStatRaiseEnd3:: + call BattleScript_AttackerAbilityStatRaise + end3 + +BattleScript_BlockedByPrimalWeatherEnd3:: + call BattleScript_AbilityPopUp + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3 + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3 + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3 + end3 + +BattleScript_SnowWarningActivatesHail:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_SNOWWARNINGHAIL + waitstate + playanimation BS_BATTLER_0, B_ANIM_HAIL_CONTINUES + call BattleScript_ActivateWeatherAbilities + end3 + +BattleScript_SnowWarningActivatesSnow:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_SNOWWARNINGSNOW + waitstate + playanimation BS_BATTLER_0, B_ANIM_HAIL_CONTINUES @ TODO: Animation B_ANIM_SNOW_CONTINUES + call BattleScript_ActivateWeatherAbilities + end3 + +BattleScript_ElectricSurgeActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_TERRAINBECOMESELECTRIC + waitmessage B_WAIT_TIME_LONG + playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + call BattleScript_ActivateTerrainEffects + end3 + +BattleScript_GrassySurgeActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_TERRAINBECOMESGRASSY + waitmessage B_WAIT_TIME_LONG + playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + call BattleScript_ActivateTerrainEffects + end3 + +BattleScript_MistySurgeActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_TERRAINBECOMESMISTY + waitmessage B_WAIT_TIME_LONG + playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + call BattleScript_ActivateTerrainEffects + end3 + +BattleScript_PsychicSurgeActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_TERRAINBECOMESPSYCHIC + waitmessage B_WAIT_TIME_LONG + playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + call BattleScript_ActivateTerrainEffects + end3 + +BattleScript_SupersweetSyrupActivates:: + copybyte sSAVED_BATTLER, gBattlerTarget +.if B_ABILITY_POP_UP == TRUE + showabilitypopup BS_ATTACKER + pause B_WAIT_TIME_LONG + destroyabilitypopup +.endif + printstring STRINGID_SUPERSWEETAROMAWAFTS + waitmessage B_WAIT_TIME_LONG + setbyte gBattlerTarget, 0 +BattleScript_SupersweetSyrupLoop: + jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_SupersweetSyrupLoopIncrement + jumpiftargetally BattleScript_SupersweetSyrupLoopIncrement + jumpifabsent BS_TARGET, BattleScript_SupersweetSyrupLoopIncrement + jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_SupersweetSyrupLoopIncrement +BattleScript_SupersweetSyrupEffect: + copybyte sBATTLER, gBattlerAttacker + setstatchanger STAT_EVASION, 1, TRUE + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_SupersweetSyrupLoopIncrement + setgraphicalstatchangevalues + jumpifability BS_TARGET, ABILITY_CONTRARY, BattleScript_SupersweetSyrupContrary + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SupersweetSyrupWontDecrease + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatDownStringIds +BattleScript_SupersweetSyrupEffect_WaitString: + waitmessage B_WAIT_TIME_LONG + copybyte sBATTLER, gBattlerTarget + call BattleScript_TryIntimidateHoldEffects +BattleScript_SupersweetSyrupLoopIncrement: + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_SupersweetSyrupLoop +BattleScript_SupersweetSyrupEnd: + copybyte sBATTLER, gBattlerAttacker + destroyabilitypopup + copybyte gBattlerTarget, sSAVED_BATTLER + pause B_WAIT_TIME_MED + end3 + +BattleScript_AnnounceAirLockCloudNine:: + call BattleScript_AbilityPopUp + printstring STRINGID_AIRLOCKACTIVATES + waitmessage B_WAIT_TIME_LONG + call BattleScript_ActivateWeatherAbilities + end3 + +BattleScript_AttackerFormChangeEnd3:: + call BattleScript_AttackerFormChange + end3 + +BattleScript_AttackerFormChangeEnd3NoPopup:: + call BattleScript_AttackerFormChangeNoPopup + end3 + +BattleScript_BattlerAbilityStatRaiseOnSwitchIn:: + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + printstring STRINGID_BATTLERABILITYRAISEDSTAT + waitmessage B_WAIT_TIME_LONG + copybyte gBattlerAttacker, sSAVED_BATTLER + end3 + +BattleScript_DesolateLandActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_EXTREMELYHARSHSUNLIGHT + waitstate + playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES + call BattleScript_ActivateWeatherAbilities + end3 + +BattleScript_PrimordialSeaActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_HEAVYRAIN + waitstate + playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES + call BattleScript_ActivateWeatherAbilities + end3 + +BattleScript_DeltaStreamActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_MYSTERIOUSAIRCURRENT + waitstate + playanimation BS_ATTACKER, B_ANIM_MON_HIT @ TODO: Animation B_ANIM_STRONG_WINDS + end3 + +BattleScript_RuinAbilityActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_SupremeOverlordActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_CostarActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNCOPIEDSTATCHANGES + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_ZeroToHeroActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_ZEROTOHEROTRANSFORMATION + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_HospitalityActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_HOSPITALITYRESTORATION + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + end3 + +BattleScript_HarvestActivates:: + pause 5 + tryrecycleitem BattleScript_HarvestActivatesEnd + call BattleScript_AbilityPopUp + printstring STRINGID_HARVESTBERRY + waitmessage B_WAIT_TIME_LONG +BattleScript_HarvestActivatesEnd: + end3 + +@ Can't compare directly to a value, have to compare to value at pointer +sZero: +.byte 0 + +BattleScript_MoodyActivates:: + call BattleScript_AbilityPopUp + jumpifbyteequal sSTATCHANGER, sZero, BattleScript_MoodyLower + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_MoodyLower + jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_ROSE, BattleScript_MoodyLower + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_MoodyLower: + jumpifbyteequal sSAVED_STAT_CHANGER, sZero, BattleScript_MoodyEnd + copybyte sSTATCHANGER, sSAVED_STAT_CHANGER + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_MoodyEnd + jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_MoodyEnd + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_MoodyEnd: + end3 + +BattleScript_BadDreamsActivates:: + setbyte gBattlerTarget, 0 +BattleScript_BadDreamsLoop: + jumpiftargetally BattleScript_BadDreamsIncrement + jumpifability BS_TARGET, ABILITY_MAGIC_GUARD, BattleScript_BadDreamsIncrement + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_BadDreams_Dmg + jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_BadDreams_Dmg + goto BattleScript_BadDreamsIncrement +BattleScript_BadDreams_Dmg: + jumpifbyteequal sFIXED_ABILITY_POPUP, sZero, BattleScript_BadDreams_ShowPopUp +BattleScript_BadDreams_DmgAfterPopUp: + printstring STRINGID_BADDREAMSDMG + waitmessage B_WAIT_TIME_LONG + dmg_1_8_targethp + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + jumpifhasnohp BS_TARGET, BattleScript_BadDreams_HidePopUp +BattleScript_BadDreamsIncrement: + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_BadDreamsLoop + jumpifbyteequal sFIXED_ABILITY_POPUP, sZero, BattleScript_BadDreamsEnd + destroyabilitypopup + pause 15 +BattleScript_BadDreamsEnd: + end3 +BattleScript_BadDreams_ShowPopUp: + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + setbyte sFIXED_ABILITY_POPUP, TRUE + goto BattleScript_BadDreams_DmgAfterPopUp +BattleScript_BadDreams_HidePopUp: + destroyabilitypopup + tryfaintmon BS_TARGET + goto BattleScript_BadDreamsIncrement + +BattleScript_SolarPowerActivates:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + call BattleScript_AbilityPopUp + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printstring STRINGID_SOLARPOWERHPDROP + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_ATTACKER + end3 + +BattleScript_HealerActivates:: + call BattleScript_AbilityPopUp + curestatus BS_SCRIPTING + updatestatusicon BS_SCRIPTING + printstring STRINGID_HEALERCURE + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_BallFetch:: + call BattleScript_AbilityPopUp + printstring STRINGID_FETCHEDPOKEBALL + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_CudChewActivates:: + pause B_WAIT_TIME_SHORTEST + call BattleScript_AbilityPopUp + setbyte sBERRY_OVERRIDE, 1 @ override the requirements for eating berries + consumeberry BS_SCRIPTING, FALSE + setbyte sBERRY_OVERRIDE, 0 + end3 + +BattleScript_DazzlingProtected:: + attackstring + ppreduce + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_POKEMONCANNOTUSEMOVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_DarkTypePreventsPrankster:: + attackstring + ppreduce + pause B_WAIT_TIME_SHORT + printstring STRINGID_ITDOESNTAFFECT + waitmessage B_WAIT_TIME_LONG + orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + goto BattleScript_MoveEnd + +BattleScript_GoodAsGoldActivates:: + attackstring + ppreduce + call BattleScript_AbilityPopUpTarget + pause B_WAIT_TIME_SHORT + printstring STRINGID_ITDOESNTAFFECT + waitmessage B_WAIT_TIME_MED + goto BattleScript_MoveEnd + +BattleScript_MoveStatDrain_PPLoss:: + ppreduce +BattleScript_MoveStatDrain:: + attackstring + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_MoveStatDrain_Cont +.if B_ABSORBING_ABILITY_STRING >= GEN_5 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +.else + printstring STRINGID_TARGETABILITYSTATRAISE + waitmessage B_WAIT_TIME_LONG +.endif +BattleScript_MoveStatDrain_Cont: + clearsemiinvulnerablebit + tryfaintmon BS_ATTACKER + goto BattleScript_MoveEnd + +BattleScript_TargetAbilityStatRaiseRet:: + copybyte sSAVED_BATTLER, gBattlerAttacker + copybyte gBattlerAbility, gEffectBattler + copybyte gBattlerAttacker, gBattlerTarget + call BattleScript_AbilityPopUp + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN, BattleScript_TargetAbilityStatRaiseRet_End + setgraphicalstatchangevalues + call BattleScript_StatUp +BattleScript_TargetAbilityStatRaiseRet_End: + copybyte gBattlerAttacker, sSAVED_BATTLER + return + +BattleScript_WeakArmorActivates:: + call BattleScript_AbilityPopUp + setstatchanger STAT_DEF, 1, TRUE + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_WeakArmorActivatesSpeed + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_WeakArmorDefAnim + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_WeakArmorActivatesSpeed + pause B_WAIT_TIME_SHORTEST + printfromtable gStatDownStringIds + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED @ Set by statbuffchange when stat can't be decreased + waitmessage B_WAIT_TIME_LONG + goto BattleScript_WeakArmorActivatesSpeed +BattleScript_WeakArmorDefAnim: + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printstring STRINGID_TARGETABILITYSTATLOWER + waitmessage B_WAIT_TIME_LONG +BattleScript_WeakArmorActivatesSpeed: +.if B_WEAK_ARMOR_SPEED >= GEN_7 + setstatchanger STAT_SPEED, 2, FALSE +.else + setstatchanger STAT_SPEED, 1, FALSE +.endif + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_WeakArmorActivatesEnd + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_WeakArmorSpeedAnim + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_EMPTY, BattleScript_WeakArmorActivatesEnd + pause B_WAIT_TIME_SHORTEST + printstring STRINGID_TARGETSTATWONTGOHIGHER + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED + waitmessage B_WAIT_TIME_LONG + goto BattleScript_WeakArmorActivatesEnd +BattleScript_WeakArmorSpeedAnim: + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printstring STRINGID_TARGETABILITYSTATRAISE + waitmessage B_WAIT_TIME_LONG +BattleScript_WeakArmorActivatesEnd: + return + +BattleScript_CursedBodyActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_CUSEDBODYDISABLED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MummyActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_ATTACKERACQUIREDABILITY + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_WanderingSpiritActivates:: +.if B_ABILITY_POP_UP == TRUE + setbyte sFIXED_ABILITY_POPUP, TRUE + sethword sABILITY_OVERWRITE, ABILITY_WANDERING_SPIRIT + showabilitypopup BS_TARGET + pause 60 + sethword sABILITY_OVERWRITE, 0 + updateabilitypopup BS_TARGET + pause 20 + destroyabilitypopup + pause 40 + copybyte gBattlerAbility, gBattlerAttacker + setbyte sFIXED_ABILITY_POPUP, TRUE + copyhword sABILITY_OVERWRITE, gLastUsedAbility + showabilitypopup BS_ATTACKER + pause 60 + sethword sABILITY_OVERWRITE, 0 + updateabilitypopup BS_ATTACKER + pause 20 + destroyabilitypopup + pause 40 +.endif + printstring STRINGID_SWAPPEDABILITIES + waitmessage B_WAIT_TIME_LONG + switchinabilities BS_ATTACKER + switchinabilities BS_TARGET + return + +BattleScript_TargetsStatWasMaxedOut:: + call BattleScript_AbilityPopUp + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printstring STRINGID_TARGETSSTATWASMAXEDOUT + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_GooeyActivates:: + waitstate + call BattleScript_AbilityPopUp + swapattackerwithtarget @ for defiant, mirror armor + seteffectsecondary MOVE_EFFECT_SPD_MINUS_1 + swapattackerwithtarget + return + +BattleScript_DampPreventsAftermath:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + pause 40 + copybyte gBattlerAbility, sBATTLER + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSABILITYPREVENTSABILITY + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_AftermathDmg:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_AftermathDmgRet + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printstring STRINGID_AFTERMATHDMG + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_ATTACKER +BattleScript_AftermathDmgRet: + return + +BattleScript_AbilityStatusEffect:: + waitstate + call BattleScript_AbilityPopUp + seteffectsecondary + return + +BattleScript_IllusionOff:: + spriteignore0hp TRUE + playanimation BS_TARGET, B_ANIM_MON_HIT @ TODO: Animation B_ANIM_ILLUSION_OFF + waitanimation + updatenick BS_TARGET + waitstate + spriteignore0hp FALSE + printstring STRINGID_ILLUSIONWOREOFF + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_CottonDownActivates:: + copybyte sSAVED_BATTLER, gBattlerAttacker + call BattleScript_AbilityPopUpTarget + copybyte gEffectBattler, gBattlerTarget + swapattackerwithtarget + setbyte gBattlerTarget, 0 +BattleScript_CottonDownLoop: + jumpiffainted BS_TARGET, TRUE, BattleScript_CottonDownLoopIncrement + setstatchanger STAT_SPEED, 1, TRUE + jumpifbyteequal gBattlerTarget, gEffectBattler, BattleScript_CottonDownLoopIncrement + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_CottonDownTargetSpeedCantGoLower + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_CottonDownLoopIncrement +BattleScript_CottonDownTargetSpeedCantGoLower: + printstring STRINGID_STATSWONTDECREASE + waitmessage B_WAIT_TIME_LONG +BattleScript_CottonDownLoopIncrement: + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_CottonDownLoop +BattleScript_CottonDownReturn: + swapattackerwithtarget + copybyte gBattlerAttacker, sSAVED_BATTLER + return + +BattleScript_BlockedByPrimalWeatherRet:: + call BattleScript_AbilityPopUp + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedRet + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainRet + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnRet + return + +BattleScript_SandSpitActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_ASANDSTORMKICKEDUP + waitstate + playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES + call BattleScript_ActivateWeatherAbilities + return + +BattleScript_PerishBodyActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSWILLPERISHIN3TURNS + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + return + +BattleScript_GulpMissileGulping:: + call BattleScript_AbilityPopUp + playanimation BS_ATTACKER, B_ANIM_MON_HIT @ TODO: Animation B_ANIM_GULP_MISSILE + waitanimation + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + effectivenesssound + hitanimation BS_ATTACKER + waitstate + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_GulpMissileNoDmgGulping + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + tryfaintmon BS_ATTACKER + jumpiffainted BS_ATTACKER, TRUE, BattleScript_GulpMissileNoSecondEffectGulping + jumpifholdeffect BS_ATTACKER, HOLD_EFFECT_CLEAR_AMULET, BattleScript_GulpMissileNoSecondEffectGulping + jumpifability BS_ATTACKER, ABILITY_CLEAR_BODY, BattleScript_GulpMissileNoSecondEffectGulping + jumpifability BS_ATTACKER, ABILITY_FULL_METAL_BODY, BattleScript_GulpMissileNoSecondEffectGulping + jumpifability BS_ATTACKER, ABILITY_WHITE_SMOKE, BattleScript_GulpMissileNoSecondEffectGulping + jumpifflowerveilattacker BattleScript_GulpMissileNoSecondEffectGulping +BattleScript_GulpMissileNoDmgGulping: + handleformchange BS_TARGET, 0 + playanimation BS_TARGET, B_ANIM_FORM_CHANGE + waitanimation + swapattackerwithtarget @ to make gStatDownStringIds down below print the right battler + setstatchanger STAT_DEF, 1, TRUE + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_GulpMissileGorgingTargetDefenseCantGoLower + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG + swapattackerwithtarget @ restore the battlers, just in case + return +BattleScript_GulpMissileNoSecondEffectGulping: + handleformchange BS_TARGET, 0 + playanimation BS_TARGET, B_ANIM_FORM_CHANGE + waitanimation + return +BattleScript_GulpMissileGorgingTargetDefenseCantGoLower: + printstring STRINGID_STATSWONTDECREASE + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_GulpMissileGorging:: + call BattleScript_AbilityPopUp + playanimation BS_ATTACKER, B_ANIM_MON_HIT @ TODO: Animation B_ANIM_GULP_MISSILE + waitanimation + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + effectivenesssound + hitanimation BS_ATTACKER + waitstate + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_GulpMissileNoDmgGorging + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + tryfaintmon BS_ATTACKER + jumpiffainted BS_ATTACKER, TRUE, BattleScript_GulpMissileNoSecondEffectGorging +BattleScript_GulpMissileNoDmgGorging: + handleformchange BS_TARGET, 0 + playanimation BS_TARGET, B_ANIM_FORM_CHANGE + waitanimation + swapattackerwithtarget + seteffectprimary MOVE_EFFECT_PARALYSIS + swapattackerwithtarget + return +BattleScript_GulpMissileNoSecondEffectGorging: + handleformchange BS_TARGET, 0 + playanimation BS_TARGET, B_ANIM_FORM_CHANGE + waitanimation + return + +BattleScript_SeedSowerActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_TERRAINBECOMESGRASSY + waitmessage B_WAIT_TIME_LONG + playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + call BattleScript_ActivateTerrainEffects + return + +BattleScript_AngerShellActivates:: + call BattleScript_AbilityPopUp + jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef + jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef + jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_AngerShellTryDef + jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_AngerShellTryDef + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_ButItFailed +BattleScript_AngerShellTryDef:: + setbyte sSTAT_ANIM_PLAYED, FALSE + modifybattlerstatstage BS_ATTACKER, STAT_DEF, DECREASE, 1, BattleScript_AngerShellTrySpDef, ANIM_ON +BattleScript_AngerShellTrySpDef: + modifybattlerstatstage BS_ATTACKER, STAT_SPDEF, DECREASE, 1, BattleScript_AngerShellTryAttack, ANIM_ON +BattleScript_AngerShellTryAttack: + setbyte sSTAT_ANIM_PLAYED, FALSE + modifybattlerstatstage BS_ATTACKER, STAT_ATK, INCREASE, 1, BattleScript_AngerShellTrySpAtk, ANIM_ON +BattleScript_AngerShellTrySpAtk: + modifybattlerstatstage BS_ATTACKER, STAT_SPATK, INCREASE, 1, BattleScript_AngerShellTrySpeed, ANIM_ON +BattleScript_AngerShellTrySpeed: + modifybattlerstatstage BS_ATTACKER, STAT_SPEED, INCREASE, 1, BattleScript_AngerShellRet, ANIM_ON +BattleScript_AngerShellRet: + return + +BattleScript_WindPowerActivates:: + call BattleScript_AbilityPopUp + setcharge BS_TARGET + printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER + waitmessage B_WAIT_TIME_LONG +BattleScript_WindPowerActivates_Ret: + return + +BattleScript_ToxicDebrisActivates:: + call BattleScript_AbilityPopUp + pause B_WAIT_TIME_SHORT + settoxicspikes BattleScript_ToxicDebrisRet + printstring STRINGID_POISONSPIKESSCATTERED + waitmessage B_WAIT_TIME_LONG +BattleScript_ToxicDebrisRet: + copybyte sBATTLER, gBattlerTarget + copybyte gBattlerTarget, gBattlerAttacker + copybyte gBattlerAttacker, sBATTLER + return + +BattleScript_AttackerFormChange:: + pause 5 + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + flushtextbox +BattleScript_AttackerFormChangeNoPopup:: + handleformchange BS_ATTACKER, 0 + handleformchange BS_ATTACKER, 1 + playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE + waitanimation + handleformchange BS_ATTACKER, 2 + return + +BattleScript_DancerActivates:: + call BattleScript_AbilityPopUp + waitmessage B_WAIT_TIME_SHORT + setbyte sB_ANIM_TURN, 0 + setbyte sB_ANIM_TARGETS_HIT, 0 + orword gHitMarker, HITMARKER_ALLOW_NO_PP + jumptocalledmove TRUE + +BattleScript_OpportunistCopyStatChange:: + call BattleScript_AbilityPopUp + printstring STRINGID_OPPORTUNISTCOPIED + waitmessage B_WAIT_TIME_LONG + call BattleScript_TotemVar_Ret + copybyte gBattlerAttacker, sSAVED_BATTLER @ restore the original attacker just to be safe + end3 + +BattleScript_BattlerGotOverItsInfatuation:: + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNGOTOVERITSINFATUATION + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_BattlerShookOffTaunt:: + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSHOOKOFFTHETAUNT + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_BattlerFormChangeWithStringEnd3:: + pause 5 + call BattleScript_AbilityPopUp + flushtextbox + handleformchange BS_SCRIPTING, 0 + handleformchange BS_SCRIPTING, 1 + playanimation BS_SCRIPTING, B_ANIM_FORM_CHANGE, NULL + waitanimation + handleformchange BS_SCRIPTING, 2 + printstring STRINGID_PKMNTRANSFORMED + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_ProtosynthesisActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_SUNLIGHTACTIVATEDABILITY + waitmessage B_WAIT_TIME_MED + printstring STRINGID_STATWASHEIGHTENED + waitmessage B_WAIT_TIME_MED + end3 + +BattleScript_MimicryActivates_End3:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_BATTLERTYPECHANGEDTO + waitmessage B_WAIT_TIME_SHORT + end3 + +BattleScript_TraceActivatesEnd3:: + call BattleScript_TraceActivates + end3 + +BattleScript_QuarkDriveActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_ELECTRICTERRAINACTIVATEDABILITY + waitmessage B_WAIT_TIME_MED + printstring STRINGID_STATWASHEIGHTENED + waitmessage B_WAIT_TIME_MED + end3 + +BattleScript_FriskMsgWithPopup:: + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp +BattleScript_FriskMsg:: + printstring STRINGID_FRISKACTIVATES + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_BerryStatRaiseRet:: + jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_BerryStatRaiseRet_AbilityPopup + goto BattleScript_BerryStatRaiseRet_Anim +BattleScript_BerryStatRaiseRet_AbilityPopup: + call BattleScript_AbilityPopUp +BattleScript_BerryStatRaiseRet_Anim: + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_BerryStatRaiseRet_End + setgraphicalstatchangevalues + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1 + setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM + call BattleScript_StatUp + removeitem BS_SCRIPTING +BattleScript_BerryStatRaiseRet_End: + return + +BattleScript_ActivateTerrainEffects: + savetarget + setbyte gBattlerTarget, 0 +BattleScript_ActivateTerrainSeed: + copybyte sBATTLER, gBattlerTarget + doterrainseed BS_TARGET, BattleScript_ActivateTerrainAbility + removeitem BS_TARGET +BattleScript_ActivateTerrainAbility: + activateterrainchangeabilities BS_TARGET +BattleScript_ActivateTerrainEffects_Increment: + addbyte gBattlerTarget, 0x1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_ActivateTerrainSeed + restoretarget + return + +BattleScript_AttackerAbilityStatRaise:: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AttackerAbilityStatRaise_End + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + printstring STRINGID_ATTACKERABILITYSTATRAISE + waitmessage B_WAIT_TIME_LONG +BattleScript_AttackerAbilityStatRaise_End: + return + +BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3: + pause B_WAIT_TIME_SHORT + printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_NoReliefFromHeavyRainEnd3: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NORELIEFROMHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_MysteriousAirCurrentBlowsOnEnd3: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_ActivateWeatherAbilities: + savetarget + setbyte gBattlerTarget, 0 +BattleScript_ActivateWeatherAbilities_Loop: + copybyte sBATTLER, gBattlerTarget + activateweatherchangeabilities BS_TARGET +BattleScript_ActivateWeatherAbilities_Increment: + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_ActivateWeatherAbilities_Loop + restoretarget + return + +BattleScript_SupersweetSyrupWontDecrease: + printstring STRINGID_STATSWONTDECREASE + goto BattleScript_SupersweetSyrupEffect_WaitString + +BattleScript_SupersweetSyrupContrary: + call BattleScript_AbilityPopUpTarget + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SupersweetSyrupContrary_WontIncrease + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + goto BattleScript_SupersweetSyrupEffect_WaitString +BattleScript_SupersweetSyrupContrary_WontIncrease: + printstring STRINGID_TARGETSTATWONTGOHIGHER + goto BattleScript_SupersweetSyrupEffect_WaitString + +BattleScript_TryIntimidateHoldEffects: + itemstatchangeeffects BS_TARGET + jumpifnoholdeffect BS_TARGET, HOLD_EFFECT_ADRENALINE_ORB, BattleScript_TryIntimidateHoldEffectsRet + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPEED, 12, BattleScript_TryIntimidateHoldEffectsRet + setstatchanger STAT_SPEED, 1, FALSE + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_TryIntimidateHoldEffectsRet + playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + copybyte sBATTLER, gBattlerTarget + setlastuseditem BS_TARGET + printstring STRINGID_USINGITEMSTATOFPKMNROSE + waitmessage B_WAIT_TIME_LONG + removeitem BS_TARGET +BattleScript_TryIntimidateHoldEffectsRet: + return + +BattleScript_ExtremelyHarshSunlightWasNotLessenedRet: + pause B_WAIT_TIME_SHORT + printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_NoReliefFromHeavyRainRet: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NORELIEFROMHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MysteriousAirCurrentBlowsOnRet: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_TotemVar_Ret:: + gettotemboost BattleScript_ApplyTotemVarBoost +BattleScript_TotemVarEnd: + return +BattleScript_ApplyTotemVarBoost: + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_TotemVarEnd + setgraphicalstatchangevalues + playanimation BS_SCRIPTING, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_TotemVar_Ret @loop until stats bitfield is empty + +BattleScript_TotemFlaredToLife:: + playanimation BS_ATTACKER, B_ANIM_MON_HIT, NULL @ TODO Animation B_ANIM_TOTEM_FLARE, NULL + printstring STRINGID_AURAFLAREDTOLIFE + waitmessage B_WAIT_TIME_LONG + call BattleScript_ApplyTotemVarBoost + end2 + +BattleScript_ItemHealHP_RemoveItemEnd2:: + jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_ItemHealHP_RemoveItemEnd2_AbilityPopUp + goto BattleScript_ItemHealHP_RemoveItemEnd2_Anim +BattleScript_ItemHealHP_RemoveItemEnd2_AbilityPopUp: + call BattleScript_AbilityPopUp +BattleScript_ItemHealHP_RemoveItemEnd2_Anim: + playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNSITEMRESTOREDHEALTH + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + removeitem BS_ATTACKER + end2 + +BattleScript_ItemHealHP_RemoveItemRet:: + jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_ItemHealHP_RemoveItemRet_AbilityPopUp + goto BattleScript_ItemHealHP_RemoveItemRet_Anim +BattleScript_ItemHealHP_RemoveItemRet_AbilityPopUp: + call BattleScript_AbilityPopUp +BattleScript_ItemHealHP_RemoveItemRet_Anim: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNSITEMRESTOREDHEALTH + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + removeitem BS_SCRIPTING + return + +BattleScript_MicleBerryActivateEnd2:: + jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_MicleBerryActivateEnd2_Ripen + goto BattleScript_MicleBerryActivateEnd2_Anim +BattleScript_MicleBerryActivateEnd2_Ripen: + call BattleScript_AbilityPopUp +BattleScript_MicleBerryActivateEnd2_Anim: + playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_MICLEBERRYACTIVATES + waitmessage B_WAIT_TIME_LONG + removeitem BS_ATTACKER + end2 + +BattleScript_MicleBerryActivateRet:: + jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_MicleBerryActivateRet_Ripen + goto BattleScript_MicleBerryActivateRet_Anim +BattleScript_MicleBerryActivateRet_Ripen: + call BattleScript_AbilityPopUp +BattleScript_MicleBerryActivateRet_Anim: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_MICLEBERRYACTIVATES + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + return + +BattleScript_BerryPPHealRet:: + jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_BerryPPHeal_AbilityPopup + goto BattleScript_BerryPPHeal_Anim +BattleScript_BerryPPHeal_AbilityPopup: + call BattleScript_AbilityPopUp +BattleScript_BerryPPHeal_Anim: + playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNSITEMRESTOREDPP + waitmessage B_WAIT_TIME_LONG + removeitem BS_ATTACKER + return + +BattleScript_BerryConfuseHealRet:: + jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_BerryConfuseHealRet_AbilityPopup + goto BattleScript_BerryConfuseHealRet_Anim +BattleScript_BerryConfuseHealRet_AbilityPopup: + call BattleScript_AbilityPopUp +BattleScript_BerryConfuseHealRet_Anim: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNSITEMRESTOREDHEALTH + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + printstring STRINGID_FORXCOMMAYZ + waitmessage B_WAIT_TIME_LONG + seteffectprimary MOVE_EFFECT_CONFUSION | MOVE_EFFECT_CERTAIN + removeitem BS_TARGET + return + +@ remove the mirror herb, do totem loop +BattleScript_MirrorHerbCopyStatChangeEnd2:: + call BattleScript_MirrorHerbCopyStatChange + end2 + +BattleScript_MirrorHerbCopyStatChange:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL + printstring STRINGID_MIRRORHERBCOPIED + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + call BattleScript_TotemVar_Ret + copybyte gBattlerAttacker, sSAVED_BATTLER @ restore the original attacker just to be safe + return + +BattleScript_BerryCureFrbRet:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNSITEMHEALEDFROSTBITE + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_SCRIPTING + removeitem BS_SCRIPTING + return + +BattleScript_MentalHerbCureRet:: + playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT + printfromtable gMentalHerbCureStringIds + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_SCRIPTING + removeitem BS_SCRIPTING + copybyte gBattlerAttacker, sSAVED_BATTLER @ restore the original attacker just to be safe + return + +BattleScript_BerryFocusEnergyRet:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNUSEDXTOGETPUMPED + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + return + +BattleScript_BerserkGeneRet:: +BattleScript_BerserkGeneRet_Anim: + savetarget + copybyte gBattlerTarget, sBATTLER + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_BerserkGeneRet_TryConfuse + setgraphicalstatchangevalues + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1 + setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM + call BattleScript_StatUp +BattleScript_BerserkGeneRet_TryConfuse: + jumpifability BS_SCRIPTING, ABILITY_OWN_TEMPO, BattleScript_BerserkGeneRet_OwnTempoPrevents + jumpifsafeguard BattleScript_BerserkGeneRet_SafeguardProtected + seteffectprimary MOVE_EFFECT_CONFUSION + goto BattleScript_BerserkGeneRet_End +BattleScript_BerserkGeneRet_SafeguardProtected:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_PKMNUSEDSAFEGUARD + waitmessage B_WAIT_TIME_LONG + goto BattleScript_BerserkGeneRet_End +BattleScript_BerserkGeneRet_OwnTempoPrevents: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNPREVENTSCONFUSIONWITH + waitmessage B_WAIT_TIME_LONG +BattleScript_BerserkGeneRet_End: + restoretarget + removeitem BS_SCRIPTING + end3 + +BattleScript_BerryCureFrbEnd2:: + call BattleScript_BerryCureFrzRet + end2 + +BattleScript_AirBaloonMsgIn:: + printstring STRINGID_AIRBALLOONFLOAT + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_EjectButtonActivates:: + makevisible BS_ATTACKER + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_EJECTBUTTONACTIVATE + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + makeinvisible BS_SCRIPTING + openpartyscreen BS_SCRIPTING, BattleScript_EjectButtonEnd + switchoutabilities BS_SCRIPTING + waitstate + switchhandleorder BS_SCRIPTING 0x2 + returntoball BS_SCRIPTING, FALSE + getswitchedmondata BS_SCRIPTING + switchindataupdate BS_SCRIPTING + hpthresholds BS_SCRIPTING + trytoclearprimalweather + flushtextbox + printstring 0x3 + switchinanim BS_SCRIPTING 0x1 + waitstate + switchineffects BS_SCRIPTING +BattleScript_EjectButtonEnd: + return + +BattleScript_EjectPackActivate_Ret:: + goto BattleScript_EjectButtonActivates + +BattleScript_EjectPackActivate_End2:: + call BattleScript_EjectPackActivate_Ret + end2 + +BattleScript_ItemHurtEnd2:: + playanimation BS_ATTACKER, B_ANIM_MON_HIT + waitanimation + call BattleScript_ItemHurtRet + end2 + +BattleScript_MentalHerbCureEnd2:: + call BattleScript_MentalHerbCureRet + end2 + +BattleScript_AttackerItemStatRaise:: + copybyte sBATTLER, gBattlerAttacker + statbuffchange MOVE_EFFECT_AFFECTS_USER, BattleScript_AttackerItemStatRaiseRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AttackerItemStatRaiseRet + playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT + waitanimation + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + printstring STRINGID_USINGITEMSTATOFPKMNROSE + waitmessage B_WAIT_TIME_LONG + removeitem BS_ATTACKER +BattleScript_AttackerItemStatRaiseRet: + return + +BattleScript_ItemHurtRet:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printstring STRINGID_HURTBYITEM + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_ATTACKER + return + +BattleScript_AirBaloonMsgPop:: + printstring STRINGID_AIRBALLOONPOP + waitmessage B_WAIT_TIME_LONG + removeitem BS_TARGET + return + +BattleScript_RockyHelmetActivates:: + @ don't play the animation for a fainted mon + jumpifabsent BS_TARGET, BattleScript_RockyHelmetActivatesDmg + playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT + waitanimation +BattleScript_RockyHelmetActivatesDmg: + call BattleScript_HurtAttacker + return + +BattleScript_TargetItemStatRaise:: + copybyte sBATTLER, gBattlerTarget + statbuffchange 0, BattleScript_TargetItemStatRaiseRemoveItemRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_TargetItemStatRaiseRemoveItemRet + playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT + waitanimation + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + printstring STRINGID_USINGITEMSTATOFPKMNROSE + waitmessage B_WAIT_TIME_LONG + removeitem BS_TARGET +BattleScript_TargetItemStatRaiseRemoveItemRet: + return + +BattleScript_JabocaRowapBerryActivates:: + jumpifability BS_TARGET, ABILITY_RIPEN, BattleScript_JabocaRowapBerryActivate_Ripen + goto BattleScript_JabocaRowapBerryActivate_Anim +BattleScript_JabocaRowapBerryActivate_Ripen: + call BattleScript_AbilityPopUp +BattleScript_JabocaRowapBerryActivate_Anim: + jumpifabsent BS_TARGET, BattleScript_JabocaRowapBerryActivate_Dmg @ dont play the animation for a fainted target + playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT + waitanimation +BattleScript_JabocaRowapBerryActivate_Dmg: + call BattleScript_HurtAttacker + removeitem BS_TARGET + return + +BattleScript_StickyBarbTransfer:: + playanimation BS_TARGET, B_ANIM_ITEM_STEAL + printstring STRINGID_STICKYBARBTRANSFER + waitmessage B_WAIT_TIME_LONG + removeitem BS_TARGET + return + +BattleScript_ToxicOrb:: + setbyte cMULTISTRING_CHOOSER, 0 + copybyte gEffectBattler, gBattlerAttacker + call BattleScript_MoveEffectToxic + end2 + +BattleScript_FlameOrb:: + setbyte cMULTISTRING_CHOOSER, 0 + copybyte gEffectBattler, gBattlerAttacker + call BattleScript_MoveEffectBurn + end2 + +BattleScript_WeaknessPolicy:: + copybyte sBATTLER, gBattlerTarget + jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_WeaknessPolicyAtk + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPATK, MAX_STAT_STAGE, BattleScript_WeaknessPolicyEnd +BattleScript_WeaknessPolicyAtk: + playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, STAT_CHANGE_BY_TWO + setstatchanger STAT_ATK, 2, FALSE + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_WeaknessPolicySpAtk + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_WeaknessPolicySpAtk + printstring STRINGID_USINGITEMSTATOFPKMNROSE + waitmessage B_WAIT_TIME_LONG +BattleScript_WeaknessPolicySpAtk: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_WeaknessPolicyRemoveItem + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_WeaknessPolicyRemoveItem + printstring STRINGID_USINGITEMSTATOFPKMNROSE + waitmessage B_WAIT_TIME_LONG +BattleScript_WeaknessPolicyRemoveItem: + removeitem BS_TARGET +BattleScript_WeaknessPolicyEnd: + return + +BattleScript_HurtAttacker: + 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 + return + +BattleScript_KingsShieldEffect:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + seteffectsecondary + copybyte sBATTLER, gBattlerTarget + copybyte gBattlerTarget, gBattlerAttacker + copybyte gBattlerAttacker, sBATTLER + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + return + +BattleScript_BanefulBunkerEffect:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_PASSIVE_DAMAGE + bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + seteffectsecondary + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + return + +BattleScript_BeakBlastBurn:: + setbyte cMULTISTRING_CHOOSER, 0 + copybyte gEffectBattler, gBattlerAttacker + call BattleScript_MoveEffectBurn + return + +BattleScript_FrostbiteHealedViaFireMove:: + printstring STRINGID_PKMNFROSTBITEHEALED + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_TARGET + return + +BattleScript_MoveEffectStockpileWoreOff:: + .if B_STOCKPILE_RAISES_DEFS >= GEN_4 + dostockpilestatchangeswearoff BS_ATTACKER, BattleScript_StockpileStatChangeDown + printstring STRINGID_STOCKPILEDEFFECTWOREOFF + waitmessage B_WAIT_TIME_SHORT + .endif + return + +BattleScript_StockpileStatChangeDown: + statbuffchange MOVE_EFFECT_AFFECTS_USER, BattleScript_StockpileStatChangeDown_Ret + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_StockpileStatChangeDown_Ret: + return + +BattleScript_SpikyShieldEffect:: + jumpifabsent BS_ATTACKER, BattleScript_SpikyShieldRet + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printstring STRINGID_PKMNHURTSWITH + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_ATTACKER + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED +BattleScript_SpikyShieldRet:: + return + +BattleScript_MoveEffectSmackDown:: + printstring STRINGID_FELLSTRAIGHTDOWN + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_TargetWokeUp:: + printstring STRINGID_TARGETWOKEUP + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_TARGET + return + +BattleScript_TargetBurnHeal:: + printstring STRINGID_PKMNBURNHEALED + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_TARGET + return + +BattleScript_DefDownSpeedUp:: + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_DefDownSpeedUpTryDef + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MAX_STAT_STAGE, BattleScript_DefDownSpeedUpRet +BattleScript_DefDownSpeedUpTryDef:: + playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_CANT_PREVENT + setstatchanger STAT_DEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpTrySpeed + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpTrySpeed: + playstatchangeanimation BS_ATTACKER, BIT_SPEED, 0 + setstatchanger STAT_SPEED, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpRet + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpRet:: + return + +BattleScript_MagicianActivates:: + call BattleScript_AbilityPopUp + call BattleScript_ItemSteal + return + +BattleScript_EjectPackActivates:: + jumpifcantswitch BS_SCRIPTING, BattleScript_EjectButtonEnd + goto BattleScript_EjectPackActivate_Ret + +BattleScript_RedCardActivates:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_REDCARDACTIVATE + waitmessage B_WAIT_TIME_LONG + swapattackerwithtarget + jumpifstatus3 BS_EFFECT_BATTLER, STATUS3_ROOTED, BattleScript_RedCardIngrain + jumpifability BS_EFFECT_BATTLER, ABILITY_SUCTION_CUPS, BattleScript_RedCardSuctionCups + @ jumpiftargetdynamaxed BattleScript_RedCardDynamaxed @ TODO: Dynamax + removeitem BS_SCRIPTING + setbyte sSWITCH_CASE, B_SWITCH_RED_CARD + forcerandomswitch BattleScript_RedCardEnd + @ changes the current battle script. the rest happens in BattleScript_RoarSuccessSwitch_Ret, if switch is successful +BattleScript_RedCardEnd: + return +BattleScript_RedCardIngrain: + printstring STRINGID_PKMNANCHOREDITSELF + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + swapattackerwithtarget + return +BattleScript_RedCardSuctionCups: + printstring STRINGID_PKMNANCHORSITSELFWITH + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + swapattackerwithtarget + return +BattleScript_RedCardDynamaxed: + printstring STRINGID_MOVEBLOCKEDBYDYNAMAX + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + swapattackerwithtarget + return + +BattleScript_Pickpocket:: + call BattleScript_AbilityPopUp + jumpifability BS_ATTACKER, ABILITY_STICKY_HOLD, BattleScript_PickpocketPrevented + swapattackerwithtarget + call BattleScript_ItemSteal + swapattackerwithtarget + activateitemeffects BS_TARGET + return + +BattleScript_PickpocketPrevented: + pause B_WAIT_TIME_SHORT + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + printstring STRINGID_ITEMCANNOTBEREMOVED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_EmergencyExit:: + pause 5 + call BattleScript_AbilityPopUp + pause B_WAIT_TIME_LONG +BattleScript_EmergencyExitNoPopUp:: + playanimation BS_TARGET, B_ANIM_SLIDE_OFFSCREEN + waitanimation + openpartyscreen BS_TARGET, BattleScript_EmergencyExitRet + switchoutabilities BS_TARGET + waitstate + switchhandleorder BS_TARGET, 2 + returntoball BS_TARGET, FALSE + getswitchedmondata BS_TARGET + switchindataupdate BS_TARGET + hpthresholds BS_TARGET + printstring STRINGID_SWITCHINMON + switchinanim BS_TARGET, TRUE + waitstate + switchineffects BS_TARGET +BattleScript_EmergencyExitRet: + return + +BattleScript_EmergencyExitWild:: + pause 5 + call BattleScript_AbilityPopUp + pause B_WAIT_TIME_LONG +BattleScript_EmergencyExitWildNoPopUp:: + playanimation BS_TARGET, B_ANIM_SLIDE_OFFSCREEN + waitanimation + setoutcomeonteleport BS_TARGET + finishaction + return + +BattleScript_PrimalReversion:: + call BattleScript_PrimalReversionRet + end2 + +BattleScript_PrimalReversionRestoreAttacker:: + call BattleScript_PrimalReversionRet + copybyte gBattlerAttacker, sSAVED_BATTLER + end2 + +BattleScript_PrimalReversionRet:: + flushtextbox + setbyte gIsCriticalHit, 0 + handleprimalreversion BS_ATTACKER, 0 + handleprimalreversion BS_ATTACKER, 1 + playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE @ TODO: Animation B_ANIM_PRIMAL_REVERSION + waitanimation + handleprimalreversion BS_ATTACKER, 2 + printstring STRINGID_PKMNREVERTEDTOPRIMAL + waitmessage B_WAIT_TIME_LONG + switchinabilities BS_ATTACKER + return + +BattleScript_DmgHazardsOnTarget:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + call BattleScript_PrintHurtByDmgHazards + tryfaintmon BS_TARGET + tryfaintmon_spikes BS_TARGET, BattleScript_DmgHazardsOnTargetFainted + return + +BattleScript_DmgHazardsOnTargetFainted:: + setbyte sGIVEEXP_STATE, 0 + getexp BS_TARGET + moveendall + goto BattleScript_HandleFaintedMon + +BattleScript_DmgHazardsOnAttacker:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + call BattleScript_PrintHurtByDmgHazards + tryfaintmon BS_ATTACKER + tryfaintmon_spikes BS_ATTACKER, BattleScript_DmgHazardsOnAttackerFainted + return + +BattleScript_DmgHazardsOnAttackerFainted:: + setbyte sGIVEEXP_STATE, 0 + getexp BS_ATTACKER + moveendall + goto BattleScript_HandleFaintedMon + +BattleScript_HealingWishActivates:: + setbyte cMULTISTRING_CHOOSER, 0 + goto BattleScript_EffectHealingWishRestore +BattleScript_LunarDanceActivates:: + setbyte cMULTISTRING_CHOOSER, 1 + restorepp BS_ATTACKER +BattleScript_EffectHealingWishRestore: + printfromtable gHealingWishStringIds + waitmessage B_WAIT_TIME_LONG + playanimation BS_ATTACKER, B_ANIM_WISH_HEAL + waitanimation + dmgtomaxattackerhp + manipulatedamage DMG_CHANGE_SIGN + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + clearstatus BS_ATTACKER + waitstate + updatestatusicon BS_ATTACKER + waitstate + printstring STRINGID_HEALINGWISHHEALED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_DmgHazardsOnFaintedBattler:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_FAINTED + datahpupdate BS_FAINTED + call BattleScript_PrintHurtByDmgHazards + tryfaintmon BS_FAINTED + tryfaintmon_spikes BS_FAINTED, BattleScript_DmgHazardsOnFaintedBattlerFainted + return + +BattleScript_DmgHazardsOnFaintedBattlerFainted:: + setbyte sGIVEEXP_STATE, 0 + getexp BS_FAINTED + moveendall + goto BattleScript_HandleFaintedMon + +BattleScript_ToxicSpikesAbsorbed:: + printstring STRINGID_TOXICSPIKESABSORBED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_ToxicSpikesPoisoned:: + printstring STRINGID_TOXICSPIKESPOISONED + waitmessage B_WAIT_TIME_LONG + statusanimation BS_SCRIPTING + updatestatusicon BS_SCRIPTING + waitstate + return + +BattleScript_StickyWebOnSwitchIn:: + savetarget + copybyte gBattlerTarget, sBATTLER + setbyte sSTICKY_WEB_STAT_DROP, 1 + printstring STRINGID_STICKYWEBSWITCHIN + waitmessage B_WAIT_TIME_LONG + jumpifability BS_TARGET, ABILITY_MIRROR_ARMOR, BattleScript_MirrorArmorReflectStickyWeb + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_StickyWebOnSwitchInEnd + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StickyWebOnSwitchInStatAnim + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StickyWebOnSwitchInEnd + pause B_WAIT_TIME_SHORT + goto BattleScript_StickyWebOnSwitchInPrintStatMsg +BattleScript_StickyWebOnSwitchInStatAnim: + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 +BattleScript_StickyWebOnSwitchInPrintStatMsg: + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_StickyWebOnSwitchInEnd: + restoretarget + return + +BattleScript_HealReplacementZMove:: + playanimation BS_SCRIPTING B_ANIM_WISH_HEAL 0x0 + printfromtable gZEffectStringIds + waitmessage B_WAIT_TIME_LONG + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + return + +BattleScript_PrintHurtByDmgHazards:: + printfromtable gDmgHazardsStringIds + waitmessage B_WAIT_TIME_LONG + return + +@ gBattlerTarget is battler with Mirror Armor +BattleScript_MirrorArmorReflectStickyWeb: + call BattleScript_AbilityPopUp + setattackertostickywebuser + jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_StickyWebOnSwitchInEnd @ Sticky web user not on field -> no stat loss + goto BattleScript_MirrorArmorReflectStatLoss + +BattleScript_MirrorArmorReflect:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss +BattleScript_MirrorArmorReflectStatLoss: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim + goto BattleScript_MirrorArmorReflectWontFall +BattleScript_MirrorArmorReflectAnim: + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 +BattleScript_MirrorArmorReflectPrintString: + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_MirrorArmorReflectEnd: + return + +BattleScript_MirrorArmorReflectWontFall: + copybyte gBattlerTarget, gBattlerAttacker @ STRINGID_STATSWONTDECREASE uses target + goto BattleScript_MirrorArmorReflectPrintString + +BattleScript_EffectStealthRock:: + attackcanceler + attackstring + ppreduce + setstealthrock BattleScript_ButItFailed + attackanimation + waitanimation + printstring STRINGID_POINTEDSTONESFLOAT + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_AbilityHpHeal: + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSXRESTOREDHPALITTLE2 + waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + return + +BattleScript_CheekPouchActivates:: + copybyte sSAVED_BATTLER, gBattlerAttacker + copybyte gBattlerAttacker, gBattlerAbility + call BattleScript_AbilityHpHeal + copybyte gBattlerAttacker, sSAVED_BATTLER + return + +BattleScript_SideStatusWoreOffReturn:: + printstring STRINGID_PKMNSXWOREOFF + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SpikesDefog:: + printstring STRINGID_SPIKESDISAPPEAREDFROMTEAM + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_ToxicSpikesDefog:: + printstring STRINGID_TOXICSPIKESDISAPPEAREDFROMTEAM + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_StickyWebDefog:: + printstring STRINGID_STICKYWEBDISAPPEAREDFROMTEAM + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_StealthRockDefog:: + printstring STRINGID_STEALTHROCKDISAPPEAREDFROMTEAM + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SteelsurgeDefog:: + printstring STRINGID_SHARPSTEELDISAPPEAREDFROMTEAM + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_TerrainEnds_Ret:: + printfromtable gTerrainStringIds + waitmessage B_WAIT_TIME_LONG + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG + return + +BattleScript_RaiseStatOnFaintingTarget:: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_RaiseStatOnFaintingTarget_End + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + printstring STRINGID_LASTABILITYRAISEDSTAT + waitmessage B_WAIT_TIME_LONG +BattleScript_RaiseStatOnFaintingTarget_End: + return + +BattleScript_ReceiverActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_RECEIVERABILITYTAKEOVER + waitmessage B_WAIT_TIME_LONG + settracedability BS_ABILITY_BATTLER + return + +BattleScript_FellStingerRaisesStat:: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_FellStingerRaisesAtkEnd + jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_ROSE, BattleScript_FellStingerRaisesAtkEnd + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_FellStingerRaisesAtkEnd: + return + +BattleScript_NeutralizingGasExits:: + savetarget + pause B_WAIT_TIME_SHORT + printstring STRINGID_NEUTRALIZINGGASOVER + waitmessage B_WAIT_TIME_LONG + setbyte gBattlerTarget, 0 +BattleScript_NeutralizingGasExitsLoop: + switchinabilities BS_TARGET + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_NeutralizingGasExitsLoop + restoretarget + return + +BattleScript_BattleBondActivatesOnMoveEndAttacker:: + pause 5 + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + printstring STRINGID_ATTACKERBECAMEFULLYCHARGED + handleformchange BS_ATTACKER, 0 + handleformchange BS_ATTACKER, 1 + playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE + waitanimation + handleformchange BS_ATTACKER, 2 + printstring STRINGID_ATTACKERBECAMEASHSPECIES + return + +BattleScript_ScriptingAbilityStatRaise:: + copybyte gBattlerAbility, sBATTLER + call BattleScript_AbilityPopUp + copybyte sSAVED_DMG, gBattlerAttacker + copybyte gBattlerAttacker, sBATTLER + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL + setgraphicalstatchangevalues + playanimation BS_SCRIPTING, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + waitanimation + printstring STRINGID_ATTACKERABILITYSTATRAISE + waitmessage B_WAIT_TIME_LONG + copybyte gBattlerAttacker, sSAVED_DMG + return + +BattleScript_ElectricTerrainPrevents:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_ELECTRICTERRAINPREVENTS + waitmessage B_WAIT_TIME_LONG + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_MistyTerrainPrevents:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MISTYTERRAINPREVENTS + waitmessage B_WAIT_TIME_LONG + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_InsomniaProtects: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSTAYEDAWAKEUSING + waitmessage B_WAIT_TIME_LONG + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_AbilityProtectsDoesntAffectRet:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_ITDOESNTAFFECT + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_AbilityProtectsDoesntAffect: + call BattleScript_AbilityProtectsDoesntAffectRet + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_FlowerVeilProtectsRet:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_FLOWERVEILPROTECTED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_FlowerVeilProtects: + call BattleScript_FlowerVeilProtectsRet + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_SweetVeilProtectsRet:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_FLOWERVEILPROTECTED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_SweetVeilProtects: + call BattleScript_SweetVeilProtectsRet + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_LeafGuardPreventsRest:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_BUTITFAILED + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectHit_Ret:: + attackcanceler +BattleScript_EffectHit_RetFromAccCheck:: + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce +BattleScript_EffectHit_RetFromCritCalc:: + critcalc + damagecalc + adjustdamage +BattleScript_Hit_RetFromAtkAnimation:: + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + setadditionaleffects + return + +BattleScript_ItemNoStatLoss:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_CLEARAMULETWONTLOWERSTATS + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_RoarSuccessSwitch:: + call BattleScript_RoarSuccessRet + getswitchedmondata BS_TARGET + switchindataupdate BS_TARGET + trytoclearprimalweather + flushtextbox + switchinanim BS_TARGET, FALSE + waitstate + printstring STRINGID_PKMNWASDRAGGEDOUT + switchineffects BS_TARGET + jumpifbyte CMP_EQUAL, sSWITCH_CASE, B_SWITCH_RED_CARD, BattleScript_RoarSuccessSwitch_Ret + setbyte sSWITCH_CASE, B_SWITCH_NORMAL + goto BattleScript_MoveEnd +BattleScript_RoarSuccessSwitch_Ret: + swapattackerwithtarget @ continuation of RedCardActivates + restoretarget + setbyte sSWITCH_CASE, B_SWITCH_NORMAL + return + +BattleScript_RoarSuccessEndBattle:: + call BattleScript_RoarSuccessRet + setbyte sSWITCH_CASE, B_SWITCH_NORMAL + setoutcomeonteleport BS_ATTACKER + finishaction + +BattleScript_RoarSuccessRet: + jumpifbyte CMP_EQUAL, sSWITCH_CASE, B_SWITCH_HIT, BattleScript_RoarSuccessRet_Ret + jumpifbyte CMP_EQUAL, sSWITCH_CASE, B_SWITCH_RED_CARD, BattleScript_RoarSuccessRet_Ret + attackanimation + waitanimation +BattleScript_RoarSuccessRet_Ret: + switchoutabilities BS_TARGET + returntoball BS_TARGET, FALSE + waitstate + return + +BattleScript_NotAffectedAbilityPopUp:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUpTarget + orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE + resultmessage + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectRollout:: + attackcanceler + attackstring + jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_RolloutCheckAccuracy + ppreduce +BattleScript_RolloutCheckAccuracy:: + accuracycheck BattleScript_RolloutHit, ACC_CURR_MOVE +BattleScript_RolloutHit:: + typecalc + handlerollout + goto BattleScript_HitFromCritCalc + +BattleScript_CheckPrimalWeather: + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn + return + +BattleScript_MoveWeatherChangeRet:: + printfromtable gMoveWeatherChangeStringIds + waitmessage B_WAIT_TIME_LONG + call BattleScript_ActivateWeatherAbilities + return + +BattleScript_NoReliefFromHeavyRain: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NORELIEFROMHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_MysteriousAirCurrentBlowsOn: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_ExtremelyHarshSunlightWasNotLessened: + pause B_WAIT_TIME_SHORT + printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index 8cf53e44a..f26501a38 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -71,56 +71,51 @@ BattleScript_UseItemMessage: waitmessage B_WAIT_TIME_LONG moveendcase 15 return + +BattleScript_ItemRestoreHPRet: + bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + printstring STRINGID_ITEMRESTOREDSPECIESHEALTH + waitmessage B_WAIT_TIME_LONG + return BattleScript_ItemRestoreHP:: - call BattleScript_UseItemMessage - itemrestorehp - bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE - healthbarupdate BS_SCRIPTING - datahpupdate BS_SCRIPTING - printstring STRINGID_ITEMRESTOREDSPECIESHEALTH - waitmessage B_WAIT_TIME_LONG - moveendcase 15 - end + call BattleScript_UseItemMessage + itemrestorehp BattleScript_ItemRestoreHPEnd + call BattleScript_ItemRestoreHPRet +BattleScript_ItemRestoreHPEnd: + end BattleScript_ItemRestoreHP_Party:: - jumpifbyte CMP_EQUAL, gBattleCommunication, TRUE, BattleScript_ItemRestoreHP_SendOutRevivedBattler - bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT - printstring STRINGID_ITEMRESTOREDSPECIESHEALTH - waitmessage B_WAIT_TIME_LONG - end + jumpifbyte CMP_EQUAL, gBattleCommunication, TRUE, BattleScript_ItemRestoreHP_SendOutRevivedBattler + bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT + printstring STRINGID_ITEMRESTOREDSPECIESHEALTH + waitmessage B_WAIT_TIME_LONG + end BattleScript_ItemRestoreHP_SendOutRevivedBattler: - switchinanim BS_SCRIPTING, FALSE - waitstate - switchineffects BS_SCRIPTING - end + switchinanim BS_SCRIPTING, FALSE + waitstate + switchineffects BS_SCRIPTING + end BattleScript_ItemCureStatus:: - call BattleScript_UseItemMessage - itemcurestatus - updatestatusicon BS_SCRIPTING - printstring STRINGID_ITEMCUREDSPECIESSTATUS - waitmessage B_WAIT_TIME_LONG - moveendcase 15 - end + call BattleScript_UseItemMessage +BattleScript_ItemCureStatusAfterItemMsg: + itemcurestatus BattleScript_ItemCureStatusEnd + updatestatusicon BS_SCRIPTING + printstring STRINGID_ITEMCUREDSPECIESSTATUS + waitmessage B_WAIT_TIME_LONG +BattleScript_ItemCureStatusEnd: + end BattleScript_ItemHealAndCureStatus:: - call BattleScript_UseItemMessage - itemrestorehp - itemcurestatus - printstring STRINGID_ITEMRESTOREDSPECIESHEALTH - waitmessage B_WAIT_TIME_LONG - bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE - healthbarupdate BS_SCRIPTING - datahpupdate BS_SCRIPTING - updatestatusicon BS_SCRIPTING - printstring STRINGID_ITEMRESTOREDSPECIESHEALTH - waitmessage B_WAIT_TIME_LONG - moveendcase 15 - end + call BattleScript_UseItemMessage + itemrestorehp BattleScript_ItemCureStatusAfterItemMsg + call BattleScript_ItemRestoreHPRet + goto BattleScript_ItemCureStatusAfterItemMsg BattleScript_ItemIncreaseStat:: call BattleScript_UseItemMessage diff --git a/data/maps/ViridianCity_Mart/scripts.inc b/data/maps/ViridianCity_Mart/scripts.inc index 1d8260f1a..5c2432f76 100644 --- a/data/maps/ViridianCity_Mart/scripts.inc +++ b/data/maps/ViridianCity_Mart/scripts.inc @@ -95,6 +95,9 @@ ViridianCity_Mart_Items:: .2byte ITEM_PROTEIN .2byte ITEM_ABILITY_CAPSULE .2byte ITEM_ABILITY_PATCH + .2byte ITEM_STICKY_BARB + .2byte ITEM_ORAN_BERRY + .2byte ITEM_BEAST_BALL .2byte ITEM_NONE release end diff --git a/include/battle.h b/include/battle.h index 8d11f91b5..ca7ef3f70 100644 --- a/include/battle.h +++ b/include/battle.h @@ -4,6 +4,7 @@ #include #include "global.h" #include "constants/battle.h" +#include "constants/form_change_types.h" #include "constants/battle_script_commands.h" #include "battle_util.h" #include "battle_script_commands.h" @@ -48,6 +49,25 @@ #define B_ACTION_NOTHING_FAINTED 13 // when choosing an action #define B_ACTION_NONE 0xFF + +// Special indicator value for shellBellDmg in SpecialStatus +#define IGNORE_SHELL_BELL 0xFFFF + + +// For defining EFFECT_HIT etc. with battle TV scores and flags etc. +struct __attribute__((packed, aligned(2))) BattleMoveEffect +{ + const u8 *battleScript; + u16 encourageEncore:1; + u16 twoTurnEffect:1; + u16 semiInvulnerableEffect:1; + u16 usesProtectCounter:1; + u16 padding:12; +}; + +#define GET_MOVE_BATTLESCRIPT(move) gBattleMoveEffects[gMovesInfo[move].effect].battleScript + + #define MAX_TRAINER_ITEMS 4 enum { @@ -56,18 +76,6 @@ enum { BATTLER_AFFINE_RETURN, }; -#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) - -// For the second argument of GetMoveTarget, when no target override is needed -#define NO_TARGET_OVERRIDE 0 - struct TrainerMonNoItemDefaultMoves { u16 iv; @@ -131,106 +139,181 @@ extern const struct Trainer gTrainers[]; struct ResourceFlags { - u32 flags[4]; + u32 flags[MAX_BATTLERS_COUNT]; }; -#define RESOURCE_FLAG_FLASH_FIRE 1 +#define RESOURCE_FLAG_FLASH_FIRE 0x1 +#define RESOURCE_FLAG_ROOST 0x2 +#define RESOURCE_FLAG_UNBURDEN 0x4 +#define RESOURCE_FLAG_UNUSED 0x8 +#define RESOURCE_FLAG_TRACED 0x10 +#define RESOURCE_FLAG_EMERGENCY_EXIT 0x20 +#define RESOURCE_FLAG_NEUTRALIZING_GAS 0x40 +#define RESOURCE_FLAG_ICE_FACE 0x80 struct DisableStruct { - /*0x00*/ u32 transformedMonPersonality; - /*0x04*/ u16 disabledMove; - /*0x06*/ u16 encoredMove; - /*0x08*/ u8 protectUses; - /*0x09*/ u8 stockpileCounter; - /*0x0A*/ u8 substituteHP; - /*0x0B*/ u8 disableTimer : 4; - /*0x0B*/ u8 disableTimerStartValue : 4; - /*0x0C*/ u8 encoredMovePos; - /*0x0D*/ u8 unkD; - /*0x0E*/ u8 encoreTimer : 4; - /*0x0E*/ u8 encoreTimerStartValue : 4; - /*0x0F*/ u8 perishSongTimer : 4; - /*0x0F*/ u8 perishSongTimerStartValue : 4; - /*0x10*/ u8 furyCutterCounter; - /*0x11*/ u8 rolloutTimer : 4; - /*0x11*/ u8 rolloutTimerStartValue : 4; - /*0x12*/ u8 chargeTimer : 4; - /*0x12*/ u8 chargeTimerStartValue : 4; - /*0x13*/ u8 tauntTimer:4; - /*0x13*/ u8 tauntTimer2:4; - /*0x14*/ u8 battlerPreventingEscape; - /*0x15*/ u8 battlerWithSureHit; - /*0x16*/ u8 isFirstTurn; - /*0x17*/ u8 unk17; - /*0x18*/ u8 truantCounter : 1; - /*0x18*/ u8 truantSwitchInHack : 1; // Unused here, but used in pokeemerald - /*0x18*/ u8 unk18_a_2 : 2; - /*0x18*/ u8 mimickedMoves : 4; - /*0x19*/ u8 rechargeTimer; - /*0x1A*/ u8 unk1A[1]; + u32 transformedMonPersonality; + bool8 transformedMonShininess; + u16 disabledMove; + u16 encoredMove; + u8 protectUses:4; + u8 stockpileCounter:4; + s8 stockpileDef; + s8 stockpileSpDef; + s8 stockpileBeforeDef; + s8 stockpileBeforeSpDef; + u8 substituteHP; + u8 encoredMovePos; + u8 disableTimer:4; + u8 encoreTimer:4; + u8 perishSongTimer:4; + u8 furyCutterCounter; + u8 rolloutTimer:4; + u8 rolloutTimerStartValue:4; + u8 chargeTimer:4; + u8 tauntTimer:4; + u8 battlerPreventingEscape; + u8 battlerWithSureHit; + u8 isFirstTurn; + u8 truantCounter:1; + u8 truantSwitchInHack:1; + u8 mimickedMoves:4; + u8 rechargeTimer; + u8 autotomizeCount; + u8 slowStartTimer; + u8 embargoTimer; + u8 magnetRiseTimer; + u8 telekinesisTimer; + u8 healBlockTimer; + u8 laserFocusTimer; + u8 throatChopTimer; u8 wrapTurns; + u8 tormentTimer:4; // used for G-Max Meltdown + u8 usedMoves:4; + u8 noRetreat:1; + u8 tarShot:1; + u8 octolock:1; + u8 cudChew:1; + u8 spikesDone:1; + u8 toxicSpikesDone:1; + u8 stickyWebDone:1; + u8 stealthRockDone:1; + u8 syrupBombTimer; + u8 syrupBombIsShiny:1; + u8 steelSurgeDone:1; + u8 weatherAbilityDone:1; + u8 terrainAbilityDone:1; + u8 usedProteanLibero:1; }; extern struct DisableStruct gDisableStructs[MAX_BATTLERS_COUNT]; struct ProtectStruct { - /* field_0 */ u32 protected:1; + u32 spikyShielded:1; + u32 kingsShielded:1; + u32 banefulBunkered:1; + u32 obstructed:1; u32 endured:1; u32 noValidMoves:1; u32 helpingHand:1; u32 bounceMove:1; u32 stealMove:1; - u32 flag0Unknown:1; u32 prlzImmobility:1; - /* field_1 */ u32 confusionSelfDmg:1; - u32 targetNotAffected:1; + u32 targetAffected:1; u32 chargingTurn:1; - u32 fleeType: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; - /* field_2 */ - u32 usedTauntedMove:1; // 0x1 - u32 flag2Unknown:1; // 0x2 - u32 flinchImmobility:1; // 0x4 - u32 notFirstStrike:1; // 0x8 - u32 flag_x10 : 1; // 0x10 - u32 flag_x20 : 1; // 0x20 - u32 flag_x40 : 1; // 0x40 - u32 flag_x80 : 1; // 0x80 - u32 field3 : 8; - + u32 usedTauntedMove:1; + u32 flag2Unknown:1; // Only set to 0 once. Checked in 'WasUnableToUseMove' function. + u32 flinchImmobility:1; + u32 notFirstStrike:1; + u32 palaceUnableToUseMove:1; + u32 usesBouncedMove:1; + u32 usedHealBlockedMove:1; + u32 usedGravityPreventedMove:1; + u32 powderSelfDmg:1; + u32 usedThroatChopPreventedMove:1; + u32 statRaised:1; + u32 usedMicleBerry:1; + u32 usedCustapBerry:1; // also quick claw + u32 touchedProtectLike:1; + // End of 32-bit bitfield + u16 disableEjectPack:1; + u16 statFell:1; + u16 pranksterElevated:1; + u16 quickDraw:1; + u16 beakBlastCharge:1; + u16 quash:1; + u16 shellTrap:1; + u16 maxGuarded:1; + u16 silkTrapped:1; + u16 burningBulwarked:1; + u16 eatMirrorHerb:1; + u16 activateOpportunist:2; // 2 - to copy stats. 1 - stats copied (do not repeat). 0 - no stats to copy + u16 usedAllySwitch:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; - u16 fieldE; + // pokefirered + /* field_0 */ + /* field_1 */ + u32 targetNotAffected:1; + /* field_2 */ }; extern struct ProtectStruct gProtectStructs[MAX_BATTLERS_COUNT]; struct SpecialStatus { - u8 statLowered:1; // 0x1 - u8 lightningRodRedirected:1; // 0x2 - u8 restoredBattlerSprite:1; // 0x4 - u8 intimidatedMon:1; // 0x8 - u8 traced:1; // 0x10 - u8 ppNotAffectedByPressure:1; - u8 faintedHasReplacement:1; - u8 focusBanded:1; - u8 field1[3]; - s32 dmg; + s32 shellBellDmg; s32 physicalDmg; s32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; - u8 field12; - u8 field13; + u8 changedStatsBattlerId; // Battler that was responsible for the latest stat change. Can be self. + u8 statLowered:1; + u8 lightningRodRedirected:1; + u8 restoredBattlerSprite: 1; + u8 traced:1; + u8 faintedHasReplacement:1; + u8 focusBanded:1; + u8 focusSashed:1; + // End of byte + u8 sturdied:1; + u8 stormDrainRedirected:1; + u8 switchInAbilityDone:1; + u8 switchInItemDone:1; + u8 instructedChosenTarget:3; + u8 berryReduced:1; + // End of byte + u8 gemParam; + // End of byte + u8 gemBoost:1; + u8 rototillerAffected:1; // to be affected by rototiller + u8 parentalBondState:2; + u8 multiHitOn:1; + u8 announceNeutralizingGas:1; // See Cmd_switchineffects + u8 neutralizingGasRemoved:1; // See VARIOUS_TRY_END_NEUTRALIZING_GAS + u8 affectionEndured:1; + // End of byte + u8 damagedMons:4; // Mons that have been damaged directly by using a move, includes substitute. + u8 dancerUsedMove:1; + u8 dancerOriginalTarget:3; + // End of byte + u8 emergencyExited:1; + u8 afterYou:1; + u8 preventLifeOrbDamage:1; // So that Life Orb doesn't activate various effects. + // pokeemrald + u8 intimidatedMon:1; // 0x8 + u8 ppNotAffectedByPressure:1; + s32 dmg; }; extern struct SpecialStatus gSpecialStatuses[MAX_BATTLERS_COUNT]; @@ -249,20 +332,54 @@ struct SideTimer /*0x09*/ u8 followmeTarget; /*0x0A*/ u8 spikesAmount; /*0x0B*/ u8 fieldB; + // pokeemerald + u8 retaliateTimer; + u8 stealthRockAmount; + u8 stickyWebAmount; + u8 stickyWebBattlerId; + u8 stickyWebBattlerSide; // Used for Court Change + u8 tailwindTimer; + u8 tailwindBattlerId; + u8 auroraVeilTimer; + u8 auroraVeilBattlerId; + u8 toxicSpikesAmount; + u8 followmePowder:1; // Rage powder, does not affect grass type pokemon. + u8 steelsurgeAmount; + u8 luckyChantTimer; + u8 luckyChantBattlerId; + u8 damageNonTypesTimer; + u8 damageNonTypesType; + u8 rainbowTimer; + u8 seaOfFireTimer; + u8 swampTimer; }; extern struct SideTimer gSideTimers[]; +struct FieldTimer +{ + u8 mudSportTimer; + u8 waterSportTimer; + u8 wonderRoomTimer; + u8 magicRoomTimer; + u8 trickRoomTimer; + u8 terrainTimer; + u8 gravityTimer; + u8 fairyLockTimer; +}; + struct WishFutureKnock { u8 futureSightCounter[MAX_BATTLERS_COUNT]; - u8 futureSightAttacker[MAX_BATTLERS_COUNT]; - s32 futureSightDmg[MAX_BATTLERS_COUNT]; + u8 futureSightBattlerIndex[MAX_BATTLERS_COUNT]; + u8 futureSightPartyIndex[MAX_BATTLERS_COUNT]; + u8 futureSightAttacker[MAX_BATTLERS_COUNT]; // pokefirered, remove + s32 futureSightDmg[MAX_BATTLERS_COUNT]; // pokefirered, remove u16 futureSightMove[MAX_BATTLERS_COUNT]; u8 wishCounter[MAX_BATTLERS_COUNT]; - u8 wishMonId[MAX_BATTLERS_COUNT]; + u8 wishPartyId[MAX_BATTLERS_COUNT]; u8 weatherDuration; - u8 knockedOffMons[2]; + u8 knockedOffMons[NUM_BATTLE_SIDES]; }; extern struct WishFutureKnock gWishFutureKnock; @@ -293,13 +410,18 @@ struct UsedMoves u16 unknown[MAX_BATTLERS_COUNT]; }; +#define AI_MOVE_HISTORY_COUNT 3 + struct BattleHistory { /*0x00*/ u16 usedMoves[2][8]; // 0xFFFF means move not used (confuse self hit, etc) - /*0x20*/ u16 abilities[MAX_BATTLERS_COUNT / 2]; - /*0x22*/ u8 itemEffects[MAX_BATTLERS_COUNT / 2]; + u16 abilities[MAX_BATTLERS_COUNT]; + /*0x22*/ u8 itemEffects[MAX_BATTLERS_COUNT]; /*0x24*/ u16 trainerItems[MAX_BATTLERS_COUNT]; /*0x2C*/ u8 itemsNo; + u16 moveHistory[MAX_BATTLERS_COUNT][AI_MOVE_HISTORY_COUNT]; // 3 last used moves for each battler + u8 moveHistoryIndex[MAX_BATTLERS_COUNT]; + u16 heldItems[MAX_BATTLERS_COUNT]; }; struct BattleScriptsStack @@ -371,6 +493,74 @@ struct LinkBattlerHeader struct BattleEnigmaBerry battleEnigmaBerry; }; +struct MegaEvolutionData +{ + u8 toEvolve; // As flags using gBitTable. + bool8 alreadyEvolved[4]; // Array id is used for mon position. + u8 battlerId; + bool8 playerSelect; + u8 triggerSpriteId; +}; + +struct UltraBurstData +{ + u8 toBurst; // As flags using gBitTable. + bool8 alreadyBursted[4]; // Array id is used for mon position. + u8 battlerId; + bool8 playerSelect; + u8 triggerSpriteId; +}; + +struct Illusion +{ + u8 on; + u8 set; + u8 broken; + u8 partyId; + struct Pokemon *mon; +}; + +struct ZMoveData +{ + u8 viable:1; // current move can become a z move + u8 viewing:1; // if player is viewing the z move name instead of regular moves + u8 active:1; // is z move being used this turn + u8 zStatusActive:1; + u8 healReplacement:1; + u8 activeCategory:2; // active z move category + u8 zUnused:1; + u8 triggerSpriteId; + u8 possibleZMoves[MAX_BATTLERS_COUNT]; + u16 chosenZMove; // z move of move cursor is on + u8 effect; + u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles + u16 toBeUsed[MAX_BATTLERS_COUNT]; // z moves per battler to be used + u16 baseMoves[MAX_BATTLERS_COUNT]; + u8 categories[MAX_BATTLERS_COUNT]; +}; + +struct DynamaxData +{ + bool8 playerSelect; + u8 triggerSpriteId; + u8 toDynamax; // flags using gBitTable + bool8 alreadyDynamaxed[NUM_BATTLE_SIDES]; + bool8 dynamaxed[MAX_BATTLERS_COUNT]; + u8 dynamaxTurns[MAX_BATTLERS_COUNT]; + u8 usingMaxMove[MAX_BATTLERS_COUNT]; + u8 activeCategory; + u8 categories[MAX_BATTLERS_COUNT]; + u16 baseMove[MAX_BATTLERS_COUNT]; // base move of Max Move + u16 lastUsedBaseMove; + u16 levelUpHP; +}; + +struct LostItem +{ + u16 originalItem:15; + u16 stolen:1; +}; + struct BattleStruct { u8 turnEffectsTracker; @@ -384,7 +574,6 @@ struct BattleStruct u8 wildVictorySong; u8 dynamicMoveType; u8 wrappedBy[MAX_BATTLERS_COUNT]; - u16 assistPossibleMoves[PARTY_SIZE * MAX_MON_MOVES]; // 6 mons, each of them knowing 4 moves u8 focusPunchBattlerId; u8 battlerPreventingSwitchout; u8 moneyMultiplier; @@ -393,7 +582,7 @@ struct BattleStruct u8 faintedActionsState; u8 faintedActionsBattlerId; // balign 2 - u16 expValue; + u32 expValue; u8 scriptPartyIdx; // for printing the nickname u8 sentInPokes; bool8 selectionScriptFinished[MAX_BATTLERS_COUNT]; @@ -403,8 +592,8 @@ struct BattleStruct u8 runTries; u8 caughtMonNick[POKEMON_NAME_LENGTH + 1]; u8 field_78; // unused - u8 safariRockThrowCounter; - u8 safariBaitThrowCounter; + u8 safariRockThrowCounter; // safariGoNearCounter in pokeemerald + u8 safariBaitThrowCounter; // safariPkblThrowCounter in pokeemerald u8 safariEscapeFactor; u8 safariCatchFactor; u8 linkBattleVsSpriteId_V; @@ -430,11 +619,11 @@ struct BattleStruct u8 hpScale; u16 savedBattleTypeFlags; void (*savedCallback)(void); - u8 synchronizeMoveEffect; + u16 synchronizeMoveEffect; u8 multiplayerId; u8 overworldWeatherDone; u8 atkCancellerTracker; - u16 usedHeldItems[MAX_BATTLERS_COUNT]; + u16 usedHeldItems[PARTY_SIZE][NUM_BATTLE_SIDES]; // For each party member and side. For harvest, recycle u8 chosenItem[MAX_BATTLERS_COUNT]; // why is this an u8? u8 AI_itemType[2]; u8 AI_itemFlags[2]; @@ -446,7 +635,7 @@ struct BattleStruct u8 turnSideTracker; u8 fillerDC[0xDF-0xDC]; u8 givenExpMons; - u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; + u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT]; u16 castformPalette[MAX_BATTLERS_COUNT][16]; u8 wishPerishSongState; u8 wishPerishSongBattlerId; @@ -459,42 +648,134 @@ struct BattleStruct u8 itemPartyIndex[MAX_BATTLERS_COUNT]; u8 itemMoveIndex[MAX_BATTLERS_COUNT]; u8 padding_1E4[0x14]; -}; // size == 0x200 bytes + // pokeemerald + u8 isSkyBattle:1; + u8 isAtkCancelerForCalledMove:1; // Certain cases in atk canceler should only be checked once, when the original move is called, however others need to be checked the twice. + u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky + u8 beatUpSlot:3; + u8 pledgeMove:1; + u8 magnitudeBasePower; + u8 presentBasePower; + u8 sameMoveTurns[MAX_BATTLERS_COUNT]; // For Metronome, number of times the same moves has been SUCCESFULLY used. + u8 lastMoveFailed; // as bits for each battler, for the sake of Stomping Tantrum + bool8 ateBoost[MAX_BATTLERS_COUNT]; + u8 timesGotHit[NUM_BATTLE_SIDES][PARTY_SIZE]; + u8 supremeOverlordCounter[MAX_BATTLERS_COUNT]; + struct Illusion illusion[MAX_BATTLERS_COUNT]; + u8 trainerSlideFirstSTABMoveMsgState:2; + u8 blunderPolicy:1; // should blunder policy activate + u8 skyDropTargets[MAX_BATTLERS_COUNT]; // For Sky Drop, to account for if multiple Pokemon use Sky Drop in a double battle. + u8 bonusCritStages[MAX_BATTLERS_COUNT]; // G-Max Chi Strike boosts crit stages of allies. + u8 enduredDamage; + u16 changedSpecies[NUM_BATTLE_SIDES][PARTY_SIZE]; // For forms when multiple mons can change into the same pokemon. + u8 trainerSlideFirstCriticalHitMsgState:2; + u8 trainerSlideFirstSuperEffectiveHitMsgState:2; + u8 additionalEffectsCounter:4; // A counter for the additionalEffects applied by the current move in Cmd_setadditionaleffects + u8 targetsDone[MAX_BATTLERS_COUNT]; // Each battler as a bit. + u16 moveEffect2; // For Knock Off + u8 stolenStats[NUM_BATTLE_STATS]; // hp byte is used for which stats to raise, other inform about by how many stages + u8 stickySyrupdBy[MAX_BATTLERS_COUNT]; + u8 moneyMultiplierMove:1; + struct LostItem itemLost[PARTY_SIZE]; // Player's team that had items consumed or stolen (two bytes per party member) + u8 savedBattlerTarget; + u8 ateBerry[2]; // array id determined by side, each party pokemon as bit + u16 overwrittenAbilities[MAX_BATTLERS_COUNT]; // abilities overwritten during battle (keep separate from battle history in case of switching) + struct MegaEvolutionData mega; + struct UltraBurstData burst; + struct ZMoveData zmove; + struct DynamaxData dynamax; + u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change + bool8 allowedToChangeFormInWeather[PARTY_SIZE][NUM_BATTLE_SIDES]; // For each party member and side, used by Ice Face. + u8 startingStatus; // status to apply at battle start. defined in constants/battle.h + u8 startingStatusTimer; + u8 transformZeroToHero[NUM_BATTLE_SIDES]; + u8 supersweetSyrup[NUM_BATTLE_SIDES]; + u8 intrepidSwordBoost[NUM_BATTLE_SIDES]; + u8 dauntlessShieldBoost[NUM_BATTLE_SIDES]; + u16 tracedAbility[MAX_BATTLERS_COUNT]; + u16 hpBefore[MAX_BATTLERS_COUNT]; // Hp of battlers before using a move. For Berserk and Anger Shell. + u8 friskedBattler; // Frisk needs to identify 2 battlers in double battles. + bool8 friskedAbility; // If identifies two mons, show the ability pop-up only once. + bool8 spriteIgnore0Hp; + u8 moneyMultiplierItem:1; + u8 expGettersOrder[PARTY_SIZE]; // First battlers which were sent out, then via exp-share + u32 expShareExpValue; + u8 expOrderId:3; + u8 expSentInMons; // As bits for player party mons - not including exp share mons. + u8 teamGotExpMsgPrinted:1; // The 'Rest of your team got msg' has been printed. + u8 roostTypes[MAX_BATTLERS_COUNT][2]; + u8 lastMoveTarget[MAX_BATTLERS_COUNT]; // The last target on which each mon used a move, for the sake of Instruct + u8 attackerBeforeBounce:2; + bool8 hitSwitchTargetFailed:1; + u8 storedHealingWish:4; // Each battler as a bit. + u8 storedLunarDance:4; // Each battler as a bit. + u8 forcedSwitch:4; // For each battler + u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed Pokémon. + u8 soulheartBattlerId; + const u8 *trainerSlideMsg; + u8 battleBondTransformed[NUM_BATTLE_SIDES]; // Bitfield for each party. + // pokeemerald unknown use + u8 field_93; // related to choosing pokemon? probably related to recording +}; extern struct BattleStruct *gBattleStruct; -#define F_DYNAMIC_TYPE_1 (1 << 6) -#define F_DYNAMIC_TYPE_2 (1 << 7) -#define DYNAMIC_TYPE_MASK (F_DYNAMIC_TYPE_1 - 1) +#define DYNAMIC_TYPE_MASK ((1 << 6) - 1) +#define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects. +#define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type. #define GET_MOVE_TYPE(move, typeArg) \ { \ if (gBattleStruct->dynamicMoveType) \ typeArg = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; \ else \ - typeArg = gBattleMoves[move].type; \ + typeArg = gMovesInfo[move].type; \ } -#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY) -#define IS_TYPE_SPECIAL(moveType)(moveType > TYPE_MYSTERY) +#define IS_MOVE_PHYSICAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) +#define IS_MOVE_SPECIAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL) +#define IS_MOVE_STATUS(move)(gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) -#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0)) +#define IS_MOVE_RECOIL(move)(gMovesInfo[move].recoil > 0 || gMovesInfo[move].effect == EFFECT_RECOIL_IF_MISS) -#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type)) -#define SET_BATTLER_TYPE(battlerId, type) \ -{ \ - gBattleMons[battlerId].type1 = type; \ - gBattleMons[battlerId].type2 = type; \ +#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY) // TODO: remove +#define IS_TYPE_SPECIAL(moveType)(moveType > TYPE_MYSTERY) // TODO: remove + +#define BATTLER_MAX_HP(battlerId)(gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP) +#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[gBattlerTarget])) +#define BATTLER_TURN_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[battler])) + +#define IS_BATTLER_OF_TYPE(battlerId, type)((GetBattlerType(battlerId, 0) == type || GetBattlerType(battlerId, 1) == type || (GetBattlerType(battlerId, 2) != TYPE_MYSTERY && GetBattlerType(battlerId, 2) == type))) + +#define SET_BATTLER_TYPE(battlerId, type) \ +{ \ + gBattleMons[battlerId].type1 = type; \ + gBattleMons[battlerId].type2 = type; \ + gBattleMons[battlerId].type3 = TYPE_MYSTERY; \ } -#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8 -#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0)) -#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40 +#define IS_BATTLER_PROTECTED(battlerId)(gProtectStructs[battlerId].protected \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_QUICK_GUARD \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_MAT_BLOCK \ + || gProtectStructs[battlerId].spikyShielded \ + || gProtectStructs[battlerId].kingsShielded \ + || gProtectStructs[battlerId].banefulBunkered \ + || gProtectStructs[battlerId].burningBulwarked \ + || gProtectStructs[battlerId].obstructed \ + || gProtectStructs[battlerId].silkTrapped) + +#define GET_STAT_BUFF_ID(n)((n & 7)) // first three bits 0x1, 0x2, 0x4 +#define GET_STAT_BUFF_VALUE_WITH_SIGN(n)((n & 0xF8)) +#define GET_STAT_BUFF_VALUE(n)(((n >> 3) & 0xF)) // 0x8, 0x10, 0x20, 0x40 #define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit -#define SET_STAT_BUFF_VALUE(n)(((s8)(((s8)(n) << 4)) & 0xF0)) +#define SET_STAT_BUFF_VALUE(n)((((n) << 3) & 0xF8)) #define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) +#define SET_STATCHANGER2(dst, statId, stage, goesDown)(dst = (statId) + ((stage) << 3) + (goesDown << 7)) +// TODO: change in battle script(?) from stage << 4 to stage << 3 // NOTE: The members of this struct have hard-coded offsets // in include/constants/battle_script_commands.h @@ -503,14 +784,14 @@ struct BattleScripting s32 painSplitHp; s32 bideDmg; u8 multihitString[6]; - u8 dmgMultiplier; - u8 twoTurnsMoveStringId; + bool8 expOnCatch; + u8 unused; u8 animArg1; u8 animArg2; - u16 tripleKickPower; + u16 savedStringId; u8 moveendState; - u8 battlerWithAbility; - u8 multihitMoveEffect; + u8 savedStatChanger; // For further use, if attempting to change stat two times(ex. Moody) + u8 shiftSwitched; // When the game tells you the next enemy's pokemon and you switch. Option for noobs but oh well. u8 battler; u8 animTurn; u8 animTargetsHit; @@ -520,10 +801,26 @@ struct BattleScripting u8 battleStyle; u8 drawlvlupboxState; u8 learnMoveState; - u8 pursuitDoublesAttacker; + u8 savedBattler; u8 reshowMainState; u8 reshowHelperState; u8 levelUpHP; + u8 windowsType; // B_WIN_TYPE_* + u8 multiplayerId; + u8 specialTrainerBattleType; + bool8 monCaught; + s32 savedDmg; + u16 savedMoveEffect; // For moves hitting multiple targets. + u16 moveEffect; + u16 multihitMoveEffect; + u8 illusionNickHack; // To properly display nick in STRINGID_ENEMYABOUTTOSWITCHPKMN. + bool8 fixedPopup; // Force ability popup to stick until manually called back + u16 abilityPopupOverwrite; + u8 switchCase; // Special switching conditions, eg. red card + u8 overrideBerryRequirements; + u8 stickyWebStatDrop; // To prevent Defiant activating on a Court Change'd Sticky Web + // TODO: remove pokefirered members + u8 dmgMultiplier; }; struct BattleSpriteInfo @@ -545,7 +842,9 @@ struct BattleAnimationInfo u8 field_5; u8 field_6; u8 field_7; - u8 ballThrowCaseId; + u8 ballThrowCaseId:6; + u8 isCriticalCapture:1; + u8 criticalCaptureSuccess:1; u8 introAnimActive:1; u8 wildMonInvisible:1; u8 field_9_x1C:3; @@ -615,7 +914,8 @@ struct MonSpritesGfx void *sprites[MAX_BATTLERS_COUNT]; struct SpriteTemplate templates[MAX_BATTLERS_COUNT]; struct SpriteFrameImage images[MAX_BATTLERS_COUNT][4]; - u8 field_F4[0x80]; // unused + u8 field_F4[0x80 - (4 * MAX_BATTLERS_COUNT)]; // unused, original - spritesGfx + u8 *spritesGfx[MAX_BATTLERS_COUNT]; u8 *barFontGfx; void *field_178; // freed but never allocated u16 *multiUseBuffer; @@ -630,6 +930,12 @@ struct PokedudeBattlerState u8 saved_bg0y; }; +struct QueuedStatBoost +{ + u8 stats; // bitfield for each battle stat that is set if the stat changes + s8 statChanges[NUM_BATTLE_STATS - 1]; // highest bit being set decreases the stat +}; /* size = 8 */ + extern u16 gBattle_BG0_X; extern u16 gBattle_BG0_Y; extern u16 gBattle_BG1_X; @@ -648,6 +954,7 @@ extern u16 gLastUsedItem; extern u32 gBattleTypeFlags; extern struct MonSpritesGfx *gMonSpritesGfxPtr; extern u16 gTrainerBattleOpponent_A; +extern u16 gTrainerBattleOpponent_B; extern u16 gMoveToLearn; extern u16 gBattleMovePower; extern struct BattleEnigmaBerry gEnigmaBerries[MAX_BATTLERS_COUNT]; @@ -695,7 +1002,7 @@ extern const u8 *gSelectionBattleScripts[MAX_BATTLERS_COUNT]; extern u16 gLastMoves[MAX_BATTLERS_COUNT]; extern u8 gBattlerByTurnOrder[MAX_BATTLERS_COUNT]; extern u8 gBattleCommunication[BATTLE_COMMUNICATION_ENTRIES_COUNT]; -extern u16 gSideStatuses[2]; +extern u32 gSideStatuses[NUM_BATTLE_SIDES]; extern u32 gHitMarker; extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT]; extern u8 gMoveResultFlags; @@ -727,6 +1034,19 @@ extern u8 gBattleTerrain; extern struct MultiBattlePokemonTx gMultiPartnerParty[3]; extern u16 gRandomTurnNumber; extern u8 gPartyCriticalHits[PARTY_SIZE]; +extern const struct BattleMoveEffect gBattleMoveEffects[]; +extern u32 gFieldStatuses; +extern u8 gBattlerAbility; +extern s32 gBideDmg[MAX_BATTLERS_COUNT]; +extern u8 gBideTarget[MAX_BATTLERS_COUNT]; +extern u16 gLastUsedMove; +extern u8 gIsCriticalHit; +extern struct FieldTimer gFieldTimers; +extern bool8 gHasFetchedBall; +extern u8 gLastUsedBall; +extern u16 gLastThrownBall; +extern u16 gBallToDisplay; +extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT]; static inline u32 GetBattlerPosition(u32 battler) { diff --git a/include/battle_ai_script_commands.h b/include/battle_ai_script_commands.h index 6e7cdd653..7c39fb0b6 100644 --- a/include/battle_ai_script_commands.h +++ b/include/battle_ai_script_commands.h @@ -12,9 +12,9 @@ void BattleAI_HandleItemUseBeforeAISetup(void); void BattleAI_SetupAIData(void); u8 BattleAI_ChooseMoveOrAction(void); void ClearBankMoveHistory(u8 bank); -void RecordAbilityBattle(u8 bank, u16 abilityId); +void RecordAbilityBattle(u32 bank, u32 abilityId); void ClearBankAbilityHistory(u8 bank); -void RecordItemEffectBattle(u8 bank, u8 itemEffect); +void RecordItemEffectBattle(u32 bank, u32 itemEffect); void ClearBankItemEffectHistory(u8 bank); u8 BattleAI_ChooseMoveOrAction(void); diff --git a/include/battle_anim.h b/include/battle_anim.h index 2b4b82b8b..b535704fe 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -185,6 +185,12 @@ extern const u8 *const gBattleAnims_StatusConditions[]; extern const u8 *const gBattleAnims_Moves[]; extern const u16 gMovesWithQuietBGM[]; +u8 GetAnimBattlerId(u8 wantedBattler); + +// battle_anim_throw.c +bool32 IsCriticalCapture(void); + +// void MoveBattlerSpriteToBG(u8 battlerId, u8); void ResetBattleAnimBg(u8); void ClearBattleAnimationVars(void); diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 4d543ea8a..9f1e2b258 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -181,7 +181,7 @@ enum CONTROLLER_HITANIMATION, CONTROLLER_CANTSWITCH, CONTROLLER_PLAYSE, - CONTROLLER_PLAYFANFARE, + CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_FAINTINGCRY, CONTROLLER_INTROSLIDE, CONTROLLER_INTROTRAINERBALLTHROW, @@ -206,6 +206,7 @@ void SetUpBattleVars(void); void InitBattleControllers(void); void TryReceiveLinkBattleData(void); void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data); +bool32 IsValidForBattle(struct Pokemon *mon); // emitters void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck); @@ -218,7 +219,7 @@ void BtlController_EmitTrainerSlide(u8 bufferId); void BtlController_EmitTrainerSlideBack(u8 bufferId); void BtlController_EmitFaintAnimation(u8 bufferId); void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId); -void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr); +void BtlController_EmitMoveAnimation(u32 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 action, u16 itemId); @@ -237,7 +238,7 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b); void BtlController_EmitHitAnimation(u8 bufferId); void BtlController_EmitCantSwitch(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); -void BtlController_EmitPlayFanfare(u8 bufferId, u16 songId); +void BtlController_EmitPlayFanfareOrBGM(u32 bufferId, u16 songId, bool8 playBGM); void BtlController_EmitFaintingCry(u8 bufferId); void BtlController_EmitIntroSlide(u8 bufferId, u8 terrainId); void BtlController_EmitIntroTrainerBallThrow(u8 bufferId); @@ -245,7 +246,7 @@ void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus *h void BtlController_EmitHidePartyStatusSummary(u8 bufferId); void BtlController_EmitEndBounceEffect(u8 bufferId); void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible); -void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument); +void BtlController_EmitBattleAnimation(u32 bufferId, u8 animationId, struct DisableStruct* disableStructPtr, u16 argument); void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 mode); void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId); void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome); diff --git a/include/battle_dynamax.h b/include/battle_dynamax.h new file mode 100644 index 000000000..bd874d672 --- /dev/null +++ b/include/battle_dynamax.h @@ -0,0 +1,92 @@ +#ifndef GUARD_BATTLE_DYNAMAX_H +#define GUARD_BATTLE_DYNAMAX_H + +#define DYNAMAX_TURNS_COUNT 3 + +enum MaxMoveEffect +{ + MAX_EFFECT_NONE, + MAX_EFFECT_RAISE_TEAM_ATTACK, + MAX_EFFECT_RAISE_TEAM_DEFENSE, + MAX_EFFECT_RAISE_TEAM_SPEED, + MAX_EFFECT_RAISE_TEAM_SP_ATK, + MAX_EFFECT_RAISE_TEAM_SP_DEF, + MAX_EFFECT_LOWER_ATTACK, + MAX_EFFECT_LOWER_DEFENSE, + MAX_EFFECT_LOWER_SPEED, + MAX_EFFECT_LOWER_SP_ATK, + MAX_EFFECT_LOWER_SP_DEF, + MAX_EFFECT_SUN, + MAX_EFFECT_RAIN, + MAX_EFFECT_SANDSTORM, + MAX_EFFECT_HAIL, + MAX_EFFECT_MISTY_TERRAIN, + MAX_EFFECT_GRASSY_TERRAIN, + MAX_EFFECT_ELECTRIC_TERRAIN, + MAX_EFFECT_PSYCHIC_TERRAIN, + MAX_EFFECT_VINE_LASH, + MAX_EFFECT_WILDFIRE, + MAX_EFFECT_CANNONADE, + MAX_EFFECT_EFFECT_SPORE_FOES, + MAX_EFFECT_PARALYZE_FOES, + MAX_EFFECT_CONFUSE_FOES_PAY_DAY, + MAX_EFFECT_CRIT_PLUS, + MAX_EFFECT_MEAN_LOOK, + MAX_EFFECT_AURORA_VEIL, + MAX_EFFECT_INFATUATE_FOES, + MAX_EFFECT_RECYCLE_BERRIES, + MAX_EFFECT_POISON_FOES, + MAX_EFFECT_STEALTH_ROCK, + MAX_EFFECT_DEFOG, + MAX_EFFECT_POISON_PARALYZE_FOES, + MAX_EFFECT_HEAL_TEAM, + MAX_EFFECT_SPITE, + MAX_EFFECT_GRAVITY, + MAX_EFFECT_VOLCALITH, + MAX_EFFECT_SANDBLAST_FOES, + MAX_EFFECT_YAWN_FOE, + MAX_EFFECT_LOWER_EVASIVENESS_FOES, + MAX_EFFECT_AROMATHERAPY, + MAX_EFFECT_CONFUSE_FOES, + MAX_EFFECT_STEELSURGE, + MAX_EFFECT_TORMENT_FOES, + MAX_EFFECT_LOWER_SPEED_2_FOES, + MAX_EFFECT_FIRE_SPIN_FOES, + MAX_EFFECT_FIXED_POWER, + MAX_EFFECT_BYPASS_PROTECT, +}; + +// bool32 IsDynamaxed(u16 battlerId); +// bool32 CanDynamax(u16 battlerId); +// bool32 IsGigantamaxed(u16 battlerId); +// void ApplyDynamaxHPMultiplier(u32 battler, struct Pokemon* mon); +// void PrepareBattlerForDynamax(u16 battlerId); +// u16 GetNonDynamaxHP(u16 battlerId); +// u16 GetNonDynamaxMaxHP(u32 battlerId); +// void UndoDynamax(u16 battlerId); +// bool32 IsMoveBlockedByMaxGuard(u16 move); +// bool32 IsMoveBlockedByDynamax(u16 move); + +// bool32 ShouldUseMaxMove(u16 battlerId, u16 baseMove); +// u16 GetMaxMove(u16 battlerId, u16 baseMove); +// u8 GetMaxMovePower(u16 move); +// bool32 IsMaxMove(u16 move); +// void ChooseDamageNonTypesString(u8 type); + +// void BS_UpdateDynamax(void); +// void BS_SetMaxMoveEffect(void); +// void BS_SetSteelsurge(void); +// void BS_TrySetStatus1(void); +// void BS_TrySetStatus2(void); +// void BS_DamageNonTypes(void); +// void BS_HealOneSixth(void); +// void BS_TryRecycleBerry(void); +// void BS_JumpIfDynamaxed(void); + +// void ChangeDynamaxTriggerSprite(u8 spriteId, u8 animId); +// void CreateDynamaxTriggerSprite(u8, bool8); +// void HideDynamaxTriggerSprite(void); +// bool32 IsDynamaxTriggerSpriteActive(void); +// void DestroyDynamaxTriggerSprite(void); + +#endif diff --git a/include/battle_main.h b/include/battle_main.h index 1bb73b5c5..16b3ac5b2 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -79,15 +79,20 @@ void SpriteCB_PlayerThrowInit(struct Sprite *sprite); void UpdatePlayerPosInThrowAnim(struct Sprite *sprite); void BeginBattleIntroDummy(void); void BeginBattleIntro(void); -void SwitchInClearSetData(void); -void FaintClearSetData(void); +void SwitchInClearSetData(u32 battler); +const u8* FaintClearSetData(u32 battler); void BattleTurnPassed(void); -u8 IsRunningFromBattleImpossible(void); -void UpdatePartyOwnerOnSwitch_NonMulti(u8 battler); +u8 IsRunningFromBattleImpossible(u32 battler); +void SwitchPartyOrder(u32 battlerId); void SwapTurnOrder(u8 id1, u8 id2); u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves); void RunBattleScriptCommands_PopCallbacksStack(void); void RunBattleScriptCommands(void); bool8 TryRunFromBattle(u8 battler); +s8 GetMovePriority(u32 battlerId, u16 move); +s8 GetChosenMovePriority(u32 battlerId); +u32 GetBattlerTotalSpeedStatArgs(u32 battler, u32 ability, u32 holdEffect); +u32 GetBattlerTotalSpeedStat(u32 battler); +void SpecialStatusesClear(void); #endif // GUARD_BATTLE_MAIN_H diff --git a/include/battle_message.h b/include/battle_message.h index ffe8710d0..dea248ed5 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -55,6 +55,8 @@ #define B_TXT_TRAINER2_LOSE_TEXT 0x2E #define B_TXT_TRAINER2_WIN_TEXT 0x2F #define B_TXT_BUFF3 0x30 +#define B_TXT_ATK_TEAM2 0x38 // your/the opposing +#define B_TXT_DEF_TEAM2 0x3B // your/the opposing // for B_TXT_BUFF1, B_TXT_BUFF2 and B_TXT_BUFF3 @@ -152,7 +154,7 @@ { \ textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \ textVar[1] = B_BUFF_MOVE; \ - textVar[2] = move; \ + textVar[2] = (move & 0xFF); \ textVar[3] = (move & 0xFF00) >> 8; \ textVar[4] = B_BUFF_EOS; \ } @@ -233,7 +235,6 @@ extern const u8 *const gRefereeStringsTable[]; extern const u8 *const gStatNamesTable2[]; extern const u16 gMissStringIds[]; -extern const u16 gTrappingMoves[]; extern const u8 gText_Sleep[]; extern const u8 gText_Poison[]; diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 44378aa8f..6cd98e8c9 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -7,11 +7,26 @@ #define WINDOW_CLEAR (1 << 0) #define WINDOW_BG1 (1 << 7) +// Arguments for 'xStart, yStart, xEnd, yEnd' in HandleBattleWindow +#define YESNOBOX_X_Y 23, 8, 29, 13 + +struct StatFractions +{ + u8 dividend; + u8 divisor; +}; + +struct PickupItem +{ + u16 itemId; + u8 percentage[10]; +}; + void AI_CalcDmg(u8 attacker, u8 defender); u8 TypeCalc(u16 move, u8 attacker, u8 defender); u8 AI_TypeCalc(u16 move, u16 targetSpecies, u16 targetAbility); u8 GetBattlerTurnOrderNum(u8 battlerId); -void SetMoveEffect(bool8 primary, u8 certain); +void SetMoveEffect(bool32 primary, u32 certain); bool32 IsMonGettingExpSentOut(void); void BattleDestroyYesNoCursorAt(void); void BattleCreateYesNoCursorAt(void); @@ -19,7 +34,27 @@ void BufferMoveToLearnIntoBattleTextBuff2(void); void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags); bool8 UproarWakeUpCheck(u8 battlerId); u8 GetCatchingBattler(void); +bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler); +u32 GetHighestStatId(u32 battlerId); +u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect); +bool32 DoesSubstituteBlockMove(u32 battlerAtk, u32 battlerDef, u32 move); +bool32 DoesDisguiseBlockMove(u32 battler, u32 move); +bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget); +bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget); +bool32 NoAliveMonsForPlayer(void); +bool32 NoAliveMonsForEitherParty(void); +void StealTargetItem(u8 battlerStealer, u8 battlerItem); +u32 IsFlowerVeilProtected(u32 battler); +u32 IsLeafGuardProtected(u32 battler); +bool32 IsShieldsDownProtected(u32 battler); +u32 IsAbilityStatusProtected(u32 battler); +bool32 TryResetBattlerStatChanges(u8 battler); +bool32 CanBattlerSwitch(u32 battlerId); +u8 GetFirstFaintedPartyIndex(u8 battlerId); +u16 GetNaturePowerMove(void); +bool32 CanCamouflage(u8 battlerId); extern void (* const gBattleScriptingCommandsTable[])(void); +extern const struct StatFractions gAccuracyStageRatios[]; #endif // GUARD_BATTLE_SCRIPT_COMMANDS_H diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 9ef3c0163..6edca470f 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -142,8 +142,6 @@ extern const u8 BattleScript_TraceActivates[]; extern const u8 BattleScript_RainDishActivates[]; extern const u8 BattleScript_SandstreamActivates[]; extern const u8 BattleScript_ShedSkinActivates[]; -extern const u8 BattleScript_WeatherFormChanges[]; -extern const u8 BattleScript_WeatherFormChangesLoop[]; extern const u8 BattleScript_CastformChange[]; extern const u8 BattleScript_DroughtActivates[]; extern const u8 BattleScript_TookAttack[]; @@ -173,7 +171,7 @@ extern const u8 BattleScript_SynchronizeActivates[]; extern const u8 BattleScript_NoItemSteal[]; extern const u8 BattleScript_AbilityCuredStatus[]; extern const u8 BattleScript_IgnoresAndUsesRandomMove[]; -extern const u8 BattleScript_MoveUsedLoafingAround[]; +extern const u8 BattleScript_MoveUsedLoafingAroundMsg[]; extern const u8 BattleScript_IgnoresAndFallsAsleep[]; extern const u8 BattleScript_SubstituteFade[]; extern const u8 BattleScript_BerryCurePrlzEnd2[]; @@ -219,7 +217,6 @@ extern const u8 BattleScript_ActionThrowPokeblock[]; extern const u8 BattleScript_GhostGetOutGetOut[]; extern const u8 BattleScript_TooScaredToMove[]; extern const u8 BattleScript_IntimidateActivates[]; -extern const u8 BattleScript_IntimidateActivatesEnd3[]; extern const u8 BattleScript_IgnoresWhileAsleep[]; extern const u8 BattleScript_IgnoresAndHitsItself[]; extern const u8 BattleScript_MoveEffectRecoil[]; @@ -230,7 +227,6 @@ extern const u8 BattleScript_OldMan_Pokedude_CaughtMessage[]; extern const u8 BattleScript_SilphScopeUnveiled[]; extern const u8 BattleScript_BattleTowerTrainerBattleWon[]; -extern const u8 *const gBattleScriptsForMoveEffects[]; extern const u8 *const gBattlescriptsForBallThrow[]; extern const u8 *const gBattlescriptsForRunningByItem[]; extern const u8 *const gBattlescriptsForUsingItem[]; @@ -238,4 +234,1117 @@ extern const u8 *const gBattleScriptsForAIUsingItems[]; extern const u8 *const gBattlescriptsForSafariActions[]; extern const u8 BattleScript_ItemRestoreHP_Party[]; +// effect scripts +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectSleep[]; +extern const u8 BattleScript_EffectPoisonHit[]; +extern const u8 BattleScript_EffectAbsorb[]; +extern const u8 BattleScript_EffectBurnHit[]; +extern const u8 BattleScript_EffectFreezeHit[]; +extern const u8 BattleScript_EffectParalyzeHit[]; +extern const u8 BattleScript_EffectExplosion[]; +extern const u8 BattleScript_EffectDreamEater[]; +extern const u8 BattleScript_EffectMirrorMove[]; +extern const u8 BattleScript_EffectAttackUp[]; +extern const u8 BattleScript_EffectDefenseUp[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectSpecialAttackUp[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectEvasionUp[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectAttackDown[]; +extern const u8 BattleScript_EffectDefenseDown[]; +extern const u8 BattleScript_EffectSpeedDown[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectAccuracyDown[]; +extern const u8 BattleScript_EffectEvasionDown[]; +extern const u8 BattleScript_EffectHaze[]; +extern const u8 BattleScript_EffectBide[]; +extern const u8 BattleScript_EffectRoar[]; +extern const u8 BattleScript_EffectMultiHit[]; +extern const u8 BattleScript_EffectConversion[]; +extern const u8 BattleScript_EffectFlinchHit[]; +extern const u8 BattleScript_EffectRestoreHp[]; +extern const u8 BattleScript_EffectToxic[]; +extern const u8 BattleScript_EffectPayDay[]; +extern const u8 BattleScript_EffectLightScreen[]; +extern const u8 BattleScript_EffectTriAttack[]; +extern const u8 BattleScript_EffectRest[]; +extern const u8 BattleScript_EffectOHKO[]; +extern const u8 BattleScript_EffectSuperFang[]; +extern const u8 BattleScript_EffectDragonRage[]; +extern const u8 BattleScript_EffectTrap[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectDoubleHit[]; +extern const u8 BattleScript_EffectMist[]; +extern const u8 BattleScript_EffectFocusEnergy[]; +extern const u8 BattleScript_EffectConfuse[]; +extern const u8 BattleScript_EffectAttackUp[]; +extern const u8 BattleScript_EffectDefenseUp[]; +extern const u8 BattleScript_EffectSpeedUp[]; +extern const u8 BattleScript_EffectSpecialAttackUp[]; +extern const u8 BattleScript_EffectSpecialDefenseUp[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectTransform[]; +extern const u8 BattleScript_EffectAttackDown[]; +extern const u8 BattleScript_EffectDefenseDown[]; +extern const u8 BattleScript_EffectSpeedDown[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectSpecialDefenseDown[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectReflect[]; +extern const u8 BattleScript_EffectPoison[]; +extern const u8 BattleScript_EffectParalyze[]; +extern const u8 BattleScript_EffectAttackDownHit[]; +extern const u8 BattleScript_EffectDefenseDownHit[]; +extern const u8 BattleScript_EffectSpeedDownHit[]; +extern const u8 BattleScript_EffectSpecialAttackDownHit[]; +extern const u8 BattleScript_EffectSpecialDefenseDownHit[]; +extern const u8 BattleScript_EffectAccuracyDownHit[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectConfuseHit[]; +extern const u8 BattleScript_EffectTwineedle[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectSubstitute[]; +extern const u8 BattleScript_EffectRecharge[]; +extern const u8 BattleScript_EffectRage[]; +extern const u8 BattleScript_EffectMimic[]; +extern const u8 BattleScript_EffectMetronome[]; +extern const u8 BattleScript_EffectLeechSeed[]; +extern const u8 BattleScript_EffectSplash[]; +extern const u8 BattleScript_EffectDisable[]; +extern const u8 BattleScript_EffectLevelDamage[]; +extern const u8 BattleScript_EffectPsywave[]; +extern const u8 BattleScript_EffectCounter[]; +extern const u8 BattleScript_EffectEncore[]; +extern const u8 BattleScript_EffectPainSplit[]; +extern const u8 BattleScript_EffectSnore[]; +extern const u8 BattleScript_EffectConversion[]; +extern const u8 BattleScript_EffectLockOn[]; +extern const u8 BattleScript_EffectSketch[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectSleepTalk[]; +extern const u8 BattleScript_EffectDestinyBond[]; +extern const u8 BattleScript_EffectSpite[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectHealBell[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectThief[]; +extern const u8 BattleScript_EffectMeanLook[]; +extern const u8 BattleScript_EffectNightmare[]; +extern const u8 BattleScript_EffectMinimize[]; +extern const u8 BattleScript_EffectCurse[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectProtect[]; +extern const u8 BattleScript_EffectSpikes[]; +extern const u8 BattleScript_EffectForesight[]; +extern const u8 BattleScript_EffectPerishSong[]; +extern const u8 BattleScript_EffectSandstorm[]; +extern const u8 BattleScript_EffectEndure[]; +extern const u8 BattleScript_EffectSwagger[]; +extern const u8 BattleScript_EffectFuryCutter[]; +extern const u8 BattleScript_EffectAttract[]; +extern const u8 BattleScript_EffectReturn[]; +extern const u8 BattleScript_EffectPresent[]; +extern const u8 BattleScript_EffectFrustration[]; +extern const u8 BattleScript_EffectSafeguard[]; +extern const u8 BattleScript_EffectThawHit[]; +extern const u8 BattleScript_EffectMagnitude[]; +extern const u8 BattleScript_EffectBatonPass[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectRapidSpin[]; +extern const u8 BattleScript_EffectSonicboom[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectMorningSun[]; +extern const u8 BattleScript_EffectSynthesis[]; +extern const u8 BattleScript_EffectMoonlight[]; +extern const u8 BattleScript_EffectRainDance[]; +extern const u8 BattleScript_EffectSunnyDay[]; +extern const u8 BattleScript_EffectDefenseUpHit[]; +extern const u8 BattleScript_EffectAttackUpHit[]; +extern const u8 BattleScript_EffectAllStatsUpHit[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectBellyDrum[]; +extern const u8 BattleScript_EffectPsychUp[]; +extern const u8 BattleScript_EffectMirrorCoat[]; +extern const u8 BattleScript_EffectTwister[]; +extern const u8 BattleScript_EffectEarthquake[]; +extern const u8 BattleScript_EffectFutureSight[]; +extern const u8 BattleScript_EffectGust[]; +extern const u8 BattleScript_EffectStomp[]; +extern const u8 BattleScript_EffectThunder[]; +extern const u8 BattleScript_EffectTeleport[]; +extern const u8 BattleScript_EffectBeatUp[]; +extern const u8 BattleScript_EffectDefenseCurl[]; +extern const u8 BattleScript_EffectSoftboiled[]; +extern const u8 BattleScript_EffectFakeOut[]; +extern const u8 BattleScript_EffectUproar[]; +extern const u8 BattleScript_EffectStockpile[]; +extern const u8 BattleScript_EffectSwallow[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectHail[]; +extern const u8 BattleScript_EffectTorment[]; +extern const u8 BattleScript_EffectFlatter[]; +extern const u8 BattleScript_EffectWillOWisp[]; +extern const u8 BattleScript_EffectMemento[]; +extern const u8 BattleScript_EffectFacade[]; +extern const u8 BattleScript_EffectFocusPunch[]; +extern const u8 BattleScript_EffectSmellingsalt[]; +extern const u8 BattleScript_EffectFollowMe[]; +extern const u8 BattleScript_EffectNaturePower[]; +extern const u8 BattleScript_EffectCharge[]; +extern const u8 BattleScript_EffectTaunt[]; +extern const u8 BattleScript_EffectHelpingHand[]; +extern const u8 BattleScript_EffectTrick[]; +extern const u8 BattleScript_EffectRolePlay[]; +extern const u8 BattleScript_EffectWish[]; +extern const u8 BattleScript_EffectAssist[]; +extern const u8 BattleScript_EffectIngrain[]; +extern const u8 BattleScript_EffectSuperpower[]; +extern const u8 BattleScript_EffectMagicCoat[]; +extern const u8 BattleScript_EffectRecycle[]; +extern const u8 BattleScript_EffectRevenge[]; +extern const u8 BattleScript_EffectBrickBreak[]; +extern const u8 BattleScript_EffectYawn[]; +extern const u8 BattleScript_EffectKnockOff[]; +extern const u8 BattleScript_EffectEndeavor[]; +extern const u8 BattleScript_EffectSkillSwap[]; +extern const u8 BattleScript_EffectImprison[]; +extern const u8 BattleScript_EffectRefresh[]; +extern const u8 BattleScript_EffectGrudge[]; +extern const u8 BattleScript_EffectSnatch[]; +extern const u8 BattleScript_EffectDoubleEdge[]; +extern const u8 BattleScript_EffectTeeterDance[]; +extern const u8 BattleScript_EffectBurnHit[]; +extern const u8 BattleScript_EffectMudSport[]; +extern const u8 BattleScript_EffectPoisonFang[]; +extern const u8 BattleScript_EffectOverheat[]; +extern const u8 BattleScript_EffectTickle[]; +extern const u8 BattleScript_EffectCosmicPower[]; +extern const u8 BattleScript_EffectSkyUppercut[]; +extern const u8 BattleScript_EffectBulkUp[]; +extern const u8 BattleScript_EffectPoisonHit[]; +extern const u8 BattleScript_EffectWaterSport[]; +extern const u8 BattleScript_EffectCalmMind[]; +extern const u8 BattleScript_EffectDragonDance[]; +extern const u8 BattleScript_EffectCamouflage[]; + +// pokeemerald +extern const u8 BattleScript_ProteanActivates[]; +extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; +extern const u8 BattleScript_FailedFromAtkString[]; +extern const u8 BattleScript_FlingFailConsumeItem[]; +extern const u8 BattleScript_MagicCoatBouncePrankster[]; +extern const u8 BattleScript_TruantLoafingAround[]; +extern const u8 BattleScript_MoveUsedHealBlockPrevents[]; +extern const u8 BattleScript_MoveUsedGravityPrevents[]; +extern const u8 BattleScript_MoveUsedUnfrostbite[]; +extern const u8 BattleScript_PowderMoveNoEffect[]; +extern const u8 BattleScript_MoveUsedPowder[]; +extern const u8 BattleScript_MoveUsedIsThroatChopPrevented[]; +extern const u8 BattleScript_PrimalWeatherBlocksMove[]; +extern const u8 BattleScript_BerryReduceDmg[]; +extern const u8 BattleScript_GemActivates[]; +extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; +extern const u8 BattleScript_SturdiedMsg[]; +extern const u8 BattleScript_HangedOnMsg[]; +extern const u8 BattleScript_PrintBerryReduceString[]; +extern const u8 BattleScript_TargetFormChange[]; +extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[]; +extern const u8 BattleScript_IceFaceNullsDamage[]; +extern const u8 BattleScript_AffectionBasedEndurance[]; +extern const u8 BattleScript_DefSpDefDown[]; +extern const u8 BattleScript_MoveEffectClearSmog[]; +extern const u8 BattleScript_MoveEffectFlameBurst[]; +extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; +extern const u8 BattleScript_MoveEffectFeint[]; +extern const u8 BattleScript_SpectralThiefSteal[]; +extern const u8 BattleScript_VCreateStatLoss[]; +extern const u8 BattleScript_MoveEffectCoreEnforcer[]; +extern const u8 BattleScript_MoveEffectIncinerate[]; +extern const u8 BattleScript_MoveEffectBugBite[]; +extern const u8 BattleScript_BothCanNoLongerEscape[]; +extern const u8 BattleScript_RemoveFireType[]; +extern const u8 BattleScript_RemoveElectricType[]; +extern const u8 BattleScript_RemoveGenericType[]; +extern const u8 BattleScript_StealthRockActivates[]; +extern const u8 BattleScript_SpikesActivates[]; +extern const u8 BattleScript_SyrupBombActivates[]; +extern const u8 BattleScript_AromaVeilProtectsRet[]; +extern const u8 BattleScript_EffectPsychicNoise[]; +extern const u8 BattleScript_StatUpMsg[]; +extern const u8 BattleScript_SymbiosisActivates[]; +extern const u8 BattleScript_OverworldStatusStarts[]; +extern const u8 BattleScript_OverworldTerrain[]; +extern const u8 BattleScript_ImposterActivates[]; +extern const u8 BattleScript_SwitchInAbilityMsg[]; +extern const u8 BattleScript_SwitchInAbilityMsgRet[]; +extern const u8 BattleScript_ActivateAsOne[]; +extern const u8 BattleScript_PastelVeilActivates[]; +extern const u8 BattleScript_FriskActivates[]; +extern const u8 BattleScript_AttackerAbilityStatRaiseEnd3[]; +extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; +extern const u8 BattleScript_SnowWarningActivatesSnow[]; +extern const u8 BattleScript_SnowWarningActivatesHail[]; +extern const u8 BattleScript_ElectricSurgeActivates[]; +extern const u8 BattleScript_GrassySurgeActivates[]; +extern const u8 BattleScript_MistySurgeActivates[]; +extern const u8 BattleScript_PsychicSurgeActivates[]; +extern const u8 BattleScript_SupersweetSyrupActivates[]; +extern const u8 BattleScript_AnnounceAirLockCloudNine[]; +extern const u8 BattleScript_BattlerAbilityStatRaiseOnSwitchIn[]; +extern const u8 BattleScript_DesolateLandActivates[]; +extern const u8 BattleScript_PrimordialSeaActivates[]; +extern const u8 BattleScript_DeltaStreamActivates[]; +extern const u8 BattleScript_RuinAbilityActivates[]; +extern const u8 BattleScript_SupremeOverlordActivates[]; +extern const u8 BattleScript_CostarActivates[]; +extern const u8 BattleScript_ZeroToHeroActivates[]; +extern const u8 BattleScript_HospitalityActivates[]; +extern const u8 BattleScript_HarvestActivates[]; +extern const u8 BattleScript_MoodyActivates[]; +extern const u8 BattleScript_BadDreamsActivates[]; +extern const u8 BattleScript_SolarPowerActivates[]; +extern const u8 BattleScript_HealerActivates[]; +extern const u8 BattleScript_BallFetch[]; +extern const u8 BattleScript_CudChewActivates[]; +extern const u8 BattleScript_DazzlingProtected[]; +extern const u8 BattleScript_DarkTypePreventsPrankster[]; +extern const u8 BattleScript_GoodAsGoldActivates[]; +extern const u8 BattleScript_MoveStatDrain[]; +extern const u8 BattleScript_MoveStatDrain_PPLoss[]; +extern const u8 BattleScript_TargetAbilityStatRaiseRet[]; +extern const u8 BattleScript_WeakArmorActivates[]; +extern const u8 BattleScript_CursedBodyActivates[]; +extern const u8 BattleScript_MummyActivates[]; +extern const u8 BattleScript_WanderingSpiritActivates[]; +extern const u8 BattleScript_TargetsStatWasMaxedOut[]; +extern const u8 BattleScript_GooeyActivates[]; +extern const u8 BattleScript_DampPreventsAftermath[]; +extern const u8 BattleScript_AftermathDmg[]; +extern const u8 BattleScript_AbilityStatusEffect[]; +extern const u8 BattleScript_IllusionOff[]; +extern const u8 BattleScript_CottonDownActivates[]; +extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; +extern const u8 BattleScript_SandSpitActivates[]; +extern const u8 BattleScript_PerishBodyActivates[]; + +// pokeemerald copy, potential duplicates +extern const u8 BattleScript_SupersweetSyrupActivates[]; +extern const u8 BattleScript_OpportunistCopyStatChange[]; +extern const u8 BattleScript_MirrorHerbCopyStatChange[]; +extern const u8 BattleScript_MirrorHerbCopyStatChangeEnd2[]; +extern const u8 BattleScript_NotAffected[]; +extern const u8 BattleScript_HitFromCritCalc[]; +extern const u8 BattleScript_MoveEnd[]; +extern const u8 BattleScript_MakeMoveMissed[]; +extern const u8 BattleScript_PrintMoveMissed[]; +extern const u8 BattleScript_MoveMissedPause[]; +extern const u8 BattleScript_MoveMissed[]; +extern const u8 BattleScript_FlingFailConsumeItem[]; +extern const u8 BattleScript_FailedFromAtkString[]; +extern const u8 BattleScript_FailedFromAtkCanceler[]; +extern const u8 BattleScript_ButItFailed[]; +extern const u8 BattleScript_StatUp[]; +extern const u8 BattleScript_StatDown[]; +extern const u8 BattleScript_AlreadyAtFullHp[]; +extern const u8 BattleScript_PresentHealTarget[]; +extern const u8 BattleScript_MoveUsedMustRecharge[]; +extern const u8 BattleScript_FaintAttacker[]; +extern const u8 BattleScript_FaintTarget[]; +extern const u8 BattleScript_GiveExp[]; +extern const u8 BattleScript_HandleFaintedMon[]; +extern const u8 BattleScript_LocalTrainerBattleWon[]; +extern const u8 BattleScript_LocalTwoTrainersDefeated[]; +extern const u8 BattleScript_LocalBattleWonLoseTexts[]; +extern const u8 BattleScript_LocalBattleWonReward[]; +extern const u8 BattleScript_PayDayMoneyAndPickUpItems[]; +extern const u8 BattleScript_LocalBattleLost[]; +extern const u8 BattleScript_LocalBattleLostPrintWhiteOut[]; +extern const u8 BattleScript_LocalBattleLostEnd[]; +extern const u8 BattleScript_CheckDomeDrew[]; +extern const u8 BattleScript_FlushMessageBox[]; +extern const u8 BattleScript_LinkBattleWonOrLost[]; +extern const u8 BattleScript_FrontierTrainerBattleWon[]; +extern const u8 BattleScript_SmokeBallEscape[]; +extern const u8 BattleScript_RanAwayUsingMonAbility[]; +extern const u8 BattleScript_GotAwaySafely[]; +extern const u8 BattleScript_WildMonFled[]; +extern const u8 BattleScript_PrintCantRunFromTrainer[]; +extern const u8 BattleScript_PrintFailedToRunString[]; +extern const u8 BattleScript_PrintCantEscapeFromBattle[]; +extern const u8 BattleScript_PrintFullBox[]; +extern const u8 BattleScript_ActionSwitch[]; +extern const u8 BattleScript_Pausex20[]; +extern const u8 BattleScript_LevelUp[]; +extern const u8 BattleScript_RainContinuesOrEnds[]; +extern const u8 BattleScript_SnowContinuesOrEnds[]; +extern const u8 BattleScript_DamagingWeatherContinues[]; +extern const u8 BattleScript_SandStormHailSnowEnds[]; +extern const u8 BattleScript_SunlightContinues[]; +extern const u8 BattleScript_SunlightFaded[]; +extern const u8 BattleScript_OverworldStatusStarts[]; +extern const u8 BattleScript_OverworldWeatherStarts[]; +extern const u8 BattleScript_OverworldTerrain[]; +extern const u8 BattleScript_SideStatusWoreOff[]; +extern const u8 BattleScript_SafeguardProtected[]; +extern const u8 BattleScript_SafeguardEnds[]; +extern const u8 BattleScript_LeechSeedTurnDrain[]; +extern const u8 BattleScript_BideStoringEnergy[]; +extern const u8 BattleScript_BideAttack[]; +extern const u8 BattleScript_BideNoEnergyToAttack[]; +extern const u8 BattleScript_RoarSuccessSwitch[]; +extern const u8 BattleScript_RoarSuccessEndBattle[]; +extern const u8 BattleScript_MistProtected[]; +extern const u8 BattleScript_RageIsBuilding[]; +extern const u8 BattleScript_MoveUsedIsDisabled[]; +extern const u8 BattleScript_SelectingDisabledMove[]; +extern const u8 BattleScript_DisabledNoMore[]; +extern const u8 BattleScript_SelectingDisabledMoveInPalace[]; +extern const u8 BattleScript_SelectingUnusableMoveInPalace[]; +extern const u8 BattleScript_EncoredNoMore[]; +extern const u8 BattleScript_DestinyBondTakesLife[]; +extern const u8 BattleScript_DmgHazardsOnAttacker[]; +extern const u8 BattleScript_DmgHazardsOnTarget[]; +extern const u8 BattleScript_DmgHazardsOnFaintedBattler[]; +extern const u8 BattleScript_PerishSongTakesLife[]; +extern const u8 BattleScript_PerishSongCountGoesDown[]; +extern const u8 BattleScript_AllStatsUp[]; +extern const u8 BattleScript_WrapFree[]; +extern const u8 BattleScript_LeechSeedFree[]; +extern const u8 BattleScript_SpikesFree[]; +extern const u8 BattleScript_MonTookFutureAttack[]; +extern const u8 BattleScript_NoMovesLeft[]; +extern const u8 BattleScript_SelectingMoveWithNoPP[]; +extern const u8 BattleScript_NoPPForMove[]; +extern const u8 BattleScript_SelectingTormentedMove[]; +extern const u8 BattleScript_MoveUsedIsTormented[]; +extern const u8 BattleScript_SelectingTormentedMoveInPalace[]; +extern const u8 BattleScript_SelectingNotAllowedMoveTaunt[]; +extern const u8 BattleScript_MoveUsedIsTaunted[]; +extern const u8 BattleScript_SelectingNotAllowedMoveTauntInPalace[]; +extern const u8 BattleScript_WishComesTrue[]; +extern const u8 BattleScript_IngrainTurnHeal[]; +extern const u8 BattleScript_AtkDefDown[]; +extern const u8 BattleScript_DefSpDefDown[]; +extern const u8 BattleScript_KnockedOff[]; +extern const u8 BattleScript_MoveUsedIsImprisoned[]; +extern const u8 BattleScript_SelectingImprisonedMove[]; +extern const u8 BattleScript_SelectingImprisonedMoveInPalace[]; +extern const u8 BattleScript_GrudgeTakesPp[]; +extern const u8 BattleScript_MagicCoatBounce[]; +extern const u8 BattleScript_MagicCoatBouncePrankster[]; +extern const u8 BattleScript_SnatchedMove[]; +extern const u8 BattleScript_EnduredMsg[]; +extern const u8 BattleScript_OneHitKOMsg[]; +extern const u8 BattleScript_SAtkDown2[]; +extern const u8 BattleScript_FocusPunchSetUp[]; +extern const u8 BattleScript_MoveUsedIsAsleep[]; +extern const u8 BattleScript_MoveUsedWokeUp[]; +extern const u8 BattleScript_MonWokeUpInUproar[]; +extern const u8 BattleScript_PoisonTurnDmg[]; +extern const u8 BattleScript_BurnTurnDmg[]; +extern const u8 BattleScript_FrostbiteTurnDmg[]; +extern const u8 BattleScript_MoveUsedIsFrozen[]; +extern const u8 BattleScript_MoveUsedUnfroze[]; +extern const u8 BattleScript_MoveUsedUnfrostbite[]; +extern const u8 BattleScript_DefrostedViaFireMove[]; +extern const u8 BattleScript_FrostbiteHealedViaFireMove[]; +extern const u8 BattleScript_MoveUsedIsParalyzed[]; +extern const u8 BattleScript_MoveUsedFlinched[]; +extern const u8 BattleScript_PrintUproarOverTurns[]; +extern const u8 BattleScript_ThrashConfuses[]; +extern const u8 BattleScript_MoveUsedIsConfused[]; +extern const u8 BattleScript_MoveUsedIsConfusedNoMore[]; +extern const u8 BattleScript_PrintPayDayMoneyString[]; +extern const u8 BattleScript_WrapTurnDmg[]; +extern const u8 BattleScript_WrapEnds[]; +extern const u8 BattleScript_MoveUsedIsInLove[]; +extern const u8 BattleScript_MoveUsedIsInLoveCantAttack[]; +extern const u8 BattleScript_NightmareTurnDmg[]; +extern const u8 BattleScript_CurseTurnDmg[]; +extern const u8 BattleScript_TargetPRLZHeal[]; +extern const u8 BattleScript_TargetWokeUp[]; +extern const u8 BattleScript_TargetBurnHeal[]; +extern const u8 BattleScript_MoveEffectSleep[]; +extern const u8 BattleScript_YawnMakesAsleep[]; +extern const u8 BattleScript_MoveEffectPoison[]; +extern const u8 BattleScript_MoveEffectBurn[]; +extern const u8 BattleScript_MoveEffectFrostbite[]; +extern const u8 BattleScript_MoveEffectFreeze[]; +extern const u8 BattleScript_MoveEffectParalysis[]; +extern const u8 BattleScript_MoveEffectUproar[]; +extern const u8 BattleScript_MoveEffectToxic[]; +extern const u8 BattleScript_MoveEffectPayDay[]; +extern const u8 BattleScript_MoveEffectWrap[]; +extern const u8 BattleScript_MoveEffectConfusion[]; +extern const u8 BattleScript_MoveEffectRecoil[]; +extern const u8 BattleScript_DoRecoil33[]; +extern const u8 BattleScript_Recoil33End[]; +extern const u8 BattleScript_ItemSteal[]; +extern const u8 BattleScript_DrizzleActivates[]; +extern const u8 BattleScript_SpeedBoostActivates[]; +extern const u8 BattleScript_TraceActivatesEnd3[]; +extern const u8 BattleScript_RainDishActivates[]; +extern const u8 BattleScript_SandstreamActivates[]; +extern const u8 BattleScript_ShedSkinActivates[]; +extern const u8 BattleScript_DroughtActivates[]; +extern const u8 BattleScript_TookAttack[]; +extern const u8 BattleScript_SturdyPreventsOHKO[]; +extern const u8 BattleScript_DampStopsExplosion[]; +extern const u8 BattleScript_MoveHPDrain_PPLoss[]; +extern const u8 BattleScript_MoveHPDrain[]; +extern const u8 BattleScript_MonMadeMoveUseless_PPLoss[]; +extern const u8 BattleScript_MonMadeMoveUseless[]; +extern const u8 BattleScript_FlashFireBoost_PPLoss[]; +extern const u8 BattleScript_FlashFireBoost[]; +extern const u8 BattleScript_AbilityNoStatLoss[]; +extern const u8 BattleScript_ItemNoStatLoss[]; +extern const u8 BattleScript_BRNPrevention[]; +extern const u8 BattleScript_PRLZPrevention[]; +extern const u8 BattleScript_PSNPrevention[]; +extern const u8 BattleScript_ObliviousPreventsAttraction[]; +extern const u8 BattleScript_FlinchPrevention[]; +extern const u8 BattleScript_OwnTempoPrevents[]; +extern const u8 BattleScript_SoundproofProtected[]; +extern const u8 BattleScript_AbilityNoSpecificStatLoss[]; +extern const u8 BattleScript_StickyHoldActivates[]; +extern const u8 BattleScript_ColorChangeActivates[]; +extern const u8 BattleScript_RoughSkinActivates[]; +extern const u8 BattleScript_CuteCharmActivates[]; +extern const u8 BattleScript_AbilityStatusEffect[]; +extern const u8 BattleScript_SynchronizeActivates[]; +extern const u8 BattleScript_NoItemSteal[]; +extern const u8 BattleScript_AbilityCuredStatus[]; +extern const u8 BattleScript_IgnoresWhileAsleep[]; +extern const u8 BattleScript_IgnoresAndUsesRandomMove[]; +extern const u8 BattleScript_MoveUsedLoafingAround[]; +extern const u8 BattleScript_TruantLoafingAround[]; +extern const u8 BattleScript_IgnoresAndFallsAsleep[]; +extern const u8 BattleScript_IgnoresAndHitsItself[]; +extern const u8 BattleScript_SubstituteFade[]; +extern const u8 BattleScript_BerryCurePrlzEnd2[]; +extern const u8 BattleScript_BerryCureParRet[]; +extern const u8 BattleScript_BerryCurePsnEnd2[]; +extern const u8 BattleScript_BerryCurePsnRet[]; +extern const u8 BattleScript_BerryCureBrnEnd2[]; +extern const u8 BattleScript_BerryCureBrnRet[]; +extern const u8 BattleScript_BerryCureFrzEnd2[]; +extern const u8 BattleScript_BerryCureFrzRet[]; +extern const u8 BattleScript_BerryCureFrbEnd2[]; +extern const u8 BattleScript_BerryCureFrbRet[]; +extern const u8 BattleScript_BerryCureSlpEnd2[]; +extern const u8 BattleScript_BerryCureSlpRet[]; +extern const u8 BattleScript_BerryCureConfusionEnd2[]; +extern const u8 BattleScript_BerryCureConfusionRet[]; +extern const u8 BattleScript_BerryCureChosenStatusEnd2[]; +extern const u8 BattleScript_BerryCureChosenStatusRet[]; +extern const u8 BattleScript_WhiteHerbEnd2[]; +extern const u8 BattleScript_WhiteHerbRet[]; +extern const u8 BattleScript_ItemHealHP_RemoveItemRet[]; +extern const u8 BattleScript_ItemHealHP_RemoveItemEnd2[]; +extern const u8 BattleScript_BerryPPHealEnd2[]; +extern const u8 BattleScript_BerryPPHealRet[]; +extern const u8 BattleScript_ItemHealHP_End2[]; +extern const u8 BattleScript_ItemHealHP_Ret[]; +extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItem[]; +extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItemInPalace[]; +extern const u8 BattleScript_HangedOnMsg[]; +extern const u8 BattleScript_BerryConfuseHealEnd2[]; +extern const u8 BattleScript_BerryConfuseHealRet[]; +extern const u8 BattleScript_BerryStatRaiseEnd2[]; +extern const u8 BattleScript_BerryStatRaiseRet[]; +extern const u8 BattleScript_BerryFocusEnergyRet[]; +extern const u8 BattleScript_BerryFocusEnergyEnd2[]; +extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[]; +extern const u8 BattleScript_ArenaTurnBeginning[]; +extern const u8 BattleScript_PalacePrintFlavorText[]; +extern const u8 BattleScript_ArenaDoJudgment[]; +extern const u8 BattleScript_FrontierLinkBattleLost[]; +extern const u8 BattleScript_AskIfWantsToForfeitMatch[]; +extern const u8 BattleScript_PrintPlayerForfeited[]; +extern const u8 BattleScript_PrintPlayerForfeitedLinkBattle[]; +extern const u8 BattleScript_BallThrow[]; +extern const u8 BattleScript_BallThrowByWally[]; +extern const u8 BattleScript_SafariBallThrow[]; +extern const u8 BattleScript_WallyBallThrow[]; +extern const u8 BattleScript_ShakeBallThrow[]; +extern const u8 BattleScript_TrainerBallBlock[]; +extern const u8 BattleScript_RunByUsingItem[]; +extern const u8 BattleScript_ActionWatchesCarefully[]; +extern const u8 BattleScript_ActionGetNear[]; +extern const u8 BattleScript_ActionThrowPokeblock[]; +extern const u8 BattleScript_EmbargoEndTurn[]; +extern const u8 BattleScript_TelekinesisEndTurn[]; +extern const u8 BattleScript_BufferEndTurn[]; +extern const u8 BattleScript_AquaRingHeal[]; +extern const u8 BattleScript_AuroraVeilEnds[]; +extern const u8 BattleScript_LuckyChantEnds[]; +extern const u8 BattleScript_TailwindEnds[]; +extern const u8 BattleScript_TrickRoomEnds[]; +extern const u8 BattleScript_WonderRoomEnds[]; +extern const u8 BattleScript_MagicRoomEnds[]; +extern const u8 BattleScript_TerrainEnds[]; +extern const u8 BattleScript_TerrainEnds_Ret[]; +extern const u8 BattleScript_MudSportEnds[]; +extern const u8 BattleScript_WaterSportEnds[]; +extern const u8 BattleScript_SturdiedMsg[]; +extern const u8 BattleScript_GravityEnds[]; +extern const u8 BattleScript_MoveStatDrain[]; +extern const u8 BattleScript_MoveStatDrain_PPLoss[]; +extern const u8 BattleScript_TargetsStatWasMaxedOut[]; +extern const u8 BattleScript_AttackerAbilityStatRaise[]; +extern const u8 BattleScript_AttackerAbilityStatRaiseEnd3[]; +extern const u8 BattleScript_PoisonHealActivates[]; +extern const u8 BattleScript_BadDreamsActivates[]; +extern const u8 BattleScript_SwitchInAbilityMsg[]; +extern const u8 BattleScript_SwitchInAbilityMsgRet[]; +extern const u8 BattleScript_ToxicSpikesPoisoned[]; +extern const u8 BattleScript_ToxicSpikesAbsorbed[]; +extern const u8 BattleScript_StickyWebOnSwitchIn[]; +extern const u8 BattleScript_SolarPowerActivates[]; +extern const u8 BattleScript_CursedBodyActivates[]; +extern const u8 BattleScript_MummyActivates[]; +extern const u8 BattleScript_WeakArmorActivates[]; +extern const u8 BattleScript_FellStingerRaisesStat[]; +extern const u8 BattleScript_SnowWarningActivatesHail[]; +extern const u8 BattleScript_SnowWarningActivatesSnow[]; +extern const u8 BattleScript_HarvestActivates[]; +extern const u8 BattleScript_ImposterActivates[]; +extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVest[]; +extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVestInPalace[]; +extern const u8 BattleScript_SelectingNotAllowedPlaceholder[]; +extern const u8 BattleScript_SelectingNotAllowedPlaceholderInPalace[]; +extern const u8 BattleScript_SelectingNotAllowedMoveGravity[]; +extern const u8 BattleScript_MoveUsedGravityPrevents[]; +extern const u8 BattleScript_SelectingNotAllowedMoveGravityInPalace[]; +extern const u8 BattleScript_SelectingNotAllowedMoveHealBlock[]; +extern const u8 BattleScript_MoveUsedHealBlockPrevents[]; +extern const u8 BattleScript_SelectingNotAllowedMoveHealBlockInPalace[]; +extern const u8 BattleScript_ToxicSpikesFree[]; +extern const u8 BattleScript_StickyWebFree[]; +extern const u8 BattleScript_StealthRockFree[]; +extern const u8 BattleScript_SpikesDefog[]; +extern const u8 BattleScript_ToxicSpikesDefog[]; +extern const u8 BattleScript_StickyWebDefog[]; +extern const u8 BattleScript_StealthRockDefog[]; +extern const u8 BattleScript_MegaEvolution[]; +extern const u8 BattleScript_WishMegaEvolution[]; +extern const u8 BattleScript_MoveEffectClearSmog[]; +extern const u8 BattleScript_SideStatusWoreOffReturn[]; +extern const u8 BattleScript_MoveEffectSmackDown[]; +extern const u8 BattleScript_MoveEffectFlameBurst[]; +extern const u8 BattleScript_TrainerASlideMsgRet[]; +extern const u8 BattleScript_TrainerASlideMsgEnd2[]; +extern const u8 BattleScript_TrainerBSlideMsgRet[]; +extern const u8 BattleScript_TrainerBSlideMsgEnd2[]; +extern const u8 BattleScript_MoveEffectFeint[]; +extern const u8 BattleScript_ProteanActivates[]; +extern const u8 BattleScript_DazzlingProtected[]; +extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; +extern const u8 BattleScript_MoveUsedPowder[]; +extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[]; +extern const u8 BattleScript_SelectingNotAllowedStuffCheeksInPalace[]; +extern const u8 BattleScript_SelectingNotAllowedBelch[]; +extern const u8 BattleScript_SelectingNotAllowedBelchInPalace[]; +extern const u8 BattleScript_PsychicSurgeActivates[]; +extern const u8 BattleScript_GrassySurgeActivates[]; +extern const u8 BattleScript_MistySurgeActivates[]; +extern const u8 BattleScript_ElectricSurgeActivates[]; +extern const u8 BattleScript_SpectralThiefSteal[]; +extern const u8 BattleScript_StatUpMsg[]; +extern const u8 BattleScript_AbilityRaisesDefenderStat[]; +extern const u8 BattleScript_PowderMoveNoEffect[]; +extern const u8 BattleScript_GrassyTerrainHeals[]; +extern const u8 BattleScript_VCreateStatLoss[]; +extern const u8 BattleScript_SpikyShieldEffect[]; +extern const u8 BattleScript_KingsShieldEffect[]; +extern const u8 BattleScript_BanefulBunkerEffect[]; +extern const u8 BattleScript_FlowerVeilProtectsRet[]; +extern const u8 BattleScript_SweetVeilProtectsRet[]; +extern const u8 BattleScript_MoveEffectCoreEnforcer[]; +extern const u8 BattleScript_SelectingNotAllowedMoveThroatChop[]; +extern const u8 BattleScript_MoveUsedIsThroatChopPrevented[]; +extern const u8 BattleScript_SelectingNotAllowedMoveThroatChopInPalace[]; +extern const u8 BattleScript_ThroatChopEndTurn[]; +extern const u8 BattleScript_GemActivates[]; +extern const u8 BattleScript_BerryReduceDmg[]; +extern const u8 BattleScript_PrintBerryReduceString[]; +extern const u8 BattleScript_WeaknessPolicy[]; +extern const u8 BattleScript_TargetItemStatRaise[]; +extern const u8 BattleScript_RockyHelmetActivates[]; +extern const u8 BattleScript_ItemHurtEnd2[]; +extern const u8 BattleScript_AirBaloonMsgIn[]; +extern const u8 BattleScript_AirBaloonMsgPop[]; +extern const u8 BattleScript_ItemHurtRet[]; +extern const u8 BattleScript_ToxicOrb[]; +extern const u8 BattleScript_FlameOrb[]; +extern const u8 BattleScript_MoveEffectIncinerate[]; +extern const u8 BattleScript_MoveEffectBugBite[]; +extern const u8 BattleScript_IllusionOff[]; +extern const u8 BattleScript_DancerActivates[]; +extern const u8 BattleScript_AttackerFormChange[]; +extern const u8 BattleScript_AttackerFormChangeEnd3[]; +extern const u8 BattleScript_TargetFormChange[]; +extern const u8 BattleScript_AnticipationActivates[]; +extern const u8 BattleScript_SlowStartEnds[]; +extern const u8 BattleScript_HealerActivates[]; +extern const u8 BattleScript_ScriptingAbilityStatRaise[]; +extern const u8 BattleScript_ReceiverActivates[]; +extern const u8 BattleScript_FriskMsg[]; +extern const u8 BattleScript_FriskMsgWithPopup[]; +extern const u8 BattleScript_MoodyActivates[]; +extern const u8 BattleScript_EmergencyExit[]; +extern const u8 BattleScript_EmergencyExitNoPopUp[]; +extern const u8 BattleScript_EmergencyExitWild[]; +extern const u8 BattleScript_EmergencyExitWildNoPopUp[]; +extern const u8 BattleScript_CheekPouchActivates[]; +extern const u8 BattleScript_TotemVar[]; +extern const u8 BattleScript_TotemFlaredToLife[]; +extern const u8 BattleScript_AnnounceAirLockCloudNine[]; +extern const u8 BattleScript_BattlerAbilityStatRaiseOnSwitchIn[]; +extern const u8 BattleScript_CottonDownActivates[]; +extern const u8 BattleScript_BallFetch[]; +extern const u8 BattleScript_SandSpitActivates[]; +extern const u8 BattleScript_PerishBodyActivates[]; +extern const u8 BattleScript_ActivateAsOne[]; +extern const u8 BattleScript_RaiseStatOnFaintingTarget[]; +extern const u8 BattleScript_QuickClawActivation[]; +extern const u8 BattleScript_QuickDrawActivation[]; +extern const u8 BattleScript_CustapBerryActivation[]; +extern const u8 BattleScript_MicleBerryActivateEnd2[]; +extern const u8 BattleScript_MicleBerryActivateRet[]; +extern const u8 BattleScript_JabocaRowapBerryActivates[]; +extern const u8 BattleScript_NotAffectedAbilityPopUp[]; +extern const u8 BattleScript_BattlerShookOffTaunt[]; +extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; +extern const u8 BattleScript_Pickpocket[]; +extern const u8 BattleScript_StickyBarbTransfer[]; +extern const u8 BattleScript_AttackerItemStatRaise[]; +extern const u8 BattleScript_RedCardActivates[]; +extern const u8 BattleScript_EjectButtonActivates[]; +extern const u8 BattleScript_EjectPackActivate_Ret[]; +extern const u8 BattleScript_EjectPackActivate_End2[]; +extern const u8 BattleScript_EjectPackActivates[]; +extern const u8 BattleScript_MentalHerbCureRet[]; +extern const u8 BattleScript_MentalHerbCureEnd2[]; +extern const u8 BattleScript_TerrainPreventsEnd2[]; +extern const u8 BattleScript_MistyTerrainPrevents[]; +extern const u8 BattleScript_ElectricTerrainPrevents[]; +extern const u8 BattleScript_DarkTypePreventsPrankster[]; +extern const u8 BattleScript_GulpMissileGorging[]; +extern const u8 BattleScript_GulpMissileGulping[]; +extern const u8 BattleScript_GulpMissileFormChange[]; +extern const u8 BattleScript_BattleBondActivatesOnMoveEndAttacker[]; +extern const u8 BattleScript_DesolateLandActivates[]; +extern const u8 BattleScript_PrimordialSeaActivates[]; +extern const u8 BattleScript_DeltaStreamActivates[]; +extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[]; +extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; +extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; +extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; +extern const u8 BattleScript_PrimalReversion[]; +extern const u8 BattleScript_PrimalReversionRestoreAttacker[]; +extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; +extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; +extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace[]; +extern const u8 BattleScript_WanderingSpiritActivates[]; +extern const u8 BattleScript_MirrorArmorReflect[]; +extern const u8 BattleScript_GooeyActivates[]; +extern const u8 BattleScript_PastelVeilActivates[]; +extern const u8 BattleScript_MimicryActivatesEnd3[]; +extern const u8 BattleScript_ApplyMimicry[]; +extern const u8 BattleScript_AttackerFormChangeEnd3NoPopup[]; +extern const u8 BattleScript_AttackerFormChangeMoveEffect[]; +extern const u8 BattleScript_BothCanNoLongerEscape[]; +extern const u8 BattleScript_OctolockEndTurn[]; +extern const u8 BattleScript_NeutralizingGasExits[]; +extern const u8 BattleScript_MagicianActivates[]; +extern const u8 BattleScript_BeakBlastSetUp[]; +extern const u8 BattleScript_BeakBlastBurn[]; +extern const u8 BattleScript_DefDownSpeedUp[]; +extern const u8 BattleScript_AffectionBasedStatusHeal[]; +extern const u8 BattleScript_AffectionBasedEndurance[]; +extern const u8 BattleScript_SymbiosisActivates[]; +extern const u8 BattleScript_MultiHitPrintStrings[]; +extern const u8 BattleScript_RemoveFireType[]; +extern const u8 BattleScript_TargetAbilityStatRaiseRet[]; +extern const u8 BattleScript_RemoveElectricType[]; +extern const u8 BattleScript_SeedSowerActivates[]; +extern const u8 BattleScript_AngerShellActivates[]; +extern const u8 BattleScript_WellBakedBodyActivates[]; +extern const u8 BattleScript_WindRiderActivatesMoveEnd[]; +extern const u8 BattleScript_WindPowerActivates[]; +extern const u8 BattleScript_WindPowerActivatesEnd2[]; +extern const u8 BattleScript_ProtosynthesisActivates[]; +extern const u8 BattleScript_QuarkDriveActivates[]; +extern const u8 BattleScript_GoodAsGoldActivates[]; +extern const u8 BattleScript_RuinAbilityActivates[]; +extern const u8 BattleScript_CudChewActivates[]; +extern const u8 BattleScript_SupremeOverlordActivates[]; +extern const u8 BattleScript_CostarActivates[]; +extern const u8 BattleScript_ZeroToHeroActivates[]; +extern const u8 BattleScript_HospitalityActivates[]; +extern const u8 BattleScript_ToxicDebrisActivates[]; +extern const u8 BattleScript_EarthEaterActivates[]; +extern const u8 BattleScript_MimicryActivates_End3[]; +extern const u8 BattleScript_IceFaceNullsDamage[]; +extern const u8 BattleScript_BattlerFormChangeWithStringEnd3[]; +extern const u8 BattleScript_DampPreventsAftermath[]; +extern const u8 BattleScript_HealingWishActivates[]; +extern const u8 BattleScript_LunarDanceActivates[]; +extern const u8 BattleScript_ShellTrapSetUp[]; +extern const u8 BattleScript_StealthRockActivates[]; +extern const u8 BattleScript_CouldntFullyProtect[]; +extern const u8 BattleScript_MoveEffectStockpileWoreOff[]; +extern const u8 BattleScript_StealthRockActivates[]; +extern const u8 BattleScript_SpikesActivates[]; +extern const u8 BattleScript_BerserkGeneRet[]; +extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[]; +extern const u8 BattleScript_DefDown[]; +extern const u8 BattleScript_UltraBurst[]; +extern const u8 BattleScript_SelectingNotAllowedCurrentMove[]; +extern const u8 BattleScript_SelectingNotAllowedCurrentMoveInPalace[]; +extern const u8 BattleScript_SaltCureExtraDamage[]; +extern const u8 BattleScript_SyrupBombEndTurn[]; +extern const u8 BattleScript_SyrupBombActivates[]; +extern const u8 BattleScript_EffectCombinedPledge_Water[]; +extern const u8 BattleScript_EffectCombinedPledge_Fire[]; +extern const u8 BattleScript_EffectCombinedPledge_Grass[]; +extern const u8 BattleScript_TheRainbowDisappeared[]; +extern const u8 BattleScript_HurtByTheSeaOfFire[]; +extern const u8 BattleScript_TheSeaOfFireDisappeared[]; +extern const u8 BattleScript_TheSwampDisappeared[]; +extern const u8 BattleScript_ItemRestoreHP_Party[]; +extern const u8 BattleScript_EffectPsychicNoise[]; +extern const u8 BattleScript_AromaVeilProtectsRet[]; + +// zmoves +extern const u8 BattleScript_ZMoveActivateDamaging[]; +extern const u8 BattleScript_ZMoveActivateStatus[]; +extern const u8 BattleScript_ZEffectPrintString[]; +extern const u8 BattleScript_RecoverHPZMove[]; +extern const u8 BattleScript_StatUpZMove[]; +extern const u8 BattleScript_HealReplacementZMove[]; +extern const u8 BattleScript_EffectExtremeEvoboost[]; + +// max moves +extern const u8 BattleScript_EffectRaiseStatAllies[]; +extern const u8 BattleScript_EffectLowerStatFoes[]; +extern const u8 BattleScript_EffectSetWeather[]; +extern const u8 BattleScript_EffectSetTerrain[]; +extern const u8 BattleScript_EffectStonesurge[]; +extern const u8 BattleScript_EffectSteelsurge[]; +extern const u8 BattleScript_SteelsurgeFree[]; +extern const u8 BattleScript_SteelsurgeDefog[]; +extern const u8 BattleScript_DamageNonTypesStarts[]; +extern const u8 BattleScript_DamageNonTypesContinues[]; +extern const u8 BattleScript_DefogTryHazards[]; +extern const u8 BattleScript_EffectAuroraVeilSuccess[]; +extern const u8 BattleScript_EffectGravitySuccess[]; +extern const u8 BattleScript_EffectYawnSuccess[]; +extern const u8 BattleScript_EffectTryReducePP[]; +extern const u8 BattleScript_EffectStatus1Foes[]; +extern const u8 BattleScript_EffectStatus2Foes[]; +extern const u8 BattleScript_TormentEnds[]; +extern const u8 BattleScript_EffectRaiseCritAlliesAnim[]; +extern const u8 BattleScript_EffectHealOneSixthAllies[]; +extern const u8 BattleScript_EffectCureStatusAllies[]; +extern const u8 BattleScript_EffectRecycleBerriesAllies[]; +extern const u8 BattleScript_RemoveGenericType[]; + +// dynamax and max raids +extern const u8 BattleScript_DynamaxBegins[]; +extern const u8 BattleScript_DynamaxEnds[]; +extern const u8 BattleScript_MoveBlockedByDynamax[]; + +// Battle move scripts +extern const u8 BattleScript_EffectSleep[]; +extern const u8 BattleScript_EffectAbsorb[]; +extern const u8 BattleScript_EffectExplosion[]; +extern const u8 BattleScript_EffectDreamEater[]; +extern const u8 BattleScript_EffectMirrorMove[]; +extern const u8 BattleScript_EffectAttackUp[]; +extern const u8 BattleScript_EffectDefenseUp[]; +extern const u8 BattleScript_EffectSpeedUp[]; +extern const u8 BattleScript_EffectSpecialAttackUp[]; +extern const u8 BattleScript_EffectSpecialDefenseUp[]; +extern const u8 BattleScript_EffectAccuracyUp[]; +extern const u8 BattleScript_EffectEvasionUp[]; +extern const u8 BattleScript_EffectSpecialAttackUp3[]; +extern const u8 BattleScript_EffectAttackDown[]; +extern const u8 BattleScript_EffectDefenseDown[]; +extern const u8 BattleScript_EffectSpeedDown[]; +extern const u8 BattleScript_EffectSpecialAttackDown[]; +extern const u8 BattleScript_EffectSpecialDefenseDown[]; +extern const u8 BattleScript_EffectAccuracyDown[]; +extern const u8 BattleScript_EffectEvasionDown[]; +extern const u8 BattleScript_EffectHaze[]; +extern const u8 BattleScript_EffectBide[]; +extern const u8 BattleScript_EffectRoar[]; +extern const u8 BattleScript_EffectHit[]; +extern const u8 BattleScript_EffectConversion[]; +extern const u8 BattleScript_EffectRestoreHp[]; +extern const u8 BattleScript_EffectToxic[]; +extern const u8 BattleScript_EffectLightScreen[]; +extern const u8 BattleScript_EffectRest[]; +extern const u8 BattleScript_EffectOHKO[]; +extern const u8 BattleScript_EffectSuperFang[]; +extern const u8 BattleScript_EffectFixedDamageArg[]; +extern const u8 BattleScript_EffectHealBlock[]; +extern const u8 BattleScript_EffectRecoilIfMiss[]; +extern const u8 BattleScript_EffectMist[]; +extern const u8 BattleScript_EffectFocusEnergy[]; +extern const u8 BattleScript_EffectConfuse[]; +extern const u8 BattleScript_EffectAttackUp2[]; +extern const u8 BattleScript_EffectDefenseUp2[]; +extern const u8 BattleScript_EffectSpeedUp2[]; +extern const u8 BattleScript_EffectSpecialAttackUp2[]; +extern const u8 BattleScript_EffectSpecialDefenseUp2[]; +extern const u8 BattleScript_EffectAccuracyUp2[]; +extern const u8 BattleScript_EffectEvasionUp2[]; +extern const u8 BattleScript_EffectTransform[]; +extern const u8 BattleScript_EffectAttackDown2[]; +extern const u8 BattleScript_EffectDefenseDown2[]; +extern const u8 BattleScript_EffectSpeedDown2[]; +extern const u8 BattleScript_EffectSpecialAttackDown2[]; +extern const u8 BattleScript_EffectSpecialDefenseDown2[]; +extern const u8 BattleScript_EffectAccuracyDown2[]; +extern const u8 BattleScript_EffectEvasionDown2[]; +extern const u8 BattleScript_EffectReflect[]; +extern const u8 BattleScript_EffectPoison[]; +extern const u8 BattleScript_EffectParalyze[]; +extern const u8 BattleScript_EffectTwoTurnsAttack[]; +extern const u8 BattleScript_EffectSubstitute[]; +extern const u8 BattleScript_EffectRage[]; +extern const u8 BattleScript_EffectMimic[]; +extern const u8 BattleScript_EffectMetronome[]; +extern const u8 BattleScript_EffectLeechSeed[]; +extern const u8 BattleScript_EffectDoNothing[]; +extern const u8 BattleScript_EffectDisable[]; +extern const u8 BattleScript_EffectLevelDamage[]; +extern const u8 BattleScript_EffectPsywave[]; +extern const u8 BattleScript_EffectCounter[]; +extern const u8 BattleScript_EffectEncore[]; +extern const u8 BattleScript_EffectPainSplit[]; +extern const u8 BattleScript_EffectSnore[]; +extern const u8 BattleScript_EffectConversion2[]; +extern const u8 BattleScript_EffectLockOn[]; +extern const u8 BattleScript_EffectSketch[]; +extern const u8 BattleScript_EffectSleepTalk[]; +extern const u8 BattleScript_EffectDestinyBond[]; +extern const u8 BattleScript_EffectSpite[]; +extern const u8 BattleScript_EffectHealBell[]; +extern const u8 BattleScript_EffectMeanLook[]; +extern const u8 BattleScript_EffectNightmare[]; +extern const u8 BattleScript_EffectMinimize[]; +extern const u8 BattleScript_EffectCurse[]; +extern const u8 BattleScript_EffectHealingWish[]; +extern const u8 BattleScript_EffectProtect[]; +extern const u8 BattleScript_EffectSpikes[]; +extern const u8 BattleScript_EffectForesight[]; +extern const u8 BattleScript_EffectPerishSong[]; +extern const u8 BattleScript_EffectSandstorm[]; +extern const u8 BattleScript_EffectEndure[]; +extern const u8 BattleScript_EffectRollout[]; +extern const u8 BattleScript_EffectSwagger[]; +extern const u8 BattleScript_EffectFuryCutter[]; +extern const u8 BattleScript_EffectAttract[]; +extern const u8 BattleScript_EffectPresent[]; +extern const u8 BattleScript_EffectSafeguard[]; +extern const u8 BattleScript_EffectMagnitude[]; +extern const u8 BattleScript_EffectBatonPass[]; +extern const u8 BattleScript_EffectCaptivate[]; +extern const u8 BattleScript_EffectMorningSun[]; +extern const u8 BattleScript_EffectSynthesis[]; +extern const u8 BattleScript_EffectMoonlight[]; +extern const u8 BattleScript_EffectRainDance[]; +extern const u8 BattleScript_EffectSunnyDay[]; +extern const u8 BattleScript_EffectBellyDrum[]; +extern const u8 BattleScript_EffectPsychUp[]; +extern const u8 BattleScript_EffectMirrorCoat[]; +extern const u8 BattleScript_EffectFutureSight[]; +extern const u8 BattleScript_EffectGust[]; +extern const u8 BattleScript_EffectTeleport[]; +extern const u8 BattleScript_EffectBeatUp[]; +extern const u8 BattleScript_EffectDefenseCurl[]; +extern const u8 BattleScript_EffectSoftboiled[]; +extern const u8 BattleScript_EffectFirstTurnOnly[]; +extern const u8 BattleScript_EffectUproar[]; +extern const u8 BattleScript_EffectStockpile[]; +extern const u8 BattleScript_EffectSpitUp[]; +extern const u8 BattleScript_EffectSwallow[]; +extern const u8 BattleScript_EffectWorrySeed[]; +extern const u8 BattleScript_EffectHail[]; +extern const u8 BattleScript_EffectTorment[]; +extern const u8 BattleScript_EffectFlatter[]; +extern const u8 BattleScript_EffectWillOWisp[]; +extern const u8 BattleScript_EffectMemento[]; +extern const u8 BattleScript_EffectFocusPunch[]; +extern const u8 BattleScript_EffectFollowMe[]; +extern const u8 BattleScript_EffectNaturePower[]; +extern const u8 BattleScript_EffectTaunt[]; +extern const u8 BattleScript_EffectHelpingHand[]; +extern const u8 BattleScript_EffectRolePlay[]; +extern const u8 BattleScript_EffectWish[]; +extern const u8 BattleScript_EffectAssist[]; +extern const u8 BattleScript_EffectIngrain[]; +extern const u8 BattleScript_EffectMagicCoat[]; +extern const u8 BattleScript_EffectRecycle[]; +extern const u8 BattleScript_EffectBrickBreak[]; +extern const u8 BattleScript_EffectEndeavor[]; +extern const u8 BattleScript_EffectSkillSwap[]; +extern const u8 BattleScript_EffectImprison[]; +extern const u8 BattleScript_EffectRefresh[]; +extern const u8 BattleScript_EffectGrudge[]; +extern const u8 BattleScript_EffectSnatch[]; +extern const u8 BattleScript_EffectHitEscape[]; +extern const u8 BattleScript_EffectMudSport[]; +extern const u8 BattleScript_EffectTickle[]; +extern const u8 BattleScript_EffectCosmicPower[]; +extern const u8 BattleScript_EffectSkyUppercut[]; +extern const u8 BattleScript_EffectBulkUp[]; +extern const u8 BattleScript_EffectPlaceholder[]; +extern const u8 BattleScript_EffectWaterSport[]; +extern const u8 BattleScript_EffectCalmMind[]; +extern const u8 BattleScript_EffectDragonDance[]; +extern const u8 BattleScript_EffectCamouflage[]; +extern const u8 BattleScript_EffectPledge[]; +extern const u8 BattleScript_EffectFling[]; +extern const u8 BattleScript_EffectNaturalGift[]; +extern const u8 BattleScript_EffectRoost[]; +extern const u8 BattleScript_EffectGravity[]; +extern const u8 BattleScript_EffectMircleEye[]; +extern const u8 BattleScript_EffectTailwind[]; +extern const u8 BattleScript_EffectEmbargo[]; +extern const u8 BattleScript_EffectAquaRing[]; +extern const u8 BattleScript_EffectTrickRoom[]; +extern const u8 BattleScript_EffectWonderRoom[]; +extern const u8 BattleScript_EffectMagicRoom[]; +extern const u8 BattleScript_EffectMagnetRise[]; +extern const u8 BattleScript_EffectToxicSpikes[]; +extern const u8 BattleScript_EffectGastroAcid[]; +extern const u8 BattleScript_EffectStealthRock[]; +extern const u8 BattleScript_EffectTelekinesis[]; +extern const u8 BattleScript_EffectPowerSwap[]; +extern const u8 BattleScript_EffectGuardSwap[]; +extern const u8 BattleScript_EffectHeartSwap[]; +extern const u8 BattleScript_EffectPowerSplit[]; +extern const u8 BattleScript_EffectGuardSplit[]; +extern const u8 BattleScript_EffectStickyWeb[]; +extern const u8 BattleScript_EffectMetalBurst[]; +extern const u8 BattleScript_EffectLuckyChant[]; +extern const u8 BattleScript_EffectSuckerPunch[]; +extern const u8 BattleScript_EffectSimpleBeam[]; +extern const u8 BattleScript_EffectEntrainment[]; +extern const u8 BattleScript_EffectHealPulse[]; +extern const u8 BattleScript_EffectQuash[]; +extern const u8 BattleScript_EffectIonDeluge[]; +extern const u8 BattleScript_EffectTopsyTurvy[]; +extern const u8 BattleScript_EffectMistyTerrain[]; +extern const u8 BattleScript_EffectGrassyTerrain[]; +extern const u8 BattleScript_EffectElectricTerrain[]; +extern const u8 BattleScript_EffectPsychicTerrain[]; +extern const u8 BattleScript_EffectAttackAccUp[]; +extern const u8 BattleScript_EffectAttackSpAttackUp[]; +extern const u8 BattleScript_EffectMeFirst[]; +extern const u8 BattleScript_EffectQuiverDance[]; +extern const u8 BattleScript_EffectCoil[]; +extern const u8 BattleScript_EffectElectrify[]; +extern const u8 BattleScript_EffectReflectType[]; +extern const u8 BattleScript_EffectSoak[]; +extern const u8 BattleScript_EffectGrowth[]; +extern const u8 BattleScript_EffectLastResort[]; +extern const u8 BattleScript_EffectShellSmash[]; +extern const u8 BattleScript_EffectShiftGear[]; +extern const u8 BattleScript_EffectDefenseUp3[]; +extern const u8 BattleScript_EffectNobleRoar[]; +extern const u8 BattleScript_EffectVenomDrench[]; +extern const u8 BattleScript_EffectToxicThread[]; +extern const u8 BattleScript_EffectHitSwitchTarget[]; +extern const u8 BattleScript_EffectFinalGambit[]; +extern const u8 BattleScript_EffectAutotomize[]; +extern const u8 BattleScript_EffectCopycat[]; +extern const u8 BattleScript_EffectDefog[]; +extern const u8 BattleScript_EffectHitEnemyHealAlly[]; +extern const u8 BattleScript_EffectSynchronoise[]; +extern const u8 BattleScript_EffectPsychoShift[]; +extern const u8 BattleScript_EffectPowerTrick[]; +extern const u8 BattleScript_EffectAfterYou[]; +extern const u8 BattleScript_EffectBestow[]; +extern const u8 BattleScript_EffectRototiller[]; +extern const u8 BattleScript_EffectFlowerShield[]; +extern const u8 BattleScript_EffectSpeedSwap[]; +extern const u8 BattleScript_EffectAuroraVeil[]; +extern const u8 BattleScript_EffectThirdType[]; +extern const u8 BattleScript_EffectAcupressure[]; +extern const u8 BattleScript_EffectAromaticMist[]; +extern const u8 BattleScript_EffectPowder[]; +extern const u8 BattleScript_EffectPartingShot[]; +extern const u8 BattleScript_EffectMatBlock[]; +extern const u8 BattleScript_EffectInstruct[]; +extern const u8 BattleScript_EffectLaserFocus[]; +extern const u8 BattleScript_EffectMagneticFlux[]; +extern const u8 BattleScript_EffectGearUp[]; +extern const u8 BattleScript_EffectStrengthSap[]; +extern const u8 BattleScript_EffectMindBlown[]; +extern const u8 BattleScript_EffectPurify[]; +extern const u8 BattleScript_FailIfNotArgType[]; +extern const u8 BattleScript_EffectShoreUp[]; +extern const u8 BattleScript_EffectGeomancy[]; +extern const u8 BattleScript_EffectFairyLock[]; +extern const u8 BattleScript_EffectAllySwitch[]; +extern const u8 BattleScript_EffectRelicSong[]; +extern const u8 BattleScript_EffectEerieSpell[]; +extern const u8 BattleScript_EffectJungleHealing[]; +extern const u8 BattleScript_EffectCoaching[]; +extern const u8 BattleScript_EffectDecorate[]; +extern const u8 BattleScript_EffectRecoilHP25[]; +extern const u8 BattleScript_EffectStuffCheeks[]; +extern const u8 BattleScript_EffectGlitzyGlow[]; +extern const u8 BattleScript_EffectBaddyBad[]; +extern const u8 BattleScript_EffectSappySeed[]; +extern const u8 BattleScript_EffectFreezyFrost[]; +extern const u8 BattleScript_EffectSparklySwirl[]; +extern const u8 BattleScript_EffectPlasmaFists[]; +extern const u8 BattleScript_EffectHyperspaceFury[]; +extern const u8 BattleScript_EffectAuraWheel[]; +extern const u8 BattleScript_EffectPhotonGeyser[]; +extern const u8 BattleScript_EffectShellSideArm[]; +extern const u8 BattleScript_EffectNoRetreat[]; +extern const u8 BattleScript_EffectTarShot[]; +extern const u8 BattleScript_EffectPoltergeist[]; +extern const u8 BattleScript_EffectOctolock[]; +extern const u8 BattleScript_EffectClangorousSoul[]; +extern const u8 BattleScript_EffectSkyDrop[]; +extern const u8 BattleScript_EffectMeteorBeam[]; +extern const u8 BattleScript_EffectCourtChange[]; +extern const u8 BattleScript_EffectMaxHp50Recoil[]; +extern const u8 BattleScript_EffectExtremeEvoboost[]; +extern const u8 BattleScript_EffectHitSetRemoveTerrain[]; +extern const u8 BattleScript_EffectDarkVoid[]; +extern const u8 BattleScript_EffectVictoryDance[]; +extern const u8 BattleScript_EffectTeatime[]; +extern const u8 BattleScript_EffectAttackUpUserAlly[]; +extern const u8 BattleScript_EffectShellTrap[]; +extern const u8 BattleScript_EffectRevivalBlessing[]; +extern const u8 BattleScript_EffectSnow[]; +extern const u8 BattleScript_EffectTakeHeart[]; +extern const u8 BattleScript_EffectCorrosiveGas[]; +extern const u8 BattleScript_EffectSaltCure[]; +extern const u8 BattleScript_EffectChillyReception[]; +extern const u8 BattleScript_EffectMaxMove[]; +extern const u8 BattleScript_EffectGlaiveRush[]; +extern const u8 BattleScript_EffectBrickBreak[]; +extern const u8 BattleScript_EffectDoodle[]; +extern const u8 BattleScript_EffectFilletAway[]; +extern const u8 BattleScript_EffectShedTail[]; +extern const u8 BattleScript_EffectUpperHand[]; +extern const u8 BattleScript_EffectTidyUp[]; + + #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_util.h b/include/battle_util.h index 08556c659..90a966d99 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -9,63 +9,120 @@ #define MOVE_LIMITATION_TORMENTED (1 << 3) #define MOVE_LIMITATION_TAUNT (1 << 4) #define MOVE_LIMITATION_IMPRISON (1 << 5) -#define MOVE_LIMITATIONS_ALL 0xFF +#define MOVE_LIMITATION_ENCORE (1 << 6) +#define MOVE_LIMITATION_CHOICE_ITEM (1 << 7) +#define MOVE_LIMITATION_ASSAULT_VEST (1 << 8) +#define MOVE_LIMITATION_GRAVITY (1 << 9) +#define MOVE_LIMITATION_HEAL_BLOCK (1 << 10) +#define MOVE_LIMITATION_BELCH (1 << 11) +#define MOVE_LIMITATION_THROAT_CHOP (1 << 12) +#define MOVE_LIMITATION_STUFF_CHEEKS (1 << 13) +#define MOVE_LIMITATION_CANT_USE_TWICE (1 << 14) + +#define MOVE_LIMITATION_PLACEHOLDER (1 << 15) +#define MOVE_LIMITATIONS_ALL 0xFFFF #define ABILITYEFFECT_ON_SWITCHIN 0 #define ABILITYEFFECT_ENDTURN 1 #define ABILITYEFFECT_MOVES_BLOCK 2 #define ABILITYEFFECT_ABSORBING 3 -#define ABILITYEFFECT_ON_DAMAGE 4 -#define ABILITYEFFECT_IMMUNITY 5 -#define ABILITYEFFECT_FORECAST 6 +#define ABILITYEFFECT_MOVE_END_ATTACKER 4 +#define ABILITYEFFECT_MOVE_END 5 +#define ABILITYEFFECT_IMMUNITY 6 #define ABILITYEFFECT_SYNCHRONIZE 7 #define ABILITYEFFECT_ATK_SYNCHRONIZE 8 -#define ABILITYEFFECT_INTIMIDATE1 9 -#define ABILITYEFFECT_INTIMIDATE2 10 -#define ABILITYEFFECT_TRACE 11 -#define ABILITYEFFECT_CHECK_OTHER_SIDE 12 -#define ABILITYEFFECT_CHECK_BATTLER_SIDE 13 -#define ABILITYEFFECT_FIELD_SPORT 14 -#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER 15 -#define ABILITYEFFECT_COUNT_OTHER_SIDE 16 -#define ABILITYEFFECT_COUNT_BATTLER_SIDE 17 -#define ABILITYEFFECT_COUNT_ON_FIELD 18 -#define ABILITYEFFECT_CHECK_ON_FIELD 19 -#define ABILITYEFFECT_MUD_SPORT 253 -#define ABILITYEFFECT_WATER_SPORT 254 -#define ABILITYEFFECT_SWITCH_IN_WEATHER 255 +#define ABILITYEFFECT_TRACE1 9 +#define ABILITYEFFECT_TRACE2 10 +#define ABILITYEFFECT_MOVE_END_OTHER 11 +#define ABILITYEFFECT_NEUTRALIZINGGAS 12 +#define ABILITYEFFECT_FIELD_SPORT 13 // Only used if B_SPORT_TURNS >= GEN_6 +#define ABILITYEFFECT_ON_WEATHER 14 +#define ABILITYEFFECT_ON_TERRAIN 15 +#define ABILITYEFFECT_SWITCH_IN_TERRAIN 16 +#define ABILITYEFFECT_SWITCH_IN_WEATHER 17 +#define ABILITYEFFECT_OPPORTUNIST 18 +#define ABILITYEFFECT_SWITCH_IN_STATUSES 19 +// pokefirered +#define ABILITYEFFECT_CHECK_OTHER_SIDE 20 +#define ABILITYEFFECT_CHECK_BATTLER_SIDE 21 +#define ABILITYEFFECT_INTIMIDATE1 22 +#define ABILITYEFFECT_INTIMIDATE2 23 +#define ABILITYEFFECT_TRACE 24 +#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER 25 +#define ABILITYEFFECT_CHECK_ON_FIELD 26 +#define ABILITYEFFECT_ON_DAMAGE 27 +#define ABILITYEFFECT_FORECAST 28 +#define ABILITYEFFECT_COUNT_OTHER_SIDE 29 +// Special cases +#define ABILITYEFFECT_MUD_SPORT 252 // Only used if B_SPORT_TURNS >= GEN_6 +#define ABILITYEFFECT_WATER_SPORT 253 // Only used if B_SPORT_TURNS >= GEN_6 #define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0)) #define ABILITY_ON_FIELD(abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0)) #define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0)) -// For the first argument of ItemBattleEffects, to deteremine which block of item effects to try +/// For the first argument of ItemBattleEffects, to deteremine which block of item effects to try #define ITEMEFFECT_ON_SWITCH_IN 0 #define ITEMEFFECT_NORMAL 1 #define ITEMEFFECT_DUMMY 2 // Unused, empty #define ITEMEFFECT_MOVE_END 3 -#define ITEMEFFECT_KINGSROCK_SHELLBELL 4 +#define ITEMEFFECT_KINGSROCK 4 +#define ITEMEFFECT_TARGET 5 +#define ITEMEFFECT_ORBS 6 +#define ITEMEFFECT_LIFEORB_SHELLBELL 7 +#define ITEMEFFECT_USE_LAST_ITEM 8 // move end effects for just the battler, not whole field +#define ITEMEFFECT_STATS_CHANGED 9 // For White Herb and Eject Pack #define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0))) #define WEATHER_HAS_EFFECT2 ((!AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_AIR_LOCK, 0, 0))) -#define BS_GET_TARGET 0 -#define BS_GET_ATTACKER 1 -#define BS_GET_EFFECT_BANK 2 -#define BS_GET_SCRIPTING_BANK 10 -#define BS_GET_PLAYER1 11 -#define BS_GET_OPPONENT1 12 -#define BS_GET_PLAYER2 13 -#define BS_GET_OPPONENT2 14 +#define IS_WHOLE_SIDE_ALIVE(battler) ((IsBattlerAlive(battler) && IsBattlerAlive(BATTLE_PARTNER(battler)))) +#define IS_ALIVE_AND_PRESENT(battler) (IsBattlerAlive(battler) && IsBattlerSpritePresent(battler)) + +// for Natural Gift and Fling +struct TypePower +{ + u8 type; + u8 power; + u16 effect; +}; + +enum +{ + CANCELLER_FLAGS, + CANCELLER_SKY_DROP, + CANCELLER_ASLEEP, + CANCELLER_FROZEN, + CANCELLER_TRUANT, + CANCELLER_RECHARGE, + CANCELLER_FLINCH, + CANCELLER_DISABLED, + CANCELLER_GRAVITY, + CANCELLER_HEAL_BLOCKED, + CANCELLER_TAUNTED, + CANCELLER_IMPRISONED, + CANCELLER_CONFUSED, + CANCELLER_PARALYSED, + CANCELLER_GHOST, + CANCELLER_IN_LOVE, + CANCELLER_BIDE, + CANCELLER_THAW, + CANCELLER_POWDER_MOVE, + CANCELLER_POWDER_STATUS, + CANCELLER_THROAT_CHOP, + CANCELLER_MULTIHIT_MOVES, + CANCELLER_Z_MOVES, + CANCELLER_END, + CANCELLER_PSYCHIC_TERRAIN, + CANCELLER_END2, +}; + u8 GetBattlerForBattleScript(u8 caseId); -void PressurePPLose(u8 target, u8 attacker, u16 move); -void PressurePPLoseOnUsingImprison(u8 attacker); -void PressurePPLoseOnUsingPerishSong(u8 attacker); void MarkBattlerForControllerExec(u8 battlerId); void MarkBattlerReceivedLinkData(u8 battlerId); -void CancelMultiTurnMoves(u8 battler); -bool8 WasUnableToUseMove(u8 battler); +const u8* CancelMultiTurnMoves(u32 battler); +bool32 WasUnableToUseMove(u32 battler); void PrepareStringBattle(u16 stringId, u8 battler); void ResetSentPokesToOpponentValue(void); void OpponentSwitchInResetSentPokesToOpponentValue(u8 battler); @@ -74,7 +131,7 @@ void BattleScriptPush(const u8 *bsPtr); void BattleScriptPushCursor(void); void BattleScriptPop(void); u8 TrySetCantSelectMoveBattleScript(void); -u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check); +u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check); bool8 AreAllMovesUnusable(void); u8 GetImprisonedMovesCount(u8 battlerId, u16 move); u8 DoFieldEndTurnEffects(void); @@ -82,20 +139,117 @@ u8 DoBattlerEndTurnEffects(void); bool8 HandleWishPerishSongOnTurnEnd(void); bool8 HandleFaintedMonActions(void); void TryClearRageStatuses(void); -u8 AtkCanceller_UnableToUseMove(void); -bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2); +u8 AtkCanceller_UnableToUseMove(u32 moveType); +bool32 HasNoMonsToSwitch(u32 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2); u8 CastformDataTypeChange(u8 battler); -u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 moveArg); +u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 moveArg); void BattleScriptExecute(const u8 *BS_ptr); void BattleScriptPushCursorAndCallback(const u8 *BS_ptr); -u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn); +u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn); void ClearFuryCutterDestinyBondGrudge(u8 battlerId); void HandleAction_RunBattleScript(void); u8 GetMoveTarget(u16 move, u8 setTarget); u8 IsMonDisobedient(void); +void SwitchPartyOrderInGameMulti(u8 battler, u8 arg1); // new -u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating); +bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move); +bool32 IsNeutralizingGasOnField(void); +bool32 IsMyceliumMightOnField(void); +bool32 IsMoldBreakerTypeAbility(u32 ability); +u32 GetBattlerAbility(u32 battler); +u32 IsAbilityOnSide(u32 battler, u32 ability); +u32 IsAbilityOnOpposingSide(u32 battler, u32 ability); +u32 IsAbilityOnField(u32 ability); +u32 IsAbilityOnFieldExcept(u32 battler, u32 ability); +u32 IsAbilityPreventingEscape(u32 battler); bool32 IsBattlerAlive(u32 battler); bool32 CompareStat(u32 battler, u8 statId, u8 cmpTo, u8 cmpKind); +u32 CalcSecondaryEffectChance(u32 battler, u32 battlerAbility, const struct AdditionalEffect *additionalEffect); +bool32 MoveHasAdditionalEffect(u32 move, u32 moveEffect); +u8 GetBattleMoveCategory(u32 moveId); +u32 GetBattlerMoveTargetType(u32 battler, u32 move); +bool32 IsBattlerTerrainAffected(u32 battler, u32 terrainFlag); +bool32 IsBattlerGrounded(u32 battler); +u8 AtkCanceller_UnableToUseMove2(void); +void SetAtkCancellerForCalledMove(void); +bool32 BlocksPrankster(u16 move, u32 battlerPrankster, u32 battlerDef, bool32 checkTarget); +bool32 IsBattlerProtected(u32 battler, u32 move); +bool32 IsMoveMakingContact(u32 move, u32 battlerAtk); +bool32 IsHealBlockPreventingMove(u32 battler, u32 move); +s32 CalculateMoveDamage(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags); +bool32 MoveHasAdditionalEffectSelfArg(u32 move, u32 moveEffect, u32 argument); +u32 GetMoveSlot(u16 *moves, u32 move); +u32 GetBattlerWeight(u32 battler); +u32 CountBattlerStatIncreases(u32 battler, bool32 countEvasionAcc); +bool32 ShouldGetStatBadgeBoost(u16 flagId, u32 battler); +bool32 IsBattlerWeatherAffected(u32 battler, u32 weatherFlags); +bool32 CanBattlerGetOrLoseItem(u32 battler, u16 itemId); +bool32 MoveIsAffectedBySheerForce(u32 move); +u8 GetBattlerGender(u32 battler); +bool32 AreBattlersOfOppositeGender(u32 battler1, u32 battler2); +bool32 AreBattlersOfSameGender(u32 battler1, u32 battler2); +u32 GetBattlerHoldEffectParam(u32 battler); +uq4_12_t CalcTypeEffectivenessMultiplier(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, u32 defAbility, bool32 recordAbilities); +bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect); +uq4_12_t GetTypeModifier(u32 atkType, u32 defType); +u8 GetBattlerType(u32 battler, u8 typeIndex); +u32 GetIllusionMonSpecies(u32 battler); +struct Pokemon *GetIllusionMonPtr(u32 battler); +void ClearIllusionMon(u32 battler); +bool32 SetIllusionMon(struct Pokemon *mon, u32 battler); +u32 GetBattlerAffectionHearts(u32 battler); +u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating); +u32 GetBattlerHoldEffectIgnoreAbility(u32 battler, bool32 checkNegating); +u32 GetBattlerHoldEffectInternal(u32 battler, bool32 checkNegating, bool32 checkAbility); +void RecalcBattlerStats(u32 battler, struct Pokemon *mon); +bool32 TestIfSheerForceAffected(u32 battler, u16 move); +bool32 CanSleep(u32 battler); +bool32 CanBePoisoned(u32 battlerAttacker, u32 battlerTarget); +bool32 CanBeBurned(u32 battler); +bool32 CanBeParalyzed(u32 battler); +bool32 CanBeFrozen(u32 battler); +bool32 CanGetFrostbite(u32 battler); +bool32 CanBeConfused(u32 battler); +bool32 CanStealItem(u32 battlerStealing, u32 battlerItem, u16 item); +void TrySaveExchangedItem(u32 battler, u16 stolenItem); +void RemoveBattlerType(u32 battler, u8 type); +bool32 IsBattlerMegaEvolved(u32 battler); +bool32 IsBattlerPrimalReverted(u32 battler); +bool32 IsBattlerUltraBursted(u32 battler); +u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method); +bool32 TryBattleFormChange(u32 battler, u16 method); +bool32 TryChangeBattleWeather(u32 battler, u32 weatherEnumId, bool32 viaAbility); +u16 GetUsedHeldItem(u32 battler); +void RemoveConfusionStatus(u32 battler); +bool32 ChangeTypeBasedOnTerrain(u32 battler); +bool32 TryRoomService(u32 battler); +void BufferStatChange(u32 battler, u8 statId, u8 stringId); +s32 GetDrainedBigRootHp(u32 battler, s32 hp); +u8 TryHandleSeed(u32 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 execute); +bool32 HasEnoughHpToEatBerry(u32 battler, u32 hpFraction, u32 itemId); +bool32 IsGen6ExpShareEnabled(void); +void CopyMonLevelAndBaseStatsToBattleMon(u32 battler, struct Pokemon *mon); +void SortBattlersBySpeed(u8 *battlers, bool32 slowToFast); +bool32 CanBattlerEscape(u32 battler); // no ability check +bool32 IsBattlerAffectedByHazards(u32 battler, bool32 toxicSpikes); +bool32 TryPrimalReversion(u32 battler); +s32 GetStealthHazardDamage(u8 hazardType, u32 battler); +s32 GetStealthHazardDamageByTypesAndHP(u8 hazardType, u8 type1, u8 type2, u32 maxHp); +bool32 DoBattlersShareType(u32 battler1, u32 battler2); +bool32 MoveHasChargeTurnAdditionalEffect(u32 move); +bool32 IsPartnerMonFromSameTrainer(u32 battler); + +// battle_ai_util.h +bool32 IsHealingMove(u32 move); +void RecordKnownMove(u32 battlerId, u32 move); +s32 CountUsablePartyMons(u32 battlerId); +bool32 IsAiVsAiBattle(void); +void RecordLastUsedMoveBy(u32 battlerId, u32 move); +bool32 BattlerHasAi(u32 battlerId); +void ClearBattlerItemEffectHistory(u32 battlerId); +bool32 IsAffectedByPowder(u32 battler, u32 ability, u32 holdEffect); +void RecordAllMoves(u32 battler); + +// end battle_ai_util.h #endif // GUARD_BATTLE_UTIL_H diff --git a/include/calculate_base_damage.h b/include/calculate_base_damage.h index 8079031e8..9ae781f3f 100644 --- a/include/calculate_base_damage.h +++ b/include/calculate_base_damage.h @@ -3,6 +3,6 @@ #include "global.h" -s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef); +// s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u32 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef); #endif // GUARD_CALCULATE_BASE_DAMAGE_H diff --git a/include/config.h b/include/config.h index b509c980f..53ccd9371 100644 --- a/include/config.h +++ b/include/config.h @@ -1,8 +1,6 @@ #ifndef GUARD_CONFIG_H #define GUARD_CONFIG_H -#include "global.h" - // In the Generation 3 games, Asserts were used in various debug builds. // Ruby/Sapphire and Emerald do not have these asserts while Fire Red // still has them in the ROM. This is because the developers forgot diff --git a/include/config/species_enabled.h b/include/config/species_enabled.h index 229734c1a..f2d70f704 100644 --- a/include/config/species_enabled.h +++ b/include/config/species_enabled.h @@ -12,7 +12,7 @@ #define P_GEN_4_POKEMON FALSE // Generation 4 Pokémon (DPPt, HGSS) #define P_GEN_5_POKEMON FALSE // Generation 5 Pokémon (BW, B2W2) #define P_GEN_6_POKEMON FALSE // Generation 6 Pokémon (XY, ORAS) -#define P_GEN_7_POKEMON FALSE // Generation 7 Pokémon (SM, USUM, LGPE) +#define P_GEN_7_POKEMON TRUE // Generation 7 Pokémon (SM, USUM, LGPE) #define P_GEN_8_POKEMON FALSE // Generation 8 Pokémon (SwSh, BDSP, LA) #define P_GEN_9_POKEMON FALSE // Generation 9 Pokémon (SV) diff --git a/include/constants/battle.h b/include/constants/battle.h index 6f617d0d7..63e3e1e60 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -31,11 +31,12 @@ #define B_POSITION_OPPONENT_RIGHT 3 // These macros can be used with either battler ID or positions to get the partner or the opposite mon -#define BATTLE_OPPOSITE(id) ((id) ^ 1) -#define BATTLE_PARTNER(id) ((id) ^ 2) +#define BATTLE_OPPOSITE(id) ((id) ^ BIT_SIDE) +#define BATTLE_PARTNER(id) ((id) ^ BIT_FLANK) #define B_SIDE_PLAYER 0 #define B_SIDE_OPPONENT 1 +#define NUM_BATTLE_SIDES 2 #define B_FLANK_LEFT 0 #define B_FLANK_RIGHT 1 @@ -65,9 +66,15 @@ #define BATTLE_TYPE_WILD_SCRIPTED (1 << 17) // Used in pokeemerald as BATTLE_TYPE_PALACE. #define BATTLE_TYPE_LEGENDARY_FRLG (1 << 18) // Used in pokeemerald as BATTLE_TYPE_ARENA. #define BATTLE_TYPE_TRAINER_TOWER (1 << 19) // Used in pokeemerald as BATTLE_TYPE_FACTORY. +// pokeemerald +#define BATTLE_TYPE_INGAME_PARTNER (1 << 20) +#define BATTLE_TYPE_TOWER_LINK_MULTI (1 << 21) +#define BATTLE_TYPE_TWO_OPPONENTS (1 << 22) #define IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(flags) ((flags) & BATTLE_TYPE_GHOST && !((flags) & BATTLE_TYPE_GHOST_UNVEILED)) #define IS_BATTLE_TYPE_GHOST_WITH_SCOPE(flags) ((flags) & BATTLE_TYPE_GHOST && (flags) & BATTLE_TYPE_GHOST_UNVEILED) +#define WILD_DOUBLE_BATTLE ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER)))) +#define BATTLE_TWO_VS_ONE_OPPONENT ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gTrainerBattleOpponent_B == 0xFFFF)) #define RIVAL_BATTLE_HEAL_AFTER 1 #define RIVAL_BATTLE_TUTORIAL 3 @@ -86,7 +93,10 @@ #define B_OUTCOME_LINK_BATTLE_RAN (1 << 7) // 128 // Non-volatile status conditions -// These persist remain outside of battle and after switching out +// These remain outside of battle and after switching out. +// If a new STATUS1 is added here, it should also be added to +// sCompressedStatuses in src/pokemon.c or else it will be lost outside +// of battle. #define STATUS1_NONE 0 #define STATUS1_SLEEP (1 << 0 | 1 << 1 | 1 << 2) // First 3 bits (Number of turns to sleep) #define STATUS1_SLEEP_TURN(num) ((num) << 0) // Just for readability (or if rearranging statuses) @@ -108,7 +118,7 @@ #define STATUS2_FLINCHED (1 << 3) #define STATUS2_UPROAR (1 << 4 | 1 << 5 | 1 << 6) #define STATUS2_UPROAR_TURN(num) ((num) << 4) -#define STATUS2_UNUSED (1 << 7) +#define STATUS2_TORMENT (1 << 7) #define STATUS2_BIDE (1 << 8 | 1 << 9) #define STATUS2_BIDE_TURN(num) (((num) << 8) & STATUS2_BIDE) #define STATUS2_LOCK_CONFUSE (1 << 10 | 1 << 11) // e.g. Thrash @@ -118,7 +128,7 @@ #define STATUS2_POWDER (1 << 14) #define STATUS2_INFATUATION (1 << 16 | 1 << 17 | 1 << 18 | 1 << 19) // 4 bits, one for every battler #define STATUS2_INFATUATED_WITH(battler) (gBitTable[battler] << 16) -#define STATUS2_FOCUS_ENERGY (1 << 20) +#define STATUS2_DEFENSE_CURL (1 << 20) #define STATUS2_TRANSFORMED (1 << 21) #define STATUS2_RECHARGE (1 << 22) #define STATUS2_RAGE (1 << 23) @@ -128,10 +138,10 @@ #define STATUS2_NIGHTMARE (1 << 27) #define STATUS2_CURSED (1 << 28) #define STATUS2_FORESIGHT (1 << 29) -#define STATUS2_DEFENSE_CURL (1 << 30) -#define STATUS2_TORMENT (1 << 31) +#define STATUS2_DRAGON_CHEER (1 << 30) +#define STATUS2_FOCUS_ENERGY (1 << 31) +#define STATUS2_FOCUS_ENERGY_ANY (STATUS2_DRAGON_CHEER | STATUS2_FOCUS_ENERGY) -// Seems like per-battler statuses. Not quite sure how to categorize these #define STATUS3_LEECHSEED_BATTLER (1 << 0 | 1 << 1) // The battler to receive HP from Leech Seed #define STATUS3_LEECHSEED (1 << 2) #define STATUS3_ALWAYS_HITS (1 << 3 | 1 << 4) @@ -146,7 +156,7 @@ #define STATUS3_YAWN_TURN(num) (((num) << 11) & STATUS3_YAWN) #define STATUS3_IMPRISONED_OTHERS (1 << 13) #define STATUS3_GRUDGE (1 << 14) -#define STATUS3_CANT_SCORE_A_CRIT (1 << 15) +#define STATUS3_CANT_SCORE_A_CRIT (1 << 15) // unused? #define STATUS3_GASTRO_ACID (1 << 16) #define STATUS3_EMBARGO (1 << 17) #define STATUS3_UNDERWATER (1 << 18) @@ -175,9 +185,9 @@ // Not really sure what a "hitmarker" is. #define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked. -#define HITMARKER_SKIP_DMG_TRACK (1 << 5) +#define HITMARKER_IGNORE_BIDE (1 << 5) #define HITMARKER_DESTINYBOND (1 << 6) -#define HITMARKER_NO_ANIMATIONS (1 << 7) +#define HITMARKER_NO_ANIMATIONS (1 << 7) // set from battleSceneOff. Never changed during battle #define HITMARKER_IGNORE_SUBSTITUTE (1 << 8) #define HITMARKER_NO_ATTACKSTRING (1 << 9) #define HITMARKER_ATTACKSTRING_PRINTED (1 << 10) @@ -186,9 +196,9 @@ #define HITMARKER_STATUS_ABILITY_EFFECT (1 << 13) #define HITMARKER_SYNCHRONISE_EFFECT (1 << 14) #define HITMARKER_RUN (1 << 15) -#define HITMARKER_IGNORE_ON_AIR (1 << 16) -#define HITMARKER_IGNORE_UNDERGROUND (1 << 17) -#define HITMARKER_IGNORE_UNDERWATER (1 << 18) +#define HITMARKER_IGNORE_DISGUISE (1 << 16) +#define HITMARKER_DISABLE_ANIMATION (1 << 17) // disable animations during battle scripts, e.g. for Bug Bite +// 3 free spots because of change in handling of UNDERGROUND/UNDERWATER/ON AIR #define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19) #define HITMARKER_PASSIVE_DAMAGE (1 << 20) #define HITMARKER_DISOBEDIENT_MOVE (1 << 21) @@ -200,42 +210,108 @@ #define HITMARKER_CHARGING (1 << 27) #define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) #define HITMARKER_FAINTED2(battler) ((1 << 28) << battler) +#define HITMARKER_STRING_PRINTED (1 << 29) +// TODO: old hitmarkers for compatability, remove with new battle system +#define HITMARKER_SKIP_DMG_TRACK (1 << 30) +#define HITMARKER_IGNORE_ON_AIR (1 << 31) +#define HITMARKER_IGNORE_UNDERGROUND (1 << 0) +#define HITMARKER_IGNORE_UNDERWATER (1 << 1) + // Per-side statuses that affect an entire party -#define SIDE_STATUS_REFLECT (1 << 0) -#define SIDE_STATUS_LIGHTSCREEN (1 << 1) -#define SIDE_STATUS_X4 (1 << 2) -#define SIDE_STATUS_SPIKES (1 << 4) -#define SIDE_STATUS_SAFEGUARD (1 << 5) -#define SIDE_STATUS_FUTUREATTACK (1 << 6) -#define SIDE_STATUS_MIST (1 << 8) -#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9) +#define SIDE_STATUS_REFLECT (1 << 0) +#define SIDE_STATUS_LIGHTSCREEN (1 << 1) +#define SIDE_STATUS_STICKY_WEB (1 << 2) +#define SIDE_STATUS_SPIKES (1 << 4) +#define SIDE_STATUS_SAFEGUARD (1 << 5) +#define SIDE_STATUS_FUTUREATTACK (1 << 6) +#define SIDE_STATUS_MIST (1 << 8) +#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9) // TODO: remove with new battle system +// (1 << 9) previously was SIDE_STATUS_SPIKES_DAMAGED +#define SIDE_STATUS_TAILWIND (1 << 10) +#define SIDE_STATUS_AURORA_VEIL (1 << 11) +#define SIDE_STATUS_LUCKY_CHANT (1 << 12) +#define SIDE_STATUS_TOXIC_SPIKES (1 << 13) +#define SIDE_STATUS_STEALTH_ROCK (1 << 14) +// Missing flags previously were SIDE_STATUS_TOXIC_SPIKES_DAMAGED, SIDE_STATUS_STEALTH_ROCK_DAMAGED, SIDE_STATUS_STICKY_WEB_DAMAGED +#define SIDE_STATUS_QUICK_GUARD (1 << 18) +#define SIDE_STATUS_WIDE_GUARD (1 << 19) +#define SIDE_STATUS_CRAFTY_SHIELD (1 << 20) +#define SIDE_STATUS_MAT_BLOCK (1 << 21) +#define SIDE_STATUS_STEELSURGE (1 << 22) +#define SIDE_STATUS_DAMAGE_NON_TYPES (1 << 23) +#define SIDE_STATUS_RAINBOW (1 << 24) +#define SIDE_STATUS_SEA_OF_FIRE (1 << 25) +#define SIDE_STATUS_SWAMP (1 << 26) + +#define SIDE_STATUS_HAZARDS_ANY (SIDE_STATUS_SPIKES | SIDE_STATUS_STICKY_WEB | SIDE_STATUS_TOXIC_SPIKES | SIDE_STATUS_STEALTH_ROCK | SIDE_STATUS_STEELSURGE) +#define SIDE_STATUS_SCREEN_ANY (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL) +#define SIDE_STATUS_PLEDGE_ANY (SIDE_STATUS_RAINBOW | SIDE_STATUS_SEA_OF_FIRE | SIDE_STATUS_SWAMP) + +// Field affecting statuses. +#define STATUS_FIELD_MAGIC_ROOM (1 << 0) +#define STATUS_FIELD_TRICK_ROOM (1 << 1) +#define STATUS_FIELD_WONDER_ROOM (1 << 2) +#define STATUS_FIELD_MUDSPORT (1 << 3) +#define STATUS_FIELD_WATERSPORT (1 << 4) +#define STATUS_FIELD_GRAVITY (1 << 5) +#define STATUS_FIELD_GRASSY_TERRAIN (1 << 6) +#define STATUS_FIELD_MISTY_TERRAIN (1 << 7) +#define STATUS_FIELD_ELECTRIC_TERRAIN (1 << 8) +#define STATUS_FIELD_PSYCHIC_TERRAIN (1 << 9) +#define STATUS_FIELD_ION_DELUGE (1 << 10) +#define STATUS_FIELD_FAIRY_LOCK (1 << 11) +#define STATUS_FIELD_TERRAIN_PERMANENT (1 << 12) // Overworld thunderstorm generates electric terrain + +#define STATUS_FIELD_TERRAIN_ANY (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN) // Flags describing move's result -#define MOVE_RESULT_MISSED (1 << 0) -#define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1) -#define MOVE_RESULT_NOT_VERY_EFFECTIVE (1 << 2) -#define MOVE_RESULT_DOESNT_AFFECT_FOE (1 << 3) -#define MOVE_RESULT_ONE_HIT_KO (1 << 4) -#define MOVE_RESULT_FAILED (1 << 5) -#define MOVE_RESULT_FOE_ENDURED (1 << 6) -#define MOVE_RESULT_FOE_HUNG_ON (1 << 7) -#define MOVE_RESULT_NO_EFFECT (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED) +#define MOVE_RESULT_MISSED (1 << 0) +#define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1) +#define MOVE_RESULT_NOT_VERY_EFFECTIVE (1 << 2) +#define MOVE_RESULT_DOESNT_AFFECT_FOE (1 << 3) +#define MOVE_RESULT_ONE_HIT_KO (1 << 4) +#define MOVE_RESULT_FAILED (1 << 5) +#define MOVE_RESULT_FOE_ENDURED (1 << 6) +#define MOVE_RESULT_FOE_HUNG_ON (1 << 7) +#define MOVE_RESULT_STURDIED (1 << 8) +#define MOVE_RESULT_FOE_ENDURED_AFFECTION (1 << 9) +#define MOVE_RESULT_NO_EFFECT (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED) // Battle Weather flags +#define B_WEATHER_NONE 0 #define B_WEATHER_RAIN_TEMPORARY (1 << 0) #define B_WEATHER_RAIN_DOWNPOUR (1 << 1) // unused #define B_WEATHER_RAIN_PERMANENT (1 << 2) -#define B_WEATHER_RAIN (B_WEATHER_RAIN_TEMPORARY | B_WEATHER_RAIN_DOWNPOUR | B_WEATHER_RAIN_PERMANENT) -#define B_WEATHER_SANDSTORM_TEMPORARY (1 << 3) -#define B_WEATHER_SANDSTORM_PERMANENT (1 << 4) +#define B_WEATHER_RAIN_PRIMAL (1 << 3) +#define B_WEATHER_RAIN (B_WEATHER_RAIN_TEMPORARY | B_WEATHER_RAIN_DOWNPOUR | B_WEATHER_RAIN_PERMANENT | B_WEATHER_RAIN_PRIMAL) +#define B_WEATHER_SANDSTORM_TEMPORARY (1 << 4) +#define B_WEATHER_SANDSTORM_PERMANENT (1 << 5) #define B_WEATHER_SANDSTORM (B_WEATHER_SANDSTORM_TEMPORARY | B_WEATHER_SANDSTORM_PERMANENT) -#define B_WEATHER_SUN_TEMPORARY (1 << 5) -#define B_WEATHER_SUN_PERMANENT (1 << 6) -#define B_WEATHER_SUN (B_WEATHER_SUN_TEMPORARY | B_WEATHER_SUN_PERMANENT) -#define B_WEATHER_HAIL_TEMPORARY (1 << 7) -#define B_WEATHER_HAIL (B_WEATHER_HAIL_TEMPORARY) -#define B_WEATHER_ANY (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_SUN | B_WEATHER_HAIL) +#define B_WEATHER_SUN_TEMPORARY (1 << 6) +#define B_WEATHER_SUN_PERMANENT (1 << 7) +#define B_WEATHER_SUN_PRIMAL (1 << 8) +#define B_WEATHER_SUN (B_WEATHER_SUN_TEMPORARY | B_WEATHER_SUN_PERMANENT | B_WEATHER_SUN_PRIMAL) +#define B_WEATHER_HAIL_TEMPORARY (1 << 9) +#define B_WEATHER_HAIL_PERMANENT (1 << 10) +#define B_WEATHER_HAIL (B_WEATHER_HAIL_TEMPORARY | B_WEATHER_HAIL_PERMANENT) +#define B_WEATHER_STRONG_WINDS (1 << 11) +#define B_WEATHER_ANY (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_SUN | B_WEATHER_HAIL | B_WEATHER_STRONG_WINDS | B_WEATHER_SNOW) +#define B_WEATHER_PRIMAL_ANY (B_WEATHER_RAIN_PRIMAL | B_WEATHER_SUN_PRIMAL | B_WEATHER_STRONG_WINDS) +#define B_WEATHER_SNOW_TEMPORARY (1 << 12) +#define B_WEATHER_SNOW_PERMANENT (1 << 13) +#define B_WEATHER_SNOW (B_WEATHER_SNOW_TEMPORARY | B_WEATHER_SNOW_PERMANENT) + +// Battle Weather as enum +#define ENUM_WEATHER_NONE 0 +#define ENUM_WEATHER_RAIN 1 +#define ENUM_WEATHER_SUN 2 +#define ENUM_WEATHER_SANDSTORM 3 +#define ENUM_WEATHER_HAIL 4 +#define ENUM_WEATHER_SUN_PRIMAL 5 +#define ENUM_WEATHER_RAIN_PRIMAL 6 +#define ENUM_WEATHER_STRONG_WINDS 7 +#define ENUM_WEATHER_SNOW 8 // Move Effects #define MOVE_EFFECT_SLEEP 1 @@ -244,15 +320,16 @@ #define MOVE_EFFECT_FREEZE 4 #define MOVE_EFFECT_PARALYSIS 5 #define MOVE_EFFECT_TOXIC 6 -#define PRIMARY_STATUS_MOVE_EFFECT MOVE_EFFECT_TOXIC // All above move effects apply primary status -#define MOVE_EFFECT_CONFUSION 7 -#define MOVE_EFFECT_FLINCH 8 -#define MOVE_EFFECT_TRI_ATTACK 9 -#define MOVE_EFFECT_UPROAR 10 -#define MOVE_EFFECT_PAYDAY 11 -#define MOVE_EFFECT_CHARGING 12 -#define MOVE_EFFECT_WRAP 13 -#define MOVE_EFFECT_RECOIL_25 14 +#define MOVE_EFFECT_FROSTBITE 7 +#define PRIMARY_STATUS_MOVE_EFFECT MOVE_EFFECT_FROSTBITE // All above move effects apply primary status +#define MOVE_EFFECT_FREEZE_OR_FROSTBITE (B_USE_FROSTBITE == TRUE ? MOVE_EFFECT_FROSTBITE : MOVE_EFFECT_FREEZE) +#define MOVE_EFFECT_CONFUSION 8 +#define MOVE_EFFECT_FLINCH 9 +#define MOVE_EFFECT_TRI_ATTACK 10 +#define MOVE_EFFECT_UPROAR 11 +#define MOVE_EFFECT_PAYDAY 12 +#define MOVE_EFFECT_CHARGING 13 +#define MOVE_EFFECT_WRAP 14 #define MOVE_EFFECT_ATK_PLUS_1 15 #define MOVE_EFFECT_DEF_PLUS_1 16 #define MOVE_EFFECT_SPD_PLUS_1 17 @@ -267,16 +344,16 @@ #define MOVE_EFFECT_SP_DEF_MINUS_1 26 #define MOVE_EFFECT_ACC_MINUS_1 27 #define MOVE_EFFECT_EVS_MINUS_1 28 -#define MOVE_EFFECT_RECHARGE 29 -#define MOVE_EFFECT_RAGE 30 -#define MOVE_EFFECT_STEAL_ITEM 31 -#define MOVE_EFFECT_PREVENT_ESCAPE 32 -#define MOVE_EFFECT_NIGHTMARE 33 -#define MOVE_EFFECT_ALL_STATS_UP 34 -#define MOVE_EFFECT_RAPIDSPIN 35 -#define MOVE_EFFECT_REMOVE_PARALYSIS 36 -#define MOVE_EFFECT_ATK_DEF_DOWN 37 -#define MOVE_EFFECT_RECOIL_33 38 +#define MOVE_EFFECT_REMOVE_ARG_TYPE 29 +#define MOVE_EFFECT_RECHARGE 30 +#define MOVE_EFFECT_RAGE 31 +#define MOVE_EFFECT_STEAL_ITEM 32 +#define MOVE_EFFECT_PREVENT_ESCAPE 33 +#define MOVE_EFFECT_NIGHTMARE 34 +#define MOVE_EFFECT_ALL_STATS_UP 35 +#define MOVE_EFFECT_RAPID_SPIN 36 +#define MOVE_EFFECT_REMOVE_STATUS 37 +#define MOVE_EFFECT_ATK_DEF_DOWN 38 #define MOVE_EFFECT_ATK_PLUS_2 39 #define MOVE_EFFECT_DEF_PLUS_2 40 #define MOVE_EFFECT_SPD_PLUS_2 41 @@ -291,43 +368,86 @@ #define MOVE_EFFECT_SP_DEF_MINUS_2 50 #define MOVE_EFFECT_ACC_MINUS_2 51 #define MOVE_EFFECT_EVS_MINUS_2 52 -#define MOVE_EFFECT_THRASH 53 -#define MOVE_EFFECT_KNOCK_OFF 54 -#define MOVE_EFFECT_NOTHING_37 55 -#define MOVE_EFFECT_NOTHING_38 56 -#define MOVE_EFFECT_NOTHING_39 57 -#define MOVE_EFFECT_NOTHING_3A 58 -#define MOVE_EFFECT_SP_ATK_TWO_DOWN 59 -#define NUM_MOVE_EFFECTS 60 +#define MOVE_EFFECT_SCALE_SHOT 53 +#define MOVE_EFFECT_THRASH 54 +#define MOVE_EFFECT_KNOCK_OFF 55 +#define MOVE_EFFECT_DEF_SPDEF_DOWN 56 +#define MOVE_EFFECT_CLEAR_SMOG 57 +#define MOVE_EFFECT_SP_ATK_TWO_DOWN 58 +#define MOVE_EFFECT_SMACK_DOWN 59 +#define MOVE_EFFECT_FLAME_BURST 60 +#define MOVE_EFFECT_FEINT 61 +#define MOVE_EFFECT_SPECTRAL_THIEF 62 +#define MOVE_EFFECT_V_CREATE 63 +#define MOVE_EFFECT_HAPPY_HOUR 64 +#define MOVE_EFFECT_CORE_ENFORCER 65 +#define MOVE_EFFECT_THROAT_CHOP 66 +#define MOVE_EFFECT_INCINERATE 67 +#define MOVE_EFFECT_BUG_BITE 68 +#define MOVE_EFFECT_RECOIL_HP_25 69 +#define MOVE_EFFECT_TRAP_BOTH 70 +#define MOVE_EFFECT_ROUND 71 +#define MOVE_EFFECT_STOCKPILE_WORE_OFF 72 +#define MOVE_EFFECT_DIRE_CLAW 73 +#define MOVE_EFFECT_STEALTH_ROCK 74 +#define MOVE_EFFECT_SPIKES 75 +#define MOVE_EFFECT_SYRUP_BOMB 76 +#define MOVE_EFFECT_FLORAL_HEALING 77 +#define MOVE_EFFECT_SECRET_POWER 78 +#define MOVE_EFFECT_PSYCHIC_NOISE 79 +// TODO: old pokefirered move effects, remove with new battle system +#define MOVE_EFFECT_RECOIL_25 80 +#define MOVE_EFFECT_RAPIDSPIN 81 +#define MOVE_EFFECT_REMOVE_PARALYSIS 82 +#define MOVE_EFFECT_RECOIL_33 83 -#define MOVE_EFFECT_AFFECTS_USER (1 << 6) // 64 -#define MOVE_EFFECT_CERTAIN (1 << 7) // 128 +#define NUM_MOVE_EFFECTS 84 + +#define MOVE_EFFECT_AFFECTS_USER 0x2000 +#define MOVE_EFFECT_CERTAIN 0x4000 +#define MOVE_EFFECT_CONTINUE 0x8000 // Battle terrain defines for gBattleTerrain. -#define BATTLE_TERRAIN_GRASS 0 -#define BATTLE_TERRAIN_LONG_GRASS 1 -#define BATTLE_TERRAIN_SAND 2 -#define BATTLE_TERRAIN_UNDERWATER 3 -#define BATTLE_TERRAIN_WATER 4 -#define BATTLE_TERRAIN_POND 5 -#define BATTLE_TERRAIN_MOUNTAIN 6 -#define BATTLE_TERRAIN_CAVE 7 -#define BATTLE_TERRAIN_BUILDING 8 -#define BATTLE_TERRAIN_PLAIN 9 -#define BATTLE_TERRAIN_LINK 10 -#define BATTLE_TERRAIN_GYM 11 -#define BATTLE_TERRAIN_LEADER 12 -#define BATTLE_TERRAIN_INDOOR_2 13 -#define BATTLE_TERRAIN_INDOOR_1 14 -#define BATTLE_TERRAIN_LORELEI 15 -#define BATTLE_TERRAIN_BRUNO 16 -#define BATTLE_TERRAIN_AGATHA 17 -#define BATTLE_TERRAIN_LANCE 18 -#define BATTLE_TERRAIN_CHAMPION 19 +#define BATTLE_TERRAIN_GRASS 0 +#define BATTLE_TERRAIN_LONG_GRASS 1 +#define BATTLE_TERRAIN_SAND 2 +#define BATTLE_TERRAIN_UNDERWATER 3 +#define BATTLE_TERRAIN_WATER 4 +#define BATTLE_TERRAIN_POND 5 +#define BATTLE_TERRAIN_MOUNTAIN 6 +#define BATTLE_TERRAIN_CAVE 7 +#define BATTLE_TERRAIN_BUILDING 8 +#define BATTLE_TERRAIN_PLAIN 9 +// New battle terrains are used for Secret Power but not fully implemented. +#define BATTLE_TERRAIN_SOARING 10 +#define BATTLE_TERRAIN_SKY_PILLAR 11 +#define BATTLE_TERRAIN_BURIAL_GROUND 12 +#define BATTLE_TERRAIN_PUDDLE 13 +#define BATTLE_TERRAIN_MARSH 14 +#define BATTLE_TERRAIN_SWAMP 15 +#define BATTLE_TERRAIN_SNOW 16 +#define BATTLE_TERRAIN_ICE 17 +#define BATTLE_TERRAIN_VOLCANO 18 +#define BATTLE_TERRAIN_DISTORTION_WORLD 19 +#define BATTLE_TERRAIN_SPACE 20 +#define BATTLE_TERRAIN_ULTRA_SPACE 21 +#define BATTLE_TERRAIN_LINK 22 +#define BATTLE_TERRAIN_GYM 23 +#define BATTLE_TERRAIN_LEADER 24 +#define BATTLE_TERRAIN_INDOOR_2 25 +#define BATTLE_TERRAIN_INDOOR_1 26 +#define BATTLE_TERRAIN_LORELEI 27 +#define BATTLE_TERRAIN_BRUNO 28 +#define BATTLE_TERRAIN_AGATHA 29 +#define BATTLE_TERRAIN_LANCE 30 +#define BATTLE_TERRAIN_CHAMPION 31 -#define B_WAIT_TIME_LONG 64 -#define B_WAIT_TIME_MED 48 -#define B_WAIT_TIME_SHORT 32 +#define BATTLE_TERRAIN_COUNT 32 + +#define B_WAIT_TIME_LONG 64 +#define B_WAIT_TIME_MED 48 +#define B_WAIT_TIME_SHORT 32 +#define B_WAIT_TIME_SHORTEST 16 #define CASTFORM_NORMAL 0 #define CASTFORM_FIRE 1 @@ -377,4 +497,44 @@ // Indicator for the party summary bar to display an empty slot. #define HP_EMPTY_SLOT 0xFFFF +#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) +#define MOVE_TARGET_ALLY (1 << 7) +#define MOVE_TARGET_ALL_BATTLERS ((1 << 8) | MOVE_TARGET_USER) + +// For the second argument of GetMoveTarget, when no target override is needed +#define NO_TARGET_OVERRIDE 0 + +// Constants for Parental Bond +#define PARENTAL_BOND_1ST_HIT 2 +#define PARENTAL_BOND_2ND_HIT 1 +#define PARENTAL_BOND_OFF 0 + +// Constants for if HandleScriptMegaPrimalBurst should handle Mega Evolution, Primal Reversion, or Ultra Burst. +#define HANDLE_TYPE_MEGA_EVOLUTION 0 +#define HANDLE_TYPE_PRIMAL_REVERSION 1 +#define HANDLE_TYPE_ULTRA_BURST 2 + +// Constants for Torment +#define PERMANENT_TORMENT 0xF + +// Constants for B_VAR_STARTING_STATUS +// Timer value controlled by B_VAR_STARTING_STATUS_TIMER +#define STARTING_STATUS_NONE 0 +#define STARTING_STATUS_ELECTRIC_TERRAIN 1 +#define STARTING_STATUS_MISTY_TERRAIN 2 +#define STARTING_STATUS_GRASSY_TERRAIN 3 +#define STARTING_STATUS_PSYCHIC_TERRAIN 4 +#define STARTING_STATUS_TRICK_ROOM 5 +#define STARTING_STATUS_MAGIC_ROOM 6 +#define STARTING_STATUS_WONDER_ROOM 7 +#define STARTING_STATUS_TAILWIND_PLAYER 8 +#define STARTING_STATUS_TAILWIND_OPPONENT 9 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 496e814e2..bd766df24 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -303,6 +303,13 @@ #define ANIM_ATK_PARTNER 2 #define ANIM_DEF_PARTNER 3 +// Below are used by AnimTask_ShakeMon2 and AnimTask_SetGrayscaleOrOriginalPal +#define ANIM_PLAYER_LEFT (MAX_BATTLERS_COUNT + 0) +#define ANIM_OPPONENT_LEFT (MAX_BATTLERS_COUNT + 1) +#define ANIM_PLAYER_RIGHT (MAX_BATTLERS_COUNT + 2) +#define ANIM_OPPONENT_RIGHT (MAX_BATTLERS_COUNT + 3) +#define ANIM_ATTACKER_FORCE (MAX_BATTLERS_COUNT + 4) + // stereo panning constants [0-255] // // 0 @@ -347,7 +354,7 @@ #define BG_SOLAR_BEAM_CONTESTS 26 // table ids for general animations (gBattleAnims_General) -#define B_ANIM_CASTFORM_CHANGE 0 +#define B_ANIM_FORM_CHANGE 0 #define B_ANIM_STATS_CHANGE 1 #define B_ANIM_SUBSTITUTE_FADE 2 #define B_ANIM_SUBSTITUTE_APPEAR 3 @@ -356,7 +363,7 @@ #define B_ANIM_TURN_TRAP 6 #define B_ANIM_HELD_ITEM_EFFECT 7 #define B_ANIM_SMOKEBALL_ESCAPE 8 -#define B_ANIM_FOCUS_BAND 9 +#define B_ANIM_HANGED_ON 9 #define B_ANIM_RAIN_CONTINUES 10 #define B_ANIM_SUN_CONTINUES 11 #define B_ANIM_SANDSTORM_CONTINUES 12 @@ -375,6 +382,8 @@ #define B_ANIM_SILPH_SCOPED 25 #define B_ANIM_ROCK_THROW 26 #define B_ANIM_SAFARI_REACTION 27 +#define B_ANIM_RESTORE_BG 28 // for Terrain Endings +#define B_ANIM_SLIDE_OFFSCREEN 29 // for Emergency Exit // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 5555eecb9..50fac7c56 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -1,219 +1,476 @@ #ifndef GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #define GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H -#define EFFECT_HIT 0 -#define EFFECT_SLEEP 1 -#define EFFECT_POISON_HIT 2 -#define EFFECT_ABSORB 3 -#define EFFECT_BURN_HIT 4 -#define EFFECT_FREEZE_HIT 5 -#define EFFECT_PARALYZE_HIT 6 -#define EFFECT_EXPLOSION 7 -#define EFFECT_DREAM_EATER 8 -#define EFFECT_MIRROR_MOVE 9 -#define EFFECT_ATTACK_UP 10 -#define EFFECT_DEFENSE_UP 11 -#define EFFECT_SPEED_UP 12 -#define EFFECT_SPECIAL_ATTACK_UP 13 -#define EFFECT_SPECIAL_DEFENSE_UP 14 -#define EFFECT_ACCURACY_UP 15 -#define EFFECT_EVASION_UP 16 -#define EFFECT_ALWAYS_HIT 17 -#define EFFECT_ATTACK_DOWN 18 -#define EFFECT_DEFENSE_DOWN 19 -#define EFFECT_SPEED_DOWN 20 -#define EFFECT_SPECIAL_ATTACK_DOWN 21 // unused -#define EFFECT_SPECIAL_DEFENSE_DOWN 22 // unused -#define EFFECT_ACCURACY_DOWN 23 -#define EFFECT_EVASION_DOWN 24 -#define EFFECT_HAZE 25 -#define EFFECT_BIDE 26 -#define EFFECT_RAMPAGE 27 -#define EFFECT_ROAR 28 -#define EFFECT_MULTI_HIT 29 -#define EFFECT_CONVERSION 30 -#define EFFECT_FLINCH_HIT 31 -#define EFFECT_RESTORE_HP 32 -#define EFFECT_TOXIC 33 -#define EFFECT_PAY_DAY 34 -#define EFFECT_LIGHT_SCREEN 35 -#define EFFECT_TRI_ATTACK 36 -#define EFFECT_REST 37 -#define EFFECT_OHKO 38 -#define EFFECT_RAZOR_WIND 39 -#define EFFECT_SUPER_FANG 40 -#define EFFECT_DRAGON_RAGE 41 -#define EFFECT_TRAP 42 -#define EFFECT_HIGH_CRITICAL 43 -#define EFFECT_DOUBLE_HIT 44 -#define EFFECT_RECOIL_IF_MISS 45 -#define EFFECT_MIST 46 -#define EFFECT_FOCUS_ENERGY 47 -#define EFFECT_RECOIL 48 -#define EFFECT_CONFUSE 49 -#define EFFECT_ATTACK_UP_2 50 -#define EFFECT_DEFENSE_UP_2 51 -#define EFFECT_SPEED_UP_2 52 -#define EFFECT_SPECIAL_ATTACK_UP_2 53 -#define EFFECT_SPECIAL_DEFENSE_UP_2 54 -#define EFFECT_ACCURACY_UP_2 55 -#define EFFECT_EVASION_UP_2 56 -#define EFFECT_TRANSFORM 57 -#define EFFECT_ATTACK_DOWN_2 58 -#define EFFECT_DEFENSE_DOWN_2 59 -#define EFFECT_SPEED_DOWN_2 60 -#define EFFECT_SPECIAL_ATTACK_DOWN_2 61 -#define EFFECT_SPECIAL_DEFENSE_DOWN_2 62 -#define EFFECT_ACCURACY_DOWN_2 63 -#define EFFECT_EVASION_DOWN_2 64 -#define EFFECT_REFLECT 65 -#define EFFECT_POISON 66 -#define EFFECT_PARALYZE 67 -#define EFFECT_ATTACK_DOWN_HIT 68 -#define EFFECT_DEFENSE_DOWN_HIT 69 -#define EFFECT_SPEED_DOWN_HIT 70 -#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 71 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 72 -#define EFFECT_ACCURACY_DOWN_HIT 73 -#define EFFECT_EVASION_DOWN_HIT 74 -#define EFFECT_SKY_ATTACK 75 -#define EFFECT_CONFUSE_HIT 76 -#define EFFECT_TWINEEDLE 77 -#define EFFECT_VITAL_THROW 78 -#define EFFECT_SUBSTITUTE 79 -#define EFFECT_RECHARGE 80 -#define EFFECT_RAGE 81 -#define EFFECT_MIMIC 82 -#define EFFECT_METRONOME 83 -#define EFFECT_LEECH_SEED 84 -#define EFFECT_SPLASH 85 -#define EFFECT_DISABLE 86 -#define EFFECT_LEVEL_DAMAGE 87 -#define EFFECT_PSYWAVE 88 -#define EFFECT_COUNTER 89 -#define EFFECT_ENCORE 90 -#define EFFECT_PAIN_SPLIT 91 -#define EFFECT_SNORE 92 -#define EFFECT_CONVERSION_2 93 -#define EFFECT_LOCK_ON 94 -#define EFFECT_SKETCH 95 -#define EFFECT_UNUSED_60 96 // thaw -#define EFFECT_SLEEP_TALK 97 -#define EFFECT_DESTINY_BOND 98 -#define EFFECT_FLAIL 99 -#define EFFECT_SPITE 100 -#define EFFECT_FALSE_SWIPE 101 -#define EFFECT_HEAL_BELL 102 -#define EFFECT_QUICK_ATTACK 103 -#define EFFECT_TRIPLE_KICK 104 -#define EFFECT_THIEF 105 -#define EFFECT_MEAN_LOOK 106 -#define EFFECT_NIGHTMARE 107 -#define EFFECT_MINIMIZE 108 -#define EFFECT_CURSE 109 -#define EFFECT_UNUSED_6E 110 -#define EFFECT_PROTECT 111 -#define EFFECT_SPIKES 112 -#define EFFECT_FORESIGHT 113 -#define EFFECT_PERISH_SONG 114 -#define EFFECT_SANDSTORM 115 -#define EFFECT_ENDURE 116 -#define EFFECT_ROLLOUT 117 -#define EFFECT_SWAGGER 118 -#define EFFECT_FURY_CUTTER 119 -#define EFFECT_ATTRACT 120 -#define EFFECT_RETURN 121 -#define EFFECT_PRESENT 122 -#define EFFECT_FRUSTRATION 123 -#define EFFECT_SAFEGUARD 124 -#define EFFECT_THAW_HIT 125 -#define EFFECT_MAGNITUDE 126 -#define EFFECT_BATON_PASS 127 -#define EFFECT_PURSUIT 128 -#define EFFECT_RAPID_SPIN 129 -#define EFFECT_SONICBOOM 130 -#define EFFECT_UNUSED_83 131 -#define EFFECT_MORNING_SUN 132 -#define EFFECT_SYNTHESIS 133 -#define EFFECT_MOONLIGHT 134 -#define EFFECT_HIDDEN_POWER 135 -#define EFFECT_RAIN_DANCE 136 -#define EFFECT_SUNNY_DAY 137 -#define EFFECT_DEFENSE_UP_HIT 138 -#define EFFECT_ATTACK_UP_HIT 139 -#define EFFECT_ALL_STATS_UP_HIT 140 -#define EFFECT_UNUSED_8D 141 // incomplete fake out in gen 2 -#define EFFECT_BELLY_DRUM 142 -#define EFFECT_PSYCH_UP 143 -#define EFFECT_MIRROR_COAT 144 -#define EFFECT_SKULL_BASH 145 -#define EFFECT_TWISTER 146 -#define EFFECT_EARTHQUAKE 147 -#define EFFECT_FUTURE_SIGHT 148 -#define EFFECT_GUST 149 -#define EFFECT_FLINCH_MINIMIZE_HIT 150 // STOMP ASTONISH EXTRASENSORY NEEDLE_ARM -#define EFFECT_SOLAR_BEAM 151 -#define EFFECT_THUNDER 152 -#define EFFECT_TELEPORT 153 -#define EFFECT_BEAT_UP 154 -#define EFFECT_SEMI_INVULNERABLE 155 -#define EFFECT_DEFENSE_CURL 156 -#define EFFECT_SOFTBOILED 157 -#define EFFECT_FAKE_OUT 158 -#define EFFECT_UPROAR 159 -#define EFFECT_STOCKPILE 160 -#define EFFECT_SPIT_UP 161 -#define EFFECT_SWALLOW 162 -#define EFFECT_UNUSED_A3 163 -#define EFFECT_HAIL 164 -#define EFFECT_TORMENT 165 -#define EFFECT_FLATTER 166 -#define EFFECT_WILL_O_WISP 167 -#define EFFECT_MEMENTO 168 -#define EFFECT_FACADE 169 -#define EFFECT_FOCUS_PUNCH 170 -#define EFFECT_SMELLINGSALT 171 -#define EFFECT_FOLLOW_ME 172 -#define EFFECT_NATURE_POWER 173 -#define EFFECT_CHARGE 174 -#define EFFECT_TAUNT 175 -#define EFFECT_HELPING_HAND 176 -#define EFFECT_TRICK 177 -#define EFFECT_ROLE_PLAY 178 -#define EFFECT_WISH 179 -#define EFFECT_ASSIST 180 -#define EFFECT_INGRAIN 181 -#define EFFECT_SUPERPOWER 182 -#define EFFECT_MAGIC_COAT 183 -#define EFFECT_RECYCLE 184 -#define EFFECT_REVENGE 185 -#define EFFECT_BRICK_BREAK 186 -#define EFFECT_YAWN 187 -#define EFFECT_KNOCK_OFF 188 -#define EFFECT_ENDEAVOR 189 -#define EFFECT_ERUPTION 190 -#define EFFECT_SKILL_SWAP 191 -#define EFFECT_IMPRISON 192 -#define EFFECT_REFRESH 193 -#define EFFECT_GRUDGE 194 -#define EFFECT_SNATCH 195 -#define EFFECT_LOW_KICK 196 -#define EFFECT_SECRET_POWER 197 -#define EFFECT_DOUBLE_EDGE 198 -#define EFFECT_TEETER_DANCE 199 -#define EFFECT_BLAZE_KICK 200 -#define EFFECT_MUD_SPORT 201 -#define EFFECT_POISON_FANG 202 -#define EFFECT_WEATHER_BALL 203 -#define EFFECT_OVERHEAT 204 -#define EFFECT_TICKLE 205 -#define EFFECT_COSMIC_POWER 206 -#define EFFECT_SKY_UPPERCUT 207 -#define EFFECT_BULK_UP 208 -#define EFFECT_POISON_TAIL 209 -#define EFFECT_WATER_SPORT 210 -#define EFFECT_CALM_MIND 211 -#define EFFECT_DRAGON_DANCE 212 -#define EFFECT_CAMOUFLAGE 213 + + +#define EFFECT_PLACEHOLDER 0 + #define EFFECT_HIT 1 + #define EFFECT_SLEEP 2 + #define EFFECT_ABSORB 3 + #define EFFECT_EXPLOSION 4 + #define EFFECT_DREAM_EATER 5 + #define EFFECT_MIRROR_MOVE 6 + #define EFFECT_ATTACK_UP 7 + #define EFFECT_DEFENSE_UP 8 + #define EFFECT_SPEED_UP 9 + #define EFFECT_SPECIAL_ATTACK_UP 10 + #define EFFECT_SPECIAL_DEFENSE_UP 11 + #define EFFECT_ACCURACY_UP 12 + #define EFFECT_EVASION_UP 13 + #define EFFECT_SPECIAL_ATTACK_UP_3 14 + #define EFFECT_ATTACK_DOWN 15 + #define EFFECT_DEFENSE_DOWN 16 + #define EFFECT_SPEED_DOWN 17 + #define EFFECT_SPECIAL_ATTACK_DOWN 18 + #define EFFECT_SPECIAL_DEFENSE_DOWN 19 + #define EFFECT_ACCURACY_DOWN 20 + #define EFFECT_EVASION_DOWN 21 + #define EFFECT_HAZE 22 + #define EFFECT_BIDE 23 + #define EFFECT_ROAR 24 + #define EFFECT_MULTI_HIT 25 + #define EFFECT_CONVERSION 26 + #define EFFECT_RESTORE_HP 27 + #define EFFECT_TOXIC 28 + #define EFFECT_LIGHT_SCREEN 29 + #define EFFECT_REST 30 + #define EFFECT_OHKO 31 + #define EFFECT_FUSION_COMBO 32 + #define EFFECT_SUPER_FANG 33 + #define EFFECT_FIXED_DAMAGE_ARG 34 + #define EFFECT_HEAL_BLOCK 35 + #define EFFECT_RECOIL_IF_MISS 36 + #define EFFECT_MIST 37 + #define EFFECT_FOCUS_ENERGY 38 + #define EFFECT_CONFUSE 39 + #define EFFECT_ATTACK_UP_2 40 + #define EFFECT_DEFENSE_UP_2 41 + #define EFFECT_SPEED_UP_2 42 + #define EFFECT_SPECIAL_ATTACK_UP_2 43 + #define EFFECT_SPECIAL_DEFENSE_UP_2 44 + #define EFFECT_ACCURACY_UP_2 45 + #define EFFECT_EVASION_UP_2 46 + #define EFFECT_TRANSFORM 47 + #define EFFECT_ATTACK_DOWN_2 48 + #define EFFECT_DEFENSE_DOWN_2 49 + #define EFFECT_SPEED_DOWN_2 50 + #define EFFECT_SPECIAL_ATTACK_DOWN_2 51 + #define EFFECT_SPECIAL_DEFENSE_DOWN_2 52 + #define EFFECT_ACCURACY_DOWN_2 53 + #define EFFECT_EVASION_DOWN_2 54 + #define EFFECT_REFLECT 55 + #define EFFECT_POISON 56 + #define EFFECT_PARALYZE 57 + #define EFFECT_TWO_TURNS_ATTACK 58 + #define EFFECT_SUBSTITUTE 59 + #define EFFECT_RAGE 60 + #define EFFECT_MIMIC 61 + #define EFFECT_METRONOME 62 + #define EFFECT_LEECH_SEED 63 + #define EFFECT_DO_NOTHING 64 + #define EFFECT_DISABLE 65 + #define EFFECT_LEVEL_DAMAGE 66 + #define EFFECT_PSYWAVE 67 + #define EFFECT_COUNTER 68 + #define EFFECT_ENCORE 69 + #define EFFECT_PAIN_SPLIT 70 + #define EFFECT_SNORE 71 + #define EFFECT_CONVERSION_2 72 + #define EFFECT_LOCK_ON 73 + #define EFFECT_SKETCH 74 + #define EFFECT_SLEEP_TALK 75 + #define EFFECT_DESTINY_BOND 76 + #define EFFECT_FLAIL 77 + #define EFFECT_SPITE 78 + #define EFFECT_FALSE_SWIPE 79 + #define EFFECT_HEAL_BELL 80 + #define EFFECT_TRIPLE_KICK 81 + #define EFFECT_MEAN_LOOK 82 + #define EFFECT_NIGHTMARE 83 + #define EFFECT_MINIMIZE 84 + #define EFFECT_CURSE 85 + #define EFFECT_HEALING_WISH 86 + #define EFFECT_PROTECT 87 + #define EFFECT_SPIKES 88 + #define EFFECT_FORESIGHT 89 + #define EFFECT_PERISH_SONG 90 + #define EFFECT_SANDSTORM 91 + #define EFFECT_ENDURE 92 + #define EFFECT_ROLLOUT 93 + #define EFFECT_SWAGGER 94 + #define EFFECT_FURY_CUTTER 95 + #define EFFECT_ATTRACT 96 + #define EFFECT_RETURN 97 + #define EFFECT_PRESENT 98 + #define EFFECT_FRUSTRATION 99 + #define EFFECT_SAFEGUARD 100 + #define EFFECT_MAGNITUDE 101 + #define EFFECT_BATON_PASS 102 + #define EFFECT_PURSUIT 103 + #define EFFECT_CAPTIVATE 104 + #define EFFECT_MORNING_SUN 105 + #define EFFECT_SYNTHESIS 106 + #define EFFECT_MOONLIGHT 107 + #define EFFECT_HIDDEN_POWER 108 + #define EFFECT_RAIN_DANCE 109 + #define EFFECT_SUNNY_DAY 110 + #define EFFECT_FELL_STINGER 111 + #define EFFECT_BELLY_DRUM 112 + #define EFFECT_PSYCH_UP 113 + #define EFFECT_MIRROR_COAT 114 + #define EFFECT_EARTHQUAKE 115 + #define EFFECT_FUTURE_SIGHT 116 + #define EFFECT_SOLAR_BEAM 117 + #define EFFECT_THUNDER 118 + #define EFFECT_TELEPORT 119 + #define EFFECT_BEAT_UP 120 + #define EFFECT_SEMI_INVULNERABLE 121 + #define EFFECT_DEFENSE_CURL 122 + #define EFFECT_SOFTBOILED 123 // differences vs Recover - can be used outside of battle to restore HP + #define EFFECT_FIRST_TURN_ONLY 124 + #define EFFECT_UPROAR 125 + #define EFFECT_STOCKPILE 126 + #define EFFECT_SPIT_UP 127 + #define EFFECT_SWALLOW 128 + #define EFFECT_WORRY_SEED 129 + #define EFFECT_HAIL 130 + #define EFFECT_TORMENT 131 + #define EFFECT_FLATTER 132 + #define EFFECT_WILL_O_WISP 133 + #define EFFECT_MEMENTO 134 + #define EFFECT_FACADE 135 + #define EFFECT_FOCUS_PUNCH 136 + #define EFFECT_DOUBLE_POWER_ON_ARG_STATUS 137 + #define EFFECT_FOLLOW_ME 138 + #define EFFECT_NATURE_POWER 139 + #define EFFECT_CHARGE 140 + #define EFFECT_TAUNT 141 + #define EFFECT_HELPING_HAND 142 + #define EFFECT_TRICK 143 + #define EFFECT_ROLE_PLAY 144 + #define EFFECT_WISH 145 + #define EFFECT_ASSIST 146 + #define EFFECT_INGRAIN 147 + #define EFFECT_MAGIC_COAT 148 + #define EFFECT_RECYCLE 149 + #define EFFECT_REVENGE 150 + #define EFFECT_BRICK_BREAK 151 + #define EFFECT_YAWN 152 + #define EFFECT_KNOCK_OFF 153 + #define EFFECT_ENDEAVOR 154 + #define EFFECT_ERUPTION 155 + #define EFFECT_SKILL_SWAP 156 + #define EFFECT_IMPRISON 157 + #define EFFECT_REFRESH 158 + #define EFFECT_GRUDGE 159 + #define EFFECT_SNATCH 160 + #define EFFECT_LOW_KICK 161 + #define EFFECT_HIT_ESCAPE 162 + #define EFFECT_MUD_SPORT 163 + #define EFFECT_WEATHER_BALL 164 + #define EFFECT_TICKLE 165 + #define EFFECT_COSMIC_POWER 166 + #define EFFECT_BULK_UP 167 + #define EFFECT_WATER_SPORT 168 + #define EFFECT_CALM_MIND 169 + #define EFFECT_DRAGON_DANCE 170 + #define EFFECT_CAMOUFLAGE 171 + #define EFFECT_PLEDGE 172 + #define EFFECT_FLING 173 + #define EFFECT_NATURAL_GIFT 174 + #define EFFECT_VARY_POWER_BASED_ON_HP 175 + #define EFFECT_ASSURANCE 176 + #define EFFECT_TRUMP_CARD 177 + #define EFFECT_ACROBATICS 178 + #define EFFECT_HEAT_CRASH 179 + #define EFFECT_PUNISHMENT 180 + #define EFFECT_STORED_POWER 181 + #define EFFECT_ELECTRO_BALL 182 + #define EFFECT_GYRO_BALL 183 + #define EFFECT_ECHOED_VOICE 184 + #define EFFECT_PAYBACK 185 + #define EFFECT_ROUND 186 + #define EFFECT_BRINE 187 + #define EFFECT_RETALIATE 188 + #define EFFECT_BULLDOZE 189 + #define EFFECT_FOUL_PLAY 190 + #define EFFECT_PSYSHOCK 191 + #define EFFECT_ROOST 192 + #define EFFECT_GRAVITY 193 + #define EFFECT_MIRACLE_EYE 194 + #define EFFECT_TAILWIND 195 + #define EFFECT_EMBARGO 196 + #define EFFECT_AQUA_RING 197 + #define EFFECT_TRICK_ROOM 198 + #define EFFECT_WONDER_ROOM 199 + #define EFFECT_MAGIC_ROOM 200 + #define EFFECT_MAGNET_RISE 201 + #define EFFECT_TOXIC_SPIKES 202 + #define EFFECT_GASTRO_ACID 203 + #define EFFECT_STEALTH_ROCK 204 + #define EFFECT_TELEKINESIS 205 + #define EFFECT_POWER_SWAP 206 + #define EFFECT_GUARD_SWAP 207 + #define EFFECT_HEART_SWAP 208 + #define EFFECT_POWER_SPLIT 209 + #define EFFECT_GUARD_SPLIT 210 + #define EFFECT_STICKY_WEB 211 + #define EFFECT_METAL_BURST 212 + #define EFFECT_LUCKY_CHANT 213 + #define EFFECT_SUCKER_PUNCH 214 + #define EFFECT_SIMPLE_BEAM 215 + #define EFFECT_ENTRAINMENT 216 + #define EFFECT_HEAL_PULSE 217 + #define EFFECT_QUASH 218 + #define EFFECT_ION_DELUGE 219 + #define EFFECT_FREEZE_DRY 220 + #define EFFECT_TOPSY_TURVY 221 + #define EFFECT_MISTY_TERRAIN 222 + #define EFFECT_GRASSY_TERRAIN 223 + #define EFFECT_ELECTRIC_TERRAIN 224 + #define EFFECT_PSYCHIC_TERRAIN 225 + #define EFFECT_ATTACK_ACCURACY_UP 226 + #define EFFECT_ATTACK_SPATK_UP 227 + #define EFFECT_TWO_TYPED_MOVE 228 + #define EFFECT_ME_FIRST 229 + #define EFFECT_QUIVER_DANCE 230 + #define EFFECT_COIL 231 + #define EFFECT_ELECTRIFY 232 + #define EFFECT_REFLECT_TYPE 233 + #define EFFECT_SOAK 234 + #define EFFECT_GROWTH 235 + #define EFFECT_LAST_RESORT 236 + #define EFFECT_SHELL_SMASH 237 + #define EFFECT_SHIFT_GEAR 238 + #define EFFECT_DEFENSE_UP_3 239 + #define EFFECT_NOBLE_ROAR 240 + #define EFFECT_VENOM_DRENCH 241 + #define EFFECT_TOXIC_THREAD 242 + #define EFFECT_HIT_SWITCH_TARGET 243 + #define EFFECT_FINAL_GAMBIT 244 + #define EFFECT_CHANGE_TYPE_ON_ITEM 245 + #define EFFECT_AUTOTOMIZE 246 + #define EFFECT_COPYCAT 247 + #define EFFECT_DEFOG 248 + #define EFFECT_HIT_ENEMY_HEAL_ALLY 249 + #define EFFECT_SYNCHRONOISE 250 + #define EFFECT_PSYCHO_SHIFT 251 + #define EFFECT_POWER_TRICK 252 + #define EFFECT_AFTER_YOU 253 + #define EFFECT_BESTOW 254 + #define EFFECT_ROTOTILLER 255 + #define EFFECT_FLOWER_SHIELD 256 + #define EFFECT_SPEED_SWAP 257 + #define EFFECT_REVELATION_DANCE 258 + #define EFFECT_AURORA_VEIL 259 + #define EFFECT_THIRD_TYPE 260 + #define EFFECT_ACUPRESSURE 261 + #define EFFECT_AROMATIC_MIST 262 + #define EFFECT_POWDER 263 + #define EFFECT_BELCH 264 + #define EFFECT_PARTING_SHOT 265 + #define EFFECT_MAT_BLOCK 266 + #define EFFECT_STOMPING_TANTRUM 267 + #define EFFECT_INSTRUCT 268 + #define EFFECT_LASER_FOCUS 269 + #define EFFECT_MAGNETIC_FLUX 270 + #define EFFECT_GEAR_UP 271 + #define EFFECT_STRENGTH_SAP 272 + #define EFFECT_MIND_BLOWN 273 + #define EFFECT_PURIFY 274 + #define EFFECT_FAIL_IF_NOT_ARG_TYPE 275 + #define EFFECT_SHORE_UP 276 + #define EFFECT_GEOMANCY 277 + #define EFFECT_FAIRY_LOCK 278 + #define EFFECT_ALLY_SWITCH 279 + #define EFFECT_RELIC_SONG 280 + #define EFFECT_BODY_PRESS 281 + #define EFFECT_EERIE_SPELL 282 + #define EFFECT_JUNGLE_HEALING 283 + #define EFFECT_COACHING 284 + #define EFFECT_LASH_OUT 285 + #define EFFECT_GRASSY_GLIDE 286 + #define EFFECT_DYNAMAX_DOUBLE_DMG 287 + #define EFFECT_DECORATE 288 + #define EFFECT_SNIPE_SHOT 289 + #define EFFECT_RECOIL_HP_25 290 + #define EFFECT_STUFF_CHEEKS 291 + #define EFFECT_GRAV_APPLE 292 + #define EFFECT_GLITZY_GLOW 293 + #define EFFECT_BADDY_BAD 294 + #define EFFECT_SAPPY_SEED 295 + #define EFFECT_FREEZY_FROST 296 + #define EFFECT_SPARKLY_SWIRL 297 + #define EFFECT_PLASMA_FISTS 298 + #define EFFECT_HYPERSPACE_FURY 299 + #define EFFECT_AURA_WHEEL 300 + #define EFFECT_PHOTON_GEYSER 301 + #define EFFECT_SHELL_SIDE_ARM 302 + #define EFFECT_TERRAIN_PULSE 303 + #define EFFECT_NO_RETREAT 304 + #define EFFECT_TAR_SHOT 305 + #define EFFECT_POLTERGEIST 306 + #define EFFECT_OCTOLOCK 307 + #define EFFECT_CLANGOROUS_SOUL 308 + #define EFFECT_BOLT_BEAK 309 + #define EFFECT_SKY_DROP 310 + #define EFFECT_EXPANDING_FORCE 311 + #define EFFECT_RISING_VOLTAGE 312 + #define EFFECT_BEAK_BLAST 313 + #define EFFECT_COURT_CHANGE 314 + #define EFFECT_MAX_HP_50_RECOIL 315 + #define EFFECT_EXTREME_EVOBOOST 316 + #define EFFECT_HIT_SET_REMOVE_TERRAIN 317 + #define EFFECT_DARK_VOID 318 + #define EFFECT_VICTORY_DANCE 319 + #define EFFECT_TEATIME 320 + #define EFFECT_ATTACK_UP_USER_ALLY 321 + #define EFFECT_SHELL_TRAP 322 + #define EFFECT_PSYBLADE 323 + #define EFFECT_HYDRO_STEAM 324 + #define EFFECT_REVIVAL_BLESSING 325 + #define EFFECT_SNOWSCAPE 326 + #define EFFECT_TAKE_HEART 327 + #define EFFECT_COLLISION_COURSE 328 + #define EFFECT_CORROSIVE_GAS 329 + #define EFFECT_POPULATION_BOMB 330 + #define EFFECT_SALT_CURE 331 + #define EFFECT_CHILLY_RECEPTION 332 + #define EFFECT_MAX_MOVE 333 + #define EFFECT_GLAIVE_RUSH 334 + #define EFFECT_RAGING_BULL 335 + #define EFFECT_RAGE_FIST 336 + #define EFFECT_DOODLE 337 + #define EFFECT_FILLET_AWAY 338 + #define EFFECT_IVY_CUDGEL 339 + #define EFFECT_FICKLE_BEAM 340 + #define EFFECT_BLIZZARD 341 + #define EFFECT_RAIN_ALWAYS_HIT 342 // Unlike EFFECT_THUNDER it doesn't get its accuracy reduced under sun. + #define EFFECT_SHED_TAIL 343 + #define EFFECT_UPPER_HAND 344 + #define EFFECT_DRAGON_CHEER 345 + #define EFFECT_LAST_RESPECTS 346 + #define EFFECT_TIDY_UP 347 + // leftovers from original so game doesnt break + #define EFFECT_POISON_HIT 349 + #define EFFECT_BURN_HIT 350 + #define EFFECT_FREEZE_HIT 351 + #define EFFECT_PARALYZE_HIT 352 + #define EFFECT_ALWAYS_HIT 353 + #define EFFECT_RAMPAGE 354 + #define EFFECT_FLINCH_HIT 355 + #define EFFECT_PAY_DAY 356 + #define EFFECT_TRI_ATTACK 357 + #define EFFECT_RAZOR_WIND 358 + #define EFFECT_DRAGON_RAGE 359 + #define EFFECT_TRAP 360 + #define EFFECT_HIGH_CRITICAL 361 + #define EFFECT_DOUBLE_HIT 362 + #define EFFECT_RECOIL 363 + #define EFFECT_ATTACK_DOWN_HIT 364 + #define EFFECT_DEFENSE_DOWN_HIT 365 + #define EFFECT_SPEED_DOWN_HIT 366 + #define EFFECT_SPECIAL_ATTACK_DOWN_HIT 367 + #define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 368 + #define EFFECT_ACCURACY_DOWN_HIT 369 + #define EFFECT_EVASION_DOWN_HIT 370 + #define EFFECT_SKY_ATTACK 371 + #define EFFECT_CONFUSE_HIT 372 + #define EFFECT_TWINEEDLE 373 + #define EFFECT_VITAL_THROW 374 + #define EFFECT_RECHARGE 375 + #define EFFECT_SPLASH 376 + #define EFFECT_UNUSED_60 377 + #define EFFECT_QUICK_ATTACK 378 + #define EFFECT_THIEF 379 + #define EFFECT_UNUSED_6E 380 + #define EFFECT_THAW_HIT 381 + #define EFFECT_RAPID_SPIN 382 + #define EFFECT_SONICBOOM 383 + #define EFFECT_UNUSED_83 384 + #define EFFECT_DEFENSE_UP_HIT 385 + #define EFFECT_ATTACK_UP_HIT 386 + #define EFFECT_ALL_STATS_UP_HIT 387 + #define EFFECT_UNUSED_8D 388 // incomplete fake out in gen 2 + #define EFFECT_SKULL_BASH 389 + #define EFFECT_TWISTER 390 + #define EFFECT_GUST 391 + #define EFFECT_FLINCH_MINIMIZE_HIT 392 // STOMP ASTONISH EXTRASENSORY NEEDLE_ARM + #define EFFECT_FAKE_OUT 393 + #define EFFECT_UNUSED_A3 394 + #define EFFECT_SMELLINGSALT 395 + #define EFFECT_SUPERPOWER 396 + #define EFFECT_SECRET_POWER 397 + #define EFFECT_DOUBLE_EDGE 398 + #define EFFECT_TEETER_DANCE 399 + #define EFFECT_BLAZE_KICK 400 + #define EFFECT_POISON_FANG 401 + #define EFFECT_OVERHEAT 402 + #define EFFECT_SKY_UPPERCUT 403 + #define EFFECT_POISON_TAIL 404 + + #define NUM_BATTLE_MOVE_EFFECTS 405 + + +// enum { +// EFFECT_POISON_HIT, +// EFFECT_BURN_HIT , +// EFFECT_FREEZE_HIT , +// EFFECT_PARALYZE_HIT , +// EFFECT_ALWAYS_HIT , +// EFFECT_RAMPAGE , +// EFFECT_FLINCH_HIT , +// EFFECT_PAY_DAY , +// EFFECT_TRI_ATTACK , +// EFFECT_RAZOR_WIND , +// EFFECT_DRAGON_RAGE , +// EFFECT_TRAP , +// EFFECT_HIGH_CRITICAL , +// EFFECT_DOUBLE_HIT , +// EFFECT_RECOIL , +// EFFECT_ATTACK_DOWN_HIT , +// EFFECT_DEFENSE_DOWN_HIT , +// EFFECT_SPEED_DOWN_HIT , +// EFFECT_SPECIAL_ATTACK_DOWN_HIT , +// EFFECT_SPECIAL_DEFENSE_DOWN_HIT , +// EFFECT_ACCURACY_DOWN_HIT , +// EFFECT_EVASION_DOWN_HIT , +// EFFECT_SKY_ATTACK , +// EFFECT_CONFUSE_HIT , +// EFFECT_TWINEEDLE , +// EFFECT_VITAL_THROW , +// EFFECT_RECHARGE , +// EFFECT_SPLASH , +// EFFECT_UNUSED_60, +// EFFECT_QUICK_ATTACK , +// EFFECT_THIEF , +// EFFECT_UNUSED_6E , +// EFFECT_THAW_HIT , +// EFFECT_RAPID_SPIN , +// EFFECT_SONICBOOM , +// EFFECT_UNUSED_83 , +// EFFECT_DEFENSE_UP_HIT , +// EFFECT_ATTACK_UP_HIT , +// EFFECT_ALL_STATS_UP_HIT , +// EFFECT_UNUSED_8D , // incomplete fake out in gen 2 +// EFFECT_SKULL_BASH , +// EFFECT_TWISTER , +// EFFECT_GUST , +// EFFECT_FLINCH_MINIMIZE_HIT , // STOMP ASTONISH EXTRASENSORY NEEDLE_ARM +// EFFECT_FAKE_OUT , +// EFFECT_UNUSED_A3 , +// EFFECT_SMELLINGSALT , +// EFFECT_SUPERPOWER , +// EFFECT_SECRET_POWER , +// EFFECT_DOUBLE_EDGE , +// EFFECT_TEETER_DANCE , +// EFFECT_BLAZE_KICK , +// EFFECT_POISON_FANG , +// EFFECT_OVERHEAT , +// EFFECT_SKY_UPPERCUT , +// EFFECT_POISON_TAIL +// } + + #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 061dad1e5..c726366b4 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -2,30 +2,45 @@ #define GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H // The following correspond to the struct members of BattleScripting by adding their offset -#define sPAINSPLIT_HP gBattleScripting + 0x00 // painSplitHp -#define sBIDE_DMG gBattleScripting + 0x04 // bideDmg -#define sMULTIHIT_STRING gBattleScripting + 0x08 // multihitString -#define sDMG_MULTIPLIER gBattleScripting + 0x0E // dmgMultiplier -#define sTWOTURN_STRINGID gBattleScripting + 0x0F // twoTurnsMoveStringId -#define sB_ANIM_ARG1 gBattleScripting + 0x10 // animArg1 -#define sB_ANIM_ARG2 gBattleScripting + 0x11 // animArg2 -#define sTRIPLE_KICK_POWER gBattleScripting + 0x12 // tripleKickPower -#define sMOVEEND_STATE gBattleScripting + 0x14 // moveendState -#define sBATTLER_WITH_ABILITY gBattleScripting + 0x15 // battlerWithAbility -#define sMULTIHIT_EFFECT gBattleScripting + 0x16 // multihitMoveEffect -#define sBATTLER gBattleScripting + 0x17 // battler -#define sB_ANIM_TURN gBattleScripting + 0x18 // animTurn -#define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19 // animTargetsHit -#define sSTATCHANGER gBattleScripting + 0x1A // statChanger -#define sSTAT_ANIM_PLAYED gBattleScripting + 0x1B // statAnimPlayed -#define sGIVEEXP_STATE gBattleScripting + 0x1C // getexpState -#define sBATTLE_STYLE gBattleScripting + 0x1D // battleStyle -#define sLVLBOX_STATE gBattleScripting + 0x1E // drawlvlupboxState -#define sLEARNMOVE_STATE gBattleScripting + 0x1F // learnMoveState -#define sPURSUIT_DOUBLES_ATTACKER gBattleScripting + 0x20 // pursuitDoublesAttacker -#define sRESHOW_MAIN_STATE gBattleScripting + 0x21 // reshowMainState -#define sRESHOW_HELPER_STATE gBattleScripting + 0x22 // reshowHelperState -#define sLVLUP_HP gBattleScripting + 0x23 // levelUpHP +#define sPAINSPLIT_HP (gBattleScripting + 0x00) // painSplitHp +#define sBIDE_DMG (gBattleScripting + 0x04) // bideDmg +#define sMULTIHIT_STRING (gBattleScripting + 0x08) // multihitString +#define sEXP_CATCH (gBattleScripting + 0x0E) // expOnCatch +#define sUNUSED (gBattleScripting + 0x0F) // unused +#define sB_ANIM_ARG1 (gBattleScripting + 0x10) // animArg1 +#define sB_ANIM_ARG2 (gBattleScripting + 0x11) // animArg2 +#define sSAVED_STRINID (gBattleScripting + 0x12) // savedStringId +#define sMOVEEND_STATE (gBattleScripting + 0x14) // moveendState +#define sSAVED_STAT_CHANGER (gBattleScripting + 0x15) // savedStatChanger +#define sSHIFT_SWITCHED (gBattleScripting + 0x16) // shiftSwitched +#define sBATTLER (gBattleScripting + 0x17) // battler +#define sB_ANIM_TURN (gBattleScripting + 0x18) // animTurn +#define sB_ANIM_TARGETS_HIT (gBattleScripting + 0x19) // animTargetsHit +#define sSTATCHANGER (gBattleScripting + 0x1A) // statChanger +#define sSTAT_ANIM_PLAYED (gBattleScripting + 0x1B) // statAnimPlayed +#define sGIVEEXP_STATE (gBattleScripting + 0x1C) // getexpState +#define sBATTLE_STYLE (gBattleScripting + 0x1D) // battleStyle +#define sLVLBOX_STATE (gBattleScripting + 0x1E) // drawlvlupboxState +#define sLEARNMOVE_STATE (gBattleScripting + 0x1F) // learnMoveState +#define sSAVED_BATTLER (gBattleScripting + 0x20) // savedBattler +#define sRESHOW_MAIN_STATE (gBattleScripting + 0x21) // reshowMainState +#define sRESHOW_HELPER_STATE (gBattleScripting + 0x22) // reshowHelperState +#define sLVLUP_HP (gBattleScripting + 0x23) // levelUpHP +#define sWINDOWS_TYPE (gBattleScripting + 0x24) // windowsType +#define sMULTIPLAYER_ID (gBattleScripting + 0x25) // multiplayerId +#define sSPECIAL_TRAINER_BATTLE_TYPE (gBattleScripting + 0x26) // specialTrainerBattleType +#define sMON_CAUGHT (gBattleScripting + 0x27) // monCaught +#define sSAVED_DMG (gBattleScripting + 0x28) // savedDmg +#define sSAVED_MOVE_EFFECT (gBattleScripting + 0x2C) // savedMoveEffect +#define sMOVE_EFFECT (gBattleScripting + 0x2E) // moveEffect +#define sMULTIHIT_EFFECT (gBattleScripting + 0x30) // multihitMoveEffect +#define sILLUSION_NICK_HACK (gBattleScripting + 0x32) // illusionNickHack +#define sFIXED_ABILITY_POPUP (gBattleScripting + 0x33) // fixedPopup +#define sABILITY_OVERWRITE (gBattleScripting + 0x34) // abilityPopupOverwrite +#define sSWITCH_CASE (gBattleScripting + 0x36) // switchCase +#define sBERRY_OVERRIDE (gBattleScripting + 0x37) // overrideBerryRequirements +#define sSTICKY_WEB_STAT_DROP (gBattleScripting + 0x38) // stickyWebStatDrop +#define sDMG_MULTIPLIER (gBattleScripting + 0x39) // dmgMultiplier // Array entries for battle communication #define MULTIUSE_STATE 0 @@ -40,7 +55,6 @@ #define MSG_DISPLAY 7 #define BATTLE_COMMUNICATION_ENTRIES_COUNT 8 -#define cEFFECT_CHOOSER (gBattleCommunication + MOVE_EFFECT_BYTE) #define cMULTISTRING_CHOOSER (gBattleCommunication + MULTISTRING_CHOOSER) #define cMISS_TYPE (gBattleCommunication + MISS_TYPE) @@ -54,12 +68,14 @@ #define BS_FAINTED_LINK_MULTIPLE_2 6 // for openpartyscreen #define BS_BATTLER_0 7 #define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability -#define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability +#define BS_TARGET_SIDE 9 // for Cmd_jumpifability #define BS_SCRIPTING 10 #define BS_PLAYER1 11 #define BS_OPPONENT1 12 #define BS_PLAYER2 13 // for Cmd_updatestatusicon #define BS_OPPONENT2 14 +#define BS_ABILITY_BATTLER 15 +#define BS_ATTACKER_PARTNER 16 // atk 01, accuracy calc #define NO_ACC_CALC 0xFFFE @@ -76,32 +92,180 @@ // TODO: documentation // atk76, various -#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 -#define VARIOUS_SET_MAGIC_COAT_TARGET 1 -#define VARIOUS_IS_RUNNING_IMPOSSIBLE 2 -#define VARIOUS_GET_MOVE_TARGET 3 -#define VARIOUS_GET_BATTLER_FAINTED 4 -#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5 -#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6 -#define VARIOUS_RESET_PLAYER_FAINTED 7 -#define VARIOUS_GET_BATTLERS_FOR_RECALL 8 -#define VARIOUS_RETURN_OPPONENT_MON1 9 -#define VARIOUS_RETURN_OPPONENT_MON2 10 -#define VARIOUS_CHECK_POKEFLUTE 11 -#define VARIOUS_WAIT_FANFARE 12 -#define VARIOUS_PLAY_MOVE_ANIMATION 36 +// pokeemerald +// Cmd_various +#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 +#define VARIOUS_SET_MAGIC_COAT_TARGET 1 +#define VARIOUS_IS_RUNNING_IMPOSSIBLE 2 +#define VARIOUS_GET_MOVE_TARGET 3 +#define VARIOUS_GET_BATTLER_FAINTED 4 +#define VARIOUS_RESET_SWITCH_IN_ABILITY_BITS 5 +#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6 +#define VARIOUS_RESET_PLAYER_FAINTED 7 +#define VARIOUS_PALACE_FLAVOR_TEXT 8 // unused from pokeemerald +#define VARIOUS_ARENA_JUDGMENT_WINDOW 9 // unused, from pokeemerald +#define VARIOUS_ARENA_OPPONENT_MON_LOST 10 // unused, from pokeemerald +#define VARIOUS_ARENA_PLAYER_MON_LOST 11 // unused, from pokeemerald +#define VARIOUS_ARENA_BOTH_MONS_LOST 12 // unused, from pokeemerald +#define VARIOUS_EMIT_YESNOBOX 13 // unused, from pokeemerald +#define VARIOUS_DRAW_ARENA_REF_TEXT_BOX 14 // unused, from pokeemerald +#define VARIOUS_ERASE_ARENA_REF_TEXT_BOX 15 // unused, from pokeemerald +#define VARIOUS_ARENA_JUDGMENT_STRING 16 // unused, from pokeemerald +#define VARIOUS_ARENA_WAIT_STRING 17 // unused, from pokeemerald +#define VARIOUS_WAIT_CRY 18 +#define VARIOUS_RETURN_OPPONENT_MON1 19 +#define VARIOUS_RETURN_OPPONENT_MON2 20 +#define VARIOUS_VOLUME_DOWN 21 +#define VARIOUS_VOLUME_UP 22 +#define VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT 23 +#define VARIOUS_PALACE_TRY_ESCAPE_STATUS 24 // unused from pokeemerald +#define VARIOUS_SET_TELEPORT_OUTCOME 25 +#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26 +#define VARIOUS_STAT_TEXT_BUFFER 27 +#define VARIOUS_SWITCHIN_ABILITIES 28 +#define VARIOUS_SAVE_TARGET 29 +#define VARIOUS_RESTORE_TARGET 30 +#define VARIOUS_INSTANT_HP_DROP 31 +#define VARIOUS_CLEAR_STATUS 32 +#define VARIOUS_RESTORE_PP 33 +#define VARIOUS_TRY_ACTIVATE_MOXIE 34 +#define VARIOUS_TRY_ACTIVATE_FELL_STINGER 35 +#define VARIOUS_PLAY_MOVE_ANIMATION 36 +#define VARIOUS_SET_LUCKY_CHANT 37 +#define VARIOUS_SUCKER_PUNCH_CHECK 38 +#define VARIOUS_SET_SIMPLE_BEAM 39 +#define VARIOUS_TRY_ENTRAINMENT 40 +#define VARIOUS_SET_LAST_USED_ABILITY 41 +#define VARIOUS_INVERT_STAT_STAGES 42 +#define VARIOUS_TRY_ME_FIRST 43 +#define VARIOUS_JUMP_IF_BATTLE_END 44 +#define VARIOUS_TRY_ELECTRIFY 45 +#define VARIOUS_TRY_REFLECT_TYPE 46 +#define VARIOUS_TRY_SOAK 47 +#define VARIOUS_HANDLE_MEGA_EVO 48 +#define VARIOUS_TRY_LAST_RESORT 49 +#define VARIOUS_SET_ARG_TO_BATTLE_DAMAGE 50 +#define VARIOUS_TRY_HIT_SWITCH_TARGET 51 +#define VARIOUS_TRY_AUTOTOMIZE 52 +#define VARIOUS_ABILITY_POPUP 53 +#define VARIOUS_JUMP_IF_TARGET_ALLY 54 +#define VARIOUS_TRY_SYNCHRONOISE 55 +#define VARIOUS_PSYCHO_SHIFT 56 +#define VARIOUS_CURE_STATUS 57 +#define VARIOUS_POWER_TRICK 58 +#define VARIOUS_AFTER_YOU 59 +#define VARIOUS_BESTOW 60 +#define VARIOUS_JUMP_IF_NOT_GROUNDED 61 +#define VARIOUS_HANDLE_TRAINER_SLIDE_MSG 62 +#define VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF 63 +#define VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON 64 +#define VARIOUS_SET_AURORA_VEIL 65 +#define VARIOUS_TRY_THIRD_TYPE 66 +#define VARIOUS_ACUPRESSURE 67 +#define VARIOUS_SET_POWDER 68 +#define VARIOUS_SPECTRAL_THIEF 69 +#define VARIOUS_GRAVITY_ON_AIRBORNE_MONS 70 +#define VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS 71 +#define VARIOUS_JUMP_IF_ROAR_FAILS 72 +#define VARIOUS_TRY_INSTRUCT 73 +#define VARIOUS_JUMP_IF_NOT_BERRY 74 +#define VARIOUS_TRACE_ABILITY 75 +#define VARIOUS_UPDATE_NICK 76 +#define VARIOUS_TRY_ILLUSION_OFF 77 +#define VARIOUS_SET_SPRITEIGNORE0HP 78 +#define VARIOUS_HANDLE_FORM_CHANGE 79 +#define VARIOUS_GET_STAT_VALUE 80 +#define VARIOUS_JUMP_IF_FULL_HP 81 +#define VARIOUS_LOSE_TYPE 82 +#define VARIOUS_TRY_ACTIVATE_SOULHEART 83 +#define VARIOUS_TRY_ACTIVATE_RECEIVER 84 +#define VARIOUS_TRY_ACTIVATE_BEAST_BOOST 85 +#define VARIOUS_TRY_FRISK 86 +#define VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED 87 +#define VARIOUS_TRY_FAIRY_LOCK 88 +#define VARIOUS_JUMP_IF_NO_ALLY 89 +#define VARIOUS_POISON_TYPE_IMMUNITY 90 +#define VARIOUS_JUMP_IF_HOLD_EFFECT 91 +#define VARIOUS_INFATUATE_WITH_BATTLER 92 +#define VARIOUS_SET_LAST_USED_ITEM 93 +#define VARIOUS_PARALYZE_TYPE_IMMUNITY 94 +#define VARIOUS_JUMP_IF_ABSENT 95 +#define VARIOUS_DESTROY_ABILITY_POPUP 96 +#define VARIOUS_TOTEM_BOOST 97 +#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 98 +#define VARIOUS_MOVEEND_ITEM_EFFECTS 99 +#define VARIOUS_TERRAIN_SEED 100 +#define VARIOUS_MAKE_INVISIBLE 101 +#define VARIOUS_ROOM_SERVICE 102 +#define VARIOUS_EERIE_SPELL_PP_REDUCE 103 +#define VARIOUS_JUMP_IF_TEAM_HEALTHY 104 +#define VARIOUS_TRY_HEAL_QUARTER_HP 105 +#define VARIOUS_REMOVE_TERRAIN 106 +#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 107 +#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 108 +#define VARIOUS_GET_ROTOTILLER_TARGETS 109 +#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 110 +#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 111 +#define VARIOUS_CONSUME_BERRY 112 +#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 113 +#define VARIOUS_JUMP_IF_SPECIES 114 +#define VARIOUS_UPDATE_ABILITY_POPUP 115 +#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 116 +#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 117 +#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 118 +#define VARIOUS_SHELL_SIDE_ARM_CHECK 119 +#define VARIOUS_TRY_NO_RETREAT 120 +#define VARIOUS_TRY_TAR_SHOT 121 +#define VARIOUS_CAN_TAR_SHOT_WORK 122 +#define VARIOUS_CHECK_POLTERGEIST 123 +#define VARIOUS_CUT_1_3_HP_RAISE_STATS 124 +#define VARIOUS_TRY_END_NEUTRALIZING_GAS 125 +#define VARIOUS_JUMP_IF_UNDER_200 126 +#define VARIOUS_SET_SKY_DROP 127 +#define VARIOUS_CLEAR_SKY_DROP 128 +#define VARIOUS_SKY_DROP_YAWN 129 +#define VARIOUS_CURE_CERTAIN_STATUSES 130 +#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 131 +#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 132 +#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 133 +#define VARIOUS_SAVE_BATTLER_ITEM 134 +#define VARIOUS_RESTORE_BATTLER_ITEM 135 +#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 136 +#define VARIOUS_SET_BEAK_BLAST 137 +#define VARIOUS_SWAP_SIDE_STATUSES 138 +#define VARIOUS_SWAP_STATS 139 +#define VARIOUS_TEATIME_INVUL 140 +#define VARIOUS_TEATIME_TARGETS 141 +#define VARIOUS_TRY_WIND_RIDER_POWER 142 +#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 143 +#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 144 +#define VARIOUS_STORE_HEALING_WISH 145 +#define VARIOUS_HIT_SWITCH_TARGET_FAILED 146 +#define VARIOUS_TRY_REVIVAL_BLESSING 147 +// pokefirered +#define VARIOUS_GET_BATTLERS_FOR_RECALL 148 // for battle tower +#define VARIOUS_CHECK_POKEFLUTE 149 // pokeflute +#define VARIOUS_WAIT_FANFARE 151 // pokeflute and other -// Cmd_manipulatedmg +// Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 #define DMG_RECOIL_FROM_MISS 1 #define DMG_DOUBLED 2 +#define DMG_1_8_TARGET_HP 3 +#define DMG_FULL_ATTACKER_HP 4 +#define DMG_CURR_ATTACKER_HP 5 +#define DMG_BIG_ROOT 6 +#define DMG_1_2_ATTACKER_HP 7 +#define DMG_RECOIL_FROM_IMMUNE 8 // Used to calculate recoil for the Gen 4 version of Jump Kick // Cmd_jumpifcantswitch #define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7) // Cmd_statbuffchange #define STAT_CHANGE_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange +#define STAT_CHANGE_MIRROR_ARMOR (1 << 1) // Stat change redirection caused by Mirror Armor ability. #define STAT_CHANGE_NOT_PROTECT_AFFECTED (1 << 5) +#define STAT_CHANGE_UPDATE_MOVE_EFFECT (1 << 6) // stat change flags for Cmd_playstatchangeanimation #define STAT_CHANGE_NEGATIVE (1 << 0) @@ -122,23 +286,55 @@ #define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen // cases for Cmd_moveend -#define MOVEEND_RAGE 0 -#define MOVEEND_DEFROST 1 -#define MOVEEND_SYNCHRONIZE_TARGET 2 -#define MOVEEND_ON_DAMAGE_ABILITIES 3 -#define MOVEEND_IMMUNITY_ABILITIES 4 -#define MOVEEND_SYNCHRONIZE_ATTACKER 5 -#define MOVEEND_CHOICE_MOVE 6 -#define MOVEEND_CHANGED_ITEMS 7 -#define MOVEEND_ATTACKER_INVISIBLE 8 -#define MOVEEND_ATTACKER_VISIBLE 9 -#define MOVEEND_TARGET_VISIBLE 10 -#define MOVEEND_ITEM_EFFECTS_ALL 11 -#define MOVEEND_KINGSROCK_SHELLBELL 12 -#define MOVEEND_SUBSTITUTE 13 -#define MOVEEND_UPDATE_LAST_MOVES 14 -#define MOVEEND_MIRROR_MOVE 15 -#define MOVEEND_NEXT_TARGET 16 -#define MOVEEND_COUNT 17 +#define MOVEEND_SUM_DAMAGE 0 +#define MOVEEND_PROTECT_LIKE_EFFECT 1 +#define MOVEEND_RAGE 2 +#define MOVEEND_SYNCHRONIZE_TARGET 3 +#define MOVEEND_ABILITIES 4 +#define MOVEEND_ABILITIES_ATTACKER 5 +#define MOVEEND_STATUS_IMMUNITY_ABILITIES 6 +#define MOVEEND_SYNCHRONIZE_ATTACKER 7 +#define MOVEEND_CHOICE_MOVE 8 +#define MOVEEND_ATTACKER_INVISIBLE 9 +#define MOVEEND_ATTACKER_VISIBLE 10 +#define MOVEEND_TARGET_VISIBLE 11 +#define MOVEEND_ITEM_EFFECTS_TARGET 12 +#define MOVEEND_MOVE_EFFECTS2 13 +#define MOVEEND_ITEM_EFFECTS_ALL 14 +#define MOVEEND_KINGSROCK 15 // These item effects will occur each strike of a multi-hit move +#define MOVEEND_NUM_HITS 16 +#define MOVEEND_SUBSTITUTE 17 +#define MOVEEND_SKY_DROP_CONFUSE 18 +#define MOVEEND_UPDATE_LAST_MOVES 19 +#define MOVEEND_MIRROR_MOVE 20 +#define MOVEEND_NEXT_TARGET 21 // Everything up until here is handled for each strike of a multi-hit move +#define MOVEEND_MULTIHIT_MOVE 22 +#define MOVEEND_DEFROST 23 +#define MOVEEND_RECOIL 24 +#define MOVEEND_MAGICIAN 25 // Occurs after final multi-hit strike, and after other items/abilities would activate +#define MOVEEND_EJECT_ITEMS 26 +#define MOVEEND_WHITE_HERB 27 +#define MOVEEND_RED_CARD 28 +#define MOVEEND_LIFEORB_SHELLBELL 29 // Includes shell bell, throat spray, etc +#define MOVEEND_CHANGED_ITEMS 30 +#define MOVEEND_PICKPOCKET 31 +#define MOVEEND_DANCER 32 +#define MOVEEND_EMERGENCY_EXIT 33 +#define MOVEEND_SYMBIOSIS 34 +#define MOVEEND_OPPORTUNIST 35 // Occurs after other stat change items/abilities to try and copy the boosts +#define MOVEEND_SAME_MOVE_TURNS 36 +#define MOVEEND_SET_EVOLUTION_TRACKER 37 +#define MOVEEND_CLEAR_BITS 38 +#define MOVEEND_COUNT 39 + +// switch cases +#define B_SWITCH_NORMAL 0 +#define B_SWITCH_HIT 1 // dragon tail, circle throw +#define B_SWITCH_RED_CARD 2 + +// Argument labels for EFFECT_HIT_SET_REMOVE_TERRAIN +#define ARG_SET_PSYCHIC_TERRAIN 0 +#define ARG_TRY_REMOVE_TERRAIN_HIT 1 +#define ARG_TRY_REMOVE_TERRAIN_FAIL 2 #endif // GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 36e259f50..0774af257 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -1,12 +1,13 @@ #ifndef GUARD_BATTLE_STRING_IDS_H #define GUARD_BATTLE_STRING_IDS_H -#define STRINGID_INTROMSG 0 +#define STRINGID_INTROMSG 0 #define STRINGID_INTROSENDOUT 1 -#define STRINGID_RETURNMON 2 +#define STRINGID_RETURNMON 2 #define STRINGID_SWITCHINMON 3 -#define STRINGID_USEDMOVE 4 -#define STRINGID_BATTLEEND 5 +#define STRINGID_USEDMOVE 4 +#define STRINGID_BATTLEEND 5 +#define STRINGID_TRAINERSLIDE 6 // todo: make some of those names less vague: attacker/target vs pkmn, etc. @@ -388,8 +389,191 @@ #define STRINGID_ITEMRESTOREDSPECIESHEALTH 386 #define STRINGID_ITEMRESTOREDSPECIESPP 387 #define STRINGID_ITEMCUREDSPECIESSTATUS 388 +#define STRINGID_ELECTROSHOTCHARGING 389 +#define STRINGID_METEORBEAMCHARGING 390 +#define STRINGID_CLOAKEDINAHARSHLIGHT 391 +#define STRINGID_VANISHEDINSTANTLY 392 +#define STRINGID_PKMNTOOKTARGETHIGH 393 +#define STRINGID_CLOAKEDINAFREEZINGLIGHT 394 +#define STRINGID_PKNMABSORBINGPOWER 395 +#define STRINGID_POKEMONCANNOTUSEMOVE 396 +#define STRINGID_PKMNMOVEBOUNCEDABILITY 397 +#define STRINGID_HEALBLOCKPREVENTSUSAGE 398 +#define STRINGID_GRAVITYPREVENTSUSAGE 399 +#define STRINGID_PKMNFROSTBITEHEALED2 400 +#define STRINGID_PKMNFROSTBITEHEALEDBY 401 +#define STRINGID_SAFETYGOGGLESPROTECTED 402 +#define STRINGID_POWDEREXPLODES 403 +#define STRINGID_PKMNCANTUSEMOVETHROATCHOP 404 +#define STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN 405 +#define STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT 406 +#define STRINGID_TARGETATEITEM 407 +#define STRINGID_GEMACTIVATES 408 +#define STRINGID_ATTACKWEAKENEDBSTRONGWINDS 409 +#define STRINGID_ENDUREDSTURDY 410 +#define STRINGID_BERRYDMGREDUCES 411 +#define STRINGID_TARGETTOUGHEDITOUT 412 +#define STRINGID_TRAPPEDBYSWIRLINGMAGMA 413 +#define STRINGID_INFESTATION 414 +#define STRINGID_PKMNINSNAPTRAP 415 +#define STRINGID_THUNDERCAGETRAPPED 416 +#define STRINGID_RESETSTARGETSSTATLEVELS 417 +#define STRINGID_EXTREMESUNLIGHTFADED 418 +#define STRINGID_HEAVYRAINLIFTED 419 +#define STRINGID_STRONGWINDSDISSIPATED 420 +#define STRINGID_SYMBIOSISITEMPASS 421 +#define STRINGID_BURSTINGFLAMESHIT 422 +#define STRINGID_BROKETHROUGHPROTECTION 423 +#define STRINGID_FELLFORFEINT 424 +#define STRINGID_SPECTRALTHIEFSTEAL 425 +#define STRINGID_PKMNSABILITYSUPPRESSED 426 +#define STRINGID_INCINERATEBURN 427 +#define STRINGID_BUGBITE 428 +#define STRINGID_BOTHCANNOLONGERESCAPE 429 +#define STRINGID_ATTACKERLOSTFIRETYPE 430 +#define STRINGID_ATTACKERLOSTELECTRICTYPE 431 +#define STRINGID_ATTACKERLOSTITSTYPE 432 +#define STRINGID_STEALTHROCKDMG 433 +#define STRINGID_SHARPSTEELDMG 434 +#define STRINGID_POINTEDSTONESFLOAT 435 +#define STRINGID_SHARPSTEELFLOATS 436 +#define STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP 437 +#define STRINGID_AROMAVEILPROTECTED 438 +#define STRINGID_PKMNPREVENTEDFROMHEALING 439 +#define STRINGID_TERRAINBECOMESMISTY 440 +#define STRINGID_TERRAINBECOMESGRASSY 441 +#define STRINGID_TERRAINBECOMESELECTRIC 442 +#define STRINGID_TERRAINBECOMESPSYCHIC 443 +#define STRINGID_DIMENSIONSWERETWISTED 444 +#define STRINGID_BIZARREARENACREATED 445 +#define STRINGID_BIZARREAREACREATED 446 +#define STRINGID_TAILWINDBLEW 447 +#define STRINGID_ELECTRICTERRAINENDS 448 +#define STRINGID_MISTYTERRAINENDS 449 +#define STRINGID_PSYCHICTERRAINENDS 450 +#define STRINGID_GRASSYTERRAINENDS 451 +#define STRINGID_MOLDBREAKERENTERS 452 +#define STRINGID_TERAVOLTENTERS 453 +#define STRINGID_TURBOBLAZEENTERS 454 +#define STRINGID_SLOWSTARTENTERS 455 +#define STRINGID_UNNERVEENTERS 456 +#define STRINGID_ANTICIPATIONACTIVATES 457 +#define STRINGID_FOREWARNACTIVATES 458 +#define STRINGID_PRESSUREENTERS 459 +#define STRINGID_DARKAURAENTERS 460 +#define STRINGID_FAIRYAURAENTERS 461 +#define STRINGID_AURABREAKENTERS 462 +#define STRINGID_COMATOSEENTERS 463 +#define STRINGID_SCREENCLEANERENTERS 464 +#define STRINGID_ASONEENTERS 465 +#define STRINGID_CURIOUSMEDICINEENTERS 466 +#define STRINGID_PASTELVEILENTERS 467 +#define STRINGID_NEUTRALIZINGGASENTERS 468 +#define STRINGID_BEINGHITCHARGEDPKMNWITHPOWER 469 +#define STRINGID_IMPOSTERTRANSFORM 470 +#define STRINGID_SNOWWARNINGHAIL 471 +#define STRINGID_SNOWWARNINGSNOW 472 +#define STRINGID_SUPERSWEETAROMAWAFTS 473 +#define STRINGID_AIRLOCKACTIVATES 474 +#define STRINGID_BATTLERABILITYRAISEDSTAT 475 +#define STRINGID_EXTREMELYHARSHSUNLIGHT 476 +#define STRINGID_HEAVYRAIN 477 +#define STRINGID_MYSTERIOUSAIRCURRENT 478 +#define STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT 479 +#define STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN 480 +#define STRINGID_ZEROTOHEROTRANSFORMATION 481 +#define STRINGID_HOSPITALITYRESTORATION 482 +#define STRINGID_HARVESTBERRY 483 +#define STRINGID_BADDREAMSDMG 484 +#define STRINGID_SOLARPOWERHPDROP 485 +#define STRINGID_HEALERCURE 486 +#define STRINGID_FETCHEDPOKEBALL 487 +#define STRINGID_TARGETABILITYSTATLOWER 488 +#define STRINGID_TARGETSTATWONTGOHIGHER 489 +#define STRINGID_TARGETABILITYSTATRAISE 490 +#define STRINGID_CUSEDBODYDISABLED 491 +#define STRINGID_ATTACKERACQUIREDABILITY 492 +#define STRINGID_SWAPPEDABILITIES 493 +#define STRINGID_TARGETSSTATWASMAXEDOUT 494 +#define STRINGID_PKMNSABILITYPREVENTSABILITY 495 +#define STRINGID_AFTERMATHDMG 496 +#define STRINGID_ILLUSIONWOREOFF 497 +#define STRINGID_ASANDSTORMKICKEDUP 498 +#define STRINGID_PKMNSWILLPERISHIN3TURNS 499 +#define STRINGID_POISONSPIKESSCATTERED 500 +#define STRINGID_OPPORTUNISTCOPIED 501 +#define STRINGID_PKMNGOTOVERITSINFATUATION 502 +#define STRINGID_PKMNSHOOKOFFTHETAUNT 503 +#define STRINGID_SUNLIGHTACTIVATEDABILITY 504 +#define STRINGID_STATWASHEIGHTENED 505 +#define STRINGID_BATTLERTYPECHANGEDTO 506 +#define STRINGID_ELECTRICTERRAINACTIVATEDABILITY 507 +#define STRINGID_FRISKACTIVATES 508 +#define STRINGID_ATTACKERABILITYSTATRAISE 509 +#define STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED 510 +#define STRINGID_NORELIEFROMHEAVYRAIN 511 +#define STRINGID_MYSTERIOUSAIRCURRENTBLOWSON 512 +#define STRINGID_AURAFLAREDTOLIFE 513 +#define STRINGID_ATKGOTOVERINFATUATION 514 +#define STRINGID_TORMENTEDNOMORE 515 +#define STRINGID_BUFFERENDS 516 +#define STRINGID_HEALBLOCKEDNOMORE 517 +#define STRINGID_MICLEBERRYACTIVATES 518 +#define STRINGID_MIRRORHERBCOPIED 519 +#define STRINGID_PKMNSITEMHEALEDFROSTBITE 520 +#define STRINGID_AIRBALLOONFLOAT 521 +#define STRINGID_EJECTBUTTONACTIVATE 522 +#define STRINGID_HURTBYITEM 523 +#define STRINGID_AIRBALLOONPOP 524 +#define STRINGID_STICKYBARBTRANSFER 525 +#define STRINGID_TEAMGAINEDEXP 526 +#define STRINGID_PKMNFROSTBITEHEALED 527 +#define STRINGID_STOCKPILEDEFFECTWOREOFF 528 +#define STRINGID_FELLSTRAIGHTDOWN 529 +#define STRINGID_TARGETWOKEUP 530 +#define STRINGID_PKMNBURNHEALED 531 +#define STRINGID_REDCARDACTIVATE 532 +#define STRINGID_MOVEBLOCKEDBYDYNAMAX 533 +#define STRINGID_ITEMCANNOTBEREMOVED 534 +#define STRINGID_ZMOVERESETSSTATS 535 +#define STRINGID_ZMOVEZBOOSTCRIT 536 +#define STRINGID_ZMOVERESTOREHP 537 +#define STRINGID_ZMOVESTATUP 538 +#define STRINGID_ZMOVEHPTRAP 539 +#define STRINGID_ZMOVEALLSTATSUP 540 +#define STRINGID_PKMNREVERTEDTOPRIMAL 541 +#define STRINGID_HEALINGWISHHEALED 542 +#define STRINGID_TOXICSPIKESABSORBED 543 +#define STRINGID_TOXICSPIKESPOISONED 544 +#define STRINGID_STICKYWEBSWITCHIN 545 +#define STRINGID_HEALINGWISHCAMETRUE 546 +#define STRINGID_LUNARDANCECAMETRUE 547 +#define STRINGID_SPIKESDISAPPEAREDFROMTEAM 548 +#define STRINGID_TOXICSPIKESDISAPPEAREDFROMTEAM 549 +#define STRINGID_STICKYWEBDISAPPEAREDFROMTEAM 550 +#define STRINGID_STEALTHROCKDISAPPEAREDFROMTEAM 551 +#define STRINGID_SHARPSTEELDISAPPEAREDFROMTEAM 552 +#define STRINGID_LASTABILITYRAISEDSTAT 553 +#define STRINGID_RECEIVERABILITYTAKEOVER 554 +#define STRINGID_NEUTRALIZINGGASOVER 555 +#define STRINGID_ATTACKERBECAMEFULLYCHARGED 556 +#define STRINGID_ATTACKERBECAMEASHSPECIES 557 +#define STRINGID_PROTECTEDTEAM 558 +#define STRINGID_ELECTRICTERRAINPREVENTS 559 +#define STRINGID_MISTYTERRAINPREVENTS 560 +#define STRINGID_PSYCHICTERRAINPREVENTS 561 +#define STRINGID_FLOWERVEILPROTECTED 562 +#define STRINGID_DRASTICALLY 563 +#define STRINGID_SEVERELY 564 +#define STRINGID_CLEARAMULETWONTLOWERSTATS 565 +#define STRINGID_CELEBRATEMESSAGE 566 +#define STRINGID_PKMNBLEWAWAYTOXICSPIKES 567 +#define STRINGID_PKMNBLEWAWAYSTICKYWEB 568 +#define STRINGID_PKMNBLEWAWAYSTEALTHROCK 569 +#define STRINGID_PKMNBLEWAWAYSHARPSTEEL 570 +#define STRINGID_PKMNGOTFROSTBITE 571 -#define BATTLESTRINGS_COUNT 389 +#define BATTLESTRINGS_COUNT 572 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, @@ -472,6 +656,7 @@ #define B_MSG_PROTECTED_ITSELF 0 #define B_MSG_BRACED_ITSELF 1 #define B_MSG_PROTECT_FAILED 2 +#define B_MSG_PROTECTED_TEAM 3 // gRestUsedStringIds #define B_MSG_REST 0 @@ -544,6 +729,10 @@ #define B_MSG_SOMEONES_BOX_FULL 2 #define B_MSG_BILLS_BOX_FULL 3 +// gPrimalWeatherBlocksStringIds +#define B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN 0 +#define B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN 1 + // gInobedientStringIds #define B_MSG_LOAFING 0 #define B_MSG_WONT_OBEY 1 @@ -590,6 +779,93 @@ #define B_MSG_DEFROSTED 0 #define B_MSG_DEFROSTED_BY_MOVE 1 -#define NUM_TRAPPING_MOVES 6 +// gFrostbiteHealedStringIds +#define B_MSG_FROSTBITE_HEALED 0 +#define B_MSG_FROSTBITE_HEALED_BY_MOVE 1 + +// gSwitchInAbilityStringIds +#define B_MSG_SWITCHIN_MOLDBREAKER 0 +#define B_MSG_SWITCHIN_TERAVOLT 1 +#define B_MSG_SWITCHIN_TURBOBLAZE 2 +#define B_MSG_SWITCHIN_SLOWSTART 3 +#define B_MSG_SWITCHIN_UNNERVE 4 +#define B_MSG_SWITCHIN_ANTICIPATION 5 +#define B_MSG_SWITCHIN_FOREWARN 6 +#define B_MSG_SWITCHIN_PRESSURE 7 +#define B_MSG_SWITCHIN_DARKAURA 8 +#define B_MSG_SWITCHIN_FAIRYAURA 9 +#define B_MSG_SWITCHIN_AURABREAK 10 +#define B_MSG_SWITCHIN_COMATOSE 11 +#define B_MSG_SWITCHIN_SCREENCLEANER 12 +#define B_MSG_SWITCHIN_ASONE 13 +#define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14 +#define B_MSG_SWITCHIN_PASTEL_VEIL 15 +#define B_MSG_SWITCHIN_NEUTRALIZING_GAS 16 + +// gMentalHerbCureStringIds +#define B_MSG_MENTALHERBCURE_INFATUATION 0 +#define B_MSG_MENTALHERBCURE_TAUNT 1 +#define B_MSG_MENTALHERBCURE_ENCORE 2 +#define B_MSG_MENTALHERBCURE_TORMENT 3 +#define B_MSG_MENTALHERBCURE_HEALBLOCK 4 +#define B_MSG_MENTALHERBCURE_DISABLE 5 + +// gTerrainPreventsStringIds +#define B_MSG_TERRAINPREVENTS_MISTY 0 +#define B_MSG_TERRAINPREVENTS_ELECTRIC 1 +#define B_MSG_TERRAINPREVENTS_PSYCHIC 2 + +// gTerrainStringIds +#define B_MSG_TERRAIN_SET_MISTY 0 +#define B_MSG_TERRAIN_SET_ELECTRIC 1 +#define B_MSG_TERRAIN_SET_PSYCHIC 2 +#define B_MSG_TERRAIN_SET_GRASSY 3 +#define B_MSG_TERRAIN_END_MISTY 4 +#define B_MSG_TERRAIN_END_ELECTRIC 5 +#define B_MSG_TERRAIN_END_PSYCHIC 6 +#define B_MSG_TERRAIN_END_GRASSY 7 +#define B_MSG_TERRAIN_COUNT 8 + +// gStartingStatusStringIds +#define B_MSG_TERRAIN_SET_MISTY 0 +#define B_MSG_TERRAIN_SET_ELECTRIC 1 +#define B_MSG_TERRAIN_SET_PSYCHIC 2 +#define B_MSG_TERRAIN_SET_GRASSY 3 +#define B_MSG_SET_TRICK_ROOM 4 +#define B_MSG_SET_MAGIC_ROOM 5 +#define B_MSG_SET_WONDER_ROOM 6 +#define B_MSG_SET_TAILWIND_PLAYER 7 +#define B_MSG_SET_TAILWIND_OPPONENT 8 +#define B_MSG_STARTING_STATUS_COUNT 9 + +// gWrappedStringIds +#define B_MSG_WRAPPED_BIND 0 +#define B_MSG_WRAPPED_WRAP 1 +#define B_MSG_WRAPPED_FIRE_SPIN 2 +#define B_MSG_WRAPPED_CLAMP 3 +#define B_MSG_WRAPPED_WHIRLPOOL 4 +#define B_MSG_WRAPPED_SAND_TOMB 5 +#define B_MSG_WRAPPED_MAGMA_STORM 6 +#define B_MSG_WRAPPED_INFESTATION 7 +#define B_MSG_WRAPPED_SNAP_TRAP 8 +#define B_MSG_WRAPPED_THUNDER_CAGE 9 +#define NUM_TRAPPING_MOVES 10 + +// z effects (gZEffectStringIds) +#define B_MSG_Z_RESET_STATS 0 +#define B_MSG_Z_ALL_STATS_UP 1 +#define B_MSG_Z_BOOST_CRITS 2 +#define B_MSG_Z_FOLLOW_ME 3 +#define B_MSG_Z_RECOVER_HP 4 +#define B_MSG_Z_STAT_UP 5 +#define B_MSG_Z_HP_TRAP 6 + +// gDmgHazardsStringIds +#define B_MSG_PKMNHURTBYSPIKES 0 +#define B_MSG_STEALTHROCKDMG 1 +#define B_MSG_SHARPSTEELDMG 2 +#define B_MSG_POINTEDSTONESFLOAT 3 +#define B_MSG_SPIKESSCATTERED 4 +#define B_MSG_SHARPSTEELFLOATS 5 #endif // GUARD_BATTLE_STRING_IDS_H diff --git a/include/constants/battle_z_move_effects.h b/include/constants/battle_z_move_effects.h new file mode 100644 index 000000000..ce4d5c4ad --- /dev/null +++ b/include/constants/battle_z_move_effects.h @@ -0,0 +1,38 @@ +#ifndef GUARD_Z_MOVE_EFFECTS_H +#define GUARD_Z_MOVE_EFFECTS_H + +#define Z_EFFECT_NONE 0 +#define Z_EFFECT_RESET_STATS 1 +#define Z_EFFECT_ALL_STATS_UP_1 2 +#define Z_EFFECT_BOOST_CRITS 3 +#define Z_EFFECT_FOLLOW_ME 4 +#define Z_EFFECT_CURSE 5 +#define Z_EFFECT_RECOVER_HP 6 +#define Z_EFFECT_RESTORE_REPLACEMENT_HP 7 + +#define Z_EFFECT_ATK_UP_1 8 +#define Z_EFFECT_DEF_UP_1 9 +#define Z_EFFECT_SPD_UP_1 10 +#define Z_EFFECT_SPATK_UP_1 11 +#define Z_EFFECT_SPDEF_UP_1 12 +#define Z_EFFECT_ACC_UP_1 13 +#define Z_EFFECT_EVSN_UP_1 14 + +#define Z_EFFECT_ATK_UP_2 15 +#define Z_EFFECT_DEF_UP_2 16 +#define Z_EFFECT_SPD_UP_2 17 +#define Z_EFFECT_SPATK_UP_2 18 +#define Z_EFFECT_SPDEF_UP_2 19 +#define Z_EFFECT_ACC_UP_2 20 +#define Z_EFFECT_EVSN_UP_2 21 + +#define Z_EFFECT_ATK_UP_3 22 +#define Z_EFFECT_DEF_UP_3 23 +#define Z_EFFECT_SPD_UP_3 24 +#define Z_EFFECT_SPATK_UP_3 25 +#define Z_EFFECT_SPDEF_UP_3 26 +#define Z_EFFECT_ACC_UP_3 27 +#define Z_EFFECT_EVSN_UP_3 28 + + +#endif // GUARD_Z_MOVE_EFFECTS_H diff --git a/include/constants/form_change_types.h b/include/constants/form_change_types.h new file mode 100644 index 000000000..51325baf2 --- /dev/null +++ b/include/constants/form_change_types.h @@ -0,0 +1,123 @@ +#ifndef GUARD_CONSTANTS_FORM_CHANGE_TYPES_H +#define GUARD_CONSTANTS_FORM_CHANGE_TYPES_H + +// FORM_CHANGE_BATTLE_HP_PERCENT param2 arguments +#define HP_HIGHER_THAN 1 +#define HP_LOWER_EQ_THAN 2 +// FORM_CHANGE_MOVE param2 Arguments +#define WHEN_LEARNED 0 +#define WHEN_FORGOTTEN 1 +// FORM_CHANGE_ITEM_USE param2 Arguments +#define DAY 1 +#define NIGHT 2 + +#define FUSION_TERMINATOR 0xFF +#define FORM_CHANGE_TERMINATOR 0 + +// Form change that activates when the specified item is given to or taken from the selected Pokémon. +// param1: item to hold. +// param2: ability to check for, optional. +#define FORM_CHANGE_ITEM_HOLD 1 + +// Form change that activates when the item is used on the selected Pokémon. +// param1: item to use +// param2: time of day to check, optional. +// - DAY if Form change that activates in the daytime. +// - NIGHT if Form change that activates at nighttime. +#define FORM_CHANGE_ITEM_USE 2 + +// TODO: Form change that activates when the Pokémon learns or forgets the move. +// param1: move to check for +// param2: +// - WHEN_LEARNED if Form change that activates when move is forgotten +// - WHEN_FORGOTTEN if Form change that activates when move is learned +#define FORM_CHANGE_MOVE 3 + +// Form change that activates when the Pokémon is withdrawn from the PC or Daycare. +// Daycare withdraw done, PC withdraw TODO. +// - No parameters. +#define FORM_CHANGE_WITHDRAW 4 + +// Form change that activates when the Pokémon faints, either in battle or in the overworld by poison. +// If species is not specified and it's on the player's side, it will try to use the value +// saved in gBattleStruct->changedSpecies from a previous form change. +// - No parameters. +#define FORM_CHANGE_FAINT 5 + +// Form change that activates when the Pokémon is sent out at the beginning of a battle +// param1: item to hold, optional +// param2: a move that will be replaced, optional +// param3: a new move to replace it with, optional +#define FORM_CHANGE_BEGIN_BATTLE 6 + +// Form change that activates at the end of a battle. If species is not specified and it's on the player's side, it will try to use the value saved in gBattleStruct->changedSpecies from a previous form change. +// param1: item to hold, optional +// param2: a move that will be replaced, optional +// param3: a new move to replace it with, optional +#define FORM_CHANGE_END_BATTLE 7 + +// Form change that activates at the end of a battle based on the terrain if it participated in the battle and hasn't fainted. Takes priority over FORM_CHANGE_END_BATTLE. +// param1: battle terrain to check. +#define FORM_CHANGE_END_BATTLE_TERRAIN 8 + +// Form change that activates when the Pokémon is switched out in battle. +// - No parameters. +#define FORM_CHANGE_BATTLE_SWITCH 9 + +// Form change that activates when the Pokémon's HP % passes a certain threshold. +// param1: Ability to check. +// param2: HP comparer +// - HP_HIGHER_THAN if the form triggers when the current HP is higher than the specified threshold. +// - HP_LOWER_EQ_THAN if the form triggers when the current HP is lower or equal than the specified threshold. +// param3: HP percentage threshold. +#define FORM_CHANGE_BATTLE_HP_PERCENT 10 + +// Form change that activates when the mon has the defined item. +// If it's on the player's side, it also requires ITEM_MEGA_RING in the user's bag and for the player to trigger it by pressing START before selecting a move. +// param1: item to hold. +#define FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM 11 + +// Form change that activates when the mon has the defined move. +// If it's on the player's side, it also requires ITEM_MEGA_RING in the user's bag and for the player to trigger it by pressing START before selecting a move. +// param1: move to have. +#define FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE 12 + +// Form change that activates automatically when entering battle with the specified item. +// If the item is a Red Orb, it uses the Omega Symbol for the animation and icon. Otherwise, it defaults to the Alpha symbol. +// The battle indicator icon is based on the species, with Primal Groudon's as Omega and otherwise being Alpha. +// param1: item to hold. +#define FORM_CHANGE_BATTLE_PRIMAL_REVERSION 13 + +// Form change that activates when a specific weather is set during battle. +// param1: weather to check +// param2: (optional) revert if specified ability is lost +#define FORM_CHANGE_BATTLE_WEATHER 14 + +// Form change that activates automatically when the turn ends. +// param1: ability to check. +#define FORM_CHANGE_BATTLE_TURN_END 15 + +// Form change that activates when the mon has the defined item. +// If it's on the player's side, it also requires for the player to trigger it by pressing START before selecting a move. +// param1: item to hold. +#define FORM_CHANGE_BATTLE_ULTRA_BURST 16 + +// Form change that activates when the mon Dynamaxes (TODO: with Gigantamax factor). +// - No parameters +#define FORM_CHANGE_BATTLE_GIGANTAMAX 17 + +// Form change that activates at a certain time of day in the overworld automatically. +// param1: time of day to check. +// - DAY if Form change that activates in the daytime. +// - NIGHT if Form change that activates at nighttime. +#define FORM_CHANGE_TIME_OF_DAY 18 + +// Form change that depends on a multichoice (e.g. Rotom Catalog). +// param1: multichoice list (starting at 0). +#define FORM_CHANGE_ITEM_USE_MULTICHOICE 19 + +// Form change that activates when inflicted with a specific status +// param1: status +#define FORM_CHANGE_STATUS 20 + +#endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H diff --git a/include/constants/global.h b/include/constants/global.h index 3668131c9..19f0afa9d 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -36,6 +36,10 @@ #define GAME_LANGUAGE (LANGUAGE_ENGLISH) #endif +// party sizes +#define PARTY_SIZE 6 +#define MULTI_PARTY_SIZE (PARTY_SIZE / 2) + // capacities of various saveblock objects #define DAYCARE_MON_COUNT 2 #define PC_ITEMS_COUNT 30 @@ -83,8 +87,7 @@ #define TRAINER_ID_LENGTH 4 #define MAX_MON_MOVES 4 -#define PARTY_SIZE 6 -#define MULTI_PARTY_SIZE (PARTY_SIZE / 2) +#define ALL_MOVES_MASK ((1 << MAX_MON_MOVES) - 1) #define QUEST_LOG_SCENE_COUNT 4 diff --git a/include/constants/items.h b/include/constants/items.h index ff11e1c4d..b41ef1248 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -4,39 +4,74 @@ #define ITEM_NONE 0 // Poké Balls -#define ITEM_MASTER_BALL 1 -#define ITEM_ULTRA_BALL 2 -#define ITEM_GREAT_BALL 3 -#define ITEM_POKE_BALL 4 -#define ITEM_SAFARI_BALL 5 -#define ITEM_NET_BALL 6 -#define ITEM_DIVE_BALL 7 +#define ITEM_POKE_BALL 1 +#define ITEM_GREAT_BALL 2 +#define ITEM_ULTRA_BALL 3 +#define ITEM_MASTER_BALL 4 +#define ITEM_PREMIER_BALL 5 +#define ITEM_HEAL_BALL 6 +#define ITEM_NET_BALL 7 #define ITEM_NEST_BALL 8 -#define ITEM_REPEAT_BALL 9 -#define ITEM_TIMER_BALL 10 -#define ITEM_LUXURY_BALL 11 -#define ITEM_PREMIER_BALL 12 -#define ITEM_HEAL_BALL 13 -#define ITEM_DUSK_BALL 14 -#define ITEM_QUICK_BALL 15 -#define ITEM_LEVEL_BALL 16 -#define ITEM_LURE_BALL 17 -#define ITEM_MOON_BALL 18 -#define ITEM_FRIEND_BALL 19 -#define ITEM_LOVE_BALL 20 -#define ITEM_FAST_BALL 21 -#define ITEM_HEAVY_BALL 22 -#define ITEM_DREAM_BALL 23 +#define ITEM_DIVE_BALL 9 +#define ITEM_DUSK_BALL 10 +#define ITEM_TIMER_BALL 11 +#define ITEM_QUICK_BALL 12 +#define ITEM_REPEAT_BALL 13 +#define ITEM_LUXURY_BALL 14 +#define ITEM_LEVEL_BALL 15 +#define ITEM_LURE_BALL 16 +#define ITEM_MOON_BALL 17 +#define ITEM_FRIEND_BALL 18 +#define ITEM_LOVE_BALL 19 +#define ITEM_FAST_BALL 20 +#define ITEM_HEAVY_BALL 21 +#define ITEM_DREAM_BALL 22 +#define ITEM_SAFARI_BALL 23 #define ITEM_SPORT_BALL 24 #define ITEM_PARK_BALL 25 #define ITEM_BEAST_BALL 26 -#define ITEM_CHERISH_BALL 27 +#define ITEM_CHERISH_BALL 27 // TODO: throwing CHERISH_BALL restarts game, intended? // Note: If moving ball IDs around, updating FIRST_BALL/LAST_BALL is not sufficient // Several places expect the ball IDs to be first and contiguous (e.g. MON_DATA_POKEBALL) // If adding new balls, it's easiest to insert them after the last ball and increment the below IDs (and removing ITEM_034 for example) -#define FIRST_BALL ITEM_MASTER_BALL -#define LAST_BALL ITEM_PREMIER_BALL +#define FIRST_BALL ITEM_POKE_BALL +#define LAST_BALL ITEM_CHERISH_BALL + +// // Poké Balls +// #define ITEM_MASTER_BALL 1 +// #define ITEM_ULTRA_BALL 2 +// #define ITEM_GREAT_BALL 3 +// #define ITEM_POKE_BALL 4 +// #define ITEM_SAFARI_BALL 5 +// #define ITEM_NET_BALL 6 +// #define ITEM_DIVE_BALL 7 +// #define ITEM_NEST_BALL 8 +// #define ITEM_REPEAT_BALL 9 +// #define ITEM_TIMER_BALL 10 +// #define ITEM_LUXURY_BALL 11 +// #define ITEM_PREMIER_BALL 12 +// #define ITEM_HEAL_BALL 13 +// #define ITEM_DUSK_BALL 14 +// #define ITEM_QUICK_BALL 15 +// #define ITEM_LEVEL_BALL 16 +// #define ITEM_LURE_BALL 17 +// #define ITEM_MOON_BALL 18 +// #define ITEM_FRIEND_BALL 19 +// #define ITEM_LOVE_BALL 20 +// #define ITEM_FAST_BALL 21 +// #define ITEM_HEAVY_BALL 22 +// #define ITEM_DREAM_BALL 23 +// #define ITEM_SPORT_BALL 24 +// #define ITEM_PARK_BALL 25 +// #define ITEM_BEAST_BALL 26 +// #define ITEM_CHERISH_BALL 27 + +// // Note: If moving ball IDs around, updating FIRST_BALL/LAST_BALL is not sufficient +// // Several places expect the ball IDs to be first and contiguous (e.g. MON_DATA_POKEBALL) +// // If adding new balls, it's easiest to insert them after the last ball and increment the below IDs (and removing ITEM_034 for example) +// #define FIRST_BALL ITEM_MASTER_BALL +// #define LAST_BALL ITEM_CHERISH_BALL // Medicine #define ITEM_POTION 28 diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index 1321a4ced..05c046d16 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -70,8 +70,8 @@ #define PARTY_ACTION_CANT_SWITCH 2 #define PARTY_ACTION_USE_ITEM 3 #define PARTY_ACTION_ABILITY_PREVENTS 4 -#define PARTY_ACTION_GIVE_ITEM 5 -#define PARTY_ACTION_GIVE_PC_ITEM 6 +#define PARTY_ACTION_GIVE_ITEM 5 +#define PARTY_ACTION_GIVE_PC_ITEM 6 // Unused. Not possible to give non-mail items directly from PC #define PARTY_ACTION_GIVE_MAILBOX_MAIL 7 #define PARTY_ACTION_SWITCH 8 #define PARTY_ACTION_SWITCHING 9 @@ -79,7 +79,8 @@ #define PARTY_ACTION_CHOOSE_AND_CLOSE 11 #define PARTY_ACTION_MOVE_TUTOR 12 #define PARTY_ACTION_MINIGAME 13 -#define PARTY_ACTION_REUSABLE_ITEM 14 +#define PARTY_ACTION_REUSABLE_ITEM 14 // Unused. The only reusable items are handled separately +#define PARTY_ACTION_CHOOSE_FAINTED_MON 15 // TODO: Party actions // IDs for DisplayPartyMenuStdMessage, to display the message at the bottom of the party menu #define PARTY_MSG_CHOOSE_MON 0 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 711b923c2..3ad555baf 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -136,11 +136,16 @@ #define FRIENDSHIP_EVENT_FAINT_OUTSIDE_BATTLE 8 #define FRIENDSHIP_EVENT_FAINT_LARGE 9 -#if P_UPDATED_FRIENDSHIP >= GEN_8 -#define STANDARD_FRIENDSHIP 50 -#else -#define STANDARD_FRIENDSHIP 70 -#endif +// Constants for GetBattlerAffectionHearts (based on friendship value) +#define AFFECTION_NO_HEARTS 0 // 0-79 friendship +#define AFFECTION_ONE_HEART 1 // 80-129 friendship +#define AFFECTION_TWO_HEARTS 2 // 130-179 friendship +#define AFFECTION_THREE_HEARTS 3 // 180-219 friendship +#define AFFECTION_FOUR_HEARTS 4 // 220-254 friendship +#define AFFECTION_FIVE_HEARTS 5 // Max friendship + +// Friendship value that the majority of species use. +#define STANDARD_FRIENDSHIP ((P_UPDATED_FRIENDSHIP >= GEN_8) ? 50 : 70) #define MAX_FRIENDSHIP 255 #define MAX_SHEEN 255 @@ -153,6 +158,11 @@ #define MAX_TOTAL_EVS 510 #define EV_ITEM_RAISE_LIMIT ((I_VITAMIN_EV_CAP >= GEN_8) ? MAX_PER_STAT_EVS : 100) +// Move category defines. +#define DAMAGE_CATEGORY_PHYSICAL 0 +#define DAMAGE_CATEGORY_SPECIAL 1 +#define DAMAGE_CATEGORY_STATUS 2 + // Battle move flags #define FLAG_MAKES_CONTACT (1 << 0) #define FLAG_PROTECT_AFFECTED (1 << 1) @@ -253,6 +263,11 @@ // - Deoxys has 2 frames, 1 for each form #define MAX_MON_PIC_FRAMES 4 +#define BATTLE_ALIVE_EXCEPT_BATTLER 0 +#define BATTLE_ALIVE_SIDE 1 + +#define SKIP_FRONT_ANIM (1 << 7) + // used by ShouldIgnoreDeoxysForm #define DEOXYS_CHECK_BATTLE_SPRITE 1 #define DEOXYS_CHECK_TRADE_MAIN 3 diff --git a/include/constants/species.h b/include/constants/species.h index dd92a8c0e..07ebef6e1 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -419,7 +419,8 @@ #define SPECIES_BURMY_PLANT_CLOAK 412 #define SPECIES_WORMADAM SPECIES_WORMADAM_PLANT_CLOAK #define SPECIES_WORMADAM_PLANT_CLOAK 413 -#define SPECIES_MOTHIM 414 +#define SPECIES_MOTHIM SPECIES_MOTHIM_PLANT_CLOAK +#define SPECIES_MOTHIM_PLANT_CLOAK 414 #define SPECIES_COMBEE 415 #define SPECIES_VESPIQUEN 416 #define SPECIES_PACHIRISU 417 @@ -684,8 +685,10 @@ #define SPECIES_FLETCHLING 661 #define SPECIES_FLETCHINDER 662 #define SPECIES_TALONFLAME 663 -#define SPECIES_SCATTERBUG 664 -#define SPECIES_SPEWPA 665 +#define SPECIES_SCATTERBUG SPECIES_SCATTERBUG_ICY_SNOW +#define SPECIES_SCATTERBUG_ICY_SNOW 664 +#define SPECIES_SPEWPA SPECIES_SPEWPA_ICY_SNOW +#define SPECIES_SPEWPA_ICY_SNOW 665 #define SPECIES_VIVILLON SPECIES_VIVILLON_ICY_SNOW #define SPECIES_VIVILLON_ICY_SNOW 666 #define SPECIES_LITLEO 667 @@ -961,441 +964,329 @@ #define SPECIES_OVERQWIL 904 #define SPECIES_ENAMORUS SPECIES_ENAMORUS_INCARNATE #define SPECIES_ENAMORUS_INCARNATE 905 - -#define FORMS_START SPECIES_ENAMORUS_INCARNATE - -// Megas -#define SPECIES_VENUSAUR_MEGA FORMS_START + 1 -#define SPECIES_CHARIZARD_MEGA_X FORMS_START + 2 -#define SPECIES_CHARIZARD_MEGA_Y FORMS_START + 3 -#define SPECIES_BLASTOISE_MEGA FORMS_START + 4 -#define SPECIES_BEEDRILL_MEGA FORMS_START + 5 -#define SPECIES_PIDGEOT_MEGA FORMS_START + 6 -#define SPECIES_ALAKAZAM_MEGA FORMS_START + 7 -#define SPECIES_SLOWBRO_MEGA FORMS_START + 8 -#define SPECIES_GENGAR_MEGA FORMS_START + 9 -#define SPECIES_KANGASKHAN_MEGA FORMS_START + 10 -#define SPECIES_PINSIR_MEGA FORMS_START + 11 -#define SPECIES_GYARADOS_MEGA FORMS_START + 12 -#define SPECIES_AERODACTYL_MEGA FORMS_START + 13 -#define SPECIES_MEWTWO_MEGA_X FORMS_START + 14 -#define SPECIES_MEWTWO_MEGA_Y FORMS_START + 15 -#define SPECIES_AMPHAROS_MEGA FORMS_START + 16 -#define SPECIES_STEELIX_MEGA FORMS_START + 17 -#define SPECIES_SCIZOR_MEGA FORMS_START + 18 -#define SPECIES_HERACROSS_MEGA FORMS_START + 19 -#define SPECIES_HOUNDOOM_MEGA FORMS_START + 20 -#define SPECIES_TYRANITAR_MEGA FORMS_START + 21 -#define SPECIES_SCEPTILE_MEGA FORMS_START + 22 -#define SPECIES_BLAZIKEN_MEGA FORMS_START + 23 -#define SPECIES_SWAMPERT_MEGA FORMS_START + 24 -#define SPECIES_GARDEVOIR_MEGA FORMS_START + 25 -#define SPECIES_SABLEYE_MEGA FORMS_START + 26 -#define SPECIES_MAWILE_MEGA FORMS_START + 27 -#define SPECIES_AGGRON_MEGA FORMS_START + 28 -#define SPECIES_MEDICHAM_MEGA FORMS_START + 29 -#define SPECIES_MANECTRIC_MEGA FORMS_START + 30 -#define SPECIES_SHARPEDO_MEGA FORMS_START + 31 -#define SPECIES_CAMERUPT_MEGA FORMS_START + 32 -#define SPECIES_ALTARIA_MEGA FORMS_START + 33 -#define SPECIES_BANETTE_MEGA FORMS_START + 34 -#define SPECIES_ABSOL_MEGA FORMS_START + 35 -#define SPECIES_GLALIE_MEGA FORMS_START + 36 -#define SPECIES_SALAMENCE_MEGA FORMS_START + 37 -#define SPECIES_METAGROSS_MEGA FORMS_START + 38 -#define SPECIES_LATIAS_MEGA FORMS_START + 39 -#define SPECIES_LATIOS_MEGA FORMS_START + 40 -#define SPECIES_LOPUNNY_MEGA FORMS_START + 41 -#define SPECIES_GARCHOMP_MEGA FORMS_START + 42 -#define SPECIES_LUCARIO_MEGA FORMS_START + 43 -#define SPECIES_ABOMASNOW_MEGA FORMS_START + 44 -#define SPECIES_GALLADE_MEGA FORMS_START + 45 -#define SPECIES_AUDINO_MEGA FORMS_START + 46 -#define SPECIES_DIANCIE_MEGA FORMS_START + 47 - -// Special Mega + Primals -#define SPECIES_RAYQUAZA_MEGA FORMS_START + 48 -#define SPECIES_KYOGRE_PRIMAL FORMS_START + 49 -#define SPECIES_GROUDON_PRIMAL FORMS_START + 50 - -// Alolan Forms -#define SPECIES_RATTATA_ALOLAN FORMS_START + 51 -#define SPECIES_RATICATE_ALOLAN FORMS_START + 52 -#define SPECIES_RAICHU_ALOLAN FORMS_START + 53 -#define SPECIES_SANDSHREW_ALOLAN FORMS_START + 54 -#define SPECIES_SANDSLASH_ALOLAN FORMS_START + 55 -#define SPECIES_VULPIX_ALOLAN FORMS_START + 56 -#define SPECIES_NINETALES_ALOLAN FORMS_START + 57 -#define SPECIES_DIGLETT_ALOLAN FORMS_START + 58 -#define SPECIES_DUGTRIO_ALOLAN FORMS_START + 59 -#define SPECIES_MEOWTH_ALOLAN FORMS_START + 60 -#define SPECIES_PERSIAN_ALOLAN FORMS_START + 61 -#define SPECIES_GEODUDE_ALOLAN FORMS_START + 62 -#define SPECIES_GRAVELER_ALOLAN FORMS_START + 63 -#define SPECIES_GOLEM_ALOLAN FORMS_START + 64 -#define SPECIES_GRIMER_ALOLAN FORMS_START + 65 -#define SPECIES_MUK_ALOLAN FORMS_START + 66 -#define SPECIES_EXEGGUTOR_ALOLAN FORMS_START + 67 -#define SPECIES_MAROWAK_ALOLAN FORMS_START + 68 - -// Galarian Forms -#define SPECIES_MEOWTH_GALARIAN FORMS_START + 69 -#define SPECIES_PONYTA_GALARIAN FORMS_START + 70 -#define SPECIES_RAPIDASH_GALARIAN FORMS_START + 71 -#define SPECIES_SLOWPOKE_GALARIAN FORMS_START + 72 -#define SPECIES_SLOWBRO_GALARIAN FORMS_START + 73 -#define SPECIES_FARFETCHD_GALARIAN FORMS_START + 74 -#define SPECIES_WEEZING_GALARIAN FORMS_START + 75 -#define SPECIES_MR_MIME_GALARIAN FORMS_START + 76 -#define SPECIES_ARTICUNO_GALARIAN FORMS_START + 77 -#define SPECIES_ZAPDOS_GALARIAN FORMS_START + 78 -#define SPECIES_MOLTRES_GALARIAN FORMS_START + 79 -#define SPECIES_SLOWKING_GALARIAN FORMS_START + 80 -#define SPECIES_CORSOLA_GALARIAN FORMS_START + 81 -#define SPECIES_ZIGZAGOON_GALARIAN FORMS_START + 82 -#define SPECIES_LINOONE_GALARIAN FORMS_START + 83 -#define SPECIES_DARUMAKA_GALARIAN FORMS_START + 84 +#define SPECIES_VENUSAUR_MEGA 906 +#define SPECIES_CHARIZARD_MEGA_X 907 +#define SPECIES_CHARIZARD_MEGA_Y 908 +#define SPECIES_BLASTOISE_MEGA 909 +#define SPECIES_BEEDRILL_MEGA 910 +#define SPECIES_PIDGEOT_MEGA 911 +#define SPECIES_ALAKAZAM_MEGA 912 +#define SPECIES_SLOWBRO_MEGA 913 +#define SPECIES_GENGAR_MEGA 914 +#define SPECIES_KANGASKHAN_MEGA 915 +#define SPECIES_PINSIR_MEGA 916 +#define SPECIES_GYARADOS_MEGA 917 +#define SPECIES_AERODACTYL_MEGA 918 +#define SPECIES_MEWTWO_MEGA_X 919 +#define SPECIES_MEWTWO_MEGA_Y 920 +#define SPECIES_AMPHAROS_MEGA 921 +#define SPECIES_STEELIX_MEGA 922 +#define SPECIES_SCIZOR_MEGA 923 +#define SPECIES_HERACROSS_MEGA 924 +#define SPECIES_HOUNDOOM_MEGA 925 +#define SPECIES_TYRANITAR_MEGA 926 +#define SPECIES_SCEPTILE_MEGA 927 +#define SPECIES_BLAZIKEN_MEGA 928 +#define SPECIES_SWAMPERT_MEGA 929 +#define SPECIES_GARDEVOIR_MEGA 930 +#define SPECIES_SABLEYE_MEGA 931 +#define SPECIES_MAWILE_MEGA 932 +#define SPECIES_AGGRON_MEGA 933 +#define SPECIES_MEDICHAM_MEGA 934 +#define SPECIES_MANECTRIC_MEGA 935 +#define SPECIES_SHARPEDO_MEGA 936 +#define SPECIES_CAMERUPT_MEGA 937 +#define SPECIES_ALTARIA_MEGA 938 +#define SPECIES_BANETTE_MEGA 939 +#define SPECIES_ABSOL_MEGA 940 +#define SPECIES_GLALIE_MEGA 941 +#define SPECIES_SALAMENCE_MEGA 942 +#define SPECIES_METAGROSS_MEGA 943 +#define SPECIES_LATIAS_MEGA 944 +#define SPECIES_LATIOS_MEGA 945 +#define SPECIES_LOPUNNY_MEGA 946 +#define SPECIES_GARCHOMP_MEGA 947 +#define SPECIES_LUCARIO_MEGA 948 +#define SPECIES_ABOMASNOW_MEGA 949 +#define SPECIES_GALLADE_MEGA 950 +#define SPECIES_AUDINO_MEGA 951 +#define SPECIES_DIANCIE_MEGA 952 +#define SPECIES_RAYQUAZA_MEGA 953 +#define SPECIES_KYOGRE_PRIMAL 954 +#define SPECIES_GROUDON_PRIMAL 955 +#define SPECIES_RATTATA_ALOLAN 956 +#define SPECIES_RATICATE_ALOLAN 957 +#define SPECIES_RAICHU_ALOLAN 958 +#define SPECIES_SANDSHREW_ALOLAN 959 +#define SPECIES_SANDSLASH_ALOLAN 960 +#define SPECIES_VULPIX_ALOLAN 961 +#define SPECIES_NINETALES_ALOLAN 962 +#define SPECIES_DIGLETT_ALOLAN 963 +#define SPECIES_DUGTRIO_ALOLAN 964 +#define SPECIES_MEOWTH_ALOLAN 965 +#define SPECIES_PERSIAN_ALOLAN 966 +#define SPECIES_GEODUDE_ALOLAN 967 +#define SPECIES_GRAVELER_ALOLAN 968 +#define SPECIES_GOLEM_ALOLAN 969 +#define SPECIES_GRIMER_ALOLAN 970 +#define SPECIES_MUK_ALOLAN 971 +#define SPECIES_EXEGGUTOR_ALOLAN 972 +#define SPECIES_MAROWAK_ALOLAN 973 +#define SPECIES_MEOWTH_GALARIAN 974 +#define SPECIES_PONYTA_GALARIAN 975 +#define SPECIES_RAPIDASH_GALARIAN 976 +#define SPECIES_SLOWPOKE_GALARIAN 977 +#define SPECIES_SLOWBRO_GALARIAN 978 +#define SPECIES_FARFETCHD_GALARIAN 979 +#define SPECIES_WEEZING_GALARIAN 980 +#define SPECIES_MR_MIME_GALARIAN 981 +#define SPECIES_ARTICUNO_GALARIAN 982 +#define SPECIES_ZAPDOS_GALARIAN 983 +#define SPECIES_MOLTRES_GALARIAN 984 +#define SPECIES_SLOWKING_GALARIAN 985 +#define SPECIES_CORSOLA_GALARIAN 986 +#define SPECIES_ZIGZAGOON_GALARIAN 987 +#define SPECIES_LINOONE_GALARIAN 988 +#define SPECIES_DARUMAKA_GALARIAN 989 #define SPECIES_DARMANITAN_GALARIAN SPECIES_DARMANITAN_GALARIAN_STANDARD_MODE -#define SPECIES_DARMANITAN_GALARIAN_STANDARD_MODE FORMS_START + 85 -#define SPECIES_YAMASK_GALARIAN FORMS_START + 86 -#define SPECIES_STUNFISK_GALARIAN FORMS_START + 87 +#define SPECIES_DARMANITAN_GALARIAN_STANDARD_MODE 990 +#define SPECIES_YAMASK_GALARIAN 991 +#define SPECIES_STUNFISK_GALARIAN 992 //Hisuian Forms -#define SPECIES_GROWLITHE_HISUIAN FORMS_START + 88 -#define SPECIES_ARCANINE_HISUIAN FORMS_START + 89 -#define SPECIES_VOLTORB_HISUIAN FORMS_START + 90 -#define SPECIES_ELECTRODE_HISUIAN FORMS_START + 91 -#define SPECIES_TYPHLOSION_HISUIAN FORMS_START + 92 -#define SPECIES_QWILFISH_HISUIAN FORMS_START + 93 -#define SPECIES_SNEASEL_HISUIAN FORMS_START + 94 -#define SPECIES_SAMUROTT_HISUIAN FORMS_START + 95 -#define SPECIES_LILLIGANT_HISUIAN FORMS_START + 96 -#define SPECIES_ZORUA_HISUIAN FORMS_START + 97 -#define SPECIES_ZOROARK_HISUIAN FORMS_START + 98 -#define SPECIES_BRAVIARY_HISUIAN FORMS_START + 99 -#define SPECIES_SLIGGOO_HISUIAN FORMS_START + 100 -#define SPECIES_GOODRA_HISUIAN FORMS_START + 101 -#define SPECIES_AVALUGG_HISUIAN FORMS_START + 102 -#define SPECIES_DECIDUEYE_HISUIAN FORMS_START + 103 +#define SPECIES_GROWLITHE_HISUIAN 993 +#define SPECIES_ARCANINE_HISUIAN 994 +#define SPECIES_VOLTORB_HISUIAN 995 +#define SPECIES_ELECTRODE_HISUIAN 996 +#define SPECIES_TYPHLOSION_HISUIAN 997 +#define SPECIES_QWILFISH_HISUIAN 998 +#define SPECIES_SNEASEL_HISUIAN 999 +#define SPECIES_SAMUROTT_HISUIAN 1000 +#define SPECIES_LILLIGANT_HISUIAN 1001 +#define SPECIES_ZORUA_HISUIAN 1002 +#define SPECIES_ZOROARK_HISUIAN 1003 +#define SPECIES_BRAVIARY_HISUIAN 1004 +#define SPECIES_SLIGGOO_HISUIAN 1005 +#define SPECIES_GOODRA_HISUIAN 1006 +#define SPECIES_AVALUGG_HISUIAN 1007 +#define SPECIES_DECIDUEYE_HISUIAN 1008 // Misc Forms - -// Cosplay Pikachu -#define SPECIES_PIKACHU_COSPLAY FORMS_START + 104 -#define SPECIES_PIKACHU_ROCK_STAR FORMS_START + 105 -#define SPECIES_PIKACHU_BELLE FORMS_START + 106 -#define SPECIES_PIKACHU_POP_STAR FORMS_START + 107 -#define SPECIES_PIKACHU_PH_D FORMS_START + 108 -#define SPECIES_PIKACHU_LIBRE FORMS_START + 109 - -// Cap Pikachu -#define SPECIES_PIKACHU_ORIGINAL_CAP FORMS_START + 110 -#define SPECIES_PIKACHU_HOENN_CAP FORMS_START + 111 -#define SPECIES_PIKACHU_SINNOH_CAP FORMS_START + 112 -#define SPECIES_PIKACHU_UNOVA_CAP FORMS_START + 113 -#define SPECIES_PIKACHU_KALOS_CAP FORMS_START + 114 -#define SPECIES_PIKACHU_ALOLA_CAP FORMS_START + 115 -#define SPECIES_PIKACHU_PARTNER_CAP FORMS_START + 116 -#define SPECIES_PIKACHU_WORLD_CAP FORMS_START + 117 - -// Pichu -#define SPECIES_PICHU_SPIKY_EARED FORMS_START + 118 - -// Unown -#define SPECIES_UNOWN_B FORMS_START + 119 -#define SPECIES_UNOWN_C FORMS_START + 120 -#define SPECIES_UNOWN_D FORMS_START + 121 -#define SPECIES_UNOWN_E FORMS_START + 122 -#define SPECIES_UNOWN_F FORMS_START + 123 -#define SPECIES_UNOWN_G FORMS_START + 124 -#define SPECIES_UNOWN_H FORMS_START + 125 -#define SPECIES_UNOWN_I FORMS_START + 126 -#define SPECIES_UNOWN_J FORMS_START + 127 -#define SPECIES_UNOWN_K FORMS_START + 128 -#define SPECIES_UNOWN_L FORMS_START + 129 -#define SPECIES_UNOWN_M FORMS_START + 130 -#define SPECIES_UNOWN_N FORMS_START + 131 -#define SPECIES_UNOWN_O FORMS_START + 132 -#define SPECIES_UNOWN_P FORMS_START + 133 -#define SPECIES_UNOWN_Q FORMS_START + 134 -#define SPECIES_UNOWN_R FORMS_START + 135 -#define SPECIES_UNOWN_S FORMS_START + 136 -#define SPECIES_UNOWN_T FORMS_START + 137 -#define SPECIES_UNOWN_U FORMS_START + 138 -#define SPECIES_UNOWN_V FORMS_START + 139 -#define SPECIES_UNOWN_W FORMS_START + 140 -#define SPECIES_UNOWN_X FORMS_START + 141 -#define SPECIES_UNOWN_Y FORMS_START + 142 -#define SPECIES_UNOWN_Z FORMS_START + 143 -#define SPECIES_UNOWN_EMARK FORMS_START + 144 -#define SPECIES_UNOWN_QMARK FORMS_START + 145 - -// Castform -#define SPECIES_CASTFORM_SUNNY FORMS_START + 146 -#define SPECIES_CASTFORM_RAINY FORMS_START + 147 -#define SPECIES_CASTFORM_SNOWY FORMS_START + 148 - -// Deoxys -#define SPECIES_DEOXYS_ATTACK FORMS_START + 149 -#define SPECIES_DEOXYS_DEFENSE FORMS_START + 150 -#define SPECIES_DEOXYS_SPEED FORMS_START + 151 - -// Burmy -#define SPECIES_BURMY_SANDY_CLOAK FORMS_START + 152 -#define SPECIES_BURMY_TRASH_CLOAK FORMS_START + 153 - -// Wormadam -#define SPECIES_WORMADAM_SANDY_CLOAK FORMS_START + 154 -#define SPECIES_WORMADAM_TRASH_CLOAK FORMS_START + 155 - -// Cherrim -#define SPECIES_CHERRIM_SUNSHINE FORMS_START + 156 - -// Shellos -#define SPECIES_SHELLOS_EAST_SEA FORMS_START + 157 - -// Gastrodon -#define SPECIES_GASTRODON_EAST_SEA FORMS_START + 158 - -// Rotom -#define SPECIES_ROTOM_HEAT FORMS_START + 159 -#define SPECIES_ROTOM_WASH FORMS_START + 160 -#define SPECIES_ROTOM_FROST FORMS_START + 161 -#define SPECIES_ROTOM_FAN FORMS_START + 162 -#define SPECIES_ROTOM_MOW FORMS_START + 163 - -// Origin Forme -#define SPECIES_DIALGA_ORIGIN FORMS_START + 164 -#define SPECIES_PALKIA_ORIGIN FORMS_START + 165 -#define SPECIES_GIRATINA_ORIGIN FORMS_START + 166 - -// Shaymin -#define SPECIES_SHAYMIN_SKY FORMS_START + 167 - -// Arceus -#define SPECIES_ARCEUS_FIGHTING FORMS_START + 168 -#define SPECIES_ARCEUS_FLYING FORMS_START + 169 -#define SPECIES_ARCEUS_POISON FORMS_START + 170 -#define SPECIES_ARCEUS_GROUND FORMS_START + 171 -#define SPECIES_ARCEUS_ROCK FORMS_START + 172 -#define SPECIES_ARCEUS_BUG FORMS_START + 173 -#define SPECIES_ARCEUS_GHOST FORMS_START + 174 -#define SPECIES_ARCEUS_STEEL FORMS_START + 175 -#define SPECIES_ARCEUS_FIRE FORMS_START + 176 -#define SPECIES_ARCEUS_WATER FORMS_START + 177 -#define SPECIES_ARCEUS_GRASS FORMS_START + 178 -#define SPECIES_ARCEUS_ELECTRIC FORMS_START + 179 -#define SPECIES_ARCEUS_PSYCHIC FORMS_START + 180 -#define SPECIES_ARCEUS_ICE FORMS_START + 181 -#define SPECIES_ARCEUS_DRAGON FORMS_START + 182 -#define SPECIES_ARCEUS_DARK FORMS_START + 183 -#define SPECIES_ARCEUS_FAIRY FORMS_START + 184 - -// Basculin -#define SPECIES_BASCULIN_BLUE_STRIPED FORMS_START + 185 -#define SPECIES_BASCULIN_WHITE_STRIPED FORMS_START + 186 - -// Darmanitan -#define SPECIES_DARMANITAN_ZEN_MODE FORMS_START + 187 -#define SPECIES_DARMANITAN_GALARIAN_ZEN_MODE FORMS_START + 188 - -// Deerling -#define SPECIES_DEERLING_SUMMER FORMS_START + 189 -#define SPECIES_DEERLING_AUTUMN FORMS_START + 190 -#define SPECIES_DEERLING_WINTER FORMS_START + 191 - -// Sawsbuck -#define SPECIES_SAWSBUCK_SUMMER FORMS_START + 192 -#define SPECIES_SAWSBUCK_AUTUMN FORMS_START + 193 -#define SPECIES_SAWSBUCK_WINTER FORMS_START + 194 - -// Therian Forms -#define SPECIES_TORNADUS_THERIAN FORMS_START + 195 -#define SPECIES_THUNDURUS_THERIAN FORMS_START + 196 -#define SPECIES_LANDORUS_THERIAN FORMS_START + 197 -#define SPECIES_ENAMORUS_THERIAN FORMS_START + 198 - -// Kyurem -#define SPECIES_KYUREM_WHITE FORMS_START + 199 -#define SPECIES_KYUREM_BLACK FORMS_START + 200 - -// Keldeo -#define SPECIES_KELDEO_RESOLUTE FORMS_START + 201 - -// Meloetta -#define SPECIES_MELOETTA_PIROUETTE FORMS_START + 202 - -// Genesect -#define SPECIES_GENESECT_DOUSE_DRIVE FORMS_START + 203 -#define SPECIES_GENESECT_SHOCK_DRIVE FORMS_START + 204 -#define SPECIES_GENESECT_BURN_DRIVE FORMS_START + 205 -#define SPECIES_GENESECT_CHILL_DRIVE FORMS_START + 206 - -// Greninja -#define SPECIES_GRENINJA_BATTLE_BOND FORMS_START + 207 -#define SPECIES_GRENINJA_ASH FORMS_START + 208 - -// Vivillon -#define SPECIES_VIVILLON_POLAR FORMS_START + 209 -#define SPECIES_VIVILLON_TUNDRA FORMS_START + 210 -#define SPECIES_VIVILLON_CONTINENTAL FORMS_START + 211 -#define SPECIES_VIVILLON_GARDEN FORMS_START + 212 -#define SPECIES_VIVILLON_ELEGANT FORMS_START + 213 -#define SPECIES_VIVILLON_MEADOW FORMS_START + 214 -#define SPECIES_VIVILLON_MODERN FORMS_START + 215 -#define SPECIES_VIVILLON_MARINE FORMS_START + 216 -#define SPECIES_VIVILLON_ARCHIPELAGO FORMS_START + 217 -#define SPECIES_VIVILLON_HIGH_PLAINS FORMS_START + 218 -#define SPECIES_VIVILLON_SANDSTORM FORMS_START + 219 -#define SPECIES_VIVILLON_RIVER FORMS_START + 220 -#define SPECIES_VIVILLON_MONSOON FORMS_START + 221 -#define SPECIES_VIVILLON_SAVANNA FORMS_START + 222 -#define SPECIES_VIVILLON_SUN FORMS_START + 223 -#define SPECIES_VIVILLON_OCEAN FORMS_START + 224 -#define SPECIES_VIVILLON_JUNGLE FORMS_START + 225 -#define SPECIES_VIVILLON_FANCY FORMS_START + 226 -#define SPECIES_VIVILLON_POKE_BALL FORMS_START + 227 - -// Flabébé -#define SPECIES_FLABEBE_YELLOW_FLOWER FORMS_START + 228 -#define SPECIES_FLABEBE_ORANGE_FLOWER FORMS_START + 229 -#define SPECIES_FLABEBE_BLUE_FLOWER FORMS_START + 230 -#define SPECIES_FLABEBE_WHITE_FLOWER FORMS_START + 231 - -// Floette -#define SPECIES_FLOETTE_YELLOW_FLOWER FORMS_START + 232 -#define SPECIES_FLOETTE_ORANGE_FLOWER FORMS_START + 233 -#define SPECIES_FLOETTE_BLUE_FLOWER FORMS_START + 234 -#define SPECIES_FLOETTE_WHITE_FLOWER FORMS_START + 235 -#define SPECIES_FLOETTE_ETERNAL_FLOWER FORMS_START + 236 - -// Florges -#define SPECIES_FLORGES_YELLOW_FLOWER FORMS_START + 237 -#define SPECIES_FLORGES_ORANGE_FLOWER FORMS_START + 238 -#define SPECIES_FLORGES_BLUE_FLOWER FORMS_START + 239 -#define SPECIES_FLORGES_WHITE_FLOWER FORMS_START + 240 - -// Furfrou -#define SPECIES_FURFROU_HEART_TRIM FORMS_START + 241 -#define SPECIES_FURFROU_STAR_TRIM FORMS_START + 242 -#define SPECIES_FURFROU_DIAMOND_TRIM FORMS_START + 243 -#define SPECIES_FURFROU_DEBUTANTE_TRIM FORMS_START + 244 -#define SPECIES_FURFROU_MATRON_TRIM FORMS_START + 245 -#define SPECIES_FURFROU_DANDY_TRIM FORMS_START + 246 -#define SPECIES_FURFROU_LA_REINE_TRIM FORMS_START + 247 -#define SPECIES_FURFROU_KABUKI_TRIM FORMS_START + 248 -#define SPECIES_FURFROU_PHARAOH_TRIM FORMS_START + 249 - -// Meowstic -#define SPECIES_MEOWSTIC_FEMALE FORMS_START + 250 - -// Aegislash -#define SPECIES_AEGISLASH_BLADE FORMS_START + 251 - -// Pumpkaboo -#define SPECIES_PUMPKABOO_SMALL FORMS_START + 252 -#define SPECIES_PUMPKABOO_LARGE FORMS_START + 253 -#define SPECIES_PUMPKABOO_SUPER FORMS_START + 254 - -// Gourgeist -#define SPECIES_GOURGEIST_SMALL FORMS_START + 255 -#define SPECIES_GOURGEIST_LARGE FORMS_START + 256 -#define SPECIES_GOURGEIST_SUPER FORMS_START + 257 - -// Xerneas -#define SPECIES_XERNEAS_ACTIVE FORMS_START + 258 - -// Zygarde +#define SPECIES_PIKACHU_COSPLAY 1009 +#define SPECIES_PIKACHU_ROCK_STAR 1010 +#define SPECIES_PIKACHU_BELLE 1011 +#define SPECIES_PIKACHU_POP_STAR 1012 +#define SPECIES_PIKACHU_PH_D 1013 +#define SPECIES_PIKACHU_LIBRE 1014 +#define SPECIES_PIKACHU_ORIGINAL_CAP 1015 +#define SPECIES_PIKACHU_HOENN_CAP 1016 +#define SPECIES_PIKACHU_SINNOH_CAP 1017 +#define SPECIES_PIKACHU_UNOVA_CAP 1018 +#define SPECIES_PIKACHU_KALOS_CAP 1019 +#define SPECIES_PIKACHU_ALOLA_CAP 1020 +#define SPECIES_PIKACHU_PARTNER_CAP 1021 +#define SPECIES_PIKACHU_WORLD_CAP 1022 +#define SPECIES_PICHU_SPIKY_EARED 1023 +#define SPECIES_UNOWN_B 1024 +#define SPECIES_UNOWN_C 1025 +#define SPECIES_UNOWN_D 1026 +#define SPECIES_UNOWN_E 1027 +#define SPECIES_UNOWN_F 1028 +#define SPECIES_UNOWN_G 1029 +#define SPECIES_UNOWN_H 1030 +#define SPECIES_UNOWN_I 1031 +#define SPECIES_UNOWN_J 1032 +#define SPECIES_UNOWN_K 1033 +#define SPECIES_UNOWN_L 1034 +#define SPECIES_UNOWN_M 1035 +#define SPECIES_UNOWN_N 1036 +#define SPECIES_UNOWN_O 1037 +#define SPECIES_UNOWN_P 1038 +#define SPECIES_UNOWN_Q 1039 +#define SPECIES_UNOWN_R 1040 +#define SPECIES_UNOWN_S 1041 +#define SPECIES_UNOWN_T 1042 +#define SPECIES_UNOWN_U 1043 +#define SPECIES_UNOWN_V 1044 +#define SPECIES_UNOWN_W 1045 +#define SPECIES_UNOWN_X 1046 +#define SPECIES_UNOWN_Y 1047 +#define SPECIES_UNOWN_Z 1048 +#define SPECIES_UNOWN_EMARK 1049 +#define SPECIES_UNOWN_QMARK 1050 +#define SPECIES_CASTFORM_SUNNY 1051 +#define SPECIES_CASTFORM_RAINY 1052 +#define SPECIES_CASTFORM_SNOWY 1053 +#define SPECIES_DEOXYS_ATTACK 1054 +#define SPECIES_DEOXYS_DEFENSE 1055 +#define SPECIES_DEOXYS_SPEED 1056 +#define SPECIES_BURMY_SANDY_CLOAK 1057 +#define SPECIES_BURMY_TRASH_CLOAK 1058 +#define SPECIES_WORMADAM_SANDY_CLOAK 1059 +#define SPECIES_WORMADAM_TRASH_CLOAK 1060 +#define SPECIES_CHERRIM_SUNSHINE 1061 +#define SPECIES_SHELLOS_EAST_SEA 1062 +#define SPECIES_GASTRODON_EAST_SEA 1063 +#define SPECIES_ROTOM_HEAT 1064 +#define SPECIES_ROTOM_WASH 1065 +#define SPECIES_ROTOM_FROST 1066 +#define SPECIES_ROTOM_FAN 1067 +#define SPECIES_ROTOM_MOW 1068 +#define SPECIES_DIALGA_ORIGIN 1069 +#define SPECIES_PALKIA_ORIGIN 1070 +#define SPECIES_GIRATINA_ORIGIN 1071 +#define SPECIES_SHAYMIN_SKY 1072 +#define SPECIES_ARCEUS_FIGHTING 1073 +#define SPECIES_ARCEUS_FLYING 1074 +#define SPECIES_ARCEUS_POISON 1075 +#define SPECIES_ARCEUS_GROUND 1076 +#define SPECIES_ARCEUS_ROCK 1077 +#define SPECIES_ARCEUS_BUG 1078 +#define SPECIES_ARCEUS_GHOST 1079 +#define SPECIES_ARCEUS_STEEL 1080 +#define SPECIES_ARCEUS_FIRE 1081 +#define SPECIES_ARCEUS_WATER 1082 +#define SPECIES_ARCEUS_GRASS 1083 +#define SPECIES_ARCEUS_ELECTRIC 1084 +#define SPECIES_ARCEUS_PSYCHIC 1085 +#define SPECIES_ARCEUS_ICE 1086 +#define SPECIES_ARCEUS_DRAGON 1087 +#define SPECIES_ARCEUS_DARK 1088 +#define SPECIES_ARCEUS_FAIRY 1089 +#define SPECIES_BASCULIN_BLUE_STRIPED 1090 +#define SPECIES_BASCULIN_WHITE_STRIPED 1091 +#define SPECIES_DARMANITAN_ZEN_MODE 1092 +#define SPECIES_DARMANITAN_GALARIAN_ZEN_MODE 1093 +#define SPECIES_DEERLING_SUMMER 1094 +#define SPECIES_DEERLING_AUTUMN 1095 +#define SPECIES_DEERLING_WINTER 1096 +#define SPECIES_SAWSBUCK_SUMMER 1097 +#define SPECIES_SAWSBUCK_AUTUMN 1098 +#define SPECIES_SAWSBUCK_WINTER 1099 +#define SPECIES_TORNADUS_THERIAN 1100 +#define SPECIES_THUNDURUS_THERIAN 1101 +#define SPECIES_LANDORUS_THERIAN 1102 +#define SPECIES_ENAMORUS_THERIAN 1103 +#define SPECIES_KYUREM_WHITE 1104 +#define SPECIES_KYUREM_BLACK 1105 +#define SPECIES_KELDEO_RESOLUTE 1106 +#define SPECIES_MELOETTA_PIROUETTE 1107 +#define SPECIES_GENESECT_DOUSE_DRIVE 1108 +#define SPECIES_GENESECT_SHOCK_DRIVE 1109 +#define SPECIES_GENESECT_BURN_DRIVE 1110 +#define SPECIES_GENESECT_CHILL_DRIVE 1111 +#define SPECIES_GRENINJA_BATTLE_BOND 1112 +#define SPECIES_GRENINJA_ASH 1113 +#define SPECIES_VIVILLON_POLAR 1114 +#define SPECIES_VIVILLON_TUNDRA 1115 +#define SPECIES_VIVILLON_CONTINENTAL 1116 +#define SPECIES_VIVILLON_GARDEN 1117 +#define SPECIES_VIVILLON_ELEGANT 1118 +#define SPECIES_VIVILLON_MEADOW 1119 +#define SPECIES_VIVILLON_MODERN 1120 +#define SPECIES_VIVILLON_MARINE 1121 +#define SPECIES_VIVILLON_ARCHIPELAGO 1122 +#define SPECIES_VIVILLON_HIGH_PLAINS 1123 +#define SPECIES_VIVILLON_SANDSTORM 1124 +#define SPECIES_VIVILLON_RIVER 1125 +#define SPECIES_VIVILLON_MONSOON 1126 +#define SPECIES_VIVILLON_SAVANNA 1127 +#define SPECIES_VIVILLON_SUN 1128 +#define SPECIES_VIVILLON_OCEAN 1129 +#define SPECIES_VIVILLON_JUNGLE 1130 +#define SPECIES_VIVILLON_FANCY 1131 +#define SPECIES_VIVILLON_POKE_BALL 1132 +#define SPECIES_FLABEBE_YELLOW_FLOWER 1133 +#define SPECIES_FLABEBE_ORANGE_FLOWER 1134 +#define SPECIES_FLABEBE_BLUE_FLOWER 1135 +#define SPECIES_FLABEBE_WHITE_FLOWER 1136 +#define SPECIES_FLOETTE_YELLOW_FLOWER 1137 +#define SPECIES_FLOETTE_ORANGE_FLOWER 1138 +#define SPECIES_FLOETTE_BLUE_FLOWER 1139 +#define SPECIES_FLOETTE_WHITE_FLOWER 1140 +#define SPECIES_FLOETTE_ETERNAL_FLOWER 1141 +#define SPECIES_FLORGES_YELLOW_FLOWER 1142 +#define SPECIES_FLORGES_ORANGE_FLOWER 1143 +#define SPECIES_FLORGES_BLUE_FLOWER 1144 +#define SPECIES_FLORGES_WHITE_FLOWER 1145 +#define SPECIES_FURFROU_HEART_TRIM 1146 +#define SPECIES_FURFROU_STAR_TRIM 1147 +#define SPECIES_FURFROU_DIAMOND_TRIM 1148 +#define SPECIES_FURFROU_DEBUTANTE_TRIM 1149 +#define SPECIES_FURFROU_MATRON_TRIM 1150 +#define SPECIES_FURFROU_DANDY_TRIM 1151 +#define SPECIES_FURFROU_LA_REINE_TRIM 1152 +#define SPECIES_FURFROU_KABUKI_TRIM 1153 +#define SPECIES_FURFROU_PHARAOH_TRIM 1154 +#define SPECIES_MEOWSTIC_FEMALE 1155 +#define SPECIES_AEGISLASH_BLADE 1156 +#define SPECIES_PUMPKABOO_SMALL 1157 +#define SPECIES_PUMPKABOO_LARGE 1158 +#define SPECIES_PUMPKABOO_SUPER 1159 +#define SPECIES_GOURGEIST_SMALL 1160 +#define SPECIES_GOURGEIST_LARGE 1161 +#define SPECIES_GOURGEIST_SUPER 1162 +#define SPECIES_XERNEAS_ACTIVE 1163 #define SPECIES_ZYGARDE_10 SPECIES_ZYGARDE_10_AURA_BREAK -#define SPECIES_ZYGARDE_10_AURA_BREAK FORMS_START + 259 -#define SPECIES_ZYGARDE_10_POWER_CONSTRUCT FORMS_START + 260 -#define SPECIES_ZYGARDE_50_POWER_CONSTRUCT FORMS_START + 261 -#define SPECIES_ZYGARDE_COMPLETE FORMS_START + 262 - -// Hoopa -#define SPECIES_HOOPA_UNBOUND FORMS_START + 263 - -// Oricorio -#define SPECIES_ORICORIO_POM_POM FORMS_START + 264 -#define SPECIES_ORICORIO_PAU FORMS_START + 265 -#define SPECIES_ORICORIO_SENSU FORMS_START + 266 - -// Rockruff -#define SPECIES_ROCKRUFF_OWN_TEMPO FORMS_START + 267 - -// Lycanroc -#define SPECIES_LYCANROC_MIDNIGHT FORMS_START + 268 -#define SPECIES_LYCANROC_DUSK FORMS_START + 269 - -// Wishiwashi -#define SPECIES_WISHIWASHI_SCHOOL FORMS_START + 270 - -// Silvally -#define SPECIES_SILVALLY_FIGHTING FORMS_START + 271 -#define SPECIES_SILVALLY_FLYING FORMS_START + 272 -#define SPECIES_SILVALLY_POISON FORMS_START + 273 -#define SPECIES_SILVALLY_GROUND FORMS_START + 274 -#define SPECIES_SILVALLY_ROCK FORMS_START + 275 -#define SPECIES_SILVALLY_BUG FORMS_START + 276 -#define SPECIES_SILVALLY_GHOST FORMS_START + 277 -#define SPECIES_SILVALLY_STEEL FORMS_START + 278 -#define SPECIES_SILVALLY_FIRE FORMS_START + 279 -#define SPECIES_SILVALLY_WATER FORMS_START + 280 -#define SPECIES_SILVALLY_GRASS FORMS_START + 281 -#define SPECIES_SILVALLY_ELECTRIC FORMS_START + 282 -#define SPECIES_SILVALLY_PSYCHIC FORMS_START + 283 -#define SPECIES_SILVALLY_ICE FORMS_START + 284 -#define SPECIES_SILVALLY_DRAGON FORMS_START + 285 -#define SPECIES_SILVALLY_DARK FORMS_START + 286 -#define SPECIES_SILVALLY_FAIRY FORMS_START + 287 - -// Minior +#define SPECIES_ZYGARDE_10_AURA_BREAK 1164 +#define SPECIES_ZYGARDE_10_POWER_CONSTRUCT 1165 +#define SPECIES_ZYGARDE_50_POWER_CONSTRUCT 1166 +#define SPECIES_ZYGARDE_COMPLETE 1167 +#define SPECIES_HOOPA_UNBOUND 1168 +#define SPECIES_ORICORIO_POM_POM 1169 +#define SPECIES_ORICORIO_PAU 1170 +#define SPECIES_ORICORIO_SENSU 1171 +#define SPECIES_ROCKRUFF_OWN_TEMPO 1172 +#define SPECIES_LYCANROC_MIDNIGHT 1173 +#define SPECIES_LYCANROC_DUSK 1174 +#define SPECIES_WISHIWASHI_SCHOOL 1175 +#define SPECIES_SILVALLY_FIGHTING 1176 +#define SPECIES_SILVALLY_FLYING 1177 +#define SPECIES_SILVALLY_POISON 1178 +#define SPECIES_SILVALLY_GROUND 1179 +#define SPECIES_SILVALLY_ROCK 1180 +#define SPECIES_SILVALLY_BUG 1181 +#define SPECIES_SILVALLY_GHOST 1182 +#define SPECIES_SILVALLY_STEEL 1183 +#define SPECIES_SILVALLY_FIRE 1184 +#define SPECIES_SILVALLY_WATER 1185 +#define SPECIES_SILVALLY_GRASS 1186 +#define SPECIES_SILVALLY_ELECTRIC 1187 +#define SPECIES_SILVALLY_PSYCHIC 1188 +#define SPECIES_SILVALLY_ICE 1189 +#define SPECIES_SILVALLY_DRAGON 1190 +#define SPECIES_SILVALLY_DARK 1191 +#define SPECIES_SILVALLY_FAIRY 1192 #define SPECIES_MINIOR_ORANGE SPECIES_MINIOR_METEOR_ORANGE #define SPECIES_MINIOR_YELLOW SPECIES_MINIOR_METEOR_YELLOW #define SPECIES_MINIOR_GREEN SPECIES_MINIOR_METEOR_GREEN #define SPECIES_MINIOR_BLUE SPECIES_MINIOR_METEOR_BLUE #define SPECIES_MINIOR_INDIGO SPECIES_MINIOR_METEOR_INDIGO #define SPECIES_MINIOR_VIOLET SPECIES_MINIOR_METEOR_VIOLET -#define SPECIES_MINIOR_METEOR_ORANGE FORMS_START + 288 -#define SPECIES_MINIOR_METEOR_YELLOW FORMS_START + 289 -#define SPECIES_MINIOR_METEOR_GREEN FORMS_START + 290 -#define SPECIES_MINIOR_METEOR_BLUE FORMS_START + 291 -#define SPECIES_MINIOR_METEOR_INDIGO FORMS_START + 292 -#define SPECIES_MINIOR_METEOR_VIOLET FORMS_START + 293 +#define SPECIES_MINIOR_METEOR_ORANGE 1193 +#define SPECIES_MINIOR_METEOR_YELLOW 1194 +#define SPECIES_MINIOR_METEOR_GREEN 1195 +#define SPECIES_MINIOR_METEOR_BLUE 1196 +#define SPECIES_MINIOR_METEOR_INDIGO 1197 +#define SPECIES_MINIOR_METEOR_VIOLET 1198 #define SPECIES_MINIOR_CORE SPECIES_MINIOR_CORE_RED -#define SPECIES_MINIOR_CORE_RED FORMS_START + 294 -#define SPECIES_MINIOR_CORE_ORANGE FORMS_START + 295 -#define SPECIES_MINIOR_CORE_YELLOW FORMS_START + 296 -#define SPECIES_MINIOR_CORE_GREEN FORMS_START + 297 -#define SPECIES_MINIOR_CORE_BLUE FORMS_START + 298 -#define SPECIES_MINIOR_CORE_INDIGO FORMS_START + 299 -#define SPECIES_MINIOR_CORE_VIOLET FORMS_START + 300 - -// Mimikyu -#define SPECIES_MIMIKYU_BUSTED FORMS_START + 301 - -// Necrozma -#define SPECIES_NECROZMA_DUSK_MANE FORMS_START + 302 -#define SPECIES_NECROZMA_DAWN_WINGS FORMS_START + 303 -#define SPECIES_NECROZMA_ULTRA FORMS_START + 304 - -// Magearna -#define SPECIES_MAGEARNA_ORIGINAL_COLOR FORMS_START + 305 - -// Cramorant -#define SPECIES_CRAMORANT_GULPING FORMS_START + 306 -#define SPECIES_CRAMORANT_GORGING FORMS_START + 307 - -// Toxtricity -#define SPECIES_TOXTRICITY_LOW_KEY FORMS_START + 308 - -// Sinistea -#define SPECIES_SINISTEA_ANTIQUE FORMS_START + 309 - -// Polteageist -#define SPECIES_POLTEAGEIST_ANTIQUE FORMS_START + 310 - -// Alcremie +#define SPECIES_MINIOR_CORE_RED 1199 +#define SPECIES_MINIOR_CORE_ORANGE 1200 +#define SPECIES_MINIOR_CORE_YELLOW 1201 +#define SPECIES_MINIOR_CORE_GREEN 1202 +#define SPECIES_MINIOR_CORE_BLUE 1203 +#define SPECIES_MINIOR_CORE_INDIGO 1204 +#define SPECIES_MINIOR_CORE_VIOLET 1205 +#define SPECIES_MIMIKYU_BUSTED 1206 +#define SPECIES_NECROZMA_DUSK_MANE 1207 +#define SPECIES_NECROZMA_DAWN_WINGS 1208 +#define SPECIES_NECROZMA_ULTRA 1209 +#define SPECIES_MAGEARNA_ORIGINAL_COLOR 1210 +#define SPECIES_CRAMORANT_GULPING 1211 +#define SPECIES_CRAMORANT_GORGING 1212 +#define SPECIES_TOXTRICITY_LOW_KEY 1213 +#define SPECIES_SINISTEA_ANTIQUE 1214 +#define SPECIES_POLTEAGEIST_ANTIQUE 1215 #define SPECIES_ALCREMIE_RUBY_CREAM SPECIES_ALCREMIE_STRAWBERRY_RUBY_CREAM #define SPECIES_ALCREMIE_MATCHA_CREAM SPECIES_ALCREMIE_STRAWBERRY_MATCHA_CREAM #define SPECIES_ALCREMIE_MINT_CREAM SPECIES_ALCREMIE_STRAWBERRY_MINT_CREAM @@ -1404,375 +1295,343 @@ #define SPECIES_ALCREMIE_RUBY_SWIRL SPECIES_ALCREMIE_STRAWBERRY_RUBY_SWIRL #define SPECIES_ALCREMIE_CARAMEL_SWIRL SPECIES_ALCREMIE_STRAWBERRY_CARAMEL_SWIRL #define SPECIES_ALCREMIE_RAINBOW_SWIRL SPECIES_ALCREMIE_STRAWBERRY_RAINBOW_SWIRL -#define SPECIES_ALCREMIE_STRAWBERRY_RUBY_CREAM FORMS_START + 311 -#define SPECIES_ALCREMIE_STRAWBERRY_MATCHA_CREAM FORMS_START + 312 -#define SPECIES_ALCREMIE_STRAWBERRY_MINT_CREAM FORMS_START + 313 -#define SPECIES_ALCREMIE_STRAWBERRY_LEMON_CREAM FORMS_START + 314 -#define SPECIES_ALCREMIE_STRAWBERRY_SALTED_CREAM FORMS_START + 315 -#define SPECIES_ALCREMIE_STRAWBERRY_RUBY_SWIRL FORMS_START + 316 -#define SPECIES_ALCREMIE_STRAWBERRY_CARAMEL_SWIRL FORMS_START + 317 -#define SPECIES_ALCREMIE_STRAWBERRY_RAINBOW_SWIRL FORMS_START + 318 - -// Eiscue -#define SPECIES_EISCUE_NOICE_FACE FORMS_START + 319 - -// Indeedee -#define SPECIES_INDEEDEE_FEMALE FORMS_START + 320 - -// Morpeko -#define SPECIES_MORPEKO_HANGRY FORMS_START + 321 - -// Zacian -#define SPECIES_ZACIAN_CROWNED_SWORD FORMS_START + 322 - -// Zamazenta -#define SPECIES_ZAMAZENTA_CROWNED_SHIELD FORMS_START + 323 - -// Eternatus -#define SPECIES_ETERNATUS_ETERNAMAX FORMS_START + 324 - -// Urshifu -#define SPECIES_URSHIFU_RAPID_STRIKE_STYLE FORMS_START + 325 - -// Zarude -#define SPECIES_ZARUDE_DADA FORMS_START + 326 - -// Calyrex -#define SPECIES_CALYREX_ICE_RIDER FORMS_START + 327 -#define SPECIES_CALYREX_SHADOW_RIDER FORMS_START + 328 - -// Basculegion -#define SPECIES_BASCULEGION_FEMALE FORMS_START + 329 - -// More Alcremie +#define SPECIES_ALCREMIE_STRAWBERRY_RUBY_CREAM 1216 +#define SPECIES_ALCREMIE_STRAWBERRY_MATCHA_CREAM 1217 +#define SPECIES_ALCREMIE_STRAWBERRY_MINT_CREAM 1218 +#define SPECIES_ALCREMIE_STRAWBERRY_LEMON_CREAM 1219 +#define SPECIES_ALCREMIE_STRAWBERRY_SALTED_CREAM 1220 +#define SPECIES_ALCREMIE_STRAWBERRY_RUBY_SWIRL 1221 +#define SPECIES_ALCREMIE_STRAWBERRY_CARAMEL_SWIRL 1222 +#define SPECIES_ALCREMIE_STRAWBERRY_RAINBOW_SWIRL 1223 +#define SPECIES_EISCUE_NOICE_FACE 1224 +#define SPECIES_INDEEDEE_FEMALE 1225 +#define SPECIES_MORPEKO_HANGRY 1226 +#define SPECIES_ZACIAN_CROWNED_SWORD 1227 +#define SPECIES_ZAMAZENTA_CROWNED_SHIELD 1228 +#define SPECIES_ETERNATUS_ETERNAMAX 1229 +#define SPECIES_URSHIFU_RAPID_STRIKE_STYLE 1230 +#define SPECIES_ZARUDE_DADA 1231 +#define SPECIES_CALYREX_ICE_RIDER 1232 +#define SPECIES_CALYREX_SHADOW_RIDER 1233 +#define SPECIES_BASCULEGION_FEMALE 1234 #define SPECIES_ALCREMIE_BERRY SPECIES_ALCREMIE_BERRY_VANILLA_CREAM -#define SPECIES_ALCREMIE_BERRY_VANILLA_CREAM FORMS_START + 330 -#define SPECIES_ALCREMIE_BERRY_RUBY_CREAM FORMS_START + 331 -#define SPECIES_ALCREMIE_BERRY_MATCHA_CREAM FORMS_START + 332 -#define SPECIES_ALCREMIE_BERRY_MINT_CREAM FORMS_START + 333 -#define SPECIES_ALCREMIE_BERRY_LEMON_CREAM FORMS_START + 334 -#define SPECIES_ALCREMIE_BERRY_SALTED_CREAM FORMS_START + 335 -#define SPECIES_ALCREMIE_BERRY_RUBY_SWIRL FORMS_START + 336 -#define SPECIES_ALCREMIE_BERRY_CARAMEL_SWIRL FORMS_START + 337 -#define SPECIES_ALCREMIE_BERRY_RAINBOW_SWIRL FORMS_START + 338 +#define SPECIES_ALCREMIE_BERRY_VANILLA_CREAM 1235 +#define SPECIES_ALCREMIE_BERRY_RUBY_CREAM 1236 +#define SPECIES_ALCREMIE_BERRY_MATCHA_CREAM 1237 +#define SPECIES_ALCREMIE_BERRY_MINT_CREAM 1238 +#define SPECIES_ALCREMIE_BERRY_LEMON_CREAM 1239 +#define SPECIES_ALCREMIE_BERRY_SALTED_CREAM 1240 +#define SPECIES_ALCREMIE_BERRY_RUBY_SWIRL 1241 +#define SPECIES_ALCREMIE_BERRY_CARAMEL_SWIRL 1242 +#define SPECIES_ALCREMIE_BERRY_RAINBOW_SWIRL 1243 #define SPECIES_ALCREMIE_LOVE SPECIES_ALCREMIE_LOVE_VANILLA_CREAM -#define SPECIES_ALCREMIE_LOVE_VANILLA_CREAM FORMS_START + 339 -#define SPECIES_ALCREMIE_LOVE_RUBY_CREAM FORMS_START + 340 -#define SPECIES_ALCREMIE_LOVE_MATCHA_CREAM FORMS_START + 341 -#define SPECIES_ALCREMIE_LOVE_MINT_CREAM FORMS_START + 342 -#define SPECIES_ALCREMIE_LOVE_LEMON_CREAM FORMS_START + 343 -#define SPECIES_ALCREMIE_LOVE_SALTED_CREAM FORMS_START + 344 -#define SPECIES_ALCREMIE_LOVE_RUBY_SWIRL FORMS_START + 345 -#define SPECIES_ALCREMIE_LOVE_CARAMEL_SWIRL FORMS_START + 346 -#define SPECIES_ALCREMIE_LOVE_RAINBOW_SWIRL FORMS_START + 347 +#define SPECIES_ALCREMIE_LOVE_VANILLA_CREAM 1244 +#define SPECIES_ALCREMIE_LOVE_RUBY_CREAM 1245 +#define SPECIES_ALCREMIE_LOVE_MATCHA_CREAM 1246 +#define SPECIES_ALCREMIE_LOVE_MINT_CREAM 1247 +#define SPECIES_ALCREMIE_LOVE_LEMON_CREAM 1248 +#define SPECIES_ALCREMIE_LOVE_SALTED_CREAM 1249 +#define SPECIES_ALCREMIE_LOVE_RUBY_SWIRL 1250 +#define SPECIES_ALCREMIE_LOVE_CARAMEL_SWIRL 1251 +#define SPECIES_ALCREMIE_LOVE_RAINBOW_SWIRL 1252 #define SPECIES_ALCREMIE_STAR SPECIES_ALCREMIE_STAR_VANILLA_CREAM -#define SPECIES_ALCREMIE_STAR_VANILLA_CREAM FORMS_START + 348 -#define SPECIES_ALCREMIE_STAR_RUBY_CREAM FORMS_START + 349 -#define SPECIES_ALCREMIE_STAR_MATCHA_CREAM FORMS_START + 350 -#define SPECIES_ALCREMIE_STAR_MINT_CREAM FORMS_START + 351 -#define SPECIES_ALCREMIE_STAR_LEMON_CREAM FORMS_START + 352 -#define SPECIES_ALCREMIE_STAR_SALTED_CREAM FORMS_START + 353 -#define SPECIES_ALCREMIE_STAR_RUBY_SWIRL FORMS_START + 354 -#define SPECIES_ALCREMIE_STAR_CARAMEL_SWIRL FORMS_START + 355 -#define SPECIES_ALCREMIE_STAR_RAINBOW_SWIRL FORMS_START + 356 +#define SPECIES_ALCREMIE_STAR_VANILLA_CREAM 1253 +#define SPECIES_ALCREMIE_STAR_RUBY_CREAM 1254 +#define SPECIES_ALCREMIE_STAR_MATCHA_CREAM 1255 +#define SPECIES_ALCREMIE_STAR_MINT_CREAM 1256 +#define SPECIES_ALCREMIE_STAR_LEMON_CREAM 1257 +#define SPECIES_ALCREMIE_STAR_SALTED_CREAM 1258 +#define SPECIES_ALCREMIE_STAR_RUBY_SWIRL 1259 +#define SPECIES_ALCREMIE_STAR_CARAMEL_SWIRL 1260 +#define SPECIES_ALCREMIE_STAR_RAINBOW_SWIRL 1261 #define SPECIES_ALCREMIE_CLOVER SPECIES_ALCREMIE_CLOVER_VANILLA_CREAM -#define SPECIES_ALCREMIE_CLOVER_VANILLA_CREAM FORMS_START + 357 -#define SPECIES_ALCREMIE_CLOVER_RUBY_CREAM FORMS_START + 358 -#define SPECIES_ALCREMIE_CLOVER_MATCHA_CREAM FORMS_START + 359 -#define SPECIES_ALCREMIE_CLOVER_MINT_CREAM FORMS_START + 360 -#define SPECIES_ALCREMIE_CLOVER_LEMON_CREAM FORMS_START + 361 -#define SPECIES_ALCREMIE_CLOVER_SALTED_CREAM FORMS_START + 362 -#define SPECIES_ALCREMIE_CLOVER_RUBY_SWIRL FORMS_START + 363 -#define SPECIES_ALCREMIE_CLOVER_CARAMEL_SWIRL FORMS_START + 364 -#define SPECIES_ALCREMIE_CLOVER_RAINBOW_SWIRL FORMS_START + 365 +#define SPECIES_ALCREMIE_CLOVER_VANILLA_CREAM 1262 +#define SPECIES_ALCREMIE_CLOVER_RUBY_CREAM 1263 +#define SPECIES_ALCREMIE_CLOVER_MATCHA_CREAM 1264 +#define SPECIES_ALCREMIE_CLOVER_MINT_CREAM 1265 +#define SPECIES_ALCREMIE_CLOVER_LEMON_CREAM 1266 +#define SPECIES_ALCREMIE_CLOVER_SALTED_CREAM 1267 +#define SPECIES_ALCREMIE_CLOVER_RUBY_SWIRL 1268 +#define SPECIES_ALCREMIE_CLOVER_CARAMEL_SWIRL 1269 +#define SPECIES_ALCREMIE_CLOVER_RAINBOW_SWIRL 1270 #define SPECIES_ALCREMIE_FLOWER SPECIES_ALCREMIE_FLOWER_VANILLA_CREAM -#define SPECIES_ALCREMIE_FLOWER_VANILLA_CREAM FORMS_START + 366 -#define SPECIES_ALCREMIE_FLOWER_RUBY_CREAM FORMS_START + 367 -#define SPECIES_ALCREMIE_FLOWER_MATCHA_CREAM FORMS_START + 368 -#define SPECIES_ALCREMIE_FLOWER_MINT_CREAM FORMS_START + 369 -#define SPECIES_ALCREMIE_FLOWER_LEMON_CREAM FORMS_START + 370 -#define SPECIES_ALCREMIE_FLOWER_SALTED_CREAM FORMS_START + 371 -#define SPECIES_ALCREMIE_FLOWER_RUBY_SWIRL FORMS_START + 372 -#define SPECIES_ALCREMIE_FLOWER_CARAMEL_SWIRL FORMS_START + 373 -#define SPECIES_ALCREMIE_FLOWER_RAINBOW_SWIRL FORMS_START + 374 +#define SPECIES_ALCREMIE_FLOWER_VANILLA_CREAM 1271 +#define SPECIES_ALCREMIE_FLOWER_RUBY_CREAM 1272 +#define SPECIES_ALCREMIE_FLOWER_MATCHA_CREAM 1273 +#define SPECIES_ALCREMIE_FLOWER_MINT_CREAM 1274 +#define SPECIES_ALCREMIE_FLOWER_LEMON_CREAM 1275 +#define SPECIES_ALCREMIE_FLOWER_SALTED_CREAM 1276 +#define SPECIES_ALCREMIE_FLOWER_RUBY_SWIRL 1277 +#define SPECIES_ALCREMIE_FLOWER_CARAMEL_SWIRL 1278 +#define SPECIES_ALCREMIE_FLOWER_RAINBOW_SWIRL 1279 #define SPECIES_ALCREMIE_RIBBON SPECIES_ALCREMIE_RIBBON_VANILLA_CREAM -#define SPECIES_ALCREMIE_RIBBON_VANILLA_CREAM FORMS_START + 375 -#define SPECIES_ALCREMIE_RIBBON_RUBY_CREAM FORMS_START + 376 -#define SPECIES_ALCREMIE_RIBBON_MATCHA_CREAM FORMS_START + 377 -#define SPECIES_ALCREMIE_RIBBON_MINT_CREAM FORMS_START + 378 -#define SPECIES_ALCREMIE_RIBBON_LEMON_CREAM FORMS_START + 379 -#define SPECIES_ALCREMIE_RIBBON_SALTED_CREAM FORMS_START + 380 -#define SPECIES_ALCREMIE_RIBBON_RUBY_SWIRL FORMS_START + 381 -#define SPECIES_ALCREMIE_RIBBON_CARAMEL_SWIRL FORMS_START + 382 -#define SPECIES_ALCREMIE_RIBBON_RAINBOW_SWIRL FORMS_START + 383 +#define SPECIES_ALCREMIE_RIBBON_VANILLA_CREAM 1280 +#define SPECIES_ALCREMIE_RIBBON_RUBY_CREAM 1281 +#define SPECIES_ALCREMIE_RIBBON_MATCHA_CREAM 1282 +#define SPECIES_ALCREMIE_RIBBON_MINT_CREAM 1283 +#define SPECIES_ALCREMIE_RIBBON_LEMON_CREAM 1284 +#define SPECIES_ALCREMIE_RIBBON_SALTED_CREAM 1285 +#define SPECIES_ALCREMIE_RIBBON_RUBY_SWIRL 1286 +#define SPECIES_ALCREMIE_RIBBON_CARAMEL_SWIRL 1287 +#define SPECIES_ALCREMIE_RIBBON_RAINBOW_SWIRL 1288 #define GEN9_START SPECIES_ALCREMIE_RIBBON_RAINBOW_SWIRL -#define SPECIES_SPRIGATITO GEN9_START + 1 -#define SPECIES_FLORAGATO GEN9_START + 2 -#define SPECIES_MEOWSCARADA GEN9_START + 3 -#define SPECIES_FUECOCO GEN9_START + 4 -#define SPECIES_CROCALOR GEN9_START + 5 -#define SPECIES_SKELEDIRGE GEN9_START + 6 -#define SPECIES_QUAXLY GEN9_START + 7 -#define SPECIES_QUAXWELL GEN9_START + 8 -#define SPECIES_QUAQUAVAL GEN9_START + 9 -#define SPECIES_LECHONK GEN9_START + 10 +#define SPECIES_SPRIGATITO 1289 +#define SPECIES_FLORAGATO 1290 +#define SPECIES_MEOWSCARADA 1291 +#define SPECIES_FUECOCO 1292 +#define SPECIES_CROCALOR 1293 +#define SPECIES_SKELEDIRGE 1294 +#define SPECIES_QUAXLY 1295 +#define SPECIES_QUAXWELL 1296 +#define SPECIES_QUAQUAVAL 1297 +#define SPECIES_LECHONK 1298 #define SPECIES_OINKOLOGNE SPECIES_OINKOLOGNE_MALE -#define SPECIES_OINKOLOGNE_MALE GEN9_START + 11 -#define SPECIES_OINKOLOGNE_FEMALE GEN9_START + 12 -#define SPECIES_TAROUNTULA GEN9_START + 13 -#define SPECIES_SPIDOPS GEN9_START + 14 -#define SPECIES_NYMBLE GEN9_START + 15 -#define SPECIES_LOKIX GEN9_START + 16 -#define SPECIES_PAWMI GEN9_START + 17 -#define SPECIES_PAWMO GEN9_START + 18 -#define SPECIES_PAWMOT GEN9_START + 19 -#define SPECIES_TANDEMAUS GEN9_START + 20 +#define SPECIES_OINKOLOGNE_MALE 1299 +#define SPECIES_OINKOLOGNE_FEMALE 1300 +#define SPECIES_TAROUNTULA 1301 +#define SPECIES_SPIDOPS 1302 +#define SPECIES_NYMBLE 1303 +#define SPECIES_LOKIX 1304 +#define SPECIES_PAWMI 1305 +#define SPECIES_PAWMO 1306 +#define SPECIES_PAWMOT 1307 +#define SPECIES_TANDEMAUS 1308 #define SPECIES_MAUSHOLD SPECIES_MAUSHOLD_FAMILY_OF_THREE -#define SPECIES_MAUSHOLD_FAMILY_OF_THREE GEN9_START + 21 -#define SPECIES_MAUSHOLD_FAMILY_OF_FOUR GEN9_START + 22 -#define SPECIES_FIDOUGH GEN9_START + 23 -#define SPECIES_DACHSBUN GEN9_START + 24 -#define SPECIES_SMOLIV GEN9_START + 25 -#define SPECIES_DOLLIV GEN9_START + 26 -#define SPECIES_ARBOLIVA GEN9_START + 27 +#define SPECIES_MAUSHOLD_FAMILY_OF_THREE 1309 +#define SPECIES_MAUSHOLD_FAMILY_OF_FOUR 1310 +#define SPECIES_FIDOUGH 1311 +#define SPECIES_DACHSBUN 1312 +#define SPECIES_SMOLIV 1313 +#define SPECIES_DOLLIV 1314 +#define SPECIES_ARBOLIVA 1315 #define SPECIES_SQUAWKABILLY SPECIES_SQUAWKABILLY_GREEN_PLUMAGE -#define SPECIES_SQUAWKABILLY_GREEN_PLUMAGE GEN9_START + 28 -#define SPECIES_SQUAWKABILLY_BLUE_PLUMAGE GEN9_START + 29 -#define SPECIES_SQUAWKABILLY_YELLOW_PLUMAGE GEN9_START + 30 -#define SPECIES_SQUAWKABILLY_WHITE_PLUMAGE GEN9_START + 31 -#define SPECIES_NACLI GEN9_START + 32 -#define SPECIES_NACLSTACK GEN9_START + 33 -#define SPECIES_GARGANACL GEN9_START + 34 -#define SPECIES_CHARCADET GEN9_START + 35 -#define SPECIES_ARMAROUGE GEN9_START + 36 -#define SPECIES_CERULEDGE GEN9_START + 37 -#define SPECIES_TADBULB GEN9_START + 38 -#define SPECIES_BELLIBOLT GEN9_START + 39 -#define SPECIES_WATTREL GEN9_START + 40 -#define SPECIES_KILOWATTREL GEN9_START + 41 -#define SPECIES_MASCHIFF GEN9_START + 42 -#define SPECIES_MABOSSTIFF GEN9_START + 43 -#define SPECIES_SHROODLE GEN9_START + 44 -#define SPECIES_GRAFAIAI GEN9_START + 45 -#define SPECIES_BRAMBLIN GEN9_START + 46 -#define SPECIES_BRAMBLEGHAST GEN9_START + 47 -#define SPECIES_TOEDSCOOL GEN9_START + 48 -#define SPECIES_TOEDSCRUEL GEN9_START + 49 -#define SPECIES_KLAWF GEN9_START + 50 -#define SPECIES_CAPSAKID GEN9_START + 51 -#define SPECIES_SCOVILLAIN GEN9_START + 52 -#define SPECIES_RELLOR GEN9_START + 53 -#define SPECIES_RABSCA GEN9_START + 54 -#define SPECIES_FLITTLE GEN9_START + 55 -#define SPECIES_ESPATHRA GEN9_START + 56 -#define SPECIES_TINKATINK GEN9_START + 57 -#define SPECIES_TINKATUFF GEN9_START + 58 -#define SPECIES_TINKATON GEN9_START + 59 -#define SPECIES_WIGLETT GEN9_START + 60 -#define SPECIES_WUGTRIO GEN9_START + 61 -#define SPECIES_BOMBIRDIER GEN9_START + 62 -#define SPECIES_FINIZEN GEN9_START + 63 +#define SPECIES_SQUAWKABILLY_GREEN_PLUMAGE 1316 +#define SPECIES_SQUAWKABILLY_BLUE_PLUMAGE 1317 +#define SPECIES_SQUAWKABILLY_YELLOW_PLUMAGE 1318 +#define SPECIES_SQUAWKABILLY_WHITE_PLUMAGE 1319 +#define SPECIES_NACLI 1320 +#define SPECIES_NACLSTACK 1321 +#define SPECIES_GARGANACL 1322 +#define SPECIES_CHARCADET 1323 +#define SPECIES_ARMAROUGE 1324 +#define SPECIES_CERULEDGE 1325 +#define SPECIES_TADBULB 1326 +#define SPECIES_BELLIBOLT 1327 +#define SPECIES_WATTREL 1328 +#define SPECIES_KILOWATTREL 1329 +#define SPECIES_MASCHIFF 1330 +#define SPECIES_MABOSSTIFF 1331 +#define SPECIES_SHROODLE 1332 +#define SPECIES_GRAFAIAI 1333 +#define SPECIES_BRAMBLIN 1334 +#define SPECIES_BRAMBLEGHAST 1335 +#define SPECIES_TOEDSCOOL 1336 +#define SPECIES_TOEDSCRUEL 1337 +#define SPECIES_KLAWF 1338 +#define SPECIES_CAPSAKID 1339 +#define SPECIES_SCOVILLAIN 1340 +#define SPECIES_RELLOR 1341 +#define SPECIES_RABSCA 1342 +#define SPECIES_FLITTLE 1343 +#define SPECIES_ESPATHRA 1344 +#define SPECIES_TINKATINK 1345 +#define SPECIES_TINKATUFF 1346 +#define SPECIES_TINKATON 1347 +#define SPECIES_WIGLETT 1348 +#define SPECIES_WUGTRIO 1349 +#define SPECIES_BOMBIRDIER 1350 +#define SPECIES_FINIZEN 1351 #define SPECIES_PALAFIN SPECIES_PALAFIN_ZERO -#define SPECIES_PALAFIN_ZERO GEN9_START + 64 -#define SPECIES_PALAFIN_HERO GEN9_START + 65 -#define SPECIES_VAROOM GEN9_START + 66 -#define SPECIES_REVAVROOM GEN9_START + 67 -#define SPECIES_CYCLIZAR GEN9_START + 68 -#define SPECIES_ORTHWORM GEN9_START + 69 -#define SPECIES_GLIMMET GEN9_START + 70 -#define SPECIES_GLIMMORA GEN9_START + 71 -#define SPECIES_GREAVARD GEN9_START + 72 -#define SPECIES_HOUNDSTONE GEN9_START + 73 -#define SPECIES_FLAMIGO GEN9_START + 74 -#define SPECIES_CETODDLE GEN9_START + 75 -#define SPECIES_CETITAN GEN9_START + 76 -#define SPECIES_VELUZA GEN9_START + 77 -#define SPECIES_DONDOZO GEN9_START + 78 +#define SPECIES_PALAFIN_ZERO 1352 +#define SPECIES_PALAFIN_HERO 1353 +#define SPECIES_VAROOM 1354 +#define SPECIES_REVAVROOM 1355 +#define SPECIES_CYCLIZAR 1356 +#define SPECIES_ORTHWORM 1357 +#define SPECIES_GLIMMET 1358 +#define SPECIES_GLIMMORA 1359 +#define SPECIES_GREAVARD 1360 +#define SPECIES_HOUNDSTONE 1361 +#define SPECIES_FLAMIGO 1362 +#define SPECIES_CETODDLE 1363 +#define SPECIES_CETITAN 1364 +#define SPECIES_VELUZA 1365 +#define SPECIES_DONDOZO 1366 #define SPECIES_TATSUGIRI SPECIES_TATSUGIRI_CURLY -#define SPECIES_TATSUGIRI_CURLY GEN9_START + 79 -#define SPECIES_TATSUGIRI_DROOPY GEN9_START + 80 -#define SPECIES_TATSUGIRI_STRETCHY GEN9_START + 81 -#define SPECIES_ANNIHILAPE GEN9_START + 82 -#define SPECIES_CLODSIRE GEN9_START + 83 -#define SPECIES_FARIGIRAF GEN9_START + 84 +#define SPECIES_TATSUGIRI_CURLY 1367 +#define SPECIES_TATSUGIRI_DROOPY 1368 +#define SPECIES_TATSUGIRI_STRETCHY 1369 +#define SPECIES_ANNIHILAPE 1370 +#define SPECIES_CLODSIRE 1371 +#define SPECIES_FARIGIRAF 1372 #define SPECIES_DUDUNSPARCE SPECIES_DUDUNSPARCE_TWO_SEGMENT -#define SPECIES_DUDUNSPARCE_TWO_SEGMENT GEN9_START + 85 -#define SPECIES_DUDUNSPARCE_THREE_SEGMENT GEN9_START + 86 -#define SPECIES_KINGAMBIT GEN9_START + 87 -#define SPECIES_GREAT_TUSK GEN9_START + 88 -#define SPECIES_SCREAM_TAIL GEN9_START + 89 -#define SPECIES_BRUTE_BONNET GEN9_START + 90 -#define SPECIES_FLUTTER_MANE GEN9_START + 91 -#define SPECIES_SLITHER_WING GEN9_START + 92 -#define SPECIES_SANDY_SHOCKS GEN9_START + 93 -#define SPECIES_IRON_TREADS GEN9_START + 94 -#define SPECIES_IRON_BUNDLE GEN9_START + 95 -#define SPECIES_IRON_HANDS GEN9_START + 96 -#define SPECIES_IRON_JUGULIS GEN9_START + 97 -#define SPECIES_IRON_MOTH GEN9_START + 98 -#define SPECIES_IRON_THORNS GEN9_START + 99 -#define SPECIES_FRIGIBAX GEN9_START + 100 -#define SPECIES_ARCTIBAX GEN9_START + 101 -#define SPECIES_BAXCALIBUR GEN9_START + 102 +#define SPECIES_DUDUNSPARCE_TWO_SEGMENT 1373 +#define SPECIES_DUDUNSPARCE_THREE_SEGMENT 1374 +#define SPECIES_KINGAMBIT 1375 +#define SPECIES_GREAT_TUSK 1376 +#define SPECIES_SCREAM_TAIL 1377 +#define SPECIES_BRUTE_BONNET 1378 +#define SPECIES_FLUTTER_MANE 1379 +#define SPECIES_SLITHER_WING 1380 +#define SPECIES_SANDY_SHOCKS 1381 +#define SPECIES_IRON_TREADS 1382 +#define SPECIES_IRON_BUNDLE 1383 +#define SPECIES_IRON_HANDS 1384 +#define SPECIES_IRON_JUGULIS 1385 +#define SPECIES_IRON_MOTH 1386 +#define SPECIES_IRON_THORNS 1387 +#define SPECIES_FRIGIBAX 1388 +#define SPECIES_ARCTIBAX 1389 +#define SPECIES_BAXCALIBUR 1390 #define SPECIES_GIMMIGHOUL SPECIES_GIMMIGHOUL_CHEST -#define SPECIES_GIMMIGHOUL_CHEST GEN9_START + 103 -#define SPECIES_GIMMIGHOUL_ROAMING GEN9_START + 104 -#define SPECIES_GHOLDENGO GEN9_START + 105 -#define SPECIES_WO_CHIEN GEN9_START + 106 -#define SPECIES_CHIEN_PAO GEN9_START + 107 -#define SPECIES_TING_LU GEN9_START + 108 -#define SPECIES_CHI_YU GEN9_START + 109 -#define SPECIES_ROARING_MOON GEN9_START + 110 -#define SPECIES_IRON_VALIANT GEN9_START + 111 -#define SPECIES_KORAIDON GEN9_START + 112 -#define SPECIES_MIRAIDON GEN9_START + 113 +#define SPECIES_GIMMIGHOUL_CHEST 1391 +#define SPECIES_GIMMIGHOUL_ROAMING 1392 +#define SPECIES_GHOLDENGO 1393 +#define SPECIES_WO_CHIEN 1394 +#define SPECIES_CHIEN_PAO 1395 +#define SPECIES_TING_LU 1396 +#define SPECIES_CHI_YU 1397 +#define SPECIES_ROARING_MOON 1398 +#define SPECIES_IRON_VALIANT 1399 +#define SPECIES_KORAIDON 1400 +#define SPECIES_MIRAIDON 1401 // Paldean Forms -#define SPECIES_TAUROS_PALDEAN_COMBAT_BREED GEN9_START + 114 -#define SPECIES_TAUROS_PALDEAN_BLAZE_BREED GEN9_START + 115 -#define SPECIES_TAUROS_PALDEAN_AQUA_BREED GEN9_START + 116 -#define SPECIES_WOOPER_PALDEAN GEN9_START + 117 +#define SPECIES_TAUROS_PALDEAN_COMBAT_BREED 1402 +#define SPECIES_TAUROS_PALDEAN_BLAZE_BREED 1403 +#define SPECIES_TAUROS_PALDEAN_AQUA_BREED 1404 +#define SPECIES_WOOPER_PALDEAN 1405 // Scarlet and Violet 1.2.0 -#define SPECIES_WALKING_WAKE GEN9_START + 118 -#define SPECIES_IRON_LEAVES GEN9_START + 119 +#define SPECIES_WALKING_WAKE 1406 +#define SPECIES_IRON_LEAVES 1407 // Teal Mask -#define SPECIES_DIPPLIN GEN9_START + 120 +#define SPECIES_DIPPLIN 1408 #define SPECIES_POLTCHAGEIST SPECIES_POLTCHAGEIST_COUNTERFEIT -#define SPECIES_POLTCHAGEIST_COUNTERFEIT GEN9_START + 121 -#define SPECIES_POLTCHAGEIST_ARTISAN GEN9_START + 122 +#define SPECIES_POLTCHAGEIST_COUNTERFEIT 1409 +#define SPECIES_POLTCHAGEIST_ARTISAN 1410 #define SPECIES_SINISTCHA SPECIES_SINISTCHA_UNREMARKABLE -#define SPECIES_SINISTCHA_UNREMARKABLE GEN9_START + 123 -#define SPECIES_SINISTCHA_MASTERPIECE GEN9_START + 124 -#define SPECIES_OKIDOGI GEN9_START + 125 -#define SPECIES_MUNKIDORI GEN9_START + 126 -#define SPECIES_FEZANDIPITI GEN9_START + 127 +#define SPECIES_SINISTCHA_UNREMARKABLE 1411 +#define SPECIES_SINISTCHA_MASTERPIECE 1412 +#define SPECIES_OKIDOGI 1413 +#define SPECIES_MUNKIDORI 1414 +#define SPECIES_FEZANDIPITI 1415 #define SPECIES_OGERPON SPECIES_OGERPON_TEAL_MASK -#define SPECIES_OGERPON_TEAL_MASK GEN9_START + 128 -#define SPECIES_OGERPON_WELLSPRING_MASK GEN9_START + 129 -#define SPECIES_OGERPON_HEARTHFLAME_MASK GEN9_START + 130 -#define SPECIES_OGERPON_CORNERSTONE_MASK GEN9_START + 131 -#define SPECIES_OGERPON_TEAL_MASK_TERA GEN9_START + 132 -#define SPECIES_OGERPON_WELLSPRING_MASK_TERA GEN9_START + 133 -#define SPECIES_OGERPON_HEARTHFLAME_MASK_TERA GEN9_START + 134 -#define SPECIES_OGERPON_CORNERSTONE_MASK_TERA GEN9_START + 135 -#define SPECIES_URSALUNA_BLOODMOON GEN9_START + 136 +#define SPECIES_OGERPON_TEAL_MASK 1416 +#define SPECIES_OGERPON_WELLSPRING_MASK 1417 +#define SPECIES_OGERPON_HEARTHFLAME_MASK 1418 +#define SPECIES_OGERPON_CORNERSTONE_MASK 1419 +#define SPECIES_OGERPON_TEAL_MASK_TERA 1420 +#define SPECIES_OGERPON_WELLSPRING_MASK_TERA 1421 +#define SPECIES_OGERPON_HEARTHFLAME_MASK_TERA 1422 +#define SPECIES_OGERPON_CORNERSTONE_MASK_TERA 1423 +#define SPECIES_URSALUNA_BLOODMOON 1424 // Indigo Disk -#define SPECIES_1018 GEN9_START + 137 -#define SPECIES_1019 GEN9_START + 138 -#define SPECIES_1020 GEN9_START + 139 -#define SPECIES_1021 GEN9_START + 140 -#define SPECIES_1022 GEN9_START + 141 -#define SPECIES_1023 GEN9_START + 142 -#define SPECIES_1024 SPECIES_1024_FORM_1 -#define SPECIES_1024_FORM_1 GEN9_START + 143 -#define SPECIES_1024_FORM_2 GEN9_START + 144 -#define SPECIES_1024_FORM_3 GEN9_START + 145 -#define SPECIES_1025 GEN9_START + 146 +#define SPECIES_ARCHALUDON 1425 +#define SPECIES_HYDRAPPLE 1426 +#define SPECIES_GOUGING_FIRE 1427 +#define SPECIES_RAGING_BOLT 1428 +#define SPECIES_IRON_BOULDER 1429 +#define SPECIES_IRON_CROWN 1430 +#define SPECIES_TERAPAGOS SPECIES_TERAPAGOS_NORMAL +#define SPECIES_TERAPAGOS_NORMAL 1431 +#define SPECIES_TERAPAGOS_TERASTAL 1432 +#define SPECIES_TERAPAGOS_STELLAR 1433 +#define SPECIES_PECHARUNT 1434 +#define SPECIES_LUGIA_SHADOW 1435 +#define SPECIES_MOTHIM_SANDY_CLOAK 1436 +#define SPECIES_MOTHIM_TRASH_CLOAK 1437 +#define SPECIES_SCATTERBUG_POLAR 1438 +#define SPECIES_SCATTERBUG_TUNDRA 1439 +#define SPECIES_SCATTERBUG_CONTINENTAL 1440 +#define SPECIES_SCATTERBUG_GARDEN 1441 +#define SPECIES_SCATTERBUG_ELEGANT 1442 +#define SPECIES_SCATTERBUG_MEADOW 1443 +#define SPECIES_SCATTERBUG_MODERN 1444 +#define SPECIES_SCATTERBUG_MARINE 1445 +#define SPECIES_SCATTERBUG_ARCHIPELAGO 1446 +#define SPECIES_SCATTERBUG_HIGH_PLAINS 1447 +#define SPECIES_SCATTERBUG_SANDSTORM 1448 +#define SPECIES_SCATTERBUG_RIVER 1449 +#define SPECIES_SCATTERBUG_MONSOON 1450 +#define SPECIES_SCATTERBUG_SAVANNA 1451 +#define SPECIES_SCATTERBUG_SUN 1452 +#define SPECIES_SCATTERBUG_OCEAN 1453 +#define SPECIES_SCATTERBUG_JUNGLE 1454 +#define SPECIES_SCATTERBUG_FANCY 1455 +#define SPECIES_SCATTERBUG_POKE_BALL 1456 +#define SPECIES_SPEWPA_POLAR 1457 +#define SPECIES_SPEWPA_TUNDRA 1458 +#define SPECIES_SPEWPA_CONTINENTAL 1459 +#define SPECIES_SPEWPA_GARDEN 1460 +#define SPECIES_SPEWPA_ELEGANT 1461 +#define SPECIES_SPEWPA_MEADOW 1462 +#define SPECIES_SPEWPA_MODERN 1463 +#define SPECIES_SPEWPA_MARINE 1464 +#define SPECIES_SPEWPA_ARCHIPELAGO 1465 +#define SPECIES_SPEWPA_HIGH_PLAINS 1466 +#define SPECIES_SPEWPA_SANDSTORM 1467 +#define SPECIES_SPEWPA_RIVER 1468 +#define SPECIES_SPEWPA_MONSOON 1469 +#define SPECIES_SPEWPA_SAVANNA 1470 +#define SPECIES_SPEWPA_SUN 1471 +#define SPECIES_SPEWPA_OCEAN 1472 +#define SPECIES_SPEWPA_JUNGLE 1473 +#define SPECIES_SPEWPA_FANCY 1474 +#define SPECIES_SPEWPA_POKE_BALL 1475 +#define SPECIES_RATICATE_ALOLAN_TOTEM 1476 +#define SPECIES_GUMSHOOS_TOTEM 1477 +#define SPECIES_VIKAVOLT_TOTEM 1478 +#define SPECIES_LURANTIS_TOTEM 1479 +#define SPECIES_SALAZZLE_TOTEM 1480 +#define SPECIES_MIMIKYU_TOTEM SPECIES_MIMIKYU_TOTEM_DISGUISED +#define SPECIES_MIMIKYU_TOTEM_DISGUISED 1481 +#define SPECIES_KOMMO_O_TOTEM 1482 +#define SPECIES_MAROWAK_ALOLAN_TOTEM 1483 +#define SPECIES_RIBOMBEE_TOTEM 1484 +#define SPECIES_ARAQUANID_TOTEM 1485 +#define SPECIES_TOGEDEMARU_TOTEM 1486 +#define SPECIES_PIKACHU_PARTNER 1487 +#define SPECIES_EEVEE_PARTNER 1488 +#define SPECIES_VENUSAUR_GIGANTAMAX 1489 +#define SPECIES_BLASTOISE_GIGANTAMAX 1490 +#define SPECIES_CHARIZARD_GIGANTAMAX 1491 +#define SPECIES_BUTTERFREE_GIGANTAMAX 1492 +#define SPECIES_PIKACHU_GIGANTAMAX 1493 +#define SPECIES_MEOWTH_GIGANTAMAX 1494 +#define SPECIES_MACHAMP_GIGANTAMAX 1495 +#define SPECIES_GENGAR_GIGANTAMAX 1496 +#define SPECIES_KINGLER_GIGANTAMAX 1497 +#define SPECIES_LAPRAS_GIGANTAMAX 1498 +#define SPECIES_EEVEE_GIGANTAMAX 1499 +#define SPECIES_SNORLAX_GIGANTAMAX 1500 +#define SPECIES_GARBODOR_GIGANTAMAX 1501 +#define SPECIES_MELMETAL_GIGANTAMAX 1502 +#define SPECIES_RILLABOOM_GIGANTAMAX 1503 +#define SPECIES_CINDERACE_GIGANTAMAX 1504 +#define SPECIES_INTELEON_GIGANTAMAX 1505 +#define SPECIES_CORVIKNIGHT_GIGANTAMAX 1506 +#define SPECIES_ORBEETLE_GIGANTAMAX 1507 +#define SPECIES_DREDNAW_GIGANTAMAX 1508 +#define SPECIES_COALOSSAL_GIGANTAMAX 1509 +#define SPECIES_FLAPPLE_GIGANTAMAX 1510 +#define SPECIES_APPLETUN_GIGANTAMAX 1511 +#define SPECIES_SANDACONDA_GIGANTAMAX 1512 +#define SPECIES_TOXTRICITY_AMPED_GIGANTAMAX 1513 +#define SPECIES_TOXTRICITY_LOW_KEY_GIGANTAMAX 1514 +#define SPECIES_CENTISKORCH_GIGANTAMAX 1515 +#define SPECIES_HATTERENE_GIGANTAMAX 1516 +#define SPECIES_GRIMMSNARL_GIGANTAMAX 1517 +#define SPECIES_ALCREMIE_GIGANTAMAX 1518 +#define SPECIES_COPPERAJAH_GIGANTAMAX 1519 +#define SPECIES_DURALUDON_GIGANTAMAX 1520 +#define SPECIES_URSHIFU_SINGLE_STRIKE_STYLE_GIGANTAMAX 1521 +#define SPECIES_URSHIFU_RAPID_STRIKE_STYLE_GIGANTAMAX 1522 +#define SPECIES_MIMIKYU_TOTEM_BUSTED 1523 -#define PLACEHOLDER_START SPECIES_1025 -// XD: Gale of Darkness -#define SPECIES_LUGIA_SHADOW PLACEHOLDER_START + 1 -// Diamond & Pearl -#define SPECIES_MOTHIM_SANDY_CLOAK PLACEHOLDER_START + 2 -#define SPECIES_MOTHIM_TRASH_CLOAK PLACEHOLDER_START + 3 -// X & Y -#define SPECIES_SCATTERBUG_POLAR PLACEHOLDER_START + 4 -#define SPECIES_SCATTERBUG_TUNDRA PLACEHOLDER_START + 5 -#define SPECIES_SCATTERBUG_CONTINENTAL PLACEHOLDER_START + 6 -#define SPECIES_SCATTERBUG_GARDEN PLACEHOLDER_START + 7 -#define SPECIES_SCATTERBUG_ELEGANT PLACEHOLDER_START + 8 -#define SPECIES_SCATTERBUG_MEADOW PLACEHOLDER_START + 9 -#define SPECIES_SCATTERBUG_MODERN PLACEHOLDER_START + 10 -#define SPECIES_SCATTERBUG_MARINE PLACEHOLDER_START + 11 -#define SPECIES_SCATTERBUG_ARCHIPELAGO PLACEHOLDER_START + 12 -#define SPECIES_SCATTERBUG_HIGH_PLAINS PLACEHOLDER_START + 13 -#define SPECIES_SCATTERBUG_SANDSTORM PLACEHOLDER_START + 14 -#define SPECIES_SCATTERBUG_RIVER PLACEHOLDER_START + 15 -#define SPECIES_SCATTERBUG_MONSOON PLACEHOLDER_START + 16 -#define SPECIES_SCATTERBUG_SAVANNA PLACEHOLDER_START + 17 -#define SPECIES_SCATTERBUG_SUN PLACEHOLDER_START + 18 -#define SPECIES_SCATTERBUG_OCEAN PLACEHOLDER_START + 19 -#define SPECIES_SCATTERBUG_JUNGLE PLACEHOLDER_START + 20 -#define SPECIES_SCATTERBUG_FANCY PLACEHOLDER_START + 21 -#define SPECIES_SCATTERBUG_POKE_BALL PLACEHOLDER_START + 22 -#define SPECIES_SPEWPA_POLAR PLACEHOLDER_START + 23 -#define SPECIES_SPEWPA_TUNDRA PLACEHOLDER_START + 24 -#define SPECIES_SPEWPA_CONTINENTAL PLACEHOLDER_START + 25 -#define SPECIES_SPEWPA_GARDEN PLACEHOLDER_START + 26 -#define SPECIES_SPEWPA_ELEGANT PLACEHOLDER_START + 27 -#define SPECIES_SPEWPA_MEADOW PLACEHOLDER_START + 28 -#define SPECIES_SPEWPA_MODERN PLACEHOLDER_START + 29 -#define SPECIES_SPEWPA_MARINE PLACEHOLDER_START + 30 -#define SPECIES_SPEWPA_ARCHIPELAGO PLACEHOLDER_START + 31 -#define SPECIES_SPEWPA_HIGH_PLAINS PLACEHOLDER_START + 32 -#define SPECIES_SPEWPA_SANDSTORM PLACEHOLDER_START + 33 -#define SPECIES_SPEWPA_RIVER PLACEHOLDER_START + 34 -#define SPECIES_SPEWPA_MONSOON PLACEHOLDER_START + 35 -#define SPECIES_SPEWPA_SAVANNA PLACEHOLDER_START + 36 -#define SPECIES_SPEWPA_SUN PLACEHOLDER_START + 37 -#define SPECIES_SPEWPA_OCEAN PLACEHOLDER_START + 38 -#define SPECIES_SPEWPA_JUNGLE PLACEHOLDER_START + 39 -#define SPECIES_SPEWPA_FANCY PLACEHOLDER_START + 40 -#define SPECIES_SPEWPA_POKE_BALL PLACEHOLDER_START + 41 -// Sun & Moon -#define SPECIES_RATICATE_ALOLAN_TOTEM PLACEHOLDER_START + 42 -#define SPECIES_GUMSHOOS_TOTEM PLACEHOLDER_START + 43 -#define SPECIES_VIKAVOLT_TOTEM PLACEHOLDER_START + 44 -#define SPECIES_LURANTIS_TOTEM PLACEHOLDER_START + 45 -#define SPECIES_SALAZZLE_TOTEM PLACEHOLDER_START + 46 -#define SPECIES_MIMIKYU_TOTEM PLACEHOLDER_START + 47 -#define SPECIES_KOMMO_O_TOTEM PLACEHOLDER_START + 48 -// Ultra Sun & Ultra Moon -#define SPECIES_MAROWAK_ALOLAN_TOTEM PLACEHOLDER_START + 49 -#define SPECIES_RIBOMBEE_TOTEM PLACEHOLDER_START + 50 -#define SPECIES_ARAQUANID_TOTEM PLACEHOLDER_START + 51 -#define SPECIES_TOGEDEMARU_TOTEM PLACEHOLDER_START + 52 -// Let's Go Pikachu & Let's Go Eevee -#define SPECIES_PIKACHU_PARTNER PLACEHOLDER_START + 53 -#define SPECIES_EEVEE_PARTNER PLACEHOLDER_START + 54 +#define SPECIES_EGG SPECIES_MIMIKYU_TOTEM_BUSTED + 1 -#define GIGANTAMAX_START SPECIES_EEVEE_PARTNER - -// Gigantamax Forms -#define SPECIES_VENUSAUR_GIGANTAMAX GIGANTAMAX_START + 1 -#define SPECIES_BLASTOISE_GIGANTAMAX GIGANTAMAX_START + 2 -#define SPECIES_CHARIZARD_GIGANTAMAX GIGANTAMAX_START + 3 -#define SPECIES_BUTTERFREE_GIGANTAMAX GIGANTAMAX_START + 4 -#define SPECIES_PIKACHU_GIGANTAMAX GIGANTAMAX_START + 5 -#define SPECIES_MEOWTH_GIGANTAMAX GIGANTAMAX_START + 6 -#define SPECIES_MACHAMP_GIGANTAMAX GIGANTAMAX_START + 7 -#define SPECIES_GENGAR_GIGANTAMAX GIGANTAMAX_START + 8 -#define SPECIES_KINGLER_GIGANTAMAX GIGANTAMAX_START + 9 -#define SPECIES_LAPRAS_GIGANTAMAX GIGANTAMAX_START + 10 -#define SPECIES_EEVEE_GIGANTAMAX GIGANTAMAX_START + 11 -#define SPECIES_SNORLAX_GIGANTAMAX GIGANTAMAX_START + 12 -#define SPECIES_GARBODOR_GIGANTAMAX GIGANTAMAX_START + 13 -#define SPECIES_MELMETAL_GIGANTAMAX GIGANTAMAX_START + 14 -#define SPECIES_RILLABOOM_GIGANTAMAX GIGANTAMAX_START + 15 -#define SPECIES_CINDERACE_GIGANTAMAX GIGANTAMAX_START + 16 -#define SPECIES_INTELEON_GIGANTAMAX GIGANTAMAX_START + 17 -#define SPECIES_CORVIKNIGHT_GIGANTAMAX GIGANTAMAX_START + 18 -#define SPECIES_ORBEETLE_GIGANTAMAX GIGANTAMAX_START + 19 -#define SPECIES_DREDNAW_GIGANTAMAX GIGANTAMAX_START + 20 -#define SPECIES_COALOSSAL_GIGANTAMAX GIGANTAMAX_START + 21 -#define SPECIES_FLAPPLE_GIGANTAMAX GIGANTAMAX_START + 22 -#define SPECIES_APPLETUN_GIGANTAMAX GIGANTAMAX_START + 23 -#define SPECIES_SANDACONDA_GIGANTAMAX GIGANTAMAX_START + 24 -#define SPECIES_TOXTRICITY_AMPED_GIGANTAMAX GIGANTAMAX_START + 25 -#define SPECIES_TOXTRICITY_LOW_KEY_GIGANTAMAX GIGANTAMAX_START + 26 -#define SPECIES_CENTISKORCH_GIGANTAMAX GIGANTAMAX_START + 27 -#define SPECIES_HATTERENE_GIGANTAMAX GIGANTAMAX_START + 28 -#define SPECIES_GRIMMSNARL_GIGANTAMAX GIGANTAMAX_START + 29 -#define SPECIES_ALCREMIE_GIGANTAMAX GIGANTAMAX_START + 30 -#define SPECIES_COPPERAJAH_GIGANTAMAX GIGANTAMAX_START + 31 -#define SPECIES_DURALUDON_GIGANTAMAX GIGANTAMAX_START + 32 -#define SPECIES_URSHIFU_SINGLE_STRIKE_STYLE_GIGANTAMAX GIGANTAMAX_START + 33 -#define SPECIES_URSHIFU_RAPID_STRIKE_STYLE_GIGANTAMAX GIGANTAMAX_START + 34 - -#define SPECIES_EGG SPECIES_URSHIFU_RAPID_STRIKE_STYLE_GIGANTAMAX + 1 - -#define KANTO_SPECIES_END SPECIES_MEW +#define KANTO_SPECIES_END SPECIES_MEW // TODO: remove #define NUM_SPECIES SPECIES_EGG diff --git a/include/data.h b/include/data.h index ad6154ea6..991dc36d1 100644 --- a/include/data.h +++ b/include/data.h @@ -2,6 +2,7 @@ #define GUARD_DATA_H #include "global.h" +#include "constants/trainers.h" #define SPECIES_SHINY_TAG 500 #define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F)) @@ -23,6 +24,13 @@ extern const u8 gMoveNames[][MOVE_NAME_LENGTH + 1]; extern const u8 gTrainerClassNames[][13]; +static inline u16 SanitizeTrainerId(u16 trainerId) +{ + if (trainerId >= NUM_TRAINERS) + return TRAINER_NONE; + return trainerId; +} + // extern const struct MonCoords gMonFrontPicCoords[]; // extern const struct CompressedSpriteSheet gMonFrontPicTable[]; // extern const struct MonCoords gMonBackPicCoords[]; @@ -41,8 +49,6 @@ extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; -extern const u8 gEnemyMonElevation[NUM_SPECIES]; - extern const u8 *const gBattleAnims_General[]; extern const u8 *const gBattleAnims_Special[]; @@ -63,4 +69,9 @@ extern const struct SpriteFrameImage gTrainerBackPicTable_RSMay[]; extern const union AnimCmd sAnim_GeneralFrame0[]; +// static inline const struct TrainerMon *GetTrainerPartyFromId(u16 trainerId) +// { +// return gTrainers[SanitizeTrainerId(trainerId)].party; +// } + #endif // GUARD_DATA_H diff --git a/include/fpmath.h b/include/fpmath.h new file mode 100644 index 000000000..6e3edd64e --- /dev/null +++ b/include/fpmath.h @@ -0,0 +1,81 @@ +#ifndef FPMATH_H_ +#define FPMATH_H_ + +typedef s16 q4_12_t; +typedef u32 uq4_12_t; + +#define Q_4_12_SHIFT (12) +#define UQ_4_12_SHIFT (12) + +// Converts a number to Q8.8 fixed-point format +#define Q_8_8(n) ((s16)((n) * 256)) + +// Converts a number to Q4.12 fixed-point format +#define Q_4_12(n) ((q4_12_t)((n) * 4096)) +#define UQ_4_12(n) ((uq4_12_t)((n) * 4096)) + +// Converts a number to Q24.8 fixed-point format +#define Q_24_8(n) ((s32)((n) << 8)) + +// Converts a Q8.8 fixed-point format number to a regular integer +#define Q_8_8_TO_INT(n) ((s32)((n) / 256)) + +// Converts a Q4.12 fixed-point format number to a regular integer +#define Q_4_12_TO_INT(n) ((s32)((n) / 4096)) +#define UQ_4_12_TO_INT(n) ((u32)((n) / 4096)) + +// Converts a Q24.8 fixed-point format number to a regular integer +#define Q_24_8_TO_INT(n) ((s32)((n) >> 8)) + +// Rounding value for Q4.12 fixed-point format +#define Q_4_12_ROUND ((1) << (Q_4_12_SHIFT - 1)) +#define UQ_4_12_ROUND ((1) << (UQ_4_12_SHIFT - 1)) + +// Basic arithmetic for fixed point number formats +// Consumers should use encapsulated functions where possible + +// FP API does not provide sanity checks against overflows + +static inline uq4_12_t uq4_12_add(uq4_12_t a, uq4_12_t b) +{ + return a + b; +} + +static inline uq4_12_t uq4_12_subtract(uq4_12_t a, uq4_12_t b) +{ + return a - b; +} + +static inline uq4_12_t uq4_12_multiply(uq4_12_t a, uq4_12_t b) +{ + u32 product = (u32) a * b; + return (product + UQ_4_12_ROUND) >> UQ_4_12_SHIFT; +} + +static inline uq4_12_t uq4_12_multiply_half_down(uq4_12_t a, uq4_12_t b) +{ + u32 product = (u32) a * b; + return (product + UQ_4_12_ROUND - 1) >> UQ_4_12_SHIFT; +} + +static inline uq4_12_t uq4_12_divide(uq4_12_t dividend, uq4_12_t divisor) +{ + if (divisor == UQ_4_12(0.0)) return UQ_4_12(0); + return (dividend << UQ_4_12_SHIFT) / divisor; +} + +// Multiplies value by the UQ_4_12 number modifier. +// Returns an integer, rounded to nearest (rounding down on n.5) +static inline u32 uq4_12_multiply_by_int_half_down(uq4_12_t modifier, u32 value) +{ + return UQ_4_12_TO_INT((modifier * value) + UQ_4_12_ROUND - 1); +} + +// Multiplies value by the UQ_4_12 number modifier. +// Returns an integer, rounded to nearest (rounding up on n.5) +static inline u32 uq4_12_multiply_by_int_half_up(uq4_12_t modifier, u32 value) +{ + return UQ_4_12_TO_INT((modifier * value) + UQ_4_12_ROUND); +} + +#endif // FPMATH_H_ diff --git a/include/global.h b/include/global.h index 50bff8386..1cf8e22a2 100644 --- a/include/global.h +++ b/include/global.h @@ -4,6 +4,8 @@ #include "config.h" #include "gba/gba.h" #include +#include "fpmath.h" +#include "metaprogram.h" #include "constants/global.h" #include "constants/flags.h" #include "constants/vars.h" @@ -51,13 +53,13 @@ #define Q_8_8(n) ((s16)((n) * 256)) // Converts a number from Q8.8 fixed-point format -#define Q_8_8_TO_INT(n) ((s16)((n) >> 8)) +// #define Q_8_8_TO_INT(n) ((s16)((n) >> 8)) // Converts a number to Q4.12 fixed-point format -#define Q_4_12(n) ((s16)((n) * 4096)) +// #define Q_4_12(n) ((s16)((n) * 4096)) // Converts a number from Q4.12 fixed-point format -#define Q_4_12_TO_INT(n) ((s16)((n) >> 12)) +// #define Q_4_12_TO_INT(n) ((s16)((n) >> 12)) // Converts a number to QN.S fixed-point format (16-bits) #define Q_N_S(s, n) ((s16)((n) * (1 << (s)))) @@ -86,6 +88,12 @@ #define SAFE_DIV(a, b) ((a) / (b)) #endif +// The below macro does a%n, but (to match) will switch to a&(n-1) if n is a power of 2. +// There are cases where GF does a&(n-1) where we would really like to have a%n, because +// if n is changed to a value that isn't a power of 2 then a&(n-1) is unlikely to work as +// intended, and a%n for powers of 2 isn't always optimized to use &. +#define MOD(a, n)(((n) & ((n)-1)) ? ((a) % (n)) : ((a) & ((n)-1))) + // Extracts the upper 16 bits of a 32-bit number #define HIHALF(n) (((n) & 0xFFFF0000) >> 16) @@ -132,25 +140,27 @@ extern u8 gStringVar4[]; #define NUM_ADDITIONAL_PHRASE_BYTES ROUND_BITS_TO_BYTES(NUM_ADDITIONAL_PHRASES) // Calls m0/m1/.../m8 depending on how many arguments are passed. -#define VARARG_8(m, ...) CAT(m, NARG_8(__VA_ARGS__))(__VA_ARGS__) +// #define VARARG_8(m, ...) CAT(m, NARG_8(__VA_ARGS__))(__VA_ARGS__) // This returns the number of arguments passed to it (up to 8). -#define NARG_8(...) NARG_8_(_, ##__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#define NARG_8_(_, a, b, c, d, e, f, g, h, N, ...) N +// #define NARG_8(...) NARG_8_(_, ##__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0) +// #define NARG_8_(_, a, b, c, d, e, f, g, h, N, ...) N -#define CAT(a, b) CAT_(a, b) -#define CAT_(a, b) a ## b +// #define CAT(a, b) CAT_(a, b) +// #define CAT_(a, b) a ## b -#define STR(a) STR_(a) -#define STR_(a) #a +// #define STR(a) STR_(a) +// #define STR_(a) #a // Converts a string to a compound literal, essentially making it a pointer to const u8 -#define COMPOUND_STRING(str) (const u8[]) _(str) +// #define COMPOUND_STRING(str) (const u8[]) _(str) // This produces an error at compile-time if expr is zero. // It looks like file.c:line: size of array `id' is negative #define STATIC_ASSERT(expr, id) typedef char id[(expr) ? 1 : -1]; +#define FEATURE_FLAG_ASSERT(flag, id) STATIC_ASSERT(flag > TEMP_FLAGS_END || flag == 0, id) + struct Coords8 { s8 x; diff --git a/include/item.h b/include/item.h index 05430f4b5..6f5da26bc 100644 --- a/include/item.h +++ b/include/item.h @@ -70,6 +70,7 @@ u8 ItemId_GetType(u16 itemId); ItemUseFunc ItemId_GetFieldFunc(u16 itemId); u8 ItemId_GetBattleUsage(u16 itemId); u8 ItemId_GetSecondaryId(u16 itemId); +u32 ItemId_GetFlingPower(u32 itemId); u16 ItemId_GetPrice(u16 itemId); void ClearBag(void); void ClearPCItemSlots(void); diff --git a/include/metaprogram.h b/include/metaprogram.h new file mode 100644 index 000000000..4bcc306b6 --- /dev/null +++ b/include/metaprogram.h @@ -0,0 +1,143 @@ +/* Macros to aid with metaprogramming. */ +#ifndef METAPROGRAM_H +#define METAPROGRAM_H + +/* Check if VA_OPT_ is supported by the compiler. GCC's version should be at least 9.5*/ +#define PP_THIRD_ARG(a,b,c,...) c +#define VA_OPT_SUPPORTED_I(...) PP_THIRD_ARG(__VA_OPT__(,),TRUE,FALSE,) +#define VA_OPT_SUPPORTED VA_OPT_SUPPORTED_I(?) + +#if !VA_OPT_SUPPORTED +#error ERROR: VA_OPT__ is not supported. Please update your gcc compiler to version 10 or higher +#endif // VA_OPT_SUPPORTED + +/* Calls m0/m1/.../m8 depending on how many arguments are passed. */ +#define VARARG_8(m, ...) CAT(m, NARG_8(__VA_ARGS__))(__VA_ARGS__) + +/* Returns the number of arguments passed to it (up to 8). */ +#define NARG_8(...) NARG_8_(_, ##__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#define NARG_8_(_, a, b, c, d, e, f, g, h, N, ...) N + +/* Expands 'a' and 'b' and then concatenates them. */ +#define CAT(a, b) CAT_(a, b) +#define CAT_(a, b) a ## b + +/* Expands '__VA_ARGS__' and then stringizes them. */ +#define STR(...) STR_(__VA_ARGS__) +#define STR_(...) #__VA_ARGS__ + +/* Converts a string to a compound literal, essentially making it a pointer to const u8 */ +#define COMPOUND_STRING(str) (const u8[]) _(str) + +/* Expands to the first/second/third/fourth argument. */ +#define FIRST(a, ...) a +#define SECOND(a, ...) __VA_OPT__(FIRST(__VA_ARGS__)) +#define THIRD(a, ...) __VA_OPT__(SECOND(__VA_ARGS__)) +#define FOURTH(a, ...) __VA_OPT__(THIRD(__VA_ARGS__)) + +/* Expands to everything but the first x arguments */ +#define EXCEPT_1(a, ...) __VA_OPT__(__VA_ARGS__) +#define EXCEPT_2(a, ...) __VA_OPT__(EXCEPT_1(__VA_ARGS__)) +#define EXCEPT_3(a, ...) __VA_OPT__(EXCEPT_2(__VA_ARGS__)) +#define EXCEPT_4(a, ...) __VA_OPT__(EXCEPT_3(__VA_ARGS__)) + +/* 'UNPACK (x, y, z)' expands to 'x, y, z'. + * Useful for passing arguments which may contain commas into a macro. */ +#define UNPACK(...) __VA_ARGS__ + +/* Expands to 'macro(...args, ...)'. */ +#define INVOKE_WITH(macro, args, ...) INVOKE_WITH_(macro, UNPACK args __VA_OPT__(, __VA_ARGS__)) +#define INVOKE_WITH_(macro, ...) macro(__VA_ARGS__) + +/* Recursive macros. + * Based on https://www.scs.stanford.edu/~dm/blog/va-opt.html + * + * Macros prefixed with R_ are recursive, to correctly expand them the + * top-level macro which references them should use 'RECURSIVELY' around + * them. 'RECURSIVELY' cannot be nested, hence the top-level macro must + * use it so that a recursive macro is able to reference another + * recursive macro. */ + +#define RECURSIVELY(...) RECURSIVELY_4(RECURSIVELY_4(RECURSIVELY_4(RECURSIVELY_4(__VA_ARGS__)))) +#define RECURSIVELY_4(...) RECURSIVELY_3(RECURSIVELY_3(RECURSIVELY_3(RECURSIVELY_3(__VA_ARGS__)))) +#define RECURSIVELY_3(...) RECURSIVELY_2(RECURSIVELY_2(RECURSIVELY_2(RECURSIVELY_2(__VA_ARGS__)))) +#define RECURSIVELY_2(...) RECURSIVELY_1(RECURSIVELY_1(RECURSIVELY_1(RECURSIVELY_1(__VA_ARGS__)))) +#define RECURSIVELY_1(...) __VA_ARGS__ + +/* Useful for deferring expansion until the second scan. See + * https://www.scs.stanford.edu/~dm/blog/va-opt.html for more info. */ +#define PARENS () + +/* Expands to 'macro(a)' for each 'a' in '...' */ +#define R_FOR_EACH(macro, ...) __VA_OPT__(R_FOR_EACH_(macro, __VA_ARGS__)) +#define R_FOR_EACH_(macro, a, ...) macro(a) __VA_OPT__(R_FOR_EACH_P PARENS (macro, __VA_ARGS__)) +#define R_FOR_EACH_P() R_FOR_EACH_ + +/* Expands to 'macro(...args, a)' for each 'a' in '...'. */ +#define R_FOR_EACH_WITH(macro, args, ...) __VA_OPT__(R_FOR_EACH_WITH_(macro, args, __VA_ARGS__)) +#define R_FOR_EACH_WITH_(macro, args, a, ...) INVOKE_WITH(macro, args, a) __VA_OPT__(R_FOR_EACH_WITH_P PARENS (macro, args, __VA_ARGS__)) +#define R_FOR_EACH_WITH_P() R_FOR_EACH_WITH_ + +/* Picks the xth VA_ARG if it exists, otherwise returns a default value */ +#define DEFAULT(_default, ...) FIRST(__VA_OPT__(__VA_ARGS__, ) _default) +#define DEFAULT_2(_default, ...) DEFAULT(_default __VA_OPT__(, SECOND(__VA_ARGS__))) +#define DEFAULT_3(_default, ...) DEFAULT(_default __VA_OPT__(, THIRD(__VA_ARGS__))) +#define DEFAULT_4(_default, ...) DEFAULT(_default __VA_OPT__(, FOURTH(__VA_ARGS__))) + +/* (Credit to MGriffin) A rather monstrous way of finding the set bit in a word. +Invalid input causes a compiler error. Sample: https://cexplore.karathan.at/z/x1hm7B */ +#define BIT_INDEX(n) \ + (n) == (1 << 0) ? 0 : \ + (n) == (1 << 1) ? 1 : \ + (n) == (1 << 2) ? 2 : \ + (n) == (1 << 3) ? 3 : \ + (n) == (1 << 4) ? 4 : \ + (n) == (1 << 5) ? 5 : \ + (n) == (1 << 6) ? 6 : \ + (n) == (1 << 7) ? 7 : \ + (n) == (1 << 8) ? 8 : \ + (n) == (1 << 9) ? 9 : \ + (n) == (1 << 10) ? 10 : \ + (n) == (1 << 11) ? 11 : \ + (n) == (1 << 12) ? 12 : \ + (n) == (1 << 13) ? 13 : \ + (n) == (1 << 14) ? 14 : \ + (n) == (1 << 15) ? 15 : \ + (n) == (1 << 16) ? 16 : \ + (n) == (1 << 17) ? 17 : \ + (n) == (1 << 18) ? 18 : \ + (n) == (1 << 19) ? 19 : \ + (n) == (1 << 20) ? 20 : \ + (n) == (1 << 21) ? 21 : \ + (n) == (1 << 22) ? 22 : \ + (n) == (1 << 23) ? 23 : \ + (n) == (1 << 24) ? 24 : \ + (n) == (1 << 25) ? 25 : \ + (n) == (1 << 26) ? 26 : \ + (n) == (1 << 27) ? 27 : \ + (n) == (1 << 28) ? 28 : \ + (n) == (1 << 29) ? 29 : \ + (n) == (1 << 30) ? 30 : \ + (n) == (1 << 31) ? 31 : \ + *(u32 *)NULL + +#define COMPRESS_BITS_0 0, 1 +#define COMPRESS_BITS_1 1, 1 +#define COMPRESS_BITS_2 2, 1 +#define COMPRESS_BITS_3 3, 1 +#define COMPRESS_BITS_4 4, 1 +#define COMPRESS_BITS_5 5, 1 +#define COMPRESS_BITS_6 6, 1 +#define COMPRESS_BITS_7 7, 1 + +/* Will try and compress a set bit (or up to three sequential bits) into a single byte +Input must be of the form (upper << lower) where upper can be up to 3, lower up to 31 */ +#define COMPRESS_BITS(_val) COMPRESS_BITS_STEP_2 _val +#define COMPRESS_BITS_STEP_2(_unpacked) COMPRESS_BITS_STEP_3(COMPRESS_BITS_## _unpacked) +#define COMPRESS_BITS_STEP_3(...) COMPRESS_BITS_STEP_4(__VA_ARGS__) +#define COMPRESS_BITS_STEP_4(upper, lower) (((upper % 8) << 5) + (BIT_INDEX(lower))) + +/* Will read a compressed bit stored by COMPRESS_BIT into a single byte */ +#define UNCOMPRESS_BITS(compressed) ((compressed >> 5) << (compressed & 0x1F)) + +#endif diff --git a/include/party_menu.h b/include/party_menu.h index fbc9d7236..08dce7efd 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -60,8 +60,8 @@ void ItemUseCB_ResetEVs(u8 taskId, TaskFunc task); void ItemUseCB_PPRecovery(u8 taskId, TaskFunc func); void ItemUseCB_PPUp(u8 taskId, TaskFunc func); u16 ItemIdToBattleMoveId(u16 item); -bool8 IsMoveHm(u16 move); bool8 MonKnowsMove(struct Pokemon *mon, u16 move); +bool8 BoxMonKnowsMove(struct BoxPokemon *boxMon, u16 move); void ItemUseCB_TMHM(u8 taskId, TaskFunc func); void ItemUseCB_RareCandy(u8 taskId, TaskFunc func); void ItemUseCB_SacredAsh(u8 taskId, TaskFunc func); diff --git a/include/pokemon.h b/include/pokemon.h index ac6dbfba1..428243465 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -3,10 +3,11 @@ #include "global.h" #include "sprite.h" -#include "constants/pokemon.h" #include "constants/items.h" +#include "constants/region_map_sections.h" +#include "constants/pokemon.h" - +#define GET_BASE_SPECIES_ID(speciesId) (GetFormSpeciesId(speciesId, 0)) #define FORM_SPECIES_END (0xffff) @@ -321,27 +322,28 @@ struct BattlePokemon /*0x15*/ u32 speedIV:5; /*0x16*/ u32 spAttackIV:5; /*0x17*/ u32 spDefenseIV:5; - /*0x17*/ u32 isEgg:1; /*0x17*/ u32 abilityNum:2; /*0x18*/ s8 statStages[NUM_BATTLE_STATS]; /*0x20*/ u16 ability; - /*0x21*/ u8 type1; - /*0x22*/ u8 type2; - /*0x23*/ u8 unknown; - /*0x24*/ u8 pp[MAX_MON_MOVES]; - /*0x28*/ u16 hp; - /*0x2A*/ u8 level; - /*0x2B*/ u8 friendship; - /*0x2C*/ u16 maxHP; - /*0x2E*/ u16 item; - /*0x30*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; - /*0x3B*/ u8 ppBonuses; - /*0x3C*/ u8 otName[PLAYER_NAME_LENGTH + 1]; - /*0x44*/ u32 experience; - /*0x48*/ u32 personality; - /*0x4C*/ u32 status1; - /*0x50*/ u32 status2; - /*0x54*/ u32 otId; + /*0x22*/ u8 type1; + /*0x23*/ u8 type2; + /*0x24*/ u8 type3; + /*0x25*/ u8 pp[MAX_MON_MOVES]; + /*0x29*/ u16 hp; + /*0x2B*/ u8 level; + /*0x2C*/ u8 friendship; + /*0x2D*/ u16 maxHP; + /*0x2F*/ u16 item; + /*0x31*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; + /*0x3C*/ u8 ppBonuses; + /*0x3D*/ u8 otName[PLAYER_NAME_LENGTH + 1]; + /*0x45*/ u32 experience; + /*0x49*/ u32 personality; + /*0x4D*/ u32 status1; + /*0x51*/ u32 status2; + /*0x55*/ u32 otId; + /*0x59*/ u8 metLevel; + /*0x5A*/ bool8 isShiny; }; struct SpeciesInfo /*0x8C*/ @@ -384,9 +386,9 @@ struct SpeciesInfo /*0x8C*/ /* 0x38 */ u16 trainerScale; /* 0x3A */ u16 trainerOffset; /* 0x3C */ const u8 *description; - /* 0x40 */ u8 bodyColor : 7; + /* 0x40 */ u8 bodyColor:7; // Graphical Data - u8 noFlip : 1; + u8 noFlip:1; /* 0x41 */ u8 frontAnimDelay; /* 0x42 */ u8 frontAnimId; /* 0x43 */ u8 backAnimId; @@ -401,7 +403,9 @@ struct SpeciesInfo /*0x8C*/ /* 0x64 */ const u32 *shinyPaletteFemale; /* 0x68 */ const u8 *iconSprite; /* 0x6C */ const u8 *iconSpriteFemale; +// #if P_FOOTPRINTS /* 0x70 */ const u8 *footprint; +// #endif // All Pokémon pics are 64x64, but this data table defines where in this 64x64 frame the sprite's non-transparent pixels actually are. /* 0x74 */ u8 frontPicSize; // The dimensions of this drawn pixel area. /* 0x74 */ u8 frontPicSizeFemale; // The dimensions of this drawn pixel area. @@ -417,6 +421,7 @@ struct SpeciesInfo /*0x8C*/ /* 0x7A */ u32 isLegendary:1; u32 isMythical:1; u32 isUltraBeast:1; + u32 isTotem:1; u32 isParadoxForm:1; u32 isMegaEvolution:1; u32 isPrimalReversion:1; @@ -429,7 +434,8 @@ struct SpeciesInfo /*0x8C*/ u32 cannotBeTraded:1; u32 allPerfectIVs:1; u32 dexForceRequired:1; // This species will be taken into account for Pokédex ratings even if they have the "isMythical" flag set. - u32 padding4:17; + u32 tmIlliterate:1; // This species will be unable to learn the universal moves. + u32 padding4:15; // Move Data /* 0x80 */ const struct LevelUpMove *levelUpLearnset; /* 0x84 */ const u16 *teachableLearnset; @@ -585,6 +591,17 @@ struct FormChange u16 param3; }; +struct Fusion +{ + u16 fusionStorageIndex; + u16 itemId; + u16 targetSpecies1; + u16 targetSpecies2; + u16 fusingIntoMon; + u16 fusionMove; + u16 unfuseForgetMove; +}; + // struct __attribute__((packed)) LevelUpMove // { // u16 move:9; @@ -610,7 +627,7 @@ struct Evolution #define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality)) extern const struct MoveInfo gMovesInfo[]; -extern const struct BattleMove gBattleMoves[]; +// extern const struct BattleMove gBattleMoves[]; extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[PARTY_SIZE]; extern u8 gEnemyPartyCount; @@ -651,13 +668,9 @@ void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot); void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot); u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove); void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move); -s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef); - -#define BATTLE_ALIVE_EXCEPT_ACTIVE 0 -#define BATTLE_ALIVE_ATK_SIDE 1 -#define BATTLE_ALIVE_DEF_SIDE 2 - -u8 CountAliveMonsInBattle(u8 caseId); +s32 CalculateBaseDamageOld(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u32 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef); +u32 GetMonAffectionHearts(struct Pokemon *pokemon); +u8 CountAliveMonsInBattle(u8 caseId, u32 battler); u8 GetDefaultMoveTarget(u8 battlerId); u8 GetMonGender(struct Pokemon *mon); @@ -698,7 +711,7 @@ u8 GiveMonToPlayer(struct Pokemon *mon); u8 CalculatePlayerPartyCount(void); u8 CalculateEnemyPartyCount(void); u8 GetMonsStateToDoubles(void); -u16 GetAbilityBySpecies(u16 species, bool8 abilityNum); +u16 GetAbilityBySpecies(u16 species, u8 abilityNum); u16 GetMonAbility(struct Pokemon *mon); u8 GetSecretBaseTrainerPicIndex(void); u8 GetSecretBaseTrainerNameIndex(void); @@ -754,7 +767,7 @@ const u32 *GetMonFrontSpritePal(struct Pokemon *mon); const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality); const u32 *GetMonSpritePalStruct(struct Pokemon *mon); const u32 *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality); -bool32 IsHMMove2(u16 move); +bool32 IsMoveHM(u16 move); bool8 IsMonSpriteNotFlipped(u16 species); s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor); bool8 IsTradedMon(struct Pokemon *mon); @@ -777,6 +790,14 @@ bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 bank); struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 battlePosition, u8 mode); void DestroyMonSpritesGfxManager(void); u8 *MonSpritesGfxManager_GetSpritePtr(u8 bufferId); +u16 GetFormSpeciesId(u16 speciesId, u8 formId); +u8 GetFormIdFromFormSpeciesId(u16 formSpeciesId); +u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg); +u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg); +bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method); +void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method); +bool8 IsMonPastEvolutionLevel(struct Pokemon *mon); +bool32 IsPersonalityFemale(u16 species, u32 personality); bool8 HealStatusConditions(struct Pokemon *mon, u32 healMask, u8 battleId); diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index 5d7e96c0f..5dcf7cd71 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -8,7 +8,7 @@ extern const struct SpritePalette gMonIconPaletteTable[]; extern const u16 gMonIconPalettes[][16]; // extern const u8 gMonIconPaletteIndices[]; -const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo); +const u8 *GetMonIconPtr(u16 speciesId, u32 personality); const u8 *GetMonIconTiles(u16 iconSpecies, bool32 extra); const u16 *GetValidMonIconPalettePtr(u16 speciesId); void LoadMonIconPalettes(void); diff --git a/include/random.h b/include/random.h index fd6b88ad0..df6b67ff8 100644 --- a/include/random.h +++ b/include/random.h @@ -3,24 +3,258 @@ #include "global.h" -extern u32 gRngValue; -extern u32 gRng2Value; +// extern u32 gRngValue; +// extern u32 gRng2Value; + +// //Returns a 16-bit pseudorandom number +// u16 Random(void); +// u16 Random2(void); + +// //Returns a 32-bit pseudorandom number +// #define Random32() (Random() | (Random() << 16)) + +// // The number 1103515245 comes from the example implementation of rand and srand +// // in the ISO C standard. +#define RAND_MULT 1103515245 +// #define ISO_RANDOMIZE1(val)(RAND_MULT * (val) + 24691) +// #define ISO_RANDOMIZE2(val)(RAND_MULT * (val) + 12345) + +// //Sets the initial seed value of the pseudorandom number generator +// void SeedRng(u16 seed); +// void SeedRng2(u16 seed); + + +// The number 1103515245 comes from the example implementation of rand and srand +// in the ISO C standard. +#define ISO_RANDOMIZE1(val)(RAND_MULT * (val) + 24691) +#define ISO_RANDOMIZE2(val)(RAND_MULT * (val) + 12345) + +/* Some functions have been added to support HQ_RANDOM. +* +* If using HQ_RANDOM, you cannot call Random() in interrupt handlers safely. +* AdvanceRandom() is provided to handle burning numbers in the VBlank handler +* if you choose to do that, and can be used regardless of HQ_RANDOM setting. +* If you need to use random numbers in the VBlank handler, a local state +* should be used instead. +* +* LocalRandom(*val) allows you to have local random states that are the same +* type as the global states regardless of HQ_RANDOM setting, which is useful +* if you want to be able to set them from or assign them to gRngValue. +* LocalRandomSeed(u32) returns a properly seeded rng_value_t. +* +* Random2_32() was added to HQ_RANDOM because the output of the generator is +* always 32 bits and Random()/Random2() are just wrappers in that mode. It is +* also available in non-HQ mode for consistency. +*/ + +#if HQ_RANDOM == TRUE +struct Sfc32State { + u32 a; + u32 b; + u32 c; + u32 ctr; +}; + +typedef struct Sfc32State rng_value_t; + +#define RNG_VALUE_EMPTY {} + +// Calling this function directly is discouraged. +// Use LocalRandom() instead. +static inline u32 _SFC32_Next(struct Sfc32State *state) +{ + const u32 result = state->a + state->b + state->ctr++; + state->a = state->b ^ (state->b >> 9); + state->b = state->c * 9; + state->c = result + ((state->c << 21) | (state->c >> 11)); + return result; +} + +static inline u16 LocalRandom(rng_value_t *val) +{ + return _SFC32_Next(val) >> 16; +} + +u32 Random32(void); +u32 Random2_32(void); + +static inline u16 Random(void) +{ + return Random32() >> 16; +} + +void SeedRng(u32 seed); +void SeedRng2(u32 seed); +rng_value_t LocalRandomSeed(u32 seed); + +static inline u16 Random2(void) +{ + return Random2_32() >> 16; +} + +void AdvanceRandom(void); +#else +typedef u32 rng_value_t; + +#define RNG_VALUE_EMPTY 0 //Returns a 16-bit pseudorandom number u16 Random(void); u16 Random2(void); -//Returns a 32-bit pseudorandom number -#define Random32() (Random() | (Random() << 16)) - -// The number 1103515245 comes from the example implementation of rand and srand -// in the ISO C standard. -#define RAND_MULT 1103515245 -#define ISO_RANDOMIZE1(val)(RAND_MULT * (val) + 24691) -#define ISO_RANDOMIZE2(val)(RAND_MULT * (val) + 12345) - //Sets the initial seed value of the pseudorandom number generator void SeedRng(u16 seed); void SeedRng2(u16 seed); +//Returns a 32-bit pseudorandom number +#define Random32() (Random() | (Random() << 16)) +#define Random2_32() (Random2() | (Random2() << 16)) + +static inline u16 LocalRandom(rng_value_t *val) +{ + *val = ISO_RANDOMIZE1(*val); + return *val >> 16; +} + +static inline void AdvanceRandom(void) +{ + Random(); +} + +static inline rng_value_t LocalRandomSeed(u32 seed) +{ + return seed; +} + +#endif + +extern rng_value_t gRngValue; +extern rng_value_t gRng2Value; + +void Shuffle8(void *data, size_t n); +void Shuffle16(void *data, size_t n); +void Shuffle32(void *data, size_t n); +void ShuffleN(void *data, size_t n, size_t size); + +static inline void Shuffle(void *data, size_t n, size_t size) +{ + switch (size) + { + case 1: Shuffle8(data, n); break; + case 2: Shuffle16(data, n); break; + case 4: Shuffle32(data, n); break; + default: ShuffleN(data, n, size); break; + } +} + +/* Structured random number generator. + * Instead of the caller converting bits from Random() to a meaningful + * value, the caller provides metadata that is used to return the + * meaningful value directly. This allows code to interpret the random + * call, for example, battle tests know what the domain of a random call + * is, and can exhaustively test it. + * + * RandomTag identifies the purpose of the value. + * + * RandomUniform(tag, lo, hi) returns a number from lo to hi inclusive + * with uniform probability. + * + * RandomUniformExcept(tag, lo, hi, reject) returns a number from lo to + * hi inclusive with uniform probability, excluding those for which + * reject returns TRUE. + * + * RandomElement(tag, array) returns an element in array with uniform + * probability. The array must be known at compile-time (e.g. a global + * const array). + * + * RandomPercentage(tag, t) returns FALSE with probability (1-t)/100, + * and TRUE with probability t/100. + * + * RandomWeighted(tag, w0, w1, ... wN) returns a number from 0 to N + * inclusive. The return value is proportional to the weights, e.g. + * RandomWeighted(..., 1, 1) returns 50% 0s and 50% 1s. + * RandomWeighted(..., 2, 1) returns 2/3 0s and 1/3 1s. */ + +enum RandomTag +{ + RNG_NONE, + RNG_ACCURACY, + RNG_CONFUSION, + RNG_CRITICAL_HIT, + RNG_CUTE_CHARM, + RNG_DAMAGE_MODIFIER, + RNG_DIRE_CLAW, + RNG_FLAME_BODY, + RNG_FORCE_RANDOM_SWITCH, + RNG_FROZEN, + RNG_G_MAX_STUN_SHOCK, + RNG_G_MAX_BEFUDDLE, + RNG_G_MAX_REPLENISH, + RNG_G_MAX_SNOOZE, + RNG_HITS, + RNG_HOLD_EFFECT_FLINCH, + RNG_INFATUATION, + RNG_LOADED_DICE, + RNG_METRONOME, + RNG_PARALYSIS, + RNG_POISON_POINT, + RNG_RAMPAGE_TURNS, + RNG_SECONDARY_EFFECT, + RNG_SECONDARY_EFFECT_2, + RNG_SECONDARY_EFFECT_3, + RNG_SLEEP_TURNS, + RNG_SPEED_TIE, + RNG_STATIC, + RNG_STENCH, + RNG_TRI_ATTACK, + RNG_QUICK_DRAW, + RNG_QUICK_CLAW, + RNG_TRACE, + RNG_FICKLE_BEAM, +}; + +#define RandomWeighted(tag, ...) \ + ({ \ + const u8 weights[] = { __VA_ARGS__ }; \ + u32 sum, i; \ + for (i = 0, sum = 0; i < ARRAY_COUNT(weights); i++) \ + sum += weights[i]; \ + RandomWeightedArray(tag, sum, ARRAY_COUNT(weights), weights); \ + }) + +#define RandomPercentage(tag, t) \ + ({ \ + u32 r; \ + if (t <= 0) \ + { \ + r = FALSE; \ + } \ + else if (t >= 100) \ + { \ + r = TRUE; \ + } \ + else \ + { \ + const u8 weights[] = { 100 - t, t }; \ + r = RandomWeightedArray(tag, 100, ARRAY_COUNT(weights), weights); \ + } \ + r; \ + }) + +#define RandomElement(tag, array) \ + ({ \ + *(typeof((array)[0]) *)RandomElementArray(tag, array, sizeof((array)[0]), ARRAY_COUNT(array)); \ + }) + +u32 RandomUniform(enum RandomTag, u32 lo, u32 hi); +u32 RandomUniformExcept(enum RandomTag, u32 lo, u32 hi, bool32 (*reject)(u32)); +u32 RandomWeightedArray(enum RandomTag, u32 sum, u32 n, const u8 *weights); +const void *RandomElementArray(enum RandomTag, const void *array, size_t size, size_t count); + +u32 RandomUniformDefault(enum RandomTag, u32 lo, u32 hi); +u32 RandomUniformExceptDefault(enum RandomTag, u32 lo, u32 hi, bool32 (*reject)(u32)); +u32 RandomWeightedArrayDefault(enum RandomTag, u32 sum, u32 n, const u8 *weights); +const void *RandomElementArrayDefault(enum RandomTag, const void *array, size_t size, size_t count); + + #endif // GUARD_RANDOM_H diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index ff438aba6..bfa8df2f6 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -282,10 +282,8 @@ static const u16 sDiscouragedPowerfulMoveEffects[] = { EFFECT_EXPLOSION, EFFECT_DREAM_EATER, - EFFECT_RAZOR_WIND, - EFFECT_SKY_ATTACK, + EFFECT_TWO_TURNS_ATTACK, EFFECT_RECHARGE, - EFFECT_SKULL_BASH, EFFECT_SOLAR_BEAM, EFFECT_SPIT_UP, EFFECT_FOCUS_PUNCH, @@ -514,16 +512,18 @@ static void ClearBattlerMoveHistory(u8 battlerId) BATTLE_HISTORY->usedMoves[battlerId / 2][i] = MOVE_NONE; } -void RecordAbilityBattle(u8 battlerId, u16 abilityId) +void RecordAbilityBattle(u32 battlerId, u32 abilityId) { - if (GetBattlerSide(battlerId) == 0) - BATTLE_HISTORY->abilities[GET_BATTLER_SIDE(battlerId)] = abilityId; + BATTLE_HISTORY->abilities[battlerId] = abilityId; + // TODO: AI + // AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].ability = abilityId; } -void RecordItemEffectBattle(u8 battlerId, u8 itemEffect) +void RecordItemEffectBattle(u32 battlerId, u32 itemEffect) { - if (GetBattlerSide(battlerId) == 0) - BATTLE_HISTORY->itemEffects[GET_BATTLER_SIDE(battlerId)] = itemEffect; + BATTLE_HISTORY->itemEffects[battlerId] = itemEffect; + // TODO: AI + // AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].heldEffect = itemEffect; } static void Cmd_if_random_less_than(void) @@ -948,7 +948,7 @@ static void Cmd_if_user_has_attacking_move(void) for (i = 0; i < MAX_MON_MOVES; i++) { if (gBattleMons[gBattlerAttacker].moves[i] != 0 - && gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].power != 0) + && gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].power != 0) break; } @@ -965,7 +965,7 @@ static void Cmd_if_user_has_no_attacking_moves(void) for (i = 0; i < MAX_MON_MOVES; i++) { if (gBattleMons[gBattlerAttacker].moves[i] != 0 - && gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].power != 0) + && gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].power != 0) break; } @@ -998,7 +998,7 @@ static void Cmd_get_type(void) AI_THINKING_STRUCT->funcResult = gBattleMons[gBattlerTarget].type2; break; case AI_TYPE_MOVE: - AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].type; + AI_THINKING_STRUCT->funcResult = gMovesInfo[AI_THINKING_STRUCT->moveConsidered].type; break; } sAIScriptPtr += 2; @@ -1006,7 +1006,7 @@ static void Cmd_get_type(void) static void Cmd_get_considered_move_power(void) { - AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power; + AI_THINKING_STRUCT->funcResult = gMovesInfo[AI_THINKING_STRUCT->moveConsidered].power; sAIScriptPtr += 1; } @@ -1017,11 +1017,11 @@ static void Cmd_get_how_powerful_move_is(void) for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++) { - if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == sDiscouragedPowerfulMoveEffects[i]) + if (gMovesInfo[AI_THINKING_STRUCT->moveConsidered].effect == sDiscouragedPowerfulMoveEffects[i]) break; } - if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power > 1 + if (gMovesInfo[AI_THINKING_STRUCT->moveConsidered].power > 1 && sDiscouragedPowerfulMoveEffects[i] == 0xFFFF) { gDynamicBasePower = 0; @@ -1034,13 +1034,13 @@ static void Cmd_get_how_powerful_move_is(void) { for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++) { - if (gBattleMoves[gBattleMons[gBattlerAttacker].moves[checkedMove]].effect == sDiscouragedPowerfulMoveEffects[i]) + if (gMovesInfo[gBattleMons[gBattlerAttacker].moves[checkedMove]].effect == sDiscouragedPowerfulMoveEffects[i]) break; } if (gBattleMons[gBattlerAttacker].moves[checkedMove] != MOVE_NONE && sDiscouragedPowerfulMoveEffects[i] == 0xFFFF - && gBattleMoves[gBattleMons[gBattlerAttacker].moves[checkedMove]].power > 1) + && gMovesInfo[gBattleMons[gBattlerAttacker].moves[checkedMove]].power > 1) { gCurrentMove = gBattleMons[gBattlerAttacker].moves[checkedMove]; AI_CalcDmg(gBattlerAttacker, gBattlerTarget); @@ -1178,7 +1178,7 @@ static void Cmd_get_considered_move(void) static void Cmd_get_considered_move_effect(void) { - AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect; + AI_THINKING_STRUCT->funcResult = gMovesInfo[AI_THINKING_STRUCT->moveConsidered].effect; sAIScriptPtr += 1; } @@ -1446,7 +1446,7 @@ static void Cmd_get_weather(void) static void Cmd_if_effect(void) { CMD_ARGS(u16 byte, const u8 *ptr); - if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == cmd->byte) + if (gMovesInfo[AI_THINKING_STRUCT->moveConsidered].effect == cmd->byte) { sAIScriptPtr = cmd->ptr; } @@ -1459,7 +1459,7 @@ static void Cmd_if_effect(void) static void Cmd_if_not_effect(void) { CMD_ARGS(u16 byte, const u8 *ptr); - if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect != cmd->byte) + if (gMovesInfo[AI_THINKING_STRUCT->moveConsidered].effect != cmd->byte) { sAIScriptPtr = cmd->ptr; } @@ -1531,7 +1531,7 @@ static void Cmd_if_stat_level_not_equal(void) static void Cmd_if_can_faint(void) { - if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) + if (gMovesInfo[AI_THINKING_STRUCT->moveConsidered].power < 2) { sAIScriptPtr += 5; return; @@ -1560,7 +1560,7 @@ static void Cmd_if_can_faint(void) static void Cmd_if_cant_faint(void) { - if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) + if (gMovesInfo[AI_THINKING_STRUCT->moveConsidered].power < 2) { sAIScriptPtr += 5; return; @@ -1664,7 +1664,7 @@ static void Cmd_if_has_move_with_effect(void) case AI_USER_PARTNER: for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gBattlerAttacker].moves[i] != 0 && gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].effect == cmd->effect) + if (gBattleMons[gBattlerAttacker].moves[i] != 0 && gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].effect == cmd->effect) break; } if (i != MAX_MON_MOVES) @@ -1676,7 +1676,7 @@ static void Cmd_if_has_move_with_effect(void) case AI_TARGET_PARTNER: for (i = 0; i < 8; i++) { - if (gBattleMons[gBattlerAttacker].moves[i] != 0 && gBattleMoves[BATTLE_HISTORY->usedMoves[gBattlerTarget >> 1][i]].effect == cmd->effect) + if (gBattleMons[gBattlerAttacker].moves[i] != 0 && gMovesInfo[BATTLE_HISTORY->usedMoves[gBattlerTarget >> 1][i]].effect == cmd->effect) break; } sAIScriptPtr = cmd->ptr; @@ -1694,7 +1694,7 @@ static void Cmd_if_doesnt_have_move_with_effect(void) case AI_USER_PARTNER: for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gBattlerAttacker].moves[i] != 0 && gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].effect == cmd->effect) + if (gBattleMons[gBattlerAttacker].moves[i] != 0 && gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].effect == cmd->effect) break; } if (i != MAX_MON_MOVES) @@ -1706,7 +1706,7 @@ static void Cmd_if_doesnt_have_move_with_effect(void) case AI_TARGET_PARTNER: for (i = 0; i < 8; i++) { - if (BATTLE_HISTORY->usedMoves[gBattlerTarget >> 1][i] != 0 && gBattleMoves[BATTLE_HISTORY->usedMoves[gBattlerTarget >> 1][i]].effect == cmd->effect) + if (BATTLE_HISTORY->usedMoves[gBattlerTarget >> 1][i] != 0 && gMovesInfo[BATTLE_HISTORY->usedMoves[gBattlerTarget >> 1][i]].effect == cmd->effect) break; } sAIScriptPtr = cmd->nextInstr; @@ -1878,27 +1878,27 @@ static void Cmd_get_used_held_item(void) else battlerId = gBattlerTarget; - AI_THINKING_STRUCT->funcResult = ((u8 *)gBattleStruct->usedHeldItems)[battlerId * 2]; + AI_THINKING_STRUCT->funcResult = gBattleStruct->usedHeldItems[battlerId][GetBattlerSide(battlerId)]; sAIScriptPtr += 2; } static void Cmd_get_move_type_from_result(void) { - AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].type; + AI_THINKING_STRUCT->funcResult = gMovesInfo[AI_THINKING_STRUCT->funcResult].type; sAIScriptPtr += 1; } static void Cmd_get_move_power_from_result(void) { - AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].power; + AI_THINKING_STRUCT->funcResult = gMovesInfo[AI_THINKING_STRUCT->funcResult].power; sAIScriptPtr += 1; } static void Cmd_get_move_effect_from_result(void) { - AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].effect; + AI_THINKING_STRUCT->funcResult = gMovesInfo[AI_THINKING_STRUCT->funcResult].effect; sAIScriptPtr += 1; } diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 0fc72bbca..8c0c927e6 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -90,7 +90,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) || (gLastLandedMoves[gActiveBattler] == MOVE_NONE)) return FALSE; if (gLastLandedMoves[gActiveBattler] == 0xFFFF - || gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0) + || gMovesInfo[gLastLandedMoves[gActiveBattler]].power == 0) return FALSE; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { @@ -105,11 +105,11 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) battlerIn1 = gActiveBattler; battlerIn2 = gActiveBattler; } - if (gBattleMoves[gLastLandedMoves[gActiveBattler]].type == TYPE_FIRE) + if (gMovesInfo[gLastLandedMoves[gActiveBattler]].type == TYPE_FIRE) absorbingTypeAbility = ABILITY_FLASH_FIRE; - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].type == TYPE_WATER) + else if (gMovesInfo[gLastLandedMoves[gActiveBattler]].type == TYPE_WATER) absorbingTypeAbility = ABILITY_WATER_ABSORB; - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].type == TYPE_ELECTRIC) + else if (gMovesInfo[gLastLandedMoves[gActiveBattler]].type == TYPE_ELECTRIC) absorbingTypeAbility = ABILITY_VOLT_ABSORB; else return FALSE; @@ -156,7 +156,7 @@ static bool8 ShouldSwitchIfNaturalCure(void) BtlController_EmitTwoReturnValues(1, B_ACTION_SWITCH, 0); return TRUE; } - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 && Random() & 1) + else if (gMovesInfo[gLastLandedMoves[gActiveBattler]].power == 0 && Random() & 1) { *(gBattleStruct->AI_monToSwitchIntoId + (GetBattlerPosition(gActiveBattler) >> 1)) = PARTY_SIZE; BtlController_EmitTwoReturnValues(1, B_ACTION_SWITCH, 0); @@ -245,7 +245,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) return FALSE; if ((gLastLandedMoves[gActiveBattler] == 0xFFFF) || (gLastHitBy[gActiveBattler] == 0xFF) - || (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0)) + || (gMovesInfo[gLastLandedMoves[gActiveBattler]].power == 0)) return FALSE; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { @@ -529,7 +529,7 @@ u8 GetMostSuitableMonToSwitchInto(void) { move = GetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j); gBattleMoveDamage = 0; - if (move != MOVE_NONE && gBattleMoves[move].power != 1) + if (move != MOVE_NONE && gMovesInfo[move].power != 1) { AI_CalcDmg(gActiveBattler, opposingBattler); TypeCalc(move, gActiveBattler, opposingBattler); diff --git a/src/battle_anim.c b/src/battle_anim.c index 30f9a7ad2..8aafce929 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1723,3 +1723,30 @@ static void Cmd_stopsound(void) m4aMPlayStop(&gMPlayInfo_SE2); sBattleAnimScriptPtr++; } + +u8 GetAnimBattlerId(u8 wantedBattler) +{ + switch (wantedBattler) + { + case ANIM_ATTACKER: + default: + return gBattleAnimAttacker; + case ANIM_TARGET: + return gBattleAnimTarget; + case ANIM_ATK_PARTNER: + return BATTLE_PARTNER(gBattleAnimAttacker); + case ANIM_DEF_PARTNER: + return BATTLE_PARTNER(gBattleAnimTarget); + case ANIM_PLAYER_LEFT ... ANIM_OPPONENT_RIGHT: + return wantedBattler - MAX_BATTLERS_COUNT; + } +} + +// battle_anim_throw.c + +bool32 IsCriticalCapture(void) +{ + return gBattleSpritesDataPtr->animationData->isCriticalCapture; +} + +// diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index bfe1bf898..088509bb4 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -223,9 +223,9 @@ static u8 GetBattlerElevation(u8 battlerId, u16 species) if (species == SPECIES_CASTFORM) ret = sCastformElevations[gBattleMonForms[battlerId]]; else if (species > NUM_SPECIES) - ret = gEnemyMonElevation[0]; + ret = gSpeciesInfo[SPECIES_NONE].enemyMonElevation; else - ret = gEnemyMonElevation[species]; + ret = gSpeciesInfo[species].enemyMonElevation; } return ret; } diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 896c6411a..031152dec 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -968,3 +968,12 @@ static void AnimTask_WaitAndRestoreVisibility(u8 taskId) DestroyTask(taskId); } } + +void AnimTask_SetInvisible(u8 taskId) +{ + u32 battlerId = GetAnimBattlerId(gBattleAnimArgs[0]); + u32 spriteId = gBattlerSpriteIds[battlerId]; + + gSprites[spriteId].invisible = gBattleSpritesDataPtr->battlerData[battlerId].invisible = gBattleAnimArgs[1]; + DestroyAnimVisualTask(taskId); +} diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 6e9fb7c61..7b6f432d6 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -132,7 +132,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation, [CONTROLLER_CANTSWITCH] = LinkOpponentHandleCantSwitch, [CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = LinkOpponentHandlePlayFanfare, + [CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfare, [CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry, [CONTROLLER_INTROSLIDE] = LinkOpponentHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = LinkOpponentHandleIntroTrainerBallThrow, @@ -505,7 +505,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst) battleMon.speed = GetMonData(&gEnemyParty[monId], MON_DATA_SPEED); battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK); battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF); - battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); + // battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index d2c02a0ae..3621131c4 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -129,7 +129,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation, [CONTROLLER_CANTSWITCH] = LinkPartnerHandleCantSwitch, [CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = LinkPartnerHandlePlayFanfare, + [CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfare, [CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry, [CONTROLLER_INTROSLIDE] = LinkPartnerHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = LinkPartnerHandleIntroTrainerBallThrow, @@ -466,7 +466,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst) battleMon.speed = GetMonData(&gPlayerParty[monId], MON_DATA_SPEED); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); - battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); + // battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); TODO: check controllers if this is correct battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); diff --git a/src/battle_controller_oak_old_man.c b/src/battle_controller_oak_old_man.c index 1d821aec9..6f5a2de70 100644 --- a/src/battle_controller_oak_old_man.c +++ b/src/battle_controller_oak_old_man.c @@ -142,7 +142,7 @@ static void (*const sOakOldManBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = OakOldManHandleHitAnimation, [CONTROLLER_CANTSWITCH] = OakOldManHandleCmd42, [CONTROLLER_PLAYSE] = OakOldManHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = OakOldManHandlePlayFanfare, + [CONTROLLER_PLAYFANFAREORBGM] = OakOldManHandlePlayFanfare, [CONTROLLER_FAINTINGCRY] = OakOldManHandleFaintingCry, [CONTROLLER_INTROSLIDE] = OakOldManHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = OakOldManHandleIntroTrainerBallThrow, @@ -1029,7 +1029,7 @@ static u32 CopyOakOldManMonData(u8 monId, u8 *dst) battleMon.speed = GetMonData(&gPlayerParty[monId], MON_DATA_SPEED); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); - battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); + // battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index b4b6ebbdf..2c889e9d9 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -136,7 +136,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation, [CONTROLLER_CANTSWITCH] = OpponentHandleCmd42, [CONTROLLER_PLAYSE] = OpponentHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = OpponentHandlePlayFanfare, + [CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfare, [CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry, [CONTROLLER_INTROSLIDE] = OpponentHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = OpponentHandleIntroTrainerBallThrow, @@ -490,7 +490,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst) battleMon.speed = GetMonData(&gEnemyParty[monId], MON_DATA_SPEED); battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK); battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF); - battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); + // battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); @@ -1367,9 +1367,9 @@ static void OpponentHandleChooseMove(void) BtlController_EmitTwoReturnValues(1, B_ACTION_RUN, 0); break; default: - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (gMovesInfo[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) gBattlerTarget = gActiveBattler; - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) + if (gMovesInfo[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) { gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) @@ -1390,7 +1390,7 @@ static void OpponentHandleChooseMove(void) move = moveInfo->moves[chosenMoveId]; } while (move == MOVE_NONE); - if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (gMovesInfo[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gActiveBattler << 8)); else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 0924f5506..38f866868 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -153,7 +153,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation, [CONTROLLER_CANTSWITCH] = PlayerHandleCmd42, [CONTROLLER_PLAYSE] = PlayerHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = PlayerHandlePlayFanfare, + [CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfare, [CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry, [CONTROLLER_INTROSLIDE] = PlayerHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = PlayerHandleIntroTrainerBallThrow, @@ -378,7 +378,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) ++i; - else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER_OR_SELECTED) + else if (gMovesInfo[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER_OR_SELECTED) ++i; break; case B_POSITION_OPPONENT_LEFT: @@ -418,7 +418,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) ++i; - else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER_OR_SELECTED) + else if (gMovesInfo[GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler])].target & MOVE_TARGET_USER_OR_SELECTED) ++i; break; case B_POSITION_OPPONENT_LEFT: @@ -454,7 +454,7 @@ void HandleInputChooseMove(void) } else { - moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; + moveTarget = gMovesInfo[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; } if (moveTarget & MOVE_TARGET_USER) @@ -475,7 +475,7 @@ void HandleInputChooseMove(void) { canSelectTarget = FALSE; } - else if (!(moveTarget & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) && CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) <= 1) + else if (!(moveTarget & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) && CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_BATTLER, gActiveBattler) <= 1) { gMultiUsePlayerCursor = GetDefaultMoveTarget(gActiveBattler); canSelectTarget = FALSE; @@ -1409,7 +1409,7 @@ static void MoveSelectionDisplayMoveType(void) *txtPtr++ = 6; *txtPtr++ = 1; txtPtr = StringCopy(txtPtr, gText_MoveInterfaceDynamicColors); - StringCopy(txtPtr, gTypeNames[gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].type]); + StringCopy(txtPtr, gTypeNames[gMovesInfo[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].type]); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE); } @@ -1549,7 +1549,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst) battleMon.speed = GetMonData(&gPlayerParty[monId], MON_DATA_SPEED); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); - battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); + // battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); @@ -2900,7 +2900,7 @@ static void PreviewDeterminativeMoveTargets(void) } else { - moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; + moveTarget = gMovesInfo[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; } switch (moveTarget) { diff --git a/src/battle_controller_pokedude.c b/src/battle_controller_pokedude.c index 2455d747b..f3d61516f 100644 --- a/src/battle_controller_pokedude.c +++ b/src/battle_controller_pokedude.c @@ -166,7 +166,7 @@ static void (*const sPokedudeBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = PokedudeHandleHitAnimation, [CONTROLLER_CANTSWITCH] = PokedudeHandleCmd42, [CONTROLLER_PLAYSE] = PokedudeHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = PokedudeHandlePlayFanfare, + [CONTROLLER_PLAYFANFAREORBGM] = PokedudeHandlePlayFanfare, [CONTROLLER_FAINTINGCRY] = PokedudeHandleFaintingCry, [CONTROLLER_INTROSLIDE] = PokedudeHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = PokedudeHandleIntroTrainerBallThrow, @@ -777,7 +777,7 @@ static u32 CopyPokedudeMonData(u8 monId, u8 *dst) battleMon.speed = GetMonData(mon, MON_DATA_SPEED); battleMon.spAttack = GetMonData(mon, MON_DATA_SPATK); battleMon.spDefense = GetMonData(mon, MON_DATA_SPDEF); - battleMon.isEgg = GetMonData(mon, MON_DATA_IS_EGG); + // battleMon.isEgg = GetMonData(mon, MON_DATA_IS_EGG); battleMon.abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(mon, MON_DATA_OT_ID); GetMonData(mon, MON_DATA_NICKNAME, nickname); diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 4337dd723..9622899bf 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -123,7 +123,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_HITANIMATION] = SafariHandleHitAnimation, [CONTROLLER_CANTSWITCH] = SafariHandleCmd42, [CONTROLLER_PLAYSE] = SafariHandlePlaySE, - [CONTROLLER_PLAYFANFARE] = SafariHandlePlayFanfareOrBGM, + [CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry, [CONTROLLER_INTROSLIDE] = SafariHandleIntroSlide, [CONTROLLER_INTROTRAINERBALLTHROW] = SafariHandleIntroTrainerBallThrow, diff --git a/src/battle_controllers.c b/src/battle_controllers.c index ce772cab5..22d0e7128 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -287,6 +287,14 @@ static void InitLinkBtlControllers(void) } } +bool32 IsValidForBattle(struct Pokemon *mon) +{ + u32 species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG); + return (species != SPECIES_NONE && species != SPECIES_EGG + && GetMonData(mon, MON_DATA_HP) != 0 + && GetMonData(mon, MON_DATA_IS_EGG) == FALSE); +} + static void SetBattlePartyIds(void) { s32 i, j; @@ -740,7 +748,7 @@ static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, toWait * 3 + 2); } -void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr) +void BtlController_EmitMoveAnimation(u32 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit) { sBattleBuffersTransferData[0] = CONTROLLER_MOVEANIMATION; sBattleBuffersTransferData[1] = move; @@ -753,7 +761,7 @@ void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 m sBattleBuffersTransferData[8] = (dmg & 0x00FF0000) >> 16; sBattleBuffersTransferData[9] = (dmg & 0xFF000000) >> 24; sBattleBuffersTransferData[10] = friendship; - sBattleBuffersTransferData[11] = gMultiHitCounter; // multihit in pokeem + sBattleBuffersTransferData[11] = multihit; // multihit in pokeem if (WEATHER_HAS_EFFECT2) { sBattleBuffersTransferData[12] = gBattleWeather; @@ -789,7 +797,7 @@ void BtlController_EmitPrintString(u8 bufferId, u16 stringID) stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx; stringInfo->hpScale = gBattleStruct->hpScale; stringInfo->itemEffectBattler = gPotentialItemEffectBattler; - stringInfo->moveType = gBattleMoves[gCurrentMove].type; + stringInfo->moveType = gMovesInfo[gCurrentMove].type; for (i = 0; i < MAX_BATTLERS_COUNT; i++) stringInfo->abilities[i] = gBattleMons[i].ability; @@ -1109,12 +1117,12 @@ void BtlController_EmitPlaySE(u8 bufferId, u16 songId) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitPlayFanfare(u8 bufferId, u16 songId) +void BtlController_EmitPlayFanfareOrBGM(u32 bufferId, u16 songId, bool8 playBGM) { - sBattleBuffersTransferData[0] = CONTROLLER_PLAYFANFARE; + sBattleBuffersTransferData[0] = CONTROLLER_PLAYFANFAREORBGM; sBattleBuffersTransferData[1] = songId; sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8; - sBattleBuffersTransferData[3] = 0; + sBattleBuffersTransferData[3] = playBGM; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } @@ -1183,13 +1191,14 @@ void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument) +void BtlController_EmitBattleAnimation(u32 bufferId, u8 animationId, struct DisableStruct* disableStructPtr, u16 argument) { sBattleBuffersTransferData[0] = CONTROLLER_BATTLEANIMATION; sBattleBuffersTransferData[1] = animationId; sBattleBuffersTransferData[2] = argument; sBattleBuffersTransferData[3] = (argument & 0xFF00) >> 8; - PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); + memcpy(&sBattleBuffersTransferData[4], disableStructPtr, sizeof(struct DisableStruct)); + PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4 + sizeof(struct DisableStruct)); } // mode is a LINK_STANDBY_* constant diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index f143c0dd0..9c13a63f6 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -209,7 +209,7 @@ bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattler, u8 atkBattler, u8 de { u8 taskId; - if (tableId == B_ANIM_CASTFORM_CHANGE && (argument & 0x80)) + if (tableId == B_ANIM_FORM_CHANGE && (argument & 0x80)) { gBattleMonForms[activeBattler] = (argument & ~(0x80)); return TRUE; @@ -918,7 +918,7 @@ static void SpriteCB_EnemyShadow(struct Sprite *shadowSprite) if (gAnimScriptActive || battlerSprite->invisible) invisible = TRUE; else if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE - && gEnemyMonElevation[gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies] == 0) + && gSpeciesInfo[gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies].enemyMonElevation == 0) invisible = TRUE; if (gBattleSpritesDataPtr->battlerData[battlerId].behindSubstitute) invisible = TRUE; @@ -941,7 +941,7 @@ void SetBattlerShadowSpriteCallback(u8 battlerId, u16 species) if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) species = gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies; - if (gEnemyMonElevation[species] != 0) + if (gSpeciesInfo[species].enemyMonElevation != 0) gSprites[gBattleSpritesDataPtr->healthBoxesData[battlerId].shadowSpriteId].callback = SpriteCB_EnemyShadow; else gSprites[gBattleSpritesDataPtr->healthBoxesData[battlerId].shadowSpriteId].callback = SpriteCB_SetInvisible; diff --git a/src/battle_main.c b/src/battle_main.c index f6e596edb..644e8fe0b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -86,7 +86,6 @@ static void SpriteCB_PlayerThrowUpdate(struct Sprite *sprite); static void BattleStartClearSetData(void); static void BattleIntroGetMonsData(void); static void TurnValuesCleanUp(bool8 var0); -static void SpecialStatusesClear(void); static void BattleIntroPrepareBackgroundSlide(void); static void BattleIntroDrawTrainersOrMonsSprites(void); static void BattleIntroDrawPartySummaryScreens(void); @@ -185,7 +184,7 @@ EWRAM_DATA u32 gHitMarker = 0; static EWRAM_DATA u8 sUnusedBattlersArray[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u8 gUnusedFirstBattleVar2 = 0; -EWRAM_DATA u16 gSideStatuses[2] = {0}; +EWRAM_DATA u32 gSideStatuses[NUM_BATTLE_SIDES] = {0}; EWRAM_DATA struct SideTimer gSideTimers[2] = {0}; EWRAM_DATA u32 gStatuses3[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u32 gStatuses4[MAX_BATTLERS_COUNT] = {0}; @@ -221,6 +220,18 @@ EWRAM_DATA u16 gBattleMovePower = 0; EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u8 gPartyCriticalHits[PARTY_SIZE] = {0}; +EWRAM_DATA u32 gFieldStatuses = 0; +EWRAM_DATA u8 gBattlerAbility = 0; +EWRAM_DATA s32 gBideDmg[MAX_BATTLERS_COUNT] = {0}; +EWRAM_DATA u8 gBideTarget[MAX_BATTLERS_COUNT] = {0}; +EWRAM_DATA u16 gLastUsedMove = 0; +EWRAM_DATA u8 gIsCriticalHit = FALSE; +EWRAM_DATA struct FieldTimer gFieldTimers = {0}; +EWRAM_DATA bool8 gHasFetchedBall = FALSE; +EWRAM_DATA u8 gLastUsedBall = 0; +EWRAM_DATA u16 gLastThrownBall = 0; +EWRAM_DATA u16 gBallToDisplay = 0; +EWRAM_DATA struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT] = {0}; void (*gPreBattleCallback1)(void); void (*gBattleMainFunc)(void); @@ -1600,7 +1611,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum) for (j = 0; j < MAX_MON_MOVES; j++) { SetMonData(&party[i], MON_DATA_MOVE1 + j, &partyData[i].moves[j]); - SetMonData(&party[i], MON_DATA_PP1 + j, &gBattleMoves[partyData[i].moves[j]].pp); + SetMonData(&party[i], MON_DATA_PP1 + j, &gMovesInfo[partyData[i].moves[j]].pp); } break; } @@ -1633,7 +1644,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum) for (j = 0; j < MAX_MON_MOVES; j++) { SetMonData(&party[i], MON_DATA_MOVE1 + j, &partyData[i].moves[j]); - SetMonData(&party[i], MON_DATA_PP1 + j, &gBattleMoves[partyData[i].moves[j]].pp); + SetMonData(&party[i], MON_DATA_PP1 + j, &gMovesInfo[partyData[i].moves[j]].pp); } break; } @@ -2217,26 +2228,37 @@ static void BattleMainCB1(void) gBattlerControllerFuncs[gActiveBattler](); } +static void ClearSetBScriptingStruct(void) +{ + // windowsType is set up earlier in BattleInitBgsAndWindows, so we need to save the value + u32 temp = gBattleScripting.windowsType; + memset(&gBattleScripting, 0, sizeof(gBattleScripting)); + + gBattleScripting.windowsType = temp; + gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle; + gBattleScripting.expOnCatch = (B_EXP_CATCH >= GEN_6); +} + static void BattleStartClearSetData(void) { s32 i; - u32 j; - u8 *dataPtr; TurnValuesCleanUp(FALSE); SpecialStatusesClear(); + memset(&gDisableStructs, 0, sizeof(gDisableStructs)); + memset(&gFieldTimers, 0, sizeof(gFieldTimers)); + memset(&gSideStatuses, 0, sizeof(gSideStatuses)); + memset(&gSideTimers, 0, sizeof(gSideTimers)); + memset(&gWishFutureKnock, 0, sizeof(gWishFutureKnock)); + memset(&gBattleResults, 0, sizeof(gBattleResults)); + ClearSetBScriptingStruct(); + for (i = 0; i < MAX_BATTLERS_COUNT; i++) { gStatuses3[i] = 0; gStatuses4[i] = 0; - - dataPtr = (u8 *)&gDisableStructs[i]; - for (j = 0; j < sizeof(struct DisableStruct); j++) - dataPtr[j] = 0; - gDisableStructs[i].isFirstTurn = 2; - sUnusedBattlersArray[i] = 0; gLastMoves[i] = MOVE_NONE; gLastLandedMoves[i] = MOVE_NONE; gLastHitByType[i] = 0; @@ -2245,32 +2267,34 @@ static void BattleStartClearSetData(void) gLockedMoves[i] = MOVE_NONE; gLastPrintedMoves[i] = MOVE_NONE; gBattleResources->flags->flags[i] = 0; + gBattleStruct->lastTakenMove[i] = MOVE_NONE; + gBattleStruct->choicedMove[i] = MOVE_NONE; + gBattleStruct->changedItems[i] = 0; + gBattleStruct->lastTakenMoveFrom[i][0] = MOVE_NONE; + gBattleStruct->lastTakenMoveFrom[i][1] = MOVE_NONE; + gBattleStruct->lastTakenMoveFrom[i][2] = MOVE_NONE; + gBattleStruct->lastTakenMoveFrom[i][3] = MOVE_NONE; + gBattleStruct->AI_monToSwitchIntoId[i] = PARTY_SIZE; + gBattleStruct->skyDropTargets[i] = 0xFF; + gBattleStruct->overwrittenAbilities[i] = ABILITY_NONE; } - for (i = 0; i < 2; i++) - { - gSideStatuses[i] = 0; + gLastUsedMove = 0; + gFieldStatuses = 0; - dataPtr = (u8 *)&gSideTimers[i]; - for (j = 0; j < sizeof(struct SideTimer); j++) - dataPtr[j] = 0; - } + gHasFetchedBall = FALSE; + gLastUsedBall = 0; gBattlerAttacker = 0; gBattlerTarget = 0; + gEffectBattler = 0; + gBattlerAbility = 0; gBattleWeather = 0; - - dataPtr = (u8 *)&gWishFutureKnock; - for (i = 0; i < sizeof(struct WishFutureKnock); i++) - dataPtr[i] = 0; - gHitMarker = 0; if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_POKEDUDE)) && gSaveBlock2Ptr->optionsBattleSceneOff) gHitMarker |= HITMARKER_NO_ANIMATIONS; - gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle; - gMultiHitCounter = 0; gBattleOutcome = 0; gBattleControllerExecFlags = 0; @@ -2284,253 +2308,329 @@ static void BattleStartClearSetData(void) gPauseCounterBattle = 0; gBattleMoveDamage = 0; gIntroSlideFlags = 0; - gBattleScripting.animTurn = 0; - gBattleScripting.animTargetsHit = 0; gLeveledUpInBattle = 0; gAbsentBattlerFlags = 0; gBattleStruct->runTries = 0; gBattleStruct->safariRockThrowCounter = 0; gBattleStruct->safariBaitThrowCounter = 0; - *(&gBattleStruct->safariCatchFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275; - *(&gBattleStruct->safariEscapeFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].safariZoneFleeRate * 100 / 1275; - if (gBattleStruct->safariEscapeFactor <= 1) - gBattleStruct->safariEscapeFactor = 2; + gBattleStruct->safariCatchFactor = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275; + gBattleStruct->safariEscapeFactor = 3; gBattleStruct->wildVictorySong = 0; gBattleStruct->moneyMultiplier = 1; - for (i = 0; i < 8; i++) + gBattleStruct->givenExpMons = 0; + + gBattleResults.shinyWildMon = IsMonShiny(&gEnemyParty[0]); + + gBattleStruct->mega.triggerSpriteId = 0xFF; + gBattleStruct->burst.triggerSpriteId = 0xFF; + + for (i = 0; i < ARRAY_COUNT(gSideTimers); i++) { - *((u8 *)gBattleStruct->lastTakenMove + i) = MOVE_NONE; - *((u8 *)gBattleStruct->usedHeldItems + i) = ITEM_NONE; - *((u8 *)gBattleStruct->choicedMove + i) = MOVE_NONE; - *((u8 *)gBattleStruct->changedItems + i) = ITEM_NONE; - *(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i + 3 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + gSideTimers[i].stickyWebBattlerId = 0xFF; } - *(gBattleStruct->AI_monToSwitchIntoId + 0) = PARTY_SIZE; - *(gBattleStruct->AI_monToSwitchIntoId + 1) = PARTY_SIZE; - *(&gBattleStruct->givenExpMons) = 0; - for (i = 0; i < 11; i++) - gBattleResults.catchAttempts[i] = 0; - gBattleResults.battleTurnCounter = 0; - gBattleResults.playerFaintCounter = 0; - gBattleResults.opponentFaintCounter = 0; - gBattleResults.playerSwitchesCounter = 0; - gBattleResults.numHealingItemsUsed = 0; - gBattleResults.numRevivesUsed = 0; - gBattleResults.playerMonWasDamaged = FALSE; - gBattleResults.usedMasterBall = FALSE; - gBattleResults.lastOpponentSpecies = SPECIES_NONE; - gBattleResults.lastUsedMovePlayer = MOVE_NONE; - gBattleResults.lastUsedMoveOpponent = MOVE_NONE; - gBattleResults.playerMon1Species = SPECIES_NONE; - gBattleResults.playerMon2Species = SPECIES_NONE; - gBattleResults.caughtMonSpecies = SPECIES_NONE; - for (i = 0; i < POKEMON_NAME_LENGTH; ++i) + gBattleStruct->appearedInBattle = 0; + gBattleStruct->beatUpSlot = 0; + + for (i = 0; i < PARTY_SIZE; i++) { - gBattleResults.playerMon1Name[i] = 0; - gBattleResults.playerMon2Name[i] = 0; - gBattleResults.caughtMonNick[i] = 0; + gBattleStruct->usedHeldItems[i][B_SIDE_PLAYER] = 0; + gBattleStruct->usedHeldItems[i][B_SIDE_OPPONENT] = 0; + gBattleStruct->itemLost[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); + gPartyCriticalHits[i] = 0; + gBattleStruct->allowedToChangeFormInWeather[i][B_SIDE_PLAYER] = FALSE; + gBattleStruct->allowedToChangeFormInWeather[i][B_SIDE_OPPONENT] = FALSE; } - for (i = 0; i < PARTY_SIZE; i++) { - gPartyCriticalHits[i] = 0; - } + gBattleStruct->swapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky + gSelectedMonPartyId = PARTY_SIZE; // Revival Blessing } -void SwitchInClearSetData(void) +void SwitchInClearSetData(u32 battler) { struct DisableStruct disableStructCopy = gDisableStructs[gActiveBattler]; s32 i; u8 *ptr; - if (gBattleMoves[gCurrentMove].effect != EFFECT_BATON_PASS) + if (gMovesInfo[gCurrentMove].effect != EFFECT_BATON_PASS) { for (i = 0; i < NUM_BATTLE_STATS; i++) - gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE; + gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE; for (i = 0; i < gBattlersCount; i++) { - if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == gActiveBattler) + if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == battler) gBattleMons[i].status2 &= ~STATUS2_ESCAPE_PREVENTION; - if ((gStatuses3[i] & STATUS3_ALWAYS_HITS) && gDisableStructs[i].battlerWithSureHit == gActiveBattler) + if ((gStatuses3[i] & STATUS3_ALWAYS_HITS) && gDisableStructs[i].battlerWithSureHit == battler) { gStatuses3[i] &= ~STATUS3_ALWAYS_HITS; gDisableStructs[i].battlerWithSureHit = 0; } } } - if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) + if (gMovesInfo[gCurrentMove].effect == EFFECT_BATON_PASS) { - gBattleMons[gActiveBattler].status2 &= (STATUS2_CONFUSION | STATUS2_FOCUS_ENERGY | STATUS2_SUBSTITUTE | STATUS2_ESCAPE_PREVENTION | STATUS2_CURSED); - gStatuses3[gActiveBattler] &= (STATUS3_LEECHSEED_BATTLER | STATUS3_LEECHSEED | STATUS3_ALWAYS_HITS | STATUS3_PERISH_SONG | STATUS3_ROOTED); - gStatuses4[gActiveBattler] &= (STATUS4_MUD_SPORT | STATUS4_WATER_SPORT); + gBattleMons[battler].status2 &= (STATUS2_CONFUSION | STATUS2_FOCUS_ENERGY_ANY | STATUS2_SUBSTITUTE | STATUS2_ESCAPE_PREVENTION | STATUS2_CURSED); + gStatuses3[battler] &= (STATUS3_LEECHSEED_BATTLER | STATUS3_LEECHSEED | STATUS3_ALWAYS_HITS | STATUS3_PERISH_SONG | STATUS3_ROOTED + | STATUS3_GASTRO_ACID | STATUS3_EMBARGO | STATUS3_TELEKINESIS | STATUS3_MAGNET_RISE | STATUS3_HEAL_BLOCK + | STATUS3_AQUA_RING | STATUS3_POWER_TRICK); + gStatuses4[battler] &= (STATUS4_MUD_SPORT | STATUS4_WATER_SPORT | STATUS4_INFINITE_CONFUSION); for (i = 0; i < gBattlersCount; i++) { - if (GetBattlerSide(gActiveBattler) != GetBattlerSide(i) + if (GetBattlerSide(battler) != GetBattlerSide(i) && (gStatuses3[i] & STATUS3_ALWAYS_HITS) != 0 - && (gDisableStructs[i].battlerWithSureHit == gActiveBattler)) + && (gDisableStructs[i].battlerWithSureHit == battler)) { gStatuses3[i] &= ~STATUS3_ALWAYS_HITS; gStatuses3[i] |= STATUS3_ALWAYS_HITS_TURN(2); } } + if (gStatuses3[battler] & STATUS3_POWER_TRICK) + SWAP(gBattleMons[battler].attack, gBattleMons[battler].defense, i); } else { - gBattleMons[gActiveBattler].status2 = 0; - gStatuses3[gActiveBattler] = 0; - gStatuses4[gActiveBattler] = 0; + gBattleMons[battler].status2 = 0; + gStatuses3[battler] = 0; + gStatuses4[battler] = 0; } for (i = 0; i < gBattlersCount; i++) { - if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler)) - gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(gActiveBattler); - if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler) + if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(battler)) + gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(battler); + if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == battler) gBattleMons[i].status2 &= ~STATUS2_WRAPPED; + if ((gStatuses4[i] & STATUS4_SYRUP_BOMB) && *(gBattleStruct->stickySyrupdBy + i) == battler) + gStatuses4[i] &= ~STATUS4_SYRUP_BOMB; } - gActionSelectionCursor[gActiveBattler] = 0; - gMoveSelectionCursor[gActiveBattler] = 0; + gActionSelectionCursor[battler] = 0; + gMoveSelectionCursor[battler] = 0; - ptr = (u8 *)&gDisableStructs[gActiveBattler]; - for (i = 0; i < sizeof(struct DisableStruct); i++) - ptr[i] = 0; + memset(&gDisableStructs[battler], 0, sizeof(struct DisableStruct)); - if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) + if (gMovesInfo[gCurrentMove].effect == EFFECT_BATON_PASS) { - gDisableStructs[gActiveBattler].substituteHP = disableStructCopy.substituteHP; - gDisableStructs[gActiveBattler].battlerWithSureHit = disableStructCopy.battlerWithSureHit; - gDisableStructs[gActiveBattler].perishSongTimer = disableStructCopy.perishSongTimer; - gDisableStructs[gActiveBattler].perishSongTimerStartValue = disableStructCopy.perishSongTimerStartValue; - gDisableStructs[gActiveBattler].battlerPreventingEscape = disableStructCopy.battlerPreventingEscape; + gDisableStructs[battler].substituteHP = disableStructCopy.substituteHP; + gDisableStructs[battler].battlerWithSureHit = disableStructCopy.battlerWithSureHit; + gDisableStructs[battler].perishSongTimer = disableStructCopy.perishSongTimer; + gDisableStructs[battler].battlerPreventingEscape = disableStructCopy.battlerPreventingEscape; + gDisableStructs[battler].embargoTimer = disableStructCopy.embargoTimer; + } + else if (gMovesInfo[gCurrentMove].effect == EFFECT_SHED_TAIL) + { + gBattleMons[battler].status2 |= STATUS2_SUBSTITUTE; + gDisableStructs[battler].substituteHP = disableStructCopy.substituteHP; } gMoveResultFlags = 0; - gDisableStructs[gActiveBattler].isFirstTurn = 2; - gLastMoves[gActiveBattler] = MOVE_NONE; - gLastLandedMoves[gActiveBattler] = MOVE_NONE; - gLastHitByType[gActiveBattler] = 0; - gLastResultingMoves[gActiveBattler] = MOVE_NONE; - gLastPrintedMoves[gActiveBattler] = MOVE_NONE; - gLastHitBy[gActiveBattler] = 0xFF; + gDisableStructs[battler].isFirstTurn = 2; + gDisableStructs[battler].truantSwitchInHack = disableStructCopy.truantSwitchInHack; + gLastMoves[battler] = MOVE_NONE; + gLastLandedMoves[battler] = MOVE_NONE; + gLastHitByType[battler] = 0; + gLastResultingMoves[battler] = MOVE_NONE; + gLastPrintedMoves[battler] = MOVE_NONE; + gLastHitBy[battler] = 0xFF; - *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE; - *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE; - *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + gBattleStruct->lastTakenMove[battler] = 0; + gBattleStruct->sameMoveTurns[battler] = 0; + gBattleStruct->lastTakenMoveFrom[battler][0] = 0; + gBattleStruct->lastTakenMoveFrom[battler][1] = 0; + gBattleStruct->lastTakenMoveFrom[battler][2] = 0; + gBattleStruct->lastTakenMoveFrom[battler][3] = 0; + gBattleStruct->lastMoveFailed &= ~(gBitTable[battler]); + + for (i = 0; i < ARRAY_COUNT(gSideTimers); i++) + { + // Switched into sticky web user slot, so reset stored battler ID + if (gSideTimers[i].stickyWebBattlerId == battler) + gSideTimers[i].stickyWebBattlerId = 0xFF; + } for (i = 0; i < gBattlersCount; i++) { - if (i != gActiveBattler) - { - *(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE; - *(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE; - } - *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + if (i != battler && GetBattlerSide(i) != GetBattlerSide(battler)) + gBattleStruct->lastTakenMove[i] = MOVE_NONE; + + gBattleStruct->lastTakenMoveFrom[i][battler] = 0; } - *((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE; - *((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE; - - gBattleResources->flags->flags[gActiveBattler] = 0; + gBattleStruct->choicedMove[battler] = MOVE_NONE; + gBattleResources->flags->flags[battler] = 0; gCurrentMove = MOVE_NONE; + + // Reset damage to prevent things like red card activating if the switched-in mon is holding it + gSpecialStatuses[battler].physicalDmg = 0; + gSpecialStatuses[battler].specialDmg = 0; + + // Reset G-Max Chi Strike boosts. + gBattleStruct->bonusCritStages[battler] = 0; + + // TODO: Dynamax + // Reset Dynamax flags. + // UndoDynamax(battler); + + gBattleStruct->overwrittenAbilities[battler] = ABILITY_NONE; + + // Clear selected party ID so Revival Blessing doesn't get confused. + gSelectedMonPartyId = PARTY_SIZE; + + // TODO: AI + // Ai_UpdateSwitchInData(battler); } -void FaintClearSetData(void) +const u8* FaintClearSetData(u32 battler) { s32 i; - u8 *ptr; + const u8 *result = NULL; + u8 battlerSide = GetBattlerSide(battler); for (i = 0; i < NUM_BATTLE_STATS; i++) - gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE; + gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE; - gBattleMons[gActiveBattler].status2 = 0; - gStatuses3[gActiveBattler] = 0; - gStatuses4[gActiveBattler] = 0; + gBattleMons[battler].status2 = 0; + gStatuses3[battler] &= STATUS3_GASTRO_ACID; // Edge case: Keep Gastro Acid if pokemon's ability can have effect after fainting, for example Innards Out. + gStatuses4[battler] = 0; for (i = 0; i < gBattlersCount; i++) { - if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == gActiveBattler) + if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == battler) gBattleMons[i].status2 &= ~STATUS2_ESCAPE_PREVENTION; - if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler)) - gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(gActiveBattler); - if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler) + if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(battler)) + gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(battler); + if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == battler) gBattleMons[i].status2 &= ~STATUS2_WRAPPED; + if ((gStatuses4[i] & STATUS4_SYRUP_BOMB) && *(gBattleStruct->stickySyrupdBy + i) == battler) + gStatuses4[i] &= ~STATUS4_SYRUP_BOMB; } - gActionSelectionCursor[gActiveBattler] = 0; - gMoveSelectionCursor[gActiveBattler] = 0; + gActionSelectionCursor[battler] = 0; + gMoveSelectionCursor[battler] = 0; - ptr = (u8 *)&gDisableStructs[gActiveBattler]; - for (i = 0; i < sizeof(struct DisableStruct); i++) - ptr[i] = 0; + memset(&gDisableStructs[battler], 0, sizeof(struct DisableStruct)); - gProtectStructs[gActiveBattler].protected = FALSE; - gProtectStructs[gActiveBattler].endured = FALSE; - gProtectStructs[gActiveBattler].noValidMoves = FALSE; - gProtectStructs[gActiveBattler].helpingHand = FALSE; - gProtectStructs[gActiveBattler].bounceMove = FALSE; - gProtectStructs[gActiveBattler].stealMove = FALSE; - gProtectStructs[gActiveBattler].flag0Unknown = FALSE; - gProtectStructs[gActiveBattler].prlzImmobility = FALSE; - gProtectStructs[gActiveBattler].confusionSelfDmg = FALSE; - gProtectStructs[gActiveBattler].targetNotAffected = FALSE; - gProtectStructs[gActiveBattler].chargingTurn = FALSE; - gProtectStructs[gActiveBattler].fleeType = 0; - gProtectStructs[gActiveBattler].usedImprisonedMove = FALSE; - gProtectStructs[gActiveBattler].loveImmobility = FALSE; - gProtectStructs[gActiveBattler].usedDisabledMove = FALSE; - gProtectStructs[gActiveBattler].usedTauntedMove = FALSE; - gProtectStructs[gActiveBattler].flag2Unknown = FALSE; - gProtectStructs[gActiveBattler].flinchImmobility = FALSE; - gProtectStructs[gActiveBattler].notFirstStrike = FALSE; + gProtectStructs[battler].protected = FALSE; + gProtectStructs[battler].spikyShielded = FALSE; + gProtectStructs[battler].kingsShielded = FALSE; + gProtectStructs[battler].banefulBunkered = FALSE; + gProtectStructs[battler].quash = FALSE; + gProtectStructs[battler].obstructed = FALSE; + gProtectStructs[battler].silkTrapped = FALSE; + gProtectStructs[battler].burningBulwarked = FALSE; + gProtectStructs[battler].endured = FALSE; + gProtectStructs[battler].noValidMoves = FALSE; + gProtectStructs[battler].helpingHand = FALSE; + gProtectStructs[battler].bounceMove = FALSE; + gProtectStructs[battler].stealMove = FALSE; + gProtectStructs[battler].prlzImmobility = FALSE; + gProtectStructs[battler].confusionSelfDmg = FALSE; + gProtectStructs[battler].targetAffected = FALSE; + gProtectStructs[battler].chargingTurn = FALSE; + gProtectStructs[battler].fleeType = 0; + gProtectStructs[battler].usedImprisonedMove = FALSE; + gProtectStructs[battler].loveImmobility = FALSE; + gProtectStructs[battler].usedDisabledMove = FALSE; + gProtectStructs[battler].usedTauntedMove = FALSE; + gProtectStructs[battler].flag2Unknown = FALSE; + gProtectStructs[battler].flinchImmobility = FALSE; + gProtectStructs[battler].notFirstStrike = FALSE; + gProtectStructs[battler].usedHealBlockedMove = FALSE; + gProtectStructs[battler].usesBouncedMove = FALSE; + gProtectStructs[battler].usedGravityPreventedMove = FALSE; + gProtectStructs[battler].usedThroatChopPreventedMove = FALSE; + gProtectStructs[battler].statRaised = FALSE; + gProtectStructs[battler].statFell = FALSE; + gProtectStructs[battler].pranksterElevated = FALSE; - gDisableStructs[gActiveBattler].isFirstTurn = 2; + gDisableStructs[battler].isFirstTurn = 2; - gLastMoves[gActiveBattler] = MOVE_NONE; - gLastLandedMoves[gActiveBattler] = MOVE_NONE; - gLastHitByType[gActiveBattler] = 0; - gLastResultingMoves[gActiveBattler] = MOVE_NONE; - gLastPrintedMoves[gActiveBattler] = MOVE_NONE; - gLastHitBy[gActiveBattler] = 0xFF; + gLastMoves[battler] = MOVE_NONE; + gLastLandedMoves[battler] = MOVE_NONE; + gLastHitByType[battler] = 0; + gLastResultingMoves[battler] = MOVE_NONE; + gLastPrintedMoves[battler] = MOVE_NONE; + gLastHitBy[battler] = 0xFF; - *((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE; - *((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE; + gBattleStruct->choicedMove[battler] = MOVE_NONE; + gBattleStruct->sameMoveTurns[battler] = 0; + gBattleStruct->lastTakenMove[battler] = MOVE_NONE; + gBattleStruct->lastTakenMoveFrom[battler][0] = 0; + gBattleStruct->lastTakenMoveFrom[battler][1] = 0; + gBattleStruct->lastTakenMoveFrom[battler][2] = 0; + gBattleStruct->lastTakenMoveFrom[battler][3] = 0; - *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE; - *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE; - *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + for (i = 0; i < ARRAY_COUNT(gSideTimers); i++) + { + // User of sticky web fainted, so reset the stored battler ID + if (gSideTimers[i].stickyWebBattlerId == battler) + gSideTimers[i].stickyWebBattlerId = 0xFF; + } for (i = 0; i < gBattlersCount; i++) { - if (i != gActiveBattler) - { - *(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE; - *(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE; - } - *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + if (i != battler && GetBattlerSide(i) != battlerSide) + gBattleStruct->lastTakenMove[i] = MOVE_NONE; + + gBattleStruct->lastTakenMoveFrom[i][battler] = 0; } - gBattleResources->flags->flags[gActiveBattler] = 0; - gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0]; - gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1]; + + gBattleResources->flags->flags[battler] = 0; + + gBattleMons[battler].type1 = gSpeciesInfo[gBattleMons[battler].species].types[0]; + gBattleMons[battler].type2 = gSpeciesInfo[gBattleMons[battler].species].types[1]; + gBattleMons[battler].type3 = TYPE_MYSTERY; + + // TODO: AI + // Ai_UpdateFaintData(battler); + TryBattleFormChange(battler, FORM_CHANGE_FAINT); + + gBattleStruct->overwrittenAbilities[battler] = ABILITY_NONE; + + // If the fainted mon was involved in a Sky Drop + if (gBattleStruct->skyDropTargets[battler] != 0xFF) + { + // Get battler id of the other Pokemon involved in this Sky Drop + u8 otherSkyDropper = gBattleStruct->skyDropTargets[battler]; + + // Clear Sky Drop data + gBattleStruct->skyDropTargets[battler] = 0xFF; + gBattleStruct->skyDropTargets[otherSkyDropper] = 0xFF; + + // If the other Pokemon involved in this Sky Drop was the target, not the attacker + if (gStatuses3[otherSkyDropper] & STATUS3_SKY_DROPPED) + { + // Release the target and take them out of the semi-invulnerable state + gStatuses3[otherSkyDropper] &= ~(STATUS3_SKY_DROPPED | STATUS3_ON_AIR); + + // Make the target's sprite visible + gSprites[gBattlerSpriteIds[otherSkyDropper]].invisible = FALSE; + + // If the target was sky dropped in the middle of using Outrage/Petal Dance/Thrash, + // confuse them upon release and print "confused via fatigue" message and animation. + if (gBattleMons[otherSkyDropper].status2 & STATUS2_LOCK_CONFUSE) + { + gBattleMons[otherSkyDropper].status2 &= ~(STATUS2_LOCK_CONFUSE); + + // If the released mon can be confused, do so. + // Don't use CanBeConfused here, since it can cause issues in edge cases. + if (!(GetBattlerAbility(otherSkyDropper) == ABILITY_OWN_TEMPO + || gBattleMons[otherSkyDropper].status2 & STATUS2_CONFUSION + || IsBattlerTerrainAffected(otherSkyDropper, STATUS_FIELD_MISTY_TERRAIN))) + { + gBattleMons[otherSkyDropper].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); + gBattlerAttacker = otherSkyDropper; + result = BattleScript_ThrashConfuses; + } + } + } + } + + // Clear Z-Move data + gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.toBeUsed[battler] = MOVE_NONE; + gBattleStruct->zmove.effect = EFFECT_HIT; + return result; } static void BattleIntroGetMonsData(void) @@ -3016,78 +3116,69 @@ void BattleTurnPassed(void) gRandomTurnNumber = Random(); } -u8 IsRunningFromBattleImpossible(void) +u8 IsRunningFromBattleImpossible(u32 battler) { - u8 holdEffect; - u8 side; - s32 i; + u32 holdEffect, i; - if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY) - holdEffect = gEnigmaBerries[gActiveBattler].holdEffect; + if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY_E_READER) + holdEffect = gEnigmaBerries[battler].holdEffect; else - holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item); - gPotentialItemEffectBattler = gActiveBattler; - if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN - || (gBattleTypeFlags & BATTLE_TYPE_LINK) - || gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY) - return BATTLE_RUN_SUCCESS; - side = GetBattlerSide(gActiveBattler); - for (i = 0; i < gBattlersCount; i++) + holdEffect = ItemId_GetHoldEffect(gBattleMons[battler].item); + + gPotentialItemEffectBattler = battler; + + if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) // Cannot ever run from saving Birch's battle. { - if (side != GetBattlerSide(i) - && gBattleMons[i].ability == ABILITY_SHADOW_TAG) - { - gBattleScripting.battler = i; - gLastUsedAbility = gBattleMons[i].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; - return BATTLE_RUN_FAILURE; - } - if (side != GetBattlerSide(i) - && gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE - && !IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_FLYING) - && gBattleMons[i].ability == ABILITY_ARENA_TRAP) - { - gBattleScripting.battler = i; - gLastUsedAbility = gBattleMons[i].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; - return BATTLE_RUN_FAILURE; - } + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH; + return BATTLE_RUN_FORBIDDEN; } - i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0); - if (i != 0 && IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL)) + if (GetBattlerPosition(battler) == B_POSITION_PLAYER_RIGHT && WILD_DOUBLE_BATTLE + && IsBattlerAlive(GetBattlerAtPosition(B_POSITION_PLAYER_LEFT))) // The second pokemon cannot run from a double wild battle, unless it's the only alive mon. + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE; + return BATTLE_RUN_FORBIDDEN; + } + + if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN) + return BATTLE_RUN_SUCCESS; + if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) + return BATTLE_RUN_SUCCESS; + if (gBattleTypeFlags & BATTLE_TYPE_LINK) + return BATTLE_RUN_SUCCESS; + if (GetBattlerAbility(battler) == ABILITY_RUN_AWAY) + return BATTLE_RUN_SUCCESS; + + if ((i = IsAbilityPreventingEscape(battler))) { gBattleScripting.battler = i - 1; gLastUsedAbility = gBattleMons[i - 1].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE; return BATTLE_RUN_FAILURE; } - if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)) - || (gStatuses3[gActiveBattler] & STATUS3_ROOTED)) + + if (!CanBattlerEscape(battler)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; - return BATTLE_RUN_FORBIDDEN; - } - if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) - { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE; return BATTLE_RUN_FORBIDDEN; } return BATTLE_RUN_SUCCESS; } -void UpdatePartyOwnerOnSwitch_NonMulti(u8 battler) +void SwitchPartyOrder(u32 battler) { s32 i; - u8 r4, r1; + u32 partyId1, partyId2; - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)); - r4 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]); - r1 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler)); - SwitchPartyMonSlots(r4, r1); + + partyId1 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]); + partyId2 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler)); + SwitchPartyMonSlots(partyId1, partyId2); + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) { *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; *(BATTLE_PARTNER(battler) * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; @@ -3095,8 +3186,10 @@ void UpdatePartyOwnerOnSwitch_NonMulti(u8 battler) } else { - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) + { *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; + } } } @@ -3261,7 +3354,7 @@ static void HandleTurnActionSelectionState(void) BattleScriptExecute(BattleScript_PrintCantRunFromTrainer); gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN; } - else if (IsRunningFromBattleImpossible() != BATTLE_RUN_SUCCESS + else if (IsRunningFromBattleImpossible(gActiveBattler) != BATTLE_RUN_SUCCESS && gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN) { gSelectionBattleScripts[gActiveBattler] = BattleScript_PrintCantEscapeFromBattle; @@ -3520,10 +3613,10 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) moveBattler2 = MOVE_NONE; } // both move priorities are different than 0 - if (gBattleMoves[moveBattler1].priority != 0 || gBattleMoves[moveBattler2].priority != 0) + if (gMovesInfo[moveBattler1].priority != 0 || gMovesInfo[moveBattler2].priority != 0) { // both priorities are the same - if (gBattleMoves[moveBattler1].priority == gBattleMoves[moveBattler2].priority) + if (gMovesInfo[moveBattler1].priority == gMovesInfo[moveBattler2].priority) { if (speedBattler1 == speedBattler2 && Random() & 1) strikesFirst = 2; // same speeds, same priorities @@ -3531,7 +3624,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) strikesFirst = 1; // battler2 has more speed // else battler1 has more speed } - else if (gBattleMoves[moveBattler1].priority < gBattleMoves[moveBattler2].priority) + else if (gMovesInfo[moveBattler1].priority < gMovesInfo[moveBattler2].priority) strikesFirst = 1; // battler2's move has greater priority // else battler1's move has greater priority } @@ -3641,47 +3734,52 @@ static void SetActionsAndBattlersTurnOrder(void) static void TurnValuesCleanUp(bool8 var0) { s32 i; - u8 *dataPtr; - for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) + for (i = 0; i < gBattlersCount; i++) { if (var0) { - gProtectStructs[gActiveBattler].protected = FALSE; - gProtectStructs[gActiveBattler].endured = FALSE; + gProtectStructs[i].protected = FALSE; + gProtectStructs[i].spikyShielded = FALSE; + gProtectStructs[i].kingsShielded = FALSE; + gProtectStructs[i].banefulBunkered = FALSE; + gProtectStructs[i].quash = FALSE; + gProtectStructs[i].usedCustapBerry = FALSE; + gProtectStructs[i].quickDraw = FALSE; + memset(&gQueuedStatBoosts[i], 0, sizeof(struct QueuedStatBoost)); } else { - dataPtr = (u8 *)(&gProtectStructs[gActiveBattler]); - for (i = 0; i < sizeof(struct ProtectStruct); i++) - dataPtr[i] = 0; - if (gDisableStructs[gActiveBattler].isFirstTurn) - --gDisableStructs[gActiveBattler].isFirstTurn; - if (gDisableStructs[gActiveBattler].rechargeTimer) + memset(&gProtectStructs[i], 0, sizeof(struct ProtectStruct)); + + if (gDisableStructs[i].isFirstTurn) + gDisableStructs[i].isFirstTurn--; + + if (gDisableStructs[i].rechargeTimer) { - --gDisableStructs[gActiveBattler].rechargeTimer; - if (gDisableStructs[gActiveBattler].rechargeTimer == 0) - gBattleMons[gActiveBattler].status2 &= ~(STATUS2_RECHARGE); + gDisableStructs[i].rechargeTimer--; + if (gDisableStructs[i].rechargeTimer == 0) + gBattleMons[i].status2 &= ~STATUS2_RECHARGE; } } - if (gDisableStructs[gActiveBattler].substituteHP == 0) - gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE); + if (gDisableStructs[i].substituteHP == 0) + gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE; + + gSpecialStatuses[i].parentalBondState = PARENTAL_BOND_OFF; } - gSideTimers[0].followmeTimer = 0; - gSideTimers[1].followmeTimer = 0; + + gSideStatuses[B_SIDE_PLAYER] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK); + gSideStatuses[B_SIDE_OPPONENT] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK); + gSideTimers[B_SIDE_PLAYER].followmeTimer = 0; + gSideTimers[B_SIDE_OPPONENT].followmeTimer = 0; + + gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceller } -static void SpecialStatusesClear(void) +void SpecialStatusesClear(void) { - for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) - { - s32 i; - u8 *dataPtr = (u8 *)(&gSpecialStatuses[gActiveBattler]); - - for (i = 0; i < sizeof(struct SpecialStatus); i++) - dataPtr[i] = 0; - } + memset(&gSpecialStatuses, 0, sizeof(gSpecialStatuses)); } static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) @@ -4043,7 +4141,7 @@ static void HandleAction_UseMove(void) // choose target side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; if (gSideTimers[side].followmeTimer != 0 - && gBattleMoves[gCurrentMove].target == MOVE_TARGET_SELECTED + && gMovesInfo[gCurrentMove].target == MOVE_TARGET_SELECTED && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget) && gBattleMons[gSideTimers[side].followmeTarget].hp != 0) { @@ -4051,10 +4149,10 @@ static void HandleAction_UseMove(void) } else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gSideTimers[side].followmeTimer == 0 - && (gBattleMoves[gCurrentMove].power != 0 - || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER) + && (gMovesInfo[gCurrentMove].power != 0 + || gMovesInfo[gCurrentMove].target != MOVE_TARGET_USER) && gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD - && gBattleMoves[gCurrentMove].type == TYPE_ELECTRIC) + && gMovesInfo[gCurrentMove].type == TYPE_ELECTRIC) { side = GetBattlerSide(gBattlerAttacker); for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) @@ -4065,7 +4163,7 @@ static void HandleAction_UseMove(void) var = GetBattlerTurnOrderNum(gActiveBattler); if (var == 4) { - if (gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + if (gMovesInfo[gChosenMove].target & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -4109,7 +4207,7 @@ static void HandleAction_UseMove(void) } } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + && gMovesInfo[gChosenMove].target & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -4146,7 +4244,7 @@ static void HandleAction_UseMove(void) } } } - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } @@ -4498,3 +4596,135 @@ static void HandleAction_ActionFinished(void) gBattleScripting.multihitMoveEffect = 0; gBattleResources->battleScriptsStack->size = 0; } + +s8 GetMovePriority(u32 battler, u16 move) +{ + s8 priority; + u16 ability = GetBattlerAbility(battler); + + // TODO: Z-Moves + // if (gBattleStruct->zmove.toBeUsed[battler] && gMovesInfo[move].power != 0) + // move = gBattleStruct->zmove.toBeUsed[battler]; + + priority = gMovesInfo[move].priority; + + // Max Guard check + // TODO: Dynamax + // if (gBattleStruct->dynamax.usingMaxMove[battler] && gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) + // return gMovesInfo[MOVE_MAX_GUARD].priority; + + if (ability == ABILITY_GALE_WINGS + && (B_GALE_WINGS < GEN_7 || BATTLER_MAX_HP(battler)) + && gMovesInfo[move].type == TYPE_FLYING) + { + priority++; + } + else if (ability == ABILITY_PRANKSTER && IS_MOVE_STATUS(move)) + { + gProtectStructs[battler].pranksterElevated = 1; + priority++; + } + else if (gMovesInfo[move].effect == EFFECT_GRASSY_GLIDE && gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && IsBattlerGrounded(battler)) + { + priority++; + } + else if (ability == ABILITY_TRIAGE && IsHealingMove(move)) + priority += 3; + + if (gProtectStructs[battler].quash) + priority = -8; + + return priority; +} + +s8 GetChosenMovePriority(u32 battler) +{ + u16 move; + + gProtectStructs[battler].pranksterElevated = 0; + if (gProtectStructs[battler].noValidMoves) + move = MOVE_STRUGGLE; + else + move = gBattleMons[battler].moves[*(gBattleStruct->chosenMovePositions + battler)]; + + return GetMovePriority(battler, move); +} + +// For AI, so it doesn't 'cheat' by knowing player's ability +u32 GetBattlerTotalSpeedStatArgs(u32 battler, u32 ability, u32 holdEffect) +{ + u32 speed = gBattleMons[battler].speed; + u32 highestStat = GetHighestStatId(battler); + + // weather abilities + if (WEATHER_HAS_EFFECT) + { + if (ability == ABILITY_SWIFT_SWIM && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & B_WEATHER_RAIN) + speed *= 2; + else if (ability == ABILITY_CHLOROPHYLL && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & B_WEATHER_SUN) + speed *= 2; + else if (ability == ABILITY_SAND_RUSH && gBattleWeather & B_WEATHER_SANDSTORM) + speed *= 2; + else if (ability == ABILITY_SLUSH_RUSH && (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW))) + speed *= 2; + } + + // other abilities + if (ability == ABILITY_QUICK_FEET && gBattleMons[battler].status1 & STATUS1_ANY) + speed = (speed * 150) / 100; + else if (ability == ABILITY_SURGE_SURFER && gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + speed *= 2; + else if (ability == ABILITY_SLOW_START && gDisableStructs[battler].slowStartTimer != 0) + speed /= 2; + else if (ability == ABILITY_PROTOSYNTHESIS && gBattleWeather & B_WEATHER_SUN && highestStat == STAT_SPEED) + speed = (speed * 150) / 100; + else if (ability == ABILITY_QUARK_DRIVE && gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && highestStat == STAT_SPEED) + speed = (speed * 150) / 100; + + // stat stages + speed *= gStatStageRatios[gBattleMons[battler].statStages[STAT_SPEED]][0]; + speed /= gStatStageRatios[gBattleMons[battler].statStages[STAT_SPEED]][1]; + + // player's badge boost + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER)) + && ShouldGetStatBadgeBoost(FLAG_BADGE03_GET, battler) + && GetBattlerSide(battler) == B_SIDE_PLAYER) + { + speed = (speed * 110) / 100; + } + + // item effects + if (holdEffect == HOLD_EFFECT_MACHO_BRACE || holdEffect == HOLD_EFFECT_POWER_ITEM) + speed /= 2; + else if (holdEffect == HOLD_EFFECT_IRON_BALL) + speed /= 2; + else if (holdEffect == HOLD_EFFECT_CHOICE_SCARF /*&& !IsDynamaxed(battler)*/) // TODO: Dynamax + speed = (speed * 150) / 100; + else if (holdEffect == HOLD_EFFECT_QUICK_POWDER && gBattleMons[battler].species == SPECIES_DITTO && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) + speed *= 2; + + // various effects + if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_TAILWIND) + speed *= 2; + if (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_UNBURDEN) + speed *= 2; + + // paralysis drop + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS && ability != ABILITY_QUICK_FEET) + speed /= B_PARALYSIS_SPEED >= GEN_7 ? 2 : 4; + + if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SWAMP) + speed /= 4; + + return speed; +} + +u32 GetBattlerTotalSpeedStat(u32 battler) +{ + u32 ability = GetBattlerAbility(battler); + u32 holdEffect = GetBattlerHoldEffect(battler, TRUE); + return GetBattlerTotalSpeedStatArgs(battler, ability, holdEffect); +} + + + diff --git a/src/battle_message.c b/src/battle_message.c index 18e56f4b9..83311f470 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -518,14 +518,189 @@ const u8 gText_HowDissapointing[] = _("OAK: Hm…\nHow disappointing…\pIf you static const u8 sText_ItemRestoredSpeciesHealth[] = _("{B_BUFF1} had its\nHP restored!"); static const u8 sText_ItemCuredSpeciesStatus[] = _("{B_BUFF1} had\nits status healed!"); static const u8 sText_ItemRestoredSpeciesPP[] = _("{B_BUFF1} had its\nPP restored!"); - - -const u16 gTrainerUsedItemStringIds[] = -{ - STRINGID_PLAYERUSEDITEM, STRINGID_TRAINER1USEDITEM -}; -// - +static const u8 sText_ElectroShotCharging[] = _("{B_ATK_NAME_WITH_PREFIX} absorbed\nelectricity!"); +static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); +static const u8 sText_PkmnIsCloakedInAHarshLight[] = _("{B_ATK_NAME_WITH_PREFIX} became\ncloaked in a harsh light!"); +static const u8 sText_VanishedInstantly[] =_("{B_ATK_NAME_WITH_PREFIX} vanished\ninstantly!"); +static const u8 sText_PkmnTookTargetHigh[] = _("{B_ATK_NAME_WITH_PREFIX} took {B_DEF_NAME_WITH_PREFIX}\ninto the air!"); +static const u8 sText_CloakedInAFreezingLight[] = _("{B_ATK_NAME_WITH_PREFIX} became cloaked\nin a freezing light!"); +static const u8 sText_PkmnAbsorbingPower[] = _("{B_ATK_NAME_WITH_PREFIX} is absorbing power!"); +static const u8 sText_PokemonCannotUseMove[] = _("{B_ATK_NAME_WITH_PREFIX} cannot\nuse {B_CURRENT_MOVE}!"); +static const u8 sText_PkmnMoveBouncedViaAbility[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_CURRENT_MOVE} was\nbounced back by {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY}!"); +static const u8 sText_HealBlockPreventsUsage[] = _("{B_ATK_NAME_WITH_PREFIX} was\nprevented from healing!\p"); +static const u8 sText_GravityPreventsUsage[] = _("{B_ATK_NAME_WITH_PREFIX} can't use {B_CURRENT_MOVE}\nbecause of gravity!\p"); +static const u8 sText_PkmnFrostbiteHealed2[] = _("{B_ATK_NAME_WITH_PREFIX}'s\nfrostbite was healed!"); +static const u8 sText_PkmnFrostbiteHealedBy[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_CURRENT_MOVE}\nhealed its frostbite!"); +static const u8 sText_SafetyGogglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!"); +static const u8 sText_PowderExplodes[] = _("When the flame touched the powder\non the Pokémon, it exploded!"); +static const u8 sText_PkmnCantUseMoveThroatChop[] = _("{B_ATK_NAME_WITH_PREFIX} can't use\n{B_CURRENT_MOVE} due to Throat Chop!\p"); +static const u8 sText_MoveFizzledOutInTheHeavyRain[] = _("The Fire-type attack fizzled out\nin the heavy rain!"); +static const u8 sText_MoveEvaporatedInTheHarshSunlight[] = _("The Water-type attack evaporated\nin the harsh sunlight!"); +static const u8 sText_TargetAteItem[] = _("{B_DEF_NAME_WITH_PREFIX} ate its {B_LAST_ITEM}!"); +static const u8 sText_GemActivates[] = _("{B_LAST_ITEM} strengthened\n{B_ATK_NAME_WITH_PREFIX}'s power!"); +static const u8 sText_AttackWeakenedByStrongWinds[] = _("The mysterious strong winds\nweakened the attack!"); +static const u8 sText_EnduredViaSturdy[] = _("{B_DEF_NAME_WITH_PREFIX} endured\nthe hit using {B_DEF_ABILITY}!"); +static const u8 sText_BerryDmgReducing[] = _("{B_LAST_ITEM} weakened the damage\nto {B_DEF_NAME_WITH_PREFIX}!"); +static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!"); +static const u8 sText_TrappedBySwirlingMagma[] =_("{B_DEF_NAME_WITH_PREFIX} became\ntrapped by swirling magma!"); +static const u8 sText_Infestation[] = _("{B_DEF_NAME_WITH_PREFIX} has been afflicted\nwith an infestation by {B_ATK_NAME_WITH_PREFIX}!"); +static const u8 sText_PkmnInSnapTrap[] = _("{B_DEF_NAME_WITH_PREFIX} got trapped\nby a snap trap!"); +static const u8 sText_AtkTrappedDef[] = _("{B_ATK_NAME_WITH_PREFIX} trapped\nthe {B_DEF_NAME_WITH_PREFIX}!"); +static const u8 sText_ResetsTargetsStatLevels[] =_("{B_DEF_NAME_WITH_PREFIX}'s stat changes\nwere removed!"); +static const u8 sText_StrongWindsDissipated[] = _("The mysterious strong winds\nhave dissipated!{PAUSE 64}"); +static const u8 sText_ExtremeSunlightFaded[] = _("The extreme sunlight faded.{PAUSE 64}"); +static const u8 sText_HeavyRainLifted[] = _("The heavy rain has lifted!{PAUSE 64}"); +static const u8 sText_SymbiosisItemPass[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} passed its {B_LAST_ITEM}\nto {B_ATK_NAME_WITH_PREFIX} through {B_LAST_ABILITY}!"); +static const u8 sText_BurstingFlames[] = _("The bursting flames\nhit {B_SCR_ACTIVE_NAME_WITH_PREFIX}!"); +static const u8 sText_BrokeThroughProtection[] = _("It broke through\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); +static const u8 sText_FellForFeint[] = _("{B_DEF_NAME_WITH_PREFIX} fell for\nthe feint!"); +static const u8 sText_SpectralThiefSteal[] = _("{B_ATK_NAME_WITH_PREFIX} stole the target's\nboosted stats!"); +static const u8 sText_PkmnsAbilitySuppressed[] = _("{B_DEF_NAME_WITH_PREFIX}'s ability\nwas suppressed!"); +static const u8 sText_IncinerateBurn[] = _("{B_EFF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nwas burnt up!"); +static const u8 sText_BugBite[] = _("{B_ATK_NAME_WITH_PREFIX} stole and ate\n{B_EFF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); +static const u8 sText_BothCanNoLongerEscape[] = _("Neither Pokémon can run away!"); +static const u8 sText_AttackerLostFireType[] = _("{B_ATK_NAME_WITH_PREFIX} burned itself out!"); +static const u8 sText_AttackerLostElectricType[] = _("{B_ATK_NAME_WITH_PREFIX} used up all\nof its electricity!"); +static const u8 sText_AttackerLostItsType[] = _("{B_ATK_NAME_WITH_PREFIX} lost\nits {B_BUFF1} type!"); +static const u8 sText_StealthRockDmg[] = _("Pointed stones dug into\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}!"); +static const u8 sText_SharpSteelDmg[] = _("Sharp steel bit into {B_DEF_NAME_WITH_PREFIX}!"); +static const u8 sText_PointedStonesFloat[] =_("Pointed stones float in the air\naround {B_DEF_TEAM2} team!"); +static const u8 sText_SharpSteelFloats[] = _("Sharp-pointed steel floats\naround {B_DEF_TEAM2} team!"); +static const u8 sText_TargetCoveredInStickyCandySyrup[] = _("{B_DEF_NAME_WITH_PREFIX} got covered\nin sticky syrup!"); +static const u8 sText_AromaVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby an aromatic veil!"); +static const u8 sText_PkmnPreventedFromHealing[] = _("{B_DEF_NAME_WITH_PREFIX} was prevented\nfrom healing!"); +static const u8 sText_TerrainBecomesMisty[] = _("Mist swirled about\nthe battlefield!"); +static const u8 sText_TerrainBecomesGrassy[] = _("Grass grew to cover\nthe battlefield!"); +static const u8 sText_TerrainBecomesElectric[] = _("An electric current runs across\nthe battlefield!"); +static const u8 sText_TerrainBecomesPsychic[] = _("The battlefield got weird!"); +static const u8 sText_DimensionsWereTwisted[] = _("The dimensions were\ntwisted!"); +static const u8 sText_BizzareAreaCreated[] =_("A bizarre area was created in which the\nDefense and Sp. Def stats are swapped!"); +static const u8 sText_BizarreArenaCreated[] =_("A bizarre area was created!\nHold items lost their effects!"); +static const u8 sText_TailWindBlew[] = _("The tailwind blew from\nbehind {B_ATK_TEAM2} team!"); +static const u8 sText_ElectricTerrainEnds[] = _("The electricity disappeared\nfrom the battlefield."); +static const u8 sText_MistyTerrainEnds[] = _("The mist disappeared\nfrom the battlefield."); +static const u8 sText_PsychicTerrainEnds[] = _("The weirdness disappeared\nfrom the battlefield."); +static const u8 sText_GrassyTerrainEnds[] = _("The grass disappeared\nfrom the battlefield."); +static const u8 sText_MoldBreakerEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} breaks the mold!"); +static const u8 sText_TeravoltEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na bursting aura!"); +static const u8 sText_TurboblazeEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na blazing aura!"); +static const u8 sText_SlowStartEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} can't get it going!"); +static const u8 sText_UnnerveEnters[] = _("The opposing team is too nervous\nto eat Berries!"); +static const u8 sText_AnticipationActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shuddered\nin anticipation!"); +static const u8 sText_ForewarnActivates[] = _("{B_SCR_ACTIVE_ABILITY} alerted {B_SCR_ACTIVE_NAME_WITH_PREFIX}\nto {B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}!"); +static const u8 sText_PressureActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is exerting its\npressure!"); +static const u8 sText_DarkAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na dark aura!"); +static const u8 sText_FairyAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na fairy aura!"); +static const u8 sText_AuraBreakActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} reversed all\nother Pokémon's auras!"); +static const u8 sText_ComatoseActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is drowsing!"); +static const u8 sText_ScreenCleanerActivates[] = _("All screens on the field were\ncleansed!"); +static const u8 sText_AsOneEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} has two Abilities!"); +static const u8 sText_CuriousMedicineEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s\nstat changes were reset!"); +static const u8 sText_PastelVeilEnters[] = _("{B_DEF_NAME_WITH_PREFIX} was cured\nof its poisoning!"); +static const u8 sText_NeutralizingGasEnters[] = _("Neutralizing Gas filled the area!"); +static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_DEF_NAME_WITH_PREFIX} with power!"); +static const u8 sText_ImposterTransform[] = _("{B_ATK_NAME_WITH_PREFIX} transformed into\n{B_DEF_NAME_WITH_PREFIX} using {B_LAST_ABILITY}!"); +static const u8 sText_SnowWarningHail[] = _("It started to hail!"); +static const u8 sText_SnowWarningSnow[] = _("It started to snow!"); +static const u8 sText_SupersweetAromaWafts[] = _("A supersweet aroma is wafting from\nthe syrup covering {B_ATK_NAME_WITH_PREFIX}!"); +static const u8 sText_AirLockActivates[] = _("The effects of weather\ndisappeared."); +static const u8 sText_BattlerAbilityRaisedStat[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nraised its {B_BUFF1}!"); +static const u8 sText_ExtremelyHarshSunlight[] = _("The sunlight turned\nextremely harsh!"); +static const u8 sText_HeavyRain[] = _("A heavy rain began to fall!"); +static const u8 sText_MysteriousAirCurrent[] = _("A mysterious air current is\nprotecting Flying-type Pokémon!"); +static const u8 sText_AbilityWeakenedSurroundingMonsStat[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nweakened the {B_BUFF1} of\lall surrounding Pokémon!\p"); +static const u8 sText_AttackerGainedStrengthFromTheFallen[] = _("{B_ATK_NAME_WITH_PREFIX} gained strength\nfrom the fallen!"); +static const u8 sText_ZeroToHeroTransformation[] = _("{B_ATK_NAME_WITH_PREFIX} underwent a heroic\ntransformation!"); +static const u8 sText_HospitalityRestoration[] = _("{B_ATK_PARTNER_NAME} drank down all the\nmatcha that {B_ATK_NAME_WITH_PREFIX} made!"); +static const u8 sText_HarvestBerry[] = _("{B_ATK_NAME_WITH_PREFIX} harvested\nits {B_LAST_ITEM}!"); +static const u8 sText_BadDreamsDmg[] = _("{B_DEF_NAME_WITH_PREFIX} is tormented!"); +static const u8 sText_SolarPowerHpDrop[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\ntakes its toll!"); +static const u8 sText_HealerCure[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}\ncured {B_SCR_ACTIVE_NAME_WITH_PREFIX}'s problem!"); +static const u8 sText_FetchedPokeBall[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} found\na {B_LAST_ITEM}!"); +static const u8 sText_TargetAbilityLoweredStat[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\nlowered its {B_BUFF1}!"); +static const u8 sText_TargetStatWontGoHigher[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwon't go higher!"); +static const u8 sText_TargetAbilityRaisedStat[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\nraised its {B_BUFF1}!"); +static const u8 sText_CursedBodyDisabled[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1} was disabled\nby {B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}!"); +static const u8 sText_AttackerAquiredAbility[] = _("{B_ATK_NAME_WITH_PREFIX} acquired\n{B_LAST_ABILITY}!"); +static const u8 sText_SwappedAbilities[] = _("{B_DEF_NAME_WITH_PREFIX} swapped Abilities\nwith its target!"); +static const u8 sText_TargetsStatWasMaxedOut[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY} maxed\nits {B_BUFF1}!"); +static const u8 sText_PkmnsAbilityPreventsAbility[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!"); +static const u8 sText_AftermathDmg[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt!"); +static const u8 sText_IllusionWoreOff[] = _("{B_DEF_NAME_WITH_PREFIX}'s Illusion wore off!"); +static const u8 sText_ASandstormKickedUp[] = _("A sandstorm kicked up!"); +static const u8 sText_PkmnsWillPerishIn3Turns[] = _("Both Pokémon will perish\nin three turns!"); +static const u8 sText_PoisonSpikesScattered[] = _("Poison Spikes were scattered all\naround {B_DEF_TEAM2} team's feet!"); +static const u8 sText_OpportunistCopied[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} copied its\nopponent's stat changes!"); +static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); +static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!"); +static const u8 sText_SunlightActivatedAbility[] = _("The harsh sunlight activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); +static const u8 sText_StatWasHeightened[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_BUFF1} was heightened!"); +static const u8 sText_BattlerTypeChangedTo[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s type\nchanged to {B_BUFF1}!"); +static const u8 sText_ElectricTerrainActivatedAbility[] = _("The Electric Terrain activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); +static const u8 sText_FriskActivates[] = _("{B_ATK_NAME_WITH_PREFIX} frisked {B_DEF_NAME_WITH_PREFIX} and\nfound its {B_LAST_ITEM}!"); +static const u8 sText_AttackerAbilityRaisedStat[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nraised its {B_BUFF1}!"); +static const u8 sText_ExtremelyHarshSunlightWasNotLessened[] = _("The extremely harsh sunlight\nwas not lessened at all!"); +static const u8 sText_NoReliefFromHeavyRain[] = _("There is no relief from\nthis heavy rain!"); +static const u8 sText_MysteriousAirCurrentBlowsOn[] = _("The mysterious air current\nblows on regardless!"); +static const u8 sText_AuraFlaredToLife[] = _("{B_DEF_NAME_WITH_PREFIX}'s aura flared to life!"); +static const u8 sText_AttackerGotOverInfatuation[] =_("{B_ATK_NAME_WITH_PREFIX} got over\nits infatuation!"); +static const u8 sText_TormentedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is\ntormented no more!"); +static const u8 sText_BufferEnds[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\nwore off!"); +static const u8 sText_HealBlockedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is cured of\nits heal block!"); +static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!"); +static const u8 sText_MirrorHerbCopied[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} used its {B_LAST_ITEM}\nto mirror its opponent's stat changes!"); +static const u8 sText_PkmnsItemHealedFrostbite[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nhealed its frostbite!"); +static const u8 sText_AirBalloonFloat[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} floats in the air\nwith its {B_LAST_ITEM}!"); +static const u8 sText_EjectButtonActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is switched\nout with the {B_LAST_ITEM}!"); +static const u8 sText_HurtByItem[] = _("{B_ATK_NAME_WITH_PREFIX} was hurt\nby its {B_LAST_ITEM}!"); +static const u8 sText_AirBalloonPop[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM} popped!"); +static const u8 sText_StickyBarbTransfer[] = _("The {B_LAST_ITEM} attached itself to\n{B_ATK_NAME_WITH_PREFIX}!"); +static const u8 sText_TeamGainedEXP[] = _("The rest of your team gained EXP.\nPoints thanks to the {B_LAST_ITEM}!\p"); +static const u8 sText_PkmnFrostbiteHealed[] = _("{B_DEF_NAME_WITH_PREFIX}'s\nfrostbite was healed!"); +static const u8 sText_StockpiledEffectWoreOff[] = _("{B_ATK_NAME_WITH_PREFIX}'s stockpiled\neffect wore off!"); +static const u8 sText_FellStraightDown[] =_("{B_DEF_NAME_WITH_PREFIX} fell\nstraight down!"); +static const u8 sText_TargetWokeUp[] = _("{B_DEF_NAME_WITH_PREFIX} woke up!"); +static const u8 sText_PkmnBurnHealed[] = _("{B_DEF_NAME_WITH_PREFIX}'s\nburn was healed."); +static const u8 sText_RedCardActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} held up its {B_LAST_ITEM}\nagainst {B_ATK_NAME_WITH_PREFIX}!"); +static const u8 sText_MoveBlockedByDynamax[] = _("The move was blocked by\nthe power of Dynamax!"); +static const u8 sText_ItemCannotBeRemoved[] = _("{B_ATK_NAME_WITH_PREFIX}'s item cannot be removed!"); +static const u8 sText_ZMoveResetsStats[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} returned its\ndecreased stats to normal using\lits Z-Power!"); +static const u8 sText_ZMoveBoostCrit[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted its\ncritical-hit ratio using its Z-Power!"); +static const u8 sText_ZMoveRestoreHp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} restored its\nHP using its Z-Power!"); +static const u8 sText_ZMoveStatUp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted\nits stats using its Z-Power!"); +static const u8 sText_ZMoveHpSwitchInTrap[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s HP was restored by the Z-Power!"); +static const u8 sText_ZMoveAllStatsUp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted all\nof its stats using its Z-Power!"); +static const u8 sText_PkmnRevertedToPrimal[] = _("{B_ATK_NAME_WITH_PREFIX}'s Primal Reversion!\nIt reverted to its primal form!"); +static const u8 sText_HealingWishHealed[] = _("{B_ATK_NAME_WITH_PREFIX} regained health!"); +static const u8 sText_ToxicSpikesAbsorbed[] = _("The poison spikes disappeared\nfrom around {B_DEF_TEAM2} team's feet!"); +static const u8 sText_ToxicSpikesPoisoned[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} was poisoned!"); +static const u8 sText_StickyWebSwitchIn[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} was\ncaught in a Sticky Web!"); +static const u8 sText_HealingWishCameTrue[] = _("The healing wish came true\nfor {B_ATK_NAME_WITH_PREFIX}!"); +static const u8 sText_LunarDanceCameTrue[] = _("{B_ATK_NAME_WITH_PREFIX} became cloaked\nin mystical moonlight!"); +static const u8 sText_SpikesDisappearedFromTeam[] = _("The spikes disappeared from\nthe ground around {B_ATK_TEAM2} team!"); +static const u8 sText_ToxicSpikesDisappearedFromTeam[] = _("The poison spikes disappeared from\nthe ground around {B_ATK_TEAM2} team!"); +static const u8 sText_StickyWebDisappearedFromTeam[] = _("The sticky web has disappeared from\nthe ground around {B_ATK_TEAM2} team!"); +static const u8 sText_StealthRockDisappearedFromTeam[] = _("The pointed stones disappeared\nfrom around {B_ATK_TEAM2} team!"); +static const u8 sText_SharpSteelDisappearedFromTeam[] = _("The sharp steel disappeared from\nthe ground around {B_ATK_TEAM2} team!"); +static const u8 sText_LastAbilityRaisedBuff1[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}\nraised its {B_BUFF1}!"); +static const u8 sText_ReceiverAbilityTakeOver[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nwas taken over!"); +static const u8 sText_NeutralizingGasOver[] = _("The effects of Neutralizing\nGas wore off!"); +static const u8 sText_AttackerBecameFullyCharged[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its bond with its trainer!\p"); +static const u8 sText_AttackerBecameAshSpecies[] = _("{B_ATK_NAME_WITH_PREFIX} became Ash-{B_BUFF1}!\p"); +static const u8 sText_ProtectedTeam[] =_("{B_CURRENT_MOVE} protected\n{B_ATK_TEAM2} team!"); +static const u8 sText_ElectricTerrainPreventsSleep[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith electrified terrain!"); +static const u8 sText_MistyTerrainPreventsStatus[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith a protective mist!"); +static const u8 sText_PsychicTerrainPreventsPriority[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith psychic terrain!"); +static const u8 sText_FlowerVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of petals!"); +static const u8 sText_drastically[] = _("drastically "); +static const u8 sText_severely[] = _("severely "); +static const u8 sText_ClearAmuletWontLowerStats[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM} prevents\nits stats from being lowered!"); +static const u8 sText_CelebrateMessage[] = _("Congratulations, {B_PLAYER_NAME}!"); +static const u8 sText_PkmnBlewAwayToxicSpikes[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nToxic Spikes!"); +static const u8 sText_PkmnBlewAwayStickyWeb[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSticky Web!"); +static const u8 sText_PkmnBlewAwayStealthRock[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nStealth Rock!"); +static const u8 sText_PkmnBlewAwaySharpSteel[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nsharp steel!"); +static const u8 sText_PkmnGotFrostbite[] = _("{B_EFF_NAME_WITH_PREFIX} got frostbite!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_START] = { @@ -906,6 +1081,288 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_ST [STRINGID_ITEMRESTOREDSPECIESHEALTH - BATTLESTRINGS_TABLE_START] = sText_ItemRestoredSpeciesHealth, [STRINGID_ITEMRESTOREDSPECIESPP - BATTLESTRINGS_TABLE_START] = sText_ItemRestoredSpeciesPP, [STRINGID_ITEMCUREDSPECIESSTATUS - BATTLESTRINGS_TABLE_START] = sText_ItemCuredSpeciesStatus, + [STRINGID_ELECTROSHOTCHARGING - BATTLESTRINGS_TABLE_START] = sText_ElectroShotCharging, + [STRINGID_METEORBEAMCHARGING - BATTLESTRINGS_TABLE_START] = sText_MeteorBeamCharging, + [STRINGID_CLOAKEDINAHARSHLIGHT - BATTLESTRINGS_TABLE_START] = sText_PkmnIsCloakedInAHarshLight, + [STRINGID_VANISHEDINSTANTLY - BATTLESTRINGS_TABLE_START] = sText_VanishedInstantly, + [STRINGID_PKMNTOOKTARGETHIGH - BATTLESTRINGS_TABLE_START] = sText_PkmnTookTargetHigh, + [STRINGID_CLOAKEDINAFREEZINGLIGHT - BATTLESTRINGS_TABLE_START] = sText_CloakedInAFreezingLight, + [STRINGID_PKNMABSORBINGPOWER - BATTLESTRINGS_TABLE_START] = sText_PkmnAbsorbingPower, + [STRINGID_POKEMONCANNOTUSEMOVE - BATTLESTRINGS_TABLE_START] = sText_PokemonCannotUseMove, + [STRINGID_PKMNMOVEBOUNCEDABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnMoveBouncedViaAbility, + [STRINGID_HEALBLOCKPREVENTSUSAGE - BATTLESTRINGS_TABLE_START] = sText_HealBlockPreventsUsage, + [STRINGID_GRAVITYPREVENTSUSAGE - BATTLESTRINGS_TABLE_START] = sText_GravityPreventsUsage, + [STRINGID_PKMNFROSTBITEHEALED2 - BATTLESTRINGS_TABLE_START] = sText_PkmnFrostbiteHealed2, + [STRINGID_PKMNFROSTBITEHEALEDBY - BATTLESTRINGS_TABLE_START] = sText_PkmnFrostbiteHealedBy, + [STRINGID_SAFETYGOGGLESPROTECTED - BATTLESTRINGS_TABLE_START] = sText_SafetyGogglesProtected, + [STRINGID_POWDEREXPLODES - BATTLESTRINGS_TABLE_START] = sText_PowderExplodes, + [STRINGID_PKMNCANTUSEMOVETHROATCHOP - BATTLESTRINGS_TABLE_START] = sText_PkmnCantUseMoveThroatChop, + [STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN - BATTLESTRINGS_TABLE_START] = sText_MoveFizzledOutInTheHeavyRain, + [STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT - BATTLESTRINGS_TABLE_START] = sText_MoveEvaporatedInTheHarshSunlight, + [STRINGID_TARGETATEITEM - BATTLESTRINGS_TABLE_START] = sText_TargetAteItem, + [STRINGID_GEMACTIVATES - BATTLESTRINGS_TABLE_START] = sText_GemActivates, + [STRINGID_ATTACKWEAKENEDBSTRONGWINDS - BATTLESTRINGS_TABLE_START] = sText_AttackWeakenedByStrongWinds, + [STRINGID_ENDUREDSTURDY - BATTLESTRINGS_TABLE_START] = sText_EnduredViaSturdy, + [STRINGID_BERRYDMGREDUCES - BATTLESTRINGS_TABLE_START] = sText_BerryDmgReducing, + [STRINGID_TARGETTOUGHEDITOUT - BATTLESTRINGS_TABLE_START] = sText_TargetToughedItOut, + [STRINGID_TRAPPEDBYSWIRLINGMAGMA - BATTLESTRINGS_TABLE_START] = sText_TrappedBySwirlingMagma, + [STRINGID_INFESTATION - BATTLESTRINGS_TABLE_START] = sText_Infestation, + [STRINGID_PKMNINSNAPTRAP - BATTLESTRINGS_TABLE_START] = sText_PkmnInSnapTrap, + [STRINGID_THUNDERCAGETRAPPED - BATTLESTRINGS_TABLE_START] = sText_AtkTrappedDef, + [STRINGID_RESETSTARGETSSTATLEVELS - BATTLESTRINGS_TABLE_START] = sText_ResetsTargetsStatLevels, + [STRINGID_STRONGWINDSDISSIPATED - BATTLESTRINGS_TABLE_START] = sText_StrongWindsDissipated, + [STRINGID_EXTREMESUNLIGHTFADED - BATTLESTRINGS_TABLE_START] = sText_ExtremeSunlightFaded, + [STRINGID_HEAVYRAINLIFTED - BATTLESTRINGS_TABLE_START] = sText_HeavyRainLifted, + [STRINGID_SYMBIOSISITEMPASS - BATTLESTRINGS_TABLE_START] = sText_SymbiosisItemPass, + [STRINGID_BURSTINGFLAMESHIT - BATTLESTRINGS_TABLE_START] = sText_BurstingFlames, + [STRINGID_BROKETHROUGHPROTECTION - BATTLESTRINGS_TABLE_START] = sText_BrokeThroughProtection, + [STRINGID_FELLFORFEINT - BATTLESTRINGS_TABLE_START] = sText_FellForFeint, + [STRINGID_SPECTRALTHIEFSTEAL - BATTLESTRINGS_TABLE_START] = sText_SpectralThiefSteal, + [STRINGID_PKMNSABILITYSUPPRESSED - BATTLESTRINGS_TABLE_START] = sText_PkmnsAbilitySuppressed, + [STRINGID_INCINERATEBURN - BATTLESTRINGS_TABLE_START] = sText_IncinerateBurn, + [STRINGID_BUGBITE - BATTLESTRINGS_TABLE_START] = sText_BugBite, + [STRINGID_BOTHCANNOLONGERESCAPE - BATTLESTRINGS_TABLE_START] = sText_BothCanNoLongerEscape, + [STRINGID_ATTACKERLOSTFIRETYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostFireType, + [STRINGID_ATTACKERLOSTELECTRICTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostElectricType, + [STRINGID_ATTACKERLOSTITSTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostItsType, + [STRINGID_STEALTHROCKDMG - BATTLESTRINGS_TABLE_START] = sText_StealthRockDmg, + [STRINGID_SHARPSTEELDMG - BATTLESTRINGS_TABLE_START] = sText_SharpSteelDmg, + [STRINGID_POINTEDSTONESFLOAT - BATTLESTRINGS_TABLE_START] = sText_PointedStonesFloat, + [STRINGID_SHARPSTEELFLOATS - BATTLESTRINGS_TABLE_START] = sText_SharpSteelFloats, + [STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP - BATTLESTRINGS_TABLE_START] = sText_TargetCoveredInStickyCandySyrup, + [STRINGID_AROMAVEILPROTECTED - BATTLESTRINGS_TABLE_START] = sText_AromaVeilProtected, + [STRINGID_PKMNPREVENTEDFROMHEALING - BATTLESTRINGS_TABLE_START] = sText_PkmnPreventedFromHealing, + [STRINGID_TERRAINBECOMESMISTY - BATTLESTRINGS_TABLE_START] = sText_TerrainBecomesMisty, + [STRINGID_TERRAINBECOMESGRASSY - BATTLESTRINGS_TABLE_START] = sText_TerrainBecomesGrassy, + [STRINGID_TERRAINBECOMESELECTRIC - BATTLESTRINGS_TABLE_START] = sText_TerrainBecomesElectric, + [STRINGID_TERRAINBECOMESPSYCHIC - BATTLESTRINGS_TABLE_START] = sText_TerrainBecomesPsychic, + [STRINGID_DIMENSIONSWERETWISTED - BATTLESTRINGS_TABLE_START] = sText_DimensionsWereTwisted, + [STRINGID_BIZARREAREACREATED - BATTLESTRINGS_TABLE_START] = sText_BizzareAreaCreated, + [STRINGID_BIZARREARENACREATED - BATTLESTRINGS_TABLE_START] = sText_BizarreArenaCreated, + [STRINGID_TAILWINDBLEW - BATTLESTRINGS_TABLE_START] = sText_TailWindBlew, + [STRINGID_ELECTRICTERRAINENDS - BATTLESTRINGS_TABLE_START] = sText_ElectricTerrainEnds, + [STRINGID_MISTYTERRAINENDS - BATTLESTRINGS_TABLE_START] = sText_MistyTerrainEnds, + [STRINGID_PSYCHICTERRAINENDS - BATTLESTRINGS_TABLE_START] = sText_PsychicTerrainEnds, + [STRINGID_GRASSYTERRAINENDS - BATTLESTRINGS_TABLE_START] = sText_GrassyTerrainEnds, + [STRINGID_MOLDBREAKERENTERS - BATTLESTRINGS_TABLE_START] = sText_MoldBreakerEnters, + [STRINGID_TERAVOLTENTERS - BATTLESTRINGS_TABLE_START] = sText_TeravoltEnters, + [STRINGID_TURBOBLAZEENTERS - BATTLESTRINGS_TABLE_START] = sText_TurboblazeEnters, + [STRINGID_SLOWSTARTENTERS - BATTLESTRINGS_TABLE_START] = sText_SlowStartEnters, + [STRINGID_UNNERVEENTERS - BATTLESTRINGS_TABLE_START] = sText_UnnerveEnters, + [STRINGID_ANTICIPATIONACTIVATES - BATTLESTRINGS_TABLE_START] = sText_AnticipationActivates, + [STRINGID_FOREWARNACTIVATES - BATTLESTRINGS_TABLE_START] = sText_ForewarnActivates, + [STRINGID_PRESSUREENTERS - BATTLESTRINGS_TABLE_START] = sText_PressureActivates, + [STRINGID_DARKAURAENTERS - BATTLESTRINGS_TABLE_START] = sText_DarkAuraActivates, + [STRINGID_FAIRYAURAENTERS - BATTLESTRINGS_TABLE_START] = sText_FairyAuraActivates, + [STRINGID_AURABREAKENTERS - BATTLESTRINGS_TABLE_START] = sText_AuraBreakActivates, + [STRINGID_COMATOSEENTERS - BATTLESTRINGS_TABLE_START] = sText_ComatoseActivates, + [STRINGID_SCREENCLEANERENTERS - BATTLESTRINGS_TABLE_START] = sText_ScreenCleanerActivates, + [STRINGID_ASONEENTERS - BATTLESTRINGS_TABLE_START] = sText_AsOneEnters, + [STRINGID_CURIOUSMEDICINEENTERS - BATTLESTRINGS_TABLE_START] = sText_CuriousMedicineEnters, + [STRINGID_PASTELVEILENTERS - BATTLESTRINGS_TABLE_START] = sText_PastelVeilEnters, + [STRINGID_NEUTRALIZINGGASENTERS - BATTLESTRINGS_TABLE_START] = sText_NeutralizingGasEnters, + [STRINGID_BEINGHITCHARGEDPKMNWITHPOWER - BATTLESTRINGS_TABLE_START] = sText_BeingHitChargedPkmnWithPower, + [STRINGID_IMPOSTERTRANSFORM - BATTLESTRINGS_TABLE_START] = sText_ImposterTransform, + [STRINGID_SNOWWARNINGHAIL - BATTLESTRINGS_TABLE_START] = sText_SnowWarningHail, + [STRINGID_SNOWWARNINGSNOW - BATTLESTRINGS_TABLE_START] = sText_SnowWarningSnow, + [STRINGID_SUPERSWEETAROMAWAFTS - BATTLESTRINGS_TABLE_START] = sText_SupersweetAromaWafts, + [STRINGID_AIRLOCKACTIVATES - BATTLESTRINGS_TABLE_START] = sText_AirLockActivates, + [STRINGID_BATTLERABILITYRAISEDSTAT - BATTLESTRINGS_TABLE_START] = sText_BattlerAbilityRaisedStat, + [STRINGID_EXTREMELYHARSHSUNLIGHT - BATTLESTRINGS_TABLE_START] = sText_ExtremelyHarshSunlight, + [STRINGID_HEAVYRAIN - BATTLESTRINGS_TABLE_START] = sText_HeavyRain, + [STRINGID_MYSTERIOUSAIRCURRENT - BATTLESTRINGS_TABLE_START] = sText_MysteriousAirCurrent, + [STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT - BATTLESTRINGS_TABLE_START] = sText_AbilityWeakenedSurroundingMonsStat, + [STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN - BATTLESTRINGS_TABLE_START] = sText_AttackerGainedStrengthFromTheFallen, + [STRINGID_ZEROTOHEROTRANSFORMATION - BATTLESTRINGS_TABLE_START] = sText_ZeroToHeroTransformation, + [STRINGID_HOSPITALITYRESTORATION - BATTLESTRINGS_TABLE_START] = sText_HospitalityRestoration, + [STRINGID_HARVESTBERRY - BATTLESTRINGS_TABLE_START] = sText_HarvestBerry, + [STRINGID_BADDREAMSDMG - BATTLESTRINGS_TABLE_START] = sText_BadDreamsDmg, + [STRINGID_SOLARPOWERHPDROP - BATTLESTRINGS_TABLE_START] = sText_SolarPowerHpDrop, + [STRINGID_HEALERCURE - BATTLESTRINGS_TABLE_START] = sText_HealerCure, + [STRINGID_FETCHEDPOKEBALL - BATTLESTRINGS_TABLE_START] = sText_FetchedPokeBall, + [STRINGID_TARGETABILITYSTATLOWER - BATTLESTRINGS_TABLE_START] = sText_TargetAbilityLoweredStat, + [STRINGID_TARGETSTATWONTGOHIGHER - BATTLESTRINGS_TABLE_START] = sText_TargetStatWontGoHigher, + [STRINGID_TARGETABILITYSTATRAISE - BATTLESTRINGS_TABLE_START] = sText_TargetAbilityRaisedStat, + [STRINGID_CUSEDBODYDISABLED - BATTLESTRINGS_TABLE_START] = sText_CursedBodyDisabled, + [STRINGID_ATTACKERACQUIREDABILITY - BATTLESTRINGS_TABLE_START] = sText_AttackerAquiredAbility, + [STRINGID_SWAPPEDABILITIES - BATTLESTRINGS_TABLE_START] = sText_SwappedAbilities, + [STRINGID_TARGETSSTATWASMAXEDOUT - BATTLESTRINGS_TABLE_START] = sText_TargetsStatWasMaxedOut, + [STRINGID_PKMNSABILITYPREVENTSABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnsAbilityPreventsAbility, + [STRINGID_AFTERMATHDMG - BATTLESTRINGS_TABLE_START] = sText_AftermathDmg, + [STRINGID_ILLUSIONWOREOFF - BATTLESTRINGS_TABLE_START] = sText_IllusionWoreOff, + [STRINGID_ASANDSTORMKICKEDUP - BATTLESTRINGS_TABLE_START] = sText_ASandstormKickedUp, + [STRINGID_PKMNSWILLPERISHIN3TURNS - BATTLESTRINGS_TABLE_START] = sText_PkmnsWillPerishIn3Turns, + [STRINGID_POISONSPIKESSCATTERED - BATTLESTRINGS_TABLE_START] = sText_PoisonSpikesScattered, + [STRINGID_OPPORTUNISTCOPIED - BATTLESTRINGS_TABLE_START] = sText_OpportunistCopied, + [STRINGID_PKMNGOTOVERITSINFATUATION - BATTLESTRINGS_TABLE_START] = sText_PkmnGotOverItsInfatuation, + [STRINGID_PKMNSHOOKOFFTHETAUNT - BATTLESTRINGS_TABLE_START] = sText_PkmnShookOffTheTaunt, + [STRINGID_SUNLIGHTACTIVATEDABILITY - BATTLESTRINGS_TABLE_START] = sText_SunlightActivatedAbility, + [STRINGID_STATWASHEIGHTENED - BATTLESTRINGS_TABLE_START] = sText_StatWasHeightened, + [STRINGID_BATTLERTYPECHANGEDTO - BATTLESTRINGS_TABLE_START] = sText_BattlerTypeChangedTo, + [STRINGID_ELECTRICTERRAINACTIVATEDABILITY - BATTLESTRINGS_TABLE_START] = sText_ElectricTerrainActivatedAbility, + [STRINGID_FRISKACTIVATES - BATTLESTRINGS_TABLE_START] = sText_FriskActivates, + [STRINGID_ATTACKERABILITYSTATRAISE - BATTLESTRINGS_TABLE_START] = sText_AttackerAbilityRaisedStat, + [STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED - BATTLESTRINGS_TABLE_START] = sText_ExtremelyHarshSunlightWasNotLessened, + [STRINGID_NORELIEFROMHEAVYRAIN - BATTLESTRINGS_TABLE_START] = sText_NoReliefFromHeavyRain, + [STRINGID_MYSTERIOUSAIRCURRENTBLOWSON - BATTLESTRINGS_TABLE_START] = sText_MysteriousAirCurrentBlowsOn, + [STRINGID_AURAFLAREDTOLIFE - BATTLESTRINGS_TABLE_START] = sText_AuraFlaredToLife, + [STRINGID_ATKGOTOVERINFATUATION - BATTLESTRINGS_TABLE_START] = sText_AttackerGotOverInfatuation, + [STRINGID_TORMENTEDNOMORE - BATTLESTRINGS_TABLE_START] = sText_TormentedNoMore, + [STRINGID_BUFFERENDS - BATTLESTRINGS_TABLE_START] = sText_BufferEnds, + [STRINGID_HEALBLOCKEDNOMORE - BATTLESTRINGS_TABLE_START] = sText_HealBlockedNoMore, + [STRINGID_MICLEBERRYACTIVATES - BATTLESTRINGS_TABLE_START] = sText_MicleBerryActivates, + [STRINGID_MIRRORHERBCOPIED - BATTLESTRINGS_TABLE_START] = sText_MirrorHerbCopied, + [STRINGID_PKMNSITEMHEALEDFROSTBITE - BATTLESTRINGS_TABLE_START] = sText_PkmnsItemHealedFrostbite, + [STRINGID_AIRBALLOONFLOAT - BATTLESTRINGS_TABLE_START] = sText_AirBalloonFloat, + [STRINGID_EJECTBUTTONACTIVATE - BATTLESTRINGS_TABLE_START] = sText_EjectButtonActivate, + [STRINGID_HURTBYITEM - BATTLESTRINGS_TABLE_START] = sText_HurtByItem, + [STRINGID_AIRBALLOONPOP - BATTLESTRINGS_TABLE_START] = sText_AirBalloonPop, + [STRINGID_STICKYBARBTRANSFER - BATTLESTRINGS_TABLE_START] = sText_StickyBarbTransfer, + [STRINGID_TEAMGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_TeamGainedEXP, + [STRINGID_PKMNFROSTBITEHEALED - BATTLESTRINGS_TABLE_START] = sText_PkmnFrostbiteHealed, + [STRINGID_STOCKPILEDEFFECTWOREOFF - BATTLESTRINGS_TABLE_START] = sText_StockpiledEffectWoreOff, + [STRINGID_FELLSTRAIGHTDOWN - BATTLESTRINGS_TABLE_START] = sText_FellStraightDown, + [STRINGID_TARGETWOKEUP - BATTLESTRINGS_TABLE_START] = sText_TargetWokeUp, + [STRINGID_PKMNBURNHEALED - BATTLESTRINGS_TABLE_START] = sText_PkmnBurnHealed, + [STRINGID_REDCARDACTIVATE - BATTLESTRINGS_TABLE_START] = sText_RedCardActivate, + [STRINGID_MOVEBLOCKEDBYDYNAMAX - BATTLESTRINGS_TABLE_START] = sText_MoveBlockedByDynamax, + [STRINGID_ITEMCANNOTBEREMOVED - BATTLESTRINGS_TABLE_START] = sText_ItemCannotBeRemoved, + [STRINGID_ZMOVERESETSSTATS - BATTLESTRINGS_TABLE_START] = sText_ZMoveResetsStats, + [STRINGID_ZMOVEZBOOSTCRIT - BATTLESTRINGS_TABLE_START] = sText_ZMoveBoostCrit, + [STRINGID_ZMOVERESTOREHP - BATTLESTRINGS_TABLE_START] = sText_ZMoveRestoreHp, + [STRINGID_ZMOVESTATUP - BATTLESTRINGS_TABLE_START] = sText_ZMoveStatUp, + [STRINGID_ZMOVEHPTRAP - BATTLESTRINGS_TABLE_START] = sText_ZMoveHpSwitchInTrap, + [STRINGID_ZMOVEALLSTATSUP - BATTLESTRINGS_TABLE_START] = sText_ZMoveAllStatsUp, + [STRINGID_PKMNREVERTEDTOPRIMAL - BATTLESTRINGS_TABLE_START] = sText_PkmnRevertedToPrimal, + [STRINGID_HEALINGWISHHEALED - BATTLESTRINGS_TABLE_START] = sText_HealingWishHealed, + [STRINGID_TOXICSPIKESABSORBED - BATTLESTRINGS_TABLE_START] = sText_ToxicSpikesAbsorbed, + [STRINGID_TOXICSPIKESPOISONED - BATTLESTRINGS_TABLE_START] = sText_ToxicSpikesPoisoned, + [STRINGID_STICKYWEBSWITCHIN - BATTLESTRINGS_TABLE_START] = sText_StickyWebSwitchIn, + [STRINGID_HEALINGWISHCAMETRUE - BATTLESTRINGS_TABLE_START] = sText_HealingWishCameTrue, + [STRINGID_LUNARDANCECAMETRUE - BATTLESTRINGS_TABLE_START] = sText_LunarDanceCameTrue, + [STRINGID_SPIKESDISAPPEAREDFROMTEAM - BATTLESTRINGS_TABLE_START] = sText_SpikesDisappearedFromTeam, + [STRINGID_TOXICSPIKESDISAPPEAREDFROMTEAM - BATTLESTRINGS_TABLE_START] = sText_ToxicSpikesDisappearedFromTeam, + [STRINGID_STICKYWEBDISAPPEAREDFROMTEAM - BATTLESTRINGS_TABLE_START] = sText_StickyWebDisappearedFromTeam, + [STRINGID_STEALTHROCKDISAPPEAREDFROMTEAM - BATTLESTRINGS_TABLE_START] = sText_StealthRockDisappearedFromTeam, + [STRINGID_SHARPSTEELDISAPPEAREDFROMTEAM - BATTLESTRINGS_TABLE_START] = sText_SharpSteelDisappearedFromTeam, + [STRINGID_LASTABILITYRAISEDSTAT - BATTLESTRINGS_TABLE_START] = sText_LastAbilityRaisedBuff1, + [STRINGID_RECEIVERABILITYTAKEOVER - BATTLESTRINGS_TABLE_START] = sText_ReceiverAbilityTakeOver, + [STRINGID_NEUTRALIZINGGASOVER - BATTLESTRINGS_TABLE_START] = sText_NeutralizingGasOver, + [STRINGID_ATTACKERBECAMEFULLYCHARGED - BATTLESTRINGS_TABLE_START] = sText_AttackerBecameFullyCharged, + [STRINGID_ATTACKERBECAMEASHSPECIES - BATTLESTRINGS_TABLE_START] = sText_AttackerBecameAshSpecies, + [STRINGID_PROTECTEDTEAM - BATTLESTRINGS_TABLE_START] = sText_ProtectedTeam, + [STRINGID_ELECTRICTERRAINPREVENTS - BATTLESTRINGS_TABLE_START] = sText_ElectricTerrainPreventsSleep, + [STRINGID_MISTYTERRAINPREVENTS - BATTLESTRINGS_TABLE_START] = sText_MistyTerrainPreventsStatus, + [STRINGID_PSYCHICTERRAINPREVENTS - BATTLESTRINGS_TABLE_START] = sText_PsychicTerrainPreventsPriority, + [STRINGID_FLOWERVEILPROTECTED - BATTLESTRINGS_TABLE_START] = sText_FlowerVeilProtected, + [STRINGID_DRASTICALLY - BATTLESTRINGS_TABLE_START] = sText_drastically, + [STRINGID_SEVERELY - BATTLESTRINGS_TABLE_START] = sText_severely, + [STRINGID_CLEARAMULETWONTLOWERSTATS - BATTLESTRINGS_TABLE_START] = sText_ClearAmuletWontLowerStats, + [STRINGID_CELEBRATEMESSAGE - BATTLESTRINGS_TABLE_START] = sText_CelebrateMessage, + [STRINGID_PKMNBLEWAWAYTOXICSPIKES - BATTLESTRINGS_TABLE_START] = sText_PkmnBlewAwayToxicSpikes, + [STRINGID_PKMNBLEWAWAYSTICKYWEB - BATTLESTRINGS_TABLE_START] = sText_PkmnBlewAwayStickyWeb, + [STRINGID_PKMNBLEWAWAYSTEALTHROCK - BATTLESTRINGS_TABLE_START] = sText_PkmnBlewAwayStealthRock, + [STRINGID_PKMNBLEWAWAYSHARPSTEEL - BATTLESTRINGS_TABLE_START] = sText_PkmnBlewAwaySharpSteel, + [STRINGID_PKMNGOTFROSTBITE - BATTLESTRINGS_TABLE_START] = sText_PkmnGotFrostbite, +}; + +const u16 gTrainerUsedItemStringIds[] = +{ + STRINGID_PLAYERUSEDITEM, STRINGID_TRAINER1USEDITEM +}; + +const u16 gZEffectStringIds[] = +{ + [B_MSG_Z_RESET_STATS] = STRINGID_ZMOVERESETSSTATS, + [B_MSG_Z_ALL_STATS_UP]= STRINGID_ZMOVEALLSTATSUP, + [B_MSG_Z_BOOST_CRITS] = STRINGID_ZMOVEZBOOSTCRIT, + [B_MSG_Z_FOLLOW_ME] = STRINGID_PKMNCENTERATTENTION, + [B_MSG_Z_RECOVER_HP] = STRINGID_ZMOVERESTOREHP, + [B_MSG_Z_STAT_UP] = STRINGID_ZMOVESTATUP, + [B_MSG_Z_HP_TRAP] = STRINGID_ZMOVEHPTRAP, +}; + +const u16 gMentalHerbCureStringIds[] = +{ + [B_MSG_MENTALHERBCURE_INFATUATION] = STRINGID_ATKGOTOVERINFATUATION, + [B_MSG_MENTALHERBCURE_TAUNT] = STRINGID_BUFFERENDS, + [B_MSG_MENTALHERBCURE_ENCORE] = STRINGID_PKMNENCOREENDED, + [B_MSG_MENTALHERBCURE_TORMENT] = STRINGID_TORMENTEDNOMORE, + [B_MSG_MENTALHERBCURE_HEALBLOCK] = STRINGID_HEALBLOCKEDNOMORE, + [B_MSG_MENTALHERBCURE_DISABLE] = STRINGID_PKMNMOVEDISABLEDNOMORE, +}; + +const u16 gStartingStatusStringIds[B_MSG_STARTING_STATUS_COUNT] = +{ + [B_MSG_TERRAIN_SET_MISTY] = STRINGID_TERRAINBECOMESMISTY, + [B_MSG_TERRAIN_SET_ELECTRIC] = STRINGID_TERRAINBECOMESELECTRIC, + [B_MSG_TERRAIN_SET_PSYCHIC] = STRINGID_TERRAINBECOMESPSYCHIC, + [B_MSG_TERRAIN_SET_GRASSY] = STRINGID_TERRAINBECOMESGRASSY, + [B_MSG_SET_TRICK_ROOM] = STRINGID_DIMENSIONSWERETWISTED, + [B_MSG_SET_MAGIC_ROOM] = STRINGID_BIZARREARENACREATED, + [B_MSG_SET_WONDER_ROOM] = STRINGID_BIZARREAREACREATED, + [B_MSG_SET_TAILWIND_PLAYER] = STRINGID_TAILWINDBLEW, + [B_MSG_SET_TAILWIND_OPPONENT] = STRINGID_TAILWINDBLEW, +}; + +const u16 gTerrainStringIds[B_MSG_TERRAIN_COUNT] = +{ + [B_MSG_TERRAIN_SET_MISTY] = STRINGID_TERRAINBECOMESMISTY, + [B_MSG_TERRAIN_SET_ELECTRIC] = STRINGID_TERRAINBECOMESELECTRIC, + [B_MSG_TERRAIN_SET_PSYCHIC] = STRINGID_TERRAINBECOMESPSYCHIC, + [B_MSG_TERRAIN_SET_GRASSY] = STRINGID_TERRAINBECOMESGRASSY, + [B_MSG_TERRAIN_END_MISTY] = STRINGID_MISTYTERRAINENDS, + [B_MSG_TERRAIN_END_ELECTRIC] = STRINGID_ELECTRICTERRAINENDS, + [B_MSG_TERRAIN_END_PSYCHIC] = STRINGID_PSYCHICTERRAINENDS, + [B_MSG_TERRAIN_END_GRASSY] = STRINGID_GRASSYTERRAINENDS, +}; + +const u16 gTerrainPreventsStringIds[] = +{ + [B_MSG_TERRAINPREVENTS_MISTY] = STRINGID_MISTYTERRAINPREVENTS, + [B_MSG_TERRAINPREVENTS_ELECTRIC] = STRINGID_ELECTRICTERRAINPREVENTS, + [B_MSG_TERRAINPREVENTS_PSYCHIC] = STRINGID_PSYCHICTERRAINPREVENTS +}; + +const u16 gMagicCoatBounceStringIds[] = +{ + STRINGID_PKMNMOVEBOUNCED, STRINGID_PKMNMOVEBOUNCEDABILITY +}; + +const u16 gHealingWishStringIds[] = +{ + STRINGID_HEALINGWISHCAMETRUE, STRINGID_LUNARDANCECAMETRUE +}; + +const u16 gDmgHazardsStringIds[] = +{ + [B_MSG_PKMNHURTBYSPIKES] = STRINGID_PKMNHURTBYSPIKES, + [B_MSG_STEALTHROCKDMG] = STRINGID_STEALTHROCKDMG, + [B_MSG_SHARPSTEELDMG] = STRINGID_SHARPSTEELDMG, + [B_MSG_POINTEDSTONESFLOAT] = STRINGID_POINTEDSTONESFLOAT, + [B_MSG_SPIKESSCATTERED] = STRINGID_SPIKESSCATTERED, + [B_MSG_SHARPSTEELFLOATS] = STRINGID_SHARPSTEELFLOATS, +}; + +const u16 gSwitchInAbilityStringIds[] = +{ + [B_MSG_SWITCHIN_MOLDBREAKER] = STRINGID_MOLDBREAKERENTERS, + [B_MSG_SWITCHIN_TERAVOLT] = STRINGID_TERAVOLTENTERS, + [B_MSG_SWITCHIN_TURBOBLAZE] = STRINGID_TURBOBLAZEENTERS, + [B_MSG_SWITCHIN_SLOWSTART] = STRINGID_SLOWSTARTENTERS, + [B_MSG_SWITCHIN_UNNERVE] = STRINGID_UNNERVEENTERS, + [B_MSG_SWITCHIN_ANTICIPATION] = STRINGID_ANTICIPATIONACTIVATES, + [B_MSG_SWITCHIN_FOREWARN] = STRINGID_FOREWARNACTIVATES, + [B_MSG_SWITCHIN_PRESSURE] = STRINGID_PRESSUREENTERS, + [B_MSG_SWITCHIN_DARKAURA] = STRINGID_DARKAURAENTERS, + [B_MSG_SWITCHIN_FAIRYAURA] = STRINGID_FAIRYAURAENTERS, + [B_MSG_SWITCHIN_AURABREAK] = STRINGID_AURABREAKENTERS, + [B_MSG_SWITCHIN_COMATOSE] = STRINGID_COMATOSEENTERS, + [B_MSG_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS, + [B_MSG_SWITCHIN_ASONE] = STRINGID_ASONEENTERS, + [B_MSG_SWITCHIN_CURIOUS_MEDICINE] = STRINGID_CURIOUSMEDICINEENTERS, + [B_MSG_SWITCHIN_PASTEL_VEIL] = STRINGID_PASTELVEILENTERS, + [B_MSG_SWITCHIN_NEUTRALIZING_GAS] = STRINGID_NEUTRALIZINGGASENTERS, }; const u16 gMissStringIds[] = @@ -965,7 +1422,8 @@ const u16 gProtectLikeUsedStringIds[] = { [B_MSG_PROTECTED_ITSELF] = STRINGID_PKMNPROTECTEDITSELF2, [B_MSG_BRACED_ITSELF] = STRINGID_PKMNBRACEDITSELF, - [B_MSG_PROTECT_FAILED] = STRINGID_BUTITFAILED + [B_MSG_PROTECT_FAILED] = STRINGID_BUTITFAILED, + [B_MSG_PROTECTED_TEAM] = STRINGID_PROTECTEDTEAM, }; const u16 gReflectLightScreenSafeguardStringIds[] = @@ -1055,15 +1513,19 @@ const u16 gFirstTurnOfTwoStringIds[] = [B_MSG_TURN1_BOUNCE] = STRINGID_PKMNSPRANGUP }; -// Index copied from move's index in gTrappingMoves -const u16 gWrappedStringIds[] = +// Index copied from move's index in sTrappingMoves +const u16 gWrappedStringIds[NUM_TRAPPING_MOVES] = { - STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND - STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN - STRINGID_PKMNCLAMPED, // MOVE_CLAMP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL - STRINGID_PKMNTRAPPEDBYSANDTOMB // MOVE_SAND_TOMB + [B_MSG_WRAPPED_BIND] = STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND + [B_MSG_WRAPPED_WRAP] = STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP + [B_MSG_WRAPPED_FIRE_SPIN] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN + [B_MSG_WRAPPED_CLAMP] = STRINGID_PKMNCLAMPED, // MOVE_CLAMP + [B_MSG_WRAPPED_WHIRLPOOL] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL + [B_MSG_WRAPPED_SAND_TOMB] = STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB + [B_MSG_WRAPPED_MAGMA_STORM] = STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM + [B_MSG_WRAPPED_INFESTATION] = STRINGID_INFESTATION, // MOVE_INFESTATION + [B_MSG_WRAPPED_SNAP_TRAP] = STRINGID_PKMNINSNAPTRAP, // MOVE_SNAP_TRAP + [B_MSG_WRAPPED_THUNDER_CAGE]= STRINGID_THUNDERCAGETRAPPED, // MOVE_THUNDER_CAGE }; const u16 gMistUsedStringIds[] = @@ -1114,6 +1576,17 @@ const u16 gGotBurnedStringIds[] = [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNBURNEDBY }; +const u16 gGotFrostbiteStringIds[] = +{ + [B_MSG_STATUSED] = STRINGID_PKMNGOTFROSTBITE +}; + +const u16 gFrostbiteHealedStringIds[] = +{ + [B_MSG_FROSTBITE_HEALED] = STRINGID_PKMNFROSTBITEHEALED2, + [B_MSG_FROSTBITE_HEALED_BY_MOVE] = STRINGID_PKMNFROSTBITEHEALEDBY +}; + const u16 gGotFrozenStringIds[] = { [B_MSG_STATUSED] = STRINGID_PKMNWASFROZEN, @@ -1194,6 +1667,12 @@ const u16 gWeatherStartsStringIds[] = [WEATHER_ABNORMAL] = STRINGID_ITISRAINING }; +const u16 gPrimalWeatherBlocksStringIds[] = +{ + [B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN] = STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN, + [B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN] = STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT, +}; + const u16 gInobedientStringIds[] = { [B_MSG_LOAFING] = STRINGID_PKMNLOAFING, @@ -1277,17 +1756,6 @@ const u16 gDoubleBattleRecallStrings[1 << (MAX_BATTLERS_COUNT / 2)] = STRINGID_TRAINER1MON1AND2COMEBACK }; -const u16 gTrappingMoves[NUM_TRAPPING_MOVES + 1] = -{ - MOVE_BIND, - MOVE_WRAP, - MOVE_FIRE_SPIN, - MOVE_CLAMP, - MOVE_WHIRLPOOL, - MOVE_SAND_TOMB, - 0xFFFF // Never read -}; - const u8 gText_PkmnIsEvolving[] = _("What?\n{STR_VAR_1} is evolving!"); const u8 gText_CongratsPkmnEvolved[] = _("Congratulations! Your {STR_VAR_1}\nevolved into {STR_VAR_2}!{WAIT_SE}\p"); const u8 gText_PkmnStoppedEvolving[] = _("Huh? {STR_VAR_1}\nstopped evolving!\p"); @@ -1391,6 +1859,9 @@ static const u8 sText_Trainer1Fled[] = _("{PLAY_SE SE_FLEE}{B_TRAINER1_CLASS} {B static const u8 sText_PlayerLostAgainstTrainer1[] = _("Player lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!"); static const u8 sText_PlayerBattledToDrawTrainer1[] = _("Player battled to a draw against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!"); +static const u8 sText_Your2[] = _("your"); +static const u8 sText_Opposing2[] = _("the opposing"); + static const u8 *const sATypeMove_Table[NUMBER_OF_MON_TYPES] = { [TYPE_NORMAL] = gText_ANormalMove, @@ -1779,6 +2250,9 @@ void BufferStringBattle(u16 stringId) } } break; + case STRINGID_TRAINERSLIDE: + stringPtr = gBattleStruct->trainerSlideMsg; + break; default: // load a string from the table if (stringId >= BATTLESTRINGS_COUNT) { @@ -2202,8 +2676,21 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) else toCpy = sText_FoePkmnPrefix4; break; + case B_TXT_ATK_TEAM2: + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) + toCpy = sText_Your2; + else + toCpy = sText_Opposing2; + break; + case B_TXT_DEF_TEAM2: + if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) + toCpy = sText_Your2; + else + toCpy = sText_Opposing2; + break; } + // missing if (toCpy != NULL) check while (*toCpy != EOS) { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2c8f649f9..a32a6b25c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6,6 +6,7 @@ #include "pokedex.h" #include "money.h" #include "pokemon_icon.h" +#include "m4a.h" #include "mail.h" #include "event_data.h" #include "strings.h" @@ -37,6 +38,7 @@ #include "constants/abilities.h" #include "constants/pokemon.h" #include "constants/maps.h" +#include "data/battle_move_effects.h" // Helper for accessing command arguments and advancing gBattlescriptCurrInstr. // @@ -69,21 +71,258 @@ #define MEMBERS_7(a, b, c, d, e, f, g) a; b; c; d; e; f; g; #define MEMBERS_8(a, b, c, d, e, f, g, h) a; b; c; d; e; f; g; h; +// table to avoid ugly powing on gba (courtesy of doesnt) +// this returns (i^2.5)/4 +// the quarters cancel so no need to re-quadruple them in actual calculation +static const s32 sExperienceScalingFactors[] = +{ + 0, + 0, + 1, + 3, + 8, + 13, + 22, + 32, + 45, + 60, + 79, + 100, + 124, + 152, + 183, + 217, + 256, + 297, + 343, + 393, + 447, + 505, + 567, + 634, + 705, + 781, + 861, + 946, + 1037, + 1132, + 1232, + 1337, + 1448, + 1563, + 1685, + 1811, + 1944, + 2081, + 2225, + 2374, + 2529, + 2690, + 2858, + 3031, + 3210, + 3396, + 3587, + 3786, + 3990, + 4201, + 4419, + 4643, + 4874, + 5112, + 5357, + 5608, + 5866, + 6132, + 6404, + 6684, + 6971, + 7265, + 7566, + 7875, + 8192, + 8515, + 8847, + 9186, + 9532, + 9886, + 10249, + 10619, + 10996, + 11382, + 11776, + 12178, + 12588, + 13006, + 13433, + 13867, + 14310, + 14762, + 15222, + 15690, + 16167, + 16652, + 17146, + 17649, + 18161, + 18681, + 19210, + 19748, + 20295, + 20851, + 21417, + 21991, + 22574, + 23166, + 23768, + 24379, + 25000, + 25629, + 26268, + 26917, + 27575, + 28243, + 28920, + 29607, + 30303, + 31010, + 31726, + 32452, + 33188, + 33934, + 34689, + 35455, + 36231, + 37017, + 37813, + 38619, + 39436, + 40262, + 41099, + 41947, + 42804, + 43673, + 44551, + 45441, + 46340, + 47251, + 48172, + 49104, + 50046, + 50999, + 51963, + 52938, + 53924, + 54921, + 55929, + 56947, + 57977, + 59018, + 60070, + 61133, + 62208, + 63293, + 64390, + 65498, + 66618, + 67749, + 68891, + 70045, + 71211, + 72388, + 73576, + 74777, + 75989, + 77212, + 78448, + 79695, + 80954, + 82225, + 83507, + 84802, + 86109, + 87427, + 88758, + 90101, + 91456, + 92823, + 94202, + 95593, + 96997, + 98413, + 99841, + 101282, + 102735, + 104201, + 105679, + 107169, + 108672, + 110188, + 111716, + 113257, + 114811, + 116377, + 117956, + 119548, + 121153, + 122770, + 124401, + 126044, + 127700, + 129369, + 131052, + 132747, + 134456, + 136177, + 137912, + 139660, + 141421, + 143195, + 144983, + 146784, + 148598, + 150426, + 152267, + 154122, + 155990, + 157872, + 159767, +}; -extern const u8 *const gBattleScriptsForMoveEffects[]; -#define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED)) +static const u16 sTrappingMoves[NUM_TRAPPING_MOVES] = +{ + MOVE_BIND, + MOVE_WRAP, + MOVE_FIRE_SPIN, + MOVE_CLAMP, + MOVE_WHIRLPOOL, + MOVE_SAND_TOMB, + MOVE_MAGMA_STORM, + MOVE_INFESTATION, + MOVE_SNAP_TRAP, + MOVE_THUNDER_CAGE +}; + +static const u16 sBadgeFlags[8] = { + FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET, + FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET, +}; + +static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; + +#define STAT_CHANGE_WORKED 0 +#define STAT_CHANGE_DIDNT_WORK 1 #define LEVEL_UP_BANNER_START 416 #define LEVEL_UP_BANNER_END 512 #define TAG_LVLUP_BANNER_MON_ICON 55130 -static bool8 IsTwoTurnsMove(u16 move); static void TrySetDestinyBondToHappen(void); static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2. static void CheckWonderGuardAndLevitate(void); -static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8 *BS_ptr); +static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr); static void InitLevelUpBanner(void); static bool8 SlideInLevelUpBanner(void); static bool8 SlideOutLevelUpBanner(void); @@ -92,6 +331,16 @@ static void DrawLevelUpWindow2(void); static void PutMonIconOnLvlUpBanner(void); static void DrawLevelUpBannerText(void); static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite); +static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent); +static bool8 IsFinalStrikeEffect(u16 move); +static void TryUpdateRoundTurnOrder(void); +static void BestowItem(u32 battlerAtk, u32 battlerDef); +static void ApplyExperienceMultipliers(s32 *expAmount, u8 expGetterMonId, u8 faintedBattler); +static bool8 CanBurnHitThaw(u16 move); +static bool32 ChangeOrderTargetAfterAttacker(void); +static void TryUpdateEvolutionTracker(u32 evolutionMethod, u32 upAmount); +static bool8 CanAbilityPreventStatLoss(u16 abilityDef, bool8 isIntimidate); +static bool32 CriticalCapture(u32 odds); static void Cmd_attackcanceler(void); static void Cmd_accuracycheck(void); @@ -100,8 +349,8 @@ static void Cmd_ppreduce(void); static void Cmd_critcalc(void); static void Cmd_damagecalc(void); static void Cmd_typecalc(void); -static void Cmd_adjustnormaldamage(void); -static void Cmd_adjustnormaldamage2(void); +static void Cmd_adjustdamage(void); +static void Cmd_multihitresultmessage(void); static void Cmd_attackanimation(void); static void Cmd_waitanimation(void); static void Cmd_healthbarupdate(void); @@ -114,7 +363,7 @@ static void Cmd_printselectionstring(void); static void Cmd_waitmessage(void); static void Cmd_printfromtable(void); static void Cmd_printselectionstringfromtable(void); -static void Cmd_seteffectwithchance(void); +static void Cmd_setadditionaleffects(void); static void Cmd_seteffectprimary(void); static void Cmd_seteffectsecondary(void); static void Cmd_clearstatusfromeffect(void); @@ -127,7 +376,7 @@ static void Cmd_jumpifability(void); static void Cmd_jumpifsideaffecting(void); static void Cmd_jumpifstat(void); static void Cmd_jumpifstatus3condition(void); -static void Cmd_jumpiftype(void); +static void Cmd_jumpbasedontype(void); static void Cmd_getexp(void); static void Cmd_checkteamslost(void); static void Cmd_movevaluescleanup(void); @@ -157,9 +406,9 @@ static void Cmd_return(void); static void Cmd_end(void); static void Cmd_end2(void); static void Cmd_end3(void); -static void Cmd_jumpifaffectedbyprotect(void); +static void Cmd_unused5(void); static void Cmd_call(void); -static void Cmd_jumpiftype2(void); +static void Cmd_setroost(void); static void Cmd_jumpifabilitypresent(void); static void Cmd_endselectionscript(void); static void Cmd_playanimation(void); @@ -167,7 +416,7 @@ static void Cmd_playanimation_var(void); static void Cmd_setgraphicalstatchangevalues(void); static void Cmd_playstatchangeanimation(void); static void Cmd_moveend(void); -static void Cmd_typecalc2(void); +static void Cmd_sethealblock(void); static void Cmd_returnatktoball(void); static void Cmd_getswitchedmondata(void); static void Cmd_switchindataupdate(void); @@ -198,14 +447,14 @@ static void Cmd_status2animation(void); static void Cmd_chosenstatusanimation(void); static void Cmd_yesnobox(void); static void Cmd_cancelallactions(void); -static void Cmd_adjustsetdamage(void); +static void Cmd_setgravity(void); static void Cmd_removeitem(void); static void Cmd_atknameinbuff1(void); static void Cmd_drawlvlupbox(void); static void Cmd_resetsentmonsvalue(void); static void Cmd_setatktoplayer0(void); static void Cmd_makevisible(void); -static void Cmd_recordlastability(void); +static void Cmd_recordability(void); static void Cmd_buffermovetolearn(void); static void Cmd_jumpifplayerran(void); static void Cmd_hpthresholds(void); @@ -224,16 +473,16 @@ static void Cmd_setseeded(void); static void Cmd_manipulatedamage(void); static void Cmd_trysetrest(void); static void Cmd_jumpifnotfirstturn(void); -static void Cmd_nop(void); -static void Cmd_jumpifcantmakeasleep(void); +static void Cmd_setmiracleeye(void); +static void Cmd_jumpifuproarwakes(void); static void Cmd_stockpile(void); static void Cmd_stockpiletobasedamage(void); static void Cmd_stockpiletohpheal(void); -static void Cmd_negativedamage(void); +static void Cmd_setdrainedhp(void); static void Cmd_statbuffchange(void); static void Cmd_normalisebuffs(void); static void Cmd_setbide(void); -static void Cmd_confuseifrepeatingattackends(void); +static void Cmd_twoturnmoveschargestringandanimation(void); static void Cmd_setmultihitcounter(void); static void Cmd_initmultihitstring(void); static void Cmd_forcerandomswitch(void); @@ -265,33 +514,33 @@ static void Cmd_copymovepermanently(void); static void Cmd_trychoosesleeptalkmove(void); static void Cmd_setdestinybond(void); static void Cmd_trysetdestinybondtohappen(void); -static void Cmd_remaininghptopower(void); +static void Cmd_settailwind(void); static void Cmd_tryspiteppreduce(void); static void Cmd_healpartystatus(void); static void Cmd_cursetarget(void); static void Cmd_trysetspikes(void); static void Cmd_setforesight(void); static void Cmd_trysetperishsong(void); -static void Cmd_rolloutdamagecalculation(void); +static void Cmd_handlerollout(void); static void Cmd_jumpifconfusedandstatmaxed(void); -static void Cmd_furycuttercalc(void); -static void Cmd_friendshiptodamagecalculation(void); +static void Cmd_handlefurycutter(void); +static void Cmd_setembargo(void); static void Cmd_presentdamagecalculation(void); static void Cmd_setsafeguard(void); static void Cmd_magnitudedamagecalculation(void); static void Cmd_jumpifnopursuitswitchdmg(void); static void Cmd_setsunny(void); -static void Cmd_maxattackhalvehp(void); +static void Cmd_halvehp(void); static void Cmd_copyfoestats(void); static void Cmd_rapidspinfree(void); static void Cmd_setdefensecurlbit(void); static void Cmd_recoverbasedonsunlight(void); -static void Cmd_hiddenpowercalc(void); +static void Cmd_setstickyweb(void); static void Cmd_selectfirstvalidtarget(void); static void Cmd_trysetfutureattack(void); static void Cmd_trydobeatup(void); static void Cmd_setsemiinvulnerablebit(void); -static void Cmd_clearsemiinvulnerablebit(void); +static void Cmd_tryfiretwoturnmovenowbyeffect(void); static void Cmd_setminimize(void); static void Cmd_sethail(void); static void Cmd_trymemento(void); @@ -306,27 +555,27 @@ static void Cmd_trysethelpinghand(void); static void Cmd_tryswapitems(void); static void Cmd_trycopyability(void); static void Cmd_trywish(void); -static void Cmd_trysetroots(void); -static void Cmd_doubledamagedealtifdamaged(void); +static void Cmd_settoxicspikes(void); +static void Cmd_setgastroacid(void); static void Cmd_setyawn(void); static void Cmd_setdamagetohealthdifference(void); -static void Cmd_scaledamagebyhealthratio(void); +static void Cmd_setroom(void); static void Cmd_tryswapabilities(void); static void Cmd_tryimprison(void); -static void Cmd_trysetgrudge(void); -static void Cmd_weightdamagecalculation(void); +static void Cmd_setstealthrock(void); +static void Cmd_setuserstatus3(void); static void Cmd_assistattackselect(void); static void Cmd_trysetmagiccoat(void); static void Cmd_trysetsnatch(void); -static void Cmd_trygetintimidatetarget(void); +static void Cmd_unused2(void); static void Cmd_switchoutabilities(void); static void Cmd_jumpifhasnohp(void); -static void Cmd_getsecretpowereffect(void); +static void Cmd_jumpifnotcurrentmoveargtype(void); static void Cmd_pickup(void); -static void Cmd_docastformchangeanimation(void); -static void Cmd_trycastformdatachange(void); +static void Cmd_unused3(void); +static void Cmd_unused4(void); static void Cmd_settypebasedhalvers(void); -static void Cmd_setweatherballtype(void); +static void Cmd_jumpifsubstituteblocks(void); static void Cmd_tryrecycleitem(void); static void Cmd_settypetoterrain(void); static void Cmd_pursuitdoubles(void); @@ -341,275 +590,276 @@ static void Cmd_subattackerhpbydmg(void); static void Cmd_removeattackerstatus1(void); static void Cmd_finishaction(void); static void Cmd_finishturn(void); +static void Cmd_trainerslideout(void); +static void Cmd_settelekinesis(void); +static void Cmd_swapstatstages(void); +static void Cmd_averagestats(void); +static void Cmd_jumpifoppositegenders(void); +static void Cmd_unused(void); +static void Cmd_tryworryseed(void); static void Cmd_callnative(void); void (* const gBattleScriptingCommandsTable[])(void) = { - Cmd_attackcanceler, //0x0 - Cmd_accuracycheck, //0x1 - Cmd_attackstring, //0x2 - Cmd_ppreduce, //0x3 - Cmd_critcalc, //0x4 - Cmd_damagecalc, //0x5 - Cmd_typecalc, //0x6 - Cmd_adjustnormaldamage, //0x7 - Cmd_adjustnormaldamage2, //0x8 - Cmd_attackanimation, //0x9 - Cmd_waitanimation, //0xA - Cmd_healthbarupdate, //0xB - Cmd_datahpupdate, //0xC - Cmd_critmessage, //0xD - Cmd_effectivenesssound, //0xE - Cmd_resultmessage, //0xF - Cmd_printstring, //0x10 - Cmd_printselectionstring, //0x11 - Cmd_waitmessage, //0x12 - Cmd_printfromtable, //0x13 - Cmd_printselectionstringfromtable, //0x14 - Cmd_seteffectwithchance, //0x15 - Cmd_seteffectprimary, //0x16 - Cmd_seteffectsecondary, //0x17 - Cmd_clearstatusfromeffect, //0x18 - Cmd_tryfaintmon, //0x19 - Cmd_dofaintanimation, //0x1A - Cmd_cleareffectsonfaint, //0x1B - Cmd_jumpifstatus, //0x1C - Cmd_jumpifstatus2, //0x1D - Cmd_jumpifability, //0x1E - Cmd_jumpifsideaffecting, //0x1F - Cmd_jumpifstat, //0x20 - Cmd_jumpifstatus3condition, //0x21 - Cmd_jumpiftype, //0x22 - Cmd_getexp, //0x23 - Cmd_checkteamslost, //0x24 - Cmd_movevaluescleanup, //0x25 - Cmd_setmultihit, //0x26 - Cmd_decrementmultihit, //0x27 - Cmd_goto, //0x28 - Cmd_jumpifbyte, //0x29 - Cmd_jumpifhalfword, //0x2A - Cmd_jumpifword, //0x2B - Cmd_jumpifarrayequal, //0x2C - Cmd_jumpifarraynotequal, //0x2D - Cmd_setbyte, //0x2E - Cmd_addbyte, //0x2F - Cmd_subbyte, //0x30 - Cmd_copyarray, //0x31 - Cmd_copyarraywithindex, //0x32 - Cmd_orbyte, //0x33 - Cmd_orhalfword, //0x34 - Cmd_orword, //0x35 - Cmd_bicbyte, //0x36 - Cmd_bichalfword, //0x37 - Cmd_bicword, //0x38 - Cmd_pause, //0x39 - Cmd_waitstate, //0x3A - Cmd_healthbar_update, //0x3B - Cmd_return, //0x3C - Cmd_end, //0x3D - Cmd_end2, //0x3E - Cmd_end3, //0x3F - Cmd_jumpifaffectedbyprotect, //0x40 - Cmd_call, //0x41 - Cmd_jumpiftype2, //0x42 - Cmd_jumpifabilitypresent, //0x43 - Cmd_endselectionscript, //0x44 - Cmd_playanimation, //0x45 - Cmd_playanimation_var, //0x46 - Cmd_setgraphicalstatchangevalues, //0x47 - Cmd_playstatchangeanimation, //0x48 - Cmd_moveend, //0x49 - Cmd_typecalc2, //0x4A - Cmd_returnatktoball, //0x4B - Cmd_getswitchedmondata, //0x4C - Cmd_switchindataupdate, //0x4D - Cmd_switchinanim, //0x4E - Cmd_jumpifcantswitch, //0x4F - Cmd_openpartyscreen, //0x50 - Cmd_switchhandleorder, //0x51 - Cmd_switchineffects, //0x52 - Cmd_trainerslidein, //0x53 - Cmd_playse, //0x54 - Cmd_fanfare, //0x55 - Cmd_playfaintcry, //0x56 - Cmd_endlinkbattle, //0x57 - Cmd_returntoball, //0x58 - Cmd_handlelearnnewmove, //0x59 - Cmd_yesnoboxlearnmove, //0x5A - Cmd_yesnoboxstoplearningmove, //0x5B - Cmd_hitanimation, //0x5C - Cmd_getmoneyreward, //0x5D - Cmd_updatebattlermoves, //0x5E - Cmd_swapattackerwithtarget, //0x5F - Cmd_incrementgamestat, //0x60 - Cmd_drawpartystatussummary, //0x61 - Cmd_hidepartystatussummary, //0x62 - Cmd_jumptocalledmove, //0x63 - Cmd_statusanimation, //0x64 - Cmd_status2animation, //0x65 - Cmd_chosenstatusanimation, //0x66 - Cmd_yesnobox, //0x67 - Cmd_cancelallactions, //0x68 - Cmd_adjustsetdamage, //0x69 - Cmd_removeitem, //0x6A - Cmd_atknameinbuff1, //0x6B - Cmd_drawlvlupbox, //0x6C - Cmd_resetsentmonsvalue, //0x6D - Cmd_setatktoplayer0, //0x6E - Cmd_makevisible, //0x6F - Cmd_recordlastability, //0x70 - Cmd_buffermovetolearn, //0x71 - Cmd_jumpifplayerran, //0x72 - Cmd_hpthresholds, //0x73 - Cmd_hpthresholds2, //0x74 - Cmd_useitemonopponent, //0x75 - Cmd_various, //0x76 - Cmd_setprotectlike, //0x77 - Cmd_tryexplosion, //0x78 - Cmd_setatkhptozero, //0x79 - Cmd_jumpifnexttargetvalid, //0x7A - Cmd_tryhealhalfhealth, //0x7B - Cmd_trymirrormove, //0x7C - Cmd_setrain, //0x7D - Cmd_setreflect, //0x7E - Cmd_setseeded, //0x7F - Cmd_manipulatedamage, //0x80 - Cmd_trysetrest, //0x81 - Cmd_jumpifnotfirstturn, //0x82 - Cmd_nop, //0x83 - Cmd_jumpifcantmakeasleep, //0x84 - Cmd_stockpile, //0x85 - Cmd_stockpiletobasedamage, //0x86 - Cmd_stockpiletohpheal, //0x87 - Cmd_negativedamage, //0x88 - Cmd_statbuffchange, //0x89 - Cmd_normalisebuffs, //0x8A - Cmd_setbide, //0x8B - Cmd_confuseifrepeatingattackends, //0x8C - Cmd_setmultihitcounter, //0x8D - Cmd_initmultihitstring, //0x8E - Cmd_forcerandomswitch, //0x8F - Cmd_tryconversiontypechange, //0x90 - Cmd_givepaydaymoney, //0x91 - Cmd_setlightscreen, //0x92 - Cmd_tryKO, //0x93 - Cmd_damagetohalftargethp, //0x94 - Cmd_setsandstorm, //0x95 - Cmd_weatherdamage, //0x96 - Cmd_tryinfatuating, //0x97 - Cmd_updatestatusicon, //0x98 - Cmd_setmist, //0x99 - Cmd_setfocusenergy, //0x9A - Cmd_transformdataexecution, //0x9B - Cmd_setsubstitute, //0x9C - Cmd_mimicattackcopy, //0x9D - Cmd_metronome, //0x9E - Cmd_dmgtolevel, //0x9F - Cmd_psywavedamageeffect, //0xA0 - Cmd_counterdamagecalculator, //0xA1 - Cmd_mirrorcoatdamagecalculator, //0xA2 - Cmd_disablelastusedattack, //0xA3 - Cmd_trysetencore, //0xA4 - Cmd_painsplitdmgcalc, //0xA5 - Cmd_settypetorandomresistance, //0xA6 - Cmd_setalwayshitflag, //0xA7 - Cmd_copymovepermanently, //0xA8 - Cmd_trychoosesleeptalkmove, //0xA9 - Cmd_setdestinybond, //0xAA - Cmd_trysetdestinybondtohappen, //0xAB - Cmd_remaininghptopower, //0xAC - Cmd_tryspiteppreduce, //0xAD - Cmd_healpartystatus, //0xAE - Cmd_cursetarget, //0xAF - Cmd_trysetspikes, //0xB0 - Cmd_setforesight, //0xB1 - Cmd_trysetperishsong, //0xB2 - Cmd_rolloutdamagecalculation, //0xB3 - Cmd_jumpifconfusedandstatmaxed, //0xB4 - Cmd_furycuttercalc, //0xB5 - Cmd_friendshiptodamagecalculation, //0xB6 - Cmd_presentdamagecalculation, //0xB7 - Cmd_setsafeguard, //0xB8 - Cmd_magnitudedamagecalculation, //0xB9 - Cmd_jumpifnopursuitswitchdmg, //0xBA - Cmd_setsunny, //0xBB - Cmd_maxattackhalvehp, //0xBC - Cmd_copyfoestats, //0xBD - Cmd_rapidspinfree, //0xBE - Cmd_setdefensecurlbit, //0xBF - Cmd_recoverbasedonsunlight, //0xC0 - Cmd_hiddenpowercalc, //0xC1 - Cmd_selectfirstvalidtarget, //0xC2 - Cmd_trysetfutureattack, //0xC3 - Cmd_trydobeatup, //0xC4 - Cmd_setsemiinvulnerablebit, //0xC5 - Cmd_clearsemiinvulnerablebit, //0xC6 - Cmd_setminimize, //0xC7 - Cmd_sethail, //0xC8 - Cmd_trymemento, //0xC9 - Cmd_setforcedtarget, //0xCA - Cmd_setcharge, //0xCB - Cmd_callterrainattack, //0xCC - Cmd_cureifburnedparalysedorpoisoned, //0xCD - Cmd_settorment, //0xCE - Cmd_jumpifnodamage, //0xCF - Cmd_settaunt, //0xD0 - Cmd_trysethelpinghand, //0xD1 - Cmd_tryswapitems, //0xD2 - Cmd_trycopyability, //0xD3 - Cmd_trywish, //0xD4 - Cmd_trysetroots, //0xD5 - Cmd_doubledamagedealtifdamaged, //0xD6 - Cmd_setyawn, //0xD7 - Cmd_setdamagetohealthdifference, //0xD8 - Cmd_scaledamagebyhealthratio, //0xD9 - Cmd_tryswapabilities, //0xDA - Cmd_tryimprison, //0xDB - Cmd_trysetgrudge, //0xDC - Cmd_weightdamagecalculation, //0xDD - Cmd_assistattackselect, //0xDE - Cmd_trysetmagiccoat, //0xDF - Cmd_trysetsnatch, //0xE0 - Cmd_trygetintimidatetarget, //0xE1 - Cmd_switchoutabilities, //0xE2 - Cmd_jumpifhasnohp, //0xE3 - Cmd_getsecretpowereffect, //0xE4 - Cmd_pickup, //0xE5 - Cmd_docastformchangeanimation, //0xE6 - Cmd_trycastformdatachange, //0xE7 - Cmd_settypebasedhalvers, //0xE8 - Cmd_setweatherballtype, //0xE9 - Cmd_tryrecycleitem, //0xEA - Cmd_settypetoterrain, //0xEB - Cmd_pursuitdoubles, //0xEC - Cmd_snatchsetbattlers, //0xED - Cmd_removelightscreenreflect, //0xEE - Cmd_handleballthrow, //0xEF - Cmd_givecaughtmon, //0xF0 - Cmd_trysetcaughtmondexflags, //0xF1 - Cmd_displaydexinfo, //0xF2 - Cmd_trygivecaughtmonnick, //0xF3 - Cmd_subattackerhpbydmg, //0xF4 - Cmd_removeattackerstatus1, //0xF5 - Cmd_finishaction, //0xF6 - Cmd_finishturn, //0xF7 - NULL, //0xF8 - NULL, //0xF9 - NULL, //0xFA - NULL, //0xFB - NULL, //0xFC - NULL, //0xFD - NULL, //0xFE - Cmd_callnative, //0xFF + Cmd_attackcanceler, //0x0 // done + Cmd_accuracycheck, //0x1 // done + Cmd_attackstring, //0x2 // done + Cmd_ppreduce, //0x3 // done + Cmd_critcalc, //0x4 // done + Cmd_damagecalc, //0x5 // done + Cmd_typecalc, //0x6 // done + Cmd_adjustdamage, //0x7 // done + Cmd_multihitresultmessage, //0x8 // done + Cmd_attackanimation, //0x9 // done + Cmd_waitanimation, //0xA // done + Cmd_healthbarupdate, //0xB // done + Cmd_datahpupdate, //0xC // done + Cmd_critmessage, //0xD // done + Cmd_effectivenesssound, //0xE // done + Cmd_resultmessage, //0xF // done + Cmd_printstring, //0x10 // done + Cmd_printselectionstring, //0x11 // done + Cmd_waitmessage, //0x12 // done + Cmd_printfromtable, //0x13 // done + Cmd_printselectionstringfromtable, //0x14 // done + Cmd_setadditionaleffects, //0x15 // done + Cmd_seteffectprimary, //0x16 // done + Cmd_seteffectsecondary, //0x17 // done + Cmd_clearstatusfromeffect, //0x18 // done + Cmd_tryfaintmon, //0x19 // done + Cmd_dofaintanimation, //0x1A // done + Cmd_cleareffectsonfaint, //0x1B // done + Cmd_jumpifstatus, //0x1C // done + Cmd_jumpifstatus2, //0x1D // done + Cmd_jumpifability, //0x1E // done + Cmd_jumpifsideaffecting, //0x1F // done + Cmd_jumpifstat, //0x20 // done + Cmd_jumpifstatus3condition, //0x21 // done + Cmd_jumpbasedontype, //0x22 // done + Cmd_getexp, //0x23 // done + Cmd_checkteamslost, //0x24 // done + Cmd_movevaluescleanup, //0x25 // done + Cmd_setmultihit, //0x26 // done + Cmd_decrementmultihit, //0x27 // done + Cmd_goto, //0x28 // done + Cmd_jumpifbyte, //0x29 // done + Cmd_jumpifhalfword, //0x2A // done + Cmd_jumpifword, //0x2B // done + Cmd_jumpifarrayequal, //0x2C // done + Cmd_jumpifarraynotequal, //0x2D // done + Cmd_setbyte, //0x2E // done + Cmd_addbyte, //0x2F // done + Cmd_subbyte, //0x30 // done + Cmd_copyarray, //0x31 // done + Cmd_copyarraywithindex, //0x32 // done + Cmd_orbyte, //0x33 // done + Cmd_orhalfword, //0x34 // done + Cmd_orword, //0x35 // done + Cmd_bicbyte, //0x36 // done + Cmd_bichalfword, //0x37 // done + Cmd_bicword, //0x38 // done + Cmd_pause, //0x39 // done + Cmd_waitstate, //0x3A // done + Cmd_healthbar_update, //0x3B // done + Cmd_return, //0x3C // done + Cmd_end, //0x3D // done + Cmd_end2, //0x3E // done + Cmd_end3, //0x3F // done + Cmd_unused5, //0x40 // done + Cmd_call, //0x41 // done + Cmd_setroost, //0x42 // done + Cmd_jumpifabilitypresent, //0x43 // done + Cmd_endselectionscript, //0x44 // done + Cmd_playanimation, //0x45 // done + Cmd_playanimation_var, //0x46 // done + Cmd_setgraphicalstatchangevalues, //0x47 // done + Cmd_playstatchangeanimation, //0x48 // done + Cmd_moveend, //0x49 // done + Cmd_sethealblock, //0x4A // done + Cmd_returnatktoball, //0x4B // done + Cmd_getswitchedmondata, //0x4C // done + Cmd_switchindataupdate, //0x4D // done + Cmd_switchinanim, //0x4E // done + Cmd_jumpifcantswitch, //0x4F // done + Cmd_openpartyscreen, //0x50 // done + Cmd_switchhandleorder, //0x51 // done + Cmd_switchineffects, //0x52 // done + Cmd_trainerslidein, //0x53 // done + Cmd_playse, //0x54 // done + Cmd_fanfare, //0x55 // done + Cmd_playfaintcry, //0x56 // done + Cmd_endlinkbattle, //0x57 // done + Cmd_returntoball, //0x58 // done + Cmd_handlelearnnewmove, //0x59 // done + Cmd_yesnoboxlearnmove, //0x5A // done + Cmd_yesnoboxstoplearningmove, //0x5B // done + Cmd_hitanimation, //0x5C // done + Cmd_getmoneyreward, //0x5D // done + Cmd_updatebattlermoves, //0x5E // done + Cmd_swapattackerwithtarget, //0x5F // done + Cmd_incrementgamestat, //0x60 // done + Cmd_drawpartystatussummary, //0x61 // done + Cmd_hidepartystatussummary, //0x62 // done + Cmd_jumptocalledmove, //0x63 // done + Cmd_statusanimation, //0x64 // done + Cmd_status2animation, //0x65 // done + Cmd_chosenstatusanimation, //0x66 // done + Cmd_yesnobox, //0x67 // done + Cmd_cancelallactions, //0x68 // done + Cmd_setgravity, //0x69 // done + Cmd_removeitem, //0x6A // done + Cmd_atknameinbuff1, //0x6B // done + Cmd_drawlvlupbox, //0x6C // done + Cmd_resetsentmonsvalue, //0x6D // done + Cmd_setatktoplayer0, //0x6E // done + Cmd_makevisible, //0x6F // done + Cmd_recordability, //0x70 // done + Cmd_buffermovetolearn, //0x71 // done + Cmd_jumpifplayerran, //0x72 // done + Cmd_hpthresholds, //0x73 // done + Cmd_hpthresholds2, //0x74 // done + Cmd_useitemonopponent, //0x75 // done + Cmd_various, //0x76 // done + Cmd_setprotectlike, //0x77 // done + Cmd_tryexplosion, //0x78 // done + Cmd_setatkhptozero, //0x79 // done + Cmd_jumpifnexttargetvalid, //0x7A // done + Cmd_tryhealhalfhealth, //0x7B // done + Cmd_trymirrormove, //0x7C // done + Cmd_setrain, //0x7D // done + Cmd_setreflect, //0x7E // done + Cmd_setseeded, //0x7F // done + Cmd_manipulatedamage, //0x80 // done + Cmd_trysetrest, //0x81 // done + Cmd_jumpifnotfirstturn, //0x82 // done + Cmd_setmiracleeye, //0x83 // done + Cmd_jumpifuproarwakes, //0x84 // done + Cmd_stockpile, //0x85 // done + Cmd_stockpiletobasedamage, //0x86 // done + Cmd_stockpiletohpheal, //0x87 // done + Cmd_setdrainedhp, //0x88 // done + Cmd_statbuffchange, //0x89 // done + Cmd_normalisebuffs, //0x8A // done + Cmd_setbide, //0x8B // done + Cmd_twoturnmoveschargestringandanimation, //0x8C // done + Cmd_setmultihitcounter, //0x8D // done + Cmd_initmultihitstring, //0x8E // done + Cmd_forcerandomswitch, //0x8F // done + Cmd_tryconversiontypechange, //0x90 // done + Cmd_givepaydaymoney, //0x91 // done + Cmd_setlightscreen, //0x92 // done + Cmd_tryKO, //0x93 // done + Cmd_damagetohalftargethp, //0x94 // done + Cmd_setsandstorm, //0x95 // done + Cmd_weatherdamage, //0x96 // done + Cmd_tryinfatuating, //0x97 // done + Cmd_updatestatusicon, //0x98 // done + Cmd_setmist, //0x99 // done + Cmd_setfocusenergy, //0x9A // done + Cmd_transformdataexecution, //0x9B // done + Cmd_setsubstitute, //0x9C // done + Cmd_mimicattackcopy, //0x9D // done + Cmd_metronome, //0x9E // done + Cmd_dmgtolevel, //0x9F // done + Cmd_psywavedamageeffect, //0xA0 // done + Cmd_counterdamagecalculator, //0xA1 // done + Cmd_mirrorcoatdamagecalculator, //0xA2 // done + Cmd_disablelastusedattack, //0xA3 // done + Cmd_trysetencore, //0xA4 // done + Cmd_painsplitdmgcalc, //0xA5 // done + Cmd_settypetorandomresistance, //0xA6 // done + Cmd_setalwayshitflag, //0xA7 // done + Cmd_copymovepermanently, //0xA8 // done + Cmd_trychoosesleeptalkmove, //0xA9 // done + Cmd_setdestinybond, //0xAA // done + Cmd_trysetdestinybondtohappen, //0xAB // done + Cmd_settailwind, //0xAC // done + Cmd_tryspiteppreduce, //0xAD // done + Cmd_healpartystatus, //0xAE // done + Cmd_cursetarget, //0xAF // done + Cmd_trysetspikes, //0xB0 // done + Cmd_setforesight, //0xB1 // done + Cmd_trysetperishsong, //0xB2 // done + Cmd_handlerollout, //0xB3 // done + Cmd_jumpifconfusedandstatmaxed, //0xB4 // done + Cmd_handlefurycutter, //0xB5 // done + Cmd_setembargo, //0xB6 // done + Cmd_presentdamagecalculation, //0xB7 // done + Cmd_setsafeguard, //0xB8 // done + Cmd_magnitudedamagecalculation, //0xB9 // done + Cmd_jumpifnopursuitswitchdmg, //0xBA // done + Cmd_setsunny, //0xBB // done + Cmd_halvehp, //0xBC // done + Cmd_copyfoestats, //0xBD // done + Cmd_rapidspinfree, //0xBE // done + Cmd_setdefensecurlbit, //0xBF // done + Cmd_recoverbasedonsunlight, //0xC0 // done + Cmd_setstickyweb, //0xC1 // done + Cmd_selectfirstvalidtarget, //0xC2 // done + Cmd_trysetfutureattack, //0xC3 // done + Cmd_trydobeatup, //0xC4 // done + Cmd_setsemiinvulnerablebit, //0xC5 // done + Cmd_tryfiretwoturnmovenowbyeffect, //0xC6 // done + Cmd_setminimize, //0xC7 // done + Cmd_sethail, //0xC8 // done + Cmd_trymemento, //0xC9 // done + Cmd_setforcedtarget, //0xCA // done + Cmd_setcharge, //0xCB // done + Cmd_callterrainattack, //0xCC // done + Cmd_cureifburnedparalysedorpoisoned, //0xCD // done + Cmd_settorment, //0xCE // done + Cmd_jumpifnodamage, //0xCF // done + Cmd_settaunt, //0xD0 // done + Cmd_trysethelpinghand, //0xD1 // done + Cmd_tryswapitems, //0xD2 // done + Cmd_trycopyability, //0xD3 // done + Cmd_trywish, //0xD4 // done + Cmd_settoxicspikes, //0xD5 // done + Cmd_setgastroacid, //0xD6 // done + Cmd_setyawn, //0xD7 // done + Cmd_setdamagetohealthdifference, //0xD8 // done + Cmd_setroom, //0xD9 // done + Cmd_tryswapabilities, //0xDA // done + Cmd_tryimprison, //0xDB // done + Cmd_setstealthrock, //0xDC // done + Cmd_setuserstatus3, //0xDD // done + Cmd_assistattackselect, //0xDE // done + Cmd_trysetmagiccoat, //0xDF // done + Cmd_trysetsnatch, //0xE0 // done + Cmd_unused2, //0xE1 // done + Cmd_switchoutabilities, //0xE2 // done + Cmd_jumpifhasnohp, //0xE3 // done + Cmd_jumpifnotcurrentmoveargtype, //0xE4 // done + Cmd_pickup, //0xE5 // done + Cmd_unused3, //0xE6 // done + Cmd_unused4, //0xE7 // done + Cmd_settypebasedhalvers, //0xE8 // done + Cmd_jumpifsubstituteblocks, //0xE9 // done + Cmd_tryrecycleitem, //0xEA // done + Cmd_settypetoterrain, //0xEB // done + Cmd_pursuitdoubles, //0xEC // done + Cmd_snatchsetbattlers, //0xED // done + Cmd_removelightscreenreflect, //0xEE // done + Cmd_handleballthrow, //0xEF // done + Cmd_givecaughtmon, //0xF0 // done + Cmd_trysetcaughtmondexflags, //0xF1 // done + Cmd_displaydexinfo, //0xF2 // done + Cmd_trygivecaughtmonnick, //0xF3 // done + Cmd_subattackerhpbydmg, //0xF4 // done + Cmd_removeattackerstatus1, //0xF5 // done + Cmd_finishaction, //0xF6 // done + Cmd_finishturn, //0xF7 // done + Cmd_trainerslideout, //0xF8 // done + Cmd_settelekinesis, //0xF9 // done + Cmd_swapstatstages, //0xFA // done + Cmd_averagestats, //0xFB // done + Cmd_jumpifoppositegenders, //0xFC // done + Cmd_unused, //0xFD // done + Cmd_tryworryseed, //0xFE // done + Cmd_callnative, //0xFF // done }; -struct StatFractions -{ - u8 dividend; - u8 divisor; -}; - -static const struct StatFractions sAccuracyStageRatios[] = +const struct StatFractions gAccuracyStageRatios[] = { { 33, 100}, // -6 { 36, 100}, // -5 @@ -626,9 +876,6 @@ static const struct StatFractions sAccuracyStageRatios[] = { 3, 1}, // +6 }; -// The chance is 1/N for each stage. -static const u16 sCriticalHitChance[] = {16, 8, 4, 3, 2}; - static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] = { [MOVE_EFFECT_SLEEP] = STATUS1_SLEEP, @@ -637,6 +884,7 @@ static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] = [MOVE_EFFECT_FREEZE] = STATUS1_FREEZE, [MOVE_EFFECT_PARALYSIS] = STATUS1_PARALYSIS, [MOVE_EFFECT_TOXIC] = STATUS1_TOXIC_POISON, + [MOVE_EFFECT_FROSTBITE] = STATUS1_FROSTBITE, [MOVE_EFFECT_CONFUSION] = STATUS2_CONFUSION, [MOVE_EFFECT_FLINCH] = STATUS2_FLINCHED, [MOVE_EFFECT_UPROAR] = STATUS2_UPROAR, @@ -650,7 +898,6 @@ static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] = static const u8 *const sMoveEffectBS_Ptrs[] = { - [0] = BattleScript_MoveEffectSleep, [MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep, [MOVE_EFFECT_POISON] = BattleScript_MoveEffectPoison, [MOVE_EFFECT_BURN] = BattleScript_MoveEffectBurn, @@ -658,37 +905,10 @@ static const u8 *const sMoveEffectBS_Ptrs[] = [MOVE_EFFECT_PARALYSIS] = BattleScript_MoveEffectParalysis, [MOVE_EFFECT_TOXIC] = BattleScript_MoveEffectToxic, [MOVE_EFFECT_CONFUSION] = BattleScript_MoveEffectConfusion, - [MOVE_EFFECT_FLINCH] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_TRI_ATTACK] = BattleScript_MoveEffectSleep, [MOVE_EFFECT_UPROAR] = BattleScript_MoveEffectUproar, [MOVE_EFFECT_PAYDAY] = BattleScript_MoveEffectPayDay, - [MOVE_EFFECT_CHARGING] = BattleScript_MoveEffectSleep, [MOVE_EFFECT_WRAP] = BattleScript_MoveEffectWrap, - [MOVE_EFFECT_RECOIL_25] = BattleScript_MoveEffectRecoil, - [MOVE_EFFECT_ATK_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_DEF_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SPD_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_ATK_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_DEF_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ACC_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_EVS_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ATK_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_DEF_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SPD_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_ATK_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_DEF_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ACC_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_EVS_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RECHARGE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RAGE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_STEAL_ITEM] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_PREVENT_ESCAPE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_NIGHTMARE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ALL_STATS_UP] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RAPIDSPIN] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_REMOVE_PARALYSIS] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ATK_DEF_DOWN] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RECOIL_33] = BattleScript_MoveEffectRecoil, + [MOVE_EFFECT_FROSTBITE] = BattleScript_MoveEffectFrostbite, }; static const struct WindowTemplate sUnusedWinTemplate = @@ -705,13 +925,6 @@ static const struct WindowTemplate sUnusedWinTemplate = static const u16 sLevelUpBanner_Pal[] = INCBIN_U16("graphics/battle_interface/level_up_banner.gbapal"); static const u32 sLevelUpBanner_Gfx[] = INCBIN_U32("graphics/battle_interface/level_up_banner.4bpp.lz"); -// unused -static const u8 sRubyLevelUpStatBoxStats[] = -{ - MON_DATA_MAX_HP, MON_DATA_SPATK, MON_DATA_ATK, - MON_DATA_SPDEF, MON_DATA_DEF, MON_DATA_SPEED -}; - static const struct OamData sOamData_MonIconOnLvlUpBanner = { .y = 0, @@ -780,18 +993,163 @@ static const u8 sFlailHpScaleToPowerTable[] = 48, 20 }; -static const u16 sNaturePowerMoves[] = +static const u16 sFinalStrikeOnlyEffects[] = { + MOVE_EFFECT_BUG_BITE, + MOVE_EFFECT_STEAL_ITEM, + MOVE_EFFECT_REMOVE_ARG_TYPE, + MOVE_EFFECT_SMACK_DOWN, + MOVE_EFFECT_REMOVE_STATUS, + MOVE_EFFECT_RECOIL_HP_25, + MOVE_EFFECT_PREVENT_ESCAPE, + MOVE_EFFECT_WRAP, +}; + +static const u16 sNaturePowerMoves[BATTLE_TERRAIN_COUNT] = +{ +#if B_NATURE_POWER_MOVES >= GEN_7 + [BATTLE_TERRAIN_GRASS] = MOVE_ENERGY_BALL, + [BATTLE_TERRAIN_LONG_GRASS] = MOVE_ENERGY_BALL, + [BATTLE_TERRAIN_SAND] = MOVE_EARTH_POWER, + [BATTLE_TERRAIN_WATER] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_POND] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_MOUNTAIN] = MOVE_EARTH_POWER, + [BATTLE_TERRAIN_CAVE] = MOVE_EARTH_POWER, + [BATTLE_TERRAIN_BUILDING] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_PLAIN] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_SNOW] = MOVE_ICE_BEAM, +#elif B_NATURE_POWER_MOVES == GEN_6 + [BATTLE_TERRAIN_GRASS] = MOVE_ENERGY_BALL, + [BATTLE_TERRAIN_LONG_GRASS] = MOVE_ENERGY_BALL, + [BATTLE_TERRAIN_SAND] = MOVE_EARTH_POWER, + [BATTLE_TERRAIN_WATER] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_POND] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_MOUNTAIN] = MOVE_EARTH_POWER, + [BATTLE_TERRAIN_CAVE] = MOVE_EARTH_POWER, + [BATTLE_TERRAIN_BUILDING] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_PLAIN] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_SNOW] = MOVE_FROST_BREATH, +#elif B_NATURE_POWER_MOVES == GEN_5 + [BATTLE_TERRAIN_GRASS] = MOVE_SEED_BOMB, + [BATTLE_TERRAIN_LONG_GRASS] = MOVE_SEED_BOMB, + [BATTLE_TERRAIN_SAND] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_WATER] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_POND] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_MOUNTAIN] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_CAVE] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_BUILDING] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_PLAIN] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_SNOW] = MOVE_BLIZZARD, +#elif B_NATURE_POWER_MOVES == GEN_4 + [BATTLE_TERRAIN_GRASS] = MOVE_SEED_BOMB, + [BATTLE_TERRAIN_LONG_GRASS] = MOVE_SEED_BOMB, + [BATTLE_TERRAIN_SAND] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_WATER] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_POND] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_MOUNTAIN] = MOVE_ROCK_SLIDE, + [BATTLE_TERRAIN_CAVE] = MOVE_ROCK_SLIDE, + [BATTLE_TERRAIN_BUILDING] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_PLAIN] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_SNOW] = MOVE_BLIZZARD, +#else // Gen 1-3 [BATTLE_TERRAIN_GRASS] = MOVE_STUN_SPORE, [BATTLE_TERRAIN_LONG_GRASS] = MOVE_RAZOR_LEAF, [BATTLE_TERRAIN_SAND] = MOVE_EARTHQUAKE, - [BATTLE_TERRAIN_UNDERWATER] = MOVE_HYDRO_PUMP, [BATTLE_TERRAIN_WATER] = MOVE_SURF, [BATTLE_TERRAIN_POND] = MOVE_BUBBLE_BEAM, [BATTLE_TERRAIN_MOUNTAIN] = MOVE_ROCK_SLIDE, [BATTLE_TERRAIN_CAVE] = MOVE_SHADOW_BALL, [BATTLE_TERRAIN_BUILDING] = MOVE_SWIFT, - [BATTLE_TERRAIN_PLAIN] = MOVE_SWIFT + [BATTLE_TERRAIN_PLAIN] = MOVE_SWIFT, + [BATTLE_TERRAIN_SNOW] = MOVE_BLIZZARD, +#endif + [BATTLE_TERRAIN_UNDERWATER] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_SOARING] = MOVE_AIR_SLASH, + [BATTLE_TERRAIN_SKY_PILLAR] = MOVE_AIR_SLASH, + [BATTLE_TERRAIN_BURIAL_GROUND] = MOVE_SHADOW_BALL, + [BATTLE_TERRAIN_PUDDLE] = MOVE_MUD_BOMB, + [BATTLE_TERRAIN_MARSH] = MOVE_MUD_BOMB, + [BATTLE_TERRAIN_SWAMP] = MOVE_MUD_BOMB, + [BATTLE_TERRAIN_ICE] = MOVE_ICE_BEAM, + [BATTLE_TERRAIN_VOLCANO] = MOVE_LAVA_PLUME, + [BATTLE_TERRAIN_DISTORTION_WORLD] = MOVE_TRI_ATTACK, + [BATTLE_TERRAIN_SPACE] = MOVE_DRACO_METEOR, + [BATTLE_TERRAIN_ULTRA_SPACE] = MOVE_PSYSHOCK, +}; + +#define _ 0 + +static const struct PickupItem sPickupTable[] = +{// Item 1+ 11+ 21+ 31+ 41+ 51+ 61+ 71+ 81+ 91+ Levels + { ITEM_POTION, { 35, _, _, _, _, _, _, _, _, _, } }, + { ITEM_TINY_MUSHROOM, { 25, 10, _, _, _, _, _, _, _, _, } }, + { ITEM_REPEL, { 8, 30, _, _, _, _, _, _, _, _, } }, + { ITEM_SUPER_POTION, { 8, 10, 30, _, _, _, _, _, _, _, } }, + { ITEM_POKE_DOLL, { 8, 10, 9, 30, _, _, _, _, _, _, } }, + { ITEM_BIG_MUSHROOM, { 3, 10, 9, _, _, _, _, _, _, _, } }, + { ITEM_SUPER_REPEL, { 3, 10, 9, 9, 30, _, _, _, _, _, } }, + { ITEM_FULL_HEAL, { 3, 3, 9, 8, 9, 30, _, _, _, _, } }, + { ITEM_REVIVE, { 3, 3, 3, 8, 8, 9, 30, _, _, _, } }, + { ITEM_HYPER_POTION, { 3, 3, 3, 4, 8, 9, 8, 30, _, _, } }, + { ITEM_ETHER, { 1, 1, 3, 4, 4, _, _, _, _, _, } }, + { ITEM_MAX_REPEL, { _, 3, 3, 4, 4, 9, 8, 8, 30, _, } }, + { ITEM_MOON_STONE, { _, 3, 3, 4, 4, 4, 4, 5, 9, 10, } }, + { ITEM_SUN_STONE, { _, 3, 3, 4, 4, 4, 4, 5, 9, 10, } }, + { ITEM_RARE_CANDY, { _, 1, 1, 1, 1, 4, 4, 5, 4, 5, } }, + { ITEM_NUGGET, { _, _, 3, 4, 4, 4, 4, 5, 4, 5, } }, + { ITEM_MAX_POTION, { _, _, 3, 4, 4, 4, 8, 8, 9, 30, } }, + { ITEM_MAX_ETHER, { _, _, 1, 1, 4, 4, 4, _, _, _, } }, + { ITEM_PP_UP, { _, _, 1, 1, 1, 4, 4, 5, 4, 5, } }, + { ITEM_BIG_NUGGET, { _, _, 1, 1, 1, 1, 4, 5, 4, 5, } }, + { ITEM_DESTINY_KNOT, { _, _, 1, 1, 1, 1, 1, 1, 1, 1, } }, + { ITEM_LEFTOVERS, { _, _, 1, 1, 1, 1, 1, 1, 1, 1, } }, + { ITEM_MENTAL_HERB, { _, _, 1, 1, 1, 1, 1, 1, 1, 1, } }, + { ITEM_POWER_HERB, { _, _, 1, 1, 1, 1, 1, 1, 1, 1, } }, + { ITEM_WHITE_HERB, { _, _, 1, 1, 1, 1, 1, 1, 1, 1, } }, + { ITEM_BALM_MUSHROOM, { _, _, 1, 4, 4, 4, 4, 5, 4, 5, } }, + { ITEM_MAX_REVIVE, { _, _, _, 4, 4, 4, 4, 7, 9, 9, } }, + { ITEM_ELIXIR, { _, _, _, _, 1, 1, 4, 5, 4, 5, } }, + { ITEM_MAX_ELIXIR, { _, _, _, _, _, _, 1, 1, 4, 5, } }, + { ITEM_BOTTLE_CAP, { _, _, _, _, _, _, _, 1, 1, 1, } }, +}; + +#undef _ + +static const u8 sTerrainToType[BATTLE_TERRAIN_COUNT] = +{ + [BATTLE_TERRAIN_GRASS] = TYPE_GRASS, + [BATTLE_TERRAIN_LONG_GRASS] = TYPE_GRASS, + [BATTLE_TERRAIN_SAND] = TYPE_GROUND, + [BATTLE_TERRAIN_UNDERWATER] = TYPE_WATER, + [BATTLE_TERRAIN_WATER] = TYPE_WATER, + [BATTLE_TERRAIN_POND] = TYPE_WATER, + [BATTLE_TERRAIN_CAVE] = TYPE_ROCK, + [BATTLE_TERRAIN_BUILDING] = TYPE_NORMAL, + [BATTLE_TERRAIN_SOARING] = TYPE_FLYING, + [BATTLE_TERRAIN_SKY_PILLAR] = TYPE_FLYING, + [BATTLE_TERRAIN_BURIAL_GROUND] = TYPE_GHOST, + [BATTLE_TERRAIN_PUDDLE] = TYPE_GROUND, + [BATTLE_TERRAIN_MARSH] = TYPE_GROUND, + [BATTLE_TERRAIN_SWAMP] = TYPE_GROUND, + [BATTLE_TERRAIN_SNOW] = TYPE_ICE, + [BATTLE_TERRAIN_ICE] = TYPE_ICE, + [BATTLE_TERRAIN_VOLCANO] = TYPE_FIRE, + [BATTLE_TERRAIN_DISTORTION_WORLD] = TYPE_NORMAL, + [BATTLE_TERRAIN_SPACE] = TYPE_DRAGON, + [BATTLE_TERRAIN_ULTRA_SPACE] = TYPE_PSYCHIC, + [BATTLE_TERRAIN_MOUNTAIN] = (B_CAMOUFLAGE_TYPES >= GEN_5 ? TYPE_GROUND : TYPE_ROCK), + [BATTLE_TERRAIN_PLAIN] = (B_CAMOUFLAGE_TYPES >= GEN_4 ? TYPE_GROUND : TYPE_NORMAL), + // pokefirered, necessary? + [BATTLE_TERRAIN_LINK] = TYPE_NORMAL, + [BATTLE_TERRAIN_GYM] = TYPE_NORMAL, + [BATTLE_TERRAIN_LEADER] = TYPE_NORMAL, + [BATTLE_TERRAIN_INDOOR_2] = TYPE_NORMAL, + [BATTLE_TERRAIN_INDOOR_1] = TYPE_NORMAL, + [BATTLE_TERRAIN_LORELEI] = TYPE_NORMAL, + [BATTLE_TERRAIN_BRUNO] = TYPE_NORMAL, + [BATTLE_TERRAIN_AGATHA] = TYPE_NORMAL, + [BATTLE_TERRAIN_LANCE] = TYPE_NORMAL, + [BATTLE_TERRAIN_CHAMPION] = TYPE_NORMAL, }; // format: min. weight (hectograms), base power @@ -805,62 +1163,98 @@ static const u16 sWeightToDamageTable[] = 0xFFFF, 0xFFFF }; -struct PickupItem +static bool32 NoTargetPresent(u8 battler, u32 move) { - u16 itemId; - u8 chance; -}; + if (!IsBattlerAlive(gBattlerTarget)) + gBattlerTarget = GetMoveTarget(move, NO_TARGET_OVERRIDE); -static const struct PickupItem sPickupItems[] = + switch (GetBattlerMoveTargetType(battler, move)) + { + case MOVE_TARGET_SELECTED: + case MOVE_TARGET_DEPENDS: + case MOVE_TARGET_RANDOM: + if (!IsBattlerAlive(gBattlerTarget)) + return TRUE; + break; + case MOVE_TARGET_BOTH: + if (!IsBattlerAlive(gBattlerTarget) && !IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget))) + return TRUE; + break; + case MOVE_TARGET_FOES_AND_ALLY: + if (!IsBattlerAlive(gBattlerTarget) && !IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) && !IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker))) + return TRUE; + break; + } + + return FALSE; +} + + +// TODO: Convert this to a proper FORM_CHANGE type. +static bool32 TryAegiFormChange(void) { - { ITEM_ORAN_BERRY, 15 }, - { ITEM_CHERI_BERRY, 25 }, - { ITEM_CHESTO_BERRY, 35 }, - { ITEM_PECHA_BERRY, 45 }, - { ITEM_RAWST_BERRY, 55 }, - { ITEM_ASPEAR_BERRY, 65 }, - { ITEM_PERSIM_BERRY, 75 }, - { ITEM_TM10, 80 }, - { ITEM_PP_UP, 85 }, - { ITEM_RARE_CANDY, 90 }, - { ITEM_NUGGET, 95 }, - { ITEM_SPELON_BERRY, 96 }, - { ITEM_PAMTRE_BERRY, 97 }, - { ITEM_WATMEL_BERRY, 98 }, - { ITEM_DURIN_BERRY, 99 }, - { ITEM_BELUE_BERRY, 1 }, + // Only Aegislash with Stance Change can transform, transformed mons cannot. + // if (GetBattlerAbility(gBattlerAttacker) != ABILITY_STANCE_CHANGE + // || gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) + // return FALSE; -}; + // switch (gBattleMons[gBattlerAttacker].species) + // { + // default: + // return FALSE; + // case SPECIES_AEGISLASH_SHIELD: // Shield -> Blade + // if (IS_MOVE_STATUS(gCurrentMove)) + // return FALSE; + // gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_BLADE; + // break; + // case SPECIES_AEGISLASH_BLADE: // Blade -> Shield + // if (gCurrentMove != MOVE_KINGS_SHIELD) + // return FALSE; + // gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_SHIELD; + // break; + // } -static const u8 sTerrainToType[] = + // BattleScriptPushCursor(); + // gBattlescriptCurrInstr = BattleScript_AttackerFormChange; + // return TRUE; + return FALSE; +} + +bool32 ProteanTryChangeType(u32 battler, u32 ability, u32 move, u32 moveType) { - [BATTLE_TERRAIN_GRASS] = TYPE_GRASS, - [BATTLE_TERRAIN_LONG_GRASS] = TYPE_GRASS, - [BATTLE_TERRAIN_SAND] = TYPE_GROUND, - [BATTLE_TERRAIN_UNDERWATER] = TYPE_WATER, - [BATTLE_TERRAIN_WATER] = TYPE_WATER, - [BATTLE_TERRAIN_POND] = TYPE_WATER, - [BATTLE_TERRAIN_MOUNTAIN] = TYPE_ROCK, - [BATTLE_TERRAIN_CAVE] = TYPE_ROCK, - [BATTLE_TERRAIN_BUILDING] = TYPE_NORMAL, - [BATTLE_TERRAIN_PLAIN] = TYPE_NORMAL, -}; + if ((ability == ABILITY_PROTEAN || ability == ABILITY_LIBERO) + && !gDisableStructs[gBattlerAttacker].usedProteanLibero + && (gBattleMons[battler].type1 != moveType || gBattleMons[battler].type2 != moveType + || (gBattleMons[battler].type3 != moveType && gBattleMons[battler].type3 != TYPE_MYSTERY)) + && move != MOVE_STRUGGLE) + { + SET_BATTLER_TYPE(battler, moveType); + return TRUE; + } + return FALSE; +} -// - ITEM_ULTRA_BALL skips Master Ball and ITEM_NONE -static const u8 sBallCatchBonuses[] = +static bool32 IsMoveNotAllowedInSkyBattles(u32 move) { - [ITEM_ULTRA_BALL - ITEM_ULTRA_BALL] = 20, - [ITEM_GREAT_BALL - ITEM_ULTRA_BALL] = 15, - [ITEM_POKE_BALL - ITEM_ULTRA_BALL] = 10, - [ITEM_SAFARI_BALL - ITEM_ULTRA_BALL] = 15 -}; - -// unknown unused data -static const u32 sUnused = 0xFF7EAE60; + return ((gBattleStruct->isSkyBattle) && (gMovesInfo[gCurrentMove].skyBattleBanned)); +} static void Cmd_attackcanceler(void) { - s32 i; + CMD_ARGS(); + + s32 i, moveType; + u16 attackerAbility = GetBattlerAbility(gBattlerAttacker); + GET_MOVE_TYPE(gCurrentMove, moveType); + + // TODO: dynamax + // Weight-based moves are blocked by Dynamax. + // if (IsDynamaxed(gBattlerTarget) && IsMoveBlockedByDynamax(gCurrentMove)) + // { + // BattleScriptPushCursor(); + // gBattlescriptCurrInstr = BattleScript_MoveBlockedByDynamax; + // return; + // } if (gBattleOutcome != 0) { @@ -873,24 +1267,75 @@ static void Cmd_attackcanceler(void) gBattlescriptCurrInstr = BattleScript_MoveEnd; return; } - if (AtkCanceller_UnableToUseMove()) + if (B_STANCE_CHANGE_FAIL < GEN_7 && TryAegiFormChange()) + return; + if (AtkCanceller_UnableToUseMove(moveType)) + return; + + if (WEATHER_HAS_EFFECT && gMovesInfo[gCurrentMove].power) + { + if (moveType == TYPE_FIRE && (gBattleWeather & B_WEATHER_RAIN_PRIMAL)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; + return; + } + else if (moveType == TYPE_WATER && (gBattleWeather & B_WEATHER_SUN_PRIMAL)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; + return; + } + } + + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_OFF + && GetBattlerAbility(gBattlerAttacker) == ABILITY_PARENTAL_BOND + && IsMoveAffectedByParentalBond(gCurrentMove, gBattlerAttacker) + && !(gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + /*&& gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE*/) // TODO: Z-Moves + { + gSpecialStatuses[gBattlerAttacker].parentalBondState = PARENTAL_BOND_1ST_HIT; + gMultiHitCounter = 2; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + return; + } + + // Check Protean activation. + if (ProteanTryChangeType(gBattlerAttacker, attackerAbility, gCurrentMove, moveType)) + { + if (B_PROTEAN_LIBERO == GEN_9) + gDisableStructs[gBattlerAttacker].usedProteanLibero = TRUE; + PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); + gBattlerAbility = gBattlerAttacker; + BattleScriptPushCursor(); + PrepareStringBattle(STRINGID_EMPTYSTRING3, gBattlerAttacker); + gBattleCommunication[MSG_DISPLAY] = 1; + gBattlescriptCurrInstr = BattleScript_ProteanActivates; + return; + } + + if (AtkCanceller_UnableToUseMove2()) return; if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0)) return; - if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_ALLOW_NO_PP | HITMARKER_NO_ATTACKSTRING)) + if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE + && !(gHitMarker & (HITMARKER_ALLOW_NO_PP | HITMARKER_NO_ATTACKSTRING | HITMARKER_NO_PPDEDUCT)) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) { gBattlescriptCurrInstr = BattleScript_NoPPForMove; gMoveResultFlags |= MOVE_RESULT_MISSED; return; } + if (B_STANCE_CHANGE_FAIL >= GEN_7 && TryAegiFormChange()) + return; gHitMarker &= ~HITMARKER_ALLOW_NO_PP; if (!(gHitMarker & HITMARKER_OBEYS) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) { - i = IsMonDisobedient(); // why use the 'i' variable...? - switch (i) + switch (IsMonDisobedient()) { case 0: break; @@ -904,21 +1349,70 @@ static void Cmd_attackcanceler(void) } gHitMarker |= HITMARKER_OBEYS; - - if (gProtectStructs[gBattlerTarget].bounceMove && gBattleMoves[gCurrentMove].flags & FLAG_MAGIC_COAT_AFFECTED) + // Check if no available target present on the field or if Sky Battles ban the move + if ((NoTargetPresent(gBattlerAttacker, gCurrentMove) + && (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) + || (IsMoveNotAllowedInSkyBattles(gCurrentMove))) { - PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); - gProtectStructs[gBattlerTarget].bounceMove = FALSE; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; + if (gMovesInfo[gCurrentMove].effect == EFFECT_FLING) // Edge case for removing a mon's item when there is no target available after using Fling. + gBattlescriptCurrInstr = BattleScript_FlingFailConsumeItem; + else + gBattlescriptCurrInstr = BattleScript_FailedFromAtkString; + + if (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) + CancelMultiTurnMoves(gBattlerAttacker); return; } + if (gProtectStructs[gBattlerTarget].bounceMove + && gMovesInfo[gCurrentMove].magicCoatAffected + && !gProtectStructs[gBattlerAttacker].usesBouncedMove) + { + gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + // Edge case for bouncing a powder move against a grass type pokemon. + SetAtkCancellerForCalledMove(); + if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE)) + { + // Opponent used a prankster'd magic coat -> reflected status move should fail against a dark-type attacker + gBattlerTarget = gBattlerAttacker; + gBattlescriptCurrInstr = BattleScript_MagicCoatBouncePrankster; + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; + } + return; + } + else if (GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE + && gMovesInfo[gCurrentMove].magicCoatAffected + && !gProtectStructs[gBattlerAttacker].usesBouncedMove) + { + gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = 1; + // Edge case for bouncing a powder move against a grass type pokemon. + SetAtkCancellerForCalledMove(); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; + gBattlerAbility = gBattlerTarget; + return; + } + + // Z-moves and Max Moves bypass protection, but deal reduced damage (factored in AccumulateOtherModifiers) + // TODO: Z-Moves and Dynamax + // if ((gBattleStruct->zmove.active || IsMaxMove(gCurrentMove)) + // && IS_BATTLER_PROTECTED(gBattlerTarget)) + // { + // BattleScriptPush(cmd->nextInstr); + // gBattlescriptCurrInstr = BattleScript_CouldntFullyProtect; + // return; + // } + for (i = 0; i < gBattlersCount; i++) { - if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED) + if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gMovesInfo[gCurrentMove].snatchAffected) { - PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH); gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; gBattleScripting.battler = gBattlerByTurnOrder[i]; BattleScriptPushCursor(); @@ -935,59 +1429,87 @@ static void Cmd_attackcanceler(void) gBattlescriptCurrInstr = BattleScript_TookAttack; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } - else if (DEFENDER_IS_PROTECTED - && (gCurrentMove != MOVE_CURSE || IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) - && ((!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))) + else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected) { + gSpecialStatuses[gBattlerTarget].stormDrainRedirected = FALSE; + gLastUsedAbility = ABILITY_STORM_DRAIN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TookAttack; + RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); + } + else if (IsBattlerProtected(gBattlerTarget, gCurrentMove) + && (gCurrentMove != MOVE_CURSE || IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) + && (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) + && gMovesInfo[gCurrentMove].effect != EFFECT_SUCKER_PUNCH + && gMovesInfo[gCurrentMove].effect != EFFECT_UPPER_HAND) + { + if (IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; + + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT) + { + gSpecialStatuses[gBattlerAttacker].parentalBondState = PARENTAL_BOND_OFF; // No second hit if first hit was blocked + gSpecialStatuses[gBattlerAttacker].multiHitOn = 0; + gMultiHitCounter = 0; + } gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void JumpIfMoveFailed(u8 adder, u16 move) +static bool32 JumpIfMoveFailed(u8 adder, u16 move) { - const u8 *BS_ptr = gBattlescriptCurrInstr + adder; if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - BS_ptr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + return TRUE; } else { TrySetDestinyBondToHappen(); if (AbilityBattleEffects(ABILITYEFFECT_ABSORBING, gBattlerTarget, 0, 0, move)) - return; + return TRUE; } - gBattlescriptCurrInstr = BS_ptr; + gBattlescriptCurrInstr += adder; + return FALSE; } -static void Cmd_jumpifaffectedbyprotect(void) +// used to be Cmd_jumpifaffectedbyprotect +static void Cmd_unused5(void) { - if (DEFENDER_IS_PROTECTED) + CMD_ARGS(const u8 *failInstr); + + if (IsBattlerProtected(gBattlerTarget, gCurrentMove)) { gMoveResultFlags |= MOVE_RESULT_MISSED; - JumpIfMoveFailed(5, 0); + JumpIfMoveFailed(sizeof(*cmd), MOVE_NONE); gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; } else { - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static bool8 JumpIfMoveAffectedByProtect(u16 move) { bool8 affected = FALSE; - if (DEFENDER_IS_PROTECTED) + if (IsBattlerProtected(gBattlerTarget, move)) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); @@ -997,43 +1519,81 @@ static bool8 JumpIfMoveAffectedByProtect(u16 move) return affected; } -static bool8 AccuracyCalcHelper(u16 move) +static bool32 AccuracyCalcHelper(u16 move) { - if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) + if ((gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) + || (B_TOXIC_NEVER_MISS >= GEN_6 && gMovesInfo[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON)) + || gStatuses4[gBattlerTarget] & STATUS4_GLAIVE_RUSH) + { + JumpIfMoveFailed(7, move); + return TRUE; + } + // If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits. + else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) + { + if (!JumpIfMoveFailed(7, move)) + RecordAbilityBattle(gBattlerAttacker, ABILITY_NO_GUARD); + return TRUE; + } + // If the target has the ability No Guard and they aren't involved in a Sky Drop or the current move isn't Sky Drop, move hits. + else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) + { + if (!JumpIfMoveFailed(7, move)) + RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD); + return TRUE; + } + // If the target is under the effects of Telekinesis, and the move isn't a OH-KO move, move hits. + else if (gStatuses3[gBattlerTarget] & STATUS3_TELEKINESIS + && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) + && gMovesInfo[move].effect != EFFECT_OHKO) { JumpIfMoveFailed(7, move); return TRUE; } - if (!(gHitMarker & HITMARKER_IGNORE_ON_AIR) && gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) + // TODO: Z-Moves + // if (gBattleStruct->zmove.active && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) + // { + // JumpIfMoveFailed(7, move); + // return TRUE; + // } + + if ((gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) + || ((gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) && !(gMovesInfo[move].damagesAirborne || gMovesInfo[move].damagesAirborneDoubleDamage)) + || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) && !gMovesInfo[move].damagesUnderground) + || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) && !gMovesInfo[move].damagesUnderwater)) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); return TRUE; } - gHitMarker &= ~HITMARKER_IGNORE_ON_AIR; - - if (!(gHitMarker & HITMARKER_IGNORE_UNDERGROUND) && gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) + if (WEATHER_HAS_EFFECT) + { + if ((gMovesInfo[move].effect == EFFECT_THUNDER || gMovesInfo[move].effect == EFFECT_RAIN_ALWAYS_HIT) + && IsBattlerWeatherAffected(gBattlerTarget, B_WEATHER_RAIN)) + { + // thunder/hurricane/genie moves ignore acc checks in rain unless target is holding utility umbrella + JumpIfMoveFailed(7, move); + return TRUE; + } + else if ((gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && gMovesInfo[move].effect == EFFECT_BLIZZARD) + { + // Blizzard ignores acc checks in Hail in Gen4+ + JumpIfMoveFailed(7, move); + return TRUE; + } + } + + if (B_MINIMIZE_DMG_ACC >= GEN_6 + && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) + && gMovesInfo[move].minimizeDoubleDamage) { - gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); return TRUE; } - gHitMarker &= ~HITMARKER_IGNORE_UNDERGROUND; - - if (!(gHitMarker & HITMARKER_IGNORE_UNDERWATER) && gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) - { - gMoveResultFlags |= MOVE_RESULT_MISSED; - JumpIfMoveFailed(7, move); - return TRUE; - } - - gHitMarker &= ~HITMARKER_IGNORE_UNDERWATER; - - if ((WEATHER_HAS_EFFECT && (gBattleWeather & B_WEATHER_RAIN) && gBattleMoves[move].effect == EFFECT_THUNDER) - || (gBattleMoves[move].effect == EFFECT_ALWAYS_HIT || gBattleMoves[move].effect == EFFECT_VITAL_THROW)) + if (gMovesInfo[move].accuracy == 0) { JumpIfMoveFailed(7, move); return TRUE; @@ -1042,106 +1602,205 @@ static bool8 AccuracyCalcHelper(u16 move) return FALSE; } +u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect) +{ + u32 calc, moveAcc; + s8 buff, accStage, evasionStage; + u32 atkParam = GetBattlerHoldEffectParam(battlerAtk); + u32 defParam = GetBattlerHoldEffectParam(battlerDef); + u32 atkAlly = BATTLE_PARTNER(battlerAtk); + u32 atkAllyAbility = GetBattlerAbility(atkAlly); + + gPotentialItemEffectBattler = battlerDef; + accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; + evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; + if (atkAbility == ABILITY_UNAWARE || atkAbility == ABILITY_KEEN_EYE || atkAbility == ABILITY_MINDS_EYE + || (B_ILLUMINATE_EFFECT >= GEN_9 && atkAbility == ABILITY_ILLUMINATE)) + evasionStage = DEFAULT_STAT_STAGE; + if (gMovesInfo[move].ignoresTargetDefenseEvasionStages) + evasionStage = DEFAULT_STAT_STAGE; + if (defAbility == ABILITY_UNAWARE) + accStage = DEFAULT_STAT_STAGE; + + if (gBattleMons[battlerDef].status2 & STATUS2_FORESIGHT || gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED) + buff = accStage; + else + buff = accStage + DEFAULT_STAT_STAGE - evasionStage; + + if (buff < MIN_STAT_STAGE) + buff = MIN_STAT_STAGE; + if (buff > MAX_STAT_STAGE) + buff = MAX_STAT_STAGE; + + moveAcc = gMovesInfo[move].accuracy; + // Check Thunder and Hurricane on sunny weather. + if (IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && gMovesInfo[move].effect == EFFECT_THUNDER) + moveAcc = 50; + // Check Wonder Skin. + if (defAbility == ABILITY_WONDER_SKIN && IS_MOVE_STATUS(move) && moveAcc > 50) + moveAcc = 50; + + calc = gAccuracyStageRatios[buff].dividend * moveAcc; + calc /= gAccuracyStageRatios[buff].divisor; + + // Attacker's ability + switch (atkAbility) + { + case ABILITY_COMPOUND_EYES: + calc = (calc * 130) / 100; // 1.3 compound eyes boost + break; + case ABILITY_VICTORY_STAR: + calc = (calc * 110) / 100; // 1.1 victory star boost + break; + case ABILITY_HUSTLE: + if (IS_MOVE_PHYSICAL(move)) + calc = (calc * 80) / 100; // 1.2 hustle loss + break; + } + + // Target's ability + switch (defAbility) + { + case ABILITY_SAND_VEIL: + if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) + calc = (calc * 80) / 100; // 1.2 sand veil loss + break; + case ABILITY_SNOW_CLOAK: + if (WEATHER_HAS_EFFECT && (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW))) + calc = (calc * 80) / 100; // 1.2 snow cloak loss + break; + case ABILITY_TANGLED_FEET: + if (gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + calc = (calc * 50) / 100; // 1.5 tangled feet loss + break; + } + + // Attacker's ally's ability + switch (atkAllyAbility) + { + case ABILITY_VICTORY_STAR: + if (IsBattlerAlive(atkAlly)) + calc = (calc * 110) / 100; // 1.1 ally's victory star boost + break; + } + + // Attacker's hold effect + switch (atkHoldEffect) + { + case HOLD_EFFECT_WIDE_LENS: + calc = (calc * (100 + atkParam)) / 100; + break; + case HOLD_EFFECT_ZOOM_LENS: + if (GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)) + calc = (calc * (100 + atkParam)) / 100; + break; + } + + // Target's hold effect + switch (defHoldEffect) + { + case HOLD_EFFECT_EVASION_UP: + calc = (calc * (100 - defParam)) / 100; + break; + } + + if (gProtectStructs[battlerAtk].usedMicleBerry) + { + gProtectStructs[battlerAtk].usedMicleBerry = FALSE; + if (atkAbility == ABILITY_RIPEN) + calc = (calc * 140) / 100; // ripen gives 40% acc boost + else + calc = (calc * 120) / 100; // 20% acc boost + } + + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + calc = (calc * 5) / 3; // 1.66 Gravity acc boost + + if (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(battlerDef) == AFFECTION_FIVE_HEARTS) + calc = (calc * 90) / 100; + + return calc; +} + static void Cmd_accuracycheck(void) { - u16 move = T2_READ_16(gBattlescriptCurrInstr + 5); + CMD_ARGS(const u8 *failInstr, u16 move); + u32 type, move = cmd->move; + u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); + u32 abilityAtk = GetBattlerAbility(gBattlerAttacker); + u32 abilityDef = GetBattlerAbility(gBattlerTarget); + u32 holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE); + + // pokefirered specific if ((gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE && !BtlCtrl_OakOldMan_TestState2Flag(1) - && gBattleMoves[move].power != 0 + && gMovesInfo[move].power != 0 && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) || (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE && !BtlCtrl_OakOldMan_TestState2Flag(2) - && gBattleMoves[move].power == 0 + && gMovesInfo[move].power == 0 && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) || (gBattleTypeFlags & BATTLE_TYPE_POKEDUDE)) { JumpIfMoveFailed(7, move); return; } - if (move == NO_ACC_CALC || move == NO_ACC_CALC_CHECK_LOCK_ON) + + if (move == ACC_CURR_MOVE) + move = gCurrentMove; + + if (move == NO_ACC_CALC_CHECK_LOCK_ON) { - if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && move == NO_ACC_CALC_CHECK_LOCK_ON && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) - gBattlescriptCurrInstr += 7; - else if (gStatuses3[gBattlerTarget] & (STATUS3_ON_AIR | STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - else if (!JumpIfMoveAffectedByProtect(0)) - gBattlescriptCurrInstr += 7; + if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) + gBattlescriptCurrInstr = cmd->nextInstr; + else if (gStatuses3[gBattlerTarget] & (STATUS3_SEMI_INVULNERABLE)) + gBattlescriptCurrInstr = cmd->failInstr; + else if (!JumpIfMoveAffectedByProtect(gCurrentMove)) + gBattlescriptCurrInstr = cmd->nextInstr; + } + else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT + || (gSpecialStatuses[gBattlerAttacker].multiHitOn + && (abilityAtk == ABILITY_SKILL_LINK || holdEffectAtk == HOLD_EFFECT_LOADED_DICE + || !(gMovesInfo[move].effect == EFFECT_TRIPLE_KICK || gMovesInfo[move].effect == EFFECT_POPULATION_BOMB)))) + { + // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel/Population Bomb + gBattlescriptCurrInstr = cmd->nextInstr; } else { - u8 type, moveAcc, holdEffect, param; - s8 buff; - u16 calc; - - if (move == ACC_CURR_MOVE) - move = gCurrentMove; + u32 accuracy; GET_MOVE_TYPE(move, type); - if (JumpIfMoveAffectedByProtect(move)) return; if (AccuracyCalcHelper(move)) return; - if (gBattleMons[gBattlerTarget].status2 & STATUS2_FORESIGHT) - { - u8 acc = gBattleMons[gBattlerAttacker].statStages[STAT_ACC]; - buff = acc; - } - else - { - u8 acc = gBattleMons[gBattlerAttacker].statStages[STAT_ACC]; - buff = acc + DEFAULT_STAT_STAGE - gBattleMons[gBattlerTarget].statStages[STAT_EVASION]; - } + accuracy = GetTotalAccuracy( + gBattlerAttacker, + gBattlerTarget, + move, + abilityAtk, + abilityDef, + holdEffectAtk, + GetBattlerHoldEffect(gBattlerTarget, TRUE) + ); - if (buff < MIN_STAT_STAGE) - buff = MIN_STAT_STAGE; - if (buff > MAX_STAT_STAGE) - buff = MAX_STAT_STAGE; - - moveAcc = gBattleMoves[move].accuracy; - // check Thunder on sunny weather - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SUN && gBattleMoves[move].effect == EFFECT_THUNDER) - moveAcc = 50; - - calc = sAccuracyStageRatios[buff].dividend * moveAcc; - calc /= sAccuracyStageRatios[buff].divisor; - - if (gBattleMons[gBattlerAttacker].ability == ABILITY_COMPOUND_EYES) - calc = (calc * 130) / 100; // 1.3 compound eyes boost - if (WEATHER_HAS_EFFECT && gBattleMons[gBattlerTarget].ability == ABILITY_SAND_VEIL && gBattleWeather & B_WEATHER_SANDSTORM) - calc = (calc * 80) / 100; // 1.2 sand veil loss - if (gBattleMons[gBattlerAttacker].ability == ABILITY_HUSTLE && IS_TYPE_PHYSICAL(type)) - calc = (calc * 80) / 100; // 1.2 hustle loss - - if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY) - { - holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; - param = gEnigmaBerries[gBattlerTarget].holdEffectParam; - } - else - { - holdEffect = ItemId_GetHoldEffect(gBattleMons[gBattlerTarget].item); - param = ItemId_GetHoldEffectParam(gBattleMons[gBattlerTarget].item); - } - - gPotentialItemEffectBattler = gBattlerTarget; - - if (holdEffect == HOLD_EFFECT_EVASION_UP) - calc = (calc * (100 - param)) / 100; - - // final calculation - if ((Random() % 100 + 1) > calc) + if (!RandomPercentage(RNG_ACCURACY, accuracy)) { gMoveResultFlags |= MOVE_RESULT_MISSED; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) + if (holdEffectAtk == HOLD_EFFECT_BLUNDER_POLICY) + gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && + (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK; else gBattleCommunication[MISS_TYPE] = B_MSG_MISSED; - CheckWonderGuardAndLevitate(); + if (gMovesInfo[move].power) + CalcTypeEffectivenessMultiplier(move, type, gBattlerAttacker, gBattlerTarget, abilityDef, TRUE); } JumpIfMoveFailed(7, move); } @@ -1149,6 +1808,8 @@ static void Cmd_accuracycheck(void) static void Cmd_attackstring(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; @@ -1157,38 +1818,47 @@ static void Cmd_attackstring(void) PrepareStringBattle(STRINGID_USEDMOVE, gBattlerAttacker); gHitMarker |= HITMARKER_ATTACKSTRING_PRINTED; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 0; } static void Cmd_ppreduce(void) { - s32 ppToDeduct = 1; + CMD_ARGS(); + + s32 i, ppToDeduct = 1; + u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); if (gBattleControllerExecFlags) return; - if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) + if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) + gHitMarker |= HITMARKER_NO_PPDEDUCT; + + if (moveTarget == MOVE_TARGET_BOTH + || moveTarget == MOVE_TARGET_FOES_AND_ALLY + || moveTarget == MOVE_TARGET_ALL_BATTLERS + || gMovesInfo[gCurrentMove].forcePressure) { - switch (gBattleMoves[gCurrentMove].target) + for (i = 0; i < gBattlersCount; i++) { - case MOVE_TARGET_FOES_AND_ALLY: - ppToDeduct += AbilityBattleEffects(ABILITYEFFECT_COUNT_ON_FIELD, gBattlerAttacker, ABILITY_PRESSURE, 0, 0); - break; - case MOVE_TARGET_BOTH: - case MOVE_TARGET_OPPONENTS_FIELD: - ppToDeduct += AbilityBattleEffects(ABILITYEFFECT_COUNT_OTHER_SIDE, gBattlerAttacker, ABILITY_PRESSURE, 0, 0); - break; - default: - if (gBattlerAttacker != gBattlerTarget && gBattleMons[gBattlerTarget].ability == ABILITY_PRESSURE) - ppToDeduct++; - break; + if (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) && IsBattlerAlive(i)) + ppToDeduct += (GetBattlerAbility(i) == ABILITY_PRESSURE); } } + else if (moveTarget != MOVE_TARGET_OPPONENTS_FIELD) + { + if (gBattlerAttacker != gBattlerTarget && GetBattlerAbility(gBattlerTarget) == ABILITY_PRESSURE) + ppToDeduct++; + } if (!(gHitMarker & (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING)) && gBattleMons[gBattlerAttacker].pp[gCurrMovePos]) { - gProtectStructs[gBattlerAttacker].notFirstStrike = 1; + gProtectStructs[gBattlerAttacker].notFirstStrike = TRUE; + + // For item Metronome, echoed voice + if (gCurrentMove != gLastResultingMoves[gBattlerAttacker] || WasUnableToUseMove(gBattlerAttacker)) + gBattleStruct->sameMoveTurns[gBattlerAttacker] = 0; if (gBattleMons[gBattlerAttacker].pp[gCurrMovePos] > ppToDeduct) gBattleMons[gBattlerAttacker].pp[gCurrMovePos] -= ppToDeduct; @@ -1197,7 +1867,6 @@ static void Cmd_ppreduce(void) if (MOVE_IS_PERMANENT(gBattlerAttacker, gCurrMovePos)) { - gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + gCurrMovePos, 0, sizeof(gBattleMons[gBattlerAttacker].pp[gCurrMovePos]), &gBattleMons[gBattlerAttacker].pp[gCurrMovePos]); @@ -1206,79 +1875,114 @@ static void Cmd_ppreduce(void) } gHitMarker &= ~HITMARKER_NO_PPDEDUCT; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } +// The chance is 1/N for each stage. +#if B_CRIT_CHANCE >= GEN_7 + static const u8 sCriticalHitChance[] = {24, 8, 2, 1, 1}; +#elif B_CRIT_CHANCE == GEN_6 + static const u8 sCriticalHitChance[] = {16, 8, 2, 1, 1}; +#else + static const u8 sCriticalHitChance[] = {16, 8, 4, 3, 2}; // Gens 2,3,4,5 +#endif // B_CRIT_CHANCE + +#define BENEFITS_FROM_LEEK(battler, holdEffect)((holdEffect == HOLD_EFFECT_LEEK) && (GET_BASE_SPECIES_ID(gBattleMons[battler].species) == SPECIES_FARFETCHD || gBattleMons[battler].species == SPECIES_SIRFETCHD)) +s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordAbility, u32 abilityAtk, u32 abilityDef, u32 holdEffectAtk) +{ + s32 critChance = 0; + + if (gSideStatuses[battlerDef] & SIDE_STATUS_LUCKY_CHANT + || abilityDef == ABILITY_BATTLE_ARMOR || abilityDef == ABILITY_SHELL_ARMOR) + { + critChance = -1; + } + else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS + || gMovesInfo[gCurrentMove].alwaysCriticalHit + || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) + { + critChance = -2; + } + else + { + critChance = 2 * ((gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY) != 0) + + 1 * ((gBattleMons[battlerAtk].status2 & STATUS2_DRAGON_CHEER) != 0) + + gMovesInfo[gCurrentMove].criticalHitStage + + (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS) + + 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[battlerAtk].species == SPECIES_CHANSEY) + + 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk) + + 2 * (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(battlerAtk) == AFFECTION_FIVE_HEARTS) + + (abilityAtk == ABILITY_SUPER_LUCK) + + gBattleStruct->bonusCritStages[gBattlerAttacker]; + + // Record ability only if move had at least +3 chance to get a crit + if (critChance >= 3 && recordAbility && (abilityDef == ABILITY_BATTLE_ARMOR || abilityDef == ABILITY_SHELL_ARMOR)) + RecordAbilityBattle(battlerDef, abilityDef); + + if (critChance >= ARRAY_COUNT(sCriticalHitChance)) + critChance = ARRAY_COUNT(sCriticalHitChance) - 1; + } + + return critChance; +} + +s32 CalcCritChanceStage(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordAbility) +{ + u32 abilityAtk = GetBattlerAbility(gBattlerAttacker); + u32 abilityDef = GetBattlerAbility(gBattlerTarget); + u32 holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); + return CalcCritChanceStageArgs(battlerAtk, battlerDef, move, recordAbility, abilityAtk, abilityDef, holdEffectAtk); +} +#undef BENEFITS_FROM_LEEK + static void Cmd_critcalc(void) { - u8 holdEffect; - u16 item, critChance; - - item = gBattleMons[gBattlerAttacker].item; - - if (item == ITEM_ENIGMA_BERRY) - holdEffect = gEnigmaBerries[gBattlerAttacker].holdEffect; - else - holdEffect = ItemId_GetHoldEffect(item); + CMD_ARGS(); + u16 partySlot; + s32 critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); gPotentialItemEffectBattler = gBattlerAttacker; - critChance = 2 * ((gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) != 0) - + (gBattleMoves[gCurrentMove].effect == EFFECT_HIGH_CRITICAL) - + (gBattleMoves[gCurrentMove].effect == EFFECT_SKY_ATTACK) - + (gBattleMoves[gCurrentMove].effect == EFFECT_BLAZE_KICK) - + (gBattleMoves[gCurrentMove].effect == EFFECT_POISON_TAIL) - + (holdEffect == HOLD_EFFECT_SCOPE_LENS) - + 2 * (holdEffect == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY) - + 2 * (holdEffect == HOLD_EFFECT_STICK && gBattleMons[gBattlerAttacker].species == SPECIES_FARFETCHD); - - if (critChance >= ARRAY_COUNT(sCriticalHitChance)) - critChance = ARRAY_COUNT(sCriticalHitChance) - 1; - - if ((gBattleMons[gBattlerTarget].ability != ABILITY_BATTLE_ARMOR && gBattleMons[gBattlerTarget].ability != ABILITY_SHELL_ARMOR) - && !(gStatuses3[gBattlerAttacker] & STATUS3_CANT_SCORE_A_CRIT) - && !(gBattleTypeFlags & BATTLE_TYPE_OLD_MAN_TUTORIAL) - && !(Random() % sCriticalHitChance[critChance]) - && (!(gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) || BtlCtrl_OakOldMan_TestState2Flag(1)) - && !(gBattleTypeFlags & BATTLE_TYPE_POKEDUDE)) - { - gCritMultiplier = 2; - gPartyCriticalHits[gBattlerPartyIndexes[gBattlerAttacker]]++; - } + if ((gBattleTypeFlags & (BATTLE_TYPE_OLD_MAN_TUTORIAL | BATTLE_TYPE_POKEDUDE)) + || ((gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) && !BtlCtrl_OakOldMan_TestState2Flag(1))) + gIsCriticalHit = FALSE; + else if (critChance == -1) + gIsCriticalHit = FALSE; + else if (critChance == -2) + gIsCriticalHit = TRUE; else - { - gCritMultiplier = 1; - } + gIsCriticalHit = RandomWeighted(RNG_CRITICAL_HIT, sCriticalHitChance[critChance] - 1, 1); - gBattlescriptCurrInstr++; + // Counter for EVO_CRITICAL_HITS. + partySlot = gBattlerPartyIndexes[gBattlerAttacker]; + if (gIsCriticalHit && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER + && !(gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBattlerPosition(gBattlerAttacker) == B_POSITION_PLAYER_LEFT)) + gPartyCriticalHits[partySlot]++; + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_damagecalc(void) { - u16 sideStatus = gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)]; - gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, - sideStatus, gDynamicBasePower, - gBattleStruct->dynamicMoveType, gBattlerAttacker, gBattlerTarget); - gBattleMoveDamage = gBattleMoveDamage * gCritMultiplier * gBattleScripting.dmgMultiplier; + CMD_ARGS(); - if (gStatuses3[gBattlerAttacker] & STATUS3_CHARGED_UP && gBattleMoves[gCurrentMove].type == TYPE_ELECTRIC) - gBattleMoveDamage *= 2; - if (gProtectStructs[gBattlerAttacker].helpingHand) - gBattleMoveDamage = gBattleMoveDamage * 15 / 10; + u8 moveType; - gBattlescriptCurrInstr++; + GET_MOVE_TYPE(gCurrentMove, moveType); + gBattleMoveDamage = CalculateMoveDamage(gCurrentMove, gBattlerAttacker, gBattlerTarget, moveType, 0, gIsCriticalHit, TRUE, TRUE); + gBattlescriptCurrInstr = cmd->nextInstr; } void AI_CalcDmg(u8 attacker, u8 defender) { - u16 sideStatus = gSideStatuses[GET_BATTLER_SIDE(defender)]; - gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[attacker], &gBattleMons[defender], gCurrentMove, + u32 sideStatus = gSideStatuses[GET_BATTLER_SIDE(defender)]; + gBattleMoveDamage = CalculateBaseDamageOld(&gBattleMons[attacker], &gBattleMons[defender], gCurrentMove, sideStatus, gDynamicBasePower, gBattleStruct->dynamicMoveType, attacker, defender); gDynamicBasePower = 0; gBattleMoveDamage = gBattleMoveDamage * gCritMultiplier * gBattleScripting.dmgMultiplier; - if (gStatuses3[attacker] & STATUS3_CHARGED_UP && gBattleMoves[gCurrentMove].type == TYPE_ELECTRIC) + if (gStatuses3[attacker] & STATUS3_CHARGED_UP && gMovesInfo[gCurrentMove].type == TYPE_ELECTRIC) gBattleMoveDamage *= 2; if (gProtectStructs[attacker].helpingHand) gBattleMoveDamage = gBattleMoveDamage * 15 / 10; @@ -1298,7 +2002,7 @@ static void ModulateDmgByType(u8 multiplier) gMoveResultFlags &= ~MOVE_RESULT_SUPER_EFFECTIVE; break; case TYPE_MUL_NOT_EFFECTIVE: - if (gBattleMoves[gCurrentMove].power && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (gMovesInfo[gCurrentMove].power && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { if (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) gMoveResultFlags &= ~MOVE_RESULT_SUPER_EFFECTIVE; @@ -1307,7 +2011,7 @@ static void ModulateDmgByType(u8 multiplier) } break; case TYPE_MUL_SUPER_EFFECTIVE: - if (gBattleMoves[gCurrentMove].power && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (gMovesInfo[gCurrentMove].power && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE) gMoveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE; @@ -1320,73 +2024,14 @@ static void ModulateDmgByType(u8 multiplier) static void Cmd_typecalc(void) { - s32 i = 0; + CMD_ARGS(); + u8 moveType; - if (gCurrentMove == MOVE_STRUGGLE) - { - gBattlescriptCurrInstr++; - return; - } - GET_MOVE_TYPE(gCurrentMove, moveType); + CalcTypeEffectivenessMultiplier(gCurrentMove, moveType, gBattlerAttacker, gBattlerTarget, GetBattlerAbility(gBattlerTarget), TRUE); - // check stab - if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType)) - { - gBattleMoveDamage = gBattleMoveDamage * 15; - gBattleMoveDamage = gBattleMoveDamage / 10; - } - - if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND) - { - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); - gLastLandedMoves[gBattlerTarget] = 0; - gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } - else - { - while (TYPE_EFFECT_ATK_TYPE(i) != TYPE_ENDTABLE) - { - if (TYPE_EFFECT_ATK_TYPE(i) == TYPE_FORESIGHT) - { - if (gBattleMons[gBattlerTarget].status2 & STATUS2_FORESIGHT) - break; - i += 3; - continue; - } - else if (TYPE_EFFECT_ATK_TYPE(i) == moveType) - { - // check type1 - if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1) - ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i)); - // check type2 - if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 && - gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2) - ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i)); - } - i += 3; - } - } - - if (gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD && AttacksThisTurn(gBattlerAttacker, gCurrentMove) == 2 - && (!(gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) || ((gMoveResultFlags & (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE)) == (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE))) - && gBattleMoves[gCurrentMove].power) - { - gLastUsedAbility = ABILITY_WONDER_GUARD; - gMoveResultFlags |= MOVE_RESULT_MISSED; - gLastLandedMoves[gBattlerTarget] = 0; - gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } - if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) - gProtectStructs[gBattlerAttacker].targetNotAffected = 1; - - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void CheckWonderGuardAndLevitate(void) @@ -1395,7 +2040,7 @@ static void CheckWonderGuardAndLevitate(void) s32 i = 0; u8 moveType; - if (gCurrentMove == MOVE_STRUGGLE || !gBattleMoves[gCurrentMove].power) + if (gCurrentMove == MOVE_STRUGGLE || !gMovesInfo[gCurrentMove].power) return; GET_MOVE_TYPE(gCurrentMove, moveType); @@ -1455,7 +2100,7 @@ static void CheckWonderGuardAndLevitate(void) if (gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD && AttacksThisTurn(gBattlerAttacker, gCurrentMove) == 2) { - if (((flags & 2) || !(flags & 1)) && gBattleMoves[gCurrentMove].power) + if (((flags & 2) || !(flags & 1)) && gMovesInfo[gCurrentMove].power) { gLastUsedAbility = ABILITY_WONDER_GUARD; gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; @@ -1479,7 +2124,7 @@ static void ModulateDmgByType2(u8 multiplier, u16 move, u8 *flags) *flags &= ~MOVE_RESULT_SUPER_EFFECTIVE; break; case TYPE_MUL_NOT_EFFECTIVE: - if (gBattleMoves[move].power && !(*flags & MOVE_RESULT_NO_EFFECT)) + if (gMovesInfo[move].power && !(*flags & MOVE_RESULT_NO_EFFECT)) { if (*flags & MOVE_RESULT_SUPER_EFFECTIVE) *flags &= ~MOVE_RESULT_SUPER_EFFECTIVE; @@ -1488,7 +2133,7 @@ static void ModulateDmgByType2(u8 multiplier, u16 move, u8 *flags) } break; case TYPE_MUL_SUPER_EFFECTIVE: - if (gBattleMoves[move].power && !(*flags & MOVE_RESULT_NO_EFFECT)) + if (gMovesInfo[move].power && !(*flags & MOVE_RESULT_NO_EFFECT)) { if (*flags & MOVE_RESULT_NOT_VERY_EFFECTIVE) *flags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE; @@ -1508,7 +2153,7 @@ u8 TypeCalc(u16 move, u8 attacker, u8 defender) if (move == MOVE_STRUGGLE) return 0; - moveType = gBattleMoves[move].type; + moveType = gMovesInfo[move].type; // check stab if (IS_BATTLER_OF_TYPE(attacker, moveType)) @@ -1550,7 +2195,7 @@ u8 TypeCalc(u16 move, u8 attacker, u8 defender) if (gBattleMons[defender].ability == ABILITY_WONDER_GUARD && !(flags & MOVE_RESULT_MISSED) && AttacksThisTurn(attacker, move) == 2 && (!(flags & MOVE_RESULT_SUPER_EFFECTIVE) || ((flags & (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE)) == (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE))) - && gBattleMoves[move].power) + && gMovesInfo[move].power) { flags |= MOVE_RESULT_MISSED; } @@ -1567,7 +2212,7 @@ u8 AI_TypeCalc(u16 move, u16 targetSpecies, u16 targetAbility) if (move == MOVE_STRUGGLE) return 0; - moveType = gBattleMoves[move].type; + moveType = gMovesInfo[move].type; if (targetAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) { @@ -1596,7 +2241,7 @@ u8 AI_TypeCalc(u16 move, u16 targetSpecies, u16 targetAbility) } if (targetAbility == ABILITY_WONDER_GUARD && (!(flags & MOVE_RESULT_SUPER_EFFECTIVE) || ((flags & (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE)) == (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE))) - && gBattleMoves[move].power) + && gMovesInfo[move].power) flags |= MOVE_RESULT_DOESNT_AFFECT_FOE; return flags; } @@ -1621,126 +2266,245 @@ static void Unused_ApplyRandomDmgMultiplier(void) ApplyRandomDmgMultiplier(); } -static void Cmd_adjustnormaldamage(void) +static void Cmd_adjustdamage(void) { + CMD_ARGS(); + u8 holdEffect, param; + u32 moveType; + u32 affectionScore = GetBattlerAffectionHearts(gBattlerTarget); + u32 rand = Random() % 100; - ApplyRandomDmgMultiplier(); + GET_MOVE_TYPE(gCurrentMove, moveType); - if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY) + if (DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) + goto END; + if (DoesDisguiseBlockMove(gBattlerTarget, gCurrentMove)) { - holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; - param = gEnigmaBerries[gBattlerTarget].holdEffectParam; + gBattleStruct->enduredDamage |= gBitTable[gBattlerTarget]; + goto END; } - else + if (GetBattlerAbility(gBattlerTarget) == ABILITY_ICE_FACE && IS_MOVE_PHYSICAL(gCurrentMove) && gBattleMons[gBattlerTarget].species == SPECIES_EISCUE) { - holdEffect = ItemId_GetHoldEffect(gBattleMons[gBattlerTarget].item); - param = ItemId_GetHoldEffectParam(gBattleMons[gBattlerTarget].item); + // Damage deals typeless 0 HP. + gMoveResultFlags &= ~(MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE); + gBattleMoveDamage = 0; + RecordAbilityBattle(gBattlerTarget, ABILITY_ICE_FACE); + gBattleResources->flags->flags[gBattlerTarget] |= RESOURCE_FLAG_ICE_FACE; + // Form change will be done after attack animation in Cmd_resultmessage. + goto END; } + if (gBattleMons[gBattlerTarget].hp > gBattleMoveDamage) + goto END; + + holdEffect = GetBattlerHoldEffect(gBattlerTarget, TRUE); + param = GetBattlerHoldEffectParam(gBattlerTarget); gPotentialItemEffectBattler = gBattlerTarget; - if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) + if (holdEffect == HOLD_EFFECT_FOCUS_BAND && rand < param) { RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; } - if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE) - && (gBattleMoves[gCurrentMove].effect == EFFECT_FALSE_SWIPE || gProtectStructs[gBattlerTarget].endured || gSpecialStatuses[gBattlerTarget].focusBanded) - && gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage) + else if (B_STURDY >= GEN_5 && GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget)) { - gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; - if (gProtectStructs[gBattlerTarget].endured) + RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); + gSpecialStatuses[gBattlerTarget].sturdied = TRUE; + } + else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) + { + RecordItemEffectBattle(gBattlerTarget, holdEffect); + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; + } + else if (B_AFFECTION_MECHANICS == TRUE && GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER && affectionScore >= AFFECTION_THREE_HEARTS) + { + if ((affectionScore == AFFECTION_FIVE_HEARTS && rand < 20) + || (affectionScore == AFFECTION_FOUR_HEARTS && rand < 15) + || (affectionScore == AFFECTION_THREE_HEARTS && rand < 10)) + gSpecialStatuses[gBattlerTarget].affectionEndured = TRUE; + } + + if (gMovesInfo[gCurrentMove].effect != EFFECT_FALSE_SWIPE + && !gProtectStructs[gBattlerTarget].endured + && !gSpecialStatuses[gBattlerTarget].focusBanded + && !gSpecialStatuses[gBattlerTarget].focusSashed + && (B_AFFECTION_MECHANICS == FALSE || !gSpecialStatuses[gBattlerTarget].affectionEndured) + && !gSpecialStatuses[gBattlerTarget].sturdied) + goto END; + + // Handle reducing the dmg to 1 hp. + gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; + gBattleStruct->enduredDamage |= gBitTable[gBattlerTarget]; + + if (gProtectStructs[gBattlerTarget].endured) + { + gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED; + } + else if (gSpecialStatuses[gBattlerTarget].focusBanded || gSpecialStatuses[gBattlerTarget].focusSashed) + { + gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON; + gLastUsedItem = gBattleMons[gBattlerTarget].item; + } + else if (gSpecialStatuses[gBattlerTarget].sturdied) + { + gMoveResultFlags |= MOVE_RESULT_STURDIED; + gLastUsedAbility = ABILITY_STURDY; + } + else if (B_AFFECTION_MECHANICS == TRUE && gSpecialStatuses[gBattlerTarget].affectionEndured) + { + gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED_AFFECTION; + } + +END: + gBattlescriptCurrInstr = cmd->nextInstr; + + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMoveDamage >= 1) + gSpecialStatuses[gBattlerAttacker].damagedMons |= gBitTable[gBattlerTarget]; + + // Check gems and damage reducing berries. + if (gSpecialStatuses[gBattlerTarget].berryReduced + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].item) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryReduceDmg; + gLastUsedItem = gBattleMons[gBattlerTarget].item; + } + if (gSpecialStatuses[gBattlerAttacker].gemBoost + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].item + && gMovesInfo[gCurrentMove].effect != EFFECT_PLEDGE + && gCurrentMove != MOVE_STRUGGLE) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_GemActivates; + gLastUsedItem = gBattleMons[gBattlerAttacker].item; + } + + // B_WEATHER_STRONG_WINDS prints a string when it's about to reduce the power + // of a move that is Super Effective against a Flying-type Pokémon. + if (gBattleWeather & B_WEATHER_STRONG_WINDS) + { + if ((GetBattlerType(gBattlerTarget, 0) == TYPE_FLYING + && GetTypeModifier(moveType, GetBattlerType(gBattlerTarget, 0)) >= UQ_4_12(2.0)) + || (GetBattlerType(gBattlerTarget, 1) == TYPE_FLYING + && GetTypeModifier(moveType, GetBattlerType(gBattlerTarget, 1)) >= UQ_4_12(2.0)) + || (GetBattlerType(gBattlerTarget, 2) == TYPE_FLYING + && GetTypeModifier(moveType, GetBattlerType(gBattlerTarget, 2)) >= UQ_4_12(2.0))) { - gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED; - } - else if (gSpecialStatuses[gBattlerTarget].focusBanded) - { - gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON; - gLastUsedItem = gBattleMons[gBattlerTarget].item; + gBattlerAbility = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AttackWeakenedByStrongWinds; } } - gBattlescriptCurrInstr++; } -// The same as adjustnormaldamage except it doesn't check for false swipe move effect. -static void Cmd_adjustnormaldamage2(void) +static void Cmd_multihitresultmessage(void) { - u8 holdEffect, param; + CMD_ARGS(); - ApplyRandomDmgMultiplier(); + if (gBattleControllerExecFlags) + return; - if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY) + if (!(gMoveResultFlags & MOVE_RESULT_FAILED) && !(gMoveResultFlags & MOVE_RESULT_FOE_ENDURED)) { - holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; - param = gEnigmaBerries[gBattlerTarget].holdEffectParam; - } - else - { - holdEffect = ItemId_GetHoldEffect(gBattleMons[gBattlerTarget].item); - param = ItemId_GetHoldEffectParam(gBattleMons[gBattlerTarget].item); - } - - gPotentialItemEffectBattler = gBattlerTarget; - - if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) - { - RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusBanded = 1; - } - if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE) - && (gProtectStructs[gBattlerTarget].endured || gSpecialStatuses[gBattlerTarget].focusBanded) - && gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage) - { - gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; - if (gProtectStructs[gBattlerTarget].endured) + if (gMoveResultFlags & MOVE_RESULT_STURDIED) { - gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED; + gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); + gSpecialStatuses[gBattlerTarget].sturdied = FALSE; // Delete this line to make Sturdy last for the duration of the whole move turn. + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SturdiedMsg; + return; } - else if (gSpecialStatuses[gBattlerTarget].focusBanded) + else if (gMoveResultFlags & MOVE_RESULT_FOE_HUNG_ON) { - gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON; gLastUsedItem = gBattleMons[gBattlerTarget].item; + gPotentialItemEffectBattler = gBattlerTarget; + gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); + gSpecialStatuses[gBattlerTarget].focusBanded = FALSE; // Delete this line to make Focus Band last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusSashed = FALSE; // Delete this line to make Focus Sash last for the duration of the whole move turn. + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_HangedOnMsg; + return; } } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; + + // Print berry reducing message after result message. + if (gSpecialStatuses[gBattlerTarget].berryReduced + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; + } } static void Cmd_attackanimation(void) { + CMD_ARGS(); + + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + if (gBattleControllerExecFlags) return; - if ((gHitMarker & HITMARKER_NO_ANIMATIONS) && (gCurrentMove != MOVE_TRANSFORM && gCurrentMove != MOVE_SUBSTITUTE)) + if ((gHitMarker & (HITMARKER_NO_ANIMATIONS | HITMARKER_DISABLE_ANIMATION)) + && gCurrentMove != MOVE_TRANSFORM + && gCurrentMove != MOVE_SUBSTITUTE + && gCurrentMove != MOVE_ALLY_SWITCH + // In a wild double battle gotta use the teleport animation if two wild pokemon are alive. + && !(gCurrentMove == MOVE_TELEPORT && WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker)))) { - BattleScriptPush(gBattlescriptCurrInstr + 1); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_Pausex20; gBattleScripting.animTurn++; gBattleScripting.animTargetsHit++; } else { - if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS) + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT) // No animation on second hit + { + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + + if ((moveTarget & MOVE_TARGET_BOTH + || moveTarget & MOVE_TARGET_FOES_AND_ALLY + || moveTarget & MOVE_TARGET_DEPENDS) && gBattleScripting.animTargetsHit) { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; return; } if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { + u8 multihit; + + if (gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE) + multihit = gMultiHitCounter; + else if (gMultiHitCounter != 0 && gMultiHitCounter != 1) + { + if (gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage) + multihit = 1; + else + multihit = gMultiHitCounter; + } + else + multihit = gMultiHitCounter; + gActiveBattler = gBattlerAttacker; - BtlController_EmitMoveAnimation(BUFFER_A, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker]); + BtlController_EmitMoveAnimation(BUFFER_A, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker], multihit); gBattleScripting.animTurn++; gBattleScripting.animTargetsHit++; MarkBattlerForControllerExec(gBattlerAttacker); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - BattleScriptPush(gBattlescriptCurrInstr + 1); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_Pausex20; } } @@ -1748,202 +2512,236 @@ static void Cmd_attackanimation(void) static void Cmd_waitanimation(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags == 0) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_healthbarupdate(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags) return; - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + u32 battler = GetBattlerForBattleScript(cmd->battler); + gActiveBattler = battler; - if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) + if (DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && gDisableStructs[battler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) { - PrepareStringBattle(STRINGID_SUBSTITUTEDAMAGED, gActiveBattler); + PrepareStringBattle(STRINGID_SUBSTITUTEDAMAGED, battler); } - else + else if (!DoesDisguiseBlockMove(battler, gCurrentMove)) { - s16 healthValue; - - s32 currDmg = gBattleMoveDamage; - s32 maxPossibleDmgValue = 10000; // not present in R/S, ensures that huge damage values don't change sign - - if (currDmg <= maxPossibleDmgValue) - healthValue = currDmg; - else - healthValue = maxPossibleDmgValue; + s16 healthValue = min(gBattleMoveDamage, 10000); // Max damage (10000) not present in R/S, ensures that huge damage values don't change sign BtlController_EmitHealthBarUpdate(BUFFER_A, healthValue); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); - if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleMoveDamage > 0) + if (GetBattlerSide(battler) == B_SIDE_PLAYER && gBattleMoveDamage > 0) gBattleResults.playerMonWasDamaged = TRUE; } } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_datahpupdate(void) { - u32 moveType; + CMD_ARGS(u8 battler); + + u32 battler; if (gBattleControllerExecFlags) return; - if (gBattleStruct->dynamicMoveType == 0) - moveType = gBattleMoves[gCurrentMove].type; - else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_1)) - moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; - else - moveType = gBattleMoves[gCurrentMove].type; - - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) + battler = GetBattlerForBattleScript(cmd->battler); + gActiveBattler = battler; + if (DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && gDisableStructs[battler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) { - if (gDisableStructs[gActiveBattler].substituteHP >= gBattleMoveDamage) + if (gDisableStructs[battler].substituteHP >= gBattleMoveDamage) { - if (gSpecialStatuses[gActiveBattler].dmg == 0) - gSpecialStatuses[gActiveBattler].dmg = gBattleMoveDamage; - gDisableStructs[gActiveBattler].substituteHP -= gBattleMoveDamage; + if (gSpecialStatuses[battler].shellBellDmg == 0) + gSpecialStatuses[battler].shellBellDmg = gBattleMoveDamage; + gDisableStructs[battler].substituteHP -= gBattleMoveDamage; gHpDealt = gBattleMoveDamage; } else { - if (gSpecialStatuses[gActiveBattler].dmg == 0) - gSpecialStatuses[gActiveBattler].dmg = gDisableStructs[gActiveBattler].substituteHP; - gHpDealt = gDisableStructs[gActiveBattler].substituteHP; - gDisableStructs[gActiveBattler].substituteHP = 0; + if (gSpecialStatuses[battler].shellBellDmg == 0) + gSpecialStatuses[battler].shellBellDmg = gDisableStructs[battler].substituteHP; + gHpDealt = gDisableStructs[battler].substituteHP; + gDisableStructs[battler].substituteHP = 0; } // check substitute fading - if (gDisableStructs[gActiveBattler].substituteHP == 0) + if (gDisableStructs[battler].substituteHP == 0) { - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SubstituteFade; return; } } + else if (DoesDisguiseBlockMove(battler, gCurrentMove)) + { + // TODO: Convert this to a proper FORM_CHANGE type. + u32 side = GetBattlerSide(battler); + gBattleScripting.battler = battler; + if (gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] == SPECIES_NONE) + gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] = gBattleMons[battler].species; + // TODO: Totems + // if (gBattleMons[battler].species == SPECIES_MIMIKYU_TOTEM_DISGUISED) + // gBattleMons[battler].species = SPECIES_MIMIKYU_TOTEM_BUSTED; + // else + // gBattleMons[battler].species = SPECIES_MIMIKYU_BUSTED; + gBattleMons[battler].species = SPECIES_MIMIKYU_BUSTED; + if (B_DISGUISE_HP_LOSS >= GEN_8) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 8; + gBattleMoveDamage = gBattleMons[battler].maxHP / 8; + } + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_TargetFormChange; + return; + } else { gHitMarker &= ~HITMARKER_IGNORE_SUBSTITUTE; - if (gBattleMoveDamage < 0) // hp goes up + if (gBattleMoveDamage < 0) { - gBattleMons[gActiveBattler].hp -= gBattleMoveDamage; - if (gBattleMons[gActiveBattler].hp > gBattleMons[gActiveBattler].maxHP) - gBattleMons[gActiveBattler].hp = gBattleMons[gActiveBattler].maxHP; - + // Negative damage is HP gain + gBattleMons[battler].hp += -gBattleMoveDamage; + if (gBattleMons[battler].hp > gBattleMons[battler].maxHP) + gBattleMons[battler].hp = gBattleMons[battler].maxHP; } - else // hp goes down + else { - if (gHitMarker & HITMARKER_SKIP_DMG_TRACK) + if (gHitMarker & HITMARKER_IGNORE_BIDE) { - gHitMarker &= ~HITMARKER_SKIP_DMG_TRACK; + gHitMarker &= ~HITMARKER_IGNORE_BIDE; } else { - gTakenDmg[gActiveBattler] += gBattleMoveDamage; - if (gBattlescriptCurrInstr[1] == BS_TARGET) - gTakenDmgByBattler[gActiveBattler] = gBattlerAttacker; + gBideDmg[battler] += gBattleMoveDamage; + if (cmd->battler == BS_TARGET) + gBideTarget[battler] = gBattlerAttacker; else - gTakenDmgByBattler[gActiveBattler] = gBattlerTarget; + gBideTarget[battler] = gBattlerTarget; } - if (gBattleMons[gActiveBattler].hp > gBattleMoveDamage) + // Deal damage to the battler + if (gBattleMons[battler].hp > gBattleMoveDamage) { - gBattleMons[gActiveBattler].hp -= gBattleMoveDamage; + gBattleMons[battler].hp -= gBattleMoveDamage; gHpDealt = gBattleMoveDamage; } else { - gHpDealt = gBattleMons[gActiveBattler].hp; - gBattleMons[gActiveBattler].hp = 0; + gHpDealt = gBattleMons[battler].hp; + gBattleMons[battler].hp = 0; } - if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) - gSpecialStatuses[gActiveBattler].dmg = gHpDealt; + // Record damage for Shell Bell + if (gSpecialStatuses[battler].shellBellDmg == 0 && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) + gSpecialStatuses[battler].shellBellDmg = gHpDealt; - if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT) + // Note: While physicalDmg/specialDmg below are only distinguished between for Counter/Mirror Coat, they are + // used in combination as general damage trackers for other purposes. specialDmg is additionally used + // to help determine if a fire move should defrost the target. + if (IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gMovesInfo[gCurrentMove].effect != EFFECT_PAIN_SPLIT) { - gProtectStructs[gActiveBattler].physicalDmg = gHpDealt; - gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt; - if (gBattlescriptCurrInstr[1] == BS_TARGET) + gProtectStructs[battler].physicalDmg = gHpDealt; + gSpecialStatuses[battler].physicalDmg = gHpDealt; + if (cmd->battler == BS_TARGET) { - gProtectStructs[gActiveBattler].physicalBattlerId = gBattlerAttacker; - gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerAttacker; + gProtectStructs[battler].physicalBattlerId = gBattlerAttacker; + gSpecialStatuses[battler].physicalBattlerId = gBattlerAttacker; } else { - gProtectStructs[gActiveBattler].physicalBattlerId = gBattlerTarget; - gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget; + gProtectStructs[battler].physicalBattlerId = gBattlerTarget; + gSpecialStatuses[battler].physicalBattlerId = gBattlerTarget; } } - else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) + else if (!IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gMovesInfo[gCurrentMove].effect != EFFECT_PAIN_SPLIT) { - gProtectStructs[gActiveBattler].specialDmg = gHpDealt; - gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt; - if (gBattlescriptCurrInstr[1] == BS_TARGET) + // Record special damage/attacker for Mirror Coat + gProtectStructs[battler].specialDmg = gHpDealt; + gSpecialStatuses[battler].specialDmg = gHpDealt; + if (cmd->battler == BS_TARGET) { - gProtectStructs[gActiveBattler].specialBattlerId = gBattlerAttacker; - gSpecialStatuses[gActiveBattler].specialBattlerId = gBattlerAttacker; + gProtectStructs[battler].specialBattlerId = gBattlerAttacker; + gSpecialStatuses[battler].specialBattlerId = gBattlerAttacker; } else { - gProtectStructs[gActiveBattler].specialBattlerId = gBattlerTarget; - gSpecialStatuses[gActiveBattler].specialBattlerId = gBattlerTarget; + gProtectStructs[battler].specialBattlerId = gBattlerTarget; + gSpecialStatuses[battler].specialBattlerId = gBattlerTarget; } } } gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp); - MarkBattlerForControllerExec(gActiveBattler); + + // Send updated HP + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[battler].hp), &gBattleMons[battler].hp); + MarkBattlerForControllerExec(battler); } } else { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - if (gSpecialStatuses[gActiveBattler].dmg == 0) - gSpecialStatuses[gActiveBattler].dmg = 0xFFFF; + // MOVE_RESULT_NO_EFFECT was set + battler = GetBattlerForBattleScript(cmd->battler); + if (gSpecialStatuses[battler].shellBellDmg == 0) + gSpecialStatuses[battler].shellBellDmg = IGNORE_SHELL_BELL; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_critmessage(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags == 0) { - if (gCritMultiplier == 2 && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (gIsCriticalHit == TRUE && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { PrepareStringBattle(STRINGID_CRITICALHIT, gBattlerAttacker); + + // Signal for the trainer slide-in system. + if (GetBattlerSide(gBattlerTarget) != B_SIDE_PLAYER && gBattleStruct->trainerSlideFirstCriticalHitMsgState != 2) + gBattleStruct->trainerSlideFirstCriticalHitMsgState = 1; + gBattleCommunication[MSG_DISPLAY] = 1; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_effectivenesssound(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; gActiveBattler = gBattlerTarget; if (!(gMoveResultFlags & MOVE_RESULT_MISSED)) { - switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED)) + switch (gMoveResultFlags & ~MOVE_RESULT_MISSED) { case MOVE_RESULT_SUPER_EFFECTIVE: BtlController_EmitPlaySE(BUFFER_A, SE_SUPER_EFFECTIVE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); break; case MOVE_RESULT_NOT_VERY_EFFECTIVE: BtlController_EmitPlaySE(BUFFER_A, SE_NOT_EFFECTIVE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); break; case MOVE_RESULT_DOESNT_AFFECT_FOE: case MOVE_RESULT_FAILED: @@ -1952,51 +2750,76 @@ static void Cmd_effectivenesssound(void) case MOVE_RESULT_FOE_ENDURED: case MOVE_RESULT_ONE_HIT_KO: case MOVE_RESULT_FOE_HUNG_ON: + case MOVE_RESULT_STURDIED: default: if (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) { BtlController_EmitPlaySE(BUFFER_A, SE_SUPER_EFFECTIVE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); } else if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE) { BtlController_EmitPlaySE(BUFFER_A, SE_NOT_EFFECTIVE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); } else if (!(gMoveResultFlags & (MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED))) { BtlController_EmitPlaySE(BUFFER_A, SE_EFFECTIVE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); } break; } } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_resultmessage(void) { - u32 stringId = 0; + CMD_ARGS(); + u32 stringId = 0; if (gBattleControllerExecFlags) return; + // TODO: Convert this to a proper FORM_CHANGE type. + // Do Ice Face form change which was set up in Cmd_adjustdamage. + if (gBattleResources->flags->flags[gBattlerTarget] & RESOURCE_FLAG_ICE_FACE) + { + gBattleResources->flags->flags[gBattlerTarget] &= ~(RESOURCE_FLAG_ICE_FACE); + gBattleMons[gBattlerTarget].species = SPECIES_EISCUE_NOICE_FACE; + gBattleScripting.battler = gBattlerTarget; // For STRINGID_PKMNTRANSFORMED + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_IceFaceNullsDamage; + return; + } + if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK)) { + // TODO: Ability Popup + // if (gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK) // Wonder Guard or Levitate - show the ability pop-up + // CreateAbilityPopUp(gBattlerTarget, gBattleMons[gBattlerTarget].ability, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0); stringId = gMissStringIds[gBattleCommunication[MISS_TYPE]]; gBattleCommunication[MSG_DISPLAY] = 1; } else { gBattleCommunication[MSG_DISPLAY] = 1; - switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED)) + switch (gMoveResultFlags & ~MOVE_RESULT_MISSED) { case MOVE_RESULT_SUPER_EFFECTIVE: - stringId = STRINGID_SUPEREFFECTIVE; + if (!gMultiHitCounter) // Don't print effectiveness on each hit in a multi hit attack + { + // Signal for the trainer slide-in system. + if (GetBattlerSide(gBattlerTarget) != B_SIDE_PLAYER && gBattleStruct->trainerSlideFirstSuperEffectiveHitMsgState != 2) + gBattleStruct->trainerSlideFirstSuperEffectiveHitMsgState = 1; + + stringId = STRINGID_SUPEREFFECTIVE; + } break; case MOVE_RESULT_NOT_VERY_EFFECTIVE: - stringId = STRINGID_NOTVERYEFFECTIVE; + if (!gMultiHitCounter) + stringId = STRINGID_NOTVERYEFFECTIVE; break; case MOVE_RESULT_ONE_HIT_KO: stringId = STRINGID_ONEHITKO; @@ -2015,7 +2838,7 @@ static void Cmd_resultmessage(void) gPotentialItemEffectBattler = gBattlerTarget; gMoveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_FocusBandActivates; + gBattlescriptCurrInstr = BattleScript_HangedOnMsg; return; default: if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) @@ -2031,6 +2854,14 @@ static void Cmd_resultmessage(void) gBattlescriptCurrInstr = BattleScript_OneHitKOMsg; return; } + else if (gMoveResultFlags & MOVE_RESULT_STURDIED) + { + gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); + gSpecialStatuses[gBattlerTarget].sturdied = FALSE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SturdiedMsg; + return; + } else if (gMoveResultFlags & MOVE_RESULT_FOE_ENDURED) { gMoveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); @@ -2044,13 +2875,21 @@ static void Cmd_resultmessage(void) gPotentialItemEffectBattler = gBattlerTarget; gMoveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_FocusBandActivates; + gBattlescriptCurrInstr = BattleScript_HangedOnMsg; return; } else if (gMoveResultFlags & MOVE_RESULT_FAILED) { stringId = STRINGID_BUTITFAILED; } + else if (B_AFFECTION_MECHANICS == TRUE && (gMoveResultFlags & MOVE_RESULT_FOE_ENDURED_AFFECTION)) + { + gSpecialStatuses[gBattlerTarget].affectionEndured = FALSE; + gMoveResultFlags &= ~MOVE_RESULT_FOE_ENDURED_AFFECTION; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AffectionBasedEndurance; + return; + } else { gBattleCommunication[MSG_DISPLAY] = 0; @@ -2061,7 +2900,16 @@ static void Cmd_resultmessage(void) if (stringId) PrepareStringBattle(stringId, gBattlerAttacker); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; + + // Print berry reducing message after result message. + if (gSpecialStatuses[gBattlerTarget].berryReduced + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; + } } static void Cmd_printstring(void) @@ -2080,30 +2928,33 @@ static void Cmd_printstring(void) static void Cmd_printselectionstring(void) { + CMD_ARGS(u16 id); + gActiveBattler = gBattlerAttacker; + BtlController_EmitPrintSelectionString(BUFFER_A, cmd->id); + MarkBattlerForControllerExec(gBattlerAttacker); - BtlController_EmitPrintSelectionString(BUFFER_A, T2_READ_16(gBattlescriptCurrInstr + 1)); - MarkBattlerForControllerExec(gActiveBattler); - - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 1; } static void Cmd_waitmessage(void) { + CMD_ARGS(u16 time); + if (gBattleControllerExecFlags == 0) { if (!gBattleCommunication[MSG_DISPLAY]) { - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - u16 toWait = T2_READ_16(gBattlescriptCurrInstr + 1); + u16 toWait = cmd->time; if (++gPauseCounterBattle >= toWait) { gPauseCounterBattle = 0; - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 0; } } @@ -2112,62 +2963,139 @@ static void Cmd_waitmessage(void) static void Cmd_printfromtable(void) { + CMD_ARGS(const u16 *ptr); + if (gBattleControllerExecFlags == 0) { - const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u16 *ptr = cmd->ptr; ptr += gBattleCommunication[MULTISTRING_CHOOSER]; + gBattlescriptCurrInstr = cmd->nextInstr; PrepareStringBattle(*ptr, gBattlerAttacker); - - gBattlescriptCurrInstr += 5; gBattleCommunication[MSG_DISPLAY] = 1; } } static void Cmd_printselectionstringfromtable(void) { + CMD_ARGS(const u16 *ptr); + if (gBattleControllerExecFlags == 0) { - const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u16 *ptr = cmd->ptr; ptr += gBattleCommunication[MULTISTRING_CHOOSER]; gActiveBattler = gBattlerAttacker; BtlController_EmitPrintSelectionString(BUFFER_A, *ptr); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 1; } } -u8 GetBattlerTurnOrderNum(u8 battlerId) +u8 GetBattlerTurnOrderNum(u8 battler) { s32 i; for (i = 0; i < gBattlersCount; i++) { - if (gBattlerByTurnOrder[i] == battlerId) + if (gBattlerByTurnOrder[i] == battler) break; } return i; } -// Called INCREMENT_RESET_RETURN in Emerald which adds "gBattleCommunication[MOVE_EFFECT_BYTE] = 0;" before the return. -#define INCREMENT_RETURN \ +static void CheckSetUnburden(u8 battler) +{ + if (GetBattlerAbility(battler) == ABILITY_UNBURDEN) + { + gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_UNBURDEN; + RecordAbilityBattle(battler, ABILITY_UNBURDEN); + } +} + +// battlerStealer steals the item of battlerItem +void StealTargetItem(u8 battlerStealer, u8 battlerItem) +{ + gLastUsedItem = gBattleMons[battlerItem].item; + gBattleMons[battlerItem].item = 0; + + RecordItemEffectBattle(battlerItem, 0); + RecordItemEffectBattle(battlerStealer, ItemId_GetHoldEffect(gLastUsedItem)); + gBattleMons[battlerStealer].item = gLastUsedItem; + + CheckSetUnburden(battlerItem); + gBattleResources->flags->flags[battlerStealer] &= ~RESOURCE_FLAG_UNBURDEN; + + gActiveBattler = battlerStealer; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem); // set attacker item + MarkBattlerForControllerExec(battlerStealer); + + gActiveBattler = battlerItem; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[battlerItem].item); // remove target item + MarkBattlerForControllerExec(battlerItem); + + gBattleStruct->choicedMove[battlerItem] = 0; + + TrySaveExchangedItem(battlerItem, gLastUsedItem); +} + +#define INCREMENT_RESET_RETURN \ { \ gBattlescriptCurrInstr++; \ + gBattleScripting.moveEffect = 0; \ return; \ } -void SetMoveEffect(bool8 primary, u8 certain) -{ - bool32 statusChanged = FALSE; - u8 affectsUser = 0; // 0x40 otherwise - bool32 noSunCanFreeze = TRUE; +#define RESET_RETURN \ +{ \ + gBattleScripting.moveEffect = 0; \ + return; \ +} - if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_AFFECTS_USER) +void SetMoveEffect(bool32 primary, bool32 certain) +{ + s32 i, affectsUser = 0; + bool32 statusChanged = FALSE; + bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR); + u32 flags = 0; + u16 battlerAbility; + bool8 activateAfterFaint = FALSE; + + // NULL move effect + if (gBattleScripting.moveEffect == 0) + return; + + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT + && gBattleMons[gBattlerTarget].hp != 0 + && IsFinalStrikeEffect(gBattleScripting.moveEffect)) { - gEffectBattler = gBattlerAttacker; // battlerId that effects get applied on - gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_AFFECTS_USER; + gBattlescriptCurrInstr++; + return; + } + + switch (gBattleScripting.moveEffect) // Set move effects which happen later on + { + case MOVE_EFFECT_KNOCK_OFF: + case MOVE_EFFECT_SMACK_DOWN: + case MOVE_EFFECT_REMOVE_STATUS: + case MOVE_EFFECT_STOCKPILE_WORE_OFF: + gBattleStruct->moveEffect2 = gBattleScripting.moveEffect; + gBattlescriptCurrInstr++; + return; + case MOVE_EFFECT_STEALTH_ROCK: + case MOVE_EFFECT_SPIKES: + case MOVE_EFFECT_PAYDAY: + case MOVE_EFFECT_STEAL_ITEM: + case MOVE_EFFECT_BUG_BITE: + activateAfterFaint = TRUE; + break; + } + + if (gBattleScripting.moveEffect & MOVE_EFFECT_AFFECTS_USER) + { + gEffectBattler = gBattlerAttacker; // battler that effects get applied on + gBattleScripting.moveEffect &= ~MOVE_EFFECT_AFFECTS_USER; affectsUser = MOVE_EFFECT_AFFECTS_USER; gBattleScripting.battler = gBattlerTarget; // theoretically the attacker } @@ -2176,60 +3104,73 @@ void SetMoveEffect(bool8 primary, u8 certain) gEffectBattler = gBattlerTarget; gBattleScripting.battler = gBattlerAttacker; } - if (gBattleTypeFlags & BATTLE_TYPE_POKEDUDE && gBattleCommunication[MOVE_EFFECT_BYTE] != 1 - && GetBattlerSide(gEffectBattler) == B_SIDE_OPPONENT) - INCREMENT_RETURN - if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9) - INCREMENT_RETURN + battlerAbility = GetBattlerAbility(gEffectBattler); - if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7) - INCREMENT_RETURN + // Just in case this flag is still set + gBattleScripting.moveEffect &= ~MOVE_EFFECT_CERTAIN; - if (gBattleMons[gEffectBattler].hp == 0 - && gBattleCommunication[MOVE_EFFECT_BYTE] != MOVE_EFFECT_PAYDAY - && gBattleCommunication[MOVE_EFFECT_BYTE] != MOVE_EFFECT_STEAL_ITEM) - INCREMENT_RETURN - - if (gBattleMons[gEffectBattler].status2 & STATUS2_SUBSTITUTE && affectsUser != MOVE_EFFECT_AFFECTS_USER) - INCREMENT_RETURN - - if (gBattleCommunication[MOVE_EFFECT_BYTE] <= PRIMARY_STATUS_MOVE_EFFECT) + if (!primary && affectsUser != MOVE_EFFECT_AFFECTS_USER + && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) + && (battlerAbility == ABILITY_SHIELD_DUST || GetBattlerHoldEffect(gEffectBattler, TRUE) == HOLD_EFFECT_COVERT_CLOAK)) { - switch (sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]) + if (battlerAbility == ABILITY_SHIELD_DUST) + RecordAbilityBattle(gEffectBattler, battlerAbility); + else + RecordItemEffectBattle(gEffectBattler, HOLD_EFFECT_COVERT_CLOAK); + INCREMENT_RESET_RETURN + } + + if (gSideStatuses[GetBattlerSide(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) + && !primary && gBattleScripting.moveEffect <= MOVE_EFFECT_CONFUSION) + INCREMENT_RESET_RETURN + + if (!(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) + && TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) + && !primary + && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING) + INCREMENT_RESET_RETURN + + if (gBattleMons[gEffectBattler].hp == 0 && !activateAfterFaint) + INCREMENT_RESET_RETURN + + if (DoesSubstituteBlockMove(gBattlerAttacker, gEffectBattler, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER) + INCREMENT_RESET_RETURN + + if (gBattleScripting.moveEffect <= PRIMARY_STATUS_MOVE_EFFECT) // status change + { + const u8 *cancelMultiTurnMovesResult = NULL; + switch (sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]) { case STATUS1_SLEEP: // check active uproar - if (gBattleMons[gEffectBattler].ability != ABILITY_SOUNDPROOF) + if (battlerAbility != ABILITY_SOUNDPROOF || B_UPROAR_IGNORE_SOUNDPROOF >= GEN_5) { - for (gActiveBattler = 0; - gActiveBattler < gBattlersCount && !(gBattleMons[gActiveBattler].status2 & STATUS2_UPROAR); - gActiveBattler++) - {} + for (i = 0; i < gBattlersCount && !(gBattleMons[i].status2 & STATUS2_UPROAR); i++) + ; } else + { + i = gBattlersCount; gActiveBattler = gBattlersCount; + } - if (gBattleMons[gEffectBattler].status1) + if (i != gBattlersCount) break; - if (gActiveBattler != gBattlersCount) - break; - if (gBattleMons[gEffectBattler].ability == ABILITY_VITAL_SPIRIT) - break; - if (gBattleMons[gEffectBattler].ability == ABILITY_INSOMNIA) + if (!CanSleep(gEffectBattler)) break; - CancelMultiTurnMoves(gEffectBattler); + cancelMultiTurnMovesResult = CancelMultiTurnMoves(gEffectBattler); + if (cancelMultiTurnMovesResult) + gBattlescriptCurrInstr = cancelMultiTurnMovesResult; statusChanged = TRUE; break; case STATUS1_POISON: - if (gBattleMons[gEffectBattler].ability == ABILITY_IMMUNITY - && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + if ((battlerAbility == ABILITY_IMMUNITY || battlerAbility == ABILITY_PASTEL_VEIL) + && (primary == TRUE || certain == TRUE)) { - gLastUsedAbility = ABILITY_IMMUNITY; - RecordAbilityBattle(gEffectBattler, ABILITY_IMMUNITY); + gLastUsedAbility = battlerAbility; + RecordAbilityBattle(gEffectBattler, battlerAbility); BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_PSNPrevention; @@ -2243,35 +3184,29 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - return; + RESET_RETURN } - if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) + if (!CanPoisonType(gBattleScripting.battler, gEffectBattler) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + && (primary == TRUE || certain == TRUE)) { BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; - return; + RESET_RETURN } - if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON)) - break; - if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) - break; - if (gBattleMons[gEffectBattler].status1) - break; - if (gBattleMons[gEffectBattler].ability == ABILITY_IMMUNITY) + if (!CanBePoisoned(gBattleScripting.battler, gEffectBattler)) break; statusChanged = TRUE; break; case STATUS1_BURN: - if (gBattleMons[gEffectBattler].ability == ABILITY_WATER_VEIL - && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + if ((battlerAbility == ABILITY_WATER_VEIL || battlerAbility == ABILITY_WATER_BUBBLE) + && (primary == TRUE || certain == TRUE)) { - gLastUsedAbility = ABILITY_WATER_VEIL; - RecordAbilityBattle(gEffectBattler, ABILITY_WATER_VEIL); + gLastUsedAbility = battlerAbility; + RecordAbilityBattle(gEffectBattler, battlerAbility); BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_BRNPrevention; @@ -2284,46 +3219,52 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - return; + RESET_RETURN } if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + && (primary == TRUE || certain == TRUE)) { BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; - return; + RESET_RETURN } - if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)) - break; - if (gBattleMons[gEffectBattler].ability == ABILITY_WATER_VEIL) - break; - if (gBattleMons[gEffectBattler].status1) + + if (B_STATUS_TYPE_IMMUNITY == GEN_1) + { + u8 moveType = 0; + GET_MOVE_TYPE(gCurrentMove, moveType); + if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) + break; + } + + if (!CanBeBurned(gEffectBattler)) break; statusChanged = TRUE; break; case STATUS1_FREEZE: - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SUN) - noSunCanFreeze = FALSE; - if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_ICE)) - break; - if (gBattleMons[gEffectBattler].status1) - break; - if (noSunCanFreeze == FALSE) - break; - if (gBattleMons[gEffectBattler].ability == ABILITY_MAGMA_ARMOR) + if (B_STATUS_TYPE_IMMUNITY == GEN_1) + { + u8 moveType = 0; + GET_MOVE_TYPE(gCurrentMove, moveType); + if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) + break; + } + if (!CanBeFrozen(gEffectBattler)) break; - CancelMultiTurnMoves(gEffectBattler); + cancelMultiTurnMovesResult = CancelMultiTurnMoves(gEffectBattler); + if (cancelMultiTurnMovesResult) + gBattlescriptCurrInstr = cancelMultiTurnMovesResult; statusChanged = TRUE; break; case STATUS1_PARALYSIS: - if (gBattleMons[gEffectBattler].ability == ABILITY_LIMBER) + if (battlerAbility == ABILITY_LIMBER) { - if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN) + if (primary == TRUE || certain == TRUE) { gLastUsedAbility = ABILITY_LIMBER; RecordAbilityBattle(gEffectBattler, ABILITY_LIMBER); @@ -2340,21 +3281,41 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - return; + RESET_RETURN } else break; } - if (gBattleMons[gEffectBattler].status1) + if (B_STATUS_TYPE_IMMUNITY == GEN_1) + { + u8 moveType = 0; + GET_MOVE_TYPE(gCurrentMove, moveType); + if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) + break; + } + if (!CanParalyzeType(gBattleScripting.battler, gEffectBattler) + && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) + && (primary == TRUE || certain == TRUE)) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_PRLZPrevention; + + gBattleCommunication[MULTISTRING_CHOOSER] = 2; + RESET_RETURN + } + if (!CanParalyzeType(gBattleScripting.battler, gEffectBattler)) + break; + if (!CanBeParalyzed(gEffectBattler)) break; statusChanged = TRUE; break; case STATUS1_TOXIC_POISON: - if (gBattleMons[gEffectBattler].ability == ABILITY_IMMUNITY && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + if ((battlerAbility == ABILITY_IMMUNITY || battlerAbility == ABILITY_PASTEL_VEIL) + && (primary == TRUE || certain == TRUE)) { - gLastUsedAbility = ABILITY_IMMUNITY; - RecordAbilityBattle(gEffectBattler, ABILITY_IMMUNITY); + gLastUsedAbility = battlerAbility; + RecordAbilityBattle(gEffectBattler, battlerAbility); BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_PSNPrevention; @@ -2368,27 +3329,22 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - return; + RESET_RETURN } - if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) + if (!CanPoisonType(gBattleScripting.battler, gEffectBattler) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + && (primary == TRUE || certain == TRUE)) { BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; - return; + RESET_RETURN } - if (gBattleMons[gEffectBattler].status1) { + if (gBattleMons[gEffectBattler].status1) break; - } - if (!IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) && !IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) + if (CanBePoisoned(gBattleScripting.battler, gEffectBattler)) { - if (gBattleMons[gEffectBattler].ability == ABILITY_IMMUNITY) { - break; - } - // It's redundant, because at this point we know the status1 value is 0. gBattleMons[gEffectBattler].status1 &= ~STATUS1_TOXIC_POISON; gBattleMons[gEffectBattler].status1 &= ~STATUS1_POISON; @@ -2400,21 +3356,41 @@ void SetMoveEffect(bool8 primary, u8 certain) gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; } break; + case STATUS1_FROSTBITE: + if (B_STATUS_TYPE_IMMUNITY == GEN_1) + { + u8 moveType = 0; + GET_MOVE_TYPE(gCurrentMove, moveType); + if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) + break; + } + if (!CanGetFrostbite(gEffectBattler)) + break; + + statusChanged = TRUE; + break; } if (statusChanged == TRUE) { BattleScriptPush(gBattlescriptCurrInstr + 1); - if (sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]] == STATUS1_SLEEP) - gBattleMons[gEffectBattler].status1 |= STATUS1_SLEEP_TURN((Random() & 3) + 2); // 2-5 turns + if (sStatusFlagsForMoveEffects[gBattleScripting.moveEffect] == STATUS1_SLEEP) + { + if (B_SLEEP_TURNS >= GEN_5) + gBattleMons[gEffectBattler].status1 |= STATUS1_SLEEP_TURN(1 + RandomUniform(RNG_SLEEP_TURNS, 1, 3)); + else + gBattleMons[gEffectBattler].status1 |= STATUS1_SLEEP_TURN(1 + RandomUniform(RNG_SLEEP_TURNS, 2, 5)); + } else - gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]; + { + gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]; + } - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; + gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; gActiveBattler = gEffectBattler; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gEffectBattler); if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) { @@ -2428,36 +3404,37 @@ void SetMoveEffect(bool8 primary, u8 certain) // for synchronize - if (gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_POISON - || gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_TOXIC - || gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_PARALYSIS - || gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_BURN) + if (gBattleScripting.moveEffect == MOVE_EFFECT_POISON + || gBattleScripting.moveEffect == MOVE_EFFECT_TOXIC + || gBattleScripting.moveEffect == MOVE_EFFECT_PARALYSIS + || gBattleScripting.moveEffect == MOVE_EFFECT_BURN) { - u8 *synchronizeEffect = &gBattleStruct->synchronizeMoveEffect; - *synchronizeEffect = gBattleCommunication[MOVE_EFFECT_BYTE]; + gBattleStruct->synchronizeMoveEffect = gBattleScripting.moveEffect; gHitMarker |= HITMARKER_SYNCHRONISE_EFFECT; } + return; } else if (statusChanged == FALSE) { + gBattleScripting.moveEffect = 0; gBattlescriptCurrInstr++; + return; } return; } else { - if (gBattleMons[gEffectBattler].status2 & sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]) + if (gBattleMons[gEffectBattler].status2 & sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]) { gBattlescriptCurrInstr++; } else { u8 side; - switch (gBattleCommunication[MOVE_EFFECT_BYTE]) + switch (gBattleScripting.moveEffect) { case MOVE_EFFECT_CONFUSION: - if (gBattleMons[gEffectBattler].ability == ABILITY_OWN_TEMPO - || gBattleMons[gEffectBattler].status2 & STATUS2_CONFUSION) + if (!CanBeConfused(gEffectBattler)) { gBattlescriptCurrInstr++; } @@ -2465,16 +3442,30 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleMons[gEffectBattler].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); // 2-5 turns - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; + // If the confusion is activating due to being released from Sky Drop, go to "confused due to fatigue" script. + // Otherwise, do normal confusion script. + if(gCurrentMove == MOVE_SKY_DROP) + { + gBattleMons[gEffectBattler].status2 &= ~(STATUS2_LOCK_CONFUSE); + gBattlerAttacker = gEffectBattler; + gBattlescriptCurrInstr = BattleScript_ThrashConfuses; + } + else + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; + } } break; case MOVE_EFFECT_FLINCH: - if (gBattleMons[gEffectBattler].ability == ABILITY_INNER_FOCUS) + if (battlerAbility == ABILITY_INNER_FOCUS) { - if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN) + // Inner Focus ALWAYS prevents flinching but only activates + // on a move that's supposed to flinch, like Fake Out + if (primary == TRUE || certain == TRUE) { gLastUsedAbility = ABILITY_INNER_FOCUS; + gBattlerAbility = gEffectBattler; RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); gBattlescriptCurrInstr = BattleScript_FlinchPrevention; } @@ -2483,10 +3474,10 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr++; } } - else + else if (GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber + /* && !IsDynamaxed(gEffectBattler) */) // TODO: Dynamax { - if (GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber) - gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]; + gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]; gBattlescriptCurrInstr++; } break; @@ -2495,10 +3486,10 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN((Random() & 3) + 2); // 2-5 turns + gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN(B_UPROAR_TURNS >= GEN_5 ? 3 : (Random() & 3) + 2); BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; + gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; } else { @@ -2506,15 +3497,38 @@ void SetMoveEffect(bool8 primary, u8 certain) } break; case MOVE_EFFECT_PAYDAY: - if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) + // Don't scatter coins on the second hit of Parental Bond + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER && gSpecialStatuses[gBattlerAttacker].parentalBondState!= PARENTAL_BOND_2ND_HIT) { u16 payday = gPaydayMoney; + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5); if (payday > gPaydayMoney) gPaydayMoney = 0xFFFF; + + // For a move that hits multiple targets (i.e. Make it Rain) + // we only want to print the message on the final hit + if (!((moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY) + && GetNextTarget(moveTarget, TRUE) != MAX_BATTLERS_COUNT)) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectPayDay; + } + else + gBattlescriptCurrInstr++; } - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; + else + { + gBattlescriptCurrInstr++; + } + break; + case MOVE_EFFECT_HAPPY_HOUR: + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierMove) + { + gBattleStruct->moneyMultiplier *= 2; + gBattleStruct->moneyMultiplierMove = 1; + } + gBattlescriptCurrInstr++; break; case MOVE_EFFECT_TRI_ATTACK: if (gBattleMons[gEffectBattler].status1) @@ -2523,14 +3537,20 @@ void SetMoveEffect(bool8 primary, u8 certain) } else { - gBattleCommunication[MOVE_EFFECT_BYTE] = Random() % 3 + 3; - SetMoveEffect(FALSE, 0); + static const u8 sTriAttackEffects[] = + { + MOVE_EFFECT_BURN, + MOVE_EFFECT_FREEZE_OR_FROSTBITE, + MOVE_EFFECT_PARALYSIS + }; + gBattleScripting.moveEffect = RandomElement(RNG_TRI_ATTACK, sTriAttackEffects); + SetMoveEffect(primary, certain); } break; case MOVE_EFFECT_CHARGING: gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gProtectStructs[gEffectBattler].chargingTurn = 1; + gProtectStructs[gEffectBattler].chargingTurn = TRUE; gBattlescriptCurrInstr++; break; case MOVE_EFFECT_WRAP: @@ -2546,30 +3566,19 @@ void SetMoveEffect(bool8 primary, u8 certain) else gDisableStructs[gEffectBattler].wrapTurns = B_BINDING_TURNS >= GEN_5 ? (Random() % 2) + 4 : (Random() % 4) + 2; - *(gBattleStruct->wrappedMove + gEffectBattler * 2 + 0) = gCurrentMove; - *(gBattleStruct->wrappedMove + gEffectBattler * 2 + 1) = gCurrentMove >> 8; - *(gBattleStruct->wrappedBy + gEffectBattler) = gBattlerAttacker; + gBattleStruct->wrappedMove[gEffectBattler] = gCurrentMove; + gBattleStruct->wrappedBy[gEffectBattler] = gBattlerAttacker; BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; + gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; - for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) + for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] < NUM_TRAPPING_MOVES; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] >= NUM_TRAPPING_MOVES - 1) - break; - if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) + if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; } } break; - case MOVE_EFFECT_RECOIL_25: // 25% recoil - gBattleMoveDamage = (gHpDealt) / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; - break; case MOVE_EFFECT_ATK_PLUS_1: case MOVE_EFFECT_DEF_PLUS_1: case MOVE_EFFECT_SPD_PLUS_1: @@ -2577,15 +3586,16 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_SP_DEF_PLUS_1: case MOVE_EFFECT_ACC_PLUS_1: case MOVE_EFFECT_EVS_PLUS_1: - if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1), - gBattleCommunication[MOVE_EFFECT_BYTE] - MOVE_EFFECT_ATK_PLUS_1 + 1, - affectsUser, 0)) + if (NoAliveMonsForEitherParty() + || ChangeStatBuffs(SET_STAT_BUFF_VALUE(1), + gBattleScripting.moveEffect - MOVE_EFFECT_ATK_PLUS_1 + 1, + affectsUser | STAT_CHANGE_UPDATE_MOVE_EFFECT, 0)) { gBattlescriptCurrInstr++; } else { - gBattleScripting.animArg1 = gBattleCommunication[MOVE_EFFECT_BYTE] & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + gBattleScripting.animArg1 = gBattleScripting.moveEffect & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); gBattleScripting.animArg2 = 0; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_StatUp; @@ -2598,15 +3608,22 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: + flags = affectsUser; + if (mirrorArmorReflected) + flags |= (STAT_CHANGE_ALLOW_PTR * !affectsUser); + else + flags |= STAT_CHANGE_UPDATE_MOVE_EFFECT; + if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, - gBattleCommunication[MOVE_EFFECT_BYTE] - MOVE_EFFECT_ATK_MINUS_1 + 1, - affectsUser, 0)) + gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, + flags, gBattlescriptCurrInstr + 1)) { - gBattlescriptCurrInstr++; + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else { - gBattleScripting.animArg1 = gBattleCommunication[MOVE_EFFECT_BYTE] & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + gBattleScripting.animArg1 = gBattleScripting.moveEffect & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); gBattleScripting.animArg2 = 0; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_StatDown; @@ -2619,15 +3636,16 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_SP_DEF_PLUS_2: case MOVE_EFFECT_ACC_PLUS_2: case MOVE_EFFECT_EVS_PLUS_2: - if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2), - gBattleCommunication[MOVE_EFFECT_BYTE] - MOVE_EFFECT_ATK_PLUS_2 + 1, - affectsUser, 0)) + if (NoAliveMonsForEitherParty() + || ChangeStatBuffs(SET_STAT_BUFF_VALUE(2), + gBattleScripting.moveEffect - MOVE_EFFECT_ATK_PLUS_2 + 1, + affectsUser | STAT_CHANGE_UPDATE_MOVE_EFFECT, 0)) { gBattlescriptCurrInstr++; } else { - gBattleScripting.animArg1 = gBattleCommunication[MOVE_EFFECT_BYTE] & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + gBattleScripting.animArg1 = gBattleScripting.moveEffect & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); gBattleScripting.animArg2 = 0; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_StatUp; @@ -2640,15 +3658,19 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: + flags = affectsUser; + if (mirrorArmorReflected && !affectsUser) + flags |= STAT_CHANGE_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, - gBattleCommunication[MOVE_EFFECT_BYTE] - MOVE_EFFECT_ATK_MINUS_2 + 1, - affectsUser, 0)) + gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_2 + 1, + flags | STAT_CHANGE_UPDATE_MOVE_EFFECT, gBattlescriptCurrInstr + 1)) { - gBattlescriptCurrInstr++; + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else { - gBattleScripting.animArg1 = gBattleCommunication[MOVE_EFFECT_BYTE] & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + gBattleScripting.animArg1 = gBattleScripting.moveEffect & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); gBattleScripting.animArg2 = 0; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_StatDown; @@ -2666,7 +3688,7 @@ void SetMoveEffect(bool8 primary, u8 certain) break; case MOVE_EFFECT_STEAL_ITEM: { - if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER) + if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item)) { gBattlescriptCurrInstr++; break; @@ -2692,38 +3714,27 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr++; } else if (gBattleMons[gBattlerTarget].item - && gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) + && GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD) { - gBattlescriptCurrInstr = BattleScript_StickyHoldActivates; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_NoItemSteal; + gLastUsedAbility = gBattleMons[gBattlerTarget].ability; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } else if (gBattleMons[gBattlerAttacker].item != ITEM_NONE - || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY - || IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item) + || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER || gBattleMons[gBattlerTarget].item == ITEM_NONE) { gBattlescriptCurrInstr++; } else { - u16 *changedItem = &gBattleStruct->changedItems[gBattlerAttacker]; - gLastUsedItem = *changedItem = gBattleMons[gBattlerTarget].item; - gBattleMons[gBattlerTarget].item = ITEM_NONE; - - gActiveBattler = gBattlerAttacker; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem); - MarkBattlerForControllerExec(gBattlerAttacker); - - gActiveBattler = gBattlerTarget; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item); - MarkBattlerForControllerExec(gBattlerTarget); - + StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker steals target item + gBattleMons[gBattlerAttacker].item = ITEM_NONE; // Item assigned later on with thief (see MOVEEND_CHANGED_ITEMS) + gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_ItemSteal; - - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0; } } break; @@ -2737,44 +3748,43 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr++; break; case MOVE_EFFECT_ALL_STATS_UP: - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_AllStatsUp; + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_AllStatsUp; + } break; - case MOVE_EFFECT_RAPIDSPIN: + case MOVE_EFFECT_RAPID_SPIN: BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_RapidSpinAway; break; - case MOVE_EFFECT_REMOVE_PARALYSIS: // Smelling salts - if (!(gBattleMons[gBattlerTarget].status1 & STATUS1_PARALYSIS)) - { - gBattlescriptCurrInstr++; - } - else - { - gBattleMons[gBattlerTarget].status1 &= ~STATUS1_PARALYSIS; - - gActiveBattler = gBattlerTarget; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal; - } - break; case MOVE_EFFECT_ATK_DEF_DOWN: // SuperPower - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_AtkDefDown; + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_AtkDefDown; + } break; - case MOVE_EFFECT_RECOIL_33: // Double Edge - gBattleMoveDamage = gHpDealt / 3; + case MOVE_EFFECT_DEF_SPDEF_DOWN: // Close Combat + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_DefSpDefDown; + } + break; + case MOVE_EFFECT_RECOIL_HP_25: // Struggle + gBattleMoveDamage = (gBattleMons[gEffectBattler].maxHP) / 4; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; + if (GetBattlerAbility(gEffectBattler) == ABILITY_PARENTAL_BOND) + gBattleMoveDamage *= 2; BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; + gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; break; case MOVE_EFFECT_THRASH: - if (gBattleMons[gEffectBattler].status2 & STATUS2_LOCK_CONFUSE) + // Petal Dance doesn't lock mons that copy the move with Dancer + if (gSpecialStatuses[gEffectBattler].dancerUsedMove) { gBattlescriptCurrInstr++; } @@ -2782,170 +3792,511 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gBattleMons[gEffectBattler].status2 |= STATUS2_LOCK_CONFUSE_TURN((Random() & 1) + 2); // thrash for 2-3 turns - } - break; - case MOVE_EFFECT_KNOCK_OFF: - if (gBattleMons[gEffectBattler].ability == ABILITY_STICKY_HOLD) - { - if (gBattleMons[gEffectBattler].item == ITEM_NONE) - { - gBattlescriptCurrInstr++; - } - else - { - gLastUsedAbility = ABILITY_STICKY_HOLD; - gBattlescriptCurrInstr = BattleScript_StickyHoldActivates; - RecordAbilityBattle(gEffectBattler, ABILITY_STICKY_HOLD); - } - break; - } - if (gBattleMons[gEffectBattler].item) - { - side = GetBattlerSide(gEffectBattler); - - gLastUsedItem = gBattleMons[gEffectBattler].item; - gBattleMons[gEffectBattler].item = ITEM_NONE; - gWishFutureKnock.knockedOffMons[side] |= gBitTable[gBattlerPartyIndexes[gEffectBattler]]; - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_KnockedOff; - - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0; - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0; - } - else - { - gBattlescriptCurrInstr++; + gBattleMons[gEffectBattler].status2 |= STATUS2_LOCK_CONFUSE_TURN(RandomUniform(RNG_RAMPAGE_TURNS, 2, 3)); } break; case MOVE_EFFECT_SP_ATK_TWO_DOWN: // Overheat + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_SAtkDown2; + } + break; + case MOVE_EFFECT_CLEAR_SMOG: + for (i = 0; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[gEffectBattler].statStages[i] != DEFAULT_STAT_STAGE) + break; + } + if ((gSpecialStatuses[gEffectBattler].physicalDmg || gSpecialStatuses[gEffectBattler].specialDmg) && i != NUM_BATTLE_STATS) + { + for (i = 0; i < NUM_BATTLE_STATS; i++) + gBattleMons[gEffectBattler].statStages[i] = DEFAULT_STAT_STAGE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectClearSmog; + } + break; + case MOVE_EFFECT_FLAME_BURST: + if (IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) + && !(gStatuses3[BATTLE_PARTNER(gBattlerTarget)] & STATUS3_SEMI_INVULNERABLE) + && GetBattlerAbility(BATTLE_PARTNER(gBattlerTarget)) != ABILITY_MAGIC_GUARD) + { + gBattleScripting.savedBattler = BATTLE_PARTNER(gBattlerTarget); + gBattleMoveDamage = gBattleMons[BATTLE_PARTNER(gBattlerTarget)].hp / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattlescriptCurrInstr = BattleScript_MoveEffectFlameBurst; + } + break; + case MOVE_EFFECT_FEINT: + if (IS_BATTLER_PROTECTED(gBattlerTarget)) + { + gProtectStructs[gBattlerTarget].protected = FALSE; + gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~SIDE_STATUS_WIDE_GUARD; + gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~SIDE_STATUS_QUICK_GUARD; + gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~SIDE_STATUS_CRAFTY_SHIELD; + gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~SIDE_STATUS_MAT_BLOCK; + gProtectStructs[gBattlerTarget].spikyShielded = FALSE; + gProtectStructs[gBattlerTarget].kingsShielded = FALSE; + gProtectStructs[gBattlerTarget].banefulBunkered = FALSE; + gProtectStructs[gBattlerTarget].obstructed = FALSE; + gProtectStructs[gBattlerTarget].silkTrapped = FALSE; + gProtectStructs[gBattlerAttacker].burningBulwarked = FALSE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + if (gCurrentMove == MOVE_HYPERSPACE_FURY) + gBattlescriptCurrInstr = BattleScript_HyperspaceFuryRemoveProtect; + else + gBattlescriptCurrInstr = BattleScript_MoveEffectFeint; + } + break; + case MOVE_EFFECT_SPECTRAL_THIEF: + if (!NoAliveMonsForEitherParty()) + { + gBattleStruct->stolenStats[0] = 0; // Stats to steal. + gBattleScripting.animArg1 = 0; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[gBattlerTarget].statStages[i] > DEFAULT_STAT_STAGE && gBattleMons[gBattlerAttacker].statStages[i] != MAX_STAT_STAGE) + { + bool32 byTwo = FALSE; + + gBattleStruct->stolenStats[0] |= gBitTable[i]; + // Store by how many stages to raise the stat. + gBattleStruct->stolenStats[i] = gBattleMons[gBattlerTarget].statStages[i] - DEFAULT_STAT_STAGE; + while (gBattleMons[gBattlerAttacker].statStages[i] + gBattleStruct->stolenStats[i] > MAX_STAT_STAGE) + gBattleStruct->stolenStats[i]--; + gBattleMons[gBattlerTarget].statStages[i] = DEFAULT_STAT_STAGE; + + if (gBattleStruct->stolenStats[i] >= 2) + byTwo++; + + if (gBattleScripting.animArg1 == 0) + { + if (byTwo) + gBattleScripting.animArg1 = STAT_ANIM_PLUS2 + i; + else + gBattleScripting.animArg1 = STAT_ANIM_PLUS1 + i; + } + else + { + if (byTwo) + gBattleScripting.animArg1 = STAT_ANIM_MULTIPLE_PLUS2; + else + gBattleScripting.animArg1 = STAT_ANIM_MULTIPLE_PLUS1; + } + } + } + + if (gBattleStruct->stolenStats[0] != 0) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_SpectralThiefSteal; + } + } + break; + case MOVE_EFFECT_V_CREATE: + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_VCreateStatLoss; + } + break; + case MOVE_EFFECT_CORE_ENFORCER: + if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) + && !NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectCoreEnforcer; + } + break; + case MOVE_EFFECT_THROAT_CHOP: + gDisableStructs[gEffectBattler].throatChopTimer = 2; + gBattlescriptCurrInstr++; + break; + case MOVE_EFFECT_INCINERATE: + if ((gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX) + || (B_INCINERATE_GEMS >= GEN_6 && GetBattlerHoldEffect(gEffectBattler, FALSE) == HOLD_EFFECT_GEMS)) + { + gLastUsedItem = gBattleMons[gEffectBattler].item; + gBattleMons[gEffectBattler].item = 0; + CheckSetUnburden(gEffectBattler); + + gActiveBattler = gEffectBattler; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].item), &gBattleMons[gEffectBattler].item); + MarkBattlerForControllerExec(gEffectBattler); + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectIncinerate; + } + break; + case MOVE_EFFECT_BUG_BITE: + if (ItemId_GetPocket(gBattleMons[gEffectBattler].item) == POCKET_BERRY_POUCH + && battlerAbility != ABILITY_STICKY_HOLD) + { + // target loses their berry + gLastUsedItem = gBattleMons[gEffectBattler].item; + gBattleMons[gEffectBattler].item = 0; + CheckSetUnburden(gEffectBattler); + + gActiveBattler = gEffectBattler; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].item), &gBattleMons[gEffectBattler].item); + MarkBattlerForControllerExec(gEffectBattler); + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite; + } + break; + case MOVE_EFFECT_TRAP_BOTH: + if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_ESCAPE_PREVENTION) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_ESCAPE_PREVENTION)) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_BothCanNoLongerEscape; + } + if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_ESCAPE_PREVENTION)) + gDisableStructs[gBattlerTarget].battlerPreventingEscape = gBattlerAttacker; + + if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_ESCAPE_PREVENTION)) + gDisableStructs[gBattlerAttacker].battlerPreventingEscape = gBattlerTarget; + + gBattleMons[gBattlerTarget].status2 |= STATUS2_ESCAPE_PREVENTION; + gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION; + break; + case MOVE_EFFECT_REMOVE_ARG_TYPE: + // This seems unnecessary but is done to make it work properly with Parental Bond BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_SAtkDown2; + switch (gMovesInfo[gCurrentMove].argument) + { + case TYPE_FIRE: // Burn Up + gBattlescriptCurrInstr = BattleScript_RemoveFireType; + break; + case TYPE_ELECTRIC: // Double Shot + gBattlescriptCurrInstr = BattleScript_RemoveElectricType; + break; + default: + gBattlescriptCurrInstr = BattleScript_RemoveGenericType; + break; + } + RemoveBattlerType(gEffectBattler, gMovesInfo[gCurrentMove].argument); + break; + case MOVE_EFFECT_ROUND: + TryUpdateRoundTurnOrder(); // If another Pokémon uses Round before the user this turn, the user will use Round directly after it + gBattlescriptCurrInstr++; + break; + case MOVE_EFFECT_DIRE_CLAW: + if (!gBattleMons[gEffectBattler].status1) + { + static const u8 sDireClawEffects[] = { MOVE_EFFECT_POISON, MOVE_EFFECT_PARALYSIS, MOVE_EFFECT_SLEEP }; + gBattleScripting.moveEffect = RandomElement(RNG_DIRE_CLAW, sDireClawEffects); + SetMoveEffect(primary, certain); + } + break; + case MOVE_EFFECT_STEALTH_ROCK: + if (!(gSideStatuses[GetBattlerSide(gEffectBattler)] & SIDE_STATUS_STEALTH_ROCK)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_POINTEDSTONESFLOAT; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_StealthRockActivates; + } + break; + case MOVE_EFFECT_SPIKES: + if (gSideTimers[GetBattlerSide(gEffectBattler)].spikesAmount < 3) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SPIKESSCATTERED; + BattleScriptPush(gBattlescriptCurrInstr + 1); + + if (gBattleStruct->isSkyBattle) + gBattlescriptCurrInstr++; + else + gBattlescriptCurrInstr = BattleScript_SpikesActivates; + } + break; + case MOVE_EFFECT_SYRUP_BOMB: + if (!(gStatuses4[gEffectBattler] & STATUS4_SYRUP_BOMB)) + { + struct Pokemon *party = GetBattlerParty(gBattlerAttacker); + + gStatuses4[gEffectBattler] |= STATUS4_SYRUP_BOMB; + gDisableStructs[gEffectBattler].syrupBombTimer = 3; + gDisableStructs[gEffectBattler].syrupBombIsShiny = IsMonShiny(&party[gBattlerPartyIndexes[gBattlerAttacker]]); + gBattleStruct->stickySyrupdBy[gEffectBattler] = gBattlerAttacker; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_SyrupBombActivates; + } + break; + case MOVE_EFFECT_SECRET_POWER: + if (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + case STATUS_FIELD_MISTY_TERRAIN: + gBattleScripting.moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1; + break; + case STATUS_FIELD_GRASSY_TERRAIN: + gBattleScripting.moveEffect = MOVE_EFFECT_SLEEP; + break; + case STATUS_FIELD_ELECTRIC_TERRAIN: + gBattleScripting.moveEffect = MOVE_EFFECT_PARALYSIS; + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1; + break; + default: + gBattleScripting.moveEffect = MOVE_EFFECT_PARALYSIS; + break; + } + } + else + { + switch (gBattleTerrain) + { + case BATTLE_TERRAIN_GRASS: + gBattleScripting.moveEffect = (B_SECRET_POWER_EFFECT >= GEN_4 ? MOVE_EFFECT_SLEEP : MOVE_EFFECT_POISON); + break; + case BATTLE_TERRAIN_UNDERWATER: + gBattleScripting.moveEffect = (B_SECRET_POWER_EFFECT >= GEN_6 ? MOVE_EFFECT_ATK_MINUS_1 : MOVE_EFFECT_DEF_MINUS_1); + break; + case BATTLE_TERRAIN_POND: + gBattleScripting.moveEffect = (B_SECRET_POWER_EFFECT >= GEN_4 ? MOVE_EFFECT_ATK_MINUS_1 : MOVE_EFFECT_SPD_MINUS_1); + break; + case BATTLE_TERRAIN_MOUNTAIN: + if (B_SECRET_POWER_EFFECT >= GEN_5) + gBattleScripting.moveEffect = MOVE_EFFECT_ACC_MINUS_1; + else if (B_SECRET_POWER_EFFECT >= GEN_4) + gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; + else + gBattleScripting.moveEffect = MOVE_EFFECT_CONFUSION; + break; + case BATTLE_TERRAIN_PUDDLE: + gBattleScripting.moveEffect = (B_SECRET_POWER_EFFECT >= GEN_5 ? MOVE_EFFECT_SPD_MINUS_1 : MOVE_EFFECT_ACC_MINUS_1); + break; + case BATTLE_TERRAIN_LONG_GRASS: + gBattleScripting.moveEffect = MOVE_EFFECT_SLEEP; + break; + case BATTLE_TERRAIN_SAND: + gBattleScripting.moveEffect = MOVE_EFFECT_ACC_MINUS_1; + break; + case BATTLE_TERRAIN_WATER: + gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1; + break; + case BATTLE_TERRAIN_CAVE: + case BATTLE_TERRAIN_BURIAL_GROUND: + case BATTLE_TERRAIN_SPACE: + gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; + break; + case BATTLE_TERRAIN_SOARING: + case BATTLE_TERRAIN_SKY_PILLAR: + case BATTLE_TERRAIN_MARSH: + case BATTLE_TERRAIN_SWAMP: + gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1; + break; + case BATTLE_TERRAIN_SNOW: + case BATTLE_TERRAIN_ICE: + gBattleScripting.moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE; + break; + case BATTLE_TERRAIN_VOLCANO: + gBattleScripting.moveEffect = MOVE_EFFECT_BURN; + break; + case BATTLE_TERRAIN_ULTRA_SPACE: + gBattleScripting.moveEffect = MOVE_EFFECT_DEF_MINUS_1; + break; + default: + gBattleScripting.moveEffect = MOVE_EFFECT_PARALYSIS; + break; + } + } + SetMoveEffect(primary, certain); + break; + case MOVE_EFFECT_PSYCHIC_NOISE: + battlerAbility = IsAbilityOnSide(gEffectBattler, ABILITY_AROMA_VEIL); + + if (battlerAbility) + { + gBattlerAbility = battlerAbility - 1; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_AromaVeilProtectsRet; + } + else if (!(gStatuses3[gEffectBattler] & STATUS3_HEAL_BLOCK)) + { + gStatuses3[gEffectBattler] |= STATUS3_HEAL_BLOCK; + gDisableStructs[gEffectBattler].healBlockTimer = 2; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_EffectPsychicNoise; + } break; } } } + + gBattleScripting.moveEffect = 0; } -static void Cmd_seteffectwithchance(void) +static bool32 CanApplyAdditionalEffect(const struct AdditionalEffect *additionalEffect) { - u32 percentChance; + // Self-targeting move effects only apply after the last mon has been hit + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + if (additionalEffect->self + && (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY) + && GetNextTarget(moveTarget, TRUE) != MAX_BATTLERS_COUNT) + return FALSE; - if (gBattleMons[gBattlerAttacker].ability == ABILITY_SERENE_GRACE) - percentChance = gBattleMoves[gCurrentMove].secondaryEffectChance * 2; - else - percentChance = gBattleMoves[gCurrentMove].secondaryEffectChance; + // Certain move effects only apply if the target raised stats this turn (e.g. Burning Jealousy) + if (additionalEffect->onlyIfTargetRaisedStats && !gProtectStructs[gBattlerTarget].statRaised) + return FALSE; - if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_CERTAIN - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + // Certain additional effects only apply on a two-turn move's charge turn + if (additionalEffect->onChargeTurnOnly != gProtectStructs[gBattlerAttacker].chargingTurn) + return FALSE; + + return TRUE; +} + +static void Cmd_setadditionaleffects(void) +{ + CMD_ARGS(); + + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_CERTAIN; - SetMoveEffect(FALSE, MOVE_EFFECT_CERTAIN); - } - else if (Random() % 100 <= percentChance - && gBattleCommunication[MOVE_EFFECT_BYTE] - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) - { - if (percentChance >= 100) - SetMoveEffect(FALSE, MOVE_EFFECT_CERTAIN); + if (gMovesInfo[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter) + { + u32 percentChance; + const struct AdditionalEffect *additionalEffect = &gMovesInfo[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter]; + const u8 *currentPtr = gBattlescriptCurrInstr; + + // Various checks for if this move effect can be applied this turn + if (CanApplyAdditionalEffect(additionalEffect)) + { + percentChance = CalcSecondaryEffectChance(gBattlerAttacker, GetBattlerAbility(gBattlerAttacker), additionalEffect); + + // Activate effect if it's primary (chance == 0) or if RNGesus says so + if ((percentChance == 0) || RandomPercentage(RNG_SECONDARY_EFFECT + gBattleStruct->additionalEffectsCounter, percentChance)) + { + gBattleScripting.moveEffect = additionalEffect->moveEffect | (MOVE_EFFECT_AFFECTS_USER * (additionalEffect->self)); + + SetMoveEffect( + percentChance == 0, // a primary effect + percentChance >= 100 // certain to happen + ); + } + } + + // Move script along if we haven't jumped elsewhere + if (gBattlescriptCurrInstr == currentPtr) + gBattlescriptCurrInstr = cmd->nextInstr; + + // Call setadditionaleffects again in the case of a move with multiple effects + gBattleStruct->additionalEffectsCounter++; + if (gMovesInfo[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter) + gBattleScripting.moveEffect = MOVE_EFFECT_CONTINUE; + else + gBattleScripting.moveEffect = gBattleStruct->additionalEffectsCounter = 0; + } else - SetMoveEffect(FALSE, 0); + { + gBattleScripting.moveEffect = 0; + gBattlescriptCurrInstr = cmd->nextInstr; + } } else { - gBattlescriptCurrInstr++; + gBattleScripting.moveEffect = 0; + gBattlescriptCurrInstr = cmd->nextInstr; } - gBattleCommunication[MOVE_EFFECT_BYTE] = 0; gBattleScripting.multihitMoveEffect = 0; } static void Cmd_seteffectprimary(void) { - SetMoveEffect(TRUE, 0); + CMD_ARGS(); + + SetMoveEffect(TRUE, FALSE); } static void Cmd_seteffectsecondary(void) { - SetMoveEffect(FALSE, 0); + CMD_ARGS(); + + SetMoveEffect(FALSE, FALSE); } static void Cmd_clearstatusfromeffect(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); - if (gBattleCommunication[MOVE_EFFECT_BYTE] <= PRIMARY_STATUS_MOVE_EFFECT) - gBattleMons[gActiveBattler].status1 &= (~sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]); + if (gBattleScripting.moveEffect <= PRIMARY_STATUS_MOVE_EFFECT) + gBattleMons[battler].status1 &= (~sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]); else - gBattleMons[gActiveBattler].status2 &= (~sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]); + { + gBattleMons[battler].status2 &= (~sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]); + if (gBattleScripting.moveEffect == MOVE_EFFECT_CHARGING) + gProtectStructs[battler].chargingTurn = FALSE; + } - gBattleCommunication[MOVE_EFFECT_BYTE] = 0; - gBattlescriptCurrInstr += 2; + gBattleScripting.moveEffect = 0; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleScripting.multihitMoveEffect = 0; } static void Cmd_tryfaintmon(void) { - const u8 *BS_ptr; + CMD_ARGS(u8 battler, bool8 isSpikes, const u8 *instr); + u32 battler, destinyBondBattler; + const u8 *faintScript; - if (gBattlescriptCurrInstr[2] != 0) + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + if (cmd->isSpikes != FALSE) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) + if (gHitMarker & HITMARKER_FAINTED(battler)) { - BS_ptr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - BattleScriptPop(); - gBattlescriptCurrInstr = BS_ptr; - gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~SIDE_STATUS_SPIKES_DAMAGED; + gBattlescriptCurrInstr = cmd->instr; } else { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { - u8 battlerId; - - if (gBattlescriptCurrInstr[1] == BS_ATTACKER) + if (cmd->battler == BS_ATTACKER) { gActiveBattler = gBattlerAttacker; - battlerId = gBattlerTarget; - BS_ptr = BattleScript_FaintAttacker; + destinyBondBattler = gBattlerTarget; + faintScript = BattleScript_FaintAttacker; } else { gActiveBattler = gBattlerTarget; - battlerId = gBattlerAttacker; - BS_ptr = BattleScript_FaintTarget; + destinyBondBattler = gBattlerAttacker; + faintScript = BattleScript_FaintTarget; } - if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler]) - && gBattleMons[gActiveBattler].hp == 0) + if (!(gAbsentBattlerFlags & gBitTable[battler]) + && gBattleMons[battler].hp == 0) { - gHitMarker |= HITMARKER_FAINTED(gActiveBattler); - BattleScriptPush(gBattlescriptCurrInstr + 7); - gBattlescriptCurrInstr = BS_ptr; - if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) + gHitMarker |= HITMARKER_FAINTED(battler); + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = faintScript; + if (GetBattlerSide(battler) == B_SIDE_PLAYER) { gHitMarker |= HITMARKER_PLAYER_FAINTED; if (gBattleResults.playerFaintCounter < 255) gBattleResults.playerFaintCounter++; - AdjustFriendshipOnBattleFaint(gActiveBattler); + AdjustFriendshipOnBattleFaint(battler); + gSideTimers[B_SIDE_PLAYER].retaliateTimer = 2; } else { if (gBattleResults.opponentFaintCounter < 255) gBattleResults.opponentFaintCounter++; - gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - *(u8 *)(&gBattleStruct->lastAttackerToFaintOpponent) = gBattlerAttacker; + gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES, NULL); + gSideTimers[B_SIDE_OPPONENT].retaliateTimer = 2; } - if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0) + if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0 + /* && !IsDynamaxed(gBattlerAttacker) */) // TODO: Dynamax { gHitMarker &= ~HITMARKER_DESTINYBOND; BattleScriptPush(gBattlescriptCurrInstr); - gBattleMoveDamage = gBattleMons[battlerId].hp; + gBattleMoveDamage = gBattleMons[destinyBondBattler].hp; gBattlescriptCurrInstr = BattleScript_DestinyBondTakesLife; } if ((gStatuses3[gBattlerTarget] & STATUS3_GRUDGE) @@ -2960,237 +4311,252 @@ static void Cmd_tryfaintmon(void) BattleScriptPush(gBattlescriptCurrInstr); gBattlescriptCurrInstr = BattleScript_GrudgeTakesPp; gActiveBattler = gBattlerAttacker; - BtlController_EmitSetMonData(BUFFER_A, moveIndex + REQUEST_PPMOVE1_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].pp[moveIndex]), &gBattleMons[gActiveBattler].pp[moveIndex]); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitSetMonData(BUFFER_A, moveIndex + REQUEST_PPMOVE1_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].pp[moveIndex]), &gBattleMons[gBattlerAttacker].pp[moveIndex]); + MarkBattlerForControllerExec(gBattlerAttacker); PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].moves[moveIndex]) } } else { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_dofaintanimation(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitFaintAnimation(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_cleareffectsonfaint(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + const u8 *clearDataResult = NULL; - gBattleMons[gActiveBattler].status1 = 0; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); + gBattleMons[battler].status1 = 0; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); - FaintClearSetData(); // Effects like attractions, trapping, etc. - gBattlescriptCurrInstr += 2; + clearDataResult = FaintClearSetData(battler); // Effects like attractions, trapping, etc. + if (clearDataResult) + gBattlescriptCurrInstr = clearDataResult; + else + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifstatus(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + CMD_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); - if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp != 0) { - gBattlescriptCurrInstr = jumpPtr; - } - else { - gBattlescriptCurrInstr += 10; - } + u8 battler = GetBattlerForBattleScript(cmd->battler); + u32 flags = cmd->flags; + const u8 *jumpInstr = cmd->jumpInstr; + + if (gBattleMons[battler].status1 & flags && gBattleMons[battler].hp != 0) + gBattlescriptCurrInstr = jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifstatus2(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + CMD_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); - if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp != 0) - gBattlescriptCurrInstr = jumpPtr; + u8 battler = GetBattlerForBattleScript(cmd->battler); + u32 flags = cmd->flags; + const u8 *jumpInstr = cmd->jumpInstr; + + if (gBattleMons[battler].status2 & flags && gBattleMons[battler].hp != 0) + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifability(void) { CMD_ARGS(u8 battler, u16 ability, const u8 *jumpInstr); - u32 battlerId; + + u32 battler; bool32 hasAbility = FALSE; u32 ability = cmd->ability; - if (cmd->battler == BS_ATTACKER_SIDE) + switch (cmd->battler) { - battlerId = AbilityBattleEffects(ABILITYEFFECT_CHECK_BATTLER_SIDE, gBattlerAttacker, ability, 0, 0); - if (battlerId) + default: + battler = GetBattlerForBattleScript(cmd->battler); + if (GetBattlerAbility(battler) == ability) + hasAbility = TRUE; + break; + case BS_ATTACKER_SIDE: + battler = IsAbilityOnSide(gBattlerAttacker, ability); + if (battler) { - gLastUsedAbility = ability; - gBattlescriptCurrInstr = cmd->jumpInstr; - RecordAbilityBattle(battlerId - 1, gLastUsedAbility); - gBattleScripting.battlerWithAbility = battlerId - 1; + battler--; + hasAbility = TRUE; } - else - gBattlescriptCurrInstr = cmd->nextInstr; + break; + case BS_TARGET_SIDE: + battler = IsAbilityOnOpposingSide(gBattlerAttacker, ability); + if (battler) + { + battler--; + hasAbility = TRUE; + } + break; } - else if (cmd->battler == BS_NOT_ATTACKER_SIDE) + + if (hasAbility) { - battlerId = AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, gBattlerAttacker, ability, 0, 0); - if (battlerId) - { - gLastUsedAbility = ability; - gBattlescriptCurrInstr = cmd->jumpInstr; - RecordAbilityBattle(battlerId - 1, gLastUsedAbility); - gBattleScripting.battlerWithAbility = battlerId - 1; - } - else - gBattlescriptCurrInstr = cmd->nextInstr; + gLastUsedAbility = ability; + gBattlescriptCurrInstr = cmd->jumpInstr; + RecordAbilityBattle(battler, gLastUsedAbility); + gBattlerAbility = battler; } else { - battlerId = GetBattlerForBattleScript(cmd->battler); - if (gBattleMons[battlerId].ability == ability) - { - gLastUsedAbility = ability; - gBattlescriptCurrInstr = cmd->jumpInstr; - RecordAbilityBattle(battlerId, gLastUsedAbility); - gBattleScripting.battlerWithAbility = battlerId; - } - else - gBattlescriptCurrInstr = cmd->nextInstr; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifsideaffecting(void) { - u8 side; - u16 flags; - const u8 *jumpPtr; + CMD_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); - if (gBattlescriptCurrInstr[1] == BS_ATTACKER) - side = GET_BATTLER_SIDE(gBattlerAttacker); + u32 side = GetBattlerSide(GetBattlerForBattleScript(cmd->battler)); + + if (gSideStatuses[side] & cmd->flags) + gBattlescriptCurrInstr = cmd->jumpInstr; else - side = GET_BATTLER_SIDE(gBattlerTarget); - - flags = T2_READ_16(gBattlescriptCurrInstr + 2); - jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 4); - - if (gSideStatuses[side] & flags) - gBattlescriptCurrInstr = jumpPtr; - else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifstat(void) { - u8 ret = 0; - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u8 value = gBattleMons[battlerId].statStages[gBattlescriptCurrInstr[3]]; + CMD_ARGS(u8 battler, u8 comparison, u8 stat, u8 value, const u8 *jumpInstr); - switch (gBattlescriptCurrInstr[2]) - { - case CMP_EQUAL: - if (value == gBattlescriptCurrInstr[4]) - ret++; - break; - case CMP_NOT_EQUAL: - if (value != gBattlescriptCurrInstr[4]) - ret++; - break; - case CMP_GREATER_THAN: - if (value > gBattlescriptCurrInstr[4]) - ret++; - break; - case CMP_LESS_THAN: - if (value < gBattlescriptCurrInstr[4]) - ret++; - break; - case CMP_COMMON_BITS: - if (value & gBattlescriptCurrInstr[4]) - ret++; - break; - case CMP_NO_COMMON_BITS: - if (!(value & gBattlescriptCurrInstr[4])) - ret++; - break; - } + bool32 ret = 0; + u8 battler = GetBattlerForBattleScript(cmd->battler); + u8 stat = cmd->stat; + u8 value = cmd->value; + u8 comparison = cmd->comparison; + + ret = CompareStat(battler, stat, value, comparison); if (ret) - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifstatus3condition(void) { - u32 status; - const u8 *jumpPtr; + CMD_ARGS(u8 battler, u32 flags, bool8 jumpIfTrue, const u8 *jumpInstr); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - status = T2_READ_32(gBattlescriptCurrInstr + 2); - jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7); - - if (gBattlescriptCurrInstr[6]) + u32 battler = GetBattlerForBattleScript(cmd->battler); + if (cmd->jumpIfTrue) { - if ((gStatuses3[gActiveBattler] & status) != 0) - gBattlescriptCurrInstr += 11; + if ((gStatuses3[battler] & cmd->flags) != 0) + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = cmd->jumpInstr; } else { - if ((gStatuses3[gActiveBattler] & status) != 0) - gBattlescriptCurrInstr = jumpPtr; + if ((gStatuses3[battler] & cmd->flags) != 0) + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 11; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void Cmd_jumpiftype(void) +static void Cmd_jumpbasedontype(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u8 type = gBattlescriptCurrInstr[2]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); + CMD_ARGS(u8 battler, u8 type, u8 jumpIfType, const u8 *jumpInstr); - if (IS_BATTLER_OF_TYPE(battlerId, type)) - gBattlescriptCurrInstr = jumpPtr; + u8 battler = GetBattlerForBattleScript(cmd->battler); + u8 type = cmd->type; + const u8 *jumpInstr = cmd->jumpInstr; + + // jumpiftype + if (cmd->jumpIfType) + { + if (IS_BATTLER_OF_TYPE(battler, type)) + gBattlescriptCurrInstr = jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + } + // jumpifnottype else - gBattlescriptCurrInstr += 7; + { + if (!IS_BATTLER_OF_TYPE(battler, type)) + gBattlescriptCurrInstr = jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + } +} + +FEATURE_FLAG_ASSERT(I_EXP_SHARE_FLAG, YouNeedToSetTheExpShareFlagToAnUnusedFlag); + +static bool32 BattleTypeAllowsExp(void) +{ + if (gBattleTypeFlags & + ( BATTLE_TYPE_LINK + | BATTLE_TYPE_TRAINER_TOWER + | BATTLE_TYPE_BATTLE_TOWER + | BATTLE_TYPE_SAFARI + | BATTLE_TYPE_EREADER_TRAINER)) + return FALSE; + else + return TRUE; +} + +static u32 GetMonHoldEffect(struct Pokemon *mon) +{ + u32 holdEffect; + u32 item = GetMonData(mon, MON_DATA_HELD_ITEM); + + if (item == ITEM_ENIGMA_BERRY_E_READER) + #if FREE_ENIGMA_BERRY == FALSE + holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; + #else + holdEffect = 0; + #endif //FREE_ENIGMA_BERRY + else + holdEffect = ItemId_GetHoldEffect(item); + + return holdEffect; } static void Cmd_getexp(void) { - u16 item; - s32 i; // also used as stringId - u8 holdEffect; - s32 sentIn; - s32 viaExpShare = 0; - u16 *exp = &gBattleStruct->expValue; + CMD_ARGS(u8 battler); - gBattlerFainted = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - sentIn = gSentPokesToOpponent[(gBattlerFainted & 2) >> 1]; + u32 holdEffect; + s32 i; // also used as stringId + u8 *expMonId = &gBattleStruct->expGetterMonId; + + gBattlerFainted = GetBattlerForBattleScript(cmd->battler); switch (gBattleScripting.getexpState) { case 0: // check if should receive exp at all - if (GetBattlerSide(gBattlerFainted) != B_SIDE_OPPONENT || (gBattleTypeFlags & - (BATTLE_TYPE_LINK - | BATTLE_TYPE_TRAINER_TOWER - | BATTLE_TYPE_BATTLE_TOWER - | BATTLE_TYPE_SAFARI - | BATTLE_TYPE_EREADER_TRAINER))) + if (GetBattlerSide(gBattlerFainted) != B_SIDE_OPPONENT + || IsAiVsAiBattle() + || !BattleTypeAllowsExp()) { gBattleScripting.getexpState = 6; // goto last case } @@ -3202,112 +4568,151 @@ static void Cmd_getexp(void) break; case 1: // calculate experience points to redistribute { - u16 calculatedExp; - s32 viaSentIn; + u32 orderId = 0; + u32 calculatedExp = 0; + u32 *exp = &gBattleStruct->expValue; + u32 sentInBits = gSentPokesToOpponent[(gBattlerFainted & 2) >> 1]; + u32 expShareBits = 0; + s32 viaSentIn = 0; + s32 viaExpShare = 0; - for (viaSentIn = 0, i = 0; i < PARTY_SIZE; i++) + for (i = 0; i < PARTY_SIZE; i++) { - if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0) + if (!IsValidForBattle(&gPlayerParty[i])) continue; - if (gBitTable[i] & sentIn) + if (gBitTable[i] & sentInBits) viaSentIn++; - item = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); - - if (item == ITEM_ENIGMA_BERRY) - holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; - else - holdEffect = ItemId_GetHoldEffect(item); - - if (holdEffect == HOLD_EFFECT_EXP_SHARE) + holdEffect = GetMonHoldEffect(&gPlayerParty[i]); + if (holdEffect == HOLD_EFFECT_EXP_SHARE || IsGen6ExpShareEnabled()) + { + expShareBits |= gBitTable[i]; viaExpShare++; + } } - - calculatedExp = gSpeciesInfo[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7; - - if (viaExpShare) // at least one mon is getting exp via exp share + // Get order of mons getting exp: 1. all mons via sent in, 2. all mons via exp share + for (i = 0; i < PARTY_SIZE; i++) { - *exp = SAFE_DIV(calculatedExp / 2, viaSentIn); - if (*exp == 0) - *exp = 1; + if (gBitTable[i] & sentInBits) + gBattleStruct->expGettersOrder[orderId++] = i; + } + for (i = 0; i < PARTY_SIZE; i++) + { + if (!(gBitTable[i] & sentInBits) && gBitTable[i] & expShareBits) + gBattleStruct->expGettersOrder[orderId++] = i; + } + if (orderId < PARTY_SIZE) + gBattleStruct->expGettersOrder[orderId] = PARTY_SIZE; - gExpShareExp = calculatedExp / 2 / viaExpShare; - if (gExpShareExp == 0) - gExpShareExp = 1; + calculatedExp = gSpeciesInfo[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level; + if (B_SCALED_EXP >= GEN_5 && B_SCALED_EXP != GEN_6) + calculatedExp /= 5; + else + calculatedExp /= 7; + + if (B_TRAINER_EXP_MULTIPLIER <= GEN_7 && gBattleTypeFlags & BATTLE_TYPE_TRAINER) + calculatedExp = (calculatedExp * 150) / 100; + + if (B_SPLIT_EXP < GEN_6) + { + if (viaExpShare) // at least one mon is getting exp via exp share + { + *exp = SAFE_DIV(calculatedExp / 2, viaSentIn); + if (*exp == 0) + *exp = 1; + + gBattleStruct->expShareExpValue = calculatedExp / 2 / viaExpShare; + if (gBattleStruct->expShareExpValue == 0) + gBattleStruct->expShareExpValue = 1; + } + else + { + *exp = SAFE_DIV(calculatedExp, viaSentIn); + if (*exp == 0) + *exp = 1; + gBattleStruct->expShareExpValue = 0; + } } else { - *exp = SAFE_DIV(calculatedExp, viaSentIn); - if (*exp == 0) - *exp = 1; - gExpShareExp = 0; + *exp = calculatedExp; + gBattleStruct->expShareExpValue = calculatedExp / 2; + if (gBattleStruct->expShareExpValue == 0) + gBattleStruct->expShareExpValue = 1; } gBattleScripting.getexpState++; - gBattleStruct->expGetterMonId = 0; - gBattleStruct->sentInPokes = sentIn; + gBattleStruct->expOrderId = 0; + *expMonId = gBattleStruct->expGettersOrder[0]; + gBattleStruct->expSentInMons = sentInBits; } // fall through case 2: // set exp value to the poke in expgetter_id and print message if (gBattleControllerExecFlags == 0) { - item = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HELD_ITEM); + bool32 wasSentOut = ((gBattleStruct->expSentInMons & gBitTable[*expMonId]) != 0); + holdEffect = GetMonHoldEffect(&gPlayerParty[*expMonId]); - if (item == ITEM_ENIGMA_BERRY) - holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; - else - holdEffect = ItemId_GetHoldEffect(item); - - if (holdEffect != HOLD_EFFECT_EXP_SHARE && !(gBattleStruct->sentInPokes & 1)) + if ((holdEffect != HOLD_EFFECT_EXP_SHARE && !wasSentOut && !IsGen6ExpShareEnabled()) + || GetMonData(&gPlayerParty[*expMonId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) { - *(&gBattleStruct->sentInPokes) >>= 1; gBattleScripting.getexpState = 5; gBattleMoveDamage = 0; // used for exp } - else if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) == MAX_LEVEL) + else if ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && *expMonId >= 3) + || GetMonData(&gPlayerParty[*expMonId], MON_DATA_LEVEL) == MAX_LEVEL) { - *(&gBattleStruct->sentInPokes) >>= 1; gBattleScripting.getexpState = 5; gBattleMoveDamage = 0; // used for exp + if (B_MAX_LEVEL_EV_GAINS >= GEN_5) + MonGainEVs(&gPlayerParty[*expMonId], gBattleMons[gBattlerFainted].species); } else { - // music change in wild battle after fainting a poke - if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_POKEDUDE)) && gBattleMons[0].hp != 0 && !gBattleStruct->wildVictorySong) + // Music change in a wild battle after fainting opposing pokemon. + if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) + && (gBattleMons[0].hp || (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && gBattleMons[2].hp)) + && !IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + && !IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)) + && !gBattleStruct->wildVictorySong) { BattleStopLowHpSound(); PlayBGM(MUS_VICTORY_WILD); gBattleStruct->wildVictorySong++; } - if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP)) + if (IsValidForBattle(&gPlayerParty[*expMonId])) { - if (gBattleStruct->sentInPokes & 1) - gBattleMoveDamage = *exp; + if (wasSentOut) + gBattleMoveDamage = gBattleStruct->expValue; // GetSoftLevelCapExpValue(gPlayerParty[*expMonId].level, gBattleStruct->expValue); TODO: Level caps? else gBattleMoveDamage = 0; - if (holdEffect == HOLD_EFFECT_EXP_SHARE) - gBattleMoveDamage += gExpShareExp; - if (holdEffect == HOLD_EFFECT_LUCKY_EGG) - gBattleMoveDamage = (gBattleMoveDamage * 150) / 100; - if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) - gBattleMoveDamage = (gBattleMoveDamage * 150) / 100; - if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]) - && !(gBattleTypeFlags & BATTLE_TYPE_POKEDUDE)) + if ((holdEffect == HOLD_EFFECT_EXP_SHARE || IsGen6ExpShareEnabled()) + && (B_SPLIT_EXP < GEN_6 || gBattleMoveDamage == 0)) // only give exp share bonus in later gens if the mon wasn't sent out { - gBattleMoveDamage = (gBattleMoveDamage * 150) / 100; - i = STRINGID_ABOOSTED; + gBattleMoveDamage += gBattleStruct->expValue; // GetSoftLevelCapExpValue(gPlayerParty[*expMonId].level, gBattleStruct->expShareExpValue); TODO: Level caps? + } + + ApplyExperienceMultipliers(&gBattleMoveDamage, *expMonId, gBattlerFainted); + + if (IsTradedMon(&gPlayerParty[*expMonId])) + { + // check if the Pokémon doesn't belong to the player + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && *expMonId >= 3) + i = STRINGID_EMPTYSTRING4; + else + i = STRINGID_ABOOSTED; } else { i = STRINGID_EMPTYSTRING4; } - // get exp getter battlerId + // get exp getter battler if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - if (gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId && !(gAbsentBattlerFlags & gBitTable[2])) + if (gBattlerPartyIndexes[2] == *expMonId && !(gAbsentBattlerFlags & gBitTable[2])) gBattleStruct->expGetterBattlerId = 2; else { @@ -3322,15 +4727,24 @@ static void Cmd_getexp(void) gBattleStruct->expGetterBattlerId = 0; } - PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattleStruct->expGetterBattlerId, gBattleStruct->expGetterMonId); + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattleStruct->expGetterBattlerId, *expMonId); // buffer 'gained' or 'gained a boosted' PREPARE_STRING_BUFFER(gBattleTextBuff2, i); - PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff3, 5, gBattleMoveDamage); + PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff3, 6, gBattleMoveDamage); - PrepareStringBattle(STRINGID_PKMNGAINEDEXP, gBattleStruct->expGetterBattlerId); - MonGainEVs(&gPlayerParty[gBattleStruct->expGetterMonId], gBattleMons[gBattlerFainted].species); + if (wasSentOut || holdEffect == HOLD_EFFECT_EXP_SHARE) + { + PrepareStringBattle(STRINGID_PKMNGAINEDEXP, gBattleStruct->expGetterBattlerId); + } + else if (IsGen6ExpShareEnabled() && !gBattleStruct->teamGotExpMsgPrinted) // Print 'the rest of your team got exp' message once, when all of the sent-in mons were given experience + { + gLastUsedItem = ITEM_EXP_SHARE; + PrepareStringBattle(STRINGID_TEAMGAINEDEXP, gBattleStruct->expGetterBattlerId); + gBattleStruct->teamGotExpMsgPrinted = TRUE; + } + + MonGainEVs(&gPlayerParty[*expMonId], gBattleMons[gBattlerFainted].species); } - gBattleStruct->sentInPokes >>= 1; gBattleScripting.getexpState++; } } @@ -3338,19 +4752,20 @@ static void Cmd_getexp(void) case 3: // Set stats and give exp if (gBattleControllerExecFlags == 0) { - gBattleBufferB[gBattleStruct->expGetterBattlerId][0] = 0; - if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP) && GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) != MAX_LEVEL) + // gBattleResources->bufferB[gBattleStruct->expGetterBattlerId][0] = 0; TODO: bufferB as part of battle resource + gBattleBufferB[gBattleStruct->expGetterBattlerId][0] = 0; + if (GetMonData(&gPlayerParty[*expMonId], MON_DATA_HP) && GetMonData(&gPlayerParty[*expMonId], MON_DATA_LEVEL) != MAX_LEVEL) { - gBattleResources->beforeLvlUp->stats[STAT_HP] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MAX_HP); - gBattleResources->beforeLvlUp->stats[STAT_ATK] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_ATK); - gBattleResources->beforeLvlUp->stats[STAT_DEF] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_DEF); - gBattleResources->beforeLvlUp->stats[STAT_SPEED] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPEED); - gBattleResources->beforeLvlUp->stats[STAT_SPATK] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPATK); - gBattleResources->beforeLvlUp->stats[STAT_SPDEF] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPDEF); + gBattleResources->beforeLvlUp->stats[STAT_HP] = GetMonData(&gPlayerParty[*expMonId], MON_DATA_MAX_HP); + gBattleResources->beforeLvlUp->stats[STAT_ATK] = GetMonData(&gPlayerParty[*expMonId], MON_DATA_ATK); + gBattleResources->beforeLvlUp->stats[STAT_DEF] = GetMonData(&gPlayerParty[*expMonId], MON_DATA_DEF); + gBattleResources->beforeLvlUp->stats[STAT_SPEED] = GetMonData(&gPlayerParty[*expMonId], MON_DATA_SPEED); + gBattleResources->beforeLvlUp->stats[STAT_SPATK] = GetMonData(&gPlayerParty[*expMonId], MON_DATA_SPATK); + gBattleResources->beforeLvlUp->stats[STAT_SPDEF] = GetMonData(&gPlayerParty[*expMonId], MON_DATA_SPDEF); gActiveBattler = gBattleStruct->expGetterBattlerId; - BtlController_EmitExpUpdate(BUFFER_A, gBattleStruct->expGetterMonId, gBattleMoveDamage); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitExpUpdate(BUFFER_A, *expMonId, gBattleMoveDamage); + MarkBattlerForControllerExec(gBattleStruct->expGetterBattlerId); } gBattleScripting.getexpState++; } @@ -3358,52 +4773,35 @@ static void Cmd_getexp(void) case 4: // lvl up if necessary if (gBattleControllerExecFlags == 0) { - gActiveBattler = gBattleStruct->expGetterBattlerId; - if (gBattleBufferB[gActiveBattler][0] == CONTROLLER_TWORETURNVALUES && gBattleBufferB[gActiveBattler][1] == RET_VALUE_LEVELED_UP) + u32 expBattler = gBattleStruct->expGetterBattlerId; + if (gBattleBufferB[expBattler][0] == CONTROLLER_TWORETURNVALUES && gBattleBufferB[expBattler][1] == RET_VALUE_LEVELED_UP) { - if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattlerPartyIndexes[gActiveBattler] == gBattleStruct->expGetterMonId) - HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); + u16 temp, battler = 0xFF; + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattlerPartyIndexes[expBattler] == *expMonId) + HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[expBattler]], expBattler); - PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gActiveBattler, gBattleStruct->expGetterMonId); - PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 3, GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL)); + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, expBattler, *expMonId); + PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 3, GetMonData(&gPlayerParty[*expMonId], MON_DATA_LEVEL)); BattleScriptPushCursor(); - gLeveledUpInBattle |= gBitTable[gBattleStruct->expGetterMonId]; + gLeveledUpInBattle |= gBitTable[*expMonId]; gBattlescriptCurrInstr = BattleScript_LevelUp; - gBattleMoveDamage = (gBattleBufferB[gActiveBattler][2] | (gBattleBufferB[gActiveBattler][3] << 8)); - AdjustFriendship(&gPlayerParty[gBattleStruct->expGetterMonId], FRIENDSHIP_EVENT_GROW_LEVEL); + gBattleMoveDamage = T1_READ_32(&gBattleBufferB[expBattler][2]); + AdjustFriendship(&gPlayerParty[*expMonId], FRIENDSHIP_EVENT_GROW_LEVEL); // update battle mon structure after level up - if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId && gBattleMons[0].hp) + if (gBattlerPartyIndexes[0] == *expMonId && gBattleMons[0].hp) + battler = 0; + else if (gBattlerPartyIndexes[2] == *expMonId && gBattleMons[2].hp && (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + battler = 2; + + if (battler != 0xFF) { - gBattleMons[0].level = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL); - gBattleMons[0].hp = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP); - gBattleMons[0].maxHP = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MAX_HP); - gBattleMons[0].attack = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_ATK); - gBattleMons[0].defense = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_DEF); - // Speed is duplicated, likely due to a copy-paste error. - gBattleMons[0].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPEED); - gBattleMons[0].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPEED); - gBattleMons[0].spAttack = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPATK); - gBattleMons[0].spDefense = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPDEF); - } - // What is else if? - if (gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId && gBattleMons[2].hp && (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) - { - gBattleMons[2].level = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL); - gBattleMons[2].hp = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP); - gBattleMons[2].maxHP = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MAX_HP); - gBattleMons[2].attack = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_ATK); - gBattleMons[2].defense = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_DEF); - gBattleMons[2].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPEED); - // Speed is duplicated again, but Special Defense is missing. -#ifdef BUGFIX - gBattleMons[2].spDefense = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPDEF); -#else - gBattleMons[2].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPEED); -#endif - gBattleMons[2].spAttack = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPATK); + CopyMonLevelAndBaseStatsToBattleMon(battler, &gPlayerParty[*expMonId]); + if (gStatuses3[battler] & STATUS3_POWER_TRICK) + SWAP(gBattleMons[battler].attack, gBattleMons[battler].defense, temp); } + gBattleScripting.getexpState = 5; } else @@ -3420,46 +4818,57 @@ static void Cmd_getexp(void) } else { - gBattleStruct->expGetterMonId++; - if (gBattleStruct->expGetterMonId < PARTY_SIZE) - gBattleScripting.getexpState = 2; // loop again - else - gBattleScripting.getexpState = 6; // we're done + if ((++gBattleStruct->expOrderId) < PARTY_SIZE) + { + *expMonId = gBattleStruct->expGettersOrder[gBattleStruct->expOrderId]; + if (*expMonId < PARTY_SIZE) + { + gBattleScripting.getexpState = 2; // loop again + break; + } + } + gBattleScripting.getexpState = 6; // we're done } break; case 6: // increment instruction if (gBattleControllerExecFlags == 0) { // not sure why gf clears the item and ability here + gBattleStruct->expOrderId = 0; + gBattleStruct->teamGotExpMsgPrinted = FALSE; gBattleMons[gBattlerFainted].item = ITEM_NONE; gBattleMons[gBattlerFainted].ability = ABILITY_NONE; - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } } -// For battles that aren't BATTLE_TYPE_LINK, the only thing this -// command does is check whether the player has won/lost by totaling each team's HP. It then -// sets gBattleOutcome accordingly, if necessary. -static void Cmd_checkteamslost(void) +bool32 NoAliveMonsForPlayer(void) { - u16 HP_count = 0; - s32 i; + u32 i; + u32 maxI = PARTY_SIZE; + u32 HP_count = 0; - if (gBattleControllerExecFlags) - return; + if (B_MULTI_BATTLE_WHITEOUT < GEN_4 && gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER)) + maxI = MULTI_PARTY_SIZE; - for (i = 0; i < PARTY_SIZE; i++) + // Get total HP for the player's party to determine if the player has lost + for (i = 0; i < maxI; i++) { if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) { HP_count += GetMonData(&gPlayerParty[i], MON_DATA_HP); } } - if (HP_count == 0) - gBattleOutcome |= B_OUTCOME_LOST; - HP_count = 0; + + return (HP_count == 0); +} + +static bool32 NoAliveMonsForOpponent(void) +{ + u32 i; + u32 HP_count = 0; // Get total HP for the enemy's party to determine if the player has won for (i = 0; i < PARTY_SIZE; i++) @@ -3469,69 +4878,77 @@ static void Cmd_checkteamslost(void) HP_count += GetMonData(&gEnemyParty[i], MON_DATA_HP); } } - if (HP_count == 0) + + return (HP_count == 0); +} + +bool32 NoAliveMonsForEitherParty(void) +{ + return (NoAliveMonsForPlayer() || NoAliveMonsForOpponent()); +} + +// For battles that aren't BATTLE_TYPE_LINK, the only thing this +// command does is check whether the player has won/lost by totaling each team's HP. It then +// sets gBattleOutcome accordingly, if necessary. +static void Cmd_checkteamslost(void) +{ + CMD_ARGS(const u8 *jumpInstr); + + if (gBattleControllerExecFlags) + return; + + if (NoAliveMonsForPlayer()) + gBattleOutcome |= B_OUTCOME_LOST; + + if (NoAliveMonsForOpponent()) gBattleOutcome |= B_OUTCOME_WON; // For link battles that haven't ended, count number of empty battler spots // In link multi battles, jump to pointer if more than 1 spot empty // In non-multi battles, jump to pointer if 1 spot is missing on both sides - if (gBattleOutcome == 0 && (gBattleTypeFlags & BATTLE_TYPE_LINK)) + if (gBattleOutcome == 0 && (gBattleTypeFlags & (BATTLE_TYPE_LINK))) { - s32 emptyPlayerSpots; - s32 emptyOpponentSpots; + s32 i, emptyPlayerSpots, emptyOpponentSpots; for (emptyPlayerSpots = 0, i = 0; i < gBattlersCount; i += 2) { - u32 *ptr = &gHitMarker; - u32 hitMarkerUnk = 0x10000000; - - i++; - --i; - if ((hitMarkerUnk << i) & *ptr && !gSpecialStatuses[i].faintedHasReplacement) + if ((gHitMarker & HITMARKER_FAINTED2(i)) && (!gSpecialStatuses[i].faintedHasReplacement)) emptyPlayerSpots++; } - for (emptyOpponentSpots = 0, i = 1; i < gBattlersCount; i += 2) - { - u32 *ptr = &gHitMarker; - u32 hitMarkerUnk = 0x10000000; - - { - u8 match; - ++match; - --match; - } - if ((hitMarkerUnk << i) & *ptr && !gSpecialStatuses[i].faintedHasReplacement) + emptyOpponentSpots = 0; + for (i = 1; i < gBattlersCount; i += 2) + { + if ((gHitMarker & HITMARKER_FAINTED2(i)) && (!gSpecialStatuses[i].faintedHasReplacement)) emptyOpponentSpots++; } if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { if (emptyOpponentSpots + emptyPlayerSpots > 1) - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { if (emptyOpponentSpots != 0 && emptyPlayerSpots != 0) - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void MoveValuesCleanUp(void) { gMoveResultFlags = 0; - gBattleScripting.dmgMultiplier = 1; - gCritMultiplier = 1; - gBattleCommunication[MOVE_EFFECT_BYTE] = 0; + gIsCriticalHit = FALSE; + gBattleScripting.moveEffect = 0; gBattleCommunication[MISS_TYPE] = 0; gHitMarker &= ~HITMARKER_DESTINYBOND; gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; @@ -3539,315 +4956,363 @@ static void MoveValuesCleanUp(void) static void Cmd_movevaluescleanup(void) { + CMD_ARGS(); + MoveValuesCleanUp(); - gBattlescriptCurrInstr += 1; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setmultihit(void) { - gMultiHitCounter = gBattlescriptCurrInstr[1]; - gBattlescriptCurrInstr += 2; + CMD_ARGS(u8 value); + + gMultiHitCounter = cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_decrementmultihit(void) { + CMD_ARGS(const u8 *loopInstr); + if (--gMultiHitCounter == 0) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->loopInstr; } static void Cmd_goto(void) { - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *instr); + + gBattlescriptCurrInstr = cmd->instr; } static void Cmd_jumpifbyte(void) { - u8 caseID = gBattlescriptCurrInstr[1]; - const u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2); - u8 value = gBattlescriptCurrInstr[6]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7); + CMD_ARGS(u8 comparison, const u8 *bytePtr, u8 value, const u8 *jumpInstr); - gBattlescriptCurrInstr += 11; + u8 comparison = cmd->comparison; + const u8 *bytePtr = cmd->bytePtr; + u8 value = cmd->value; + const u8 *jumpInstr = cmd->jumpInstr; - switch (caseID) + gBattlescriptCurrInstr = cmd->nextInstr; + + switch (comparison) { case CMP_EQUAL: - if (*memByte == value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr == value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NOT_EQUAL: - if (*memByte != value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr != value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_GREATER_THAN: - if (*memByte > value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr > value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_LESS_THAN: - if (*memByte < value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr < value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_COMMON_BITS: - if (*memByte & value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr & value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NO_COMMON_BITS: - if (!(*memByte & value)) - gBattlescriptCurrInstr = jumpPtr; + if (!(*bytePtr & value)) + gBattlescriptCurrInstr = jumpInstr; break; } } static void Cmd_jumpifhalfword(void) { - u8 caseID = gBattlescriptCurrInstr[1]; - const u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2); - u16 value = T2_READ_16(gBattlescriptCurrInstr + 6); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8); + CMD_ARGS(u8 comparison, const u16 *halfwordPtr, u16 value, const u8 *jumpInstr); - gBattlescriptCurrInstr += 12; + u8 comparison = cmd->comparison; + const u16 *halfwordPtr = cmd->halfwordPtr; + u16 value = cmd->value; + const u8 *jumpInstr = cmd->jumpInstr; - switch (caseID) + gBattlescriptCurrInstr = cmd->nextInstr; + + switch (comparison) { case CMP_EQUAL: - if (*memHword == value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr == value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NOT_EQUAL: - if (*memHword != value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr != value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_GREATER_THAN: - if (*memHword > value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr > value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_LESS_THAN: - if (*memHword < value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr < value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_COMMON_BITS: - if (*memHword & value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr & value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NO_COMMON_BITS: - if (!(*memHword & value)) - gBattlescriptCurrInstr = jumpPtr; + if (!(*halfwordPtr & value)) + gBattlescriptCurrInstr = jumpInstr; break; } } static void Cmd_jumpifword(void) { - u8 caseID = gBattlescriptCurrInstr[1]; - const u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2); - u32 value = T1_READ_32(gBattlescriptCurrInstr + 6); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + CMD_ARGS(u8 comparison, const u32 *wordPtr, u32 value, const u8 *jumpInstr); - gBattlescriptCurrInstr += 14; + u8 comparison = cmd->comparison; + const u32 *wordPtr = cmd->wordPtr; + u32 value = cmd->value; + const u8 *jumpInstr = cmd->jumpInstr; - switch (caseID) + gBattlescriptCurrInstr = cmd->nextInstr; + + switch (comparison) { case CMP_EQUAL: - if (*memWord == value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr == value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NOT_EQUAL: - if (*memWord != value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr != value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_GREATER_THAN: - if (*memWord > value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr > value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_LESS_THAN: - if (*memWord < value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr < value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_COMMON_BITS: - if (*memWord & value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr & value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NO_COMMON_BITS: - if (!(*memWord & value)) - gBattlescriptCurrInstr = jumpPtr; + if (!(*wordPtr & value)) + gBattlescriptCurrInstr = jumpInstr; break; } } static void Cmd_jumpifarrayequal(void) { - const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); - u32 size = gBattlescriptCurrInstr[9]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + CMD_ARGS(const u8 *array1, const u8 *array2, u8 size, const u8 *jumpInstr); + + const u8 *array1 = cmd->array1; + const u8 *array2 = cmd->array2; + u32 size = cmd->size; + const u8 *jumpInstr = cmd->jumpInstr; u8 i; for (i = 0; i < size; i++) { - if (*mem1 != *mem2) + if (*array1 != *array2) { - gBattlescriptCurrInstr += 14; + gBattlescriptCurrInstr = cmd->nextInstr; break; } - mem1++, mem2++; + array1++, array2++; } if (i == size) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; } static void Cmd_jumpifarraynotequal(void) { + CMD_ARGS(const u8 *array1, const u8 *array2, u8 size, const u8 *jumpInstr); + u8 equalBytes = 0; - const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); - u32 size = gBattlescriptCurrInstr[9]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + const u8 *array1 = cmd->array1; + const u8 *array2 = cmd->array2; + u32 size = cmd->size; + const u8 *jumpInstr = cmd->jumpInstr; u8 i; for (i = 0; i < size; i++) { - if (*mem1 == *mem2) + if (*array1 == *array2) equalBytes++; - mem1++, mem2++; + array1++, array2++; } if (equalBytes != size) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 14; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte = gBattlescriptCurrInstr[5]; + CMD_ARGS(u8 *bytePtr, u8 value); - gBattlescriptCurrInstr += 6; + u8 *bytePtr = cmd->bytePtr; + *bytePtr = cmd->value; + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_addbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte += gBattlescriptCurrInstr[5]; - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr += cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_subbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte -= gBattlescriptCurrInstr[5]; - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr -= cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_copyarray(void) { - u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5); - s32 size = gBattlescriptCurrInstr[9]; + CMD_ARGS(u8 *dest, const u8 *src, u8 size); + + u8 *dest = cmd->dest; + const u8 *src = cmd->src; + s32 size = cmd->size; s32 i; for (i = 0; i < size; i++) dest[i] = src[i]; - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_copyarraywithindex(void) { - u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5); - const u8 *index = T2_READ_PTR(gBattlescriptCurrInstr + 9); - s32 size = gBattlescriptCurrInstr[13]; + CMD_ARGS(u8 *dest, const u8 *src, const u8 *indexPtr, u8 size); + + u8 *dest = cmd->dest; + const u8 *src = cmd->src; + const u8 *indexPtr = cmd->indexPtr; + s32 size = cmd->size; s32 i; for (i = 0; i < size; i++) - dest[i] = src[i + *index]; + dest[i] = src[i + *indexPtr]; - gBattlescriptCurrInstr += 14; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_orbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte |= gBattlescriptCurrInstr[5]; - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr |= cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_orhalfword(void) { - u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); + CMD_ARGS(u16 *halfwordPtr, u16 value); - *memHword |= val; - gBattlescriptCurrInstr += 7; + u16 *halfwordPtr = cmd->halfwordPtr; + u16 value = cmd->value; + + *halfwordPtr |= value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_orword(void) { - u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); + CMD_ARGS(u32 *wordPtr, u32 value); - *memWord |= val; - gBattlescriptCurrInstr += 9; + u32 *wordPtr = cmd->wordPtr; + u32 value = cmd->value; + + *wordPtr |= value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_bicbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte &= ~(gBattlescriptCurrInstr[5]); - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr &= ~cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_bichalfword(void) { - u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); + CMD_ARGS(u16 *halfwordPtr, u16 value); - *memHword &= ~val; - gBattlescriptCurrInstr += 7; + u16 *halfwordPtr = cmd->halfwordPtr; + u16 value = cmd->value; + + *halfwordPtr &= ~value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_bicword(void) { - u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); + CMD_ARGS(u32 *wordPtr, u32 value); - *memWord &= ~val; - gBattlescriptCurrInstr += 9; + u32 *wordPtr = cmd->wordPtr; + u32 value = cmd->value; + + *wordPtr &= ~value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_pause(void) { + CMD_ARGS(u16 frames); + if (gBattleControllerExecFlags == 0) { - u16 value = T2_READ_16(gBattlescriptCurrInstr + 1); + u16 value = cmd->frames; if (++gPauseCounterBattle >= value) { gPauseCounterBattle = 0; - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_waitstate(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags == 0) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_healthbar_update(void) { - if (gBattlescriptCurrInstr[1] == BS_TARGET) - gActiveBattler = gBattlerTarget; - else - gActiveBattler = gBattlerAttacker; + CMD_ARGS(u8 battler); + u32 battler; + if (cmd->battler == BS_TARGET) + battler = gBattlerTarget; + else + battler = gBattlerAttacker; + + gActiveBattler = battler; BtlController_EmitHealthBarUpdate(BUFFER_A, gBattleMoveDamage); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_return(void) @@ -3857,6 +5322,8 @@ static void Cmd_return(void) static void Cmd_end(void) { + CMD_ARGS(); + gMoveResultFlags = 0; gActiveBattler = 0; gCurrentActionFuncId = B_ACTION_TRY_FINISH; @@ -3864,6 +5331,8 @@ static void Cmd_end(void) static void Cmd_end2(void) { + CMD_ARGS(); + gActiveBattler = 0; gCurrentActionFuncId = B_ACTION_TRY_FINISH; } @@ -3871,6 +5340,8 @@ static void Cmd_end2(void) // Pops the main function stack static void Cmd_end3(void) { + CMD_ARGS(); + BattleScriptPop(); if (gBattleResources->battleCallbackStack->size != 0) gBattleResources->battleCallbackStack->size--; @@ -3879,193 +5350,220 @@ static void Cmd_end3(void) static void Cmd_call(void) { - BattleScriptPush(gBattlescriptCurrInstr + 5); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *instr); + + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = cmd->instr; } -static void Cmd_jumpiftype2(void) +static void Cmd_setroost(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(); - if (gBattlescriptCurrInstr[2] == gBattleMons[battlerId].type1 || gBattlescriptCurrInstr[2] == gBattleMons[battlerId].type2) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - else - gBattlescriptCurrInstr += 7; + gBattleResources->flags->flags[gBattlerAttacker] |= RESOURCE_FLAG_ROOST; + gBattleStruct->roostTypes[gBattlerAttacker][0] = gBattleMons[gBattlerAttacker].type1; + gBattleStruct->roostTypes[gBattlerAttacker][1] = gBattleMons[gBattlerAttacker].type2; + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifabilitypresent(void) { CMD_ARGS(u16 ability, const u8 *jumpInstr); - u16 ability = cmd->ability; - if (AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ability, 0, 0)) + u16 ability = cmd->ability; + u32 abilityBattler = IsAbilityOnField(ability); + if (abilityBattler) + { + gBattlerAbility = abilityBattler - 1; gBattlescriptCurrInstr = cmd->jumpInstr; + } else + { gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_endselectionscript(void) { + CMD_ARGS(); + *(gBattlerAttacker + gBattleStruct->selectionScriptFinished) = TRUE; } +static void PlayAnimation(u32 battler, u8 animId, const u16 *argPtr, const u8 *nextInstr) +{ + if (B_TERRAIN_BG_CHANGE == FALSE && animId == B_ANIM_RESTORE_BG) + { + // workaround for .if not working + gBattlescriptCurrInstr = nextInstr; + return; + } + + gActiveBattler = battler; + // TODO: Animation + if (animId == B_ANIM_STATS_CHANGE + || animId == B_ANIM_SNATCH_MOVE + /* || animId == B_ANIM_MEGA_EVOLUTION + || animId == B_ANIM_ILLUSION_OFF */ + || animId == B_ANIM_FORM_CHANGE + || animId == B_ANIM_SUBSTITUTE_FADE + /* || animId == B_ANIM_PRIMAL_REVERSION + || animId == B_ANIM_ULTRA_BURST */) + { + BtlController_EmitBattleAnimation(BUFFER_A, animId, &gDisableStructs[battler], *argPtr); + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = nextInstr; + } + else if (gHitMarker & (HITMARKER_NO_ANIMATIONS | HITMARKER_DISABLE_ANIMATION) && animId != B_ANIM_RESTORE_BG) + { + BattleScriptPush(nextInstr); + gBattlescriptCurrInstr = BattleScript_Pausex20; + } + else if (animId == B_ANIM_RAIN_CONTINUES + || animId == B_ANIM_SUN_CONTINUES + || animId == B_ANIM_SANDSTORM_CONTINUES + || animId == B_ANIM_HAIL_CONTINUES + /* || animId == B_ANIM_SNOW_CONTINUES */) // TODO: Animation + { + BtlController_EmitBattleAnimation(BUFFER_A, animId, &gDisableStructs[battler], *argPtr); + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = nextInstr; + } + else if (gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + { + gBattlescriptCurrInstr = nextInstr; + } + else + { + BtlController_EmitBattleAnimation(BUFFER_A, animId, &gDisableStructs[battler], *argPtr); + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = nextInstr; + } +} + static void Cmd_playanimation(void) { - const u16 *argumentPtr; + CMD_ARGS(u8 battler, u8 animId, const u16 *argPtr); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); - - if (gBattlescriptCurrInstr[2] == B_ANIM_STATS_CHANGE - || gBattlescriptCurrInstr[2] == B_ANIM_SNATCH_MOVE - || gBattlescriptCurrInstr[2] == B_ANIM_SUBSTITUTE_FADE - || gBattlescriptCurrInstr[2] == B_ANIM_SILPH_SCOPED) - { - BtlController_EmitBattleAnimation(BUFFER_A, gBattlescriptCurrInstr[2], *argumentPtr); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; - } - else if (gHitMarker & HITMARKER_NO_ANIMATIONS) - { - BattleScriptPush(gBattlescriptCurrInstr + 7); - gBattlescriptCurrInstr = BattleScript_Pausex20; - } - else if (gBattlescriptCurrInstr[2] == B_ANIM_RAIN_CONTINUES - || gBattlescriptCurrInstr[2] == B_ANIM_SUN_CONTINUES - || gBattlescriptCurrInstr[2] == B_ANIM_SANDSTORM_CONTINUES - || gBattlescriptCurrInstr[2] == B_ANIM_HAIL_CONTINUES) - { - BtlController_EmitBattleAnimation(BUFFER_A, gBattlescriptCurrInstr[2], *argumentPtr); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; - } - else if (gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) - { - gBattlescriptCurrInstr += 7; - } - else - { - BtlController_EmitBattleAnimation(BUFFER_A, gBattlescriptCurrInstr[2], *argumentPtr); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; - } + u32 battler = GetBattlerForBattleScript(cmd->battler); + PlayAnimation(battler, cmd->animId, cmd->argPtr, cmd->nextInstr); } // Same as playanimation, except it takes a pointer to some animation id, instead of taking the value directly static void Cmd_playanimation_var(void) { - const u16 *argumentPtr; - const u8 *animationIdPtr; + CMD_ARGS(u8 battler, const u8 *animIdPtr, const u16 *argPtr); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - animationIdPtr = T2_READ_PTR(gBattlescriptCurrInstr + 2); - argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); - - if (*animationIdPtr == B_ANIM_STATS_CHANGE - || *animationIdPtr == B_ANIM_SNATCH_MOVE - || *animationIdPtr == B_ANIM_SUBSTITUTE_FADE) - { - BtlController_EmitBattleAnimation(BUFFER_A, *animationIdPtr, *argumentPtr); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 10; - } - else if (gHitMarker & HITMARKER_NO_ANIMATIONS) - { - gBattlescriptCurrInstr += 10; - } - else if (*animationIdPtr == B_ANIM_RAIN_CONTINUES - || *animationIdPtr == B_ANIM_SUN_CONTINUES - || *animationIdPtr == B_ANIM_SANDSTORM_CONTINUES - || *animationIdPtr == B_ANIM_HAIL_CONTINUES) - { - BtlController_EmitBattleAnimation(BUFFER_A, *animationIdPtr, *argumentPtr); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 10; - } - else if (gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) - { - gBattlescriptCurrInstr += 10; - } - else - { - BtlController_EmitBattleAnimation(BUFFER_A, *animationIdPtr, *argumentPtr); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 10; - } + u32 battler = GetBattlerForBattleScript(cmd->battler); + PlayAnimation(battler, *(cmd->animIdPtr), cmd->argPtr, cmd->nextInstr); } static void Cmd_setgraphicalstatchangevalues(void) { - u8 value = 0; - switch (GET_STAT_BUFF_VALUE2(gBattleScripting.statChanger)) + CMD_ARGS(); + + u8 value = GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger); + + switch (value) { case SET_STAT_BUFF_VALUE(1): // +1 - value = STAT_ANIM_PLUS1; + value = STAT_ANIM_PLUS1 + 1; break; case SET_STAT_BUFF_VALUE(2): // +2 - value = STAT_ANIM_PLUS2; + value = STAT_ANIM_PLUS2 + 1; + break; + case SET_STAT_BUFF_VALUE(3): // +3 + value = STAT_ANIM_PLUS2 + 1; break; case SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE: // -1 - value = STAT_ANIM_MINUS1; + value = STAT_ANIM_MINUS1 + 1; break; case SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE: // -2 - value = STAT_ANIM_MINUS2; + value = STAT_ANIM_MINUS2 + 1; + break; + case SET_STAT_BUFF_VALUE(3) | STAT_BUFF_NEGATIVE: // -3 + value = STAT_ANIM_MINUS2 + 1; + break; + default: // <-12,-4> and <4, 12> + if (value & STAT_BUFF_NEGATIVE) + value = STAT_ANIM_MINUS2 + 1; + else + value = STAT_ANIM_PLUS2 + 1; break; } gBattleScripting.animArg1 = GET_STAT_BUFF_ID(gBattleScripting.statChanger) + value - 1; gBattleScripting.animArg2 = 0; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_playstatchangeanimation(void) { + CMD_ARGS(u8 battler, u8 stats, u8 flags); + u32 currStat = 0; - u16 statAnimId = 0; - s32 changeableStatsCount = 0; - u8 statsToCheck = 0; + u32 statAnimId = 0; + u32 changeableStatsCount = 0; + u32 startingStatAnimId = 0; + u32 flags = cmd->flags; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + u32 ability = GetBattlerAbility(battler); + u32 stats = cmd->stats; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - statsToCheck = gBattlescriptCurrInstr[2]; - - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_NEGATIVE) // goes down + // Handle Contrary and Simple + if (ability == ABILITY_CONTRARY) { - s16 startingStatAnimId; - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) - startingStatAnimId = STAT_ANIM_MINUS2 - 1; - else - startingStatAnimId = STAT_ANIM_MINUS1 - 1; + flags ^= STAT_CHANGE_NEGATIVE; + RecordAbilityBattle(battler, ability); + } + else if (ability == ABILITY_SIMPLE) + { + flags |= STAT_CHANGE_BY_TWO; + RecordAbilityBattle(battler, ability); + } - while (statsToCheck != 0) + if (flags & STAT_CHANGE_NEGATIVE) // goes down + { + if (flags & STAT_CHANGE_BY_TWO) + startingStatAnimId = STAT_ANIM_MINUS2; + else + startingStatAnimId = STAT_ANIM_MINUS1; + + while (stats != 0) { - if (statsToCheck & 1) + if (stats & 1) { - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_CANT_PREVENT) + if (flags & STAT_CHANGE_CANT_PREVENT) { - if (gBattleMons[gActiveBattler].statStages[currStat] > MIN_STAT_STAGE) + if (gBattleMons[battler].statStages[currStat] > MIN_STAT_STAGE) { statAnimId = startingStatAnimId + currStat; changeableStatsCount++; } } - else if (!gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].mistTimer - && gBattleMons[gActiveBattler].ability != ABILITY_CLEAR_BODY - && gBattleMons[gActiveBattler].ability != ABILITY_WHITE_SMOKE - && !(gBattleMons[gActiveBattler].ability == ABILITY_KEEN_EYE && currStat == STAT_ACC) - && !(gBattleMons[gActiveBattler].ability == ABILITY_HYPER_CUTTER && currStat == STAT_ATK)) + else if (!gSideTimers[GetBattlerSide(battler)].mistTimer + && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_CLEAR_AMULET + && ability != ABILITY_CLEAR_BODY + && ability != ABILITY_FULL_METAL_BODY + && ability != ABILITY_WHITE_SMOKE + && !((ability == ABILITY_KEEN_EYE || ability == ABILITY_MINDS_EYE) && currStat == STAT_ACC) + && !(B_ILLUMINATE_EFFECT >= GEN_9 && ability == ABILITY_ILLUMINATE && currStat == STAT_ACC) + && !(ability == ABILITY_HYPER_CUTTER && currStat == STAT_ATK) + && !(ability == ABILITY_BIG_PECKS && currStat == STAT_DEF)) { - if (gBattleMons[gActiveBattler].statStages[currStat] > MIN_STAT_STAGE) + if (gBattleMons[battler].statStages[currStat] > MIN_STAT_STAGE) { statAnimId = startingStatAnimId + currStat; changeableStatsCount++; } } } - statsToCheck >>= 1, currStat++; + stats >>= 1, currStat++; } if (changeableStatsCount > 1) // more than one stat, so the color is gray { - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) + if (flags & STAT_CHANGE_BY_TWO) statAnimId = STAT_ANIM_MULTIPLE_MINUS2; else statAnimId = STAT_ANIM_MULTIPLE_MINUS1; @@ -4073,72 +5571,124 @@ static void Cmd_playstatchangeanimation(void) } else // goes up { - s16 startingStatAnimId; - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) - startingStatAnimId = STAT_ANIM_PLUS2 - 1; + if (flags & STAT_CHANGE_BY_TWO) + startingStatAnimId = STAT_ANIM_PLUS2; else - startingStatAnimId = STAT_ANIM_PLUS1 - 1; + startingStatAnimId = STAT_ANIM_PLUS1; - while (statsToCheck != 0) + while (stats != 0) { - if (statsToCheck & 1 && gBattleMons[gActiveBattler].statStages[currStat] < MAX_STAT_STAGE) + if (stats & 1 && gBattleMons[battler].statStages[currStat] < MAX_STAT_STAGE) { statAnimId = startingStatAnimId + currStat; changeableStatsCount++; } - statsToCheck >>= 1, currStat++; + stats >>= 1, currStat++; } if (changeableStatsCount > 1) // more than one stat, so the color is gray { - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) + if (flags & STAT_CHANGE_BY_TWO) statAnimId = STAT_ANIM_MULTIPLE_PLUS2; else statAnimId = STAT_ANIM_MULTIPLE_PLUS1; } } - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount < 2) + if (flags & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount < 2) { - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (changeableStatsCount != 0 && !gBattleScripting.statAnimPlayed) { - BtlController_EmitBattleAnimation(BUFFER_A, B_ANIM_STATS_CHANGE, statAnimId); - MarkBattlerForControllerExec(gActiveBattler); - if (gBattlescriptCurrInstr[3] & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount > 1) + BtlController_EmitBattleAnimation(BUFFER_A, B_ANIM_STATS_CHANGE, &gDisableStructs[battler], statAnimId); + MarkBattlerForControllerExec(battler); + if (flags & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount > 1) gBattleScripting.statAnimPlayed = TRUE; - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; } } +static bool32 TryKnockOffBattleScript(u32 battlerDef) +{ + if (gBattleMons[battlerDef].item != 0 + && CanBattlerGetOrLoseItem(battlerDef, gBattleMons[battlerDef].item) + && !NoAliveMonsForEitherParty()) + { + if (GetBattlerAbility(battlerDef) == ABILITY_STICKY_HOLD && IsBattlerAlive(battlerDef)) + { + gBattlerAbility = battlerDef; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StickyHoldActivates; + } + else + { + u32 side = GetBattlerSide(battlerDef); + + gLastUsedItem = gBattleMons[battlerDef].item; + gBattleMons[battlerDef].item = 0; + if (gBattleMons[battlerDef].ability != ABILITY_GORILLA_TACTICS) + gBattleStruct->choicedMove[battlerDef] = 0; + gWishFutureKnock.knockedOffMons[side] |= gBitTable[gBattlerPartyIndexes[battlerDef]]; + CheckSetUnburden(battlerDef); + + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_KnockedOff; + } + return TRUE; + } + return FALSE; +} + +#define SYMBIOSIS_CHECK(battler, ally) \ + GetBattlerAbility(ally) == ABILITY_SYMBIOSIS \ + && gBattleMons[battler].item == ITEM_NONE \ + && gBattleMons[ally].item != ITEM_NONE \ + && CanBattlerGetOrLoseItem(battler, gBattleMons[ally].item) \ + && CanBattlerGetOrLoseItem(ally, gBattleMons[ally].item) \ + && gBattleMons[battler].hp != 0 \ + && gBattleMons[ally].hp != 0 + +static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent) +{ + u32 i; + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (i != gBattlerAttacker + && !(excludeCurrent && i == gBattlerTarget) + && IsBattlerAlive(i) + && !(gBattleStruct->targetsDone[gBattlerAttacker] & gBitTable[i]) + && (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) + break; + } + return i; +} + static void Cmd_moveend(void) { + CMD_ARGS(u8 endMode, u8 endState); + s32 i; bool32 effect = FALSE; - u8 moveType = 0; - u8 holdEffectAtk = 0; + u32 moveType = 0; + u32 holdEffectAtk = 0; u16 *choicedMoveAtk = NULL; - u8 endMode, endState; - u16 originallyUsedMove; + u32 endMode, endState; + u32 originallyUsedMove; if (gChosenMove == MOVE_UNAVAILABLE) originallyUsedMove = MOVE_NONE; else originallyUsedMove = gChosenMove; - endMode = gBattlescriptCurrInstr[1]; - endState = gBattlescriptCurrInstr[2]; - - if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY) - holdEffectAtk = gEnigmaBerries[gBattlerAttacker].holdEffect; - else - holdEffectAtk = ItemId_GetHoldEffect(gBattleMons[gBattlerAttacker].item); + endMode = cmd->endMode; + endState = cmd->endState; + holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE); choicedMoveAtk = &gBattleStruct->choicedMove[gBattlerAttacker]; GET_MOVE_TYPE(gCurrentMove, moveType); @@ -4146,6 +5696,97 @@ static void Cmd_moveend(void) { switch (gBattleScripting.moveendState) { + case MOVEEND_SUM_DAMAGE: // Sum and store damage dealt for multi strike recoil + gBattleScripting.savedDmg += gHpDealt; + gBattleScripting.moveendState++; + break; + case MOVEEND_PROTECT_LIKE_EFFECT: + if (gProtectStructs[gBattlerAttacker].touchedProtectLike) + { + if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SPIKY_SHIELD); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SpikyShieldEffect; + effect = 1; + } + else if (gProtectStructs[gBattlerTarget].kingsShielded) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + i = gBattlerAttacker; + gBattlerAttacker = gBattlerTarget; + gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable + if (B_KINGS_SHIELD_LOWER_ATK >= GEN_8) + gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1; + else + gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_2; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_KingsShieldEffect; + effect = 1; + } + else if (gProtectStructs[gBattlerTarget].banefulBunkered) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; + effect = 1; + } + else if (gProtectStructs[gBattlerTarget].obstructed && gMovesInfo[gCurrentMove].effect != EFFECT_SUCKER_PUNCH && gMovesInfo[gCurrentMove].effect != EFFECT_UPPER_HAND) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + i = gBattlerAttacker; + gBattlerAttacker = gBattlerTarget; + gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable + gBattleScripting.moveEffect = MOVE_EFFECT_DEF_MINUS_2; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_KingsShieldEffect; + effect = 1; + } + else if (gProtectStructs[gBattlerTarget].silkTrapped) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + i = gBattlerAttacker; + gBattlerAttacker = gBattlerTarget; + gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable + gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_KingsShieldEffect; + effect = 1; + } + else if (gProtectStructs[gBattlerTarget].burningBulwarked) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + gBattleScripting.moveEffect = MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BURNING_BULWARK); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; + effect = 1; + } + // Not strictly a protect effect, but works the same way + else if (gProtectStructs[gBattlerTarget].beakBlastCharge + && CanBeBurned(gBattlerAttacker) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN; + gActiveBattler = gBattlerAttacker; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].status1), &gBattleMons[gBattlerAttacker].status1); + MarkBattlerForControllerExec(gBattlerAttacker); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; + effect = 1; + } + } + gBattleScripting.moveendState++; + break; case MOVEEND_RAGE: // rage check if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE && gBattleMons[gBattlerTarget].hp != 0 @@ -4153,10 +5794,10 @@ static void Cmd_moveend(void) && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED - && gBattleMoves[gCurrentMove].power != 0 - && gBattleMons[gBattlerTarget].statStages[STAT_ATK] < MAX_STAT_STAGE) + && gMovesInfo[gCurrentMove].power != 0 + && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { - gBattleMons[gBattlerTarget].statStages[STAT_ATK]++; + SET_STATCHANGER(STAT_ATK, 1, FALSE); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_RageIsBuilding; effect = TRUE; @@ -4167,18 +5808,47 @@ static void Cmd_moveend(void) if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget - && gSpecialStatuses[gBattlerTarget].specialDmg - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && moveType == TYPE_FIRE) + && (moveType == TYPE_FIRE || CanBurnHitThaw(gCurrentMove)) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE; gActiveBattler = gBattlerTarget; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_DefrostedViaFireMove; effect = TRUE; } + if (gBattleMons[gBattlerTarget].status1 & STATUS1_FROSTBITE + && gBattleMons[gBattlerTarget].hp != 0 + && gBattlerAttacker != gBattlerTarget + && gMovesInfo[originallyUsedMove].thawsUser + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FROSTBITE; + gActiveBattler = gBattlerTarget; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1); + MarkBattlerForControllerExec(gBattlerTarget); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_FrostbiteHealedViaFireMove; + effect = TRUE; + } + gBattleScripting.moveendState++; + break; + case MOVEEND_RECOIL: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && IsBattlerAlive(gBattlerAttacker) + && gBattleScripting.savedDmg != 0) // Some checks may be redundant alongside this one + { + if (gMovesInfo[gCurrentMove].recoil > 0) + { + gBattleMoveDamage = max(1, gBattleScripting.savedDmg * max(1, gMovesInfo[gCurrentMove].recoil) / 100); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; + effect = TRUE; + } + } gBattleScripting.moveendState++; break; case MOVEEND_SYNCHRONIZE_TARGET: // target synchronize @@ -4186,12 +5856,23 @@ static void Cmd_moveend(void) effect = TRUE; gBattleScripting.moveendState++; break; - case MOVEEND_ON_DAMAGE_ABILITIES: // Such as abilities activating on contact (Effect Spore, Rough Skin, etc.). - if (AbilityBattleEffects(ABILITYEFFECT_ON_DAMAGE, gBattlerTarget, 0, 0, 0)) + case MOVEEND_ABILITIES: // Such as abilities activating on contact(Poison Spore, Rough Skin, etc.). + if (AbilityBattleEffects(ABILITYEFFECT_MOVE_END, gBattlerTarget, 0, 0, 0)) effect = TRUE; gBattleScripting.moveendState++; break; - case MOVEEND_IMMUNITY_ABILITIES: // status immunities + case MOVEEND_ABILITIES_ATTACKER: // Poison Touch, possibly other in the future + if (AbilityBattleEffects(ABILITYEFFECT_MOVE_END_ATTACKER, gBattlerAttacker, 0, 0, 0)) + effect = TRUE; + gBattleScripting.moveendState++; + break; + case MOVEEND_OPPORTUNIST: + if (AbilityBattleEffects(ABILITYEFFECT_OPPORTUNIST, 0, 0, 0, 0)) + effect = TRUE; // it loops through all battlers, so we increment after its done with all battlers + else + gBattleScripting.moveendState++; + break; + case MOVEEND_STATUS_IMMUNITY_ABILITIES: // status immunities if (AbilityBattleEffects(ABILITYEFFECT_IMMUNITY, 0, 0, 0, 0)) effect = TRUE; // it loops through all battlers, so we increment after its done with all battlers else @@ -4204,11 +5885,13 @@ static void Cmd_moveend(void) break; case MOVEEND_CHOICE_MOVE: // update choice band move if (gHitMarker & HITMARKER_OBEYS - && holdEffectAtk == HOLD_EFFECT_CHOICE_BAND + && (HOLD_EFFECT_CHOICE(holdEffectAtk) || GetBattlerAbility(gBattlerAttacker) == ABILITY_GORILLA_TACTICS) && gChosenMove != MOVE_STRUGGLE && (*choicedMoveAtk == MOVE_NONE || *choicedMoveAtk == MOVE_UNAVAILABLE)) { - if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED)) + if ((gMovesInfo[gChosenMove].effect == EFFECT_BATON_PASS + || gMovesInfo[gChosenMove].effect == EFFECT_HEALING_WISH) + && !(gMoveResultFlags & MOVE_RESULT_FAILED)) { gBattleScripting.moveendState++; break; @@ -4227,33 +5910,93 @@ static void Cmd_moveend(void) case MOVEEND_CHANGED_ITEMS: // changed held items for (i = 0; i < gBattlersCount; i++) { - u16 *changedItem = &gBattleStruct->changedItems[i]; - if (*changedItem != ITEM_NONE) + if (gBattleStruct->changedItems[i] != ITEM_NONE) { - gBattleMons[i].item = *changedItem; - *changedItem = ITEM_NONE; + gBattleMons[i].item = gBattleStruct->changedItems[i]; + gBattleStruct->changedItems[i] = ITEM_NONE; } } gBattleScripting.moveendState++; break; + case MOVEEND_ITEM_EFFECTS_TARGET: + if (ItemBattleEffects(ITEMEFFECT_TARGET, gBattlerTarget, FALSE)) + effect = TRUE; + gBattleScripting.moveendState++; + break; + case MOVEEND_MOVE_EFFECTS2: // For effects which should happen after target items, for example Knock Off after damage from Rocky Helmet. + { + switch (gBattleStruct->moveEffect2) + { + case MOVE_EFFECT_KNOCK_OFF: + effect = TryKnockOffBattleScript(gBattlerTarget); + break; + case MOVE_EFFECT_STOCKPILE_WORE_OFF: + if (gDisableStructs[gBattlerAttacker].stockpileCounter != 0) + { + gDisableStructs[gBattlerAttacker].stockpileCounter = 0; + effect = TRUE; + BattleScriptPush(gBattlescriptCurrInstr); + gBattlescriptCurrInstr = BattleScript_MoveEffectStockpileWoreOff; + } + break; + case MOVE_EFFECT_SMACK_DOWN: + if (!IsBattlerGrounded(gBattlerTarget) && IsBattlerAlive(gBattlerTarget)) + { + gStatuses3[gBattlerTarget] |= STATUS3_SMACKED_DOWN; + gStatuses3[gBattlerTarget] &= ~(STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS | STATUS3_ON_AIR); + effect = TRUE; + BattleScriptPush(gBattlescriptCurrInstr); + gBattlescriptCurrInstr = BattleScript_MoveEffectSmackDown; + } + break; + case MOVE_EFFECT_REMOVE_STATUS: // Smelling salts, Wake-Up Slap, Sparkling Aria + if ((gBattleMons[gBattlerTarget].status1 & gMovesInfo[gCurrentMove].argument) && IsBattlerAlive(gBattlerTarget)) + { + gBattleMons[gBattlerTarget].status1 &= ~(gMovesInfo[gCurrentMove].argument); + + gActiveBattler = gBattlerTarget; + BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBattlerTarget].status1); + MarkBattlerForControllerExec(gBattlerTarget); + effect = TRUE; + BattleScriptPush(gBattlescriptCurrInstr); + switch (gMovesInfo[gCurrentMove].argument) + { + case STATUS1_PARALYSIS: + gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal; + break; + case STATUS1_SLEEP: + gBattlescriptCurrInstr = BattleScript_TargetWokeUp; + break; + case STATUS1_BURN: + gBattlescriptCurrInstr = BattleScript_TargetBurnHeal; + break; + } + } + break; // MOVE_EFFECT_REMOVE_STATUS + } + gBattleStruct->moveEffect2 = 0; + gBattleScripting.moveendState++; + break; // MOVEEND_MOVE_EFFECTS2 + } case MOVEEND_ITEM_EFFECTS_ALL: // item effects for all battlers if (ItemBattleEffects(ITEMEFFECT_MOVE_END, 0, FALSE)) effect = TRUE; else gBattleScripting.moveendState++; break; - case MOVEEND_KINGSROCK_SHELLBELL: // king's rock and shell bell - if (ItemBattleEffects(ITEMEFFECT_KINGSROCK_SHELLBELL, 0, FALSE)) + case MOVEEND_KINGSROCK: // King's rock + // These effects will occur at each hit in a multi-strike move + if (ItemBattleEffects(ITEMEFFECT_KINGSROCK, 0, FALSE)) effect = TRUE; gBattleScripting.moveendState++; break; case MOVEEND_ATTACKER_INVISIBLE: // make attacker sprite invisible if (gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE) - && gHitMarker & HITMARKER_NO_ANIMATIONS) + && gHitMarker & (HITMARKER_NO_ANIMATIONS | HITMARKER_DISABLE_ANIMATION)) { gActiveBattler = gBattlerAttacker; BtlController_EmitSpriteInvisibility(BUFFER_A, TRUE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); gBattleScripting.moveendState++; return; } @@ -4266,9 +6009,9 @@ static void Cmd_moveend(void) { gActiveBattler = gBattlerAttacker; BtlController_EmitSpriteInvisibility(BUFFER_A, FALSE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); gStatuses3[gBattlerAttacker] &= ~STATUS3_SEMI_INVULNERABLE; - gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1; + gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = TRUE; gBattleScripting.moveendState++; return; } @@ -4280,13 +6023,23 @@ static void Cmd_moveend(void) { gActiveBattler = gBattlerTarget; BtlController_EmitSpriteInvisibility(BUFFER_A, FALSE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerTarget); gStatuses3[gBattlerTarget] &= ~STATUS3_SEMI_INVULNERABLE; gBattleScripting.moveendState++; return; } gBattleScripting.moveendState++; break; + case MOVEEND_NUM_HITS: + if (gBattlerAttacker != gBattlerTarget + && gMovesInfo[gCurrentMove].category != DAMAGE_CATEGORY_STATUS + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED) + { + gBattleStruct->timesGotHit[GetBattlerSide(gBattlerTarget)][gBattlerPartyIndexes[gBattlerTarget]]++; + } + gBattleScripting.moveendState++; + break; case MOVEEND_SUBSTITUTE: // update substitute for (i = 0; i < gBattlersCount; i++) { @@ -4295,26 +6048,87 @@ static void Cmd_moveend(void) } gBattleScripting.moveendState++; break; + case MOVEEND_SKY_DROP_CONFUSE: // If a Pokemon was released from Sky Drop and was in LOCK_CONFUSE, go to "confused due to fatigue" scripts and clear Sky Drop data. + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleStruct->skyDropTargets[i] == 0xFE) + { + u8 targetId; + // Find the battler id of the Pokemon that was held by Sky Drop + for (targetId = 0; targetId < gBattlersCount; targetId++) + { + if (gBattleStruct->skyDropTargets[targetId] == i) + break; + } + + // Set gBattlerAttacker to the battler id of the target + gBattlerAttacker = targetId; + + // Jump to "confused due to fatigue" script + gBattlescriptCurrInstr = BattleScript_ThrashConfuses; + + // Clear skyDropTargets data + gBattleStruct->skyDropTargets[i] = 0xFF; + gBattleStruct->skyDropTargets[targetId] = 0xFF; + return; + } + } + gBattleScripting.moveendState++; + break; case MOVEEND_UPDATE_LAST_MOVES: + if (gMoveResultFlags & (MOVE_RESULT_FAILED | MOVE_RESULT_DOESNT_AFFECT_FOE)) + gBattleStruct->lastMoveFailed |= gBitTable[gBattlerAttacker]; + else + gBattleStruct->lastMoveFailed &= ~(gBitTable[gBattlerAttacker]); + + // Set ShellTrap to activate after the attacker's turn if target was hit by a physical move. + if (gMovesInfo[gChosenMoveByBattler[gBattlerTarget]].effect == EFFECT_SHELL_TRAP + && gBattlerTarget != gBattlerAttacker + && GetBattlerSide(gBattlerTarget) != GetBattlerSide(gBattlerAttacker) + && gProtectStructs[gBattlerTarget].physicalDmg + && gProtectStructs[gBattlerTarget].physicalBattlerId == gBattlerAttacker + && !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) + { + gProtectStructs[gBattlerTarget].shellTrap = TRUE; + // Change move order in double battles, so the hit mon with shell trap moves immediately after being hit. + if (IsDoubleBattle()) + { + ChangeOrderTargetAfterAttacker(); + } + } + if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET) { - gActiveBattler = gBattlerAttacker; - gBattlerAttacker = gBattlerTarget; - gBattlerTarget = gActiveBattler; + u8 temp; + SWAP(gBattlerAttacker, gBattlerTarget, temp); gHitMarker &= ~HITMARKER_SWAP_ATTACKER_TARGET; } - if (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED) + if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove) { - gLastPrintedMoves[gBattlerAttacker] = gChosenMove; + gDisableStructs[gBattlerAttacker].usedMoves |= gBitTable[gCurrMovePos]; + gBattleStruct->lastMoveTarget[gBattlerAttacker] = gBattlerTarget; + if (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED) + { + gLastPrintedMoves[gBattlerAttacker] = gChosenMove; + gLastUsedMove = gCurrentMove; + // TODO: Dynamax + // if (IsMaxMove(gCurrentMove)) + // gBattleStruct->dynamax.lastUsedBaseMove = gBattleStruct->dynamax.baseMove[gBattlerAttacker]; + } } if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker]) - && gBattleMoves[originallyUsedMove].effect != EFFECT_BATON_PASS) + && gMovesInfo[originallyUsedMove].effect != EFFECT_BATON_PASS + && gMovesInfo[originallyUsedMove].effect != EFFECT_HEALING_WISH) { if (gHitMarker & HITMARKER_OBEYS) { - gLastMoves[gBattlerAttacker] = gChosenMove; - gLastResultingMoves[gBattlerAttacker] = gCurrentMove; + if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove) + { + gLastMoves[gBattlerAttacker] = gChosenMove; + RecordKnownMove(gBattlerAttacker, gChosenMove); + gLastResultingMoves[gBattlerAttacker] = gCurrentMove; + } } else { @@ -4347,48 +6161,464 @@ static void Cmd_moveend(void) case MOVEEND_MIRROR_MOVE: // mirror move if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker]) - && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED + && !gMovesInfo[originallyUsedMove].mirrorMoveBanned && gHitMarker & HITMARKER_OBEYS && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - u8 target, attacker; - - *(gBattleStruct->lastTakenMove + gBattlerTarget * 2 + 0) = gChosenMove; - *(gBattleStruct->lastTakenMove + gBattlerTarget * 2 + 1) = gChosenMove >> 8; - - target = gBattlerTarget; - attacker = gBattlerAttacker; - *(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove; - - target = gBattlerTarget; - attacker = gBattlerAttacker; - *(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8; + gBattleStruct->lastTakenMove[gBattlerTarget] = gChosenMove; + gBattleStruct->lastTakenMoveFrom[gBattlerTarget][gBattlerAttacker] = gChosenMove; } gBattleScripting.moveendState++; break; case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon. - if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH + { + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + // Set a flag if move hits either target (for throat spray that can't check damage) + if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + gProtectStructs[gBattlerAttacker].targetAffected = TRUE; + + gBattleStruct->targetsDone[gBattlerAttacker] |= gBitTable[gBattlerTarget]; + if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && gBattleTypeFlags & BATTLE_TYPE_DOUBLE + && !gProtectStructs[gBattlerAttacker].chargingTurn + && (moveTarget == MOVE_TARGET_BOTH + || moveTarget == MOVE_TARGET_FOES_AND_ALLY) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { - u8 battlerId = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget))); - if (gBattleMons[battlerId].hp != 0) + u32 nextTarget = GetNextTarget(moveTarget, FALSE); + gHitMarker |= HITMARKER_NO_PPDEDUCT; + + if (nextTarget != MAX_BATTLERS_COUNT) { - gBattlerTarget = battlerId; - gHitMarker |= HITMARKER_NO_ATTACKSTRING; + gBattleStruct->moveTarget[gBattlerAttacker] = gBattlerTarget = nextTarget; // Fix for moxie spread moves gBattleScripting.moveendState = 0; MoveValuesCleanUp(); - BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); + gBattleScripting.moveEffect = gBattleScripting.savedMoveEffect; + BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } + // Check if the move used was actually a bounced move. If so, we need to go back to the original attacker and make sure, its move hits all 2 or 3 pokemon. + else if (gProtectStructs[gBattlerAttacker].usesBouncedMove) + { + u8 originalBounceTarget = gBattlerAttacker; + gBattlerAttacker = gBattleStruct->attackerBeforeBounce; + gBattleStruct->targetsDone[gBattlerAttacker] |= gBitTable[originalBounceTarget]; + gBattleStruct->targetsDone[originalBounceTarget] = 0; + + nextTarget = GetNextTarget(moveTarget, FALSE); + if (nextTarget != MAX_BATTLERS_COUNT) + { + // We found another target for the original move user. + gBattleStruct->moveTarget[gBattlerAttacker] = gBattlerTarget = nextTarget; + gBattleScripting.moveendState = 0; + gBattleScripting.animTurn = 0; + gBattleScripting.animTargetsHit = 0; + MoveValuesCleanUp(); + BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + gBattlescriptCurrInstr = BattleScript_FlushMessageBox; + return; + } + } + + gHitMarker |= HITMARKER_NO_ATTACKSTRING; + gHitMarker &= ~HITMARKER_NO_PPDEDUCT; + } + RecordLastUsedMoveBy(gBattlerAttacker, gCurrentMove); + gBattleScripting.moveendState++; + break; + } + case MOVEEND_MULTIHIT_MOVE: + { + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && gMultiHitCounter + && !(gMovesInfo[gCurrentMove].effect == EFFECT_PRESENT && gBattleStruct->presentBasePower == 0)) // Silly edge case + { + gBattleScripting.multihitString[4]++; + if (--gMultiHitCounter == 0) + { + if (gMovesInfo[gCurrentMove].argument == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; + } + + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + effect = TRUE; + } else { - gHitMarker |= HITMARKER_NO_ATTACKSTRING; + if (gCurrentMove == MOVE_DRAGON_DARTS) + { + // TODO + } + + if (gBattleMons[gBattlerAttacker].hp + && gBattleMons[gBattlerTarget].hp + && (gChosenMove == MOVE_SLEEP_TALK || !(gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP)) + && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)) + { + if (gSpecialStatuses[gBattlerAttacker].parentalBondState) + gSpecialStatuses[gBattlerAttacker].parentalBondState--; + + gHitMarker |= (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING); + gBattleScripting.animTargetsHit = 0; + gBattleScripting.moveendState = 0; + gSpecialStatuses[gBattlerTarget].sturdied = 0; + gSpecialStatuses[gBattlerTarget].focusBanded = 0; // Delete this line to make Focus Band last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusSashed = 0; // Delete this line to make Focus Sash last for the duration of the whole move turn. + gSpecialStatuses[gBattlerAttacker].multiHitOn = TRUE; + MoveValuesCleanUp(); + BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + gBattlescriptCurrInstr = BattleScript_FlushMessageBox; + return; + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + effect = TRUE; + } } } + gMultiHitCounter = 0; + gSpecialStatuses[gBattlerAttacker].parentalBondState = PARENTAL_BOND_OFF; + gSpecialStatuses[gBattlerAttacker].multiHitOn = 0; + gBattleScripting.moveendState++; + break; + } + // The order of abilities/items activating after moves hitting multiple targets is + // 1. Magician + // 2. The fastest mon gets switched out using Eject Button / Eject Pack + // 3. White Herb activates + // 4. Red Card activates + // 5. Life Orb / Shell Bell + // 6. Pickpocket + case MOVEEND_MAGICIAN: + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_MAGICIAN + && gCurrentMove != MOVE_FLING && gCurrentMove != MOVE_NATURAL_GIFT + && gBattleMons[gBattlerAttacker].item == ITEM_NONE + && gBattleMons[gBattlerTarget].item != ITEM_NONE + && IsBattlerAlive(gBattlerAttacker) + && TARGET_TURN_DAMAGED + && CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) + && !gSpecialStatuses[gBattlerAttacker].gemBoost // In base game, gems are consumed after magician would activate. + && !(gWishFutureKnock.knockedOffMons[GetBattlerSide(gBattlerTarget)] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]) + && !DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && (GetBattlerAbility(gBattlerTarget) != ABILITY_STICKY_HOLD || !IsBattlerAlive(gBattlerTarget))) + { + StealTargetItem(gBattlerAttacker, gBattlerTarget); + gBattleScripting.battler = gBattlerAbility = gBattlerAttacker; + gEffectBattler = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MagicianActivates; + gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + effect = TRUE; + } + gBattleScripting.moveendState++; + break; + case MOVEEND_EJECT_ITEMS: + { + // Because sorting the battlers by speed takes lots of cycles, it's better to just check if any of the battlers has the Eject items. + u32 ejectPackBattlers = 0, ejectButtonBattlers = 0, i; + for (i = 0; i < gBattlersCount; i++) + { + u32 holdEffect; + if (i == gBattlerAttacker) + continue; + holdEffect = GetBattlerHoldEffect(i, TRUE); + if (holdEffect == HOLD_EFFECT_EJECT_BUTTON) + ejectButtonBattlers |= gBitTable[i]; + else if (holdEffect == HOLD_EFFECT_EJECT_PACK) + ejectPackBattlers |= gBitTable[i]; + } + if (ejectButtonBattlers || ejectPackBattlers) + { + u8 battlers[4] = {0, 1, 2, 3}; + SortBattlersBySpeed(battlers, FALSE); + + for (i = 0; i < gBattlersCount; i++) + { + u32 battler = battlers[i]; + + if (ejectButtonBattlers & gBitTable[battler]) + { + if (TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) // Apparently Sheer Force blocks Eject Button, but not Eject Pack + continue; + // Since we check if battler was damaged, we don't need to check move result. + // In fact, doing so actually prevents multi-target moves from activating eject button properly + if (!BATTLER_TURN_DAMAGED(battler)) + continue; + } + else if (ejectPackBattlers & gBitTable[battler]) + { + if (!gProtectStructs[battler].statFell || gProtectStructs[battler].disableEjectPack) + continue; + } + else + { + continue; + } + + if (IsBattlerAlive(battler) + && CountUsablePartyMons(battler) > 0 // Has mon to switch into + // Does not activate if attacker used Parting Shot and can switch out + && !(gMovesInfo[gCurrentMove].effect == EFFECT_HIT_SWITCH_TARGET && CanBattlerSwitch(gBattlerAttacker)) + ) + { + gBattleScripting.battler = battler; + gLastUsedItem = gBattleMons[battler].item; + if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE) + gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection + effect = TRUE; + BattleScriptPushCursor(); + if (ejectButtonBattlers & gBitTable[battler]) + { + gBattlescriptCurrInstr = BattleScript_EjectButtonActivates; + } + else // Eject Pack + { + gBattlescriptCurrInstr = BattleScript_EjectPackActivates; + // Are these 2 lines below needed? + gProtectStructs[battler].statFell = FALSE; + gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + } + break; // Only the fastest Eject item activates + } + } + } + } + gBattleScripting.moveendState++; + break; + case MOVEEND_WHITE_HERB: + for (i = 0; i < gBattlersCount; i++) + { + if (IsBattlerAlive(i) + && ItemBattleEffects(ITEMEFFECT_STATS_CHANGED, i, FALSE)) + { + effect = TRUE; + break; + } + } + if (!effect) + gBattleScripting.moveendState++; + break; + case MOVEEND_RED_CARD: + { + u32 redCardBattlers = 0, i; + for (i = 0; i < gBattlersCount; i++) + { + if (i == gBattlerAttacker) + continue; + if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_RED_CARD) + redCardBattlers |= gBitTable[i]; + } + if (redCardBattlers + && (gMovesInfo[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET || gBattleStruct->hitSwitchTargetFailed) + && IsBattlerAlive(gBattlerAttacker) + && !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_GUARD_DOG) + { + // Since we check if battler was damaged, we don't need to check move result. + // In fact, doing so actually prevents multi-target moves from activating red card properly + u8 battlers[4] = {0, 1, 2, 3}; + SortBattlersBySpeed(battlers, FALSE); + for (i = 0; i < gBattlersCount; i++) + { + u32 battler = battlers[i]; + // Search for fastest hit pokemon with a red card + // Attacker is the one to be switched out, battler is one with red card + if (redCardBattlers & gBitTable[battler] + && IsBattlerAlive(battler) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && BATTLER_TURN_DAMAGED(battler) + && CanBattlerSwitch(gBattlerAttacker)) + { + gLastUsedItem = gBattleMons[battler].item; + gBattleStruct->savedBattlerTarget = gBattleScripting.battler = battler; // Battler with red card + gEffectBattler = gBattlerAttacker; + if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE) + gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_RedCardActivates; + gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + effect = TRUE; + break; // Only fastest red card activates + } + } + } + } + gBattleScripting.moveendState++; + break; + case MOVEEND_LIFEORB_SHELLBELL: + if (ItemBattleEffects(ITEMEFFECT_LIFEORB_SHELLBELL, 0, FALSE)) + effect = TRUE; + gBattleScripting.moveendState++; + break; + case MOVEEND_PICKPOCKET: + if (IsBattlerAlive(gBattlerAttacker) + && gBattleMons[gBattlerAttacker].item != ITEM_NONE // Attacker must be holding an item + && !(gWishFutureKnock.knockedOffMons[GetBattlerSide(gBattlerAttacker)] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]) // But not knocked off + && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) // Pickpocket doesn't activate for sheer force + && IsMoveMakingContact(gCurrentMove, gBattlerAttacker) // Pickpocket requires contact + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) // Obviously attack needs to have worked + { + u8 battlers[4] = {0, 1, 2, 3}; + SortBattlersBySpeed(battlers, FALSE); // Pickpocket activates for fastest mon without item + for (i = 0; i < gBattlersCount; i++) + { + u8 battler = battlers[i]; + // Attacker is mon who made contact, battler is mon with pickpocket + if (battler != gBattlerAttacker // Cannot pickpocket yourself + && GetBattlerAbility(battler) == ABILITY_PICKPOCKET // Target must have pickpocket ability + && BATTLER_TURN_DAMAGED(battler) // Target needs to have been damaged + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) // Subsitute unaffected + && IsBattlerAlive(battler) // Battler must be alive to pickpocket + && gBattleMons[battler].item == ITEM_NONE // Pickpocketer can't have an item already + && CanStealItem(battler, gBattlerAttacker, gBattleMons[gBattlerAttacker].item)) // Cannot steal plates, mega stones, etc + { + gBattlerTarget = gBattlerAbility = battler; + // Battle scripting is super brittle so we shall do the item exchange now (if possible) + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_STICKY_HOLD) + StealTargetItem(gBattlerTarget, gBattlerAttacker); // Target takes attacker's item + + gEffectBattler = gBattlerAttacker; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_Pickpocket; // Includes sticky hold check to print separate string + effect = TRUE; + break; // Pickpocket activates on fastest mon, so exit loop. + } + } + } + gBattleScripting.moveendState++; + break; + case MOVEEND_DANCER: // Special case because it's so annoying + if (gMovesInfo[gCurrentMove].danceMove) + { + u8 battler, nextDancer = 0; + + if (!(gBattleStruct->lastMoveFailed & gBitTable[gBattlerAttacker] + || (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove + && gProtectStructs[gBattlerAttacker].usesBouncedMove))) + { // Dance move succeeds + // Set target for other Dancer mons; set bit so that mon cannot activate Dancer off of its own move + if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove) + { + gBattleScripting.savedBattler = gBattlerTarget | 0x4; + gBattleScripting.savedBattler |= (gBattlerAttacker << 4); + gSpecialStatuses[gBattlerAttacker].dancerUsedMove = TRUE; + } + for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) + { + if (GetBattlerAbility(battler) == ABILITY_DANCER && !gSpecialStatuses[battler].dancerUsedMove) + { + if (!nextDancer || (gBattleMons[battler].speed < gBattleMons[nextDancer & 0x3].speed)) + nextDancer = battler | 0x4; + } + } + if (nextDancer && AbilityBattleEffects(ABILITYEFFECT_MOVE_END_OTHER, nextDancer & 0x3, 0, 0, 0)) + effect = TRUE; + } + } + gBattleScripting.moveendState++; + break; + case MOVEEND_EMERGENCY_EXIT: // Special case, because moves hitting multiple opponents stop after switching out + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleResources->flags->flags[i] & RESOURCE_FLAG_EMERGENCY_EXIT) + { + gBattleResources->flags->flags[i] &= ~RESOURCE_FLAG_EMERGENCY_EXIT; + gSpecialStatuses[i].emergencyExited = TRUE; + gBattlerTarget = gBattlerAbility = i; + BattleScriptPushCursor(); + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || GetBattlerSide(i) == B_SIDE_PLAYER) + { + if (B_ABILITY_POP_UP == TRUE) + gBattlescriptCurrInstr = BattleScript_EmergencyExit; + else + gBattlescriptCurrInstr = BattleScript_EmergencyExitNoPopUp; + } + else + { + if (B_ABILITY_POP_UP == TRUE) + gBattlescriptCurrInstr = BattleScript_EmergencyExitWild; + else + gBattlescriptCurrInstr = BattleScript_EmergencyExitWildNoPopUp; + } + return; + } + } + gBattleScripting.moveendState++; + break; + case MOVEEND_SYMBIOSIS: + for (i = 0; i < gBattlersCount; i++) + { + if ((gSpecialStatuses[i].berryReduced + || (B_SYMBIOSIS_GEMS >= GEN_7 && gSpecialStatuses[i].gemBoost)) + && SYMBIOSIS_CHECK(i, BATTLE_PARTNER(i))) + { + BestowItem(BATTLE_PARTNER(i), i); + gLastUsedAbility = gBattleMons[BATTLE_PARTNER(i)].ability; + gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(i); + gBattlerAttacker = i; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; + effect = TRUE; + } + } + gBattleScripting.moveendState++; + break; + case MOVEEND_SAME_MOVE_TURNS: + if (gCurrentMove != gLastResultingMoves[gBattlerAttacker] || gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + gBattleStruct->sameMoveTurns[gBattlerAttacker] = 0; + else if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] && gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_1ST_HIT) + gBattleStruct->sameMoveTurns[gBattlerAttacker]++; + gBattleScripting.moveendState++; + break; + case MOVEEND_SET_EVOLUTION_TRACKER: + // If the Pokémon needs to keep track of move usage for its evolutions, do it + if (originallyUsedMove != MOVE_NONE) + TryUpdateEvolutionTracker(EVO_LEVEL_MOVE_TWENTY_TIMES, 1); + gBattleScripting.moveendState++; + break; + case MOVEEND_CLEAR_BITS: // Clear/Set bits for things like using a move for all targets and all hits. + if (gSpecialStatuses[gBattlerAttacker].instructedChosenTarget) + *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3; + if (gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget) + *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget & 0x3; + + if (B_RAMPAGE_CANCELLING >= GEN_5 + && MoveHasAdditionalEffectSelf(gCurrentMove, MOVE_EFFECT_THRASH) // If we're rampaging + && (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) // And it is unusable + && (gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE) != STATUS2_LOCK_CONFUSE_TURN(1)) // And won't end this turn + CancelMultiTurnMoves(gBattlerAttacker); // Cancel it + + gBattleStruct->targetsDone[gBattlerAttacker] = 0; + gProtectStructs[gBattlerAttacker].usesBouncedMove = FALSE; + gProtectStructs[gBattlerAttacker].targetAffected = FALSE; + gProtectStructs[gBattlerAttacker].shellTrap = FALSE; + gBattleStruct->ateBoost[gBattlerAttacker] = 0; + gStatuses3[gBattlerAttacker] &= ~STATUS3_ME_FIRST; + gSpecialStatuses[gBattlerAttacker].gemBoost = FALSE; + gSpecialStatuses[gBattlerAttacker].damagedMons = 0; + gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; + gBattleScripting.moveEffect = 0; + // clear attacker z move data + gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.toBeUsed[gBattlerAttacker] = MOVE_NONE; + gBattleStruct->zmove.effect = EFFECT_HIT; + gBattleStruct->hitSwitchTargetFailed = FALSE; + gBattleStruct->isAtkCancelerForCalledMove = FALSE; + gBattleStruct->swapDamageCategory = FALSE; + gBattleStruct->enduredDamage = 0; + gBattleStruct->additionalEffectsCounter = 0; gBattleScripting.moveendState++; break; case MOVEEND_COUNT: @@ -4403,241 +6633,258 @@ static void Cmd_moveend(void) } while (gBattleScripting.moveendState != MOVEEND_COUNT && effect == FALSE); if (gBattleScripting.moveendState == MOVEEND_COUNT && effect == FALSE) - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_typecalc2(void) +static void Cmd_sethealblock(void) { - u8 flags = 0; - s32 i = 0; - u8 moveType = gBattleMoves[gCurrentMove].type; + CMD_ARGS(const u8 *failInstr); - if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND) + if (gStatuses3[gBattlerTarget] & STATUS3_HEAL_BLOCK) { - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); - gLastLandedMoves[gBattlerTarget] = 0; - gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); + gBattlescriptCurrInstr = cmd->failInstr; } else { - while (TYPE_EFFECT_ATK_TYPE(i) != TYPE_ENDTABLE) - { - if (TYPE_EFFECT_ATK_TYPE(i) == TYPE_FORESIGHT) - { - if (gBattleMons[gBattlerTarget].status2 & STATUS2_FORESIGHT) - { - break; - } - else - { - i += 3; - continue; - } - } - - if (TYPE_EFFECT_ATK_TYPE(i) == moveType) - { - // check type1 - if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1) - { - if (TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT) - { - gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; - break; - } - if (TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE) - { - flags |= MOVE_RESULT_NOT_VERY_EFFECTIVE; - } - if (TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) - { - flags |= MOVE_RESULT_SUPER_EFFECTIVE; - } - } - // check type2 - if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2) - { - if (gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 - && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT) - { - gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; - break; - } - if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 - && gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 - && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE) - { - flags |= MOVE_RESULT_NOT_VERY_EFFECTIVE; - } - if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 - && gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 - && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) - { - flags |= MOVE_RESULT_SUPER_EFFECTIVE; - } - } - } - i += 3; - } + gStatuses3[gBattlerTarget] |= STATUS3_HEAL_BLOCK; + gDisableStructs[gBattlerTarget].healBlockTimer = 5; + gBattlescriptCurrInstr = cmd->nextInstr; } - - if (gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD - && !(flags & MOVE_RESULT_NO_EFFECT) - && AttacksThisTurn(gBattlerAttacker, gCurrentMove) == 2 - && (!(flags & MOVE_RESULT_SUPER_EFFECTIVE) || ((flags & (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE)) == (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE))) - && gBattleMoves[gCurrentMove].power) - { - gLastUsedAbility = ABILITY_WONDER_GUARD; - gMoveResultFlags |= MOVE_RESULT_MISSED; - gLastLandedMoves[gBattlerTarget] = 0; - gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } - if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) - gProtectStructs[gBattlerAttacker].targetNotAffected = 1; - - gBattlescriptCurrInstr++; } static void Cmd_returnatktoball(void) { + CMD_ARGS(); + gActiveBattler = gBattlerAttacker; - if (!(gHitMarker & HITMARKER_FAINTED(gActiveBattler))) + if (!(gHitMarker & HITMARKER_FAINTED(gBattlerAttacker))) { BtlController_EmitReturnMonToBall(BUFFER_A, FALSE); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_getswitchedmondata(void) { + CMD_ARGS(u8 battler); + + u32 battler = GetBattlerForBattleScript(cmd->battler); if (gBattleControllerExecFlags) return; + + gActiveBattler = battler; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gBattlerPartyIndexes[battler] = gBattleStruct->monToSwitchIntoId[battler]; - gBattlerPartyIndexes[gActiveBattler] = *(gBattleStruct->monToSwitchIntoId + gActiveBattler); + BtlController_EmitGetMonData(BUFFER_A, REQUEST_ALL_BATTLE, gBitTable[gBattlerPartyIndexes[battler]]); + MarkBattlerForControllerExec(battler); - BtlController_EmitGetMonData(BUFFER_A, REQUEST_ALL_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]]); - MarkBattlerForControllerExec(gActiveBattler); - - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_switchindataupdate(void) { + CMD_ARGS(u8 battler); + struct BattlePokemon oldData; - s32 i; + u32 battler, i; u8 *monData; if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - oldData = gBattleMons[gActiveBattler]; - monData = (u8 *)(&gBattleMons[gActiveBattler]); + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + oldData = gBattleMons[battler]; + monData = (u8 *)(&gBattleMons[battler]); for (i = 0; i < sizeof(struct BattlePokemon); i++) - monData[i] = gBattleBufferB[gActiveBattler][4 + i]; + monData[i] = gBattleBufferB[battler][4 + i]; - gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0]; - gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1]; - gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum); - - // check knocked off item - i = GetBattlerSide(gActiveBattler); - if (gWishFutureKnock.knockedOffMons[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]]) + // Edge case: the sent out pokemon has 0 HP. This should never happen. + if (gBattleMons[battler].hp == 0) { - gBattleMons[gActiveBattler].item = ITEM_NONE; + struct Pokemon *party = GetBattlerParty(battler); + // Find the first possible replacement for the not valid pokemon. + for (i = 0; i < PARTY_SIZE; i++) + { + if (IsValidForBattle(&party[i])) + break; + } + // There is valid replacement. + if (i != PARTY_SIZE) + { + gBattlerPartyIndexes[battler] = gBattleStruct->monToSwitchIntoId[battler] = i; + BtlController_EmitGetMonData(BUFFER_A, REQUEST_ALL_BATTLE, gBitTable[gBattlerPartyIndexes[battler]]); + MarkBattlerForControllerExec(battler); + return; + } } - if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) + gBattleMons[battler].type1 = gSpeciesInfo[gBattleMons[battler].species].types[0]; + gBattleMons[battler].type2 = gSpeciesInfo[gBattleMons[battler].species].types[1]; + gBattleMons[battler].type3 = TYPE_MYSTERY; + gBattleMons[battler].ability = GetAbilityBySpecies(gBattleMons[battler].species, gBattleMons[battler].abilityNum); + + // check knocked off item + i = GetBattlerSide(battler); + if (gWishFutureKnock.knockedOffMons[i] & gBitTable[gBattlerPartyIndexes[battler]]) + { + gBattleMons[battler].item = ITEM_NONE; + } + + if (gMovesInfo[gCurrentMove].effect == EFFECT_BATON_PASS) { for (i = 0; i < NUM_BATTLE_STATS; i++) { - gBattleMons[gActiveBattler].statStages[i] = oldData.statStages[i]; + gBattleMons[battler].statStages[i] = oldData.statStages[i]; } - gBattleMons[gActiveBattler].status2 = oldData.status2; + gBattleMons[battler].status2 = oldData.status2; } - SwitchInClearSetData(); + SwitchInClearSetData(battler); - gBattleScripting.battler = gActiveBattler; + gBattleScripting.battler = battler; - PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gActiveBattler, gBattlerPartyIndexes[gActiveBattler]); + PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, battler, gBattlerPartyIndexes[battler]); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_switchinanim(void) { + u32 battler; + + CMD_ARGS(u8 battler, bool8 dontClearSubstitute); + if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); - if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT + if (GetBattlerSide(battler) == B_SIDE_OPPONENT && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_OLD_MAN_TUTORIAL | BATTLE_TYPE_POKEDUDE | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_GHOST))) - HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); + HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[battler].species), FLAG_SET_SEEN, gBattleMons[battler].personality); - gAbsentBattlerFlags &= ~(gBitTable[gActiveBattler]); + gAbsentBattlerFlags &= ~(gBitTable[battler]); - BtlController_EmitSwitchInAnim(BUFFER_A, gBattlerPartyIndexes[gActiveBattler], gBattlescriptCurrInstr[2]); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitSwitchInAnim(BUFFER_A, gBattlerPartyIndexes[battler], cmd->dontClearSubstitute); + MarkBattlerForControllerExec(battler); - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_jumpifcantswitch(void) +bool32 CanBattlerSwitch(u32 battler) { - s32 i; - s32 lastMonId; + s32 i, lastMonId, battlerIn1, battlerIn2; + bool32 ret = FALSE; struct Pokemon *party; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~SWITCH_IGNORE_ESCAPE_PREVENTION); - if (!(gBattlescriptCurrInstr[1] & SWITCH_IGNORE_ESCAPE_PREVENTION) - && ((gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) - || (gStatuses3[gActiveBattler] & STATUS3_ROOTED))) + if (BATTLE_TWO_VS_ONE_OPPONENT && GetBattlerSide(battler) == B_SIDE_OPPONENT) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); - } - else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) - { - if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) - party = gEnemyParty; - else - party = gPlayerParty; + battlerIn1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + battlerIn2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + party = gEnemyParty; - i = 0; - if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gActiveBattler)) == TRUE) - i = 3; - for (lastMonId = i + 3; i < lastMonId; i++) + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && i != gBattlerPartyIndexes[battlerIn1] && i != gBattlerPartyIndexes[battlerIn2]) + break; + } + + ret = (i != PARTY_SIZE); + } + else if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + { + party = GetBattlerParty(battler); + + lastMonId = 0; + if (battler & 2) + lastMonId = MULTI_PARTY_SIZE; + + for (i = lastMonId; i < lastMonId + MULTI_PARTY_SIZE; i++) { if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetMonData(&party[i], MON_DATA_IS_EGG) && GetMonData(&party[i], MON_DATA_HP) != 0 - && gBattlerPartyIndexes[gActiveBattler] != i) + && gBattlerPartyIndexes[battler] != i) break; } - if (i == lastMonId) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + ret = (i != lastMonId + MULTI_PARTY_SIZE); + } + else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI) + { + if (GetBattlerSide(battler) == B_SIDE_PLAYER) + { + party = gPlayerParty; + + lastMonId = 0; + if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(battler)) == TRUE) + lastMonId = MULTI_PARTY_SIZE; + } + else + { + party = gEnemyParty; + + if (battler == 1) + lastMonId = 0; + else + lastMonId = MULTI_PARTY_SIZE; + } + } else - gBattlescriptCurrInstr += 6; + { + party = GetBattlerParty(battler); + + lastMonId = 0; + if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(battler)) == TRUE) + lastMonId = MULTI_PARTY_SIZE; + } + + for (i = lastMonId; i < lastMonId + MULTI_PARTY_SIZE; i++) + { + if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && GetMonData(&party[i], MON_DATA_HP) != 0 + && gBattlerPartyIndexes[battler] != i) + break; + } + + ret = (i != lastMonId + MULTI_PARTY_SIZE); + } + else if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetBattlerSide(battler) == B_SIDE_OPPONENT) + { + party = gEnemyParty; + + lastMonId = 0; + if (battler == B_POSITION_OPPONENT_RIGHT) + lastMonId = PARTY_SIZE / 2; + + for (i = lastMonId; i < lastMonId + (PARTY_SIZE / 2); i++) + { + if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && GetMonData(&party[i], MON_DATA_HP) != 0 + && gBattlerPartyIndexes[battler] != i) + break; + } + + ret = (i != lastMonId + (PARTY_SIZE / 2)); } else { - u8 battlerIn1, battlerIn2; - - if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) + if (GetBattlerSide(battler) == B_SIDE_OPPONENT) { battlerIn1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); @@ -4650,6 +6897,7 @@ static void Cmd_jumpifcantswitch(void) } else { + // Check if attacker side has mon to switch into battlerIn1 = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) @@ -4669,59 +6917,78 @@ static void Cmd_jumpifcantswitch(void) break; } - if (i == PARTY_SIZE) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + ret = (i != PARTY_SIZE); + } + return ret; +} + +static void Cmd_jumpifcantswitch(void) +{ + CMD_ARGS(u8 battler:7, u8 ignoreEscapePrevention:1, const u8 *jumpInstr); + + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + if (!cmd->ignoreEscapePrevention && !CanBattlerEscape(battler)) + { + gBattlescriptCurrInstr = cmd->jumpInstr; + } + else + { + if (CanBattlerSwitch(battler)) + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->jumpInstr; } } // Opens the party screen to choose a new Pokémon to send out. // slotId is the Pokémon to replace. // Note that this is not used by the Switch action, only replacing fainted Pokémon or Baton Pass -static void ChooseMonToSendOut(u8 slotId) +static void ChooseMonToSendOut(u32 battler, u8 slotId) { - *(gBattleStruct->battlerPartyIndexes + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler]; - BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_SEND_OUT, slotId, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); - MarkBattlerForControllerExec(gActiveBattler); + gBattleStruct->battlerPartyIndexes[battler] = gBattlerPartyIndexes[battler]; + gBattleStruct->monToSwitchIntoId[battler] = PARTY_SIZE; + gBattleStruct->field_93 &= ~(gBitTable[battler]); + + gActiveBattler = battler; + BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_SEND_OUT, slotId, ABILITY_NONE, gBattleStruct->battlerPartyOrders[battler]); + MarkBattlerForControllerExec(battler); } static void Cmd_openpartyscreen(void) { - u32 flags; - u8 hitmarkerFaintBits; - u8 battlerId; - const u8 *jumpPtr; + CMD_ARGS(u8 battler:7, u8 partyScreenOptional:1, const u8 *failInstr); - battlerId = 0; - flags = 0; - jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + u32 flags = 0; + u8 hitmarkerFaintBits = 0; + u32 i, battler = 0; + const u8 *failInstr = cmd->failInstr; - if (gBattlescriptCurrInstr[1] == BS_FAINTED_LINK_MULTIPLE_1) + if (cmd->battler == BS_FAINTED_LINK_MULTIPLE_1) { - if ((gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI)) != BATTLE_TYPE_DOUBLE) + if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) || !(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) + for (battler = 0; battler < gBattlersCount; battler++) { - if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) + gActiveBattler = battler; + if (gHitMarker & HITMARKER_FAINTED(battler)) { - if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE)) + if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(PARTY_SIZE); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, PARTY_SIZE); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } } else { BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } } } @@ -4733,88 +7000,88 @@ static void Cmd_openpartyscreen(void) if (gBitTable[0] & hitmarkerFaintBits) { - gActiveBattler = 0; - if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE)) + battler = gActiveBattler = 0; + if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitCantSwitch(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[2]); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, gBattleStruct->monToSwitchIntoId[2]); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } else { BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); flags |= 1; } } if (gBitTable[2] & hitmarkerFaintBits && !(gBitTable[0] & hitmarkerFaintBits)) { - gActiveBattler = 2; - if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE)) + battler = gActiveBattler = 2; + if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitCantSwitch(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, gBattleStruct->monToSwitchIntoId[0]); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } else if (!(flags & 1)) { BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } } if (gBitTable[1] & hitmarkerFaintBits) { - gActiveBattler = 1; - if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE)) + battler = gActiveBattler = 1; + if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitCantSwitch(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[3]); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, gBattleStruct->monToSwitchIntoId[3]); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } else { BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); flags |= 2; } } if (gBitTable[3] & hitmarkerFaintBits && !(gBitTable[1] & hitmarkerFaintBits)) { - gActiveBattler = 3; - if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE)) + battler = gActiveBattler = 3; + if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitCantSwitch(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, gBattleStruct->monToSwitchIntoId[1]); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } else if (!(flags & 2)) { BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } } @@ -4825,12 +7092,12 @@ static void Cmd_openpartyscreen(void) if (!hasReplacement_2 && hitmarkerFaintBits != 0) { if (gAbsentBattlerFlags & gBitTable[0]) - gActiveBattler = 2; + battler = gActiveBattler = 2; else - gActiveBattler = 0; + battler = gActiveBattler = 0; BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } } @@ -4841,18 +7108,18 @@ static void Cmd_openpartyscreen(void) if (!hasReplacement_3 && hitmarkerFaintBits != 0) { if (gAbsentBattlerFlags & gBitTable[1]) - gActiveBattler = 3; + battler = gActiveBattler = 3; else - gActiveBattler = 1; + battler = gActiveBattler = 1; BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } } } - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } - else if (gBattlescriptCurrInstr[1] == BS_FAINTED_LINK_MULTIPLE_2) + else if (cmd->battler == BS_FAINTED_LINK_MULTIPLE_2) { if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { @@ -4861,48 +7128,48 @@ static void Cmd_openpartyscreen(void) hitmarkerFaintBits = gHitMarker >> 28; if (gBitTable[2] & hitmarkerFaintBits && gBitTable[0] & hitmarkerFaintBits) { - gActiveBattler = 2; - if (HasNoMonsToSwitch(gActiveBattler, gBattleBufferB[0][1], PARTY_SIZE)) + battler = gActiveBattler = 2; + if (HasNoMonsToSwitch(battler, gBattleBufferB[0][1], PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitCantSwitch(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, gBattleStruct->monToSwitchIntoId[0]); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } } if (gBitTable[3] & hitmarkerFaintBits && hitmarkerFaintBits & gBitTable[1]) { - gActiveBattler = 3; - if (HasNoMonsToSwitch(gActiveBattler, gBattleBufferB[1][1], PARTY_SIZE)) + battler = gActiveBattler = 3; + if (HasNoMonsToSwitch(battler, gBattleBufferB[1][1], PARTY_SIZE)) { - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); BtlController_EmitCantSwitch(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); } - else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) + else if (!gSpecialStatuses[battler].faintedHasReplacement) { - ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; + ChooseMonToSendOut(battler, gBattleStruct->monToSwitchIntoId[1]); + gSpecialStatuses[battler].faintedHasReplacement = TRUE; } } - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } else { // Not multi or double battle - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { // Multi battle - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } hitmarkerFaintBits = gHitMarker >> 28; @@ -4913,59 +7180,62 @@ static void Cmd_openpartyscreen(void) gBattlerFainted++; if (gBattlerFainted == gBattlersCount) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; } else { - if (gBattlescriptCurrInstr[1] & PARTY_SCREEN_OPTIONAL) + if (cmd->partyScreenOptional) hitmarkerFaintBits = PARTY_ACTION_CHOOSE_MON; // Used here as the caseId for the EmitChoose function. else hitmarkerFaintBits = PARTY_ACTION_SEND_OUT; - battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~PARTY_SCREEN_OPTIONAL); - if (gSpecialStatuses[battlerId].faintedHasReplacement) + battler = GetBattlerForBattleScript(cmd->battler); + if (gSpecialStatuses[battler].faintedHasReplacement) { - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } - else if (HasNoMonsToSwitch(battlerId, PARTY_SIZE, PARTY_SIZE)) + else if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE)) { - gActiveBattler = battlerId; - gAbsentBattlerFlags |= gBitTable[gActiveBattler]; - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); - gBattlescriptCurrInstr = jumpPtr; + gActiveBattler = battler; + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker &= ~HITMARKER_FAINTED(battler); + gBattlescriptCurrInstr = failInstr; } else { - gActiveBattler = battlerId; - *(gBattleStruct->battlerPartyIndexes + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler]; + gActiveBattler = battler; + *(gBattleStruct->battlerPartyIndexes + battler) = gBattlerPartyIndexes[battler]; + *(gBattleStruct->monToSwitchIntoId + battler) = PARTY_SIZE; + gBattleStruct->field_93 &= ~(gBitTable[battler]); - BtlController_EmitChoosePokemon(BUFFER_A, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + (gActiveBattler ^ 2)), 0, gBattleStruct->battlerPartyOrders[gActiveBattler]); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitChoosePokemon(BUFFER_A, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(battler)), ABILITY_NONE, gBattleStruct->battlerPartyOrders[battler]); + MarkBattlerForControllerExec(battler); - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; - if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT && gBattleResults.playerSwitchesCounter < 255) + if (GetBattlerPosition(battler) == B_POSITION_PLAYER_LEFT && gBattleResults.playerSwitchesCounter < 255) gBattleResults.playerSwitchesCounter++; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) + for (i = 0; i < gBattlersCount; i++) { - if (gActiveBattler != battlerId) + gActiveBattler = i; + if (i != battler) { BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(i); } } } else { - gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(battlerId) ^ BIT_SIDE); - if (gAbsentBattlerFlags & gBitTable[gActiveBattler]) - gActiveBattler ^= BIT_FLANK; + u32 battlerOpposite = gActiveBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(battler))); + if (gAbsentBattlerFlags & gBitTable[battlerOpposite]) + battlerOpposite = gActiveBattler ^= BIT_FLANK; BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_ONLY); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battlerOpposite); } } } @@ -4973,13 +7243,15 @@ static void Cmd_openpartyscreen(void) static void Cmd_switchhandleorder(void) { - s32 i; + CMD_ARGS(u8 battler, u8 state); + + u32 battler, i; if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); - switch (gBattlescriptCurrInstr[2]) + switch (cmd->state) { case 0: for (i = 0; i < gBattlersCount; i++) @@ -4987,229 +7259,395 @@ static void Cmd_switchhandleorder(void) if (gBattleBufferB[i][0] == CONTROLLER_CHOSENMONRETURNVALUE) { *(gBattleStruct->monToSwitchIntoId + i) = gBattleBufferB[i][1]; + if (!(gBattleStruct->field_93 & gBitTable[i])) + { + gBattleStruct->field_93 |= gBitTable[i]; + } } } break; case 1: if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) - UpdatePartyOwnerOnSwitch_NonMulti(gActiveBattler); + SwitchPartyOrder(battler); break; case 2: - gBattleCommunication[0] = gBattleBufferB[gActiveBattler][1]; - *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = gBattleBufferB[gActiveBattler][1]; - - if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + if (!(gBattleStruct->field_93 & gBitTable[battler])) { - *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF; - *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0); - *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3]; + gBattleStruct->field_93 |= gBitTable[battler]; + } + // fall through + case 3: + gBattleCommunication[0] = gBattleBufferB[battler][1]; + *(gBattleStruct->monToSwitchIntoId + battler) = gBattleBufferB[battler][1]; - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0); - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4; - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3]; + if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + *(battler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF; + *(battler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[battler][2] & 0xF0); + *(battler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[battler][3]; + + *((BATTLE_PARTNER(battler)) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0); + *((BATTLE_PARTNER(battler)) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[battler][2] & 0xF0) >> 4; + *((BATTLE_PARTNER(battler)) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[battler][3]; + } + else if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + { + SwitchPartyOrderInGameMulti(battler, *(gBattleStruct->monToSwitchIntoId + battler)); } else { - UpdatePartyOwnerOnSwitch_NonMulti(gActiveBattler); + SwitchPartyOrder(battler); } - PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species) - PREPARE_MON_NICK_BUFFER(gBattleTextBuff2, gActiveBattler, gBattleBufferB[gActiveBattler][1]) + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species) + PREPARE_MON_NICK_BUFFER(gBattleTextBuff2, battler, gBattleBufferB[battler][1]) break; } - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void SetDmgHazardsBattlescript(u8 battler, u8 multistringId) +{ + gBattleMons[battler].status2 &= ~STATUS2_DESTINY_BOND; + gHitMarker &= ~HITMARKER_DESTINYBOND; + gBattleScripting.battler = battler; + gBattleCommunication[MULTISTRING_CHOOSER] = multistringId; + + BattleScriptPushCursor(); + if (gBattlescriptCurrInstr[1] == BS_TARGET) + gBattlescriptCurrInstr = BattleScript_DmgHazardsOnTarget; + else if (gBattlescriptCurrInstr[1] == BS_ATTACKER) + gBattlescriptCurrInstr = BattleScript_DmgHazardsOnAttacker; + else + gBattlescriptCurrInstr = BattleScript_DmgHazardsOnFaintedBattler; +} + +bool32 DoSwitchInAbilities(u32 battler) +{ + return (TryPrimalReversion(battler) + || AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, battler, 0, 0, 0) + || (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT && AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, battler, 0, 0, 0)) + || (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY && AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, battler, 0, 0, 0)) + || AbilityBattleEffects(ABILITYEFFECT_TRACE2, 0, 0, 0, 0)); } static void Cmd_switchineffects(void) { + CMD_ARGS(u8 battler); + s32 i; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - UpdateSentPokesToOpponentValue(gActiveBattler); + UpdateSentPokesToOpponentValue(battler); // TODO: compare with pokeemerald - gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); - gSpecialStatuses[gActiveBattler].faintedHasReplacement = FALSE; + gHitMarker &= ~HITMARKER_FAINTED(battler); + gSpecialStatuses[battler].faintedHasReplacement = FALSE; - if (!(gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES_DAMAGED) - && (gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES) - && !IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_FLYING) - && gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE) + if (!BattlerHasAi(battler)) + gBattleStruct->appearedInBattle |= gBitTable[gBattlerPartyIndexes[battler]]; + + // Neutralizing Gas announces itself before hazards + if (gBattleMons[battler].ability == ABILITY_NEUTRALIZING_GAS && gSpecialStatuses[battler].announceNeutralizingGas == 0) { - u8 spikesDmg; - - gSideStatuses[GetBattlerSide(gActiveBattler)] |= SIDE_STATUS_SPIKES_DAMAGED; - - // Present in pokeemerald but not here - // gBattleMons[gActiveBattler].status2 &= ~STATUS2_DESTINY_BOND; - // gHitMarker &= ~HITMARKER_DESTINYBOND; - - spikesDmg = (5 - gSideTimers[GetBattlerSide(gActiveBattler)].spikesAmount) * 2; - gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (spikesDmg); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_NEUTRALIZING_GAS; + gSpecialStatuses[battler].announceNeutralizingGas = TRUE; + gBattlerAbility = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SwitchInAbilityMsgRet; + } + // Healing Wish activates before hazards. + // Starting from Gen8 - it heals only pokemon which can be healed. In gens 5,6,7 the effect activates anyways. + else if (((gBattleStruct->storedHealingWish & gBitTable[battler]) || (gBattleStruct->storedLunarDance & gBitTable[battler])) + && (gBattleMons[battler].hp != gBattleMons[battler].maxHP || gBattleMons[battler].status1 != 0 || B_HEALING_WISH_SWITCH < GEN_8)) + { + if (gBattleStruct->storedHealingWish & gBitTable[battler]) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_HealingWishActivates; + gBattleStruct->storedHealingWish &= ~(gBitTable[battler]); + } + else // Lunar Dance + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_LunarDanceActivates; + gBattleStruct->storedLunarDance &= ~(gBitTable[battler]); + } + } + else if (!(gDisableStructs[battler].spikesDone) + && (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SPIKES) + && GetBattlerAbility(battler) != ABILITY_MAGIC_GUARD + && IsBattlerAffectedByHazards(battler, FALSE) + && IsBattlerGrounded(battler)) + { + u8 spikesDmg = (5 - gSideTimers[GetBattlerSide(battler)].spikesAmount) * 2; + gBattleMoveDamage = gBattleMons[battler].maxHP / (spikesDmg); if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattleScripting.battler = gActiveBattler; - BattleScriptPushCursor(); + gDisableStructs[battler].spikesDone = TRUE; + SetDmgHazardsBattlescript(battler, B_MSG_PKMNHURTBYSPIKES); + } + else if (!(gDisableStructs[battler].stealthRockDone) + && (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_STEALTH_ROCK) + && IsBattlerAffectedByHazards(battler, FALSE) + && GetBattlerAbility(battler) != ABILITY_MAGIC_GUARD) + { + gDisableStructs[battler].stealthRockDone = TRUE; + gBattleMoveDamage = GetStealthHazardDamage(gMovesInfo[MOVE_STEALTH_ROCK].type, battler); - if (gBattlescriptCurrInstr[1] == BS_TARGET) - gBattlescriptCurrInstr = BattleScript_SpikesOnTarget; - else if (gBattlescriptCurrInstr[1] == BS_ATTACKER) - gBattlescriptCurrInstr = BattleScript_SpikesOnAttacker; - else - gBattlescriptCurrInstr = BattleScript_SpikesOnFaintedBattler; + if (gBattleMoveDamage != 0) + SetDmgHazardsBattlescript(battler, B_MSG_STEALTHROCKDMG); + } + else if (!(gDisableStructs[battler].toxicSpikesDone) + && (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_TOXIC_SPIKES) + && IsBattlerGrounded(battler)) + { + gDisableStructs[battler].toxicSpikesDone = TRUE; + if (IS_BATTLER_OF_TYPE(battler, TYPE_POISON)) // Absorb the toxic spikes. + { + gSideStatuses[GetBattlerSide(battler)] &= ~SIDE_STATUS_TOXIC_SPIKES; + gSideTimers[GetBattlerSide(battler)].toxicSpikesAmount = 0; + gBattleScripting.battler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ToxicSpikesAbsorbed; + } + else if (IsBattlerAffectedByHazards(battler, TRUE)) + { + if (!(gBattleMons[battler].status1 & STATUS1_ANY) + && !IS_BATTLER_OF_TYPE(battler, TYPE_STEEL) + && GetBattlerAbility(battler) != ABILITY_IMMUNITY + && !IsAbilityOnSide(battler, ABILITY_PASTEL_VEIL) + && !(gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD) + && !(gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + { + if (gSideTimers[GetBattlerSide(battler)].toxicSpikesAmount >= 2) + gBattleMons[battler].status1 |= STATUS1_TOXIC_POISON; + else + gBattleMons[battler].status1 |= STATUS1_POISON; + + gActiveBattler = battler; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + gBattleScripting.battler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ToxicSpikesPoisoned; + } + } + } + else if (!(gDisableStructs[battler].stickyWebDone) + && (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_STICKY_WEB) + && IsBattlerAffectedByHazards(battler, FALSE) + && IsBattlerGrounded(battler)) + { + gDisableStructs[battler].stickyWebDone = TRUE; + gBattleScripting.battler = battler; + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StickyWebOnSwitchIn; + } + else if (!(gDisableStructs[battler].steelSurgeDone) + && (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_STEELSURGE) + && IsBattlerAffectedByHazards(battler, FALSE) + && GetBattlerAbility(battler) != ABILITY_MAGIC_GUARD) + { + gDisableStructs[battler].steelSurgeDone = TRUE; + gBattleMoveDamage = GetStealthHazardDamage(gMovesInfo[MOVE_G_MAX_STEELSURGE].type, battler); + + if (gBattleMoveDamage != 0) + SetDmgHazardsBattlescript(battler, B_MSG_SHARPSTEELDMG); + } + else if (gBattleMons[battler].hp != gBattleMons[battler].maxHP && gBattleStruct->zmove.healReplacement) + { + gBattleStruct->zmove.healReplacement = FALSE; + gBattleMoveDamage = -1 * (gBattleMons[battler].maxHP); + gBattleScripting.battler = battler; + BattleScriptPushCursor(); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_HP_TRAP; + gBattlescriptCurrInstr = BattleScript_HealReplacementZMove; + return; } else { - // There is a hack here in pokeemerald to ensure the truant counter will be 0 when the battler's next turn starts. - // The truant counter is not updated in the case where a mon switches in after a lost judgement in the battle arena. - if (gBattleMons[gActiveBattler].ability == ABILITY_TRUANT) - //if (gBattleMons[gActiveBattler].ability == ABILITY_TRUANT && !gDisableStructs[gActiveBattler].truantSwitchInHack) // In pokeemerald. - gDisableStructs[gActiveBattler].truantCounter = 1; + u32 battlerAbility = GetBattlerAbility(battler); + // There is a hack here to ensure the truant counter will be 0 when the battler's next turn starts. + // The truant counter is not updated in the case where a mon switches in after a lost judgment in the battle arena. + if (battlerAbility == ABILITY_TRUANT + && gCurrentActionFuncId != B_ACTION_USE_MOVE + && !gDisableStructs[battler].truantSwitchInHack) + gDisableStructs[battler].truantCounter = 1; - //gDisableStructs[gActiveBattler].truantSwitchInHack = 0; // In pokeemerald, otherwise unused. + gDisableStructs[battler].truantSwitchInHack = 0; - if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0) - && !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE)) + // Don't activate switch-in abilities if the opposing field is empty. + // This could happen when a mon uses explosion and causes everyone to faint. + if ((battlerAbility == ABILITY_INTIMIDATE || battlerAbility == ABILITY_SUPERSWEET_SYRUP || battlerAbility == ABILITY_DOWNLOAD) + && !IsBattlerAlive(BATTLE_OPPOSITE(battler)) + && !IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(battler)))) { - gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~SIDE_STATUS_SPIKES_DAMAGED; - - for (i = 0; i < gBattlersCount; i++) - { - if (gBattlerByTurnOrder[i] == gActiveBattler) - gActionsByTurnOrder[i] = B_ACTION_CANCEL_PARTNER; - } - - for (i = 0; i < gBattlersCount; i++) - { - u16 *hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)]; - *hpOnSwitchout = gBattleMons[i].hp; - } - - if (gBattlescriptCurrInstr[1] == BS_FAINTED_LINK_MULTIPLE_1) - { - u32 hitmarkerFaintBits = gHitMarker >> 28; - - gBattlerFainted++; - while (TRUE) - { - if (hitmarkerFaintBits & gBitTable[gBattlerFainted] && !(gAbsentBattlerFlags & gBitTable[gBattlerFainted])) - break; - if (gBattlerFainted >= gBattlersCount) - break; - gBattlerFainted++; - } - } - gBattlescriptCurrInstr += 2; + if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, battler, FALSE)) + return; } + else + { + if (DoSwitchInAbilities(battler) || ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, battler, FALSE)) + return; + else if (AbilityBattleEffects(ABILITYEFFECT_OPPORTUNIST, battler, 0, 0, 0)) + return; + } + + gDisableStructs[battler].stickyWebDone = FALSE; + gDisableStructs[battler].spikesDone = FALSE; + gDisableStructs[battler].toxicSpikesDone = FALSE; + gDisableStructs[battler].stealthRockDone = FALSE; + gDisableStructs[battler].steelSurgeDone = FALSE; + + for (i = 0; i < gBattlersCount; i++) + { + if (gBattlerByTurnOrder[i] == battler) + gActionsByTurnOrder[i] = B_ACTION_CANCEL_PARTNER; + + gBattleStruct->hpOnSwitchout[GetBattlerSide(i)] = gBattleMons[i].hp; + } + + if (cmd->battler == BS_FAINTED_LINK_MULTIPLE_1) + { + u32 hitmarkerFaintBits = gHitMarker >> 28; + + gBattlerFainted++; + while (1) + { + if (hitmarkerFaintBits & gBitTable[gBattlerFainted] && !(gAbsentBattlerFlags & gBitTable[gBattlerFainted])) + break; + if (gBattlerFainted >= gBattlersCount) + break; + gBattlerFainted++; + } + } + gBattleStruct->forcedSwitch &= ~(gBitTable[battler]); + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trainerslidein(void) { - if (!gBattlescriptCurrInstr[1]) - gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - else - gActiveBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); - BtlController_EmitTrainerSlide(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u8 battler); - gBattlescriptCurrInstr += 2; + u32 battler = gActiveBattler = GetBattlerAtPosition(cmd->battler); + BtlController_EmitTrainerSlide(BUFFER_A); + MarkBattlerForControllerExec(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_playse(void) { - gActiveBattler = gBattlerAttacker; - BtlController_EmitPlaySE(BUFFER_A, T2_READ_16(gBattlescriptCurrInstr + 1)); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u16 song); - gBattlescriptCurrInstr += 3; + gActiveBattler = gBattlerAttacker; + BtlController_EmitPlaySE(BUFFER_A, cmd->song); + MarkBattlerForControllerExec(gBattlerAttacker); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_fanfare(void) { - gActiveBattler = gBattlerAttacker; - BtlController_EmitPlayFanfare(BUFFER_A, T2_READ_16(gBattlescriptCurrInstr + 1)); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u16 song); - gBattlescriptCurrInstr += 3; + gActiveBattler = gBattlerAttacker; + BtlController_EmitPlayFanfareOrBGM(BUFFER_A, cmd->song, FALSE); + MarkBattlerForControllerExec(gBattlerAttacker); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_playfaintcry(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - BtlController_EmitFaintingCry(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u8 battler); - gBattlescriptCurrInstr += 2; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + BtlController_EmitFaintingCry(BUFFER_A); + MarkBattlerForControllerExec(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_endlinkbattle(void) { - gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - BtlController_EmitEndLinkBattle(BUFFER_A, gBattleOutcome); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(); - gBattlescriptCurrInstr += 1; + u32 battler = gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + BtlController_EmitEndLinkBattle(BUFFER_A, gBattleOutcome); + MarkBattlerForControllerExec(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_returntoball(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - BtlController_EmitReturnMonToBall(BUFFER_A, TRUE); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u8 battler, bool8 changingForm); - gBattlescriptCurrInstr += 2; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + BtlController_EmitReturnMonToBall(BUFFER_A, TRUE); + MarkBattlerForControllerExec(battler); + + // Don't always execute a form change here otherwise we can stomp gigantamax + if(!cmd->changingForm) + TryBattleFormChange(battler, FORM_CHANGE_BATTLE_SWITCH); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_handlelearnnewmove(void) { - const u8 *learnedMovePtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *nothingToLearnPtr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + CMD_ARGS(const u8 *learnedMovePtr, const u8 *nothingToLearnPtr, bool8 isFirstMove); - u16 learnMove = MonTryLearningNewMove(&gPlayerParty[gBattleStruct->expGetterMonId], gBattlescriptCurrInstr[9]); + u32 monId = gBattleStruct->expGetterMonId; + u16 learnMove = MonTryLearningNewMove(&gPlayerParty[monId], cmd->isFirstMove); while (learnMove == MON_ALREADY_KNOWS_MOVE) - learnMove = MonTryLearningNewMove(&gPlayerParty[gBattleStruct->expGetterMonId], FALSE); + learnMove = MonTryLearningNewMove(&gPlayerParty[monId], FALSE); if (learnMove == MOVE_NONE) { - gBattlescriptCurrInstr = nothingToLearnPtr; + gBattlescriptCurrInstr = cmd->nothingToLearnPtr; } else if (learnMove == MON_HAS_MAX_MOVES) { - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + u32 battler = gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - if (gBattlerPartyIndexes[gActiveBattler] == gBattleStruct->expGetterMonId - && !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED)) + if (gBattlerPartyIndexes[battler] == monId + && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) { - GiveMoveToBattleMon(&gBattleMons[gActiveBattler], learnMove); + GiveMoveToBattleMon(&gBattleMons[battler], learnMove); } if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); - if (gBattlerPartyIndexes[gActiveBattler] == gBattleStruct->expGetterMonId - && !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED)) + battler = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + if (gBattlerPartyIndexes[battler] == monId + && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) { - GiveMoveToBattleMon(&gBattleMons[gActiveBattler], learnMove); + GiveMoveToBattleMon(&gBattleMons[battler], learnMove); } } - gBattlescriptCurrInstr = learnedMovePtr; + gBattlescriptCurrInstr = cmd->learnedMovePtr; } } static void Cmd_yesnoboxlearnmove(void) { + CMD_ARGS(const u8 *forgotMovePtr); gActiveBattler = 0; switch (gBattleScripting.learnMoveState) { case 0: - HandleBattleWindow(23, 8, 29, 13, 0); + HandleBattleWindow(YESNOBOX_X_Y, 0); BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); gBattleScripting.learnMoveState++; gBattleCommunication[CURSOR_POSITION] = 0; @@ -5235,19 +7673,19 @@ static void Cmd_yesnoboxlearnmove(void) PlaySE(SE_SELECT); if (gBattleCommunication[1] == 0) { - HandleBattleWindow(23, 8, 29, 13, WINDOW_CLEAR); + HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gBattleScripting.learnMoveState++; } else { - gBattleScripting.learnMoveState = 4; + gBattleScripting.learnMoveState = 5; } } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - gBattleScripting.learnMoveState = 4; + gBattleScripting.learnMoveState = 5; } break; case 2: @@ -5259,25 +7697,30 @@ static void Cmd_yesnoboxlearnmove(void) } break; case 3: + if (!gPaletteFade.active && gMain.callback2 == BattleMainCB2) + { + gBattleScripting.learnMoveState++; + } + break; + case 4: if (!gPaletteFade.active && gMain.callback2 == BattleMainCB2) { u8 movePosition = GetMoveSlotToReplace(); if (movePosition == MAX_MON_MOVES) { - gBattleScripting.learnMoveState = 4; + gBattleScripting.learnMoveState = 5; } else { u16 moveId = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition); - - if (IsHMMove2(moveId)) + if (IsMoveHM(moveId)) { - PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, gActiveBattler); - gBattleScripting.learnMoveState = 5; + PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, B_POSITION_PLAYER_LEFT); + gBattleScripting.learnMoveState = 6; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->forgotMovePtr; PREPARE_MOVE_BUFFER(gBattleTextBuff2, moveId) @@ -5300,11 +7743,11 @@ static void Cmd_yesnoboxlearnmove(void) } } break; - case 4: - HandleBattleWindow(23, 8, 29, 13, WINDOW_CLEAR); - gBattlescriptCurrInstr += 5; - break; case 5: + HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); + gBattlescriptCurrInstr = cmd->nextInstr; + break; + case 6: if (gBattleControllerExecFlags == 0) { gBattleScripting.learnMoveState = 2; @@ -5315,10 +7758,12 @@ static void Cmd_yesnoboxlearnmove(void) static void Cmd_yesnoboxstoplearningmove(void) { + CMD_ARGS(const u8 *noInstr); + switch (gBattleScripting.learnMoveState) { case 0: - HandleBattleWindow(23, 8, 29, 13, 0); + HandleBattleWindow(YESNOBOX_X_Y, 0); BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); gBattleScripting.learnMoveState++; gBattleCommunication[CURSOR_POSITION] = 0; @@ -5344,17 +7789,17 @@ static void Cmd_yesnoboxstoplearningmove(void) PlaySE(SE_SELECT); if (gBattleCommunication[1] != 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->noInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; - HandleBattleWindow(23, 8, 29, 13, WINDOW_CLEAR); + HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - HandleBattleWindow(23, 8, 29, 13, WINDOW_CLEAR); + gBattlescriptCurrInstr = cmd->noInstr; + HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); } break; } @@ -5362,115 +7807,121 @@ static void Cmd_yesnoboxstoplearningmove(void) static void Cmd_hitanimation(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } - else if (!(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE) || !(gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) || gDisableStructs[gActiveBattler].substituteHP == 0) + else if (!(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE) || !(DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove)) || gDisableStructs[battler].substituteHP == 0) { BtlController_EmitHitAnimation(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } +static u32 GetTrainerMoneyToGive(u16 trainerId) +{ + u32 lastMonLevel = 0; + u32 moneyReward; + u8 trainerMoney = 0; + + if (trainerId == TRAINER_SECRET_BASE) + { + moneyReward = 20 * gBattleResources->secretBase->party.levels[0] * gBattleStruct->moneyMultiplier; + } + else + { + // TODO: Update Trainer struct + // const struct TrainerMon *party = GetTrainerPartyFromId(trainerId); + // if (party == NULL) + // return 20; + // lastMonLevel = party[GetTrainerPartySizeFromId(trainerId) - 1].lvl; + // trainerMoney = gTrainerClasses[GetTrainerClassFromId(trainerId)].money; + lastMonLevel = 10; + trainerMoney = 100; + + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * trainerMoney; + else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * 2 * trainerMoney; + else + moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * trainerMoney; + } + + return moneyReward; +} + static void Cmd_getmoneyreward(void) { - u32 i = 0; - u32 moneyReward; - u8 lastMonLevel = 0; + CMD_ARGS(); - const struct TrainerMonItemCustomMoves *party4; //This needs to be out here + u32 money; + u8 sPartyLevel = 1; if (gBattleOutcome == B_OUTCOME_WON) { - if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE) - { - moneyReward = gBattleResources->secretBase->party.levels[0] * 20 * gBattleStruct->moneyMultiplier; - } - else - { - switch (gTrainers[gTrainerBattleOpponent_A].partyFlags) - { - case 0: - { - const struct TrainerMonNoItemDefaultMoves *party1 = gTrainers[gTrainerBattleOpponent_A].party.NoItemDefaultMoves; - - lastMonLevel = party1[gTrainers[gTrainerBattleOpponent_A].partySize - 1].lvl; - } - break; - case F_TRAINER_PARTY_CUSTOM_MOVESET: - { - const struct TrainerMonNoItemCustomMoves *party2 = gTrainers[gTrainerBattleOpponent_A].party.NoItemCustomMoves; - - lastMonLevel = party2[gTrainers[gTrainerBattleOpponent_A].partySize - 1].lvl; - } - break; - case F_TRAINER_PARTY_HELD_ITEM: - { - const struct TrainerMonItemDefaultMoves *party3 = gTrainers[gTrainerBattleOpponent_A].party.ItemDefaultMoves; - - lastMonLevel = party3[gTrainers[gTrainerBattleOpponent_A].partySize - 1].lvl; - } - break; - case (F_TRAINER_PARTY_CUSTOM_MOVESET | F_TRAINER_PARTY_HELD_ITEM): - { - party4 = gTrainers[gTrainerBattleOpponent_A].party.ItemCustomMoves; - - lastMonLevel = party4[gTrainers[gTrainerBattleOpponent_A].partySize - 1].lvl; - } - break; - } - for (; gTrainerMoneyTable[i].classId != 0xFF; i++) - { - if (gTrainerMoneyTable[i].classId == gTrainers[gTrainerBattleOpponent_A].trainerClass) - break; - } - party4 = gTrainers[gTrainerBattleOpponent_A].party.ItemCustomMoves; // Needed to Match. Has no effect. - moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * (gBattleTypeFlags & BATTLE_TYPE_DOUBLE ? 2 : 1) * gTrainerMoneyTable[i].value; - } - AddMoney(&gSaveBlock1Ptr->money, moneyReward); + money = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + money += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + AddMoney(&gSaveBlock1Ptr->money, money); } else { - moneyReward = ComputeWhiteOutMoneyLoss(); + s32 i, count; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) > sPartyLevel) + sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + } + } + for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++) + { + if (FlagGet(sBadgeFlags[i]) == TRUE) + ++count; + } + money = sWhiteOutBadgeMoney[count] * sPartyLevel; + RemoveMoney(&gSaveBlock1Ptr->money, money); } - PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, moneyReward); - if (moneyReward) - gBattlescriptCurrInstr += 5; - else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + + PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money); + gBattlescriptCurrInstr = cmd->nextInstr; } // Command is never used static void Cmd_updatebattlermoves(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); switch (gBattleCommunication[0]) { case 0: BtlController_EmitGetMonData(BUFFER_A, REQUEST_ALL_BATTLE, 0); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); gBattleCommunication[0]++; break; case 1: if (gBattleControllerExecFlags == 0) { s32 i; - struct BattlePokemon *bufferPoke = (struct BattlePokemon *) &gBattleBufferB[gActiveBattler][4]; + struct BattlePokemon *bufferPoke = (struct BattlePokemon *) &gBattleBufferB[battler][4]; for (i = 0; i < MAX_MON_MOVES; i++) { - gBattleMons[gActiveBattler].moves[i] = bufferPoke->moves[i]; - gBattleMons[gActiveBattler].pp[i] = bufferPoke->pp[i]; + gBattleMons[battler].moves[i] = bufferPoke->moves[i]; + gBattleMons[battler].pp[i] = bufferPoke->pp[i]; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -5478,41 +7929,43 @@ static void Cmd_updatebattlermoves(void) static void Cmd_swapattackerwithtarget(void) { - gActiveBattler = gBattlerAttacker; - gBattlerAttacker = gBattlerTarget; - gBattlerTarget = gActiveBattler; + CMD_ARGS(); + + u8 temp; + // SWAP(gBattlerAttacker, gBattlerTarget, temp); + SWAP(gBattlerAttacker, gBattlerTarget, gActiveBattler); if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET) gHitMarker &= ~HITMARKER_SWAP_ATTACKER_TARGET; else gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_incrementgamestat(void) { - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) - IncrementGameStat(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 stat); - gBattlescriptCurrInstr += 2; + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) + IncrementGameStat(cmd->stat); // TODO: compare IncrementGameStat to pokeemerald + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_drawpartystatussummary(void) { - s32 i; + CMD_ARGS(u8 battler); + + u32 battler, i; struct Pokemon *party; struct HpAndStatus hpStatuses[PARTY_SIZE]; if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - - if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) - party = gPlayerParty; - else - party = gEnemyParty; + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + party = GetBattlerParty(battler); for (i = 0; i < PARTY_SIZE; i++) { @@ -5530,90 +7983,98 @@ static void Cmd_drawpartystatussummary(void) } BtlController_EmitDrawPartyStatusSummary(BUFFER_A, hpStatuses, 1); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(battler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_hidepartystatussummary(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - BtlController_EmitHidePartyStatusSummary(BUFFER_A); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u8 battler); - gBattlescriptCurrInstr += 2; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + BtlController_EmitHidePartyStatusSummary(BUFFER_A); + MarkBattlerForControllerExec(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumptocalledmove(void) { - if (gBattlescriptCurrInstr[1]) + CMD_ARGS(bool8 notChosenMove); + + if (cmd->notChosenMove) gCurrentMove = gCalledMove; else gChosenMove = gCurrentMove = gCalledMove; - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); } static void Cmd_statusanimation(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - if (!(gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) - && gDisableStructs[gActiveBattler].substituteHP == 0 - && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + if (!(gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + && gDisableStructs[battler].substituteHP == 0 + && !(gHitMarker & (HITMARKER_NO_ANIMATIONS | HITMARKER_DISABLE_ANIMATION))) { - BtlController_EmitStatusAnimation(BUFFER_A, FALSE, gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitStatusAnimation(BUFFER_A, FALSE, gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_status2animation(void) { - u32 wantedToAnimate; + CMD_ARGS(u8 battler, u32 status2); if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - wantedToAnimate = T1_READ_32(gBattlescriptCurrInstr + 2); - if (!(gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) - && gDisableStructs[gActiveBattler].substituteHP == 0 - && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + u32 status2ToAnim = cmd->status2; + if (!(gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + && gDisableStructs[battler].substituteHP == 0 + && !(gHitMarker & (HITMARKER_NO_ANIMATIONS | HITMARKER_DISABLE_ANIMATION))) { - BtlController_EmitStatusAnimation(BUFFER_A, TRUE, gBattleMons[gActiveBattler].status2 & wantedToAnimate); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitStatusAnimation(BUFFER_A, TRUE, gBattleMons[battler].status2 & status2ToAnim); + MarkBattlerForControllerExec(battler); } - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_chosenstatusanimation(void) { - u32 wantedStatus; + CMD_ARGS(u8 battler, bool8 isStatus2, u32 status); if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - wantedStatus = T1_READ_32(gBattlescriptCurrInstr + 3); - if (!(gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) - && gDisableStructs[gActiveBattler].substituteHP == 0 - && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + u32 wantedStatus = cmd->status; + if (!(gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + && gDisableStructs[battler].substituteHP == 0 + && !(gHitMarker & (HITMARKER_NO_ANIMATIONS | HITMARKER_DISABLE_ANIMATION))) { - BtlController_EmitStatusAnimation(BUFFER_A, gBattlescriptCurrInstr[2], wantedStatus); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitStatusAnimation(BUFFER_A, cmd->isStatus2, wantedStatus); + MarkBattlerForControllerExec(battler); } - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_yesnobox(void) { + CMD_ARGS(); + switch (gBattleCommunication[0]) { case 0: - HandleBattleWindow(23, 8, 29, 13, 0); + HandleBattleWindow(YESNOBOX_X_Y, 0); BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); gBattleCommunication[0]++; gBattleCommunication[CURSOR_POSITION] = 0; @@ -5638,14 +8099,14 @@ static void Cmd_yesnobox(void) { gBattleCommunication[CURSOR_POSITION] = 1; PlaySE(SE_SELECT); - HandleBattleWindow(23, 8, 29, 13, WINDOW_CLEAR); - gBattlescriptCurrInstr++; + HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); + gBattlescriptCurrInstr = cmd->nextInstr; } else if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - HandleBattleWindow(23, 8, 29, 13, WINDOW_CLEAR); - gBattlescriptCurrInstr++; + HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -5653,80 +8114,143 @@ static void Cmd_yesnobox(void) static void Cmd_cancelallactions(void) { + CMD_ARGS(); + s32 i; for (i = 0; i < gBattlersCount; i++) gActionsByTurnOrder[i] = B_ACTION_CANCEL_PARTNER; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } -// The same as adjustnormaldamage, except there's no random damage multiplier. -static void Cmd_adjustsetdamage(void) +// The same as adjustdamage, except there's no random damage multiplier. +static void Cmd_setgravity(void) { - u8 holdEffect, param; + CMD_ARGS(const u8 *failInstr); - if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY) + if (gFieldStatuses & STATUS_FIELD_GRAVITY) { - holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; - param = gEnigmaBerries[gBattlerTarget].holdEffectParam; + gBattlescriptCurrInstr = cmd->failInstr; } else { - holdEffect = ItemId_GetHoldEffect(gBattleMons[gBattlerTarget].item); - param = ItemId_GetHoldEffectParam(gBattleMons[gBattlerTarget].item); + gFieldStatuses |= STATUS_FIELD_GRAVITY; + gFieldTimers.gravityTimer = 5; + gBattlescriptCurrInstr = cmd->nextInstr; } +} - gPotentialItemEffectBattler = gBattlerTarget; +static bool32 TryCheekPouch(u32 battler, u32 itemId) +{ + if (ItemId_GetPocket(itemId) == POCKET_BERRY_POUCH + && GetBattlerAbility(battler) == ABILITY_CHEEK_POUCH + && !(gStatuses3[battler] & STATUS3_HEAL_BLOCK) + && gBattleStruct->ateBerry[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]] + && !BATTLER_MAX_HP(battler)) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 3; + gBattleMoveDamage = gBattleMons[battler].maxHP / 3; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + gBattlerAbility = battler; + BattleScriptPush(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = BattleScript_CheekPouchActivates; + return TRUE; + } + return FALSE; +} - if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) +// Used by Bestow and Symbiosis to take an item from one battler and give to another. +static void BestowItem(u32 battlerAtk, u32 battlerDef) +{ + gLastUsedItem = gBattleMons[battlerAtk].item; + + gBattleMons[battlerAtk].item = ITEM_NONE; + gActiveBattler = battlerAtk; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battlerAtk].item), &gBattleMons[battlerAtk].item); + MarkBattlerForControllerExec(battlerAtk); + CheckSetUnburden(battlerAtk); + + gBattleMons[battlerDef].item = gLastUsedItem; + gActiveBattler = battlerDef; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battlerDef].item), &gBattleMons[battlerDef].item); + MarkBattlerForControllerExec(battlerDef); + gBattleResources->flags->flags[battlerDef] &= ~RESOURCE_FLAG_UNBURDEN; +} + +// Called by Cmd_removeitem. itemId represents the item that was removed, not being given. +static bool32 TrySymbiosis(u32 battler, u32 itemId) +{ + if (!gBattleStruct->itemLost[gBattlerPartyIndexes[battler]].stolen + && gBattleStruct->changedItems[battler] == ITEM_NONE + && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_BUTTON + && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_PACK + && (B_SYMBIOSIS_GEMS < GEN_7 || !(gSpecialStatuses[battler].gemBoost)) + && gCurrentMove != MOVE_FLING //Fling and damage-reducing berries are handled separately. + && !gSpecialStatuses[battler].berryReduced + && SYMBIOSIS_CHECK(battler, BATTLE_PARTNER(battler))) { - RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + BestowItem(BATTLE_PARTNER(battler), battler); + gLastUsedAbility = gBattleMons[BATTLE_PARTNER(battler)].ability; + gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(battler); + gBattlerAttacker = battler; + BattleScriptPush(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; + return TRUE; } - if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE) - && (gBattleMoves[gCurrentMove].effect == EFFECT_FALSE_SWIPE || gProtectStructs[gBattlerTarget].endured || gSpecialStatuses[gBattlerTarget].focusBanded) - && gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage) - { - gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; - if (gProtectStructs[gBattlerTarget].endured) - { - gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED; - } - else if (gSpecialStatuses[gBattlerTarget].focusBanded) - { - gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON; - gLastUsedItem = gBattleMons[gBattlerTarget].item; - } - } - gBattlescriptCurrInstr++; + return FALSE; } static void Cmd_removeitem(void) { - u16 *usedHeldItem; + CMD_ARGS(u8 battler); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + u32 battler; + u16 itemId = 0; - usedHeldItem = &gBattleStruct->usedHeldItems[gActiveBattler]; - *usedHeldItem = gBattleMons[gActiveBattler].item; - gBattleMons[gActiveBattler].item = ITEM_NONE; + if (gBattleScripting.overrideBerryRequirements) + { + // bug bite / pluck - don't remove current item + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); - MarkBattlerForControllerExec(gActiveBattler); + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + itemId = gBattleMons[battler].item; - gBattlescriptCurrInstr += 2; + // Popped Air Balloon cannot be restored by any means. + // Corroded items cannot be restored either. + if (GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_AIR_BALLOON + && gMovesInfo[gCurrentMove].effect != EFFECT_CORROSIVE_GAS) + gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = itemId; // Remember if switched out + + gBattleMons[battler].item = ITEM_NONE; + CheckSetUnburden(battler); + + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battler].item), &gBattleMons[battler].item); + MarkBattlerForControllerExec(battler); + + ClearBattlerItemEffectHistory(battler); + if (!TryCheekPouch(battler, itemId) && !TrySymbiosis(battler, itemId)) + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_atknameinbuff1(void) { - PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattlerPartyIndexes[gBattlerAttacker]) + CMD_ARGS(); - gBattlescriptCurrInstr++; + PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattlerPartyIndexes[gBattlerAttacker]); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_drawlvlupbox(void) { + CMD_ARGS(); + if (gBattleScripting.drawlvlupboxState == 0) { // If the Pokémon getting exp is not in-battle then @@ -5820,7 +8344,7 @@ static void Cmd_drawlvlupbox(void) SetBgAttribute(1, BG_ATTR_PRIORITY, 1); ShowBg(0); ShowBg(1); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -5875,15 +8399,14 @@ static bool8 SlideInLevelUpBanner(void) static void DrawLevelUpBannerText(void) { - u16 monLevel; - u8 monGender; struct TextPrinterTemplate printerTemplate; u8 *txtPtr; - u8 *txtPtr2; + u32 var; - monLevel = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL); - monGender = GetMonGender(&gPlayerParty[gBattleStruct->expGetterMonId]); - GetMonNickname(&gPlayerParty[gBattleStruct->expGetterMonId], gStringVar4); + struct Pokemon *mon = &gPlayerParty[gBattleStruct->expGetterMonId]; + u32 monLevel = GetMonData(mon, MON_DATA_LEVEL); + u8 monGender = GetMonGender(mon); + GetMonNickname(mon, gStringVar4); printerTemplate.currentChar = gStringVar4; printerTemplate.windowId = B_WIN_LEVEL_UP_BANNER; @@ -5902,13 +8425,14 @@ static void DrawLevelUpBannerText(void) AddTextPrinter(&printerTemplate, TEXT_SKIP_DRAW, NULL); txtPtr = gStringVar4; - gStringVar4[0] = CHAR_EXTRA_SYMBOL; - *++txtPtr = CHAR_LV_2; - *++txtPtr = 0; - txtPtr2 = txtPtr + 1; - txtPtr = ConvertIntToDecimalStringN(++txtPtr, monLevel, STR_CONV_MODE_LEFT_ALIGN, 3); - txtPtr = StringFill(txtPtr, 0, 5); - txtPtr = txtPtr2 + 4; + *(txtPtr)++ = CHAR_EXTRA_SYMBOL; + *(txtPtr)++ = CHAR_LV_2; + + var = (u32)(txtPtr); + txtPtr = ConvertIntToDecimalStringN(txtPtr, monLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + var = (u32)(txtPtr) - var; + txtPtr = StringFill(txtPtr, CHAR_SPACER, 4 - var); + if (monGender != MON_GENDERLESS) { if (monGender == MON_MALE) @@ -5952,20 +8476,18 @@ static bool8 SlideOutLevelUpBanner(void) static void PutMonIconOnLvlUpBanner(void) { u8 spriteId; - const u16 *iconPal; struct SpriteSheet iconSheet; struct SpritePalette iconPalSheet; - u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES); - u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY); + struct Pokemon *mon = &gPlayerParty[gBattleStruct->expGetterMonId]; + u32 species = GetMonData(mon, MON_DATA_SPECIES); + u32 personality = GetMonData(mon, MON_DATA_PERSONALITY); - const u8 *iconPtr = GetMonIconPtr(species, personality, 1); - iconSheet.data = iconPtr; + iconSheet.data = GetMonIconPtr(species, personality); iconSheet.size = 0x200; iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON; - iconPal = GetValidMonIconPalettePtr(species); - iconPalSheet.data = iconPal; + iconPalSheet.data = GetValidMonIconPalettePtr(species); iconPalSheet.tag = TAG_LVLUP_BANNER_MON_ICON; LoadSpriteSheet(&iconSheet); @@ -5976,7 +8498,7 @@ static void PutMonIconOnLvlUpBanner(void) gSprites[spriteId].sXOffset = gBattle_BG2_X; } -static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite) +static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite *sprite) { sprite->x2 = sprite->sXOffset - gBattle_BG2_X; @@ -6007,36 +8529,42 @@ bool32 IsMonGettingExpSentOut(void) static void Cmd_resetsentmonsvalue(void) { + CMD_ARGS(); + ResetSentPokesToOpponentValue(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setatktoplayer0(void) { + CMD_ARGS(); + gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_makevisible(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - BtlController_EmitSpriteInvisibility(BUFFER_A, FALSE); - MarkBattlerForControllerExec(gActiveBattler); + CMD_ARGS(u8 battler); + u32 battler; - gBattlescriptCurrInstr += 2; + if (gBattleControllerExecFlags) + return; + + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + BtlController_EmitSpriteInvisibility(BUFFER_A, FALSE); + MarkBattlerForControllerExec(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_recordlastability(void) +static void Cmd_recordability(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - RecordAbilityBattle(gActiveBattler, gLastUsedAbility); + CMD_ARGS(u8 battler); -#ifdef BUGFIX - // This command occupies two bytes (one for the command id, and one for the battler id parameter). - gBattlescriptCurrInstr += 2; -#else - gBattlescriptCurrInstr += 1; -#endif + u8 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + RecordAbilityBattle(battler, gBattleMons[battler].ability); + gBattlescriptCurrInstr = cmd->nextInstr; } void BufferMoveToLearnIntoBattleTextBuff2(void) @@ -6046,29 +8574,32 @@ void BufferMoveToLearnIntoBattleTextBuff2(void) static void Cmd_buffermovetolearn(void) { + CMD_ARGS(); + BufferMoveToLearnIntoBattleTextBuff2(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifplayerran(void) { + CMD_ARGS(const u8 *jumpInstr); + if (TryRunFromBattle(gBattlerFainted)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_hpthresholds(void) { - u8 opposingBattler; - s32 result; + CMD_ARGS(u8 battler); if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - opposingBattler = gActiveBattler ^ BIT_SIDE; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + u32 opposingBattler = BATTLE_OPPOSITE(battler); - result = gBattleMons[opposingBattler].hp * 100 / gBattleMons[opposingBattler].maxHP; + s32 result = gBattleMons[opposingBattler].hp * 100 / gBattleMons[opposingBattler].maxHP; if (result == 0) result = 1; @@ -6082,21 +8613,19 @@ static void Cmd_hpthresholds(void) gBattleStruct->hpScale = 3; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_hpthresholds2(void) { - u8 opposingBattler; - s32 result; - u8 hpSwitchout; + CMD_ARGS(u8 battler); if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - opposingBattler = gActiveBattler ^ BIT_SIDE; - hpSwitchout = *(gBattleStruct->hpOnSwitchout + GetBattlerSide(opposingBattler)); - result = (hpSwitchout - gBattleMons[opposingBattler].hp) * 100 / hpSwitchout; + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + u32 opposingBattler = BATTLE_OPPOSITE(battler); + u8 hpSwitchout = *(gBattleStruct->hpOnSwitchout + GetBattlerSide(opposingBattler)); + s32 result = (hpSwitchout - gBattleMons[opposingBattler].hp) * 100 / hpSwitchout; if (gBattleMons[opposingBattler].hp >= hpSwitchout) gBattleStruct->hpScale = 0; @@ -6108,77 +8637,791 @@ static void Cmd_hpthresholds2(void) gBattleStruct->hpScale = 3; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_useitemonopponent(void) { + CMD_ARGS(); + gBattlerInMenuId = gBattlerAttacker; PokemonUseItemEffects(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]], gLastUsedItem, gBattlerPartyIndexes[gBattlerAttacker], 0, TRUE); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static bool32 HasAttackerFaintedTarget(void) +{ + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gMovesInfo[gCurrentMove].power != 0 + && (gLastHitBy[gBattlerTarget] == 0xFF || gLastHitBy[gBattlerTarget] == gBattlerAttacker) + && gBattleStruct->moveTarget[gBattlerAttacker] == gBattlerTarget + && gBattlerTarget != gBattlerAttacker + && gCurrentTurnActionNumber == GetBattlerTurnOrderNum(gBattlerAttacker) + && (gChosenMove == gChosenMoveByBattler[gBattlerAttacker] || gChosenMove == gBattleMons[gBattlerAttacker].moves[gChosenMovePos])) + return TRUE; + else + return FALSE; +} + +bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget) +{ + return GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION + || (!IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL) && !IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON)); +} + +bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget) +{ + return !(B_PARALYZE_ELECTRIC >= GEN_6 && IS_BATTLER_OF_TYPE(battlerTarget, TYPE_ELECTRIC)); +} + +bool32 CanUseLastResort(u8 battler) +{ + u32 i; + u32 knownMovesCount = 0, usedMovesCount = 0; + + for (i = 0; i < 4; i++) + { + if (gBattleMons[battler].moves[i] != MOVE_NONE) + knownMovesCount++; + if (i != gCurrMovePos && gDisableStructs[battler].usedMoves & gBitTable[i]) // Increment used move count for all moves except current Last Resort. + usedMovesCount++; + } + + return (knownMovesCount >= 2 && usedMovesCount >= knownMovesCount - 1); +} + +static void RemoveAllTerrains(void) +{ + gFieldTimers.terrainTimer = 0; + switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + case STATUS_FIELD_MISTY_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_END_MISTY; + break; + case STATUS_FIELD_GRASSY_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_END_GRASSY; + break; + case STATUS_FIELD_ELECTRIC_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_END_ELECTRIC; + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_END_PSYCHIC; + break; + default: + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_COUNT; // failsafe + break; + } + gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain +} + +#define DEFOG_CLEAR(status, structField, battlescript, move)\ +{ \ + if (*sideStatuses & status) \ + { \ + if (clear) \ + { \ + if (move) \ + PREPARE_MOVE_BUFFER(gBattleTextBuff1, move);\ + *sideStatuses &= ~status; \ + sideTimer->structField = 0; \ + BattleScriptPushCursor(); \ + gBattlescriptCurrInstr = battlescript; \ + } \ + return TRUE; \ + } \ +} + +static bool32 TryDefogClear(u32 battlerAtk, bool32 clear) +{ + s32 i; + u8 saveBattler = gBattlerAttacker; + + for (i = 0; i < 2; i++) + { + struct SideTimer *sideTimer = &gSideTimers[i]; + u32 *sideStatuses = &gSideStatuses[i]; + + gBattlerAttacker = i; // For correct battle string. Ally's / Foe's + if (GetBattlerSide(battlerAtk) != i) + { + DEFOG_CLEAR(SIDE_STATUS_REFLECT, reflectTimer, BattleScript_SideStatusWoreOffReturn, MOVE_REFLECT); + DEFOG_CLEAR(SIDE_STATUS_LIGHTSCREEN, lightscreenTimer, BattleScript_SideStatusWoreOffReturn, MOVE_LIGHT_SCREEN); + DEFOG_CLEAR(SIDE_STATUS_MIST, mistTimer, BattleScript_SideStatusWoreOffReturn, MOVE_MIST); + DEFOG_CLEAR(SIDE_STATUS_AURORA_VEIL, auroraVeilTimer, BattleScript_SideStatusWoreOffReturn, MOVE_AURORA_VEIL); + DEFOG_CLEAR(SIDE_STATUS_SAFEGUARD, safeguardTimer, BattleScript_SideStatusWoreOffReturn, MOVE_SAFEGUARD); + } + DEFOG_CLEAR(SIDE_STATUS_SPIKES, spikesAmount, BattleScript_SpikesDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, BattleScript_StealthRockDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, BattleScript_ToxicSpikesDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_STICKY_WEB, stickyWebAmount, BattleScript_StickyWebDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_STEELSURGE, steelsurgeAmount, BattleScript_SteelsurgeDefog, 0); + if (B_DEFOG_CLEARS_TERRAIN >= GEN_8 && (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)) + { + RemoveAllTerrains(); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TerrainEnds_Ret; + return TRUE; + } + } + + gBattlerAttacker = saveBattler; + + return FALSE; +} + +static bool32 TryTidyUpClear(u32 battlerAtk, bool32 clear) +{ + s32 i; + u8 saveBattler = gBattlerAttacker; + + for (i = 0; i < NUM_BATTLE_SIDES; i++) + { + struct SideTimer *sideTimer = &gSideTimers[i]; + u32 *sideStatuses = &gSideStatuses[i]; + + gBattlerAttacker = i; // For correct battle string. Ally's / Foe's + DEFOG_CLEAR(SIDE_STATUS_SPIKES, spikesAmount, BattleScript_SpikesDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, BattleScript_StealthRockDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, BattleScript_ToxicSpikesDefog, 0); + DEFOG_CLEAR(SIDE_STATUS_STICKY_WEB, stickyWebAmount, BattleScript_StickyWebDefog, 0); + } + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (gBattleMons[i].status2 & STATUS2_SUBSTITUTE) + { + if (clear) + { + gBattlerTarget = i; + gDisableStructs[i].substituteHP = 0; + gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SubstituteFade; + } + gBattlerAttacker = saveBattler; + return TRUE; + } + } + + gBattlerAttacker = saveBattler; + return FALSE; +} + +u32 IsFlowerVeilProtected(u32 battler) +{ + if (IS_BATTLER_OF_TYPE(battler, TYPE_GRASS)) + return IsAbilityOnSide(battler, ABILITY_FLOWER_VEIL); + else + return 0; +} + +u32 IsLeafGuardProtected(u32 battler) +{ + if (IsBattlerWeatherAffected(battler, B_WEATHER_SUN)) + return GetBattlerAbility(battler) == ABILITY_LEAF_GUARD; + else + return 0; +} + +bool32 IsShieldsDownProtected(u32 battler) +{ + return (GetBattlerAbility(battler) == ABILITY_SHIELDS_DOWN + && GetFormIdFromFormSpeciesId(gBattleMons[battler].species) < GetFormIdFromFormSpeciesId(SPECIES_MINIOR_CORE_RED)); // Minior is not in core form +} + +u32 IsAbilityStatusProtected(u32 battler) +{ + return IsFlowerVeilProtected(battler) + || IsLeafGuardProtected(battler) + || IsShieldsDownProtected(battler); +} + +u32 GetHighestStatId(u32 battler) +{ + u32 i, highestId = STAT_ATK, highestStat = gBattleMons[battler].attack; + + for (i = STAT_DEF; i < NUM_STATS; i++) + { + u16 *statVal = &gBattleMons[battler].attack + (i - 1); + if (*statVal > highestStat) + { + highestStat = *statVal; + highestId = i; + } + } + return highestId; +} + +static bool32 IsRototillerAffected(u32 battler) +{ + if (!IsBattlerAlive(battler)) + return FALSE; + if (!IsBattlerGrounded(battler)) + return FALSE; // Only grounded battlers affected + if (!IS_BATTLER_OF_TYPE(battler, TYPE_GRASS)) + return FALSE; // Only grass types affected + if (gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + return FALSE; // Rototiller doesn't affected semi-invulnerable battlers + if (BlocksPrankster(MOVE_ROTOTILLER, gBattlerAttacker, battler, FALSE)) + return FALSE; + return TRUE; +} + +static bool32 IsElectricAbilityAffected(u32 ability) +{ + u32 moveType; + + if (gBattleStruct->dynamicMoveType == 0) + moveType = gMovesInfo[gCurrentMove].type; + else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_IGNORE_PHYSICALITY)) + moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; + else + moveType = gMovesInfo[gCurrentMove].type; + + if (moveType == TYPE_ELECTRIC && GetBattlerAbility(gBattlerTarget) == ability) + return TRUE; + else + return FALSE; +} + +static bool32 IsTeatimeAffected(u32 battler) +{ + if (ItemId_GetPocket(gBattleMons[battler].item) != POCKET_BERRY_POUCH) + return FALSE; // Only berries + if (gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + return FALSE; // Teatime doesn't affected semi-invulnerable battlers + return TRUE; +} + +#define COURTCHANGE_SWAP(status, structField, temp) \ +{ \ + temp = gSideStatuses[B_SIDE_PLAYER]; \ + if (gSideStatuses[B_SIDE_OPPONENT] & status) \ + gSideStatuses[B_SIDE_PLAYER] |= status; \ + else \ + gSideStatuses[B_SIDE_PLAYER] &= ~(status); \ + if (temp & status) \ + gSideStatuses[B_SIDE_OPPONENT] |= status; \ + else \ + gSideStatuses[B_SIDE_OPPONENT] &= ~(status); \ + SWAP(sideTimerPlayer->structField, sideTimerOpp->structField, temp);\ +} \ + +#define UPDATE_COURTCHANGED_BATTLER(structField)\ +{ \ + temp = sideTimerPlayer->structField; \ + sideTimerPlayer->structField = BATTLE_OPPOSITE(sideTimerOpp->structField); \ + sideTimerOpp->structField = BATTLE_OPPOSITE(temp); \ +} \ + +static void CourtChangeSwapSideStatuses(void) +{ + struct SideTimer *sideTimerPlayer = &gSideTimers[B_SIDE_PLAYER]; + struct SideTimer *sideTimerOpp = &gSideTimers[B_SIDE_OPPONENT]; + u32 temp; + + // Swap timers and statuses + COURTCHANGE_SWAP(SIDE_STATUS_REFLECT, reflectTimer, temp) + COURTCHANGE_SWAP(SIDE_STATUS_LIGHTSCREEN, lightscreenTimer, temp) + COURTCHANGE_SWAP(SIDE_STATUS_MIST, mistTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SAFEGUARD, safeguardTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_AURORA_VEIL, auroraVeilTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_TAILWIND, tailwindTimer, temp); + // Lucky Chant doesn't exist in gen 8, but seems like it should be affected by Court Change + COURTCHANGE_SWAP(SIDE_STATUS_LUCKY_CHANT, luckyChantTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SPIKES, spikesAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STICKY_WEB, stickyWebAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STEELSURGE, steelsurgeAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_DAMAGE_NON_TYPES, damageNonTypesTimer, temp); + // Track Pledge effect side + COURTCHANGE_SWAP(SIDE_STATUS_RAINBOW, rainbowTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SEA_OF_FIRE, seaOfFireTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SWAMP, swampTimer, temp); + + // Change battler IDs of swapped effects. Needed for the correct string when they expire + // E.g. "Foe's Reflect wore off!" + UPDATE_COURTCHANGED_BATTLER(reflectBattlerId); + UPDATE_COURTCHANGED_BATTLER(lightscreenBattlerId); + UPDATE_COURTCHANGED_BATTLER(mistBattlerId); + UPDATE_COURTCHANGED_BATTLER(safeguardBattlerId); + UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId); + UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId); + UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId); + UPDATE_COURTCHANGED_BATTLER(stickyWebBattlerId); + + // Track which side originally set the Sticky Web + SWAP(sideTimerPlayer->stickyWebBattlerSide, sideTimerOpp->stickyWebBattlerSide, temp); + + // Swap what type set the Gigantamax damage over time effect + SWAP(sideTimerPlayer->damageNonTypesType, sideTimerOpp->damageNonTypesType, temp); +} + +static void HandleScriptMegaPrimalBurst(u32 caseId, u32 battler, u32 type) +{ + struct Pokemon *party = GetBattlerParty(battler); + struct Pokemon *mon = &party[gBattlerPartyIndexes[battler]]; + u32 position = GetBattlerPosition(battler); + u32 side = GetBattlerSide(battler); + + // Change species. + if (caseId == 0) + { + if (type == HANDLE_TYPE_MEGA_EVOLUTION) + { + if (!TryBattleFormChange(battler, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM)) + TryBattleFormChange(battler, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE); + } + else if (type == HANDLE_TYPE_PRIMAL_REVERSION) + TryBattleFormChange(battler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION); + else + TryBattleFormChange(battler, FORM_CHANGE_BATTLE_ULTRA_BURST); + + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[battler].species); + + gActiveBattler = battler; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[battler]], sizeof(gBattleMons[battler].species), &gBattleMons[battler].species); + MarkBattlerForControllerExec(battler); + } + // Update healthbox and elevation and play cry. + else + { + UpdateHealthboxAttribute(gHealthboxSpriteIds[battler], mon, HEALTHBOX_ALL); + if (side == B_SIDE_OPPONENT) + SetBattlerShadowSpriteCallback(battler, gBattleMons[battler].species); + if (type == HANDLE_TYPE_MEGA_EVOLUTION) + gBattleStruct->mega.alreadyEvolved[position] = TRUE; + if (type == HANDLE_TYPE_ULTRA_BURST) + gBattleStruct->burst.alreadyBursted[position] = TRUE; + } +} + +// Return True if the order was changed, and false if the order was not changed(for example because the target would move after the attacker anyway). +static bool32 ChangeOrderTargetAfterAttacker(void) +{ + u32 i; + u8 data[MAX_BATTLERS_COUNT]; + + if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) + || GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) + return FALSE; + + for (i = 0; i < gBattlersCount; i++) + data[i] = gBattlerByTurnOrder[i]; + if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 2) + { + gBattlerByTurnOrder[1] = gBattlerTarget; + gBattlerByTurnOrder[2] = data[1]; + gBattlerByTurnOrder[3] = data[3]; + } + else if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 3) + { + gBattlerByTurnOrder[1] = gBattlerTarget; + gBattlerByTurnOrder[2] = data[1]; + gBattlerByTurnOrder[3] = data[2]; + } + else // Attacker == 1, Target == 3 + { + gBattlerByTurnOrder[2] = gBattlerTarget; + gBattlerByTurnOrder[3] = data[2]; + } + return TRUE; +} + +static u32 CalculateBattlerPartyCount(u32 battler) +{ + u32 count; + if (GetBattlerSide(battler) == B_SIDE_PLAYER) + count = CalculatePlayerPartyCount(); + else + count = CalculateEnemyPartyCount(); + return count; } static void Cmd_various(void) { - u8 side; + CMD_ARGS(u8 battler, u8 id); + + struct Pokemon *mon; s32 i; - u32 monToCheck, status; - u16 species; - u8 abilityNum; + u8 data[10]; + u32 side, battler, bits; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + if (gBattleControllerExecFlags) + return; - switch (gBattlescriptCurrInstr[2]) + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + + switch (cmd->id) { - case VARIOUS_CANCEL_MULTI_TURN_MOVES: - CancelMultiTurnMoves(gActiveBattler); + // Roar will fail in a double wild battle when used by the player against one of the two alive wild mons. + // Also when an opposing wild mon uses it againt its partner. + case VARIOUS_JUMP_IF_ROAR_FAILS: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (WILD_DOUBLE_BATTLE + && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER + && GetBattlerSide(gBattlerTarget) == B_SIDE_OPPONENT + && IS_WHOLE_SIDE_ALIVE(gBattlerTarget)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else if (WILD_DOUBLE_BATTLE + && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT + && GetBattlerSide(gBattlerTarget) == B_SIDE_OPPONENT) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_ABSENT: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (!IsBattlerAlive(battler)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (IsShieldsDownProtected(battler)) + { + gBattlerAbility = battler; + gBattlescriptCurrInstr = cmd->jumpInstr; + } + else + { + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_JUMP_IF_HOLD_EFFECT: + { + VARIOUS_ARGS(u8 holdEffect, const u8 *jumpInstr, u8 equal); + if ((GetBattlerHoldEffect(battler, TRUE) == cmd->holdEffect) == cmd->equal) + { + if (cmd->equal) + gLastUsedItem = gBattleMons[battler].item; // For B_LAST_USED_ITEM + gBattlescriptCurrInstr = cmd->jumpInstr; + } + else + { + if (!cmd->equal) + gLastUsedItem = gBattleMons[battler].item; // For B_LAST_USED_ITEM + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_JUMP_IF_NO_ALLY: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (!IsBattlerAlive(BATTLE_PARTNER(battler))) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_INFATUATE_WITH_BATTLER: + { + VARIOUS_ARGS(u8 infatuateWith); + gBattleScripting.battler = battler; + gBattleMons[battler].status2 |= STATUS2_INFATUATED_WITH(GetBattlerForBattleScript(cmd->infatuateWith)); + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_SET_LAST_USED_ITEM: + { + VARIOUS_ARGS(); + gLastUsedItem = gBattleMons[battler].item; break; + } + case VARIOUS_TRY_FAIRY_LOCK: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gFieldStatuses |= STATUS_FIELD_FAIRY_LOCK; + gFieldTimers.fairyLockTimer = 2; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_GET_STAT_VALUE: + { + VARIOUS_ARGS(u8 stat); + i = cmd->stat; + gBattleMoveDamage = *(u16 *)(&gBattleMons[battler].attack) + (i - 1); + gBattleMoveDamage *= gStatStageRatios[gBattleMons[battler].statStages[i]][0]; + gBattleMoveDamage /= gStatStageRatios[gBattleMons[battler].statStages[i]][1]; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_FULL_HP: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (BATTLER_MAX_HP(battler)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_FRISK: + { + VARIOUS_ARGS(); + while (gBattleStruct->friskedBattler < gBattlersCount) + { + gBattlerTarget = gBattleStruct->friskedBattler++; + if (GetBattlerSide(battler) != GetBattlerSide(gBattlerTarget) + && IsBattlerAlive(gBattlerTarget) + && gBattleMons[gBattlerTarget].item != ITEM_NONE) + { + gLastUsedItem = gBattleMons[gBattlerTarget].item; + RecordItemEffectBattle(gBattlerTarget, GetBattlerHoldEffect(gBattlerTarget, FALSE)); + BattleScriptPushCursor(); + // If Frisk identifies two mons' items, show the pop-up only once. + if (gBattleStruct->friskedAbility) + { + gBattlescriptCurrInstr = BattleScript_FriskMsg; + } + else + { + gBattleStruct->friskedAbility = TRUE; + gBattlescriptCurrInstr = BattleScript_FriskMsgWithPopup; + } + return; + } + } + gBattleStruct->friskedBattler = 0; + gBattleStruct->friskedAbility = FALSE; + break; + } + case VARIOUS_POISON_TYPE_IMMUNITY: + { + VARIOUS_ARGS(u8 target, const u8 *failInstr); + if (!CanPoisonType(battler, GetBattlerForBattleScript(cmd->target))) + gBattlescriptCurrInstr = cmd->failInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_PARALYZE_TYPE_IMMUNITY: + { + VARIOUS_ARGS(u8 target, const u8 *failInstr); + if (!CanParalyzeType(battler, GetBattlerForBattleScript(cmd->target))) + gBattlescriptCurrInstr = cmd->failInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRACE_ABILITY: + { + VARIOUS_ARGS(); + gBattleMons[battler].ability = gBattleStruct->overwrittenAbilities[battler] = gBattleStruct->tracedAbility[battler]; + break; + } + case VARIOUS_TRY_ILLUSION_OFF: + { + VARIOUS_ARGS(); + if (GetIllusionMonPtr(battler) != NULL) + { + gBattlescriptCurrInstr = cmd->nextInstr; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_IllusionOff; + return; + } + break; + } + case VARIOUS_SET_SPRITEIGNORE0HP: + { + VARIOUS_ARGS(bool8 ignore0HP); + gBattleStruct->spriteIgnore0Hp = cmd->ignore0HP; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_UPDATE_NICK: + { + VARIOUS_ARGS(); + if (GetBattlerSide(battler) == B_SIDE_PLAYER) + mon = &gPlayerParty[gBattlerPartyIndexes[battler]]; + else + mon = &gEnemyParty[gBattlerPartyIndexes[battler]]; + UpdateHealthboxAttribute(gHealthboxSpriteIds[battler], mon, HEALTHBOX_NICK); + break; + } + case VARIOUS_JUMP_IF_NOT_BERRY: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (ItemId_GetPocket(gBattleMons[battler].item) == POCKET_BERRY_POUCH) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->jumpInstr; + return; + } + case VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS: + { + VARIOUS_ARGS(const u8 *failInstr); + if ((gStatuses3[battler] & (STATUS3_SEMI_INVULNERABLE | STATUS3_HEAL_BLOCK)) + || BATTLER_MAX_HP(battler) + || !gBattleMons[battler].hp + || !(IsBattlerGrounded(battler))) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 16; + gBattleMoveDamage = gBattleMons[battler].maxHP / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_GRAVITY_ON_AIRBORNE_MONS: + { + VARIOUS_ARGS(); + // Cancel all multiturn moves of IN_AIR Pokemon except those being targeted by Sky Drop. + if (gStatuses3[battler] & STATUS3_ON_AIR && !(gStatuses3[battler] & STATUS3_SKY_DROPPED)) + CancelMultiTurnMoves(battler); + + gStatuses3[battler] &= ~(STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS | STATUS3_ON_AIR | STATUS3_SKY_DROPPED); + break; + } + case VARIOUS_SPECTRAL_THIEF: + { + VARIOUS_ARGS(); + // Raise stats + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleStruct->stolenStats[0] & gBitTable[i]) + { + gBattleStruct->stolenStats[0] &= ~(gBitTable[i]); + SET_STATCHANGER(i, gBattleStruct->stolenStats[i], FALSE); + if (ChangeStatBuffs(GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger), i, MOVE_EFFECT_CERTAIN | MOVE_EFFECT_AFFECTS_USER, NULL) == STAT_CHANGE_WORKED) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StatUpMsg; + return; + } + } + } + break; + } + case VARIOUS_SET_POWDER: + { + VARIOUS_ARGS(); + gBattleMons[battler].status2 |= STATUS2_POWDER; + break; + } + case VARIOUS_ACUPRESSURE: + { + VARIOUS_ARGS(const u8 *failInstr); + bits = 0; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (CompareStat(battler, i, MAX_STAT_STAGE, CMP_LESS_THAN)) + bits |= gBitTable[i]; + } + if (bits) + { + u32 statId; + do + { + statId = (Random() % (NUM_BATTLE_STATS - 1)) + 1; + } while (!(bits & gBitTable[statId])); + + SET_STATCHANGER(statId, 2, FALSE); + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_CANCEL_MULTI_TURN_MOVES: + { + VARIOUS_ARGS(); + const u8 *result; + result = CancelMultiTurnMoves(battler); + if (result) + { + gBattlescriptCurrInstr = result; + return; + } + break; + } case VARIOUS_SET_MAGIC_COAT_TARGET: + { + VARIOUS_ARGS(); + gBattleStruct->attackerBeforeBounce = battler; gBattlerAttacker = gBattlerTarget; - side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; - if (gSideTimers[side].followmeTimer != 0 && gBattleMons[gSideTimers[side].followmeTarget].hp != 0) + side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); + if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove)) gBattlerTarget = gSideTimers[side].followmeTarget; else - gBattlerTarget = gActiveBattler; + gBattlerTarget = battler; break; + } case VARIOUS_IS_RUNNING_IMPOSSIBLE: - gBattleCommunication[0] = IsRunningFromBattleImpossible(); + { + VARIOUS_ARGS(); + gBattleCommunication[0] = IsRunningFromBattleImpossible(battler); break; + } case VARIOUS_GET_MOVE_TARGET: + { + VARIOUS_ARGS(); gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); break; + } case VARIOUS_GET_BATTLER_FAINTED: - if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) + { + VARIOUS_ARGS(); + if (gHitMarker & HITMARKER_FAINTED(battler)) gBattleCommunication[0] = TRUE; else gBattleCommunication[0] = FALSE; break; - case VARIOUS_RESET_INTIMIDATE_TRACE_BITS: - gSpecialStatuses[gActiveBattler].intimidatedMon = 0; - gSpecialStatuses[gActiveBattler].traced = 0; + } + case VARIOUS_RESET_SWITCH_IN_ABILITY_BITS: + { + VARIOUS_ARGS(); + gSpecialStatuses[battler].traced = FALSE; + gSpecialStatuses[battler].switchInAbilityDone = FALSE; break; + } case VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP: + { + VARIOUS_ARGS(); if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId || gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId) { - u16 *choicedMove; - if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId) - gActiveBattler = 0; + battler = 0; else - gActiveBattler = 2; - - choicedMove = &gBattleStruct->choicedMove[gActiveBattler]; + battler = 2; for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gActiveBattler].moves[i] == *choicedMove) + if (gBattleMons[battler].moves[i] == gBattleStruct->choicedMove[battler]) break; } if (i == MAX_MON_MOVES) - *choicedMove = MOVE_NONE; + gBattleStruct->choicedMove[battler] = MOVE_NONE; } break; + } case VARIOUS_RESET_PLAYER_FAINTED: + { + VARIOUS_ARGS(); if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE)) && gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattleMons[0].hp != 0 @@ -6187,6 +9430,1611 @@ static void Cmd_various(void) gHitMarker &= ~HITMARKER_PLAYER_FAINTED; } break; + } + case VARIOUS_PALACE_FLAVOR_TEXT: // unused, from pokeemerald + case VARIOUS_ARENA_JUDGMENT_WINDOW: // unused, from pokeemerald + case VARIOUS_ARENA_OPPONENT_MON_LOST: // unused, from pokeemerald + case VARIOUS_ARENA_PLAYER_MON_LOST: // unused, from pokeemerald + case VARIOUS_ARENA_BOTH_MONS_LOST: // unused, from pokeemerald + case VARIOUS_EMIT_YESNOBOX: // unused, from pokeemerald + case VARIOUS_DRAW_ARENA_REF_TEXT_BOX: // unused, from pokeemerald + case VARIOUS_ERASE_ARENA_REF_TEXT_BOX: // unused, from pokeemerald + case VARIOUS_ARENA_JUDGMENT_STRING: // unused, from pokeemerald + case VARIOUS_ARENA_WAIT_STRING: // unused, from pokeemerald + { + VARIOUS_ARGS(); + break; + } + case VARIOUS_WAIT_CRY: + { + VARIOUS_ARGS(); + if (!IsCryFinished()) + return; + break; + } + case VARIOUS_RETURN_OPPONENT_MON1: + { + VARIOUS_ARGS(); + battler = gActiveBattler = 1; + if (gBattleMons[battler].hp != 0) + { + BtlController_EmitReturnMonToBall(BUFFER_A, FALSE); + MarkBattlerForControllerExec(battler); + } + break; + } + case VARIOUS_RETURN_OPPONENT_MON2: + { + VARIOUS_ARGS(); + if (gBattlersCount > 3) + { + battler = gActiveBattler = 3; + if (gBattleMons[battler].hp != 0) + { + BtlController_EmitReturnMonToBall(BUFFER_A, FALSE); + MarkBattlerForControllerExec(battler); + } + } + break; + } + case VARIOUS_VOLUME_DOWN: + { + VARIOUS_ARGS(); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x55); + break; + } + case VARIOUS_VOLUME_UP: + { + VARIOUS_ARGS(); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100); + break; + } + case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT: + { + VARIOUS_ARGS(); + gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[battler]; + break; + } + case VARIOUS_PALACE_TRY_ESCAPE_STATUS: // unused from pokeemerald + { + VARIOUS_ARGS(); + break; + } + case VARIOUS_SET_TELEPORT_OUTCOME: + { + VARIOUS_ARGS(); + // Don't end the battle if one of the wild mons teleported from the wild double battle + // and its partner is still alive. + if (GetBattlerSide(battler) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(battler))) + { + gAbsentBattlerFlags |= gBitTable[battler]; + gHitMarker |= HITMARKER_FAINTED(battler); + gBattleMons[battler].hp = 0; + SetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_HP, &gBattleMons[battler].hp); + SetHealthboxSpriteInvisible(gHealthboxSpriteIds[battler]); + FaintClearSetData(battler); + } + else if (GetBattlerSide(battler) == B_SIDE_PLAYER) + { + gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED; + } + else + { + gBattleOutcome = B_OUTCOME_MON_TELEPORTED; + } + break; + } + case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC: + { + VARIOUS_ARGS(); + BtlController_EmitPlayFanfareOrBGM(BUFFER_A, MUS_VICTORY_TRAINER, TRUE); + MarkBattlerForControllerExec(battler); + break; + } + case VARIOUS_STAT_TEXT_BUFFER: + { + VARIOUS_ARGS(); + PREPARE_STAT_BUFFER(gBattleTextBuff1, gBattleCommunication[0]); + break; + } + case VARIOUS_SWITCHIN_ABILITIES: + { + VARIOUS_ARGS(); + gBattlescriptCurrInstr = cmd->nextInstr; + AbilityBattleEffects(ABILITYEFFECT_NEUTRALIZINGGAS, battler, 0, 0, 0); + AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, battler, 0, 0, 0); + AbilityBattleEffects(ABILITYEFFECT_TRACE2, battler, 0, 0, 0); + AbilityBattleEffects(ABILITYEFFECT_OPPORTUNIST, battler, 0, 0, 0); + return; + } + case VARIOUS_SAVE_TARGET: + { + VARIOUS_ARGS(); + gBattleStruct->savedBattlerTarget = gBattlerTarget; + break; + } + case VARIOUS_RESTORE_TARGET: + { + VARIOUS_ARGS(); + gBattlerTarget = gBattleStruct->savedBattlerTarget; + break; + } + case VARIOUS_INSTANT_HP_DROP: + { + VARIOUS_ARGS(); + BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); + MarkBattlerForControllerExec(battler); + break; + } + case VARIOUS_CLEAR_STATUS: + { + VARIOUS_ARGS(); + gBattleMons[battler].status1 = 0; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + break; + } + case VARIOUS_RESTORE_PP: + { + VARIOUS_ARGS(); + for (i = 0; i < 4; i++) + { + gBattleMons[battler].pp[i] = CalculatePPWithBonus(gBattleMons[battler].moves[i], gBattleMons[battler].ppBonuses, i); + data[i] = gBattleMons[battler].pp[i]; + } + data[i] = gBattleMons[battler].ppBonuses; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_PP_DATA_BATTLE, 0, 5, data); + MarkBattlerForControllerExec(battler); + break; + } + case VARIOUS_TRY_ACTIVATE_MOXIE: // and chilling neigh + as one ice rider + { + VARIOUS_ARGS(); + + u16 battlerAbility = GetBattlerAbility(battler); + + if ((battlerAbility == ABILITY_MOXIE + || battlerAbility == ABILITY_CHILLING_NEIGH + || battlerAbility == ABILITY_AS_ONE_ICE_RIDER) + && HasAttackerFaintedTarget() + && !NoAliveMonsForEitherParty() + && CompareStat(gBattlerAttacker, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(STAT_ATK, 1, FALSE); + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK); + BattleScriptPush(cmd->nextInstr); + gLastUsedAbility = battlerAbility; + if (battlerAbility == ABILITY_AS_ONE_ICE_RIDER) + gBattleScripting.abilityPopupOverwrite = gLastUsedAbility = ABILITY_CHILLING_NEIGH; + gBattlescriptCurrInstr = BattleScript_RaiseStatOnFaintingTarget; + return; + } + break; + } + case VARIOUS_TRY_ACTIVATE_GRIM_NEIGH: // and as one shadow rider + { + VARIOUS_ARGS(); + + u16 battlerAbility = GetBattlerAbility(battler); + + if ((battlerAbility == ABILITY_GRIM_NEIGH + || battlerAbility == ABILITY_AS_ONE_SHADOW_RIDER) + && HasAttackerFaintedTarget() + && !NoAliveMonsForEitherParty() + && CompareStat(gBattlerAttacker, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(STAT_SPATK, 1, FALSE); + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK); + BattleScriptPush(cmd->nextInstr); + gLastUsedAbility = battlerAbility; + if (battlerAbility == ABILITY_AS_ONE_SHADOW_RIDER) + gBattleScripting.abilityPopupOverwrite = gLastUsedAbility = ABILITY_GRIM_NEIGH; + gBattlescriptCurrInstr = BattleScript_RaiseStatOnFaintingTarget; + return; + } + break; + } + case VARIOUS_TRY_ACTIVATE_RECEIVER: // Partner gets fainted's ally ability + { + VARIOUS_ARGS(); + gBattlerAbility = BATTLE_PARTNER(battler); + i = GetBattlerAbility(gBattlerAbility); + if (IsBattlerAlive(gBattlerAbility) + && (i == ABILITY_RECEIVER || i == ABILITY_POWER_OF_ALCHEMY) + && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_ABILITY_SHIELD + && !gAbilitiesInfo[gBattleMons[battler].ability].cantBeCopied) + { + gBattleStruct->tracedAbility[gBattlerAbility] = gBattleMons[battler].ability; // re-using the variable for trace + gBattleScripting.battler = battler; + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_ReceiverActivates; + return; + } + break; + } + case VARIOUS_TRY_ACTIVATE_BEAST_BOOST: + { + VARIOUS_ARGS(); + i = GetHighestStatId(battler); + if (GetBattlerAbility(battler) == ABILITY_BEAST_BOOST + && HasAttackerFaintedTarget() + && !NoAliveMonsForEitherParty() + && CompareStat(gBattlerAttacker, i, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(i, 1, FALSE); + PREPARE_STAT_BUFFER(gBattleTextBuff1, i); + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_AttackerAbilityStatRaise; + return; + } + break; + } + case VARIOUS_TRY_ACTIVATE_SOULHEART: + { + VARIOUS_ARGS(); + while (gBattleStruct->soulheartBattlerId < gBattlersCount) + { + gBattleScripting.battler = gBattleStruct->soulheartBattlerId++; + if (GetBattlerAbility(gBattleScripting.battler) == ABILITY_SOUL_HEART + && IsBattlerAlive(gBattleScripting.battler) + && !NoAliveMonsForEitherParty() + && CompareStat(gBattleScripting.battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(STAT_SPATK, 1, FALSE); + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ScriptingAbilityStatRaise; + return; + } + } + gBattleStruct->soulheartBattlerId = 0; + break; + } + case VARIOUS_TRY_ACTIVATE_FELL_STINGER: + { + VARIOUS_ARGS(); + if (gMovesInfo[gCurrentMove].effect == EFFECT_FELL_STINGER + && HasAttackerFaintedTarget() + && !NoAliveMonsForEitherParty() + && CompareStat(gBattlerAttacker, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(STAT_ATK, (B_FELL_STINGER_STAT_RAISE >= GEN_7 ? 3 : 2), FALSE); + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK); + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_FellStingerRaisesStat; + return; + } + break; + } + case VARIOUS_PLAY_MOVE_ANIMATION: + { + VARIOUS_ARGS(u16 move); + BtlController_EmitMoveAnimation(BUFFER_A, cmd->move, gBattleScripting.animTurn, 0, 0, gBattleMons[battler].friendship, &gDisableStructs[battler], gMultiHitCounter); + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_SET_LUCKY_CHANT: + { + VARIOUS_ARGS(const u8 *failInstr); + if (!(gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_LUCKY_CHANT)) + { + gSideStatuses[GetBattlerSide(battler)] |= SIDE_STATUS_LUCKY_CHANT; + gSideTimers[GetBattlerSide(battler)].luckyChantBattlerId = battler; + gSideTimers[GetBattlerSide(battler)].luckyChantTimer = 5; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_SUCKER_PUNCH_CHECK: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gProtectStructs[gBattlerTarget].obstructed) + gBattlescriptCurrInstr = cmd->failInstr; + else if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) + gBattlescriptCurrInstr = cmd->failInstr; + else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]])) + gBattlescriptCurrInstr = cmd->failInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_SET_SIMPLE_BEAM: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gAbilitiesInfo[gBattleMons[gBattlerTarget].ability].cantBeOverwritten + || gBattleMons[gBattlerTarget].ability == ABILITY_SIMPLE) + { + RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) + { + RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) + gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; + + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_SIMPLE; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_TRY_ENTRAINMENT: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gAbilitiesInfo[gBattleMons[gBattlerAttacker].ability].cantBeCopied + || gAbilitiesInfo[gBattleMons[gBattlerTarget].ability].cantBeOverwritten) + { + RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) + { + RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + if (gBattleMons[gBattlerTarget].ability == gBattleMons[gBattlerAttacker].ability + /* || IsDynamaxed(gBattlerTarget) */) // TODO: Dynamax + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gBattleMons[gBattlerAttacker].ability; + gBattlescriptCurrInstr = cmd->nextInstr; + } + } + return; + } + case VARIOUS_SET_LAST_USED_ABILITY: + { + VARIOUS_ARGS(); + gLastUsedAbility = gBattleMons[battler].ability; + break; + } + case VARIOUS_INVERT_STAT_STAGES: + { + VARIOUS_ARGS(); + for (i = 0; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battler].statStages[i] < DEFAULT_STAT_STAGE) // Negative becomes positive. + gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE + (DEFAULT_STAT_STAGE - gBattleMons[battler].statStages[i]); + else if (gBattleMons[battler].statStages[i] > DEFAULT_STAT_STAGE) // Positive becomes negative. + gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE - (gBattleMons[battler].statStages[i] - DEFAULT_STAT_STAGE); + } + break; + } + case VARIOUS_TRY_ME_FIRST: + { + VARIOUS_ARGS(const u8 *failInstr); + u16 move = gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]; + if (IS_MOVE_STATUS(move) || gMovesInfo[move].meFirstBanned + || GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) + gBattlescriptCurrInstr = cmd->failInstr; + else + { + gCalledMove = move; + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); + gStatuses3[gBattlerAttacker] |= STATUS3_ME_FIRST; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_JUMP_IF_BATTLE_END: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (NoAliveMonsForEitherParty()) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_ELECTRIFY: + { + VARIOUS_ARGS(const u8 *failInstr); + if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gStatuses4[gBattlerTarget] |= STATUS4_ELECTRIFIED; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_TRY_SOAK: + { + VARIOUS_ARGS(const u8 *failInstr); + if (GetBattlerType(gBattlerTarget, 0) == gMovesInfo[gCurrentMove].type + && GetBattlerType(gBattlerTarget, 1) == gMovesInfo[gCurrentMove].type) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + SET_BATTLER_TYPE(gBattlerTarget, gMovesInfo[gCurrentMove].type); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, gMovesInfo[gCurrentMove].type); + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_HANDLE_FORM_CHANGE: + { + VARIOUS_ARGS(u8 case_); + if (GetBattlerSide(battler) == B_SIDE_OPPONENT) + mon = &gEnemyParty[gBattlerPartyIndexes[battler]]; + else + mon = &gPlayerParty[gBattlerPartyIndexes[battler]]; + + // Change species. + if (cmd->case_ == 0) + { + /* What was the idea here? + if (!gBattleTextBuff1) + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[battler].species); + */ + BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[battler]], sizeof(gBattleMons[battler].species), &gBattleMons[battler].species); + MarkBattlerForControllerExec(battler); + } + // Change stats. + else if (cmd->case_ == 1) + { + RecalcBattlerStats(battler, mon); + } + // Update healthbox. + else + { + UpdateHealthboxAttribute(gHealthboxSpriteIds[battler], mon, HEALTHBOX_ALL); + } + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_LAST_RESORT: + { + VARIOUS_ARGS(const u8 *failInstr); + if (CanUseLastResort(battler)) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->failInstr; + return; + } + case VARIOUS_SET_ARG_TO_BATTLE_DAMAGE: + { + VARIOUS_ARGS(); + gBattleMoveDamage = gMovesInfo[gCurrentMove].argument; + break; + } + case VARIOUS_TRY_HIT_SWITCH_TARGET: + { + VARIOUS_ARGS(const u8 *failInstr); + if (IsBattlerAlive(gBattlerAttacker) + && IsBattlerAlive(gBattlerTarget) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && GetBattlerAbility(gBattlerTarget) != ABILITY_GUARD_DOG) + { + gBattleScripting.switchCase = B_SWITCH_HIT; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_TRY_AUTOTOMIZE: + { + VARIOUS_ARGS(const u8 *failInstr); + if (GetBattlerWeight(battler) > 1) + { + gDisableStructs[battler].autotomizeCount++; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_TRY_INSTRUCT: + { + VARIOUS_ARGS(const u8 *failInstr); + u16 move = gLastPrintedMoves[gBattlerTarget]; + if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || MoveHasAdditionalEffectSelf(move, MOVE_EFFECT_RECHARGE) + || gMovesInfo[move].instructBanned + || gBattleMoveEffects[gMovesInfo[move].effect].twoTurnEffect + /* || IsDynamaxed(gBattlerTarget) */) // TODO: Dynamax + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gSpecialStatuses[gBattlerTarget].instructedChosenTarget = *(gBattleStruct->moveTarget + gBattlerTarget) | 0x4; + gBattlerAttacker = gBattlerTarget; + gCalledMove = move; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gBattleMons[gBattlerAttacker].moves[i] == gCalledMove) + { + gCurrMovePos = i; + i = 4; + break; + } + } + if (i != 4 || gBattleMons[gBattlerAttacker].pp[gCurrMovePos] == 0) + gBattlescriptCurrInstr = cmd->failInstr; + else + { + gBattlerTarget = gBattleStruct->lastMoveTarget[gBattlerAttacker]; + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, battler, gBattlerPartyIndexes[battler]); + gBattlescriptCurrInstr = cmd->nextInstr; + } + } + return; + } + case VARIOUS_ABILITY_POPUP: + { + VARIOUS_ARGS(); + // TODO: Ability popup + // CreateAbilityPopUp(battler, gBattleMons[battler].ability, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0); + break; + } + case VARIOUS_UPDATE_ABILITY_POPUP: + { + VARIOUS_ARGS(); + // TODO: Ability popup + // UpdateAbilityPopup(battler); + break; + } + case VARIOUS_JUMP_IF_TARGET_ALLY: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->jumpInstr; + return; + } + case VARIOUS_TRY_SYNCHRONOISE: + { + VARIOUS_ARGS(const u8 *failInstr); + if (!DoBattlersShareType(gBattlerAttacker, gBattlerTarget)) + gBattlescriptCurrInstr = cmd->failInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_LOSE_TYPE: + { + VARIOUS_ARGS(u8 type); + RemoveBattlerType(battler, cmd->type); + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_PSYCHO_SHIFT: + { + VARIOUS_ARGS(const u8 *failInstr); + // Psycho shift works + if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_POISON) && CanBePoisoned(gBattlerAttacker, gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_TOXIC_POISON) && CanBePoisoned(gBattlerAttacker, gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 1; + else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_BURN) && CanBeBurned(gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 2; + else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && CanBeParalyzed(gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 3; + else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP) && CanSleep(gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 4; + else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE) && CanBeFrozen(gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 5; + else + { + gBattlescriptCurrInstr = cmd->failInstr; + return; + } + gBattleMons[gBattlerTarget].status1 = gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY; + battler = gActiveBattler = gBattlerTarget; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_CURE_STATUS: + { + VARIOUS_ARGS(); + gBattleMons[battler].status1 = 0; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + break; + } + case VARIOUS_POWER_TRICK: + { + VARIOUS_ARGS(); + gStatuses3[battler] ^= STATUS3_POWER_TRICK; + SWAP(gBattleMons[battler].attack, gBattleMons[battler].defense, i); + break; + } + case VARIOUS_AFTER_YOU: + { + VARIOUS_ARGS(const u8 *failInstr); + if (ChangeOrderTargetAfterAttacker()) + { + gSpecialStatuses[gBattlerTarget].afterYou = 1; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_BESTOW: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gBattleMons[gBattlerAttacker].item == ITEM_NONE + || gBattleMons[gBattlerTarget].item != ITEM_NONE + || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item) + || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item) + || gWishFutureKnock.knockedOffMons[GetBattlerSide(gBattlerTarget)] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + BestowItem(gBattlerAttacker, gBattlerTarget); + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_JUMP_IF_NOT_GROUNDED: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (!IsBattlerGrounded(battler)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_HANDLE_TRAINER_SLIDE_MSG: // unused for now + { + VARIOUS_ARGS(u8 case_); + // if (cmd->case_ == 0) + // { + // // Save sprite IDs, because trainer slide in will overwrite gBattlerSpriteIds variable. + // gBattleScripting.savedDmg = (gBattlerSpriteIds[battler] & 0xFF) | (gBattlerSpriteIds[BATTLE_PARTNER(battler)] << 8); + // HideBattlerShadowSprite(battler); + // } + // else if (cmd->case_ == 1) + // { + // BtlController_EmitPrintString(BUFFER_A, STRINGID_TRAINERSLIDE); + // MarkBattlerForControllerExec(battler); + // } + // else + // { + // gBattlerSpriteIds[BATTLE_PARTNER(battler)] = gBattleScripting.savedDmg >> 8; + // gBattlerSpriteIds[battler] = gBattleScripting.savedDmg & 0xFF; + // if (IsBattlerAlive(battler)) + // { + // SetBattlerShadowSpriteCallback(battler, gBattleMons[battler].species); + // BattleLoadMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battler]], battler); + // } + // i = BATTLE_PARTNER(battler); + // if (IsBattlerAlive(i)) + // { + // SetBattlerShadowSpriteCallback(i, gBattleMons[i].species); + // BattleLoadMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[i]], i); + // } + // } + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF: // unused for now + { + VARIOUS_ARGS(); + // if ((i = ShouldDoTrainerSlide(battler, TRAINER_SLIDE_FIRST_DOWN))) + // { + // gBattleScripting.battler = battler; + // BattleScriptPush(cmd->nextInstr); + // gBattlescriptCurrInstr = (i == 1 ? BattleScript_TrainerASlideMsgRet : BattleScript_TrainerBSlideMsgRet); + // return; + // } + break; + } + case VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON: // unused for now + { + VARIOUS_ARGS(); + // if ((i = ShouldDoTrainerSlide(battler, TRAINER_SLIDE_LAST_SWITCHIN))) + // { + // gBattleScripting.battler = battler; + // BattleScriptPush(cmd->nextInstr); + // gBattlescriptCurrInstr = (i == 1 ? BattleScript_TrainerASlideMsgRet : BattleScript_TrainerBSlideMsgRet); + // return; + // } + break; + } + case VARIOUS_SET_AURORA_VEIL: + { + VARIOUS_ARGS(); + if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_AURORA_VEIL + || !(WEATHER_HAS_EFFECT && gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW))) + { + gMoveResultFlags |= MOVE_RESULT_MISSED; + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + } + else + { + gSideStatuses[GetBattlerSide(battler)] |= SIDE_STATUS_AURORA_VEIL; + if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[GetBattlerSide(battler)].auroraVeilTimer = 8; + else + gSideTimers[GetBattlerSide(battler)].auroraVeilTimer = 5; + gSideTimers[GetBattlerSide(battler)].auroraVeilBattlerId = battler; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerAttacker) == 2) + gBattleCommunication[MULTISTRING_CHOOSER] = 5; + else + gBattleCommunication[MULTISTRING_CHOOSER] = 5; + } + break; + } + case VARIOUS_TRY_THIRD_TYPE: + { + VARIOUS_ARGS(const u8 *failInstr); + if (IS_BATTLER_OF_TYPE(battler, gMovesInfo[gCurrentMove].argument)) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gBattleMons[battler].type3 = gMovesInfo[gCurrentMove].argument; + PREPARE_TYPE_BUFFER(gBattleTextBuff1, gMovesInfo[gCurrentMove].argument); + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_DESTROY_ABILITY_POPUP: + { + VARIOUS_ARGS(); + // TODO: Ability popup + // DestroyAbilityPopUp(battler); + break; + } + case VARIOUS_TOTEM_BOOST: + { + VARIOUS_ARGS(const u8 *jumpInstr); + battler = gBattlerAttacker; + if (gQueuedStatBoosts[battler].stats == 0) + { + gBattlescriptCurrInstr = cmd->nextInstr; // stats done, exit + } + else + { + for (i = 0; i < (NUM_BATTLE_STATS - 1); i++) + { + if (gQueuedStatBoosts[battler].stats & (1 << i)) + { + if (gQueuedStatBoosts[battler].statChanges[i] <= -1) + SET_STATCHANGER(i + 1, abs(gQueuedStatBoosts[battler].statChanges[i]), TRUE); + else + SET_STATCHANGER(i + 1, gQueuedStatBoosts[battler].statChanges[i], FALSE); + + gQueuedStatBoosts[battler].stats &= ~(1 << i); + gBattleScripting.battler = battler; + gBattlerTarget = battler; + if (gQueuedStatBoosts[battler].stats & 0x80) + { + gQueuedStatBoosts[battler].stats &= ~0x80; // set 'aura flared to life' flag + gBattlescriptCurrInstr = BattleScript_TotemFlaredToLife; + } + else + { + gBattlescriptCurrInstr = cmd->jumpInstr; // do boost + } + return; + } + } + gBattlescriptCurrInstr = cmd->nextInstr; // exit if loop failed (failsafe) + } + return; + } + case VARIOUS_MOVEEND_ITEM_EFFECTS: + { + VARIOUS_ARGS(); + if (ItemBattleEffects(ITEMEFFECT_NORMAL, battler, FALSE)) + return; + break; + } + case VARIOUS_ROOM_SERVICE: + { + VARIOUS_ARGS(const u8 *failInstr); + if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_ROOM_SERVICE && TryRoomService(battler)) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryStatRaiseRet; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_TERRAIN_SEED: + { + VARIOUS_ARGS(const u8 *failInstr); + if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_SEEDS) + { + u8 effect = 0; + u16 item = gBattleMons[battler].item; + switch (GetBattlerHoldEffectParam(battler)) + { + case HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_ELECTRIC_TERRAIN, STAT_DEF, item, FALSE); + break; + case HOLD_EFFECT_PARAM_GRASSY_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_GRASSY_TERRAIN, STAT_DEF, item, FALSE); + break; + case HOLD_EFFECT_PARAM_MISTY_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_MISTY_TERRAIN, STAT_SPDEF, item, FALSE); + break; + case HOLD_EFFECT_PARAM_PSYCHIC_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_PSYCHIC_TERRAIN, STAT_SPDEF, item, FALSE); + break; + } + + if (effect) + return; + } + gBattlescriptCurrInstr = cmd->failInstr; + return; + } + case VARIOUS_MAKE_INVISIBLE: + { + VARIOUS_ARGS(); + if (gBattleControllerExecFlags) + break; + + BtlController_EmitSpriteInvisibility(BUFFER_A, TRUE); + MarkBattlerForControllerExec(battler); + break; + } + case VARIOUS_EERIE_SPELL_PP_REDUCE: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gLastMoves[battler] != 0 && gLastMoves[battler] != 0xFFFF) + { + s32 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gLastMoves[battler] == gBattleMons[battler].moves[i]) + break; + } + + if (i != MAX_MON_MOVES && gBattleMons[battler].pp[i] != 0) + { + s32 ppToDeduct = 3; + + if (gBattleMons[battler].pp[i] < ppToDeduct) + ppToDeduct = gBattleMons[battler].pp[i]; + + PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[battler]) + ConvertIntToDecimalStringN(gBattleTextBuff2, ppToDeduct, STR_CONV_MODE_LEFT_ALIGN, 1); + PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 1, ppToDeduct) + gBattleMons[battler].pp[i] -= ppToDeduct; + if (!(gDisableStructs[battler].mimickedMoves & gBitTable[i]) + && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) + { + BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[battler].pp[i]), &gBattleMons[battler].pp[i]); + MarkBattlerForControllerExec(battler); + } + + if (gBattleMons[battler].pp[i] == 0 && gBattleStruct->skyDropTargets[battler] == 0xFF) + CancelMultiTurnMoves(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; // continue + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; // cant reduce pp + } + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; // cant reduce pp + } + return; + } + case VARIOUS_JUMP_IF_TEAM_HEALTHY: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerAlive(BATTLE_PARTNER(battler))) + { + u8 partner = BATTLE_PARTNER(battler); + if ((gBattleMons[battler].hp == gBattleMons[battler].maxHP && !(gBattleMons[battler].status1 & STATUS1_ANY)) + && (gBattleMons[partner].hp == gBattleMons[partner].maxHP && !(gBattleMons[partner].status1 & STATUS1_ANY))) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + } + else // single battle + { + if (gBattleMons[battler].hp == gBattleMons[battler].maxHP && !(gBattleMons[battler].status1 & STATUS1_ANY)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_TRY_HEAL_QUARTER_HP: + { + VARIOUS_ARGS(const u8 *failInstr); + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 4; + gBattleMoveDamage = gBattleMons[battler].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + + if (gBattleMons[battler].hp == gBattleMons[battler].maxHP) + gBattlescriptCurrInstr = cmd->failInstr; // fail + else + gBattlescriptCurrInstr = cmd->nextInstr; // can heal + return; + } + case VARIOUS_REMOVE_TERRAIN: + { + VARIOUS_ARGS(); + RemoveAllTerrains(); + break; + } + case VARIOUS_JUMP_IF_UNDER_200: + { + VARIOUS_ARGS(const u8 *jumpInstr); + // If the Pokemon is less than 200 kg, or weighing less than 441 lbs, then Sky Drop will work. Otherwise, it will fail. + if (GetBattlerWeight(gBattlerTarget) < 2000) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_SET_SKY_DROP: + { + VARIOUS_ARGS(); + gStatuses3[gBattlerTarget] |= (STATUS3_SKY_DROPPED | STATUS3_ON_AIR); + /* skyDropTargets holds the information of who is in a particular instance of Sky Drop. + This is needed in the case that multiple Pokemon use Sky Drop in the same turn or if + the target of a Sky Drop faints while in the air.*/ + gBattleStruct->skyDropTargets[gBattlerAttacker] = gBattlerTarget; + gBattleStruct->skyDropTargets[gBattlerTarget] = gBattlerAttacker; + + // End any multiturn effects caused by the target except STATUS2_LOCK_CONFUSE + gBattleMons[gBattlerTarget].status2 &= ~(STATUS2_MULTIPLETURNS); + gBattleMons[gBattlerTarget].status2 &= ~(STATUS2_UPROAR); + gBattleMons[gBattlerTarget].status2 &= ~(STATUS2_BIDE); + gDisableStructs[gBattlerTarget].rolloutTimer = 0; + gDisableStructs[gBattlerTarget].furyCutterCounter = 0; + + // End any Follow Me/Rage Powder effects caused by the target + if (gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer != 0 && gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget == gBattlerTarget) + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 0; + + break; + } + case VARIOUS_CLEAR_SKY_DROP: + { + VARIOUS_ARGS(const u8 *failInstr); + // Check to see if the initial target of this Sky Drop fainted before the 2nd turn of Sky Drop. + // If so, make the move fail. If not, clear all of the statuses and continue the move. + if (gBattleStruct->skyDropTargets[gBattlerAttacker] == 0xFF) + gBattlescriptCurrInstr = cmd->failInstr; + else + { + gBattleStruct->skyDropTargets[gBattlerAttacker] = 0xFF; + gBattleStruct->skyDropTargets[gBattlerTarget] = 0xFF; + gStatuses3[gBattlerTarget] &= ~(STATUS3_SKY_DROPPED | STATUS3_ON_AIR); + gBattlescriptCurrInstr = cmd->nextInstr; + } + + // Confuse target if they were in the middle of Petal Dance/Outrage/Thrash when targeted. + if (gBattleMons[gBattlerTarget].status2 & STATUS2_LOCK_CONFUSE) + gBattleScripting.moveEffect = (MOVE_EFFECT_CONFUSION | MOVE_EFFECT_CERTAIN); + return; + } + case VARIOUS_SKY_DROP_YAWN: // If the mon that's sleeping due to Yawn was holding a Pokemon in Sky Drop, release the target and clear Sky Drop data. + { + VARIOUS_ARGS(); + if (gBattleStruct->skyDropTargets[gEffectBattler] != 0xFF && !(gStatuses3[gEffectBattler] & STATUS3_SKY_DROPPED)) + { + // Set the target of Sky Drop as gEffectBattler + gEffectBattler = gBattleStruct->skyDropTargets[gEffectBattler]; + + // Clear skyDropTargets data + gBattleStruct->skyDropTargets[gBattleStruct->skyDropTargets[gEffectBattler]] = 0xFF; + gBattleStruct->skyDropTargets[gEffectBattler] = 0xFF; + + // If the target was in the middle of Outrage/Thrash/etc. when targeted by Sky Drop, confuse them on release and do proper animation + if (gBattleMons[gEffectBattler].status2 & STATUS2_LOCK_CONFUSE && CanBeConfused(gEffectBattler)) + { + gBattleMons[gEffectBattler].status2 &= ~(STATUS2_LOCK_CONFUSE); + gBattlerAttacker = gEffectBattler; + gBattleMons[gBattlerTarget].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); + gBattlescriptCurrInstr = BattleScript_ThrashConfuses; + return; + } + } + break; + } + case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (BlocksPrankster(gCurrentMove, gBattlerAttacker, battler, TRUE)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER: + { + bool8 shouldNotClear = FALSE; + + for (i = 0; i < gBattlersCount; i++) + { + u32 ability = GetBattlerAbility(i); + if (((ability == ABILITY_DESOLATE_LAND && gBattleWeather & B_WEATHER_SUN_PRIMAL) + || (ability == ABILITY_PRIMORDIAL_SEA && gBattleWeather & B_WEATHER_RAIN_PRIMAL) + || (ability == ABILITY_DELTA_STREAM && gBattleWeather & B_WEATHER_STRONG_WINDS)) + && IsBattlerAlive(i)) + shouldNotClear = TRUE; + } + if (gBattleWeather & B_WEATHER_SUN_PRIMAL && !shouldNotClear) + { + gBattleWeather &= ~B_WEATHER_SUN_PRIMAL; + PrepareStringBattle(STRINGID_EXTREMESUNLIGHTFADED, battler); + gBattleCommunication[MSG_DISPLAY] = 1; + } + else if (gBattleWeather & B_WEATHER_RAIN_PRIMAL && !shouldNotClear) + { + gBattleWeather &= ~B_WEATHER_RAIN_PRIMAL; + PrepareStringBattle(STRINGID_HEAVYRAINLIFTED, battler); + gBattleCommunication[MSG_DISPLAY] = 1; + } + else if (gBattleWeather & B_WEATHER_STRONG_WINDS && !shouldNotClear) + { + gBattleWeather &= ~B_WEATHER_STRONG_WINDS; + PrepareStringBattle(STRINGID_STRONGWINDSDISSIPATED, battler); + gBattleCommunication[MSG_DISPLAY] = 1; + } + break; + } + case VARIOUS_TRY_END_NEUTRALIZING_GAS: + { + VARIOUS_ARGS(); + if (gSpecialStatuses[battler].neutralizingGasRemoved) + { + gSpecialStatuses[battler].neutralizingGasRemoved = FALSE; + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_NeutralizingGasExits; + return; + } + break; + } + case VARIOUS_GET_ROTOTILLER_TARGETS: + { + VARIOUS_ARGS(const u8 *failInstr); + // Gets the battlers to be affected by rototiller. If there are none, print 'But it failed!' + { + u32 count = 0; + for (i = 0; i < gBattlersCount; i++) + { + gSpecialStatuses[i].rototillerAffected = FALSE; + if (IsRototillerAffected(i)) + { + gSpecialStatuses[i].rototillerAffected = TRUE; + count++; + } + } + + if (count == 0) + gBattlescriptCurrInstr = cmd->failInstr; // Rototiller fails + else + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (gSpecialStatuses[battler].rototillerAffected) + { + gSpecialStatuses[battler].rototillerAffected = FALSE; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->jumpInstr; // Unaffected by rototiller - print STRINGID_NOEFFECTONTARGET + } + return; + } + // TODO: Convert this to a proper FORM_CHANGE type. + case VARIOUS_TRY_ACTIVATE_BATTLE_BOND: + { + VARIOUS_ARGS(); + if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND + && HasAttackerFaintedTarget() + && CalculateBattlerPartyCount(gBattlerTarget) > 1 + && !(gBattleStruct->battleBondTransformed[GetBattlerSide(gBattlerAttacker)] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) + { + gBattleStruct->battleBondTransformed[GetBattlerSide(gBattlerAttacker)] |= gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]; + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species); + gBattleStruct->changedSpecies[GetBattlerSide(gBattlerAttacker)][gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species; + gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker; + return; + } + break; + } + case VARIOUS_CONSUME_BERRY: + { + VARIOUS_ARGS(bool8 fromBattler); + if (gBattleScripting.overrideBerryRequirements == 2) + { + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + + if (cmd->fromBattler) + gLastUsedItem = gBattleMons[battler].item; + + gBattleStruct->ateBerry[battler & BIT_SIDE] |= gBitTable[gBattlerPartyIndexes[battler]]; + gBattleScripting.battler = gEffectBattler = gBattlerTarget = battler; // Cover all berry effect battler cases. e.g. ChangeStatBuffs uses target ID + if (ItemBattleEffects(ITEMEFFECT_USE_LAST_ITEM, battler, FALSE)) + return; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (GetBattleFormChangeTargetSpecies(battler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) == SPECIES_NONE) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_WEATHER_AFFECTED: + { + VARIOUS_ARGS(u32 flags, const u8 *jumpInstr); + u32 flags = cmd->flags; + if (IsBattlerWeatherAffected(battler, flags)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_SPECIES: + { + VARIOUS_ARGS(u16 species, const u8 *jumpInstr); + if (gBattleMons[battler].species == cmd->species) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment + { + VARIOUS_ARGS(); + + u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; + u32 targetDefStat = gBattleMons[gBattlerTarget].defense; + u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; + u32 targetSpDefStat = gBattleMons[gBattlerTarget].spDefense; + u8 statStage; + u32 physical; + u32 special; + + gBattleStruct->swapDamageCategory = FALSE; + + statStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; + attackerAtkStat *= gStatStageRatios[statStage][0]; + attackerAtkStat /= gStatStageRatios[statStage][1]; + + statStage = gBattleMons[gBattlerTarget].statStages[STAT_DEF]; + targetDefStat *= gStatStageRatios[statStage][0]; + targetDefStat /= gStatStageRatios[statStage][1]; + + physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gMovesInfo[gCurrentMove].power * attackerAtkStat) / targetDefStat) / 50); + + statStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; + attackerSpAtkStat *= gStatStageRatios[statStage][0]; + attackerSpAtkStat /= gStatStageRatios[statStage][1]; + + statStage = gBattleMons[gBattlerTarget].statStages[STAT_SPDEF]; + targetSpDefStat *= gStatStageRatios[statStage][0]; + targetSpDefStat /= gStatStageRatios[statStage][1]; + + special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gMovesInfo[gCurrentMove].power * attackerSpAtkStat) / targetSpDefStat) / 50); + + if (((physical > special) || (physical == special && (Random() % 2) == 0))) + gBattleStruct->swapDamageCategory = TRUE; + break; + } + case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (IsLeafGuardProtected(battler)) + { + gBattlerAbility = battler; + gBattlescriptCurrInstr = cmd->jumpInstr; + } + else + { + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_SET_ATTACKER_STICKY_WEB_USER: + { + VARIOUS_ARGS(); + // For Mirror Armor: "If the Pokémon with this Ability is affected by Sticky Web, the effect is reflected back to the Pokémon which set it up. + // If Pokémon which set up Sticky Web is not on the field, no Pokémon have their Speed lowered." + gBattlerAttacker = gBattlerTarget; // Initialize 'fail' condition + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + if (gSideTimers[GetBattlerSide(battler)].stickyWebBattlerId != 0xFF) + gBattlerAttacker = gSideTimers[GetBattlerSide(battler)].stickyWebBattlerId; + break; + } + case VARIOUS_CUT_1_3_HP_RAISE_STATS: + { + VARIOUS_ARGS(const u8 *failInstr); + + bool8 atLeastOneStatBoosted = FALSE; + // TODO: Dynamax + // u16 hpFraction = max(1, GetNonDynamaxMaxHP(gBattlerAttacker) / 3); + u16 hpFraction = max(1, gBattleMons[gBattlerAttacker].maxHP / 3); + + for (i = 1; i < NUM_STATS; i++) + { + if (CompareStat(gBattlerAttacker, i, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + atLeastOneStatBoosted = TRUE; + break; + } + } + if (atLeastOneStatBoosted && gBattleMons[gBattlerAttacker].hp > hpFraction) + { + gBattleMoveDamage = hpFraction; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_CHECK_POLTERGEIST: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gBattleMons[battler].item == ITEM_NONE + || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM + || GetBattlerAbility(battler) == ABILITY_KLUTZ) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[battler].item); + gLastUsedItem = gBattleMons[battler].item; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_TRY_NO_RETREAT: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gDisableStructs[battler].noRetreat) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + if (!(gBattleMons[battler].status2 & STATUS2_ESCAPE_PREVENTION)) + gDisableStructs[battler].noRetreat = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_TRY_TAR_SHOT: + { + VARIOUS_ARGS(const u8 *failInstr); + if (gDisableStructs[battler].tarShot) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gDisableStructs[battler].tarShot = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_CAN_TAR_SHOT_WORK: + { + VARIOUS_ARGS(const u8 *failInstr); + // Tar Shot will fail if it's already been used on the target and its speed can't be lowered further + if (!gDisableStructs[battler].tarShot + && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->failInstr; + return; + } + case VARIOUS_CURE_CERTAIN_STATUSES: + { + VARIOUS_ARGS(); + // Check infatuation + if (gBattleMons[battler].status2 & STATUS2_INFATUATION) + { + gBattleMons[battler].status2 &= ~(STATUS2_INFATUATION); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_INFATUATION; // STRINGID_TARGETGOTOVERINFATUATION + StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); + } + // Check taunt + if (gDisableStructs[battler].tauntTimer != 0) + { + gDisableStructs[battler].tauntTimer = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_TAUNT; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT); + } + // Check encore + if (gDisableStructs[battler].encoreTimer != 0) + { + gDisableStructs[battler].encoredMove = 0; + gDisableStructs[battler].encoreTimer = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_ENCORE; // STRINGID_PKMNENCOREENDED + } + // Check torment + if (gBattleMons[battler].status2 & STATUS2_TORMENT) + { + gBattleMons[battler].status2 &= ~(STATUS2_TORMENT); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_TORMENT; + } + // Check heal block + if (gStatuses3[battler] & STATUS3_HEAL_BLOCK) + { + gStatuses3[battler] &= ~(STATUS3_HEAL_BLOCK); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_HEALBLOCK; + } + // Check disable + if (gDisableStructs[battler].disableTimer != 0) + { + gDisableStructs[battler].disableTimer = 0; + gDisableStructs[battler].disabledMove = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_DISABLE; + } + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES: + { + VARIOUS_ARGS(); + battler = gBattlerTarget; + for (i = 0; i < NUM_BATTLE_STATS; i++) + if (gBattleMons[battler].statStages[i] < DEFAULT_STAT_STAGE) + gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (ItemId_GetPocket(gLastUsedItem) == POCKET_BERRY_POUCH) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT: + { + VARIOUS_ARGS(u8 holdEffect, const u8 *jumpInstr); + if (ItemId_GetHoldEffect(gLastUsedItem) == cmd->holdEffect) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_SAVE_BATTLER_ITEM: + { + VARIOUS_ARGS(); + gBattleResources->battleHistory->heldItems[battler] = gBattleMons[battler].item; + break; + } + case VARIOUS_RESTORE_BATTLER_ITEM: + { + VARIOUS_ARGS(); + gBattleMons[battler].item = gBattleResources->battleHistory->heldItems[battler]; + break; + } + case VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM: + { + VARIOUS_ARGS(); + gBattleMons[battler].item = gLastUsedItem; + break; + } + case VARIOUS_SET_BEAK_BLAST: + { + VARIOUS_ARGS(); + gProtectStructs[battler].beakBlastCharge = TRUE; + break; + } + case VARIOUS_SWAP_SIDE_STATUSES: + { + VARIOUS_ARGS(); + CourtChangeSwapSideStatuses(); + break; + } + case VARIOUS_SWAP_STATS: + { + VARIOUS_ARGS(u8 stat); + + u8 stat = cmd->stat; + u16 temp; + + switch (stat) + { + case STAT_HP: + SWAP(gBattleMons[gBattlerAttacker].hp, gBattleMons[gBattlerTarget].hp, temp); + break; + case STAT_ATK: + SWAP(gBattleMons[gBattlerAttacker].attack, gBattleMons[gBattlerTarget].attack, temp); + break; + case STAT_DEF: + SWAP(gBattleMons[gBattlerAttacker].defense, gBattleMons[gBattlerTarget].defense, temp); + break; + case STAT_SPEED: + SWAP(gBattleMons[gBattlerAttacker].speed, gBattleMons[gBattlerTarget].speed, temp); + break; + case STAT_SPATK: + SWAP(gBattleMons[gBattlerAttacker].spAttack, gBattleMons[gBattlerTarget].spAttack, temp); + break; + case STAT_SPDEF: + SWAP(gBattleMons[gBattlerAttacker].spDefense, gBattleMons[gBattlerTarget].spDefense, temp); + break; + } + PREPARE_STAT_BUFFER(gBattleTextBuff1, stat); + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TEATIME_TARGETS: + { + VARIOUS_ARGS(const u8 *jumpInstr); + u32 count = 0; + + for (i = 0; i < gBattlersCount; i++) + { + if (IsTeatimeAffected(i)) + count++; + } + if (count == 0) + gBattlescriptCurrInstr = cmd->jumpInstr; // Teatime fails + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TEATIME_INVUL: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (ItemId_GetPocket(gBattleMons[battler].item) == POCKET_BERRY_POUCH && !(gStatuses3[gBattlerTarget] & (STATUS3_SEMI_INVULNERABLE))) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->jumpInstr; + return; + } + case VARIOUS_TRY_WIND_RIDER_POWER: + { + VARIOUS_ARGS(const u8 *failInstr); + u16 ability = GetBattlerAbility(battler); + if (GetBattlerSide(battler) == GetBattlerSide(gBattlerAttacker) + && (ability == ABILITY_WIND_RIDER || ability == ABILITY_WIND_POWER)) + { + gLastUsedAbility = ability; + RecordAbilityBattle(battler, gLastUsedAbility); + gBattlerAbility = gBattleScripting.battler = battler; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } + return; + } + case VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES: + { + VARIOUS_ARGS(); + gBattlescriptCurrInstr = cmd->nextInstr; + AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, battler, 0, 0, 0); + return; + } + case VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES: + { + VARIOUS_ARGS(); + gBattlescriptCurrInstr = cmd->nextInstr; + AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, battler, 0, 0, 0); + return; + } + case VARIOUS_STORE_HEALING_WISH: + { + VARIOUS_ARGS(); + if (gCurrentMove == MOVE_LUNAR_DANCE) + gBattleStruct->storedLunarDance |= gBitTable[battler]; + else + gBattleStruct->storedHealingWish |= gBitTable[battler]; + break; + } + case VARIOUS_HIT_SWITCH_TARGET_FAILED: + { + VARIOUS_ARGS(); + gBattleStruct->hitSwitchTargetFailed = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + case VARIOUS_TRY_REVIVAL_BLESSING: + { + VARIOUS_ARGS(const u8 *failInstr); + u32 side = GetBattlerSide(gBattlerAttacker); + u8 index = GetFirstFaintedPartyIndex(gBattlerAttacker); + + // Move fails if there are no battlers to revive. + if (index == PARTY_SIZE) + { + gBattlescriptCurrInstr = cmd->failInstr; + return; + } + + // Battler selected! Revive and go to next instruction. + gActiveBattler = gBattlerAttacker; + if (gSelectedMonPartyId != PARTY_SIZE) + { + struct Pokemon *party = GetSideParty(side); + + u16 hp = GetMonData(&party[gSelectedMonPartyId], MON_DATA_MAX_HP) / 2; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, gBitTable[gSelectedMonPartyId], sizeof(hp), &hp); + MarkBattlerForControllerExec(gBattlerAttacker); + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&party[gSelectedMonPartyId], MON_DATA_SPECIES)); + + // If an on-field battler is revived, it needs to be sent out again. + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && + gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerAttacker)] == gSelectedMonPartyId) + { + gBattleScripting.battler = BATTLE_PARTNER(gBattlerAttacker); + gBattleCommunication[MULTIUSE_STATE] = TRUE; + } + + gSelectedMonPartyId = PARTY_SIZE; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + // Open party menu, wait to go to next instruction. + else + { + BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CHOOSE_FAINTED_MON, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); + } + return; + } case VARIOUS_GET_BATTLERS_FOR_RECALL: i = 0; // redundant gBattleCommunication[MULTISTRING_CHOOSER] = 0; @@ -6198,28 +11046,12 @@ static void Cmd_various(void) i++; } break; - case VARIOUS_RETURN_OPPONENT_MON1: - gActiveBattler = 1; - if (gBattleMons[gActiveBattler].hp != 0) - { - BtlController_EmitReturnMonToBall(BUFFER_A, FALSE); - MarkBattlerForControllerExec(gActiveBattler); - } - break; - case VARIOUS_RETURN_OPPONENT_MON2: - if (gBattlersCount > 3) - { - gActiveBattler = 3; - if (gBattleMons[gActiveBattler].hp != 0) - { - BtlController_EmitReturnMonToBall(BUFFER_A, FALSE); - MarkBattlerForControllerExec(gActiveBattler); - } - } - break; case VARIOUS_CHECK_POKEFLUTE: + { + u32 status, monToCheck = 0; + u16 species = SPECIES_NONE; + u8 abilityNum; gBattleCommunication[MULTISTRING_CHOOSER] = 0; - monToCheck = 0; for (i = 0; i < gBattlersCount; i++) { if (gBattleMons[i].ability != ABILITY_SOUNDPROOF) @@ -6270,170 +11102,249 @@ static void Cmd_various(void) gBattleCommunication[5] = 1; } break; + } case VARIOUS_WAIT_FANFARE: if (!IsFanfareTaskInactive()) return; break; - case VARIOUS_PLAY_MOVE_ANIMATION: - { - VARIOUS_ARGS(u16 move); - BtlController_EmitMoveAnimation(BUFFER_A, cmd->move, gBattleScripting.animTurn, 0, 0, gBattleMons[gActiveBattler].friendship, &gDisableStructs[gActiveBattler]); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr = cmd->nextInstr; - return; - } - } + } // End of switch (cmd->id) - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void TryResetProtectUseCounter(u32 battler) +{ + u32 lastMove = gLastResultingMoves[battler]; + if (lastMove == MOVE_UNAVAILABLE + || (!gBattleMoveEffects[gMovesInfo[lastMove].effect].usesProtectCounter + && (B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && gMovesInfo[lastMove].effect != EFFECT_ALLY_SWITCH))) + gDisableStructs[battler].protectUses = 0; } // Protect and Endure static void Cmd_setprotectlike(void) { - bool8 notLastTurn = TRUE; - u16 lastMove = gLastResultingMoves[gBattlerAttacker]; + CMD_ARGS(); - if (lastMove != MOVE_PROTECT && lastMove != MOVE_DETECT && lastMove != MOVE_ENDURE) - gDisableStructs[gBattlerAttacker].protectUses = 0; + bool32 fail = TRUE; + bool32 notLastTurn = TRUE; + TryResetProtectUseCounter(gBattlerAttacker); if (gCurrentTurnActionNumber == (gBattlersCount - 1)) notLastTurn = FALSE; - if (sProtectSuccessRates[gDisableStructs[gBattlerAttacker].protectUses] >= Random() && notLastTurn) + if ((sProtectSuccessRates[gDisableStructs[gBattlerAttacker].protectUses] >= Random() && notLastTurn) + || (gCurrentMove == MOVE_WIDE_GUARD && B_WIDE_GUARD != GEN_5) + || (gCurrentMove == MOVE_QUICK_GUARD && B_QUICK_GUARD != GEN_5)) { - if (gBattleMoves[gCurrentMove].effect == EFFECT_PROTECT) + if (!gMovesInfo[gCurrentMove].argument) // Protects one mon only. { - gProtectStructs[gBattlerAttacker].protected = 1; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + if (gMovesInfo[gCurrentMove].effect == EFFECT_ENDURE) + { + gProtectStructs[gBattlerAttacker].endured = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; + } + else if (gCurrentMove == MOVE_DETECT || gCurrentMove == MOVE_PROTECT) + { + gProtectStructs[gBattlerAttacker].protected = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_SPIKY_SHIELD) + { + gProtectStructs[gBattlerAttacker].spikyShielded = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_KINGS_SHIELD) + { + gProtectStructs[gBattlerAttacker].kingsShielded = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_BANEFUL_BUNKER) + { + gProtectStructs[gBattlerAttacker].banefulBunkered = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_OBSTRUCT) + { + gProtectStructs[gBattlerAttacker].obstructed = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_MAX_GUARD) + { + gProtectStructs[gBattlerAttacker].maxGuarded = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_SILK_TRAP) + { + gProtectStructs[gBattlerAttacker].silkTrapped = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + else if (gCurrentMove == MOVE_BURNING_BULWARK) + { + gProtectStructs[gBattlerAttacker].burningBulwarked = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; + } + + gDisableStructs[gBattlerAttacker].protectUses++; + fail = FALSE; } - if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE) + else // Protects the whole side. { - gProtectStructs[gBattlerAttacker].endured = 1; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; + u8 side = GetBattlerSide(gBattlerAttacker); + if (gCurrentMove == MOVE_WIDE_GUARD && !(gSideStatuses[side] & SIDE_STATUS_WIDE_GUARD)) + { + gSideStatuses[side] |= SIDE_STATUS_WIDE_GUARD; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_TEAM; + gDisableStructs[gBattlerAttacker].protectUses++; + fail = FALSE; + } + else if (gCurrentMove == MOVE_QUICK_GUARD && !(gSideStatuses[side] & SIDE_STATUS_QUICK_GUARD)) + { + gSideStatuses[side] |= SIDE_STATUS_QUICK_GUARD; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_TEAM; + gDisableStructs[gBattlerAttacker].protectUses++; + fail = FALSE; + } + else if (gCurrentMove == MOVE_CRAFTY_SHIELD && !(gSideStatuses[side] & SIDE_STATUS_CRAFTY_SHIELD)) + { + gSideStatuses[side] |= SIDE_STATUS_CRAFTY_SHIELD; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_TEAM; + gDisableStructs[gBattlerAttacker].protectUses++; + fail = FALSE; + } + else if (gCurrentMove == MOVE_MAT_BLOCK && !(gSideStatuses[side] & SIDE_STATUS_MAT_BLOCK)) + { + gSideStatuses[side] |= SIDE_STATUS_MAT_BLOCK; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_TEAM; + fail = FALSE; + } } - gDisableStructs[gBattlerAttacker].protectUses++; } - else + + if (fail) { gDisableStructs[gBattlerAttacker].protectUses = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECT_FAILED; gMoveResultFlags |= MOVE_RESULT_MISSED; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryexplosion(void) { + CMD_ARGS(); + + u32 dampBattler; if (gBattleControllerExecFlags) return; - // Explosion can only fail if any battler has Damp - for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) - { - if (gBattleMons[gBattlerTarget].ability == ABILITY_DAMP) - break; - } - - if (gBattlerTarget == gBattlersCount) - { - // Success, no battlers with Damp. Drop user's HP bar to 0 - gActiveBattler = gBattlerAttacker; - gBattleMoveDamage = gBattleMons[gActiveBattler].hp; - BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr++; - - // Find first target - for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) - { - if (gBattlerTarget == gBattlerAttacker) - continue; - if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) - break; - } - } - else + if ((dampBattler = IsAbilityOnField(ABILITY_DAMP))) { // Failed, a battler has Damp gLastUsedAbility = ABILITY_DAMP; - RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + gBattlerTarget = --dampBattler; gBattlescriptCurrInstr = BattleScript_DampStopsExplosion; + return; } + + gActiveBattler = gBattlerAttacker; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp; + BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); + MarkBattlerForControllerExec(gBattlerAttacker); + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setatkhptozero(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; gActiveBattler = gBattlerAttacker; - gBattleMons[gActiveBattler].hp = 0; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp); - MarkBattlerForControllerExec(gActiveBattler); + gBattleMons[gBattlerAttacker].hp = 0; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].hp), &gBattleMons[gBattlerAttacker].hp); + MarkBattlerForControllerExec(gBattlerAttacker); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifnexttargetvalid(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *jumpInstr); - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + const u8 *jumpInstr = cmd->jumpInstr; + + for (gBattlerTarget++; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - for (gBattlerTarget++; ; gBattlerTarget++) - { - if (gBattlerTarget == gBattlerAttacker) - continue; - if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) - break; - } - - if (gBattlerTarget >= gBattlersCount) - gBattlescriptCurrInstr += 5; - else - gBattlescriptCurrInstr = jumpPtr; + if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) + continue; + if (IsBattlerAlive(gBattlerTarget)) + break; } + + if (gBattlerTarget >= gBattlersCount) + gBattlescriptCurrInstr = cmd->nextInstr; else - { - gBattlescriptCurrInstr += 5; - } + gBattlescriptCurrInstr = jumpInstr; } static void Cmd_tryhealhalfhealth(void) { - const u8 *failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr, u8 battler); - if (gBattlescriptCurrInstr[5] == BS_ATTACKER) + const u8 *failInstr = cmd->failInstr; + + if (cmd->battler == BS_ATTACKER) gBattlerTarget = gBattlerAttacker; + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerTarget) / 2; gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) - gBattlescriptCurrInstr = failPtr; + gBattlescriptCurrInstr = failInstr; else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void SetMoveForMirrorMove(u32 move) +{ + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + // Edge case, we used Z Mirror Move, got the stat boost and now need to use the Z-move + if (FALSE /* gBattleStruct->zmove.toBeUsed[gBattlerAttacker] && !IS_MOVE_STATUS(move) */) // TODO: Z-Moves + { + // TODO: Z-Moves + // gCurrentMove = gBattleStruct->zmove.chosenZMove = GetTypeBasedZMove(move, gBattlerAttacker); + // QueueZMove(gBattlerAttacker, move); + } + else + { + gCurrentMove = move; + } + + SetAtkCancellerForCalledMove(); + gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); } static void Cmd_trymirrormove(void) { - s32 validMovesCount; - s32 i; - u16 move; - u16 validMoves[MAX_BATTLERS_COUNT - 1]; + CMD_ARGS(); - for (i = 0; i < (MAX_BATTLERS_COUNT - 1); i++) // -1 to exclude the user - validMoves[i] = MOVE_NONE; + s32 i, validMovesCount; + u16 move; + u16 validMoves[MAX_BATTLERS_COUNT] = {0}; for (validMovesCount = 0, i = 0; i < gBattlersCount; i++) { if (i != gBattlerAttacker) { - move = T1_READ_16(i * 2 + gBattlerAttacker * 8 + gBattleStruct->lastTakenMoveFrom); - + move = gBattleStruct->lastTakenMoveFrom[gBattlerAttacker][i]; if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { validMoves[validMovesCount] = move; @@ -6442,70 +11353,67 @@ static void Cmd_trymirrormove(void) } } - move = T1_READ_16(gBattleStruct->lastTakenMove + gBattlerAttacker * 2); - move++;move--; // why? - + move = gBattleStruct->lastTakenMove[gBattlerAttacker]; if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { - gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCurrentMove = move; - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + SetMoveForMirrorMove(move); } else if (validMovesCount != 0) { - gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - i = Random() % validMovesCount; - gCurrentMove = validMoves[i]; - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + SetMoveForMirrorMove(validMoves[Random() % validMovesCount]); } else // no valid moves found { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setrain(void) { - if (gBattleWeather & B_WEATHER_RAIN) + CMD_ARGS(); + + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_RAIN, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = B_WEATHER_RAIN_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_RAIN; - gWishFutureKnock.weatherDuration = 5; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setreflect(void) { - if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT) + CMD_ARGS(); + + if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_REFLECT) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED; } else { - gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_REFLECT; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectTimer = 5; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker; + gSideStatuses[GetBattlerSide(gBattlerAttacker)] |= SIDE_STATUS_REFLECT; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[GetBattlerSide(gBattlerAttacker)].reflectTimer = 8; + else + gSideTimers[GetBattlerSide(gBattlerAttacker)].reflectTimer = 5; + gSideTimers[GetBattlerSide(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerAttacker) == 2) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_DOUBLE; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_SINGLE; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setseeded(void) { + CMD_ARGS(); + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -6523,40 +11431,98 @@ static void Cmd_setseeded(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_SET; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_manipulatedamage(void) { - switch (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 mode); + + switch (cmd->mode) { case DMG_CHANGE_SIGN: gBattleMoveDamage *= -1; break; case DMG_RECOIL_FROM_MISS: - gBattleMoveDamage /= 2; + if (B_RECOIL_IF_MISS_DMG >= GEN_5) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 2; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + } + else if (B_RECOIL_IF_MISS_DMG == GEN_4) + { + if ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerTarget) / 2; + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; + } + } + else + { + gBattleMoveDamage /= 2; + } if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - if ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage) - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; break; case DMG_DOUBLED: gBattleMoveDamage *= 2; break; + case DMG_1_8_TARGET_HP: + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerTarget) / 8; + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + break; + case DMG_FULL_ATTACKER_HP: + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker); + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP; + break; + case DMG_CURR_ATTACKER_HP: + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxHP(gBattlerAttacker); + gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp; + break; + case DMG_BIG_ROOT: + gBattleMoveDamage = GetDrainedBigRootHp(gBattlerAttacker, gBattleMoveDamage); + break; + case DMG_1_2_ATTACKER_HP: + // TODO: Dynamax + // gBattleMoveDamage = (GetNonDynamaxMaxHP(gBattlerAttacker) + 1) / 2; // Half of Max HP Rounded UP + gBattleMoveDamage = (gBattleMons[gBattlerAttacker].maxHP + 1) / 2; // Half of Max HP Rounded UP + break; + case DMG_RECOIL_FROM_IMMUNE: + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerTarget) / 2; + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; + break; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetrest(void) { - const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr); + + const u8 *failInstr = cmd->failInstr; gActiveBattler = gBattlerTarget = gBattlerAttacker; gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP * (-1); if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) { - gBattlescriptCurrInstr = failJump; + gBattlescriptCurrInstr = failInstr; + } + else if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_ELECTRIC_TERRAIN)) + { + gBattlescriptCurrInstr = BattleScript_ElectricTerrainPrevents; + } + else if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_MISTY_TERRAIN)) + { + gBattlescriptCurrInstr = BattleScript_MistyTerrainPrevents; } else { @@ -6566,34 +11532,46 @@ static void Cmd_trysetrest(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST; gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3); - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1); + MarkBattlerForControllerExec(gBattlerTarget); + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifnotfirstturn(void) { - const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *jumpInstr); + + const u8 *jumpInstr = cmd->jumpInstr; if (gDisableStructs[gBattlerAttacker].isFirstTurn) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = failJump; + gBattlescriptCurrInstr = jumpInstr; } -static void Cmd_nop(void) +static void Cmd_setmiracleeye(void) { - gBattlescriptCurrInstr++; + CMD_ARGS(const u8 *failInstr); + + if (!(gStatuses3[gBattlerTarget] & STATUS3_MIRACLE_EYED)) + { + gStatuses3[gBattlerTarget] |= STATUS3_MIRACLE_EYED; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; + } } -bool8 UproarWakeUpCheck(u8 battlerId) +bool8 UproarWakeUpCheck(u8 battler) { s32 i; for (i = 0; i < gBattlersCount; i++) { - if (!(gBattleMons[i].status2 & STATUS2_UPROAR) || gBattleMons[battlerId].ability == ABILITY_SOUNDPROOF) + if (!(gBattleMons[i].status2 & STATUS2_UPROAR) || (GetBattlerAbility(battler) == ABILITY_SOUNDPROOF && B_UPROAR_IGNORE_SOUNDPROOF < GEN_5)) continue; gBattleScripting.battler = i; @@ -6614,220 +11592,367 @@ bool8 UproarWakeUpCheck(u8 battlerId) return TRUE; } -static void Cmd_jumpifcantmakeasleep(void) +static void Cmd_jumpifuproarwakes(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *jumpInstr); if (UproarWakeUpCheck(gBattlerTarget)) - { - gBattlescriptCurrInstr = jumpPtr; - } - else if (gBattleMons[gBattlerTarget].ability == ABILITY_INSOMNIA - || gBattleMons[gBattlerTarget].ability == ABILITY_VITAL_SPIRIT) - { - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAYED_AWAKE_USING; - gBattlescriptCurrInstr = jumpPtr; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } + gBattlescriptCurrInstr = cmd->jumpInstr; else - { - gBattlescriptCurrInstr += 5; - } + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_stockpile(void) { - if (gDisableStructs[gBattlerAttacker].stockpileCounter == 3) - { - gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_STOCKPILE; - } - else - { - gDisableStructs[gBattlerAttacker].stockpileCounter++; + CMD_ARGS(u8 id); - PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gBattlerAttacker].stockpileCounter) - - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STOCKPILED; + switch (cmd->id) + { + case 0: + if (gDisableStructs[gBattlerAttacker].stockpileCounter >= 3) + { + gMoveResultFlags |= MOVE_RESULT_MISSED; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_STOCKPILE; + } + else + { + gDisableStructs[gBattlerAttacker].stockpileCounter++; + gDisableStructs[gBattlerAttacker].stockpileBeforeDef = gBattleMons[gBattlerAttacker].statStages[STAT_DEF]; + gDisableStructs[gBattlerAttacker].stockpileBeforeSpDef = gBattleMons[gBattlerAttacker].statStages[STAT_SPDEF]; + PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gBattlerAttacker].stockpileCounter); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STOCKPILED; + } + break; + case 1: // Save def/sp def stats. + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + gDisableStructs[gBattlerAttacker].stockpileDef += gBattleMons[gBattlerAttacker].statStages[STAT_DEF] - gDisableStructs[gBattlerAttacker].stockpileBeforeDef; + gDisableStructs[gBattlerAttacker].stockpileSpDef += gBattleMons[gBattlerAttacker].statStages[STAT_SPDEF] - gDisableStructs[gBattlerAttacker].stockpileBeforeSpDef; + } + break; } - gBattlescriptCurrInstr++; + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_stockpiletobasedamage(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr); + + const u8 *failInstr = cmd->failInstr; if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; } else { if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) - { - gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, - gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0, - 0, gBattlerAttacker, gBattlerTarget) - * gDisableStructs[gBattlerAttacker].stockpileCounter; gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; - if (gProtectStructs[gBattlerAttacker].helpingHand) - gBattleMoveDamage = gBattleMoveDamage * 15 / 10; + if (!(gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT && gBattleMons[gBattlerTarget].hp != 0)) + { + gBattleStruct->moveEffect2 = MOVE_EFFECT_STOCKPILE_WORE_OFF; } - - gDisableStructs[gBattlerAttacker].stockpileCounter = 0; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_stockpiletohpheal(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr); + + const u8 *failInstr = cmd->failInstr; if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED; } - else if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp) - { - gDisableStructs[gBattlerAttacker].stockpileCounter = 0; - gBattlescriptCurrInstr = jumpPtr; - gBattlerTarget = gBattlerAttacker; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FULL_HP; - } else { - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); + if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp) + { + gDisableStructs[gBattlerAttacker].stockpileCounter = 0; + gBattlescriptCurrInstr = failInstr; + gBattlerTarget = gBattlerAttacker; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FULL_HP; + } + else + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - gBattleMoveDamage *= -1; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; - gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; - gDisableStructs[gBattlerAttacker].stockpileCounter = 0; - gBattlescriptCurrInstr += 5; - gBattlerTarget = gBattlerAttacker; + gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; + gBattleStruct->moveEffect2 = MOVE_EFFECT_STOCKPILE_WORE_OFF; + gBattlescriptCurrInstr = cmd->nextInstr; + gBattlerTarget = gBattlerAttacker; + } } } -static void Cmd_negativedamage(void) +// Sign change for drained HP handled in GetDrainedBigRootHp +static void Cmd_setdrainedhp(void) { - gBattleMoveDamage = -(gHpDealt / 2); + CMD_ARGS(); + + if (gMovesInfo[gCurrentMove].argument != 0) + gBattleMoveDamage = (gHpDealt * gMovesInfo[gCurrentMove].argument / 100); + else + gBattleMoveDamage = (gHpDealt / 2); + if (gBattleMoveDamage == 0) - gBattleMoveDamage = -1; + gBattleMoveDamage = 1; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } -#define STAT_CHANGE_WORKED 0 -#define STAT_CHANGE_DIDNT_WORK 1 - -static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) +static u16 ReverseStatChangeMoveEffect(u16 moveEffect) { - bool8 certain = FALSE; - bool8 notProtectAffected = FALSE; - u32 index; + switch (moveEffect) + { + // +1 + case MOVE_EFFECT_ATK_PLUS_1: + return MOVE_EFFECT_ATK_MINUS_1; + case MOVE_EFFECT_DEF_PLUS_1: + return MOVE_EFFECT_DEF_MINUS_1; + case MOVE_EFFECT_SPD_PLUS_1: + return MOVE_EFFECT_SPD_MINUS_1; + case MOVE_EFFECT_SP_ATK_PLUS_1: + return MOVE_EFFECT_SP_ATK_MINUS_1; + case MOVE_EFFECT_SP_DEF_PLUS_1: + return MOVE_EFFECT_SP_DEF_MINUS_1; + case MOVE_EFFECT_ACC_PLUS_1: + return MOVE_EFFECT_ACC_MINUS_1; + case MOVE_EFFECT_EVS_PLUS_1: + return MOVE_EFFECT_EVS_MINUS_1; + // -1 + case MOVE_EFFECT_ATK_MINUS_1: + return MOVE_EFFECT_ATK_PLUS_1; + case MOVE_EFFECT_DEF_MINUS_1: + return MOVE_EFFECT_DEF_PLUS_1; + case MOVE_EFFECT_SPD_MINUS_1: + return MOVE_EFFECT_SPD_PLUS_1; + case MOVE_EFFECT_SP_ATK_MINUS_1: + return MOVE_EFFECT_SP_ATK_PLUS_1; + case MOVE_EFFECT_SP_DEF_MINUS_1: + return MOVE_EFFECT_SP_DEF_PLUS_1; + case MOVE_EFFECT_ACC_MINUS_1: + return MOVE_EFFECT_ACC_PLUS_1; + case MOVE_EFFECT_EVS_MINUS_1: + // +2 + case MOVE_EFFECT_ATK_PLUS_2: + return MOVE_EFFECT_ATK_MINUS_2; + case MOVE_EFFECT_DEF_PLUS_2: + return MOVE_EFFECT_DEF_MINUS_2; + case MOVE_EFFECT_SPD_PLUS_2: + return MOVE_EFFECT_SPD_MINUS_2; + case MOVE_EFFECT_SP_ATK_PLUS_2: + return MOVE_EFFECT_SP_ATK_MINUS_2; + case MOVE_EFFECT_SP_DEF_PLUS_2: + return MOVE_EFFECT_SP_DEF_MINUS_2; + case MOVE_EFFECT_ACC_PLUS_2: + return MOVE_EFFECT_ACC_MINUS_2; + case MOVE_EFFECT_EVS_PLUS_2: + return MOVE_EFFECT_EVS_MINUS_2; + // -2 + case MOVE_EFFECT_ATK_MINUS_2: + return MOVE_EFFECT_ATK_PLUS_2; + case MOVE_EFFECT_DEF_MINUS_2: + return MOVE_EFFECT_DEF_PLUS_2; + case MOVE_EFFECT_SPD_MINUS_2: + return MOVE_EFFECT_SPD_PLUS_2; + case MOVE_EFFECT_SP_ATK_MINUS_2: + return MOVE_EFFECT_SP_ATK_PLUS_2; + case MOVE_EFFECT_SP_DEF_MINUS_2: + return MOVE_EFFECT_SP_DEF_PLUS_2; + case MOVE_EFFECT_ACC_MINUS_2: + return MOVE_EFFECT_ACC_PLUS_2; + case MOVE_EFFECT_EVS_MINUS_2: + return MOVE_EFFECT_EVS_PLUS_2; + default: + return 0; + } +} - if (flags & MOVE_EFFECT_AFFECTS_USER) - gActiveBattler = gBattlerAttacker; +static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr) +{ + bool32 certain = FALSE; + bool32 notProtectAffected = FALSE; + u32 index, battler, battlerAbility, battlerHoldEffect; + bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER); + bool32 mirrorArmored = (flags & STAT_CHANGE_MIRROR_ARMOR); + + if (affectsUser) + battler = gBattlerAttacker; else - gActiveBattler = gBattlerTarget; + battler = gBattlerTarget; + gActiveBattler = battler; - flags &= ~MOVE_EFFECT_AFFECTS_USER; + battlerAbility = GetBattlerAbility(battler); + battlerHoldEffect = GetBattlerHoldEffect(battler, TRUE); + + gSpecialStatuses[battler].changedStatsBattlerId = gBattlerAttacker; + + flags &= ~(MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR); if (flags & MOVE_EFFECT_CERTAIN) - certain++; + certain = TRUE; flags &= ~MOVE_EFFECT_CERTAIN; if (flags & STAT_CHANGE_NOT_PROTECT_AFFECTED) notProtectAffected++; flags &= ~STAT_CHANGE_NOT_PROTECT_AFFECTED; - PREPARE_STAT_BUFFER(gBattleTextBuff1, statId) + if (battlerAbility == ABILITY_CONTRARY) + { + statValue ^= STAT_BUFF_NEGATIVE; + gBattleScripting.statChanger ^= STAT_BUFF_NEGATIVE; + RecordAbilityBattle(battler, battlerAbility); + if (flags & STAT_CHANGE_UPDATE_MOVE_EFFECT) + { + flags &= ~STAT_CHANGE_UPDATE_MOVE_EFFECT; + gBattleScripting.moveEffect = ReverseStatChangeMoveEffect(gBattleScripting.moveEffect); + } + } + else if (battlerAbility == ABILITY_SIMPLE) + { + statValue = (SET_STAT_BUFF_VALUE(GET_STAT_BUFF_VALUE(statValue) * 2)) | ((statValue <= -1) ? STAT_BUFF_NEGATIVE : 0); + } + + PREPARE_STAT_BUFFER(gBattleTextBuff1, statId); if (statValue <= -1) // Stat decrease. { - if (gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].mistTimer - && !certain && gCurrentMove != MOVE_CURSE) + if (gSideTimers[GetBattlerSide(battler)].mistTimer + && !certain && gCurrentMove != MOVE_CURSE + && !(battler == gBattlerTarget && GetBattlerAbility(gBattlerAttacker) == ABILITY_INFILTRATOR)) { if (flags == STAT_CHANGE_ALLOW_PTR) { - if (gSpecialStatuses[gActiveBattler].statLowered) + if (gSpecialStatuses[battler].statLowered) { gBattlescriptCurrInstr = BS_ptr; } else { BattleScriptPush(BS_ptr); - gBattleScripting.battler = gActiveBattler; + gBattleScripting.battler = battler; gBattlescriptCurrInstr = BattleScript_MistProtected; - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[battler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; } else if (gCurrentMove != MOVE_CURSE - && notProtectAffected != TRUE && JumpIfMoveAffectedByProtect(0)) + && notProtectAffected != TRUE && JumpIfMoveAffectedByProtect(gCurrentMove)) { gBattlescriptCurrInstr = BattleScript_ButItFailed; return STAT_CHANGE_DIDNT_WORK; } - else if ((gBattleMons[gActiveBattler].ability == ABILITY_CLEAR_BODY - || gBattleMons[gActiveBattler].ability == ABILITY_WHITE_SMOKE) - && !certain && gCurrentMove != MOVE_CURSE) + else if ((battlerHoldEffect == HOLD_EFFECT_CLEAR_AMULET + || CanAbilityPreventStatLoss(battlerAbility, GetBattlerAbility(gBattlerAttacker) == ABILITY_INTIMIDATE)) + && (!affectsUser || mirrorArmored) && !certain && gCurrentMove != MOVE_CURSE) { if (flags == STAT_CHANGE_ALLOW_PTR) { - if (gSpecialStatuses[gActiveBattler].statLowered) + if (gSpecialStatuses[battler].statLowered) { gBattlescriptCurrInstr = BS_ptr; } else { BattleScriptPush(BS_ptr); - gBattleScripting.battler = gActiveBattler; - gBattlescriptCurrInstr = BattleScript_AbilityNoStatLoss; - gLastUsedAbility = gBattleMons[gActiveBattler].ability; - RecordAbilityBattle(gActiveBattler, gLastUsedAbility); - gSpecialStatuses[gActiveBattler].statLowered = 1; + gBattleScripting.battler = battler; + if (battlerHoldEffect == HOLD_EFFECT_CLEAR_AMULET) + { + gLastUsedItem = gBattleMons[battler].item; + gBattlescriptCurrInstr = BattleScript_ItemNoStatLoss; + RecordItemEffectBattle(battler, HOLD_EFFECT_CLEAR_AMULET); + } + else + { + gBattlerAbility = battler; + gBattlescriptCurrInstr = BattleScript_AbilityNoStatLoss; + gLastUsedAbility = battlerAbility; + RecordAbilityBattle(battler, gLastUsedAbility); + } + gSpecialStatuses[battler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; } - else if (gBattleMons[gActiveBattler].ability == ABILITY_KEEN_EYE - && !certain && statId == STAT_ACC) + else if ((index = IsFlowerVeilProtected(battler)) && !certain) + { + if (flags == STAT_CHANGE_ALLOW_PTR) + { + if (gSpecialStatuses[battler].statLowered) + { + gBattlescriptCurrInstr = BS_ptr; + } + else + { + BattleScriptPush(BS_ptr); + gBattleScripting.battler = battler; + gBattlerAbility = index - 1; + gBattlescriptCurrInstr = BattleScript_FlowerVeilProtectsRet; + gLastUsedAbility = ABILITY_FLOWER_VEIL; + gSpecialStatuses[battler].statLowered = TRUE; + } + } + return STAT_CHANGE_DIDNT_WORK; + } + else if (!certain + && (((battlerAbility == ABILITY_KEEN_EYE || battlerAbility == ABILITY_MINDS_EYE) && statId == STAT_ACC) + || (B_ILLUMINATE_EFFECT >= GEN_9 && battlerAbility == ABILITY_ILLUMINATE && statId == STAT_ACC) + || (battlerAbility == ABILITY_HYPER_CUTTER && statId == STAT_ATK) + || (battlerAbility == ABILITY_BIG_PECKS && statId == STAT_DEF))) { if (flags == STAT_CHANGE_ALLOW_PTR) { BattleScriptPush(BS_ptr); - gBattleScripting.battler = gActiveBattler; + gBattleScripting.battler = battler; + gBattlerAbility = battler; gBattlescriptCurrInstr = BattleScript_AbilityNoSpecificStatLoss; - gLastUsedAbility = gBattleMons[gActiveBattler].ability; - RecordAbilityBattle(gActiveBattler, gLastUsedAbility); + gLastUsedAbility = battlerAbility; + RecordAbilityBattle(battler, gLastUsedAbility); } return STAT_CHANGE_DIDNT_WORK; } - else if (gBattleMons[gActiveBattler].ability == ABILITY_HYPER_CUTTER - && !certain && statId == STAT_ATK) + else if (battlerAbility == ABILITY_MIRROR_ARMOR && !affectsUser && !mirrorArmored && gBattlerAttacker != gBattlerTarget && battler == gBattlerTarget) { if (flags == STAT_CHANGE_ALLOW_PTR) { + SET_STATCHANGER(statId, GET_STAT_BUFF_VALUE(statValue) | STAT_BUFF_NEGATIVE, TRUE); BattleScriptPush(BS_ptr); - gBattleScripting.battler = gActiveBattler; - gBattlescriptCurrInstr = BattleScript_AbilityNoSpecificStatLoss; - gLastUsedAbility = gBattleMons[gActiveBattler].ability; - RecordAbilityBattle(gActiveBattler, gLastUsedAbility); + gBattleScripting.battler = battler; + gBattlerAbility = battler; + gBattlescriptCurrInstr = BattleScript_MirrorArmorReflect; + RecordAbilityBattle(battler, gBattleMons[battler].ability); } return STAT_CHANGE_DIDNT_WORK; } - else if (gBattleMons[gActiveBattler].ability == ABILITY_SHIELD_DUST && flags == 0) + else if (battlerAbility == ABILITY_SHIELD_DUST && flags == 0) { + RecordAbilityBattle(battler, ABILITY_SHIELD_DUST); + return STAT_CHANGE_DIDNT_WORK; + } + else if (flags == 0 && battlerHoldEffect == HOLD_EFFECT_COVERT_CLOAK) + { + RecordItemEffectBattle(battler, HOLD_EFFECT_COVERT_CLOAK); return STAT_CHANGE_DIDNT_WORK; } else // try to decrease { statValue = -GET_STAT_BUFF_VALUE(statValue); + if (gBattleMons[battler].statStages[statId] == 1) + statValue = -1; + else if (gBattleMons[battler].statStages[statId] == 2 && statValue < -2) + statValue = -2; gBattleTextBuff2[0] = B_BUFF_PLACEHOLDER_BEGIN; index = 1; if (statValue == -2) @@ -6837,20 +11962,36 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[3] = STRINGID_STATHARSHLY >> 8; index = 4; } + else if (statValue <= -3) + { + gBattleTextBuff2[1] = B_BUFF_STRING; + gBattleTextBuff2[2] = STRINGID_SEVERELY & 0xFF; + gBattleTextBuff2[3] = STRINGID_SEVERELY >> 8; + index = 4; + } gBattleTextBuff2[index++] = B_BUFF_STRING; gBattleTextBuff2[index++] = STRINGID_STATFELL; gBattleTextBuff2[index++] = STRINGID_STATFELL >> 8; gBattleTextBuff2[index] = B_BUFF_EOS; - if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE) + if (gBattleMons[battler].statStages[statId] == MIN_STAT_STAGE) + { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_DECREASE; + } else - gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL + { + gProtectStructs[battler].statFell = TRUE; // Eject pack, lash out + gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == battler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL + } } } else // stat increase { statValue = GET_STAT_BUFF_VALUE(statValue); + if (gBattleMons[battler].statStages[statId] == 11) + statValue = 1; + else if (gBattleMons[battler].statStages[statId] == 10 && statValue > 2) + statValue = 2; gBattleTextBuff2[0] = B_BUFF_PLACEHOLDER_BEGIN; index = 1; if (statValue == 2) @@ -6860,22 +12001,55 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[3] = STRINGID_STATSHARPLY >> 8; index = 4; } + else if (statValue >= 3) + { + gBattleTextBuff2[1] = B_BUFF_STRING; + gBattleTextBuff2[2] = STRINGID_DRASTICALLY & 0xFF; + gBattleTextBuff2[3] = STRINGID_DRASTICALLY >> 8; + index = 4; + } gBattleTextBuff2[index++] = B_BUFF_STRING; gBattleTextBuff2[index++] = STRINGID_STATROSE; gBattleTextBuff2[index++] = STRINGID_STATROSE >> 8; gBattleTextBuff2[index] = B_BUFF_EOS; - if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE) + if (gBattleMons[battler].statStages[statId] == MAX_STAT_STAGE) + { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_INCREASE; + } else - gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_ROSE or B_MSG_DEFENDER_STAT_ROSE + { + gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == battler); + gProtectStructs[battler].statRaised = TRUE; + + // check mirror herb + for (index = 0; index < gBattlersCount; index++) + { + if (GetBattlerSide(index) == GetBattlerSide(battler)) + continue; // Only triggers on opposing side + if (GetBattlerAbility(index) == ABILITY_OPPORTUNIST + && gProtectStructs[battler].activateOpportunist == 0) // don't activate opportunist on other mon's opportunist raises + { + gProtectStructs[index].activateOpportunist = 2; // set stats to copy + gQueuedStatBoosts[index].stats |= (1 << (statId - 1)); // -1 to start at atk + gQueuedStatBoosts[index].statChanges[statId - 1] += statValue; // cumulative in case of multiple opponent boosts + } + else if (GetBattlerHoldEffect(index, TRUE) == HOLD_EFFECT_MIRROR_HERB + && gBattleMons[index].statStages[statId] < MAX_STAT_STAGE) + { + gProtectStructs[index].eatMirrorHerb = 1; + gQueuedStatBoosts[index].stats |= (1 << (statId - 1)); // -1 to start at atk + gQueuedStatBoosts[index].statChanges[statId - 1] = statValue; + } + } + } } - gBattleMons[gActiveBattler].statStages[statId] += statValue; - if (gBattleMons[gActiveBattler].statStages[statId] < MIN_STAT_STAGE) - gBattleMons[gActiveBattler].statStages[statId] = MIN_STAT_STAGE; - if (gBattleMons[gActiveBattler].statStages[statId] > MAX_STAT_STAGE) - gBattleMons[gActiveBattler].statStages[statId] = MAX_STAT_STAGE; + gBattleMons[battler].statStages[statId] += statValue; + if (gBattleMons[battler].statStages[statId] < MIN_STAT_STAGE) + gBattleMons[battler].statStages[statId] = MIN_STAT_STAGE; + if (gBattleMons[battler].statStages[statId] > MAX_STAT_STAGE) + gBattleMons[battler].statStages[statId] = MAX_STAT_STAGE; if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && flags & STAT_CHANGE_ALLOW_PTR) gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -6888,232 +12062,339 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) static void Cmd_statbuffchange(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); - if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_CHANGE_WORKED) - gBattlescriptCurrInstr += 6; + CMD_ARGS(u16 flags, const u8 *failInstr); + + u16 flags = cmd->flags; + const u8 *ptrBefore = gBattlescriptCurrInstr; + const u8 *failInstr = cmd->failInstr; + + if (ChangeStatBuffs(GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger), GET_STAT_BUFF_ID(gBattleScripting.statChanger), flags, failInstr) == STAT_CHANGE_WORKED) + gBattlescriptCurrInstr = cmd->nextInstr; + else if (gBattlescriptCurrInstr == ptrBefore) // Prevent infinite looping. + gBattlescriptCurrInstr = failInstr; +} + +bool32 TryResetBattlerStatChanges(u8 battler) +{ + u32 j; + bool32 ret = FALSE; + + gDisableStructs[battler].stockpileDef = 0; + gDisableStructs[battler].stockpileSpDef = 0; + for (j = 0; j < NUM_BATTLE_STATS; j++) + { + if (gBattleMons[battler].statStages[j] != DEFAULT_STAT_STAGE) + ret = TRUE; // returns TRUE if any stat was reset + + gBattleMons[battler].statStages[j] = DEFAULT_STAT_STAGE; + } + + return ret; } // Haze static void Cmd_normalisebuffs(void) { - s32 i, j; + CMD_ARGS(); + + s32 i; for (i = 0; i < gBattlersCount; i++) - { - for (j = 0; j < NUM_BATTLE_STATS; j++) - gBattleMons[i].statStages[j] = DEFAULT_STAT_STAGE; - } + TryResetBattlerStatChanges(i); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setbide(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gBattlerAttacker] = gCurrentMove; - gTakenDmg[gBattlerAttacker] = 0; + gBideDmg[gBattlerAttacker] = 0; gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_confuseifrepeatingattackends(void) +static void Cmd_twoturnmoveschargestringandanimation(void) { - if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE)) - gBattleCommunication[MOVE_EFFECT_BYTE] = (MOVE_EFFECT_THRASH | MOVE_EFFECT_AFFECTS_USER); + CMD_ARGS(const u8 *animationThenStringPtr); - gBattlescriptCurrInstr++; + gBattleScripting.savedStringId = LOHALF(gMovesInfo[gCurrentMove].argument); + if (B_UPDATED_MOVE_DATA < GEN_5 || MoveHasChargeTurnAdditionalEffect(gCurrentMove)) + gBattlescriptCurrInstr = cmd->animationThenStringPtr; + else + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setmultihitcounter(void) { - if (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 value); + + if (cmd->value) { - gMultiHitCounter = gBattlescriptCurrInstr[1]; + gMultiHitCounter = cmd->value; } else { - gMultiHitCounter = Random() & 3; - if (gMultiHitCounter > 1) - gMultiHitCounter = (Random() & 3) + 2; + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK) + { + gMultiHitCounter = 5; + } else - gMultiHitCounter += 2; + { + // WARNING: These seem to be unused, see SetRandomMultiHitCounter. + if (B_MULTI_HIT_CHANCE >= GEN_5) + // 35%: 2 hits, 35%: 3 hits, 15% 4 hits, 15% 5 hits. + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 7, 7, 3, 3); + else + // 37.5%: 2 hits, 37.5%: 3 hits, 12.5% 4 hits, 12.5% 5 hits. + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 3, 3, 1, 1); + } } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_initmultihitstring(void) { + CMD_ARGS(); + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } -static bool8 TryDoForceSwitchOut(void) -{ - if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) - { - *(gBattleStruct->battlerPartyIndexes + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget]; - } - else - { - u16 random = Random() & 0xFF; - if ((u32)((random * (gBattleMons[gBattlerAttacker].level + gBattleMons[gBattlerTarget].level) >> 8) + 1) <= (gBattleMons[gBattlerTarget].level / 4)) - { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - return FALSE; - } - *(gBattleStruct->battlerPartyIndexes + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget]; - } - - gBattlescriptCurrInstr = BattleScript_SuccessForceOut; - return TRUE; -} - -#define MON_CAN_BATTLE(mon) (((GetMonData(mon, MON_DATA_SPECIES) && GetMonData(mon, MON_DATA_IS_EGG) != TRUE && GetMonData(mon, MON_DATA_HP)))) - static void Cmd_forcerandomswitch(void) { - if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + CMD_ARGS(const u8 *failInstr); + + s32 i; + s32 battler1PartyId = 0; + s32 battler2PartyId = 0; + + s32 firstMonId; + s32 lastMonId = 0; // + 1 + struct Pokemon *party = NULL; + u8 validMons[PARTY_SIZE]; + s32 validMonsCount = 0; + + bool32 redCardForcedSwitch = FALSE; + + // Red card checks against wild pokemon. If we have reached here, the player has a mon to switch into + // Red card swaps attacker with target to get the animation correct, so here we check attacker which is really the target. Thanks GF... + if (gBattleScripting.switchCase == B_SWITCH_RED_CARD + && !(gBattleTypeFlags & BATTLE_TYPE_TRAINER) + && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT) // Check opponent's red card activating { - u8 i; - struct Pokemon *party; - u8 valid; - u8 val; - - if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) - party = gPlayerParty; - else - party = gEnemyParty; - - if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + if (!WILD_DOUBLE_BATTLE) { - valid = 0; - val = 0; - if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1) - val = PARTY_SIZE / 2; - for (i = val; i < val + (PARTY_SIZE / 2); i++) - { - if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE - && !GetMonData(&party[i], MON_DATA_IS_EGG) - && GetMonData(&party[i], MON_DATA_HP) != 0) - ++valid; - } + // Wild mon with red card will end single battle + gBattlescriptCurrInstr = BattleScript_RoarSuccessEndBattle; + return; } else { - valid = 0; - for (i = 0; i < PARTY_SIZE; i++) + // Wild double battle, wild mon red card activation on player + if (IS_WHOLE_SIDE_ALIVE(gBattlerTarget)) { - if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE - && !GetMonData(&party[i], MON_DATA_IS_EGG) - && GetMonData(&party[i], MON_DATA_HP) != 0) - ++valid; - } - } - - // Fails if there's only 1 mon left in single battle or there's less than 3 left in non-multi double battle. - if ((valid < 2 && (gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI)) != BATTLE_TYPE_DOUBLE) - || (valid < 3 && (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))) - { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - } - else if (TryDoForceSwitchOut()) - { - if (gBattleTypeFlags & BATTLE_TYPE_MULTI) - { - do - { - val = Random() % (PARTY_SIZE / 2); - if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1) - i = val + (PARTY_SIZE / 2); - else - i = val; - } - while (i == gBattlerPartyIndexes[gBattlerTarget] - || i == gBattlerPartyIndexes[gBattlerTarget ^ 2] - || !MON_CAN_BATTLE(&party[i])); + // Both player's battlers are alive + redCardForcedSwitch = FALSE; } else { - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + // Player has only one mon alive -> force red card switch before manually switching to other mon + redCardForcedSwitch = TRUE; + } + } + } + + // Swapping pokemon happens in: + // trainer battles + // wild double battles when an opposing pokemon uses it against one of the two alive player mons + // wild double battle when a player pokemon uses it against its partner + if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) + || (WILD_DOUBLE_BATTLE + && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT + && GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER + && IS_WHOLE_SIDE_ALIVE(gBattlerTarget)) + || (WILD_DOUBLE_BATTLE + && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER + && GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) + || redCardForcedSwitch + ) + { + party = GetBattlerParty(gBattlerTarget); + + if (BATTLE_TWO_VS_ONE_OPPONENT && GetBattlerSide(gBattlerTarget) == B_SIDE_OPPONENT) + { + firstMonId = 0; + lastMonId = 6; + battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; + battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; + } + else if ((gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_LINK) + || (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)) + { + if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) + { + firstMonId = PARTY_SIZE / 2; + lastMonId = PARTY_SIZE; + } + else + { + firstMonId = 0; + lastMonId = PARTY_SIZE / 2; + } + battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; + battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; + } + else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)) + { + if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == B_FLANK_RIGHT) + { + firstMonId = PARTY_SIZE / 2; + lastMonId = PARTY_SIZE; + } + else + { + firstMonId = 0; + lastMonId = PARTY_SIZE / 2; + } + battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; + battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; + } + else if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + { + if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) + { + firstMonId = 0; + lastMonId = PARTY_SIZE; + } + else + { + if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { - do - { - i = Random() % PARTY_SIZE; - } - while (i == gBattlerPartyIndexes[gBattlerTarget] - || i == gBattlerPartyIndexes[gBattlerTarget ^ 2] - || !MON_CAN_BATTLE(&party[i])); + firstMonId = PARTY_SIZE / 2; + lastMonId = PARTY_SIZE; } else { - do - { - i = Random() % PARTY_SIZE; - } - while (i == gBattlerPartyIndexes[gBattlerTarget] - || !MON_CAN_BATTLE(&party[i])); + firstMonId = 0; + lastMonId = PARTY_SIZE / 2; } } - *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i; + battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; + battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; + } + else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + firstMonId = 0; + lastMonId = PARTY_SIZE; + battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; + battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; + } + else + { + firstMonId = 0; + lastMonId = PARTY_SIZE; + battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one Pokémon out in single battles + battler1PartyId = gBattlerPartyIndexes[gBattlerTarget]; + } + + for (i = firstMonId; i < lastMonId; i++) + { + if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && GetMonData(&party[i], MON_DATA_HP) != 0 + && i != battler1PartyId + && i != battler2PartyId) + { + validMons[validMonsCount++] = i; + } + } + + if (validMonsCount == 0) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + *(gBattleStruct->battlerPartyIndexes + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget]; + gBattlescriptCurrInstr = BattleScript_RoarSuccessSwitch; + gBattleStruct->forcedSwitch |= gBitTable[gBattlerTarget]; + *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = validMons[RandomUniform(RNG_FORCE_RANDOM_SWITCH, 0, validMonsCount - 1)]; + if (!IsMultiBattle()) - UpdatePartyOwnerOnSwitch_NonMulti(gBattlerTarget); - SwitchPartyOrderLinkMulti(gBattlerTarget, i, 0); - SwitchPartyOrderLinkMulti(gBattlerTarget ^ BIT_FLANK, i, 1); + SwitchPartyOrder(gBattlerTarget); + + if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) + || (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)) + { + SwitchPartyOrderLinkMulti(gBattlerTarget, i, 0); + SwitchPartyOrderLinkMulti(BATTLE_PARTNER(gBattlerTarget), i, 1); + } + + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + SwitchPartyOrderInGameMulti(gBattlerTarget, i); } } else { - TryDoForceSwitchOut(); + // In normal wild doubles, Roar will always fail if the user's level is less than the target's. + if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) + gBattlescriptCurrInstr = BattleScript_RoarSuccessEndBattle; + else + gBattlescriptCurrInstr = cmd->failInstr; } } // Randomly changes user's type to one of its moves' type static void Cmd_tryconversiontypechange(void) { + CMD_ARGS(const u8 *failInstr); + u8 validMoves = 0; - u8 moveChecked; - u8 moveType; + u8 moveChecked = 0; + u8 moveType = 0; - while (validMoves < MAX_MON_MOVES) + if (B_UPDATED_CONVERSION >= GEN_6) { - if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE) - break; - - validMoves++; - } - - for (moveChecked = 0; moveChecked < validMoves; moveChecked++) - { - moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; - - if (moveType == TYPE_MYSTERY) + // Changes user's type to its first move's type + for (moveChecked = 0; moveChecked < MAX_MON_MOVES; moveChecked++) { - if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) - moveType = TYPE_GHOST; - else - moveType = TYPE_NORMAL; + if (gBattleMons[gBattlerAttacker].moves[moveChecked] != MOVE_NONE) + { + moveType = gMovesInfo[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; + break; + } } - if (moveType != gBattleMons[gBattlerAttacker].type1 - && moveType != gBattleMons[gBattlerAttacker].type2) + if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType)) { - break; + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + SET_BATTLER_TYPE(gBattlerAttacker, moveType); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); + gBattlescriptCurrInstr = cmd->nextInstr; } - } - - if (moveChecked == validMoves) - { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else { - do + // Randomly changes user's type to one of its moves' type + while (validMoves < MAX_MON_MOVES) { - while ((moveChecked = Random() & (MAX_MON_MOVES - 1)) >= validMoves); + if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE) + break; - moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; + validMoves++; + } + + for (moveChecked = 0; moveChecked < validMoves; moveChecked++) + { + moveType = gMovesInfo[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; if (moveType == TYPE_MYSTERY) { @@ -7122,129 +12403,172 @@ static void Cmd_tryconversiontypechange(void) else moveType = TYPE_NORMAL; } + if (moveType != gBattleMons[gBattlerAttacker].type1 + && moveType != gBattleMons[gBattlerAttacker].type2 + && moveType != gBattleMons[gBattlerAttacker].type3) + { + break; + } } - while (moveType == gBattleMons[gBattlerAttacker].type1 || moveType == gBattleMons[gBattlerAttacker].type2); - SET_BATTLER_TYPE(gBattlerAttacker, moveType); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); + if (moveChecked == validMoves) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + do + { + while ((moveChecked = MOD(Random(), MAX_MON_MOVES)) >= validMoves); - gBattlescriptCurrInstr += 5; + moveType = gMovesInfo[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; + + if (moveType == TYPE_MYSTERY) + { + if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) + moveType = TYPE_GHOST; + else + moveType = TYPE_NORMAL; + } + } + while (moveType == gBattleMons[gBattlerAttacker].type1 || moveType == gBattleMons[gBattlerAttacker].type2 || moveType == gBattleMons[gBattlerAttacker].type3); + + SET_BATTLER_TYPE(gBattlerAttacker, moveType); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); + + gBattlescriptCurrInstr = cmd->nextInstr; + } } } static void Cmd_givepaydaymoney(void) { - if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gPaydayMoney != 0) + CMD_ARGS(); + + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK)) && gPaydayMoney != 0) { u32 bonusMoney = gPaydayMoney * gBattleStruct->moneyMultiplier; AddMoney(&gSaveBlock1Ptr->money, bonusMoney); PREPARE_HWORD_NUMBER_BUFFER(gBattleTextBuff1, 5, bonusMoney) - BattleScriptPush(gBattlescriptCurrInstr + 1); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_PrintPayDayMoneyString; } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setlightscreen(void) { - if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN) + CMD_ARGS(); + + if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED; } else { - gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_LIGHTSCREEN; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenTimer = 5; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker; + gSideStatuses[GetBattlerSide(gBattlerAttacker)] |= SIDE_STATUS_LIGHTSCREEN; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[GetBattlerSide(gBattlerAttacker)].lightscreenTimer = 8; + else + gSideTimers[GetBattlerSide(gBattlerAttacker)].lightscreenTimer = 5; + gSideTimers[GetBattlerSide(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerAttacker) == 2) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_DOUBLE; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_SINGLE; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryKO(void) { - u8 holdEffect, param; + CMD_ARGS(const u8 *failInstr); - if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY) - { - holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; - param = gEnigmaBerries[gBattlerTarget].holdEffectParam; - } - else - { - holdEffect = ItemId_GetHoldEffect(gBattleMons[gBattlerTarget].item); - param = ItemId_GetHoldEffectParam(gBattleMons[gBattlerTarget].item); - } + bool32 lands = FALSE; + u32 holdEffect = GetBattlerHoldEffect(gBattlerTarget, TRUE); + u16 targetAbility = GetBattlerAbility(gBattlerTarget); + + // TODO: Dynamax + // Dynamaxed Pokemon cannot be hit by OHKO moves. + // if (IsDynamaxed(gBattlerTarget)) + // { + // gMoveResultFlags |= MOVE_RESULT_MISSED; + // gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_UNAFFECTED; + // gBattlescriptCurrInstr = cmd->failInstr; + // return; + // } gPotentialItemEffectBattler = gBattlerTarget; - - if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) + if (holdEffect == HOLD_EFFECT_FOCUS_BAND + && (Random() % 100) < GetBattlerHoldEffectParam(gBattlerTarget)) { - RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_FOCUS_BAND); - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; + RecordItemEffectBattle(gBattlerTarget, holdEffect); + } + else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) + { + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; + RecordItemEffectBattle(gBattlerTarget, holdEffect); } - if (gBattleMons[gBattlerTarget].ability == ABILITY_STURDY) + if (targetAbility == ABILITY_STURDY) { gMoveResultFlags |= MOVE_RESULT_MISSED; gLastUsedAbility = ABILITY_STURDY; gBattlescriptCurrInstr = BattleScript_SturdyPreventsOHKO; - RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); + gBattlerAbility = gBattlerTarget; } else { - u16 chance; - if (!(gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS)) + if ((((gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS) + && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) + || GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD + || targetAbility == ABILITY_NO_GUARD) + && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) { - chance = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); - if (Random() % 100 + 1 < chance && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) - chance = TRUE; - else - chance = FALSE; - } - else if (gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker - && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) - { - chance = TRUE; + lands = TRUE; } else { - chance = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); - if (Random() % 100 + 1 < chance && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) - chance = TRUE; - else - chance = FALSE; + u16 odds = gMovesInfo[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); + if (B_SHEER_COLD_ACC >= GEN_7 && gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + odds -= 10; + if (RandomPercentage(RNG_ACCURACY, odds) && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) + lands = TRUE; } - if (chance) + + if (lands) { if (gProtectStructs[gBattlerTarget].endured) { gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED; } - else if (gSpecialStatuses[gBattlerTarget].focusBanded) + else if (gSpecialStatuses[gBattlerTarget].focusBanded || gSpecialStatuses[gBattlerTarget].focusSashed) { gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON; gLastUsedItem = gBattleMons[gBattlerTarget].item; } + else if (B_AFFECTION_MECHANICS == TRUE && gSpecialStatuses[gBattlerTarget].affectionEndured) + { + gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1; + gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED_AFFECTION; + } else { gBattleMoveDamage = gBattleMons[gBattlerTarget].hp; gMoveResultFlags |= MOVE_RESULT_ONE_HIT_KO; } - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { @@ -7253,7 +12577,7 @@ static void Cmd_tryKO(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_MISS; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_UNAFFECTED; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } } @@ -7261,216 +12585,226 @@ static void Cmd_tryKO(void) // Super Fang static void Cmd_damagetohalftargethp(void) { + CMD_ARGS(); + + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxHP(gBattlerTarget) / 2; gBattleMoveDamage = gBattleMons[gBattlerTarget].hp / 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setsandstorm(void) { - if (gBattleWeather & B_WEATHER_SANDSTORM) + CMD_ARGS(); + + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_SANDSTORM, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = B_WEATHER_SANDSTORM_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SANDSTORM; - gWishFutureKnock.weatherDuration = 5; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_weatherdamage(void) { + CMD_ARGS(); + + u32 ability = GetBattlerAbility(gBattlerAttacker); + + gBattleMoveDamage = 0; if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags) && (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)) { - gBattleMoveDamage = 0; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; return; } - if (WEATHER_HAS_EFFECT) + if (IsBattlerAlive(gBattlerAttacker) && WEATHER_HAS_EFFECT && ability != ABILITY_MAGIC_GUARD) { if (gBattleWeather & B_WEATHER_SANDSTORM) { - if (gBattleMons[gBattlerAttacker].type1 != TYPE_ROCK - && gBattleMons[gBattlerAttacker].type1 != TYPE_STEEL - && gBattleMons[gBattlerAttacker].type1 != TYPE_GROUND - && gBattleMons[gBattlerAttacker].type2 != TYPE_ROCK - && gBattleMons[gBattlerAttacker].type2 != TYPE_STEEL - && gBattleMons[gBattlerAttacker].type2 != TYPE_GROUND - && gBattleMons[gBattlerAttacker].ability != ABILITY_SAND_VEIL - && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND) - && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)) + if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ROCK) + && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GROUND) + && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_STEEL) + && ability != ABILITY_SAND_VEIL + && ability != ABILITY_SAND_FORCE + && ability != ABILITY_SAND_RUSH + && ability != ABILITY_OVERCOAT + && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 16; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; } - else - { - gBattleMoveDamage = 0; - } } if (gBattleWeather & B_WEATHER_HAIL) { - if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE) - && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND) - && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)) + if (ability == ABILITY_ICE_BODY + && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + && !BATTLER_MAX_HP(gBattlerAttacker) + && !(gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK)) { + gBattlerAbility = gBattlerAttacker; + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 16; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + } + else if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE) + && ability != ABILITY_SNOW_CLOAK + && ability != ABILITY_OVERCOAT + && ability != ABILITY_ICE_BODY + && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 16; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; } - else + } + if (gBattleWeather & B_WEATHER_SNOW) + { + if (ability == ABILITY_ICE_BODY + && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + && !BATTLER_MAX_HP(gBattlerAttacker) + && !(gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK)) { - gBattleMoveDamage = 0; + gBattlerAbility = gBattlerAttacker; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; } } } - else - { - gBattleMoveDamage = 0; - } - if (gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) - gBattleMoveDamage = 0; - - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryinfatuating(void) { - struct Pokemon *monAttacker, *monTarget; - u16 speciesAttacker, speciesTarget; - u32 personalityAttacker, personalityTarget; + CMD_ARGS(const u8 *failInstr); - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) - monAttacker = &gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]; - else - monAttacker = &gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]]; - - if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) - monTarget = &gPlayerParty[gBattlerPartyIndexes[gBattlerTarget]]; - else - monTarget = &gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]; - - speciesAttacker = GetMonData(monAttacker, MON_DATA_SPECIES); - personalityAttacker = GetMonData(monAttacker, MON_DATA_PERSONALITY); - - speciesTarget = GetMonData(monTarget, MON_DATA_SPECIES); - personalityTarget = GetMonData(monTarget, MON_DATA_PERSONALITY); - - if (gBattleMons[gBattlerTarget].ability == ABILITY_OBLIVIOUS) + if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { - gBattlescriptCurrInstr = BattleScript_ObliviousPreventsAttraction; + gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp; gLastUsedAbility = ABILITY_OBLIVIOUS; RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); } else { - if (GetGenderFromSpeciesAndPersonality(speciesAttacker, personalityAttacker) == GetGenderFromSpeciesAndPersonality(speciesTarget, personalityTarget) - || gBattleMons[gBattlerTarget].status2 & STATUS2_INFATUATION - || GetGenderFromSpeciesAndPersonality(speciesAttacker, personalityAttacker) == MON_GENDERLESS - || GetGenderFromSpeciesAndPersonality(speciesTarget, personalityTarget) == MON_GENDERLESS) + if (gBattleMons[gBattlerTarget].status2 & STATUS2_INFATUATION + || !AreBattlersOfOppositeGender(gBattlerAttacker, gBattlerTarget)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].status2 |= STATUS2_INFATUATED_WITH(gBattlerAttacker); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_updatestatusicon(void) { + CMD_ARGS(u8 battler); + u32 battler; + if (gBattleControllerExecFlags) return; - if (gBattlescriptCurrInstr[1] == BS_PLAYER2) + if (cmd->battler != BS_ATTACKER_WITH_PARTNER) { - for (gActiveBattler = gBattleControllerExecFlags; gActiveBattler < gBattlersCount; gActiveBattler++) - { - if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler])) - { - BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); - MarkBattlerForControllerExec(gActiveBattler); - } - } - gBattlescriptCurrInstr += 2; - } - else if (gBattlescriptCurrInstr[1] == BS_ATTACKER_WITH_PARTNER) - { - gActiveBattler = gBattlerAttacker; - if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler])) - { - BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); - MarkBattlerForControllerExec(gActiveBattler); - } - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) - { - gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); - if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler])) - { - BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); - MarkBattlerForControllerExec(gActiveBattler); - } - } - gBattlescriptCurrInstr += 2; + battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[battler].status1, gBattleMons[battler].status2); + MarkBattlerForControllerExec(battler); + gBattlescriptCurrInstr = cmd->nextInstr; } else { - - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + battler = gActiveBattler = gBattlerAttacker; + if (!(gAbsentBattlerFlags & gBitTable[battler])) + { + BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[battler].status1, gBattleMons[battler].status2); + MarkBattlerForControllerExec(battler); + } + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + { + battler = gActiveBattler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); + if (!(gAbsentBattlerFlags & gBitTable[battler])) + { + BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[battler].status1, gBattleMons[battler].status2); + MarkBattlerForControllerExec(battler); + } + } + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setmist(void) { - if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer) + CMD_ARGS(); + + if (gSideTimers[GetBattlerSide(gBattlerAttacker)].mistTimer) { gMoveResultFlags |= MOVE_RESULT_FAILED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MIST_FAILED; } else { - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer = 5; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistBattlerId = gBattlerAttacker; - gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_MIST; + gSideTimers[GetBattlerSide(gBattlerAttacker)].mistTimer = 5; + gSideTimers[GetBattlerSide(gBattlerAttacker)].mistBattlerId = gBattlerAttacker; + gSideStatuses[GetBattlerSide(gBattlerAttacker)] |= SIDE_STATUS_MIST; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setfocusenergy(void) { - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) + CMD_ARGS(); + + if ((gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || (gAbsentBattlerFlags & gBitTable[gBattlerTarget]))) + || gBattleMons[gBattlerTarget].status2 & STATUS2_FOCUS_ENERGY_ANY) { gMoveResultFlags |= MOVE_RESULT_FAILED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FOCUS_ENERGY_FAILED; } - else + else if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && !IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_DRAGON)) { - gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; + gBattleMons[gBattlerTarget].status2 |= STATUS2_DRAGON_CHEER; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED; } - gBattlescriptCurrInstr++; + else + { + gBattleMons[gBattlerTarget].status2 |= STATUS2_FOCUS_ENERGY; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED; + } + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_transformdataexecution(void) { + CMD_ARGS(); + gChosenMove = MOVE_UNAVAILABLE; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED + || gBattleStruct->illusion[gBattlerTarget].on || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) { gMoveResultFlags |= MOVE_RESULT_FAILED; @@ -7480,12 +12814,18 @@ static void Cmd_transformdataexecution(void) { s32 i; u8 *battleMonAttacker, *battleMonTarget; + u8 timesGotHit; gBattleMons[gBattlerAttacker].status2 |= STATUS2_TRANSFORMED; gDisableStructs[gBattlerAttacker].disabledMove = MOVE_NONE; gDisableStructs[gBattlerAttacker].disableTimer = 0; gDisableStructs[gBattlerAttacker].transformedMonPersonality = gBattleMons[gBattlerTarget].personality; + gDisableStructs[gBattlerAttacker].transformedMonShininess = gBattleMons[gBattlerTarget].isShiny; gDisableStructs[gBattlerAttacker].mimickedMoves = 0; + gDisableStructs[gBattlerAttacker].usedMoves = 0; + + timesGotHit = gBattleStruct->timesGotHit[GetBattlerSide(gBattlerTarget)][gBattlerPartyIndexes[gBattlerTarget]]; + gBattleStruct->timesGotHit[GetBattlerSide(gBattlerAttacker)][gBattlerPartyIndexes[gBattlerAttacker]] = timesGotHit; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].species) @@ -7495,25 +12835,38 @@ static void Cmd_transformdataexecution(void) for (i = 0; i < offsetof(struct BattlePokemon, pp); i++) battleMonAttacker[i] = battleMonTarget[i]; + gBattleStruct->overwrittenAbilities[gBattlerAttacker] = GetBattlerAbility(gBattlerTarget); for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].pp < 5) - gBattleMons[gBattlerAttacker].pp[i] = gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].pp; + if (gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].pp < 5) + gBattleMons[gBattlerAttacker].pp[i] = gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].pp; else gBattleMons[gBattlerAttacker].pp[i] = 5; } + // update AI knowledge + RecordAllMoves(gBattlerAttacker); + RecordAbilityBattle(gBattlerAttacker, gBattleMons[gBattlerAttacker].ability); + gActiveBattler = gBattlerAttacker; BtlController_EmitResetActionMoveSelection(BUFFER_A, RESET_MOVE_SELECTION); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORMED; } } static void Cmd_setsubstitute(void) { - u32 hp = gBattleMons[gBattlerAttacker].maxHP / 4; - if (gBattleMons[gBattlerAttacker].maxHP / 4 == 0) + CMD_ARGS(); + + u32 factor = gMovesInfo[gCurrentMove].effect == EFFECT_SHED_TAIL ? 2 : 4; + // TODO: Dynamax + // u32 hp = GetNonDynamaxMaxHP(gBattlerAttacker) / factor; + u32 hp = gBattleMons[gBattlerAttacker].maxHP / factor; + + // TODO: Dynamax + // if (GetNonDynamaxMaxHP(gBattlerAttacker) / factor == 0) + if (gBattleMons[gBattlerAttacker].maxHP / factor == 0) hp = 1; if (gBattleMons[gBattlerAttacker].hp <= hp) @@ -7523,7 +12876,9 @@ static void Cmd_setsubstitute(void) } else { - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for pokemon which max hp can go to 1020(which is more than possible in games) + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / factor; // one bit value will only work for Pokémon which max hp can go to 1020(which is more than possible in games) + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / factor; // one bit value will only work for Pokémon which max hp can go to 1020(which is more than possible in games) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; @@ -7534,28 +12889,19 @@ static void Cmd_setsubstitute(void) gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE; } - gBattlescriptCurrInstr++; -} - -static bool8 IsMoveUncopyableByMimic(u16 move) -{ - s32 i; - for (i = 0; sMovesForbiddenToCopy[i] != MIMIC_FORBIDDEN_END - && sMovesForbiddenToCopy[i] != move; i++); - - return (sMovesForbiddenToCopy[i] != MIMIC_FORBIDDEN_END); + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_mimicattackcopy(void) { - gChosenMove = MOVE_UNAVAILABLE; + CMD_ARGS(const u8 *failInstr); - if (IsMoveUncopyableByMimic(gLastMoves[gBattlerTarget]) - || gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED + if ((gMovesInfo[gLastMoves[gBattlerTarget]].mimicBanned) + || (gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) || gLastMoves[gBattlerTarget] == MOVE_NONE || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -7569,75 +12915,83 @@ static void Cmd_mimicattackcopy(void) if (i == MAX_MON_MOVES) { + gChosenMove = MOVE_UNAVAILABLE; gBattleMons[gBattlerAttacker].moves[gCurrMovePos] = gLastMoves[gBattlerTarget]; - if (gBattleMoves[gLastMoves[gBattlerTarget]].pp < 5) - gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = gBattleMoves[gLastMoves[gBattlerTarget]].pp; + if (gMovesInfo[gLastMoves[gBattlerTarget]].pp < 5) + gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = gMovesInfo[gLastMoves[gBattlerTarget]].pp; else gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = 5; PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[gBattlerTarget]) gDisableStructs[gBattlerAttacker].mimickedMoves |= gBitTable[gCurrMovePos]; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } } +static bool32 InvalidMetronomeMove(u32 move) +{ + return gMovesInfo[move].effect == EFFECT_PLACEHOLDER + || gMovesInfo[move].metronomeBanned; +} + static void Cmd_metronome(void) { - while (TRUE) - { - s32 i; + CMD_ARGS(); - gCurrentMove = (Random() & 0x1FF) + 1; - if (gCurrentMove >= MOVES_COUNT) - continue; +#if B_METRONOME_MOVES >= GEN_9 + u32 moveCount = MOVES_COUNT_GEN9; +#elif B_METRONOME_MOVES >= GEN_8 + u32 moveCount = MOVES_COUNT_GEN8; +#elif B_METRONOME_MOVES >= GEN_7 + u32 moveCount = MOVES_COUNT_GEN7; +#elif B_METRONOME_MOVES >= GEN_6 + u32 moveCount = MOVES_COUNT_GEN6; +#elif B_METRONOME_MOVES >= GEN_5 + u32 moveCount = MOVES_COUNT_GEN5; +#elif B_METRONOME_MOVES >= GEN_4 + u32 moveCount = MOVES_COUNT_GEN4; +#elif B_METRONOME_MOVES >= GEN_3 + u32 moveCount = MOVES_COUNT_GEN3; +#elif B_METRONOME_MOVES >= GEN_2 + u32 moveCount = MOVES_COUNT_GEN2; +#else + u32 moveCount = MOVES_COUNT_GEN1; +#endif - for (i = 0; i < MAX_MON_MOVES; i++); // ? - - i = -1; - while (TRUE) - { - i++; - if (sMovesForbiddenToCopy[i] == gCurrentMove) - break; - if (sMovesForbiddenToCopy[i] == METRONOME_FORBIDDEN_END) - break; - } - - if (sMovesForbiddenToCopy[i] == METRONOME_FORBIDDEN_END) - { - gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - return; - } - } + gCurrentMove = RandomUniformExcept(RNG_METRONOME, 1, moveCount - 1, InvalidMetronomeMove); + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + SetAtkCancellerForCalledMove(); + gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); + gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } static void Cmd_dmgtolevel(void) { + CMD_ARGS(); + gBattleMoveDamage = gBattleMons[gBattlerAttacker].level; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_psywavedamageeffect(void) { - s32 randDamage; + CMD_ARGS(); - while ((randDamage = Random() % 16) > 10); - - randDamage *= 10; + s32 randDamage = B_PSYWAVE_DMG >= GEN_6 ? (Random() % 101) : ((Random() % 11) * 10); gBattleMoveDamage = gBattleMons[gBattlerAttacker].level * (randDamage + 50) / 100; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_counterdamagecalculator(void) { + CMD_ARGS(const u8 *failInstr); + u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].physicalBattlerId); @@ -7647,46 +13001,50 @@ static void Cmd_counterdamagecalculator(void) { gBattleMoveDamage = gProtectStructs[gBattlerAttacker].physicalDmg * 2; - if (gSideTimers[sideTarget].followmeTimer && gBattleMons[gSideTimers[sideTarget].followmeTarget].hp) + if (IsAffectedByFollowMe(gBattlerAttacker, sideTarget, gCurrentMove)) gBattlerTarget = gSideTimers[sideTarget].followmeTarget; else gBattlerTarget = gProtectStructs[gBattlerAttacker].physicalBattlerId; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // A copy of Cmd_counterdamagecalculator with the physical -> special field changes static void Cmd_mirrorcoatdamagecalculator(void) { + CMD_ARGS(const u8 *failInstr); + u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].specialBattlerId); - if (gProtectStructs[gBattlerAttacker].specialDmg && sideAttacker != sideTarget && gBattleMons[gProtectStructs[gBattlerAttacker].specialBattlerId].hp) + if (gProtectStructs[gBattlerAttacker].specialDmg + && sideAttacker != sideTarget + && gBattleMons[gProtectStructs[gBattlerAttacker].specialBattlerId].hp) { gBattleMoveDamage = gProtectStructs[gBattlerAttacker].specialDmg * 2; - if (gSideTimers[sideTarget].followmeTimer && gBattleMons[gSideTimers[sideTarget].followmeTarget].hp) + if (IsAffectedByFollowMe(gBattlerAttacker, sideTarget, gCurrentMove)) gBattlerTarget = gSideTimers[sideTarget].followmeTarget; else gBattlerTarget = gProtectStructs[gBattlerAttacker].specialBattlerId; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_disablelastusedattack(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; for (i = 0; i < MAX_MON_MOVES; i++) @@ -7700,29 +13058,47 @@ static void Cmd_disablelastusedattack(void) PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].moves[i]) gDisableStructs[gBattlerTarget].disabledMove = gBattleMons[gBattlerTarget].moves[i]; - gDisableStructs[gBattlerTarget].disableTimer = (Random() & 3) + 2; - gDisableStructs[gBattlerTarget].disableTimerStartValue = gDisableStructs[gBattlerTarget].disableTimer; // used to save the random amount of turns? - gBattlescriptCurrInstr += 5; + if (B_DISABLE_TURNS >= GEN_5) + gDisableStructs[gBattlerTarget].disableTimer = 4; + else if (B_DISABLE_TURNS >= GEN_4) + gDisableStructs[gBattlerTarget].disableTimer = (Random() & 3) + 4; // 4-7 turns + else + gDisableStructs[gBattlerTarget].disableTimer = (Random() & 3) + 2; // 2-5 turns + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_trysetencore(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; - for (i = 0; i < MAX_MON_MOVES; i++) + // TODO: Dynamax + if (FALSE /* IsMaxMove(gLastMoves[gBattlerTarget]) && !IsDynamaxed(gBattlerTarget) */) { - if (gBattleMons[gBattlerTarget].moves[i] == gLastMoves[gBattlerTarget]) - break; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gBattleMons[gBattlerTarget].moves[i] == gBattleStruct->dynamax.baseMove[gBattlerTarget]) + break; + } + } + else + { + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gBattleMons[gBattlerTarget].moves[i] == gLastMoves[gBattlerTarget]) + break; + } } - if (gLastMoves[gBattlerTarget] == MOVE_STRUGGLE - || gLastMoves[gBattlerTarget] == MOVE_ENCORE - || gLastMoves[gBattlerTarget] == MOVE_MIRROR_MOVE) + if ((gMovesInfo[gLastMoves[gBattlerTarget]].encoreBanned) + || gLastMoves[gBattlerTarget] == MOVE_NONE + || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) { i = MAX_MON_MOVES; } @@ -7732,21 +13108,26 @@ static void Cmd_trysetencore(void) { gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i]; gDisableStructs[gBattlerTarget].encoredMovePos = i; - gDisableStructs[gBattlerTarget].encoreTimer = (Random() & 3) + 3; - gDisableStructs[gBattlerTarget].encoreTimerStartValue = gDisableStructs[gBattlerTarget].encoreTimer; - gBattlescriptCurrInstr += 5; + gDisableStructs[gBattlerTarget].encoreTimer = 3; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_painsplitdmgcalc(void) { - if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)) + CMD_ARGS(const u8 *failInstr); + + if (!(DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove))) { + // TODO: Dynamax + // s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + GetNonDynamaxHP(gBattlerTarget)) / 2; s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + gBattleMons[gBattlerTarget].hp) / 2; + // TODO: Dynamax + // s32 painSplitHp = gBattleMoveDamage = GetNonDynamaxHP(gBattlerTarget) - hpDiff; s32 painSplitHp = gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - hpDiff; u8 *storeLoc = (void *)(&gBattleScripting.painSplitHp); @@ -7756,95 +13137,90 @@ static void Cmd_painsplitdmgcalc(void) storeLoc[3] = (painSplitHp & 0xFF000000) >> 24; gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff; - gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF; + gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Conversion 2 static void Cmd_settypetorandomresistance(void) { + CMD_ARGS(const u8 *failInstr); + if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE || gLastLandedMoves[gBattlerAttacker] == MOVE_UNAVAILABLE) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } - else if (IsTwoTurnsMove(gLastLandedMoves[gBattlerAttacker]) + else if (gBattleMoveEffects[gMovesInfo[gLastLandedMoves[gBattlerAttacker]].effect].twoTurnEffect && gBattleMons[gLastHitBy[gBattlerAttacker]].status2 & STATUS2_MULTIPLETURNS) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { - s32 i, j, rands; + u32 i, resistTypes = 0; + u32 hitByType = gLastHitByType[gBattlerAttacker]; - for (rands = 0; rands < 1000; rands++) + for (i = 0; i < NUMBER_OF_MON_TYPES; i++) // Find all types that resist. { - while (((i = Random() % 128) > sizeof(gTypeEffectiveness) / 3)); - - i *= 3; - - if (TYPE_EFFECT_ATK_TYPE(i) == gLastHitByType[gBattlerAttacker] - && TYPE_EFFECT_MULTIPLIER(i) <= TYPE_MUL_NOT_EFFECTIVE - && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_EFFECT_DEF_TYPE(i))) + switch (GetTypeModifier(hitByType, i)) { - SET_BATTLER_TYPE(gBattlerAttacker, TYPE_EFFECT_DEF_TYPE(i)); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, TYPE_EFFECT_DEF_TYPE(i)); - - gBattlescriptCurrInstr += 5; - return; + case UQ_4_12(0): + case UQ_4_12(0.5): + resistTypes |= gBitTable[i]; + break; } } - for (j = 0, rands = 0; rands < sizeof(gTypeEffectiveness); j += 3, rands += 3) + while (resistTypes != 0) { - switch (TYPE_EFFECT_ATK_TYPE(j)) + i = Random() % NUMBER_OF_MON_TYPES; + if (resistTypes & gBitTable[i]) { - case TYPE_ENDTABLE: - case TYPE_FORESIGHT: - break; - default: - if (TYPE_EFFECT_ATK_TYPE(j) == gLastHitByType[gBattlerAttacker] - && TYPE_EFFECT_MULTIPLIER(j) <= 5 - && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_EFFECT_DEF_TYPE(i))) + if (IS_BATTLER_OF_TYPE(gBattlerAttacker, i)) { - SET_BATTLER_TYPE(gBattlerAttacker, TYPE_EFFECT_DEF_TYPE(rands)); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, TYPE_EFFECT_DEF_TYPE(rands)) - - gBattlescriptCurrInstr += 5; + resistTypes &= ~(gBitTable[i]); // Type resists, but the user is already of this type. + } + else + { + SET_BATTLER_TYPE(gBattlerAttacker, i); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, i); + gBattlescriptCurrInstr = cmd->nextInstr; return; } - break; } } - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_setalwayshitflag(void) { + CMD_ARGS(); + gStatuses3[gBattlerTarget] &= ~STATUS3_ALWAYS_HITS; gStatuses3[gBattlerTarget] |= STATUS3_ALWAYS_HITS_TURN(2); gDisableStructs[gBattlerTarget].battlerWithSureHit = gBattlerAttacker; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Sketch static void Cmd_copymovepermanently(void) { + CMD_ARGS(const u8 *failInstr); + gChosenMove = MOVE_UNAVAILABLE; if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) - && gLastPrintedMoves[gBattlerTarget] != MOVE_STRUGGLE - && gLastPrintedMoves[gBattlerTarget] != MOVE_NONE && gLastPrintedMoves[gBattlerTarget] != MOVE_UNAVAILABLE - && gLastPrintedMoves[gBattlerTarget] != MOVE_SKETCH) + && !gMovesInfo[gLastPrintedMoves[gBattlerTarget]].sketchBanned) { s32 i; @@ -7858,14 +13234,14 @@ static void Cmd_copymovepermanently(void) if (i != MAX_MON_MOVES) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else // sketch worked { struct MovePpInfo movePpData; gBattleMons[gBattlerAttacker].moves[gCurrMovePos] = gLastPrintedMoves[gBattlerTarget]; - gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = gBattleMoves[gLastPrintedMoves[gBattlerTarget]].pp; + gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = gMovesInfo[gLastPrintedMoves[gBattlerTarget]].pp; gActiveBattler = gBattlerAttacker; for (i = 0; i < MAX_MON_MOVES; i++) @@ -7876,57 +13252,30 @@ static void Cmd_copymovepermanently(void) movePpData.ppBonuses = gBattleMons[gBattlerAttacker].ppBonuses; BtlController_EmitSetMonData(BUFFER_A, REQUEST_MOVES_PP_BATTLE, 0, sizeof(movePpData), &movePpData); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastPrintedMoves[gBattlerTarget]) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } -static bool8 IsTwoTurnsMove(u16 move) -{ - if (gBattleMoves[move].effect == EFFECT_SKULL_BASH - || gBattleMoves[move].effect == EFFECT_RAZOR_WIND - || gBattleMoves[move].effect == EFFECT_SKY_ATTACK - || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM - || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) - return TRUE; - else - return FALSE; -} - -static bool8 IsInvalidForSleepTalkOrAssist(u16 move) -{ - if (move == MOVE_NONE - || move == MOVE_SLEEP_TALK - || move == MOVE_ASSIST - || move == MOVE_MIRROR_MOVE - || move == MOVE_METRONOME) - return TRUE; - else - return FALSE; -} - static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2 { // first argument is unused - if (gBattleMoves[move].effect == EFFECT_SOLAR_BEAM + if (gMovesInfo[move].effect == EFFECT_SOLAR_BEAM && (gBattleWeather & B_WEATHER_SUN)) return 2; - if (gBattleMoves[move].effect == EFFECT_SKULL_BASH - || gBattleMoves[move].effect == EFFECT_RAZOR_WIND - || gBattleMoves[move].effect == EFFECT_SKY_ATTACK - || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM - || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) + if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK + || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM + || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE + || gMovesInfo[move].effect == EFFECT_BIDE) { if ((gHitMarker & HITMARKER_CHARGING)) return 1; @@ -7936,46 +13285,47 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c static void Cmd_trychoosesleeptalkmove(void) { - s32 i; - u8 unusableMovesBits = 0; + CMD_ARGS(const u8 *failInstr); + + u32 i, unusableMovesBits = 0, movePosition; for (i = 0; i < MAX_MON_MOVES; i++) { - if (IsInvalidForSleepTalkOrAssist(gBattleMons[gBattlerAttacker].moves[i]) - || gBattleMons[gBattlerAttacker].moves[i] == MOVE_FOCUS_PUNCH - || gBattleMons[gBattlerAttacker].moves[i] == MOVE_UPROAR - || IsTwoTurnsMove(gBattleMons[gBattlerAttacker].moves[i])) + if (gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].sleepTalkBanned + || gBattleMoveEffects[gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].effect].twoTurnEffect) { unusableMovesBits |= gBitTable[i]; } } unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~MOVE_LIMITATION_PP); - if (unusableMovesBits == (1 << MAX_MON_MOVES) - 1) // all 4 moves cannot be chosen + if (unusableMovesBits == ALL_MOVES_MASK) // all 4 moves cannot be chosen { - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else // at least one move can be chosen { - u32 movePosition; - + // Set Sleep Talk as used move, so it works with Last Resort. + gDisableStructs[gBattlerAttacker].usedMoves |= gBitTable[gCurrMovePos]; do { - movePosition = Random() & (MAX_MON_MOVES - 1); + movePosition = MOD(Random(), MAX_MON_MOVES); } while ((gBitTable[movePosition] & unusableMovesBits)); gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition]; gCurrMovePos = movePosition; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_setdestinybond(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status2 |= STATUS2_DESTINY_BOND; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void TrySetDestinyBondToHappen(void) @@ -7992,41 +13342,66 @@ static void TrySetDestinyBondToHappen(void) static void Cmd_trysetdestinybondtohappen(void) { + CMD_ARGS(); + TrySetDestinyBondToHappen(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_remaininghptopower(void) +static void Cmd_settailwind(void) { - s32 i; - s32 hpFraction = GetScaledHPFraction(gBattleMons[gBattlerAttacker].hp, gBattleMons[gBattlerAttacker].maxHP, 48); + CMD_ARGS(const u8 *failInstr); - for (i = 0; i < (s32) sizeof(sFlailHpScaleToPowerTable); i += 2) + u8 side = GetBattlerSide(gBattlerAttacker); + + if (!(gSideStatuses[side] & SIDE_STATUS_TAILWIND)) { - if (hpFraction <= sFlailHpScaleToPowerTable[i]) - break; + gSideStatuses[side] |= SIDE_STATUS_TAILWIND; + gSideTimers[side].tailwindBattlerId = gBattlerAttacker; + gSideTimers[side].tailwindTimer = B_TAILWIND_TURNS >= GEN_5 ? 4 : 3; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->failInstr; } - - gDynamicBasePower = sFlailHpScaleToPowerTable[i + 1]; - gBattlescriptCurrInstr++; } static void Cmd_tryspiteppreduce(void) { + CMD_ARGS(const u8 *failInstr); + if (gLastMoves[gBattlerTarget] != MOVE_NONE && gLastMoves[gBattlerTarget] != MOVE_UNAVAILABLE) { s32 i; - for (i = 0; i < MAX_MON_MOVES; i++) + // Get move slot to reduce PP. + if (FALSE /* IsMaxMove(gLastMoves[gBattlerTarget]) */) // TODO: Dynamax { - if (gLastMoves[gBattlerTarget] == gBattleMons[gBattlerTarget].moves[i]) - break; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gBattleStruct->dynamax.baseMove[gBattlerTarget] == gBattleMons[gBattlerTarget].moves[i]) + break; + } + } + else + { + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gLastMoves[gBattlerTarget] == gBattleMons[gBattlerTarget].moves[i]) + break; + } } - if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] > 1) + if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] > (B_CAN_SPITE_FAIL >= GEN_4 ? 0 : 1)) { - s32 ppToDeduct = (Random() & 3) + 2; + s32 ppToDeduct = B_PP_REDUCED_BY_SPITE >= GEN_4 ? 4 : (Random() & 3) + 2; + // TODO: Dynamax + // G-Max Depletion only deducts 2 PP. + // if (IsMaxMove(gCurrentMove) && gMovesInfo[gCurrentMove].argument == MAX_EFFECT_SPITE) + // ppToDeduct = 2; + if (gBattleMons[gBattlerTarget].pp[i] < ppToDeduct) ppToDeduct = gBattleMons[gBattlerTarget].pp[i]; @@ -8039,48 +13414,47 @@ static void Cmd_tryspiteppreduce(void) gBattleMons[gBattlerTarget].pp[i] -= ppToDeduct; gActiveBattler = gBattlerTarget; - // if (MOVE_IS_PERMANENT(gActiveBattler, i)), but backwards - if (!(gDisableStructs[gActiveBattler].mimickedMoves & gBitTable[i]) - && !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED)) + // if (MOVE_IS_PERMANENT(gBattlerTarget, i)), but backwards + if (!(gDisableStructs[gBattlerTarget].mimickedMoves & gBitTable[i]) + && !(gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED)) { - BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[gActiveBattler].pp[i]), &gBattleMons[gActiveBattler].pp[i]); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[gBattlerTarget].pp[i]), &gBattleMons[gBattlerTarget].pp[i]); + MarkBattlerForControllerExec(gBattlerTarget); } - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; - if (gBattleMons[gBattlerTarget].pp[i] == 0) + // Don't cut off Sky Drop if pp is brought to zero. + if (gBattleMons[gBattlerTarget].pp[i] == 0 && gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF) CancelMultiTurnMoves(gBattlerTarget); } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_healpartystatus(void) { + CMD_ARGS(); + u32 zero = 0; + u32 battler; u8 toHeal = 0; if (gCurrentMove == MOVE_HEAL_BELL) { - struct Pokemon *party; + struct Pokemon *party = GetBattlerParty(gBattlerAttacker); s32 i; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BELL; - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) - party = gPlayerParty; - else - party = gEnemyParty; - - if (gBattleMons[gBattlerAttacker].ability != ABILITY_SOUNDPROOF) + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SOUNDPROOF) { gBattleMons[gBattlerAttacker].status1 = 0; gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE; @@ -8091,19 +13465,19 @@ static void Cmd_healpartystatus(void) gBattleCommunication[MULTISTRING_CHOOSER] |= B_MSG_BELL_SOUNDPROOF_ATTACKER; } - gActiveBattler = gBattleScripting.battler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); + battler = gActiveBattler = gBattleScripting.battler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && !(gAbsentBattlerFlags & gBitTable[gActiveBattler])) + && !(gAbsentBattlerFlags & gBitTable[battler])) { - if (gBattleMons[gActiveBattler].ability != ABILITY_SOUNDPROOF) + if (GetBattlerAbility(battler) != ABILITY_SOUNDPROOF) { - gBattleMons[gActiveBattler].status1 = 0; - gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE; + gBattleMons[battler].status1 = 0; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; } else { - RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); + RecordAbilityBattle(battler, gBattleMons[battler].ability); gBattleCommunication[MULTISTRING_CHOOSER] |= B_MSG_BELL_SOUNDPROOF_PARTNER; } } @@ -8120,11 +13494,11 @@ static void Cmd_healpartystatus(void) u16 ability; if (gBattlerPartyIndexes[gBattlerAttacker] == i) - ability = gBattleMons[gBattlerAttacker].ability; + ability = GetBattlerAbility(gBattlerAttacker); else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattlerPartyIndexes[gActiveBattler] == i - && !(gAbsentBattlerFlags & gBitTable[gActiveBattler])) - ability = gBattleMons[gActiveBattler].ability; + && gBattlerPartyIndexes[battler] == i + && !(gAbsentBattlerFlags & gBitTable[battler])) + ability = GetBattlerAbility(battler); else ability = GetAbilityBySpecies(species, abilityNum); @@ -8141,75 +13515,84 @@ static void Cmd_healpartystatus(void) gBattleMons[gBattlerAttacker].status1 = 0; gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE; - gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); + battler = gActiveBattler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && !(gAbsentBattlerFlags & gBitTable[gActiveBattler])) + && !(gAbsentBattlerFlags & gBitTable[battler])) { - gBattleMons[gActiveBattler].status1 = 0; - gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE; + gBattleMons[battler].status1 = 0; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; } } if (toHeal) { - gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, toHeal, sizeof(zero), &zero); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_cursetarget(void) { + CMD_ARGS(const u8 *failInstr); + if (gBattleMons[gBattlerTarget].status2 & STATUS2_CURSED) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].status2 |= STATUS2_CURSED; + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 2; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trysetspikes(void) { - u8 targetSide = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; + CMD_ARGS(const u8 *failInstr); + + u8 targetSide = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); if (gSideTimers[targetSide].spikesAmount == 3) { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gSideStatuses[targetSide] |= SIDE_STATUS_SPIKES; gSideTimers[targetSide].spikesAmount++; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setforesight(void) { + CMD_ARGS(); + gBattleMons[gBattlerTarget].status2 |= STATUS2_FORESIGHT; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetperishsong(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; s32 notAffectedCount = 0; for (i = 0; i < gBattlersCount; i++) { if (gStatuses3[i] & STATUS3_PERISH_SONG - || gBattleMons[i].ability == ABILITY_SOUNDPROOF) + || GetBattlerAbility(i) == ABILITY_SOUNDPROOF + || BlocksPrankster(gCurrentMove, gBattlerAttacker, i, TRUE)) { notAffectedCount++; } @@ -8217,20 +13600,19 @@ static void Cmd_trysetperishsong(void) { gStatuses3[i] |= STATUS3_PERISH_SONG; gDisableStructs[i].perishSongTimer = 3; - gDisableStructs[i].perishSongTimerStartValue = 3; } } - PressurePPLoseOnUsingPerishSong(gBattlerAttacker); - if (notAffectedCount == gBattlersCount) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_rolloutdamagecalculation(void) +static void Cmd_handlerollout(void) { + CMD_ARGS(); + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { CancelMultiTurnMoves(gBattlerAttacker); @@ -8238,43 +13620,37 @@ static void Cmd_rolloutdamagecalculation(void) } else { - s32 i; - - if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) // first hit + if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) // First hit. { gDisableStructs[gBattlerAttacker].rolloutTimer = 5; gDisableStructs[gBattlerAttacker].rolloutTimerStartValue = 5; gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gBattlerAttacker] = gCurrentMove; } - if (--gDisableStructs[gBattlerAttacker].rolloutTimer == 0) // last hit + if (--gDisableStructs[gBattlerAttacker].rolloutTimer == 0) // Last hit. { gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS; } - gDynamicBasePower = gBattleMoves[gCurrentMove].power; - - for (i = 1; i < (5 - gDisableStructs[gBattlerAttacker].rolloutTimer); i++) - gDynamicBasePower *= 2; - - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_DEFENSE_CURL) - gDynamicBasePower *= 2; - - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifconfusedandstatmaxed(void) { + CMD_ARGS(u8 stat, const u8 *jumpInstr); + if (gBattleMons[gBattlerTarget].status2 & STATUS2_CONFUSION - && gBattleMons[gBattlerTarget].statStages[gBattlescriptCurrInstr[1]] == MAX_STAT_STAGE) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + && !CompareStat(gBattlerTarget, cmd->stat, MAX_STAT_STAGE, CMP_LESS_THAN)) + gBattlescriptCurrInstr = cmd->jumpInstr; // Fails if we're confused AND stat cannot be raised else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_furycuttercalc(void) +static void Cmd_handlefurycutter(void) { + CMD_ARGS(); + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { gDisableStructs[gBattlerAttacker].furyCutterCounter = 0; @@ -8282,51 +13658,76 @@ static void Cmd_furycuttercalc(void) } else { - s32 i; - - if (gDisableStructs[gBattlerAttacker].furyCutterCounter != 5) + if (gDisableStructs[gBattlerAttacker].furyCutterCounter != 5 + && gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_1ST_HIT) // Don't increment counter on first hit gDisableStructs[gBattlerAttacker].furyCutterCounter++; - gDynamicBasePower = gBattleMoves[gCurrentMove].power; - - for (i = 1; i < gDisableStructs[gBattlerAttacker].furyCutterCounter; i++) - gDynamicBasePower *= 2; - - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void Cmd_friendshiptodamagecalculation(void) +static void Cmd_setembargo(void) { - if (gBattleMoves[gCurrentMove].effect == EFFECT_RETURN) - gDynamicBasePower = 10 * (gBattleMons[gBattlerAttacker].friendship) / 25; - else // EFFECT_FRUSTRATION - gDynamicBasePower = 10 * (255 - gBattleMons[gBattlerAttacker].friendship) / 25; + CMD_ARGS(const u8 *failInstr); - gBattlescriptCurrInstr++; + if (gStatuses3[gBattlerTarget] & STATUS3_EMBARGO) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gStatuses3[gBattlerTarget] |= STATUS3_EMBARGO; + gDisableStructs[gBattlerTarget].embargoTimer = 5; + gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_presentdamagecalculation(void) { - s32 rand = Random() & 0xFF; + CMD_ARGS(); - if (rand < 102) - gDynamicBasePower = 40; - else if (rand < 178) - gDynamicBasePower = 80; - else if (rand < 204) - gDynamicBasePower = 120; - else + u32 rand = Random() & 0xFF; + + /* Don't reroll present effect/power for the second hit of Parental Bond. + * Not sure if this is the correct behaviour, but bulbapedia states + * that if present heals the foe, it doesn't strike twice, and if it deals + * damage, the second strike will always deal damage too. This is a simple way + * to replicate that effect. + */ + if (gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_2ND_HIT) { - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - gBattleMoveDamage *= -1; + if (rand < 102) + { + gBattleStruct->presentBasePower = 40; + } + else if (rand < 178) + { + gBattleStruct->presentBasePower = 80; + } + else if (rand < 204) + { + gBattleStruct->presentBasePower = 120; + } + else + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerTarget) / 4; + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + gBattleStruct->presentBasePower = 0; + } } - if (rand < 204) + + if (gBattleStruct->presentBasePower) + { gBattlescriptCurrInstr = BattleScript_HitFromCritCalc; + } else if (gBattleMons[gBattlerTarget].maxHP == gBattleMons[gBattlerTarget].hp) + { gBattlescriptCurrInstr = BattleScript_AlreadyAtFullHp; + } else { gMoveResultFlags &= ~MOVE_RESULT_DOESNT_AFFECT_FOE; @@ -8336,59 +13737,63 @@ static void Cmd_presentdamagecalculation(void) static void Cmd_setsafeguard(void) { - if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD) + CMD_ARGS(); + + if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED; } else { - gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_SAFEGUARD; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardTimer = 5; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardBattlerId = gBattlerAttacker; + gSideStatuses[GetBattlerSide(gBattlerAttacker)] |= SIDE_STATUS_SAFEGUARD; + gSideTimers[GetBattlerSide(gBattlerAttacker)].safeguardTimer = 5; + gSideTimers[GetBattlerSide(gBattlerAttacker)].safeguardBattlerId = gBattlerAttacker; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SAFEGUARD; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_magnitudedamagecalculation(void) { - s32 magnitude = Random() % 100; + CMD_ARGS(); + + u32 magnitude = Random() % 100; if (magnitude < 5) { - gDynamicBasePower = 10; + gBattleStruct->magnitudeBasePower = 10; magnitude = 4; } else if (magnitude < 15) { - gDynamicBasePower = 30; + gBattleStruct->magnitudeBasePower = 30; magnitude = 5; } else if (magnitude < 35) { - gDynamicBasePower = 50; + gBattleStruct->magnitudeBasePower = 50; magnitude = 6; } else if (magnitude < 65) { - gDynamicBasePower = 70; + gBattleStruct->magnitudeBasePower = 70; magnitude = 7; } else if (magnitude < 85) { - gDynamicBasePower = 90; + gBattleStruct->magnitudeBasePower = 90; magnitude = 8; } else if (magnitude < 95) { - gDynamicBasePower = 110; + gBattleStruct->magnitudeBasePower = 110; magnitude = 9; } else { - gDynamicBasePower = 150; + gBattleStruct->magnitudeBasePower = 150; magnitude = 10; } @@ -8398,15 +13803,17 @@ static void Cmd_magnitudedamagecalculation(void) { if (gBattlerTarget == gBattlerAttacker) continue; - if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) // a valid target was found + if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) // A valid target was found. break; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifnopursuitswitchdmg(void) { + CMD_ARGS(const u8 *jumpInstr); + if (gMultiHitCounter == 1) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) @@ -8427,7 +13834,7 @@ static void Cmd_jumpifnopursuitswitchdmg(void) && !(gBattleMons[gBattlerTarget].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) && gBattleMons[gBattlerAttacker].hp && !gDisableStructs[gBattlerTarget].truantCounter - && gChosenMoveByBattler[gBattlerTarget] == MOVE_PURSUIT) + && gMovesInfo[gChosenMoveByBattler[gBattlerTarget]].effect == EFFECT_PURSUIT) { s32 i; @@ -8437,62 +13844,69 @@ static void Cmd_jumpifnopursuitswitchdmg(void) gActionsByTurnOrder[i] = B_ACTION_TRY_FINISH; } - gCurrentMove = MOVE_PURSUIT; + gCurrentMove = gChosenMoveByBattler[gBattlerTarget]; gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerTarget); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleScripting.animTurn = 1; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; } } static void Cmd_setsunny(void) { - if (gBattleWeather & B_WEATHER_SUN) + CMD_ARGS(); + + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_SUN, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = B_WEATHER_SUN_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SUNLIGHT; - gWishFutureKnock.weatherDuration = 5; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Belly Drum -static void Cmd_maxattackhalvehp(void) +static void Cmd_halvehp(void) { + CMD_ARGS(const u8 *failInstr); + + // TODO: Dynamax + // u32 halfHp = GetNonDynamaxMaxHP(gBattlerAttacker) / 2; u32 halfHp = gBattleMons[gBattlerAttacker].maxHP / 2; - if (!(gBattleMons[gBattlerAttacker].maxHP / 2)) + // TODO: Dynamax + if (/* !(GetNonDynamaxMaxHP(gBattlerAttacker) / 2) */ !(gBattleMons[gBattlerAttacker].maxHP / 2)) halfHp = 1; - if (gBattleMons[gBattlerAttacker].statStages[STAT_ATK] < MAX_STAT_STAGE - && gBattleMons[gBattlerAttacker].hp > halfHp) + if (gBattleMons[gBattlerAttacker].hp > halfHp) { - gBattleMons[gBattlerAttacker].statStages[STAT_ATK] = MAX_STAT_STAGE; + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 2; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Psych Up static void Cmd_copyfoestats(void) { + CMD_ARGS(const u8 *unused); + s32 i; for (i = 0; i < NUM_BATTLE_STATS; i++) @@ -8500,23 +13914,21 @@ static void Cmd_copyfoestats(void) gBattleMons[gBattlerAttacker].statStages[i] = gBattleMons[gBattlerTarget].statStages[i]; } - gBattlescriptCurrInstr += 5; // Has an unused jump ptr(possibly for a failed attempt) parameter. + gBattlescriptCurrInstr = cmd->nextInstr; // Has an unused jump ptr(possibly for a failed attempt) parameter. } static void Cmd_rapidspinfree(void) { + CMD_ARGS(); + + u8 atkSide = GetBattlerSide(gBattlerAttacker); + if (gBattleMons[gBattlerAttacker].status2 & STATUS2_WRAPPED) { gBattleScripting.battler = gBattlerTarget; gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED; gBattlerTarget = *(gBattleStruct->wrappedBy + gBattlerAttacker); - - gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN; - gBattleTextBuff1[1] = B_BUFF_MOVE; - gBattleTextBuff1[2] = *(gBattleStruct->wrappedMove + gBattlerAttacker * 2 + 0); - gBattleTextBuff1[3] = *(gBattleStruct->wrappedMove + gBattlerAttacker * 2 + 1); - gBattleTextBuff1[4] = B_BUFF_EOS; - + PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gBattlerAttacker]); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_WrapFree; } @@ -8527,130 +13939,184 @@ static void Cmd_rapidspinfree(void) BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_LeechSeedFree; } - else if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_SPIKES) + else if (gSideStatuses[atkSide] & SIDE_STATUS_SPIKES) { - gSideStatuses[GetBattlerSide(gBattlerAttacker)] &= ~SIDE_STATUS_SPIKES; - gSideTimers[GetBattlerSide(gBattlerAttacker)].spikesAmount = 0; + gSideStatuses[atkSide] &= ~SIDE_STATUS_SPIKES; + gSideTimers[atkSide].spikesAmount = 0; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SpikesFree; } + else if (gSideStatuses[atkSide] & SIDE_STATUS_TOXIC_SPIKES) + { + gSideStatuses[atkSide] &= ~SIDE_STATUS_TOXIC_SPIKES; + gSideTimers[atkSide].toxicSpikesAmount = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ToxicSpikesFree; + } + else if (gSideStatuses[atkSide] & SIDE_STATUS_STICKY_WEB) + { + gSideStatuses[atkSide] &= ~SIDE_STATUS_STICKY_WEB; + gSideTimers[atkSide].stickyWebAmount = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StickyWebFree; + } + else if (gSideStatuses[atkSide] & SIDE_STATUS_STEALTH_ROCK) + { + gSideStatuses[atkSide] &= ~SIDE_STATUS_STEALTH_ROCK; + gSideTimers[atkSide].stealthRockAmount = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StealthRockFree; + } + else if (gSideStatuses[atkSide] & SIDE_STATUS_STEELSURGE) + { + gSideStatuses[atkSide] &= ~SIDE_STATUS_STEELSURGE; + gSideTimers[atkSide].steelsurgeAmount = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SteelsurgeFree; + } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setdefensecurlbit(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status2 |= STATUS2_DEFENSE_CURL; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_recoverbasedonsunlight(void) { - gBattlerTarget = gBattlerAttacker; + CMD_ARGS(const u8 *failInstr); + gBattlerTarget = gBattlerAttacker; if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP) { - if (gBattleWeather == 0 || !WEATHER_HAS_EFFECT) - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; - else if (gBattleWeather & B_WEATHER_SUN) - gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; - else // not sunny weather - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gCurrentMove == MOVE_SHORE_UP) + { + if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) + { + // TODO: Dynamax + // gBattleMoveDamage = 20 * GetNonDynamaxMaxHP(gBattlerAttacker) / 30; + gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; + } + else + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 2; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + } + } + else + { + if (!(gBattleWeather & B_WEATHER_ANY) || !WEATHER_HAS_EFFECT || GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 2; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + } + else if (gBattleWeather & B_WEATHER_SUN) + { + // TODO: Dynamax + // gBattleMoveDamage = 20 * GetNonDynamaxMaxHP(gBattlerAttacker) / 30; + gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; + } + else // not sunny weather + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + } + } if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } -static void Cmd_hiddenpowercalc(void) +static void Cmd_setstickyweb(void) { - s32 powerBits, typeBits; + CMD_ARGS(const u8 *failInstr); - powerBits = ((gBattleMons[gBattlerAttacker].hpIV & 2) >> 1) - | ((gBattleMons[gBattlerAttacker].attackIV & 2) << 0) - | ((gBattleMons[gBattlerAttacker].defenseIV & 2) << 1) - | ((gBattleMons[gBattlerAttacker].speedIV & 2) << 2) - | ((gBattleMons[gBattlerAttacker].spAttackIV & 2) << 3) - | ((gBattleMons[gBattlerAttacker].spDefenseIV & 2) << 4); - typeBits = ((gBattleMons[gBattlerAttacker].hpIV & 1) << 0) - | ((gBattleMons[gBattlerAttacker].attackIV & 1) << 1) - | ((gBattleMons[gBattlerAttacker].defenseIV & 1) << 2) - | ((gBattleMons[gBattlerAttacker].speedIV & 1) << 3) - | ((gBattleMons[gBattlerAttacker].spAttackIV & 1) << 4) - | ((gBattleMons[gBattlerAttacker].spDefenseIV & 1) << 5); + u8 targetSide = GetBattlerSide(gBattlerTarget); - gDynamicBasePower = (40 * powerBits) / 63 + 30; - - // Subtract 3 instead of 1 below because 2 types are excluded (TYPE_NORMAL and TYPE_MYSTERY) - // The final + 1 skips past Normal, and the following conditional skips TYPE_MYSTERY - gBattleStruct->dynamicMoveType = ((NUMBER_OF_MON_TYPES - 3) * typeBits) / 63 + 1; - if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY) - gBattleStruct->dynamicMoveType++; - gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_1 | F_DYNAMIC_TYPE_2; - - gBattlescriptCurrInstr++; + if (gSideStatuses[targetSide] & SIDE_STATUS_STICKY_WEB) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB; + gSideTimers[targetSide].stickyWebBattlerId = gBattlerAttacker; // For Mirror Armor + gSideTimers[targetSide].stickyWebBattlerSide = GetBattlerSide(gBattlerAttacker); // For Court Change/Defiant - set this to the user's side + gSideTimers[targetSide].stickyWebAmount = 1; + gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_selectfirstvalidtarget(void) { + CMD_ARGS(); + for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker) + if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; - if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) + if (IsBattlerAlive(gBattlerTarget)) break; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetfutureattack(void) { + CMD_ARGS(const u8 *failInstr); + if (gWishFutureKnock.futureSightCounter[gBattlerTarget] != 0) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { + gSideStatuses[GetBattlerSide(gBattlerTarget)] |= SIDE_STATUS_FUTUREATTACK; gWishFutureKnock.futureSightMove[gBattlerTarget] = gCurrentMove; - gWishFutureKnock.futureSightAttacker[gBattlerTarget] = gBattlerAttacker; + gWishFutureKnock.futureSightBattlerIndex[gBattlerTarget] = gBattlerAttacker; + gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] = gBattlerPartyIndexes[gBattlerAttacker]; gWishFutureKnock.futureSightCounter[gBattlerTarget] = 3; - gWishFutureKnock.futureSightDmg[gBattlerTarget] = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, - gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0, - 0, gBattlerAttacker, gBattlerTarget); - - if (gProtectStructs[gBattlerAttacker].helpingHand) - gWishFutureKnock.futureSightDmg[gBattlerTarget] = gWishFutureKnock.futureSightDmg[gBattlerTarget] * 15 / 10; if (gCurrentMove == MOVE_DOOM_DESIRE) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trydobeatup(void) { - struct Pokemon *party; +#if B_BEAT_UP >= GEN_5 + CMD_ARGS(); - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) - party = gPlayerParty; - else - party = gEnemyParty; + gBattleStruct->beatUpSlot++; + gBattlescriptCurrInstr = cmd->nextInstr; +#else + CMD_ARGS(const u8 *endInstr, const u8 *failInstr); + struct Pokemon *party = GetBattlerParty(gBattlerAttacker); if (gBattleMons[gBattlerTarget].hp == 0) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->endInstr; } else { @@ -8658,7 +14124,7 @@ static void Cmd_trydobeatup(void) for (;gBattleCommunication[0] < PARTY_SIZE; gBattleCommunication[0]++) { if (GetMonData(&party[gBattleCommunication[0]], MON_DATA_HP) - && GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) + && GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE && GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG && !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS)) break; @@ -8667,10 +14133,10 @@ static void Cmd_trydobeatup(void) { PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattleCommunication[0]) - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleMoveDamage = gSpeciesInfo[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack; - gBattleMoveDamage *= gBattleMoves[gCurrentMove].power; + gBattleMoveDamage *= gMovesInfo[gCurrentMove].power; gBattleMoveDamage *= (GetMonData(&party[gBattleCommunication[0]], MON_DATA_LEVEL) * 2 / 5 + 2); gBattleMoveDamage /= gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseDefense; gBattleMoveDamage = (gBattleMoveDamage / 50) + 2; @@ -8680,210 +14146,295 @@ static void Cmd_trydobeatup(void) gBattleCommunication[0]++; } else if (beforeLoop != 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->endInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = cmd->failInstr; } +#endif } static void Cmd_setsemiinvulnerablebit(void) { - switch (gCurrentMove) + CMD_ARGS(bool8 clear); + + if (gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].semiInvulnerableEffect == TRUE) { - case MOVE_FLY: - case MOVE_BOUNCE: - gStatuses3[gBattlerAttacker] |= STATUS3_ON_AIR; - break; - case MOVE_DIG: - gStatuses3[gBattlerAttacker] |= STATUS3_UNDERGROUND; - break; - case MOVE_DIVE: - gStatuses3[gBattlerAttacker] |= STATUS3_UNDERWATER; - break; + u32 semiInvulnerableEffect = UNCOMPRESS_BITS(HIHALF(gMovesInfo[gCurrentMove].argument)); + if (cmd->clear) + gStatuses3[gBattlerAttacker] &= ~semiInvulnerableEffect; + else + gStatuses3[gBattlerAttacker] |= semiInvulnerableEffect; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_clearsemiinvulnerablebit(void) +static bool32 CheckIfCanFireTwoTurnMoveNow(u8 battler, bool8 checkChargeTurnEffects) { - switch (gCurrentMove) - { - case MOVE_FLY: - case MOVE_BOUNCE: - gStatuses3[gBattlerAttacker] &= ~STATUS3_ON_AIR; - break; - case MOVE_DIG: - gStatuses3[gBattlerAttacker] &= ~STATUS3_UNDERGROUND; - break; - case MOVE_DIVE: - gStatuses3[gBattlerAttacker] &= ~STATUS3_UNDERWATER; - break; - } + // Semi-invulnerable moves cannot skip their charge turn (except with Power Herb) + if (gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].semiInvulnerableEffect == TRUE) + return FALSE; - gBattlescriptCurrInstr++; + // If this move has charge turn effects, it must charge, activate them, then try to fire + if (checkChargeTurnEffects && MoveHasChargeTurnAdditionalEffect(gCurrentMove)) + return FALSE; + + // Insert custom conditions here + + // Certain two-turn moves may fire on the first turn in the right weather (Solar Beam, Electro Shot) + // By default, all two-turn moves have the option of adding weather to their argument + if (IsBattlerWeatherAffected(battler, HIHALF(gMovesInfo[gCurrentMove].argument))) + return TRUE; + + return FALSE; +} + +static void Cmd_tryfiretwoturnmovenowbyeffect(void) +{ + CMD_ARGS(u8 battler, bool8 checkChargeTurnEffects, const u8 *jumpInstr); + + if (CheckIfCanFireTwoTurnMoveNow(cmd->battler, cmd->checkChargeTurnEffects) == TRUE) + { + gBattleScripting.animTurn = 1; + gBattlescriptCurrInstr = cmd->jumpInstr; + } + else + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setminimize(void) { + CMD_ARGS(); + if (gHitMarker & HITMARKER_OBEYS) gStatuses3[gBattlerAttacker] |= STATUS3_MINIMIZED; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_sethail(void) { - if (gBattleWeather & B_WEATHER_HAIL) + CMD_ARGS(); + + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_HAIL, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = B_WEATHER_HAIL_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_HAIL; - gWishFutureKnock.weatherDuration = 5; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trymemento(void) { - if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE + CMD_ARGS(const u8 *failInstr); + + if (B_MEMENTO_FAIL >= GEN_4 + && (gBattleCommunication[MISS_TYPE] == B_MSG_PROTECTED + || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE + || IsBattlerProtected(gBattlerTarget, gCurrentMove) + || DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove))) + { + // Failed, target was protected. + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (B_MEMENTO_FAIL < GEN_4 + && gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE && gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) { // Failed, unprotected target already has minimum Attack and Special Attack. - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { // Success, drop user's HP bar to 0 gActiveBattler = gBattlerAttacker; - gBattleMoveDamage = gBattleMons[gActiveBattler].hp; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp; BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); - MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + MarkBattlerForControllerExec(gBattlerAttacker); + gBattlescriptCurrInstr = cmd->nextInstr; } } // Follow Me static void Cmd_setforcedtarget(void) { - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; - gBattlescriptCurrInstr++; + CMD_ARGS(); + + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 1; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget = gBattlerTarget; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = gMovesInfo[gCurrentMove].powderMove; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setcharge(void) { - gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP; - gDisableStructs[gBattlerAttacker].chargeTimer = 2; - gDisableStructs[gBattlerAttacker].chargeTimerStartValue = 2; + CMD_ARGS(u8 battler); + + u8 battler = GetBattlerForBattleScript(cmd->battler); + gStatuses3[battler] |= STATUS3_CHARGED_UP; + gDisableStructs[battler].chargeTimer = 2; gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Nature Power static void Cmd_callterrainattack(void) { + CMD_ARGS(); + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCurrentMove = sNaturePowerMoves[gBattleTerrain]; + gCurrentMove = GetNaturePowerMove(); gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); - gBattlescriptCurrInstr++; + BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + gBattlescriptCurrInstr = cmd->nextInstr; +} + +u16 GetNaturePowerMove(void) +{ + if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + return MOVE_MOONBLAST; + else if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + return MOVE_THUNDERBOLT; + else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) + return MOVE_ENERGY_BALL; + else if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + return MOVE_PSYCHIC; + else if (sNaturePowerMoves[gBattleTerrain] == MOVE_NONE) + return MOVE_TRI_ATTACK; + return sNaturePowerMoves[gBattleTerrain]; } // Refresh static void Cmd_cureifburnedparalysedorpoisoned(void) { - if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) + CMD_ARGS(const u8 *failInstr); + + if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE)) { gBattleMons[gBattlerAttacker].status1 = 0; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gActiveBattler = gBattlerAttacker; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].status1), &gBattleMons[gBattlerAttacker].status1); + MarkBattlerForControllerExec(gBattlerAttacker); } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_settorment(void) { - if (gBattleMons[gBattlerTarget].status2 & STATUS2_TORMENT) + CMD_ARGS(const u8 *failInstr); + + if (gBattleMons[gBattlerTarget].status2 & STATUS2_TORMENT + /* || IsDynamaxed(gBattlerTarget) */) // TODO: Dynamax { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].status2 |= STATUS2_TORMENT; - gBattlescriptCurrInstr += 5; + gDisableStructs[gBattlerTarget].tormentTimer = PERMANENT_TORMENT; // permanent + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifnodamage(void) { + CMD_ARGS(const u8 *jumpInstr); + if (gProtectStructs[gBattlerAttacker].physicalDmg || gProtectStructs[gBattlerAttacker].specialDmg) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; } static void Cmd_settaunt(void) { - if (gDisableStructs[gBattlerTarget].tauntTimer == 0) + CMD_ARGS(const u8 *failInstr); + + if (B_OBLIVIOUS_TAUNT >= GEN_6 && GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { - gDisableStructs[gBattlerTarget].tauntTimer = 2; - gDisableStructs[gBattlerTarget].tauntTimer2 = 2; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp; + gLastUsedAbility = ABILITY_OBLIVIOUS; + RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); + } + else if (gDisableStructs[gBattlerTarget].tauntTimer == 0) + { + u8 turns; + if (B_TAUNT_TURNS >= GEN_5) + { + turns = 4; + if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker)) + turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia) + } + else if (B_TAUNT_TURNS >= GEN_4) + { + turns = (Random() & 2) + 3; + } + else + { + turns = 2; + } + + gDisableStructs[gBattlerTarget].tauntTimer = turns; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_trysethelpinghand(void) { - gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); + CMD_ARGS(const u8 *failInstr); + + gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBattlerFlags & gBitTable[gBattlerTarget]) && !gProtectStructs[gBattlerAttacker].helpingHand && !gProtectStructs[gBattlerTarget].helpingHand) { - gProtectStructs[gBattlerTarget].helpingHand = 1; - gBattlescriptCurrInstr += 5; + gProtectStructs[gBattlerTarget].helpingHand = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Trick static void Cmd_tryswapitems(void) { + CMD_ARGS(const u8 *failInstr); + // opponent can't swap items with player in regular battles if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER || (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER - | BATTLE_TYPE_EREADER_TRAINER)) - && gTrainerBattleOpponent_A != TRAINER_SECRET_BASE)) + | BATTLE_TYPE_EREADER_TRAINER + | (B_TRAINERS_KNOCK_OFF_ITEMS == TRUE ? BATTLE_TYPE_TRAINER : 0))) + && gTrainerBattleOpponent_A != TRAINER_SECRET_BASE)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gBattlerTarget); - // you can't swap items if they were knocked off in regular battles + // You can't swap items if they were knocked off in regular battles if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER)) @@ -8891,20 +14442,20 @@ static void Cmd_tryswapitems(void) && (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } - // can't swap if two pokemon don't have an item + // can't swap if two Pokémon don't have an item // or if either of them is an enigma berry or a mail else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE) - || gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY - || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY - || IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item) - || IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item)) + || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item) + || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerTarget].item) + || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerTarget].item) + || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } // check if ability prevents swapping - else if (gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) + else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD) { gBattlescriptCurrInstr = BattleScript_StickyHoldActivates; gLastUsedAbility = gBattleMons[gBattlerTarget].ability; @@ -8922,6 +14473,9 @@ static void Cmd_tryswapitems(void) gBattleMons[gBattlerAttacker].item = ITEM_NONE; gBattleMons[gBattlerTarget].item = oldItemAtk; + RecordItemEffectBattle(gBattlerAttacker, 0); + RecordItemEffectBattle(gBattlerTarget, ItemId_GetHoldEffect(oldItemAtk)); + gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(*newItemAtk), newItemAtk); MarkBattlerForControllerExec(gBattlerAttacker); @@ -8930,23 +14484,39 @@ static void Cmd_tryswapitems(void) BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item); MarkBattlerForControllerExec(gBattlerTarget); - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0; + gBattleStruct->choicedMove[gBattlerTarget] = MOVE_NONE; + gBattleStruct->choicedMove[gBattlerAttacker] = MOVE_NONE; - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0; - *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0; - - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; PREPARE_ITEM_BUFFER(gBattleTextBuff1, *newItemAtk) PREPARE_ITEM_BUFFER(gBattleTextBuff2, oldItemAtk) + if (!(sideAttacker == sideTarget && IsPartnerMonFromSameTrainer(gBattlerAttacker))) + { + // if targeting your own side and you aren't in a multi battle, don't save items as stolen + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) + TrySaveExchangedItem(gBattlerAttacker, oldItemAtk); + if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) + TrySaveExchangedItem(gBattlerTarget, *newItemAtk); + } + if (oldItemAtk != ITEM_NONE && *newItemAtk != ITEM_NONE) + { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_BOTH; // attacker's item -> <- target's item + } else if (oldItemAtk == ITEM_NONE && *newItemAtk != ITEM_NONE) + { + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNBURDEN && gBattleResources->flags->flags[gBattlerAttacker] & RESOURCE_FLAG_UNBURDEN) + gBattleResources->flags->flags[gBattlerAttacker] &= ~RESOURCE_FLAG_UNBURDEN; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_TAKEN; // nothing -> <- target's item + } else + { + CheckSetUnburden(gBattlerAttacker); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_GIVEN; // attacker's item -> <- nothing + } } } } @@ -8954,154 +14524,244 @@ static void Cmd_tryswapitems(void) // Role Play static void Cmd_trycopyability(void) { - if (gBattleMons[gBattlerTarget].ability != ABILITY_NONE - && gBattleMons[gBattlerTarget].ability != ABILITY_WONDER_GUARD) + CMD_ARGS(u8 battler, const u8 *failInstr); + + u32 battler = GetBattlerForBattleScript(cmd->battler); + u16 defAbility = gBattleMons[gBattlerTarget].ability; + + if (gBattleMons[battler].ability == defAbility + || defAbility == ABILITY_NONE + || gAbilitiesInfo[gBattleMons[battler].ability].cantBeSuppressed + || gAbilitiesInfo[gBattleMons[BATTLE_PARTNER(battler)].ability].cantBeSuppressed + || gAbilitiesInfo[defAbility].cantBeCopied) { - gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->failInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattleScripting.abilityPopupOverwrite = gBattleMons[battler].ability; + gBattleMons[battler].ability = gBattleStruct->overwrittenAbilities[battler] = defAbility; + gLastUsedAbility = defAbility; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trywish(void) { - switch (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 turnNumber, const u8 *failInstr); + + switch (cmd->turnNumber) { case 0: // use wish if (gWishFutureKnock.wishCounter[gBattlerAttacker] == 0) { gWishFutureKnock.wishCounter[gBattlerAttacker] = 2; - gWishFutureKnock.wishMonId[gBattlerAttacker] = gBattlerPartyIndexes[gBattlerAttacker]; - gBattlescriptCurrInstr += 6; + gWishFutureKnock.wishPartyId[gBattlerAttacker] = gBattlerPartyIndexes[gBattlerAttacker]; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = cmd->failInstr; } break; case 1: // heal effect - PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerTarget, gWishFutureKnock.wishMonId[gBattlerTarget]) - - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - gBattleMoveDamage *= -1; - - if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerTarget, gWishFutureKnock.wishPartyId[gBattlerTarget]) + if (B_WISH_HP_SOURCE >= GEN_5) + { + if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) + gBattleMoveDamage = max(1, GetMonData(&gPlayerParty[gWishFutureKnock.wishPartyId[gBattlerTarget]], MON_DATA_MAX_HP) / 2); + else + gBattleMoveDamage = max(1, GetMonData(&gEnemyParty[gWishFutureKnock.wishPartyId[gBattlerTarget]], MON_DATA_MAX_HP) / 2); + } else - gBattlescriptCurrInstr += 6; + { + // TODO: Dynamax + // gBattleMoveDamage = max(1, GetNonDynamaxMaxHP(gBattlerAttacker) / 2); + gBattleMoveDamage = max(1, gBattleMons[gBattlerTarget].maxHP / 2); + } + + gBattleMoveDamage *= -1; + if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) + gBattlescriptCurrInstr = cmd->failInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; break; } } -// Ingrain -static void Cmd_trysetroots(void) +static void Cmd_settoxicspikes(void) { - if (gStatuses3[gBattlerAttacker] & STATUS3_ROOTED) + CMD_ARGS(const u8 *failInstr); + + u8 targetSide = GetBattlerSide(gBattlerTarget); + if (gSideTimers[targetSide].toxicSpikesAmount >= 2) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { - gStatuses3[gBattlerAttacker] |= STATUS3_ROOTED; - gBattlescriptCurrInstr += 5; + gSideTimers[targetSide].toxicSpikesAmount++; + gSideStatuses[targetSide] |= SIDE_STATUS_TOXIC_SPIKES; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void Cmd_doubledamagedealtifdamaged(void) +static void Cmd_setgastroacid(void) { - if ((gProtectStructs[gBattlerAttacker].physicalDmg != 0 - && gProtectStructs[gBattlerAttacker].physicalBattlerId == gBattlerTarget) - || (gProtectStructs[gBattlerAttacker].specialDmg != 0 - && gProtectStructs[gBattlerAttacker].specialBattlerId == gBattlerTarget)) - { - gBattleScripting.dmgMultiplier = 2; - } + CMD_ARGS(const u8 *failInstr); - gBattlescriptCurrInstr++; + if (gAbilitiesInfo[gBattleMons[gBattlerTarget].ability].cantBeSuppressed) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) + gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; + + gStatuses3[gBattlerTarget] |= STATUS3_GASTRO_ACID; + gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_setyawn(void) { + CMD_ARGS(const u8 *failInstr); + if (gStatuses3[gBattlerTarget] & STATUS3_YAWN || gBattleMons[gBattlerTarget].status1 & STATUS1_ANY) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_ELECTRIC_TERRAIN)) + { + // When Yawn is used while Electric Terrain is set and drowsiness is set from Yawn being used against target in the previous turn: + // "But it failed" will display first. + gBattlescriptCurrInstr = BattleScript_ElectricTerrainPrevents; + } + else if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_MISTY_TERRAIN)) + { + // When Yawn is used while Misty Terrain is set and drowsiness is set from Yawn being used against target in the previous turn: + // "But it failed" will display first. + gBattlescriptCurrInstr = BattleScript_MistyTerrainPrevents; } else { gStatuses3[gBattlerTarget] |= STATUS3_YAWN_TURN(2); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setdamagetohealthdifference(void) { - if (gBattleMons[gBattlerTarget].hp <= gBattleMons[gBattlerAttacker].hp) + CMD_ARGS(const u8 *failInstr); + + if (gBattleMons[gBattlerTarget].hp /* GetNonDynamaxHP(gBattlerTarget) */ <= gBattleMons[gBattlerAttacker].hp) // TODO: Dynamax { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxHP(gBattlerTarget) - gBattleMons[gBattlerAttacker].hp; gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - gBattleMons[gBattlerAttacker].hp; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void Cmd_scaledamagebyhealthratio(void) +static void HandleRoomMove(u32 statusFlag, u8 *timer, u8 stringId) { - if (gDynamicBasePower == 0) + if (gFieldStatuses & statusFlag) { - u8 power = gBattleMoves[gCurrentMove].power; - gDynamicBasePower = gBattleMons[gBattlerAttacker].hp * power / gBattleMons[gBattlerAttacker].maxHP; - if (gDynamicBasePower == 0) - gDynamicBasePower = 1; + gFieldStatuses &= ~statusFlag; + *timer = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = stringId + 1; } - gBattlescriptCurrInstr++; + else + { + gFieldStatuses |= statusFlag; + *timer = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = stringId; + } +} + +static void Cmd_setroom(void) +{ + CMD_ARGS(); + + switch (gMovesInfo[gCurrentMove].effect) + { + case EFFECT_TRICK_ROOM: + HandleRoomMove(STATUS_FIELD_TRICK_ROOM, &gFieldTimers.trickRoomTimer, 0); + break; + case EFFECT_WONDER_ROOM: + HandleRoomMove(STATUS_FIELD_WONDER_ROOM, &gFieldTimers.wonderRoomTimer, 2); + break; + case EFFECT_MAGIC_ROOM: + HandleRoomMove(STATUS_FIELD_MAGIC_ROOM, &gFieldTimers.magicRoomTimer, 4); + break; + default: + gBattleCommunication[MULTISTRING_CHOOSER] = 6; + break; + } + gBattlescriptCurrInstr = cmd->nextInstr; } // Skill Swap static void Cmd_tryswapabilities(void) { - if ((gBattleMons[gBattlerAttacker].ability == ABILITY_NONE - && gBattleMons[gBattlerTarget].ability == ABILITY_NONE) - || gBattleMons[gBattlerAttacker].ability == ABILITY_WONDER_GUARD - || gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD - || gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - } + CMD_ARGS(const u8 *failInstr); + + if (gAbilitiesInfo[gBattleMons[gBattlerAttacker].ability].cantBeSwapped + || gAbilitiesInfo[gBattleMons[gBattlerTarget].ability].cantBeSwapped) + { + RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) + { + RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); + gBattlescriptCurrInstr = cmd->failInstr; + } else { - u16 abilityAtk = gBattleMons[gBattlerAttacker].ability; - gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; - gBattleMons[gBattlerTarget].ability = abilityAtk; + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT /* || IsDynamaxed(gBattlerTarget) */) // TODO: Dynamax + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + u16 abilityAtk = gBattleMons[gBattlerAttacker].ability; + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = abilityAtk; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; + } } } static void Cmd_tryimprison(void) { + CMD_ARGS(const u8 *failInstr); + if ((gStatuses3[gBattlerAttacker] & STATUS3_IMPRISONED_OTHERS)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (B_IMPRISON >= GEN_5) + { + gStatuses3[gBattlerAttacker] |= STATUS3_IMPRISONED_OTHERS; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - u8 battlerId, sideAttacker; + u8 battler, sideAttacker; sideAttacker = GetBattlerSide(gBattlerAttacker); - PressurePPLoseOnUsingImprison(gBattlerAttacker); - for (battlerId = 0; battlerId < gBattlersCount; battlerId++) + for (battler = 0; battler < gBattlersCount; battler++) { - if (sideAttacker != GetBattlerSide(battlerId)) + if (sideAttacker != GetBattlerSide(battler)) { s32 attackerMoveId; for (attackerMoveId = 0; attackerMoveId < MAX_MON_MOVES; attackerMoveId++) @@ -9109,7 +14769,7 @@ static void Cmd_tryimprison(void) s32 i; for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gBattlerAttacker].moves[attackerMoveId] == gBattleMons[battlerId].moves[i] + if (gBattleMons[gBattlerAttacker].moves[attackerMoveId] == gBattleMons[battler].moves[i] && gBattleMons[gBattlerAttacker].moves[attackerMoveId] != MOVE_NONE) break; } @@ -9119,384 +14779,465 @@ static void Cmd_tryimprison(void) if (attackerMoveId != MAX_MON_MOVES) { gStatuses3[gBattlerAttacker] |= STATUS3_IMPRISONED_OTHERS; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; break; } } } - if (battlerId == gBattlersCount) // In Generation 3 games, Imprison fails if the user doesn't share any moves with any of the foes - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + if (battler == gBattlersCount) // In Generation 3 games, Imprison fails if the user doesn't share any moves with any of the foes. + gBattlescriptCurrInstr = cmd->failInstr; } } -static void Cmd_trysetgrudge(void) +static void Cmd_setstealthrock(void) { - if (gStatuses3[gBattlerAttacker] & STATUS3_GRUDGE) + CMD_ARGS(const u8 *failInstr); + + u8 targetSide = GetBattlerSide(gBattlerTarget); + if (gSideStatuses[targetSide] & SIDE_STATUS_STEALTH_ROCK) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { - gStatuses3[gBattlerAttacker] |= STATUS3_GRUDGE; - gBattlescriptCurrInstr += 5; + gSideStatuses[targetSide] |= SIDE_STATUS_STEALTH_ROCK; + gSideTimers[targetSide].stealthRockAmount = 1; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void Cmd_weightdamagecalculation(void) +static void Cmd_setuserstatus3(void) { - s32 i; - for (i = 0; sWeightToDamageTable[i] != 0xFFFF; i += 2) + CMD_ARGS(u32 flags, const u8 *failInstr); + + u32 flags = cmd->flags; + + if (gStatuses3[gBattlerAttacker] & flags) { - if (sWeightToDamageTable[i] > GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1)) - break; + gBattlescriptCurrInstr = cmd->failInstr; } - - if (sWeightToDamageTable[i] != 0xFFFF) - gDynamicBasePower = sWeightToDamageTable[i + 1]; else - gDynamicBasePower = 120; - - gBattlescriptCurrInstr++; + { + gStatuses3[gBattlerAttacker] |= flags; + if (flags & STATUS3_MAGNET_RISE) + gDisableStructs[gBattlerAttacker].magnetRiseTimer = 5; + if (flags & STATUS3_LASER_FOCUS) + gDisableStructs[gBattlerAttacker].laserFocusTimer = 2; + gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_assistattackselect(void) { + CMD_ARGS(const u8 *failInstr); + s32 chooseableMovesNo = 0; - struct Pokemon* party; + struct Pokemon *party; s32 monId, moveId; - u16 *validMoves = gBattleStruct->assistPossibleMoves; + u16 *validMoves = Alloc(sizeof(u16) * PARTY_SIZE * MAX_MON_MOVES); - if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER) - party = gEnemyParty; - else - party = gPlayerParty; - - for (monId = 0; monId < PARTY_SIZE; monId++) + if (validMoves != NULL) { - if (monId == gBattlerPartyIndexes[gBattlerAttacker]) - continue; - if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE) - continue; - if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) - continue; + party = GetBattlerParty(gBattlerAttacker); - for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) + for (monId = 0; monId < PARTY_SIZE; monId++) { - s32 i = 0; - u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId); - - if (IsInvalidForSleepTalkOrAssist(move)) + if (monId == gBattlerPartyIndexes[gBattlerAttacker]) + continue; + if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE) + continue; + if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) continue; - for (; sMovesForbiddenToCopy[i] != ASSIST_FORBIDDEN_END && move != sMovesForbiddenToCopy[i]; i++); + for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) + { + u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId); - if (sMovesForbiddenToCopy[i] != ASSIST_FORBIDDEN_END) - continue; - if (move == MOVE_NONE) - continue; + if (gMovesInfo[move].assistBanned) + continue; - validMoves[chooseableMovesNo] = move; - chooseableMovesNo++; + validMoves[chooseableMovesNo++] = move; + } } } + if (chooseableMovesNo) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCalledMove = validMoves[((Random() & 0xFF) * chooseableMovesNo) >> 8]; + gCalledMove = validMoves[Random() % chooseableMovesNo]; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } + + TRY_FREE_AND_SET_NULL(validMoves); } static void Cmd_trysetmagiccoat(void) { - gBattlerTarget = gBattlerAttacker; - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + CMD_ARGS(const u8 *failInstr); + if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gProtectStructs[gBattlerAttacker].bounceMove = TRUE; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } // Snatch static void Cmd_trysetsnatch(void) { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + CMD_ARGS(const u8 *failInstr); + if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { - gProtectStructs[gBattlerAttacker].stealMove = 1; - gBattlescriptCurrInstr += 5; + gProtectStructs[gBattlerAttacker].stealMove = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; } } -static void Cmd_trygetintimidatetarget(void) +static void Cmd_unused2(void) { - u8 side; - - gBattleScripting.battler = gBattleStruct->intimidateBattler; - side = GetBattlerSide(gBattleScripting.battler); - - PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gBattleMons[gBattleScripting.battler].ability) - - for (;gBattlerTarget < gBattlersCount; gBattlerTarget++) - { - if (GetBattlerSide(gBattlerTarget) == side) - continue; - if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) - break; - } - - if (gBattlerTarget >= gBattlersCount) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - else - gBattlescriptCurrInstr += 5; } static void Cmd_switchoutabilities(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); - switch (gBattleMons[gActiveBattler].ability) + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + if (gBattleMons[battler].ability == ABILITY_NEUTRALIZING_GAS) { - case ABILITY_NATURAL_CURE: - gBattleMons[gActiveBattler].status1 = 0; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, - gBitTable[*(gBattleStruct->battlerPartyIndexes + gActiveBattler)], - sizeof(gBattleMons[gActiveBattler].status1), - &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); - break; + gBattleMons[battler].ability = ABILITY_NONE; + BattleScriptPush(gBattlescriptCurrInstr); + gBattlescriptCurrInstr = BattleScript_NeutralizingGasExits; } + else + { + switch (GetBattlerAbility(battler)) + { + case ABILITY_NATURAL_CURE: + gBattleMons[battler].status1 = 0; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, + gBitTable[*(gBattleStruct->battlerPartyIndexes + battler)], + sizeof(gBattleMons[battler].status1), + &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + break; + case ABILITY_REGENERATOR: + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 3; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 3; + gBattleMoveDamage += gBattleMons[battler].hp; + if (gBattleMoveDamage > gBattleMons[battler].maxHP) + gBattleMoveDamage = gBattleMons[battler].maxHP; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, + gBitTable[*(gBattleStruct->battlerPartyIndexes + battler)], + sizeof(gBattleMoveDamage), + &gBattleMoveDamage); + MarkBattlerForControllerExec(battler); + break; + } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_jumpifhasnohp(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler, const u8 *jumpInstr); - if (gBattleMons[gActiveBattler].hp == 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + u32 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + + if (gBattleMons[battler].hp == 0) + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_getsecretpowereffect(void) +static void Cmd_jumpifnotcurrentmoveargtype(void) { - switch (gBattleTerrain) - { - case BATTLE_TERRAIN_GRASS: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_POISON; - break; - case BATTLE_TERRAIN_LONG_GRASS: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_SLEEP; - break; - case BATTLE_TERRAIN_SAND: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_ACC_MINUS_1; - break; - case BATTLE_TERRAIN_UNDERWATER: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_DEF_MINUS_1; - break; - case BATTLE_TERRAIN_WATER: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_ATK_MINUS_1; - break; - case BATTLE_TERRAIN_POND: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_SPD_MINUS_1; - break; - case BATTLE_TERRAIN_MOUNTAIN: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_CONFUSION; - break; - case BATTLE_TERRAIN_CAVE: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_FLINCH; - break; - default: - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_PARALYSIS; - break; - } - gBattlescriptCurrInstr++; + CMD_ARGS(u8 battler, const u8 *failInstr); + + u8 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + const u8 *failInstr = cmd->failInstr; + + if (!IS_BATTLER_OF_TYPE(battler, gMovesInfo[gCurrentMove].argument)) + gBattlescriptCurrInstr = failInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_pickup(void) { - s32 i; - u32 j; - u16 species, heldItem; - u32 ability; + CMD_ARGS(); + + u32 i, j; + u16 species, heldItem, ability; + u8 lvlDivBy10; for (i = 0; i < PARTY_SIZE; i++) { species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG); heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); - if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE) - ability = gSpeciesInfo[species].abilities[1]; - else - ability = gSpeciesInfo[species].abilities[0]; - if (ability == ABILITY_PICKUP && species != SPECIES_NONE && species != SPECIES_EGG && heldItem == ITEM_NONE && !(Random() % 10)) - { - s32 random = Random() % 100; + lvlDivBy10 = (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL)-1) / 10; //Moving this here makes it easier to add in abilities like Honey Gather. + if (lvlDivBy10 > 9) + lvlDivBy10 = 9; - for (j = 0; j < 15; ++j) - if (sPickupItems[j].chance > random) + ability = gSpeciesInfo[species].abilities[GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)]; + + if (ability == ABILITY_PICKUP + && species != SPECIES_NONE + && species != SPECIES_EGG + && heldItem == ITEM_NONE + && (Random() % 10) == 0) + { + u32 rand = Random() % 100; + u32 percentTotal = 0; + + for (j = 0; j < ARRAY_COUNT(sPickupTable); j++) + { + percentTotal += sPickupTable[j].percentage[lvlDivBy10]; + if (rand < percentTotal) + { + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sPickupTable[j].itemId); break; - SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sPickupItems[j]); + } + } + } + else if (ability == ABILITY_HONEY_GATHER + && species != 0 + && species != SPECIES_EGG + && heldItem == ITEM_NONE) + { + if ((lvlDivBy10 + 1 ) * 5 > Random() % 100) + { + heldItem = ITEM_HONEY; + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); + } + } + else if (P_SHUCKLE_BERRY_JUICE == GEN_2 + && species == SPECIES_SHUCKLE + && heldItem == ITEM_ORAN_BERRY + && (Random() % 16) == 0) + { + heldItem = ITEM_BERRY_JUICE; + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); } } - gBattlescriptCurrInstr++; + + gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_docastformchangeanimation(void) +static void Cmd_unused3(void) { - gActiveBattler = gBattleScripting.battler; - - if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) - *(&gBattleStruct->formToChangeInto) |= CASTFORM_SUBSTITUTE; - - BtlController_EmitBattleAnimation(BUFFER_A, B_ANIM_CASTFORM_CHANGE, gBattleStruct->formToChangeInto); - MarkBattlerForControllerExec(gActiveBattler); - - gBattlescriptCurrInstr++; } -static void Cmd_trycastformdatachange(void) +static void Cmd_unused4(void) { - u8 form; - - gBattlescriptCurrInstr++; - form = CastformDataTypeChange(gBattleScripting.battler); - if (form) - { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); - *(&gBattleStruct->formToChangeInto) = form - 1; - } } // Water and Mud Sport static void Cmd_settypebasedhalvers(void) { + CMD_ARGS(const u8 *failInstr); + bool8 worked = FALSE; - if (gBattleMoves[gCurrentMove].effect == EFFECT_MUD_SPORT) + if (gMovesInfo[gCurrentMove].effect == EFFECT_MUD_SPORT) { - if (!(gStatuses4[gBattlerAttacker] & STATUS4_MUD_SPORT)) + if (B_SPORT_TURNS >= GEN_6) { - gStatuses4[gBattlerAttacker] |= STATUS4_MUD_SPORT; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_ELECTRIC; - worked = TRUE; + if (!(gFieldStatuses & STATUS_FIELD_MUDSPORT)) + { + gFieldStatuses |= STATUS_FIELD_MUDSPORT; + gFieldTimers.mudSportTimer = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_ELECTRIC; + worked = TRUE; + } + } + else + { + if (!(gStatuses4[gBattlerAttacker] & STATUS4_MUD_SPORT)) + { + gStatuses4[gBattlerAttacker] |= STATUS4_MUD_SPORT; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_ELECTRIC; + worked = TRUE; + } } } else // Water Sport { - if (!(gStatuses4[gBattlerAttacker] & STATUS4_WATER_SPORT)) + if (B_SPORT_TURNS >= GEN_6) { - gStatuses4[gBattlerAttacker] |= STATUS4_WATER_SPORT; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_FIRE; - worked = TRUE; + if (!(gFieldStatuses & STATUS_FIELD_WATERSPORT)) + { + gFieldStatuses |= STATUS_FIELD_WATERSPORT; + gFieldTimers.waterSportTimer = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_FIRE; + worked = TRUE; + } + } + else + { + if (!(gStatuses4[gBattlerAttacker] & STATUS4_WATER_SPORT)) + { + gStatuses4[gBattlerAttacker] |= STATUS4_WATER_SPORT; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_FIRE; + worked = TRUE; + } } } if (worked) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } -static void Cmd_setweatherballtype(void) +bool32 DoesSubstituteBlockMove(u32 battlerAtk, u32 battlerDef, u32 move) { - if (WEATHER_HAS_EFFECT) - { - if (gBattleWeather & B_WEATHER_ANY) - gBattleScripting.dmgMultiplier = 2; - if (gBattleWeather & B_WEATHER_RAIN) - *(&gBattleStruct->dynamicMoveType) = TYPE_WATER | F_DYNAMIC_TYPE_2; - else if (gBattleWeather & B_WEATHER_SANDSTORM) - *(&gBattleStruct->dynamicMoveType) = TYPE_ROCK | F_DYNAMIC_TYPE_2; - else if (gBattleWeather & B_WEATHER_SUN) - *(&gBattleStruct->dynamicMoveType) = TYPE_FIRE | F_DYNAMIC_TYPE_2; - else if (gBattleWeather & B_WEATHER_HAIL) - *(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_2; - else - *(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_2; - } + if (!(gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE)) + return FALSE; + else if (gMovesInfo[move].ignoresSubstitute) + return FALSE; + else if (GetBattlerAbility(battlerAtk) == ABILITY_INFILTRATOR) + return FALSE; + else + return TRUE; +} - gBattlescriptCurrInstr++; +bool32 DoesDisguiseBlockMove(u32 battler, u32 move) +{ + // TODO: Totems + if (!(gBattleMons[battler].species == SPECIES_MIMIKYU_DISGUISED /* || gBattleMons[battler].species == SPECIES_MIMIKYU_TOTEM_DISGUISED */) + || gBattleMons[battler].status2 & STATUS2_TRANSFORMED + || (!gProtectStructs[battler].confusionSelfDmg && (IS_MOVE_STATUS(move) || gHitMarker & HITMARKER_PASSIVE_DAMAGE)) + || gHitMarker & HITMARKER_IGNORE_DISGUISE + || GetBattlerAbility(battler) != ABILITY_DISGUISE) + return FALSE; + else + return TRUE; +} + +static void Cmd_jumpifsubstituteblocks(void) +{ + CMD_ARGS(const u8 *jumpInstr); + + if (DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryrecycleitem(void) { + CMD_ARGS(const u8 *failInstr); + u16 *usedHeldItem; gActiveBattler = gBattlerAttacker; - usedHeldItem = &gBattleStruct->usedHeldItems[gActiveBattler]; - if (*usedHeldItem != ITEM_NONE && gBattleMons[gActiveBattler].item == ITEM_NONE) + usedHeldItem = &gBattleStruct->usedHeldItems[gBattlerPartyIndexes[gBattlerAttacker]][GetBattlerSide(gBattlerAttacker)]; + if (*usedHeldItem != ITEM_NONE && gBattleMons[gBattlerAttacker].item == ITEM_NONE) { gLastUsedItem = *usedHeldItem; *usedHeldItem = ITEM_NONE; - gBattleMons[gActiveBattler].item = gLastUsedItem; + gBattleMons[gBattlerAttacker].item = gLastUsedItem; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].item), &gBattleMons[gBattlerAttacker].item); + MarkBattlerForControllerExec(gBattlerAttacker); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } +bool32 CanCamouflage(u8 battler) +{ + if (IS_BATTLER_OF_TYPE(battler, sTerrainToType[gBattleTerrain])) + return FALSE; + return TRUE; +} + static void Cmd_settypetoterrain(void) { - if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain])) - { - SET_BATTLER_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain]); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, sTerrainToType[gBattleTerrain]); + CMD_ARGS(const u8 *failInstr); - gBattlescriptCurrInstr += 5; + u8 terrainType; + switch(gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + case STATUS_FIELD_ELECTRIC_TERRAIN: + terrainType = TYPE_ELECTRIC; + break; + case STATUS_FIELD_GRASSY_TERRAIN: + terrainType = TYPE_GRASS; + break; + case STATUS_FIELD_MISTY_TERRAIN: + terrainType = TYPE_FAIRY; + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + terrainType = TYPE_PSYCHIC; + break; + default: + terrainType = sTerrainToType[gBattleTerrain]; + break; + } + + if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, terrainType)) + { + SET_BATTLER_TYPE(gBattlerAttacker, terrainType); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, terrainType); + + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Unused static void Cmd_pursuitdoubles(void) { - gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); + CMD_ARGS(const u8 *failInstr); + + u32 battler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && !(gAbsentBattlerFlags & gBitTable[gActiveBattler]) - && gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_MOVE - && gChosenMoveByBattler[gActiveBattler] == MOVE_PURSUIT) + && !(gAbsentBattlerFlags & gBitTable[battler]) + && gChosenActionByBattler[battler] == B_ACTION_USE_MOVE + && gMovesInfo[gChosenMoveByBattler[battler]].effect == EFFECT_PURSUIT) { - gActionsByTurnOrder[gActiveBattler] = B_ACTION_TRY_FINISH; - gCurrentMove = MOVE_PURSUIT; - gBattlescriptCurrInstr += 5; + gActionsByTurnOrder[battler] = B_ACTION_TRY_FINISH; + gCurrentMove = gChosenMoveByBattler[battler]; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleScripting.animTurn = 1; - gBattleScripting.pursuitDoublesAttacker = gBattlerAttacker; - gBattlerAttacker = gActiveBattler; + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_snatchsetbattlers(void) { + CMD_ARGS(); + gEffectBattler = gBattlerAttacker; if (gBattlerAttacker == gBattlerTarget) @@ -9505,20 +15246,38 @@ static void Cmd_snatchsetbattlers(void) gBattlerTarget = gBattleScripting.battler; gBattleScripting.battler = gEffectBattler; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Brick Break static void Cmd_removelightscreenreflect(void) { - u8 opposingSide = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; + CMD_ARGS(); - if (gSideTimers[opposingSide].reflectTimer || gSideTimers[opposingSide].lightscreenTimer) + u8 side; + bool32 failed; + + if (B_BRICK_BREAK >= GEN_4) + side = GetBattlerSide(gBattlerTarget); // From Gen 4 onwards, Brick Break can remove screens on the user's side if used on an ally + else + side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; + + if (B_BRICK_BREAK >= GEN_5) + failed = (gMoveResultFlags & MOVE_RESULT_NO_EFFECT); + else + failed = FALSE; + + if (!failed + && (gSideTimers[side].reflectTimer + || gSideTimers[side].lightscreenTimer + || gSideTimers[side].auroraVeilTimer)) { - gSideStatuses[opposingSide] &= ~SIDE_STATUS_REFLECT; - gSideStatuses[opposingSide] &= ~SIDE_STATUS_LIGHTSCREEN; - gSideTimers[opposingSide].reflectTimer = 0; - gSideTimers[opposingSide].lightscreenTimer = 0; + gSideStatuses[side] &= ~SIDE_STATUS_REFLECT; + gSideStatuses[side] &= ~SIDE_STATUS_LIGHTSCREEN; + gSideStatuses[side] &= ~SIDE_STATUS_AURORA_VEIL; + gSideTimers[side].reflectTimer = 0; + gSideTimers[side].lightscreenTimer = 0; + gSideTimers[side].auroraVeilTimer = 0; gBattleScripting.animTurn = 1; gBattleScripting.animTargetsHit = 1; } @@ -9528,7 +15287,7 @@ static void Cmd_removelightscreenreflect(void) gBattleScripting.animTargetsHit = 0; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } u8 GetCatchingBattler(void) @@ -9541,12 +15300,16 @@ u8 GetCatchingBattler(void) static void Cmd_handleballthrow(void) { - u8 ballMultiplier = 0; + CMD_ARGS(); + + u16 ballMultiplier = 100; + s8 ballAddition = 0; + if (gBattleControllerExecFlags) return; gActiveBattler = gBattlerAttacker; - gBattlerTarget = gBattlerAttacker ^ BIT_SIDE; + gBattlerTarget = GetCatchingBattler(); if (gBattleTypeFlags & BATTLE_TYPE_GHOST) { @@ -9557,7 +15320,7 @@ static void Cmd_handleballthrow(void) else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { BtlController_EmitBallThrowAnim(BUFFER_A, BALL_TRAINER_BLOCK); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_TrainerBallBlock; } else if (gBattleTypeFlags & (BATTLE_TYPE_POKEDUDE | BATTLE_TYPE_OLD_MAN_TUTORIAL)) @@ -9568,88 +15331,209 @@ static void Cmd_handleballthrow(void) } else { - u32 odds; + u32 odds, i; u8 catchRate; - if (gLastUsedItem == ITEM_SAFARI_BALL) + gLastThrownBall = gLastUsedItem; + gBallToDisplay = gLastThrownBall; + if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) catchRate = gBattleStruct->safariCatchFactor * 1275 / 100; else catchRate = gSpeciesInfo[gBattleMons[gBattlerTarget].species].catchRate; - if (gLastUsedItem > ITEM_SAFARI_BALL) + if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].isUltraBeast) + { + if (gLastUsedItem == ITEM_BEAST_BALL) + ballMultiplier = 500; + else + ballMultiplier = 10; + } + else { switch (gLastUsedItem) { + case ITEM_ULTRA_BALL: + ballMultiplier = 200; + break; + case ITEM_SPORT_BALL: + if (B_SPORT_BALL_MODIFIER <= GEN_7) + ballMultiplier = 150; + break; + case ITEM_GREAT_BALL: + ballMultiplier = 150; + break; + case ITEM_SAFARI_BALL: + if (B_SAFARI_BALL_MODIFIER <= GEN_7) + ballMultiplier = 150; + break; case ITEM_NET_BALL: if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG)) - ballMultiplier = 30; - else - ballMultiplier = 10; + ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300; break; case ITEM_DIVE_BALL: - if (GetCurrentMapType() == MAP_TYPE_UNDERWATER) - ballMultiplier = 35; - else - ballMultiplier = 10; + // TODO: gIsFishingEncounter and gIsSurfingEncounter + // if (GetCurrentMapType() == MAP_TYPE_UNDERWATER + // || (B_DIVE_BALL_MODIFIER >= GEN_4 && (gIsFishingEncounter || gIsSurfingEncounter))) + // ballMultiplier = 350; break; case ITEM_NEST_BALL: - if (gBattleMons[gBattlerTarget].level < 40) + if (B_NEST_BALL_MODIFIER >= GEN_6) { - ballMultiplier = 40 - gBattleMons[gBattlerTarget].level; - if (ballMultiplier <= 9) - ballMultiplier = 10; + //((41 - Pokémon's level) ÷ 10)× if Pokémon's level is between 1 and 29, 1× otherwise. + if (gBattleMons[gBattlerTarget].level < 30) + ballMultiplier = 410 - (gBattleMons[gBattlerTarget].level * 10); } - else + else if (B_NEST_BALL_MODIFIER >= GEN_5) { - ballMultiplier = 10; + //((41 - Pokémon's level) ÷ 10)×, minimum 1× + if (gBattleMons[gBattlerTarget].level < 31) + ballMultiplier = 410 - (gBattleMons[gBattlerTarget].level * 10); + } + else if (gBattleMons[gBattlerTarget].level < 40) + { + //((40 - Pokémon's level) ÷ 10)×, minimum 1× + ballMultiplier = 400 - (gBattleMons[gBattlerTarget].level * 10); + if (ballMultiplier <= 90) + ballMultiplier = 100; } break; case ITEM_REPEAT_BALL: if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT)) - ballMultiplier = 30; - else - ballMultiplier = 10; + ballMultiplier = (B_REPEAT_BALL_MODIFIER >= GEN_7 ? 350 : 300); break; case ITEM_TIMER_BALL: - ballMultiplier = gBattleResults.battleTurnCounter + 10; - if (ballMultiplier > 40) - ballMultiplier = 40; + ballMultiplier = 100 + (gBattleResults.battleTurnCounter * (B_TIMER_BALL_MODIFIER >= GEN_5 ? 30 : 10)); + if (ballMultiplier > 400) + ballMultiplier = 400; break; - case ITEM_LUXURY_BALL: - case ITEM_PREMIER_BALL: + case ITEM_DUSK_BALL: + // TODO: RTC + // i = GetTimeOfDay(); + // if (i == TIME_EVENING || i == TIME_NIGHT || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND) + // ballMultiplier = (B_DUSK_BALL_MODIFIER >= GEN_7 ? 300 : 350); + break; + case ITEM_QUICK_BALL: + if (gBattleResults.battleTurnCounter == 0) + ballMultiplier = (B_QUICK_BALL_MODIFIER >= GEN_5 ? 500 : 400); + break; + case ITEM_LEVEL_BALL: + if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level) + ballMultiplier = 800; + else if (gBattleMons[gBattlerAttacker].level > 2 * gBattleMons[gBattlerTarget].level) + ballMultiplier = 400; + else if (gBattleMons[gBattlerAttacker].level > gBattleMons[gBattlerTarget].level) + ballMultiplier = 200; + break; + case ITEM_LURE_BALL: + // TODO: gIsFishingEncounter + // if (gIsFishingEncounter) + // { + // if (B_LURE_BALL_MODIFIER >= GEN_8) + // ballMultiplier = 400; + // else if (B_LURE_BALL_MODIFIER >= GEN_7) + // ballMultiplier = 500; + // else + // ballMultiplier = 300; + // } + break; + case ITEM_MOON_BALL: + { + const struct Evolution *evolutions = GetSpeciesEvolutions(gBattleMons[gBattlerTarget].species); + if (evolutions == NULL) + break; + for (i = 0; evolutions[i].method != EVOLUTIONS_END; i++) + { + if (evolutions[i].method == EVO_ITEM + && evolutions[i].param == ITEM_MOON_STONE) + ballMultiplier = 400; + } + } + break; + case ITEM_LOVE_BALL: + if (gBattleMons[gBattlerTarget].species == gBattleMons[gBattlerAttacker].species) + { + u8 gender1 = GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]); + u8 gender2 = GetMonGender(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]); + + if (gender1 != gender2 && gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS) + ballMultiplier = 800; + } + break; + case ITEM_FAST_BALL: + if (gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseSpeed >= 100) + ballMultiplier = 400; + break; + case ITEM_HEAVY_BALL: + i = GetSpeciesWeight(gBattleMons[gBattlerTarget].species); + if (B_HEAVY_BALL_MODIFIER >= GEN_7) + { + if (i < 1000) + ballAddition = -20; + else if (i < 2000) + ballAddition = 0; + else if (i < 3000) + ballAddition = 20; + else + ballAddition = 30; + } + else if (B_HEAVY_BALL_MODIFIER >= GEN_4) + { + if (i < 2048) + ballAddition = -20; + else if (i < 3072) + ballAddition = 20; + else if (i < 4096) + ballAddition = 30; + else + ballAddition = 40; + } + else + { + if (i < 1024) + ballAddition = -20; + else if (i < 2048) + ballAddition = 0; + else if (i < 3072) + ballAddition = 20; + else if (i < 4096) + ballAddition = 30; + else + ballAddition = 40; + } + break; + case ITEM_DREAM_BALL: + if (B_DREAM_BALL_MODIFIER >= GEN_8 && (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)) + ballMultiplier = 400; + break; + case ITEM_BEAST_BALL: ballMultiplier = 10; break; } } - else - ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL]; - odds = (catchRate * ballMultiplier / 10) + // catchRate is unsigned, which means that it may potentially overflow if sum is applied directly. + if (catchRate < 21 && ballAddition == -20) + catchRate = 1; + else + catchRate = catchRate + ballAddition; + + odds = (catchRate * ballMultiplier / 100) * (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2) / (3 * gBattleMons[gBattlerTarget].maxHP); if (gBattleMons[gBattlerTarget].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) odds *= 2; - if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) + if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE)) odds = (odds * 15) / 10; - if (gLastUsedItem != ITEM_SAFARI_BALL) - { - if (gLastUsedItem == ITEM_MASTER_BALL) - { - gBattleResults.usedMasterBall = TRUE; - } - else - { - if (gBattleResults.catchAttempts[gLastUsedItem - ITEM_ULTRA_BALL] < 255) - gBattleResults.catchAttempts[gLastUsedItem - ITEM_ULTRA_BALL]++; - } - } + if (gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL] < 255) + gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL]++; if (odds > 254) // mon caught { BtlController_EmitBallThrowAnim(BUFFER_A, BALL_3_SHAKES_SUCCESS); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); + TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE); gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); @@ -9657,24 +15541,54 @@ static void Cmd_handleballthrow(void) gBattleCommunication[MULTISTRING_CHOOSER] = 0; else gBattleCommunication[MULTISTRING_CHOOSER] = 1; + + if (gLastUsedItem == ITEM_HEAL_BALL) + { + MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]); + HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget); + gBattleMons[gBattlerTarget].hp = gBattleMons[gBattlerTarget].maxHP; + SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_HP, &gBattleMons[gBattlerTarget].hp); + } } else // mon may be caught, calculate shakes { u8 shakes; + u8 maxShakes; - odds = Sqrt(Sqrt(16711680 / odds)); - odds = 1048560 / odds; + // TODO: critical capture + gBattleSpritesDataPtr->animationData->isCriticalCapture = FALSE; + gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = FALSE; - for (shakes = 0; shakes < BALL_3_SHAKES_SUCCESS && Random() < odds; shakes++); + if (CriticalCapture(odds)) + { + maxShakes = BALL_1_SHAKE; // critical capture doesn't guarantee capture + gBattleSpritesDataPtr->animationData->isCriticalCapture = TRUE; + } + else + { + maxShakes = BALL_3_SHAKES_SUCCESS; + } if (gLastUsedItem == ITEM_MASTER_BALL) - shakes = BALL_3_SHAKES_SUCCESS; // why calculate the shakes before that check? + { + shakes = maxShakes; + } + else + { + odds = Sqrt(Sqrt(16711680 / odds)); + odds = 1048560 / odds; + for (shakes = 0; shakes < maxShakes && Random() < odds; shakes++); + } BtlController_EmitBallThrowAnim(BUFFER_A, shakes); - MarkBattlerForControllerExec(gActiveBattler); + MarkBattlerForControllerExec(gBattlerAttacker); - if (shakes == BALL_3_SHAKES_SUCCESS) // mon caught, copy of the code above + if (shakes == maxShakes) // mon caught, copy of the code above { + if (IsCriticalCapture()) + gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = TRUE; + + TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE); gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); @@ -9682,10 +15596,25 @@ static void Cmd_handleballthrow(void) gBattleCommunication[MULTISTRING_CHOOSER] = 0; else gBattleCommunication[MULTISTRING_CHOOSER] = 1; + + if (gLastUsedItem == ITEM_HEAL_BALL) + { + MonRestorePP(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]); + HealStatusConditions(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], STATUS1_ANY, gBattlerTarget); + gBattleMons[gBattlerTarget].hp = gBattleMons[gBattlerTarget].maxHP; + SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_HP, &gBattleMons[gBattlerTarget].hp); + } } else // not caught { - gBattleCommunication[MULTISTRING_CHOOSER] = shakes; + if (!gHasFetchedBall) + gLastUsedBall = gLastUsedItem; + + if (IsCriticalCapture()) + gBattleCommunication[MULTISTRING_CHOOSER] = BALL_3_SHAKES_FAIL; + else + gBattleCommunication[MULTISTRING_CHOOSER] = shakes; + gBattlescriptCurrInstr = BattleScript_ShakeBallThrow; } } @@ -9694,18 +15623,20 @@ static void Cmd_handleballthrow(void) static void Cmd_givecaughtmon(void) { - if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]]) != MON_GIVEN_TO_PARTY) + CMD_ARGS(); + + if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]]) != MON_GIVEN_TO_PARTY) { if (!ShouldShowBoxWasFullMessage()) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SENT_SOMEONES_PC; StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2); + GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gStringVar2); } else { StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2); + GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gStringVar2); StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOMEONES_BOX_FULL; } @@ -9715,31 +15646,35 @@ static void Cmd_givecaughtmon(void) gBattleCommunication[MULTISTRING_CHOOSER]++; } - gBattleResults.caughtMonSpecies = gBattleMons[gBattlerAttacker ^ BIT_SIDE].species; - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); + gBattleResults.caughtMonSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); + GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetcaughtmondexflags(void) { - u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL); - u32 personality = GetMonData(&gEnemyParty[0], MON_DATA_PERSONALITY, NULL); + CMD_ARGS(const u8 *failInstr); + + u32 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); + u32 personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_PERSONALITY, NULL); if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { HandleSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT, personality); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_displaydexinfo(void) { - u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL); + CMD_ARGS(); + + u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); switch (gBattleCommunication[0]) { @@ -9791,7 +15726,7 @@ static void Cmd_displaydexinfo(void) break; case 5: if (!gPaletteFade.active) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; break; } } @@ -9866,10 +15801,12 @@ void BattleDestroyYesNoCursorAt(void) static void Cmd_trygivecaughtmonnick(void) { + CMD_ARGS(const u8 *successInstr); + switch (gBattleCommunication[MULTIUSE_STATE]) { case 0: - HandleBattleWindow(23, 8, 29, 13, 0); + HandleBattleWindow(YESNOBOX_X_Y, 0); BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); gBattleCommunication[MULTIUSE_STATE]++; gBattleCommunication[CURSOR_POSITION] = 0; @@ -9912,13 +15849,13 @@ static void Cmd_trygivecaughtmonnick(void) case 2: if (!gPaletteFade.active) { - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); FreeAllWindowBuffers(); DoNamingScreen(NAMING_SCREEN_CAUGHT_MON, gBattleStruct->caughtMonNick, - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_SPECIES), - GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]]), - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_PERSONALITY, NULL), + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_SPECIES), + GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]), + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_PERSONALITY, NULL), BattleMainCB2); gBattleCommunication[MULTIUSE_STATE]++; @@ -9927,31 +15864,36 @@ static void Cmd_trygivecaughtmonnick(void) case 3: if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) { - SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); + gBattlescriptCurrInstr = cmd->successInstr; } break; case 4: if (CalculatePlayerPartyCount() == PARTY_SIZE) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->successInstr; break; } } static void Cmd_subattackerhpbydmg(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].hp -= gBattleMoveDamage; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_removeattackerstatus1(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status1 = 0; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } +// CMD_ARGS is not needed for these functions as they end the script execution. static void Cmd_finishaction(void) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -9963,6 +15905,124 @@ static void Cmd_finishturn(void) gCurrentTurnActionNumber = gBattlersCount; } +static void Cmd_trainerslideout(void) +{ + CMD_ARGS(u8 position); + + u32 battler = gActiveBattler = GetBattlerAtPosition(cmd->position); + BtlController_EmitTrainerSlideBack(BUFFER_A); + MarkBattlerForControllerExec(battler); + + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static const u16 sTelekinesisBanList[] = +{ + SPECIES_DIGLETT, + SPECIES_DUGTRIO, + SPECIES_DIGLETT_ALOLAN, + SPECIES_DUGTRIO_ALOLAN, + SPECIES_SANDYGAST, + SPECIES_PALOSSAND, + SPECIES_GENGAR_MEGA, +}; + +bool32 IsTelekinesisBannedSpecies(u16 species) +{ + u32 i; + + for (i = 0; i < ARRAY_COUNT(sTelekinesisBanList); i++) + { + if (species == sTelekinesisBanList[i]) + return TRUE; + } + return FALSE; +} + +static void Cmd_settelekinesis(void) +{ + CMD_ARGS(const u8 *failInstr); + + if (gStatuses3[gBattlerTarget] & (STATUS3_TELEKINESIS | STATUS3_ROOTED | STATUS3_SMACKED_DOWN) + || gFieldStatuses & STATUS_FIELD_GRAVITY + || IsTelekinesisBannedSpecies(gBattleMons[gBattlerTarget].species)) + { + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gStatuses3[gBattlerTarget] |= STATUS3_TELEKINESIS; + gDisableStructs[gBattlerTarget].telekinesisTimer = 3; + gBattlescriptCurrInstr = cmd->nextInstr; + } +} + +static void Cmd_swapstatstages(void) +{ + CMD_ARGS(u8 stat); + + u8 stat = cmd->stat; + s8 atkStatStage = gBattleMons[gBattlerAttacker].statStages[stat]; + s8 defStatStage = gBattleMons[gBattlerTarget].statStages[stat]; + + gBattleMons[gBattlerAttacker].statStages[stat] = defStatStage; + gBattleMons[gBattlerTarget].statStages[stat] = atkStatStage; + + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void Cmd_averagestats(void) +{ + CMD_ARGS(u8 stat); + + u8 stat = cmd->stat; + u16 atkStat = *(u16 *)((&gBattleMons[gBattlerAttacker].attack) + (stat - 1)); + u16 defStat = *(u16 *)((&gBattleMons[gBattlerTarget].attack) + (stat - 1)); + u16 average = (atkStat + defStat) / 2; + + *(u16 *)((&gBattleMons[gBattlerAttacker].attack) + (stat - 1)) = average; + *(u16 *)((&gBattleMons[gBattlerTarget].attack) + (stat - 1)) = average; + + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void Cmd_jumpifoppositegenders(void) +{ + CMD_ARGS(const u8 *jumpInstr); + + if (AreBattlersOfOppositeGender(gBattlerAttacker, gBattlerTarget)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void Cmd_unused(void) +{ +} + +static void Cmd_tryworryseed(void) +{ + CMD_ARGS(const u8 *failInstr); + + if (gAbilitiesInfo[gBattleMons[gBattlerTarget].ability].cantBeOverwritten + || gBattleMons[gBattlerTarget].ability == ABILITY_INSOMNIA) + { + RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; + } + else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) + { + RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); + gBattlescriptCurrInstr = cmd->failInstr; + } + else + { + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_INSOMNIA; + gBattlescriptCurrInstr = cmd->nextInstr; + } +} + static void Cmd_callnative(void) { CMD_ARGS(void (*func)(void)); @@ -9979,102 +16039,123 @@ void BS_GetBattlerSide(void) void BS_ItemRestoreHP(void) { - NATIVE_ARGS(); + NATIVE_ARGS(const u8 *alreadyMaxHpInstr); u16 healAmount; u32 battler = MAX_BATTLERS_COUNT; u32 healParam = ItemId_GetEffect(gLastUsedItem)[6]; u32 side = GetBattlerSide(gBattlerAttacker); struct Pokemon *party = GetSideParty(side); - u8 itemPartyIndex = gBattleStruct->itemPartyIndex[gBattlerAttacker]; u16 hp = GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_HP); u16 maxHP = GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_MAX_HP); - u32 species = GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_SPECIES); gBattleCommunication[MULTIUSE_STATE] = 0; - // Track the number of Revives used in a battle. - if (hp == 0 && side == B_SIDE_PLAYER && gBattleResults.numRevivesUsed < 255) - gBattleResults.numRevivesUsed++; - - // Check if the recipient is an active battler. - if (gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[gBattlerAttacker]) - battler = gBattlerAttacker; - else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerAttacker)]) - battler = BATTLE_PARTNER(gBattlerAttacker); - - // Get amount to heal. - switch (healParam) + if (hp == maxHP) { - case ITEM6_HEAL_HP_FULL: - healAmount = maxHP; - break; - case ITEM6_HEAL_HP_HALF: - healAmount = maxHP / 2; - break; - case ITEM6_HEAL_HP_QUARTER: - healAmount = maxHP / 4; - break; - default: - healAmount = healParam; - break; - } - if (hp + healAmount > maxHP) - healAmount = maxHP - hp; - - gBattleScripting.battler = battler; - PREPARE_SPECIES_BUFFER(gBattleTextBuff1, species); - - // Heal is applied as move damage if battler is active. - if (battler != MAX_BATTLERS_COUNT && hp != 0) - { - gBattleMoveDamage = -healAmount; - gBattlescriptCurrInstr = cmd->nextInstr; + gBattlescriptCurrInstr = cmd->alreadyMaxHpInstr; } else { - hp += healAmount; - SetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_HP, &hp); + // Track the number of Revives used in a battle. + if (hp == 0 && side == B_SIDE_PLAYER && gBattleResults.numRevivesUsed < 255) + gBattleResults.numRevivesUsed++; - // Revived battlers on the field need to be brought back. - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && battler != MAX_BATTLERS_COUNT) + // Check if the recipient is an active battler. + if (gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[gBattlerAttacker]) + battler = gBattlerAttacker; + else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE + && gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerAttacker)]) + battler = BATTLE_PARTNER(gBattlerAttacker); + + // Get amount to heal. + switch (healParam) { - gAbsentBattlerFlags &= ~gBitTable[battler]; - gBattleCommunication[MULTIUSE_STATE] = TRUE; + case ITEM6_HEAL_HP_FULL: + healAmount = maxHP; + break; + case ITEM6_HEAL_HP_HALF: + healAmount = maxHP / 2; + break; + case ITEM6_HEAL_HP_QUARTER: + healAmount = maxHP / 4; + break; + default: + healAmount = healParam; + break; + } + if (hp + healAmount > maxHP) + healAmount = maxHP - hp; + + gBattleScripting.battler = battler; + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_SPECIES)); + + // Heal is applied as move damage if battler is active. + if (battler != MAX_BATTLERS_COUNT && hp != 0) + { + gBattleMoveDamage = -healAmount; + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + hp += healAmount; + SetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_HP, &hp); + + // Revived battlers on the field need to be brought back. + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && battler != MAX_BATTLERS_COUNT) + { + gAbsentBattlerFlags &= ~gBitTable[battler]; + gBattleCommunication[MULTIUSE_STATE] = TRUE; + } + gBattlescriptCurrInstr = BattleScript_ItemRestoreHP_Party; } - gBattlescriptCurrInstr = BattleScript_ItemRestoreHP_Party; } } void BS_ItemCureStatus(void) { - NATIVE_ARGS(); + NATIVE_ARGS(const u8 *noStatusInstr); u32 battler = gBattlerAttacker; u32 side = GetBattlerSide(gBattlerAttacker); + u32 previousStatus2 = 0; + bool32 statusChanged = FALSE; struct Pokemon *party = GetSideParty(side); // Heal Status2 conditions if battler is active. if (gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[gBattlerAttacker]) { + previousStatus2 = gBattleMons[battler].status2; gBattleMons[gBattlerAttacker].status2 &= ~GetItemStatus2Mask(gLastUsedItem); } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerAttacker)]) { - gBattleMons[gBattlerAttacker].status2 &= ~GetItemStatus2Mask(gLastUsedItem); battler = BATTLE_PARTNER(gBattlerAttacker); + previousStatus2 = gBattleMons[battler].status2; + gBattleMons[battler].status2 &= ~GetItemStatus2Mask(gLastUsedItem); } + if (previousStatus2 != gBattleMons[battler].status2) + statusChanged = TRUE; + // Heal Status1 conditions. - HealStatusConditions(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], GetItemStatus1Mask(gLastUsedItem), battler); + if (!HealStatusConditions(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], GetItemStatus1Mask(gLastUsedItem), battler)) + { + statusChanged = TRUE; + if (GetItemStatus1Mask(gLastUsedItem) & STATUS1_SLEEP) + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + if (GetItemStatus2Mask(gLastUsedItem) & STATUS2_CONFUSION) + gStatuses4[battler] &= ~STATUS4_INFINITE_CONFUSION; + } - if (GetItemStatus1Mask(gLastUsedItem) & STATUS1_SLEEP) - gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; - if (GetItemStatus2Mask(gLastUsedItem) & STATUS2_CONFUSION) - gStatuses4[battler] &= ~STATUS4_INFINITE_CONFUSION; - - gBattleScripting.battler = battler; - PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_SPECIES)); - gBattlescriptCurrInstr = cmd->nextInstr; + if (statusChanged) + { + gBattleScripting.battler = battler; + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_SPECIES)); + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->noStatusInstr; + } } void BS_ItemIncreaseStat(void) @@ -10141,3 +16222,355 @@ void BS_ItemRestorePP(void) gBattlescriptCurrInstr = cmd->nextInstr; } +void BS_RunStatChangeItems(void) +{ + NATIVE_ARGS(u8 battler); + + // Change instruction before calling ItemBattleEffects. + gBattlescriptCurrInstr = cmd->nextInstr; + ItemBattleEffects(ITEMEFFECT_STATS_CHANGED, GetBattlerForBattleScript(cmd->battler), FALSE); // TODO: update +} + +static bool32 CriticalCapture(u32 odds) +{ + u32 numCaught; + + if (B_CRITICAL_CAPTURE == FALSE) + return FALSE; + + numCaught = GetNationalPokedexCount(FLAG_GET_CAUGHT); + + if (numCaught <= (NATIONAL_DEX_COUNT * 30) / 650) + odds = 0; + else if (numCaught <= (NATIONAL_DEX_COUNT * 150) / 650) + odds /= 2; + else if (numCaught <= (NATIONAL_DEX_COUNT * 300) / 650) + ; // odds = (odds * 100) / 100; + else if (numCaught <= (NATIONAL_DEX_COUNT * 450) / 650) + odds = (odds * 150) / 100; + else if (numCaught <= (NATIONAL_DEX_COUNT * 600) / 650) + odds *= 2; + else + odds = (odds * 250) / 100; + + if (CheckBagHasItem(ITEM_CATCHING_CHARM, 1)) + odds = (odds * (100 + B_CATCHING_CHARM_BOOST)) / 100; + + odds /= 6; + if ((Random() % 255) < odds) + return TRUE; + + return FALSE; +} + +bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler) +{ + if (move != MOVE_NONE && move != MOVE_UNAVAILABLE && move != MOVE_STRUGGLE + && !gMovesInfo[move].parentalBondBanned + && gMovesInfo[move].category != DAMAGE_CATEGORY_STATUS + && gMovesInfo[move].strikeCount < 2) + { + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + switch (GetBattlerMoveTargetType(battler, move)) + { + // Both foes are alive, spread move strikes once + case MOVE_TARGET_BOTH: + if (CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerTarget) >= 2) + return FALSE; + break; + // Either both foes or one foe and its ally are alive; spread move strikes once + case MOVE_TARGET_FOES_AND_ALLY: + if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_BATTLER, gBattlerAttacker) >= 2) + return FALSE; + break; + default: + break; + } + } + return TRUE; + } + return FALSE; +} + +static bool8 IsFinalStrikeEffect(u16 move) +{ + u32 i; + u16 moveEffect = gMovesInfo[move].effect; + + for (i = 0; i < ARRAY_COUNT(sFinalStrikeOnlyEffects); i++) + { + if (moveEffect == sFinalStrikeOnlyEffects[i]) + return TRUE; + } + return FALSE; +} + +void BS_TryRevertWeatherForm(void) +{ + NATIVE_ARGS(); + if (TryBattleFormChange(gBattlerTarget, FORM_CHANGE_BATTLE_WEATHER)) + { + gBattleScripting.battler = gBattlerTarget; + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_TargetFormChangeWithStringNoPopup; + return; + } + gBattlescriptCurrInstr = cmd->nextInstr; +} + +void BS_TrySymbiosis(void) +{ + NATIVE_ARGS(); + //called by Bestow, Fling, and Bug Bite, which don't work with Cmd_removeitem. + u32 partner = BATTLE_PARTNER(gBattlerAttacker); + if (SYMBIOSIS_CHECK(gBattlerAttacker, partner)) + { + BestowItem(partner, gBattlerAttacker); + gLastUsedAbility = gBattleMons[partner].ability; + gBattleScripting.battler = gBattlerAbility = partner; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; + return; + } + + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void TryUpdateRoundTurnOrder(void) +{ + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + u32 i; + u32 j = 0; + u32 k = 0; + u32 currRounder = 0; + u8 roundUsers[3] = {0xFF, 0xFF, 0xFF}; + u8 nonRoundUsers[3] = {0xFF, 0xFF, 0xFF}; + for (i = 0; i < gBattlersCount; i++) + { + if (gBattlerByTurnOrder[i] == gBattlerAttacker) + { + currRounder = i + 1; // Current battler going after attacker + break; + } + } + + // Get battlers after us using round + for (i = currRounder; i < gBattlersCount; i++) + { + if (gChosenMoveByBattler[gBattlerByTurnOrder[i]] == MOVE_ROUND) + roundUsers[j++] = gBattlerByTurnOrder[i]; + else + nonRoundUsers[k++] = gBattlerByTurnOrder[i]; + } + + // update turn order for round users + for (i = 0; roundUsers[i] != 0xFF && i < 3; i++) + { + gBattlerByTurnOrder[currRounder] = roundUsers[i]; + gActionsByTurnOrder[currRounder] = gActionsByTurnOrder[roundUsers[i]]; + gProtectStructs[roundUsers[i]].quash = TRUE; // Make it so their turn order can't be changed again + currRounder++; + } + + // Update turn order for non-round users + for (i = 0; nonRoundUsers[i] != 0xFF && i < 3; i++) + { + gBattlerByTurnOrder[currRounder] = nonRoundUsers[i]; + gActionsByTurnOrder[currRounder] = gActionsByTurnOrder[nonRoundUsers[i]]; + currRounder++; + } + } +} + +u8 GetFirstFaintedPartyIndex(u8 battler) +{ + u32 i; + u32 start = 0; + u32 end = PARTY_SIZE; + struct Pokemon *party = GetBattlerParty(battler); + + // Check whether partner is separate trainer. + if ((GetBattlerSide(battler) == B_SIDE_PLAYER && gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + || (GetBattlerSide(battler) == B_SIDE_OPPONENT && gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)) + { + if (GetBattlerPosition(battler) == B_POSITION_OPPONENT_LEFT + || GetBattlerPosition(battler) == B_POSITION_PLAYER_LEFT) + { + end = PARTY_SIZE / 2; + } + else + { + start = PARTY_SIZE / 2; + } + } + + // Loop through to find fainted battler. + for (i = start; i < end; ++i) + { + u32 species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG); + if (species != SPECIES_NONE + && species != SPECIES_EGG + && GetMonData(&party[i], MON_DATA_HP) == 0) + { + return i; + } + } + + // Returns PARTY_SIZE if none found. + return PARTY_SIZE; +} + +static void ApplyExperienceMultipliers(s32 *expAmount, u8 expGetterMonId, u8 faintedBattler) +{ + u32 holdEffect = GetMonHoldEffect(&gPlayerParty[expGetterMonId]); + + if (IsTradedMon(&gPlayerParty[expGetterMonId])) + *expAmount = (*expAmount * 150) / 100; + if (holdEffect == HOLD_EFFECT_LUCKY_EGG) + *expAmount = (*expAmount * 150) / 100; + if (B_UNEVOLVED_EXP_MULTIPLIER >= GEN_6 && IsMonPastEvolutionLevel(&gPlayerParty[expGetterMonId])) + *expAmount = (*expAmount * 4915) / 4096; + if (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(expGetterMonId) >= AFFECTION_FOUR_HEARTS) + *expAmount = (*expAmount * 4915) / 4096; + if (CheckBagHasItem(ITEM_EXP_CHARM, 1)) //is also for other exp boosting Powers if/when implemented + *expAmount = (*expAmount * 150) / 100; + + if (B_SCALED_EXP >= GEN_5 && B_SCALED_EXP != GEN_6) + { + // Note: There is an edge case where if a pokemon receives a large amount of exp, it wouldn't be properly calculated + // because of multiplying by scaling factor(the value would simply be larger than an u32 can hold). Hence u64 is needed. + u64 value = *expAmount; + u8 faintedLevel = gBattleMons[faintedBattler].level; + u8 expGetterLevel = GetMonData(&gPlayerParty[expGetterMonId], MON_DATA_LEVEL); + + value *= sExperienceScalingFactors[(faintedLevel * 2) + 10]; + value /= sExperienceScalingFactors[faintedLevel + expGetterLevel + 10]; + *expAmount = value + 1; + } +} + +static bool8 CanBurnHitThaw(u16 move) +{ + u8 i; + + if (B_BURN_HIT_THAW >= GEN_6) + { + for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + { + if (gMovesInfo[move].additionalEffects[i].moveEffect == MOVE_EFFECT_BURN) + return TRUE; + } + } + return FALSE; +} + +static void TryUpdateEvolutionTracker(u32 evolutionMethod, u32 upAmount) +{ + u32 i; + + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER + && !(gBattleTypeFlags & (BATTLE_TYPE_LINK + | BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_BATTLE_TOWER + | BATTLE_TYPE_TRAINER_TOWER))) + { + const struct Evolution *evolutions = GetSpeciesEvolutions(gBattleMons[gBattlerAttacker].species); + if (evolutions == NULL) + return; + + for (i = 0; evolutions[i].method != EVOLUTIONS_END; i++) + { + if (SanitizeSpeciesId(evolutions[i].targetSpecies) == SPECIES_NONE) + continue; + + if (evolutions[i].method == evolutionMethod) + { + // We only have 9 bits to use + u16 val = min(511, GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]], MON_DATA_EVOLUTION_TRACKER) + upAmount); + // Reset progress if you faint for the recoil method. + if (gBattleMons[gBattlerAttacker].hp == 0 && (evolutionMethod == EVO_LEVEL_RECOIL_DAMAGE_MALE || evolutionMethod == EVO_LEVEL_RECOIL_DAMAGE_FEMALE)) + val = 0; + SetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]], MON_DATA_EVOLUTION_TRACKER, &val); + return; + } + } + } +} + +void BS_DoStockpileStatChangesWearOff(void) +{ + NATIVE_ARGS(u8 battler, const u8 *statChangeInstr); + + u32 battler = GetBattlerForBattleScript(cmd->battler); + if (gDisableStructs[battler].stockpileDef != 0) + { + SET_STATCHANGER(STAT_DEF, abs(gDisableStructs[battler].stockpileDef), TRUE); + gDisableStructs[battler].stockpileDef = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = cmd->statChangeInstr; + } + else if (gDisableStructs[battler].stockpileSpDef) + { + SET_STATCHANGER(STAT_SPDEF, abs(gDisableStructs[battler].stockpileSpDef), TRUE); + gDisableStructs[battler].stockpileSpDef = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = cmd->statChangeInstr; + } + else + { + gBattlescriptCurrInstr = cmd->nextInstr; + } +} + +void BS_HandlePrimalReversion(void) +{ + NATIVE_ARGS(u8 battler, u8 caseId); + + u8 battler = gActiveBattler = GetBattlerForBattleScript(cmd->battler); + HandleScriptMegaPrimalBurst(cmd->caseId, battler, HANDLE_TYPE_PRIMAL_REVERSION); + gBattlescriptCurrInstr = cmd->nextInstr; +} + +void BS_JumpIfTerrainAffected(void) +{ + NATIVE_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); + u32 battler = GetBattlerForBattleScript(cmd->battler); + + if (IsBattlerTerrainAffected(battler, cmd->flags)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} + +void BS_CheckParentalBondCounter(void) +{ + NATIVE_ARGS(u8 counter, const u8 *jumpInstr); + // Some effects should only happen on the first or second strike of Parental Bond, + // so a way to check this in battle scripts is useful + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == cmd->counter && gBattleMons[gBattlerTarget].hp != 0) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static bool8 CanAbilityPreventStatLoss(u16 abilityDef, bool8 byIntimidate) +{ + switch (abilityDef) + { + case ABILITY_CLEAR_BODY: + case ABILITY_FULL_METAL_BODY: + case ABILITY_WHITE_SMOKE: + return TRUE; + case ABILITY_INNER_FOCUS: + case ABILITY_SCRAPPY: + case ABILITY_OWN_TEMPO: + case ABILITY_OBLIVIOUS: + if (byIntimidate && (B_UPDATED_INTIMIDATE >= GEN_8)) + return TRUE; + break; + } + return FALSE; +} + diff --git a/src/battle_setup.c b/src/battle_setup.c index 18b2a7acb..838d7b016 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -72,6 +72,7 @@ static const u8 *GetTrainerCantBattleSpeech(void); static EWRAM_DATA u16 sTrainerBattleMode = 0; EWRAM_DATA u16 gTrainerBattleOpponent_A = 0; +EWRAM_DATA u16 gTrainerBattleOpponent_B = 0; static EWRAM_DATA u16 sTrainerObjectEventLocalId = 0; static EWRAM_DATA u8 *sTrainerAIntroSpeech = NULL; static EWRAM_DATA u8 *sTrainerADefeatSpeech = NULL; diff --git a/src/battle_util.c b/src/battle_util.c index fe9e9e850..47d2d1a11 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5,14 +5,17 @@ #include "link.h" #include "berry.h" #include "random.h" +#include "party_menu.h" #include "pokemon.h" #include "string_util.h" #include "field_weather.h" #include "event_data.h" #include "battle.h" #include "battle_anim.h" +#include "battle_interface.h" #include "battle_scripts.h" #include "battle_message.h" +#include "malloc.h" #include "constants/battle_anim.h" #include "battle_controllers.h" #include "battle_ai_script_commands.h" @@ -26,6 +29,11 @@ #include "constants/battle_move_effects.h" #include "constants/battle_script_commands.h" +// TODO: remove when battle_ai_util +#define AI_THINKING_STRUCT (gBattleResources->ai) +#define BATTLE_HISTORY (gBattleResources->battleHistory) + + #define SOUND_MOVES_END 0xFFFF static const u16 sSoundMovesTable[] = @@ -34,6 +42,26 @@ static const u16 sSoundMovesTable[] = MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, SOUND_MOVES_END }; +static bool32 TryRemoveScreens(u32 battler); +static bool32 IsUnnerveAbilityOnOpposingSide(u32 battler); +static u32 GetFlingPowerFromItemId(u32 itemId); +static void SetRandomMultiHitCounter(); +static u32 GetBattlerItemHoldEffectParam(u32 battler, u32 item); +static bool32 CanBeInfinitelyConfused(u32 battler); + +static u8 CalcBeatUpPower(void) +{ + u8 basePower; + u16 species; + struct Pokemon *party = GetBattlerParty(gBattlerAttacker); + + // Party slot is incremented by the battle script for Beat Up after this damage calculation + species = GetMonData(&party[gBattleStruct->beatUpSlot], MON_DATA_SPECIES); + basePower = (gSpeciesInfo[species].baseAttack / 10) + 5; + + return basePower; +} + u8 GetBattlerForBattleScript(u8 caseId) { u8 ret = 0; @@ -66,122 +94,24 @@ u8 GetBattlerForBattleScript(u8 caseId) case BS_OPPONENT1: ret = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); break; + case BS_PLAYER2: + ret = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + break; + case BS_OPPONENT2: + ret = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + break; case BS_ATTACKER_WITH_PARTNER: case BS_FAINTED_LINK_MULTIPLE_2: case BS_ATTACKER_SIDE: - case BS_NOT_ATTACKER_SIDE: + case BS_TARGET_SIDE: + break; + case BS_ABILITY_BATTLER: + ret = gBattlerAbility; break; } return ret; } -void PressurePPLose(u8 target, u8 attacker, u16 move) -{ - int moveIndex; - - if (gBattleMons[target].ability != ABILITY_PRESSURE) - return; - - for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) - { - if (gBattleMons[attacker].moves[moveIndex] == move) - break; - } - - if (moveIndex == MAX_MON_MOVES) - return; - - if (gBattleMons[attacker].pp[moveIndex] != 0) - gBattleMons[attacker].pp[moveIndex]--; - - if (MOVE_IS_PERMANENT(attacker, moveIndex)) - { - gActiveBattler = attacker; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + moveIndex, 0, 1, &gBattleMons[gActiveBattler].pp[moveIndex]); - MarkBattlerForControllerExec(gActiveBattler); - } -} - -void PressurePPLoseOnUsingImprison(u8 attacker) -{ - int i, j; - int imprisonPos = MAX_MON_MOVES; - u8 atkSide = GetBattlerSide(attacker); - - for (i = 0; i < gBattlersCount; i++) - { - if (atkSide != GetBattlerSide(i) && gBattleMons[i].ability == ABILITY_PRESSURE) - { - for (j = 0; j < MAX_MON_MOVES; j++) - { - if (gBattleMons[attacker].moves[j] == MOVE_IMPRISON) - break; - } - if (j != MAX_MON_MOVES) - { - imprisonPos = j; - if (gBattleMons[attacker].pp[j] != 0) - gBattleMons[attacker].pp[j]--; - } - } - } - - if (imprisonPos != MAX_MON_MOVES && MOVE_IS_PERMANENT(attacker, imprisonPos)) - { - gActiveBattler = attacker; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + imprisonPos, 0, 1, &gBattleMons[gActiveBattler].pp[imprisonPos]); - MarkBattlerForControllerExec(gActiveBattler); - } -} - -void PressurePPLoseOnUsingPerishSong(u8 attacker) -{ - int i, j; - int perishSongPos = MAX_MON_MOVES; - - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ABILITY_PRESSURE && i != attacker) - { - for (j = 0; j < MAX_MON_MOVES; j++) - { - if (gBattleMons[attacker].moves[j] == MOVE_PERISH_SONG) - break; - } - if (j != MAX_MON_MOVES) - { - perishSongPos = j; - if (gBattleMons[attacker].pp[j] != 0) - gBattleMons[attacker].pp[j]--; - } - } - } - - if (perishSongPos != MAX_MON_MOVES && MOVE_IS_PERMANENT(attacker, perishSongPos)) - { - gActiveBattler = attacker; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_PPMOVE1_BATTLE + perishSongPos, 0, 1, &gBattleMons[gActiveBattler].pp[perishSongPos]); - MarkBattlerForControllerExec(gActiveBattler); - } -} - -// Unused -static void MarkAllBattlersForControllerExec(void) -{ - int i; - - if (gBattleTypeFlags & BATTLE_TYPE_LINK) - { - for (i = 0; i < gBattlersCount; i++) - gBattleControllerExecFlags |= gBitTable[i] << (32 - MAX_BATTLERS_COUNT); - } - else - { - for (i = 0; i < gBattlersCount; i++) - gBattleControllerExecFlags |= gBitTable[i]; - } -} - void MarkBattlerForControllerExec(u8 battlerId) { if (gBattleTypeFlags & BATTLE_TYPE_LINK) @@ -200,30 +130,103 @@ void MarkBattlerReceivedLinkData(u8 battlerId) gBattleControllerExecFlags &= ~((1 << 28) << battlerId); } -void CancelMultiTurnMoves(u8 battler) +const u8* CancelMultiTurnMoves(u32 battler) { - gBattleMons[battler].status2 &= ~STATUS2_MULTIPLETURNS; - gBattleMons[battler].status2 &= ~STATUS2_LOCK_CONFUSE; - gBattleMons[battler].status2 &= ~STATUS2_UPROAR; - gBattleMons[battler].status2 &= ~STATUS2_BIDE; + const u8 *result = NULL; + gBattleMons[battler].status2 &= ~(STATUS2_MULTIPLETURNS); + gBattleMons[battler].status2 &= ~(STATUS2_LOCK_CONFUSE); + gBattleMons[battler].status2 &= ~(STATUS2_UPROAR); + gBattleMons[battler].status2 &= ~(STATUS2_BIDE); - gStatuses3[battler] &= ~STATUS3_SEMI_INVULNERABLE; + // Clear battler's semi-invulnerable bits if they are not held by Sky Drop. + if (!(gStatuses3[battler] & STATUS3_SKY_DROPPED)) + gStatuses3[battler] &= ~(STATUS3_SEMI_INVULNERABLE); + + // Check to see if this Pokemon was in the middle of using Sky Drop. If so, release the target. + if (gBattleStruct->skyDropTargets[battler] != 0xFF && !(gStatuses3[battler] & STATUS3_SKY_DROPPED)) + { + // Get the target's battler id + u8 otherSkyDropper = gBattleStruct->skyDropTargets[battler]; + + // Clears sky_dropped and on_air statuses + gStatuses3[otherSkyDropper] &= ~(STATUS3_SKY_DROPPED | STATUS3_ON_AIR); + + // Makes both attacker and target's sprites visible + gSprites[gBattlerSpriteIds[battler]].invisible = FALSE; + gSprites[gBattlerSpriteIds[otherSkyDropper]].invisible = FALSE; + + // If target was sky dropped in the middle of Outrage/Thrash/Petal Dance, + // confuse them upon release and display "confused by fatigue" message & animation. + // Don't do this if this CancelMultiTurnMoves is caused by falling asleep via Yawn. + if (gBattleMons[otherSkyDropper].status2 & STATUS2_LOCK_CONFUSE && gBattleStruct->turnEffectsTracker != 24) + { + gBattleMons[otherSkyDropper].status2 &= ~(STATUS2_LOCK_CONFUSE); + + // If the target can be confused, confuse them. + // Don't use CanBeConfused, can cause issues in edge cases. + if (!(GetBattlerAbility(otherSkyDropper) == ABILITY_OWN_TEMPO + || gBattleMons[otherSkyDropper].status2 & STATUS2_CONFUSION + || IsBattlerTerrainAffected(otherSkyDropper, STATUS_FIELD_MISTY_TERRAIN))) + { + // Set confused status + gBattleMons[otherSkyDropper].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); + + // If this CancelMultiTurnMoves is occuring due to attackcanceller + if (gBattlescriptCurrInstr[0] == 0x0) + { + gBattleStruct->skyDropTargets[battler] = 0xFE; + } + // If this CancelMultiTurnMoves is occuring due to VARIOUS_GRAVITY_ON_AIRBORNE_MONS + // Reapplying STATUS3_SKY_DROPPED allows for avoiding unecessary messages when Gravity is applied to the target. + else if (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 76) + { + gBattleStruct->skyDropTargets[battler] = 0xFE; + gStatuses3[otherSkyDropper] |= STATUS3_SKY_DROPPED; + } + // If this CancelMultiTurnMoves is occuring due to cancelmultiturnmoves script + else if (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 0) + { + gBattlerAttacker = otherSkyDropper; + result = BattleScript_ThrashConfuses; + } + // If this CancelMultiTurnMoves is occuring due to receiving Sleep/Freeze status + else if (gBattleScripting.moveEffect <= PRIMARY_STATUS_MOVE_EFFECT) + { + gBattlerAttacker = otherSkyDropper; + BattleScriptPush(gBattlescriptCurrInstr + 1); + result = BattleScript_ThrashConfuses; + } + } + } + + // Clear skyDropTargets data, unless this CancelMultiTurnMoves is caused by Yawn, attackcanceler, or VARIOUS_GRAVITY_ON_AIRBORNE_MONS + if (!(gBattleMons[otherSkyDropper].status2 & STATUS2_LOCK_CONFUSE) && gBattleStruct->skyDropTargets[battler] < 4) + { + gBattleStruct->skyDropTargets[battler] = 0xFF; + gBattleStruct->skyDropTargets[otherSkyDropper] = 0xFF; + } + } gDisableStructs[battler].rolloutTimer = 0; gDisableStructs[battler].furyCutterCounter = 0; + + return result; } -bool8 WasUnableToUseMove(u8 battler) +bool32 WasUnableToUseMove(u32 battler) { if (gProtectStructs[battler].prlzImmobility - || gProtectStructs[battler].targetNotAffected || gProtectStructs[battler].usedImprisonedMove || gProtectStructs[battler].loveImmobility || gProtectStructs[battler].usedDisabledMove || gProtectStructs[battler].usedTauntedMove + || gProtectStructs[battler].usedGravityPreventedMove + || gProtectStructs[battler].usedHealBlockedMove || gProtectStructs[battler].flag2Unknown || gProtectStructs[battler].flinchImmobility - || gProtectStructs[battler].confusionSelfDmg) + || gProtectStructs[battler].confusionSelfDmg + || gProtectStructs[battler].powderSelfDmg + || gProtectStructs[battler].usedThroatChopPreventedMove) return TRUE; else return FALSE; @@ -296,7 +299,8 @@ void BattleScriptPushCursor(void) void BattleScriptPop(void) { - gBattlescriptCurrInstr = gBattleResources->battleScriptsStack->ptr[--gBattleResources->battleScriptsStack->size]; + if (gBattleResources->battleScriptsStack->size != 0) + gBattlescriptCurrInstr = gBattleResources->battleScriptsStack->ptr[--gBattleResources->battleScriptsStack->size]; } u8 TrySetCantSelectMoveBattleScript(void) @@ -321,7 +325,7 @@ u8 TrySetCantSelectMoveBattleScript(void) limitations++; } - if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0) + if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gMovesInfo[move].power == 0) { gCurrentMove = move; gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTaunt; @@ -358,50 +362,98 @@ u8 TrySetCantSelectMoveBattleScript(void) return limitations; } -u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) +static bool32 IsGravityPreventingMove(u32 move) { - u8 holdEffect; - u16 *choicedMove = &gBattleStruct->choicedMove[battlerId]; + if (!(gFieldStatuses & STATUS_FIELD_GRAVITY)) + return FALSE; + + return gMovesInfo[move].gravityBanned; +} + +bool32 IsHealBlockPreventingMove(u32 battler, u32 move) +{ + if (!(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) + return FALSE; + + return gMovesInfo[move].healingMove; +} + +static bool32 IsBelchPreventingMove(u32 battler, u32 move) +{ + if (gMovesInfo[move].effect != EFFECT_BELCH) + return FALSE; + + return !(gBattleStruct->ateBerry[battler & BIT_SIDE] & gBitTable[gBattlerPartyIndexes[battler]]); +} + +u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check) +{ + u32 move, moveEffect; + u32 holdEffect = GetBattlerHoldEffect(battler, TRUE); + u16 *choicedMove = &gBattleStruct->choicedMove[battler]; s32 i; - if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY) - holdEffect = gEnigmaBerries[battlerId].holdEffect; - else - holdEffect = ItemId_GetHoldEffect(gBattleMons[battlerId].item); - - gPotentialItemEffectBattler = battlerId; + gPotentialItemEffectBattler = battler; for (i = 0; i < MAX_MON_MOVES; i++) { + move = gBattleMons[battler].moves[i]; + moveEffect = gMovesInfo[move].effect; // No move - if (gBattleMons[battlerId].moves[i] == MOVE_NONE && check & MOVE_LIMITATION_ZEROMOVE) + if (check & MOVE_LIMITATION_ZEROMOVE && move == MOVE_NONE) unusableMoves |= gBitTable[i]; // No PP - if (gBattleMons[battlerId].pp[i] == 0 && check & MOVE_LIMITATION_PP) + else if (check & MOVE_LIMITATION_PP && gBattleMons[battler].pp[i] == 0) + unusableMoves |= gBitTable[i]; + // Placeholder + else if (check & MOVE_LIMITATION_PLACEHOLDER && moveEffect == EFFECT_PLACEHOLDER) unusableMoves |= gBitTable[i]; // Disable - if (gBattleMons[battlerId].moves[i] == gDisableStructs[battlerId].disabledMove && check & MOVE_LIMITATION_DISABLED) + else if (check & MOVE_LIMITATION_DISABLED && move == gDisableStructs[battler].disabledMove) unusableMoves |= gBitTable[i]; // Torment - if (gBattleMons[battlerId].moves[i] == gLastMoves[battlerId] && check & MOVE_LIMITATION_TORMENTED && gBattleMons[battlerId].status2 & STATUS2_TORMENT) + else if (check & MOVE_LIMITATION_TORMENTED && move == gLastMoves[battler] && gBattleMons[battler].status2 & STATUS2_TORMENT) unusableMoves |= gBitTable[i]; // Taunt - if (gDisableStructs[battlerId].tauntTimer && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0) + else if (check & MOVE_LIMITATION_TAUNT && gDisableStructs[battler].tauntTimer && IS_MOVE_STATUS(move)) unusableMoves |= gBitTable[i]; // Imprison - if (GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]) && check & MOVE_LIMITATION_IMPRISON) + else if (check & MOVE_LIMITATION_IMPRISON && GetImprisonedMovesCount(battler, move)) unusableMoves |= gBitTable[i]; // Encore - if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i]) + else if (check & MOVE_LIMITATION_ENCORE && gDisableStructs[battler].encoreTimer && gDisableStructs[battler].encoredMove != move) unusableMoves |= gBitTable[i]; - // Choice Band - if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i]) + // Choice Items + else if (check & MOVE_LIMITATION_CHOICE_ITEM && HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) + unusableMoves |= gBitTable[i]; + // Assault Vest + else if (check & MOVE_LIMITATION_ASSAULT_VEST && holdEffect == HOLD_EFFECT_ASSAULT_VEST && IS_MOVE_STATUS(move) && gMovesInfo[move].effect != EFFECT_ME_FIRST) + unusableMoves |= gBitTable[i]; + // Gravity + else if (check & MOVE_LIMITATION_GRAVITY && IsGravityPreventingMove(move)) + unusableMoves |= gBitTable[i]; + // Heal Block + else if (check & MOVE_LIMITATION_HEAL_BLOCK && IsHealBlockPreventingMove(battler, move)) + unusableMoves |= gBitTable[i]; + // Belch + else if (check & MOVE_LIMITATION_BELCH && IsBelchPreventingMove(battler, move)) + unusableMoves |= gBitTable[i]; + // Throat Chop + else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battler].throatChopTimer && gMovesInfo[move].soundMove) + unusableMoves |= gBitTable[i]; + // Stuff Cheeks + else if (check & MOVE_LIMITATION_STUFF_CHEEKS && moveEffect == EFFECT_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battler].item) != POCKET_BERRY_POUCH) + unusableMoves |= gBitTable[i]; + // Gorilla Tactics + else if (check & MOVE_LIMITATION_CHOICE_ITEM && GetBattlerAbility(battler) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) + unusableMoves |= gBitTable[i]; + // Can't Use Twice flag + else if (check & MOVE_LIMITATION_CANT_USE_TWICE && gMovesInfo[move].cantUseTwice && move == gLastResultingMoves[battler]) unusableMoves |= gBitTable[i]; } return unusableMoves; } -#define ALL_MOVES_MASK ((1 << MAX_MON_MOVES) - 1) bool8 AreAllMovesUnusable(void) { u8 unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL); @@ -422,7 +474,6 @@ bool8 AreAllMovesUnusable(void) return (unusable == ALL_MOVES_MASK); } -#undef ALL_MOVES_MASK u8 GetImprisonedMovesCount(u8 battlerId, u16 move) { @@ -962,7 +1013,7 @@ u8 DoBattlerEndTurnEffects(void) gBattleMons[gActiveBattler].status2 &= ~STATUS2_MULTIPLETURNS; if (!(gBattleMons[gActiveBattler].status2 & STATUS2_CONFUSION)) { - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER; + gBattleScripting.moveEffect = MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER; SetMoveEffect(TRUE, 0); if (gBattleMons[gActiveBattler].status2 & STATUS2_CONFUSION) BattleScriptExecute(BattleScript_ThrashConfuses); @@ -1230,30 +1281,9 @@ void TryClearRageStatuses(void) } } -enum +u8 AtkCanceller_UnableToUseMove(u32 moveType) { - CANCELLER_FLAGS, - CANCELLER_ASLEEP, - CANCELLER_FROZEN, - CANCELLER_TRUANT, - CANCELLER_RECHARGE, - CANCELLER_FLINCH, - CANCELLER_DISABLED, - CANCELLER_TAUNTED, - CANCELLER_IMPRISONED, - CANCELLER_CONFUSED, - CANCELLER_PARALYSED, - CANCELLER_GHOST, - CANCELLER_IN_LOVE, - CANCELLER_BIDE, - CANCELLER_THAW, - CANCELLER_END, -}; - -u8 AtkCanceller_UnableToUseMove(void) -{ - u8 effect = 0; - s32 *bideDmg = &gBattleScripting.bideDmg; +u8 effect = 0; do { switch (gBattleStruct->atkCancellerTracker) @@ -1261,6 +1291,17 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_FLAGS: // flags clear gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_DESTINY_BOND; gStatuses3[gBattlerAttacker] &= ~STATUS3_GRUDGE; + gStatuses4[gBattlerAttacker] &= ~ STATUS4_GLAIVE_RUSH; + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_SKY_DROP: + // If Pokemon is being held in Sky Drop + if (gStatuses3[gBattlerAttacker] & STATUS3_SKY_DROPPED) + { + gBattlescriptCurrInstr = BattleScript_MoveEnd; + gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; + effect = 1; + } gBattleStruct->atkCancellerTracker++; break; case CANCELLER_ASLEEP: // check being asleep @@ -1278,7 +1319,7 @@ u8 AtkCanceller_UnableToUseMove(void) else { u8 toSub; - if (gBattleMons[gBattlerAttacker].ability == ABILITY_EARLY_BIRD) + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_EARLY_BIRD) toSub = 2; else toSub = 1; @@ -1288,7 +1329,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleMons[gBattlerAttacker].status1 -= toSub; if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP) { - if (gCurrentMove != MOVE_SNORE && gCurrentMove != MOVE_SLEEP_TALK) + if (gChosenMove != MOVE_SNORE && gChosenMove != MOVE_SLEEP_TALK) { gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -1308,20 +1349,12 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_FROZEN: // check being frozen - if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE) + if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE && !(gMovesInfo[gCurrentMove].thawsUser)) { - if (Random() % 5) + if (!RandomPercentage(RNG_FROZEN, 20)) { - if (gBattleMoves[gCurrentMove].effect != EFFECT_THAW_HIT) // unfreezing via a move effect happens in case 13 - { - gBattlescriptCurrInstr = BattleScript_MoveUsedIsFrozen; - gHitMarker |= HITMARKER_NO_ATTACKSTRING; - } - else - { - gBattleStruct->atkCancellerTracker++; - break; - } + gBattlescriptCurrInstr = BattleScript_MoveUsedIsFrozen; + gHitMarker |= HITMARKER_NO_ATTACKSTRING; } else // unfreeze { @@ -1335,12 +1368,13 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_TRUANT: // truant - if (gBattleMons[gBattlerAttacker].ability == ABILITY_TRUANT && gDisableStructs[gBattlerAttacker].truantCounter) + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_TRUANT && gDisableStructs[gBattlerAttacker].truantCounter) { CancelMultiTurnMoves(gBattlerAttacker); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING; - gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; + gBattlerAbility = gBattlerAttacker; + gBattlescriptCurrInstr = BattleScript_TruantLoafingAround; gMoveResultFlags |= MOVE_RESULT_MISSED; effect = 1; } @@ -1361,8 +1395,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_FLINCH: // flinch if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FLINCHED) { - gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_FLINCHED; - gProtectStructs[gBattlerAttacker].flinchImmobility = 1; + gProtectStructs[gBattlerAttacker].flinchImmobility = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -1371,9 +1404,10 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_DISABLED: // disabled move - if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != MOVE_NONE) + // TODO: Z-Moves + if (/*gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE &&*/ gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != MOVE_NONE) { - gProtectStructs[gBattlerAttacker].usedDisabledMove = 1; + gProtectStructs[gBattlerAttacker].usedDisabledMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled; @@ -1382,10 +1416,36 @@ u8 AtkCanceller_UnableToUseMove(void) } gBattleStruct->atkCancellerTracker++; break; - case CANCELLER_TAUNTED: // taunt - if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0) + case CANCELLER_HEAL_BLOCKED: + // TODO: Z-Moves + if (/*gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE &&*/ gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedTauntedMove = 1; + gProtectStructs[gBattlerAttacker].usedHealBlockedMove = TRUE; + gBattleScripting.battler = gBattlerAttacker; + CancelMultiTurnMoves(gBattlerAttacker); + gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents; + gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; + effect = 1; + } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_GRAVITY: + if (gFieldStatuses & STATUS_FIELD_GRAVITY && IsGravityPreventingMove(gCurrentMove)) + { + gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = TRUE; + gBattleScripting.battler = gBattlerAttacker; + CancelMultiTurnMoves(gBattlerAttacker); + gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents; + gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; + effect = 1; + } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_TAUNTED: // taunt + // TODO: Z-Moves + if (/*gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE &&*/ gDisableStructs[gBattlerAttacker].tauntTimer && IS_MOVE_STATUS(gCurrentMove)) + { + gProtectStructs[gBattlerAttacker].usedTauntedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -1394,9 +1454,10 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_IMPRISONED: // imprisoned - if (GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove)) + // TODO: Z-Moves + if (/* gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && */ GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedImprisonedMove = 1; + gProtectStructs[gBattlerAttacker].usedImprisonedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -1405,26 +1466,26 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_CONFUSED: // confusion - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) + if (!gBattleStruct->isAtkCancelerForCalledMove && gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) { - gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1); + if (!(gStatuses4[gBattlerAttacker] & STATUS4_INFINITE_CONFUSION)) + gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1); if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) { - if (Random() & 1) - { - // The MULTISTRING_CHOOSER is used here as a bool to signal - // to BattleScript_MoveUsedIsConfused whether or not damage was taken - gBattleCommunication[MULTISTRING_CHOOSER] = FALSE; - BattleScriptPushCursor(); - } - else // confusion dmg + // confusion dmg + if (RandomWeighted(RNG_CONFUSION, (B_CONFUSION_SELF_DMG_CHANCE >= GEN_7 ? 2 : 1), 1)) { gBattleCommunication[MULTISTRING_CHOOSER] = TRUE; gBattlerTarget = gBattlerAttacker; - gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker); - gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1; + gBattleMoveDamage = CalculateMoveDamage(MOVE_NONE, gBattlerAttacker, gBattlerAttacker, TYPE_MYSTERY, 40, FALSE, FALSE, TRUE); + gProtectStructs[gBattlerAttacker].confusionSelfDmg = TRUE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; } + else + { + gBattleCommunication[MULTISTRING_CHOOSER] = FALSE; + BattleScriptPushCursor(); + } gBattlescriptCurrInstr = BattleScript_MoveUsedIsConfused; } else // snapped out of confusion @@ -1437,9 +1498,9 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_PARALYSED: // paralysis - if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0) + if (!gBattleStruct->isAtkCancelerForCalledMove && (gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && !RandomPercentage(RNG_PARALYSIS, 75)) { - gProtectStructs[gBattlerAttacker].prlzImmobility = 1; + gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE; // This is removed in FRLG and Emerald for some reason //CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed; @@ -1461,10 +1522,10 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_IN_LOVE: // infatuation - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) + if (!gBattleStruct->isAtkCancelerForCalledMove && gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) { gBattleScripting.battler = CountTrailingZeroBits((gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) >> 0x10); - if (Random() & 1) + if (!RandomPercentage(RNG_INFATUATION, 50)) { BattleScriptPushCursor(); } @@ -1472,7 +1533,7 @@ u8 AtkCanceller_UnableToUseMove(void) { BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; - gProtectStructs[gBattlerAttacker].loveImmobility = 1; + gProtectStructs[gBattlerAttacker].loveImmobility = TRUE; CancelMultiTurnMoves(gBattlerAttacker); } gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove; @@ -1492,11 +1553,11 @@ u8 AtkCanceller_UnableToUseMove(void) { // This is removed in FRLG and Emerald for some reason //gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS; - if (gTakenDmg[gBattlerAttacker]) + if (gBideDmg[gBattlerAttacker]) { gCurrentMove = MOVE_BIDE; - *bideDmg = gTakenDmg[gBattlerAttacker] * 2; - gBattlerTarget = gTakenDmgByBattler[gBattlerAttacker]; + gBattleScripting.bideDmg = gBideDmg[gBattlerAttacker] * 2; + gBattlerTarget = gBideTarget[gBattlerAttacker]; if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1); gBattlescriptCurrInstr = BattleScript_BideAttack; @@ -1513,7 +1574,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_THAW: // move thawing if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE) { - if (gBattleMoves[gCurrentMove].effect == EFFECT_THAW_HIT) + if (!(MoveHasAdditionalEffectSelfArg(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE))) { gBattleMons[gBattlerAttacker].status1 &= ~STATUS1_FREEZE; BattleScriptPushCursor(); @@ -1522,53 +1583,329 @@ u8 AtkCanceller_UnableToUseMove(void) } effect = 2; } + if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE && gMovesInfo[gCurrentMove].thawsUser) + { + if (!(MoveHasAdditionalEffectSelfArg(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE))) + { + gBattleMons[gBattlerAttacker].status1 &= ~STATUS1_FROSTBITE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveUsedUnfrostbite; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FROSTBITE_HEALED_BY_MOVE; + } + effect = 2; + } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_POWDER_MOVE: + if ((gMovesInfo[gCurrentMove].powderMove) && (gBattlerAttacker != gBattlerTarget)) + { + if (B_POWDER_GRASS >= GEN_6 + && (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS) || GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)) + { + gBattlerAbility = gBattlerTarget; + effect = 1; + } + else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_SAFETY_GOGGLES) + { + RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_SAFETY_GOGGLES); + gLastUsedItem = gBattleMons[gBattlerTarget].item; + effect = 1; + } + + if (effect != 0) + gBattlescriptCurrInstr = BattleScript_PowderMoveNoEffect; + } + if (gProtectStructs[gBattlerAttacker].usesBouncedMove) // Edge case for bouncing a powder move against a grass type pokemon. + gBattleStruct->atkCancellerTracker = CANCELLER_END; + else + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_POWDER_STATUS: + if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER) + { + if (moveType == TYPE_FIRE) + { + gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE; + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; + effect = 1; + } + } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_THROAT_CHOP: + if (/* gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && */ gDisableStructs[gBattlerAttacker].throatChopTimer && gMovesInfo[gCurrentMove].soundMove) + { + gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = TRUE; + CancelMultiTurnMoves(gBattlerAttacker); + gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented; + gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; + effect = 1; + } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_Z_MOVES: + // TODO: Z-Moves + // if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] != MOVE_NONE) + // { + // // For Z-Mirror Move, so it doesn't play the animation twice. + // bool32 alreadyUsed = (gBattleStruct->zmove.used[gBattlerAttacker] == TRUE); + + // //attacker has a queued z move + // gBattleStruct->zmove.active = TRUE; + // gBattleStruct->zmove.activeCategory = gBattleStruct->zmove.categories[gBattlerAttacker]; + // RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_Z_CRYSTAL); + // gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; + // if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsPartnerMonFromSameTrainer(gBattlerAttacker)) + // gBattleStruct->zmove.used[BATTLE_PARTNER(gBattlerAttacker)] = TRUE; //if 1v1 double, set partner used flag as well + + // gBattleScripting.battler = gBattlerAttacker; + // if (gBattleStruct->zmove.activeCategory == DAMAGE_CATEGORY_STATUS) + // { + // gBattleStruct->zmove.effect = gMovesInfo[gBattleStruct->zmove.baseMoves[gBattlerAttacker]].zMove.effect; + // if (!alreadyUsed) + // { + // BattleScriptPushCursor(); + // gBattlescriptCurrInstr = BattleScript_ZMoveActivateStatus; + // } + // } + // else + // { + // if (!alreadyUsed) + // { + // BattleScriptPushCursor(); + // gBattlescriptCurrInstr = BattleScript_ZMoveActivateDamaging; + // } + // } + // effect = 1; + // } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_MULTIHIT_MOVES: + if (gMovesInfo[gCurrentMove].effect == EFFECT_MULTI_HIT) + { + u16 ability = gBattleMons[gBattlerAttacker].ability; + + if (ability == ABILITY_SKILL_LINK) + { + gMultiHitCounter = 5; + } + else if (ability == ABILITY_BATTLE_BOND + && gCurrentMove == MOVE_WATER_SHURIKEN + && gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_ASH) + { + gMultiHitCounter = 3; + } + else + { + SetRandomMultiHitCounter(); + } + + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + } + else if (gMovesInfo[gCurrentMove].strikeCount > 1) + { + if (gMovesInfo[gCurrentMove].effect == EFFECT_POPULATION_BOMB && GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) + { + gMultiHitCounter = RandomUniform(RNG_LOADED_DICE, 4, 10); + } + else + { + gMultiHitCounter = gMovesInfo[gCurrentMove].strikeCount; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 3, 0) + } + } + else if (B_BEAT_UP >= GEN_5 && gMovesInfo[gCurrentMove].effect == EFFECT_BEAT_UP) + { + struct Pokemon* party = GetBattlerParty(gBattlerAttacker); + int i; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) + && GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && !GetMonData(&party[i], MON_DATA_STATUS)) + gMultiHitCounter++; + } + + gBattleStruct->beatUpSlot = 0; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + } + else + { + gMultiHitCounter = 0; + } gBattleStruct->atkCancellerTracker++; break; case CANCELLER_END: break; } - } while (gBattleStruct->atkCancellerTracker != CANCELLER_END && effect == 0); + } while (gBattleStruct->atkCancellerTracker != CANCELLER_END && gBattleStruct->atkCancellerTracker != CANCELLER_END2 && effect == 0); if (effect == 2) { gActiveBattler = gBattlerAttacker; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBattlerAttacker].status1); + MarkBattlerForControllerExec(gBattlerAttacker); } return effect; } -bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2) + +// After Protean Activation. +u8 AtkCanceller_UnableToUseMove2(void) { - u8 playerId, flankId; + u8 effect = 0; + + do + { + switch (gBattleStruct->atkCancellerTracker) + { + case CANCELLER_END: + gBattleStruct->atkCancellerTracker++; + case CANCELLER_PSYCHIC_TERRAIN: + if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN + && IsBattlerGrounded(gBattlerTarget) + && GetChosenMovePriority(gBattlerAttacker) > 0 + && gMovesInfo[gCurrentMove].target != MOVE_TARGET_ALL_BATTLERS + && gMovesInfo[gCurrentMove].target != MOVE_TARGET_OPPONENTS_FIELD + && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)) + { + CancelMultiTurnMoves(gBattlerAttacker); + gBattlescriptCurrInstr = BattleScript_MoveUsedPsychicTerrainPrevents; + gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; + effect = 1; + } + gBattleStruct->atkCancellerTracker++; + break; + case CANCELLER_END2: + break; + } + + } while (gBattleStruct->atkCancellerTracker != CANCELLER_END2 && effect == 0); + + return effect; +} + +bool32 HasNoMonsToSwitch(u32 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2) +{ + u32 i, side, playerId, flankId; struct Pokemon *party; - s32 i; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) return FALSE; - if (gBattleTypeFlags & BATTLE_TYPE_MULTI) - { - flankId = GetBattlerMultiplayerId(battler); - if (GetBattlerSide(battler) == B_SIDE_PLAYER) - party = gPlayerParty; - else - party = gEnemyParty; + side = GetBattlerSide(battler); + + if (BATTLE_TWO_VS_ONE_OPPONENT && side == B_SIDE_OPPONENT) + { + flankId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + party = gEnemyParty; + + if (partyIdBattlerOn1 == PARTY_SIZE) + partyIdBattlerOn1 = gBattlerPartyIndexes[flankId]; + if (partyIdBattlerOn2 == PARTY_SIZE) + partyIdBattlerOn2 = gBattlerPartyIndexes[playerId]; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (IsValidForBattle(&party[i]) + && i != partyIdBattlerOn1 && i != partyIdBattlerOn2 + && i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId]) + break; + } + return (i == PARTY_SIZE); + } + else if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + { + party = GetBattlerParty(battler); + if (side == B_SIDE_OPPONENT && WILD_DOUBLE_BATTLE) + { + flankId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + + if (partyIdBattlerOn1 == PARTY_SIZE) + partyIdBattlerOn1 = gBattlerPartyIndexes[flankId]; + if (partyIdBattlerOn2 == PARTY_SIZE) + partyIdBattlerOn2 = gBattlerPartyIndexes[playerId]; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (IsValidForBattle(&party[i]) + && i != partyIdBattlerOn1 && i != partyIdBattlerOn2 + && i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId]) + break; + } + return (i == PARTY_SIZE); + } + else + { + playerId = ((battler & BIT_FLANK) / 2); + for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++) + { + if (IsValidForBattle(&party[i])) + break; + } + return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE); + } + } + else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI) + { + if (side == B_SIDE_PLAYER) + { + party = gPlayerParty; + flankId = GetBattlerMultiplayerId(battler); + playerId = GetLinkTrainerFlankId(flankId); + } + else + { + party = gEnemyParty; + if (battler == 1) + playerId = 0; + else + playerId = 1; + } + } + else + { + flankId = GetBattlerMultiplayerId(battler); + party = GetBattlerParty(battler); + playerId = GetLinkTrainerFlankId(flankId); + } - playerId = GetLinkTrainerFlankId(flankId); for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++) { - if (GetMonData(&party[i], MON_DATA_HP) != 0 - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) + if (IsValidForBattle(&party[i])) break; } return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE); } + else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && side == B_SIDE_OPPONENT) + { + party = gEnemyParty; + + if (battler == 1) + playerId = 0; + else + playerId = MULTI_PARTY_SIZE; + + for (i = playerId; i < playerId + MULTI_PARTY_SIZE; i++) + { + if (IsValidForBattle(&party[i])) + break; + } + return (i == playerId + 3); + } else { - if (GetBattlerSide(battler) == B_SIDE_OPPONENT) + if (side == B_SIDE_OPPONENT) { flankId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); @@ -1588,9 +1925,7 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2) for (i = 0; i < PARTY_SIZE; i++) { - if (GetMonData(&party[i], MON_DATA_HP) != 0 - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG + if (IsValidForBattle(&party[i]) && i != partyIdBattlerOn1 && i != partyIdBattlerOn2 && i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId]) break; @@ -1599,6 +1934,84 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2) } } +static bool32 TryChangeBattleTerrain(u32 battler, u32 statusFlag, u8 *timer) +{ + if ((!(gFieldStatuses & statusFlag) && (!gBattleStruct->isSkyBattle))) + { + gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN); + gFieldStatuses |= statusFlag; + gDisableStructs[battler].terrainAbilityDone = FALSE; + + if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_TERRAIN_EXTENDER) + *timer = 8; + else + *timer = 5; + + gBattleScripting.battler = battler; + return TRUE; + } + + return FALSE; +} + +static void ForewarnChooseMove(u32 battler) +{ + struct Forewarn { + u8 battler; + u8 power; + u16 moveId; + }; + u32 i, j, bestId, count; + struct Forewarn *data = Alloc(sizeof(struct Forewarn) * MAX_BATTLERS_COUNT * MAX_MON_MOVES); + + // Put all moves + for (count = 0, i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (IsBattlerAlive(i) && GetBattlerSide(i) != GetBattlerSide(battler)) + { + for (j = 0; j < MAX_MON_MOVES; j++) + { + if (gBattleMons[i].moves[j] == MOVE_NONE) + continue; + data[count].moveId = gBattleMons[i].moves[j]; + data[count].battler = i; + switch (gMovesInfo[data[count].moveId].effect) + { + case EFFECT_OHKO: + data[count].power = 150; + break; + case EFFECT_COUNTER: + case EFFECT_MIRROR_COAT: + case EFFECT_METAL_BURST: + data[count].power = 120; + break; + default: + if (gMovesInfo[data[count].moveId].power == 1) + data[count].power = 80; + else + data[count].power = gMovesInfo[data[count].moveId].power; + break; + } + count++; + } + } + } + + for (bestId = 0, i = 1; i < count; i++) + { + if (data[i].power > data[bestId].power) + bestId = i; + else if (data[i].power == data[bestId].power && Random() & 1) + bestId = i; + } + + gBattlerTarget = data[bestId].battler; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, data[bestId].moveId) + RecordKnownMove(gBattlerTarget, data[bestId].moveId); + + Free(data); +} + enum { CASTFORM_NO_CHANGE, @@ -1643,785 +2056,2166 @@ u8 CastformDataTypeChange(u8 battler) return formChange; } -u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 moveArg) +bool32 ChangeTypeBasedOnTerrain(u32 battler) { - u8 effect = 0; - struct Pokemon *pokeAtk; - struct Pokemon *pokeDef; - u16 speciesAtk; - u16 speciesDef; - u32 pidAtk; - u32 pidDef; + u32 battlerType; + + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + battlerType = TYPE_ELECTRIC; + else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) + battlerType = TYPE_GRASS; + else if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + battlerType = TYPE_FAIRY; + else if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + battlerType = TYPE_PSYCHIC; + else // failsafe + return FALSE; + + SET_BATTLER_TYPE(battler, battlerType); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, battlerType); + return TRUE; +} + +static inline u8 GetSideFaintCounter(u32 side) +{ + return (side == B_SIDE_PLAYER) ? gBattleResults.playerFaintCounter : gBattleResults.opponentFaintCounter; +} + +static inline u8 GetBattlerSideFaintCounter(u32 battler) +{ + return GetSideFaintCounter(GetBattlerSide(battler)); +} + +// Supreme Overlord adds a x0.1 damage boost for each fainted ally. +static inline uq4_12_t GetSupremeOverlordModifier(u32 battler) +{ + return UQ_4_12(1.0) + (UQ_4_12(0.1) * gBattleStruct->supremeOverlordCounter[battler]); +} + +static inline bool32 HadMoreThanHalfHpNowHasLess(u32 battler) +{ + u32 cutoff = gBattleMons[battler].maxHP / 2; + if (gBattleMons[battler].maxHP % 2 == 1) + cutoff++; + // Had more than half of hp before, now has less + return (gBattleStruct->hpBefore[battler] >= cutoff + && gBattleMons[battler].hp < cutoff); +} + +u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 moveArg) +{ + u32 effect = 0; + u32 moveType, move; + u32 side; + u32 i, j; + u32 partner; + struct Pokemon *mon; + + if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) + return 0; if (gBattlerAttacker >= gBattlersCount) gBattlerAttacker = battler; - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) - pokeAtk = &gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]; + if (special) + gLastUsedAbility = special; else - pokeAtk = &gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]]; + gLastUsedAbility = GetBattlerAbility(battler); - if (gBattlerTarget >= gBattlersCount) - gBattlerTarget = battler; - - if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) - pokeDef = &gPlayerParty[gBattlerPartyIndexes[gBattlerTarget]]; + if (moveArg) + move = moveArg; else - pokeDef = &gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]; + move = gCurrentMove; - speciesAtk = GetMonData(pokeAtk, MON_DATA_SPECIES); - pidAtk = GetMonData(pokeAtk, MON_DATA_PERSONALITY); + GET_MOVE_TYPE(move, moveType); - speciesDef = GetMonData(pokeDef, MON_DATA_SPECIES); - pidDef = GetMonData(pokeDef, MON_DATA_PERSONALITY); - - if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) // Why isn't that check done at the beginning? + switch (caseID) { - u8 moveType; - s32 i; - u16 move; - u8 side; - u8 target1; - - if (special) - gLastUsedAbility = special; - else - gLastUsedAbility = gBattleMons[battler].ability; - - if (moveArg) - move = moveArg; - else - move = gCurrentMove; - - GET_MOVE_TYPE(move, moveType); - - if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags) - && (gLastUsedAbility == ABILITY_INTIMIDATE || gLastUsedAbility == ABILITY_TRACE)) - return effect; - - switch (caseID) + case ABILITYEFFECT_SWITCH_IN_STATUSES: // starting field/side/etc statuses with a variable { - case ABILITYEFFECT_ON_SWITCHIN: // 0 - if (gBattlerAttacker >= gBattlersCount) - gBattlerAttacker = battler; - switch (gLastUsedAbility) + u8 timerVal = gBattleStruct->startingStatusTimer; + + gBattleScripting.battler = battler; + switch (gBattleStruct->startingStatus) { - case ABILITYEFFECT_SWITCH_IN_WEATHER: - switch (GetCurrentWeather()) + case STARTING_STATUS_ELECTRIC_TERRAIN: + if (!(gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN)) { - case WEATHER_RAIN: - case WEATHER_RAIN_THUNDERSTORM: - case WEATHER_DOWNPOUR: - if (!(gBattleWeather & B_WEATHER_RAIN)) - { - gBattleWeather = (B_WEATHER_RAIN_TEMPORARY | B_WEATHER_RAIN_PERMANENT); - gBattleScripting.animArg1 = B_ANIM_RAIN_CONTINUES; - gBattleScripting.battler = battler; - effect++; - } - break; - case WEATHER_SANDSTORM: - if (!(gBattleWeather & B_WEATHER_SANDSTORM)) - { - gBattleWeather = B_WEATHER_SANDSTORM; - gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES; - gBattleScripting.battler = battler; - effect++; - } - break; - case WEATHER_DROUGHT: - if (!(gBattleWeather & B_WEATHER_SUN)) - { - gBattleWeather = B_WEATHER_SUN; - gBattleScripting.animArg1 = B_ANIM_SUN_CONTINUES; - gBattleScripting.battler = battler; - effect++; - } - break; - } - if (effect != 0) - { - gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather(); - BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_ELECTRIC; + gFieldStatuses |= STATUS_FIELD_ELECTRIC_TERRAIN; + if (timerVal == 0) + gFieldStatuses |= STATUS_FIELD_TERRAIN_PERMANENT; + else + gFieldTimers.terrainTimer = timerVal; + effect = 2; } break; - case ABILITY_DRIZZLE: - if (!(gBattleWeather & B_WEATHER_RAIN_PERMANENT)) + case STARTING_STATUS_MISTY_TERRAIN: + if (!(gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) { - gBattleWeather = (B_WEATHER_RAIN_PERMANENT | B_WEATHER_RAIN_TEMPORARY); - BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates); - gBattleScripting.battler = battler; - effect++; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_MISTY; + gFieldStatuses |= STATUS_FIELD_MISTY_TERRAIN; + if (timerVal == 0) + gFieldStatuses |= STATUS_FIELD_TERRAIN_PERMANENT; + else + gFieldTimers.terrainTimer = timerVal; + effect = 2; } break; - case ABILITY_SAND_STREAM: - if (!(gBattleWeather & B_WEATHER_SANDSTORM_PERMANENT)) + case STARTING_STATUS_GRASSY_TERRAIN: + if (!(gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN)) { - gBattleWeather = B_WEATHER_SANDSTORM; - BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates); - gBattleScripting.battler = battler; - effect++; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_GRASSY; + gFieldStatuses |= STATUS_FIELD_GRASSY_TERRAIN; + if (timerVal == 0) + gFieldStatuses |= STATUS_FIELD_TERRAIN_PERMANENT; + else + gFieldTimers.terrainTimer = timerVal; + effect = 2; } break; - case ABILITY_DROUGHT: - if (!(gBattleWeather & B_WEATHER_SUN_PERMANENT)) + case STARTING_STATUS_PSYCHIC_TERRAIN: + if (!(gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN)) { - gBattleWeather = B_WEATHER_SUN; - BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates); - gBattleScripting.battler = battler; - effect++; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_PSYCHIC; + gFieldStatuses |= STATUS_FIELD_PSYCHIC_TERRAIN; + if (timerVal == 0) + gFieldStatuses |= STATUS_FIELD_TERRAIN_PERMANENT; + else + gFieldTimers.terrainTimer = timerVal; + effect = 2; } break; - case ABILITY_INTIMIDATE: - if (!(gSpecialStatuses[battler].intimidatedMon)) + case STARTING_STATUS_TRICK_ROOM: + if (!(gFieldStatuses & STATUS_FIELD_TRICK_ROOM)) { - gStatuses3[battler] |= STATUS3_INTIMIDATE_POKES; - gSpecialStatuses[battler].intimidatedMon = 1; - } - break; - case ABILITY_FORECAST: - effect = CastformDataTypeChange(battler); - if (effect != 0) - { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); - gBattleScripting.battler = battler; - *(&gBattleStruct->formToChangeInto) = effect - 1; - } - break; - case ABILITY_TRACE: - if (!(gSpecialStatuses[battler].traced)) - { - gStatuses3[battler] |= STATUS3_TRACE; - gSpecialStatuses[battler].traced = 1; - } - break; - case ABILITY_CLOUD_NINE: - case ABILITY_AIR_LOCK: - { - for (target1 = 0; target1 < gBattlersCount; target1++) - { - effect = CastformDataTypeChange(target1); - if (effect != 0) - { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); - gBattleScripting.battler = target1; - *(&gBattleStruct->formToChangeInto) = effect - 1; - break; - } - } - } - break; - } - break; - case ABILITYEFFECT_ENDTURN: // 1 - if (gBattleMons[battler].hp != 0) - { - gBattlerAttacker = battler; - switch (gLastUsedAbility) - { - case ABILITY_RAIN_DISH: - if (WEATHER_HAS_EFFECT && (gBattleWeather & B_WEATHER_RAIN) - && gBattleMons[battler].maxHP > gBattleMons[battler].hp) - { - gLastUsedAbility = ABILITY_RAIN_DISH; // why - BattleScriptPushCursorAndCallback(BattleScript_RainDishActivates); - gBattleMoveDamage = gBattleMons[battler].maxHP / 16; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - gBattleMoveDamage *= -1; - effect++; - } - break; - case ABILITY_SHED_SKIN: - if ((gBattleMons[battler].status1 & STATUS1_ANY) && (Random() % 3) == 0) - { - if (gBattleMons[battler].status1 & (STATUS1_POISON | STATUS1_TOXIC_POISON)) - StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); - if (gBattleMons[battler].status1 & STATUS1_SLEEP) - StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); - if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) - StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); - if (gBattleMons[battler].status1 & STATUS1_BURN) - StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); - if (gBattleMons[battler].status1 & STATUS1_FREEZE) - StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); - gBattleMons[battler].status1 = 0; - gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; // fix nightmare glitch - gBattleScripting.battler = gActiveBattler = battler; - BattleScriptPushCursorAndCallback(BattleScript_ShedSkinActivates); - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); - MarkBattlerForControllerExec(gActiveBattler); - effect++; - } - break; - case ABILITY_SPEED_BOOST: - if (gBattleMons[battler].statStages[STAT_SPEED] < MAX_STAT_STAGE && gDisableStructs[battler].isFirstTurn != 2) - { - gBattleMons[battler].statStages[STAT_SPEED]++; - gBattleScripting.animArg1 = 14 + STAT_SPEED; - gBattleScripting.animArg2 = 0; - BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates); - gBattleScripting.battler = battler; - effect++; - } - break; - case ABILITY_TRUANT: - gDisableStructs[gBattlerAttacker].truantCounter ^= 1; - break; - } - } - break; - case ABILITYEFFECT_MOVES_BLOCK: // 2 - if (gLastUsedAbility == ABILITY_SOUNDPROOF) - { - for (i = 0; sSoundMovesTable[i] != SOUND_MOVES_END; i++) - { - if (sSoundMovesTable[i] == move) - break; - } - if (sSoundMovesTable[i] != SOUND_MOVES_END) - { - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) - gHitMarker |= HITMARKER_NO_PPDEDUCT; - gBattlescriptCurrInstr = BattleScript_SoundproofProtected; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_TRICK_ROOM; + gFieldStatuses |= STATUS_FIELD_TRICK_ROOM; + gBattleScripting.animArg1 = B_ANIM_STATS_CHANGE; // TODO: Animation B_ANIM_TRICK_ROOM; + if (timerVal == 0) + gFieldTimers.trickRoomTimer = 0; // infinite + else + gFieldTimers.trickRoomTimer = 5; effect = 1; } + break; + case STARTING_STATUS_MAGIC_ROOM: + if (!(gFieldStatuses & STATUS_FIELD_MAGIC_ROOM)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MAGIC_ROOM; + gFieldStatuses |= STATUS_FIELD_MAGIC_ROOM; + gBattleScripting.animArg1 = B_ANIM_STATS_CHANGE; // TODO: Animation B_ANIM_MAGIC_ROOM; + if (timerVal == 0) + gFieldTimers.magicRoomTimer = 0; // infinite + else + gFieldTimers.magicRoomTimer = 5; + effect = 1; + } + break; + case STARTING_STATUS_WONDER_ROOM: + if (!(gFieldStatuses & STATUS_FIELD_WONDER_ROOM)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_WONDER_ROOM; + gFieldStatuses |= STATUS_FIELD_WONDER_ROOM; + gBattleScripting.animArg1 = B_ANIM_STATS_CHANGE; // TODO: Animation B_ANIM_WONDER_ROOM; + if (timerVal == 0) + gFieldTimers.wonderRoomTimer = 0; // infinite + else + gFieldTimers.wonderRoomTimer = 5; + effect = 1; + } + break; + case STARTING_STATUS_TAILWIND_PLAYER: + if (!(gSideStatuses[B_SIDE_PLAYER] & SIDE_STATUS_TAILWIND)) + { + gBattlerAttacker = B_POSITION_PLAYER_LEFT; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_TAILWIND_PLAYER; + gSideStatuses[B_SIDE_PLAYER] |= SIDE_STATUS_TAILWIND; + gBattleScripting.animArg1 = B_ANIM_STATS_CHANGE; // TODO: Animation B_ANIM_TAILWIND; + if (timerVal == 0) + gSideTimers[B_SIDE_PLAYER].tailwindTimer = 0; // infinite + else + gSideTimers[B_SIDE_PLAYER].tailwindTimer = 5; + effect = 1; + } + break; + case STARTING_STATUS_TAILWIND_OPPONENT: + if (!(gSideStatuses[B_SIDE_OPPONENT] & SIDE_STATUS_TAILWIND)) + { + gBattlerAttacker = B_POSITION_OPPONENT_LEFT; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_TAILWIND_OPPONENT; + gSideStatuses[B_SIDE_OPPONENT] |= SIDE_STATUS_TAILWIND; + gBattleScripting.animArg1 = B_ANIM_STATS_CHANGE; // TODO: Animation B_ANIM_TAILWIND; + if (timerVal == 0) + gSideTimers[B_SIDE_OPPONENT].tailwindTimer = 0; // infinite + else + gSideTimers[B_SIDE_OPPONENT].tailwindTimer = 5; + effect = 1; + } + break; + } + + if (effect == 1) + BattleScriptPushCursorAndCallback(BattleScript_OverworldStatusStarts); + else if (effect == 2) + BattleScriptPushCursorAndCallback(BattleScript_OverworldTerrain); + } + break; + case ABILITYEFFECT_SWITCH_IN_TERRAIN: // terrain starting from overworld weather + if (B_THUNDERSTORM_TERRAIN == TRUE + && !(gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + && GetCurrentWeather() == WEATHER_RAIN_THUNDERSTORM) + { + // overworld weather started rain, so just do electric terrain anim + gFieldStatuses = (STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_ELECTRIC; + BattleScriptPushCursorAndCallback(BattleScript_OverworldTerrain); + effect++; + } + else if (B_FOG_TERRAIN == TRUE + && (GetCurrentWeather() == WEATHER_FOG_HORIZONTAL || GetCurrentWeather() == WEATHER_FOG_DIAGONAL) + && !(gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + { + gFieldStatuses = (STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_MISTY; + BattleScriptPushCursorAndCallback(BattleScript_OverworldTerrain); + effect++; + } + break; + case ABILITYEFFECT_SWITCH_IN_WEATHER: + gBattleScripting.battler = battler; + switch (GetCurrentWeather()) + { + case WEATHER_RAIN: + case WEATHER_RAIN_THUNDERSTORM: + case WEATHER_DOWNPOUR: + if (!(gBattleWeather & B_WEATHER_RAIN)) + { + gBattleWeather = (B_WEATHER_RAIN_TEMPORARY | B_WEATHER_RAIN_PERMANENT); + gBattleScripting.animArg1 = B_ANIM_RAIN_CONTINUES; + effect++; } break; - case ABILITYEFFECT_ABSORBING: // 3 - if (move) + case WEATHER_SANDSTORM: + if (!(gBattleWeather & B_WEATHER_SANDSTORM)) { - switch (gLastUsedAbility) + gBattleWeather = B_WEATHER_SANDSTORM; + gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES; + effect++; + } + break; + case WEATHER_DROUGHT: + if (!(gBattleWeather & B_WEATHER_SUN)) + { + gBattleWeather = (B_WEATHER_SUN_PERMANENT | B_WEATHER_SUN_TEMPORARY); + gBattleScripting.animArg1 = B_ANIM_SUN_CONTINUES; + effect++; + } + break; + case WEATHER_SNOW: + if (!(gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW))) + { + if (B_OVERWORLD_SNOW >= GEN_9) { - case ABILITY_VOLT_ABSORB: - if (moveType == TYPE_ELECTRIC && gBattleMoves[move].power != 0) - { - if (gProtectStructs[gBattlerAttacker].notFirstStrike) - gBattlescriptCurrInstr = BattleScript_MoveHPDrain; - else - gBattlescriptCurrInstr = BattleScript_MoveHPDrain_PPLoss; - - effect = 1; - } - break; - case ABILITY_WATER_ABSORB: - if (moveType == TYPE_WATER && gBattleMoves[move].power != 0) - { - if (gProtectStructs[gBattlerAttacker].notFirstStrike) - gBattlescriptCurrInstr = BattleScript_MoveHPDrain; - else - gBattlescriptCurrInstr = BattleScript_MoveHPDrain_PPLoss; - - effect = 1; - } - break; - case ABILITY_FLASH_FIRE: - if (moveType == TYPE_FIRE && !(gBattleMons[battler].status1 & STATUS1_FREEZE)) - { - if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) - { - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_BOOST; - if (gProtectStructs[gBattlerAttacker].notFirstStrike) - gBattlescriptCurrInstr = BattleScript_FlashFireBoost; - else - gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; - - gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_FLASH_FIRE; - effect = 2; - } - else - { - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_NO_BOOST; - if (gProtectStructs[gBattlerAttacker].notFirstStrike) - gBattlescriptCurrInstr = BattleScript_FlashFireBoost; - else - gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; - - effect = 2; - } - } - break; + gBattleWeather = B_WEATHER_SNOW; + gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES; // TODO: Animation B_ANIM_SNOW_CONTINUES; } - if (effect == 1) + else { - if (gBattleMons[battler].maxHP == gBattleMons[battler].hp) + gBattleWeather = B_WEATHER_HAIL; + gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES; + } + effect++; + } + break; + } + if (effect != 0) + { + gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather(); + BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts); + } + break; + case ABILITYEFFECT_ON_SWITCHIN: // 0 + gBattleScripting.battler = battler; + switch (gLastUsedAbility) + { + case ABILITY_IMPOSTER: + if (IsBattlerAlive(BATTLE_OPPOSITE(battler)) + && !(gBattleMons[BATTLE_OPPOSITE(battler)].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE)) + && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) + && !(gBattleStruct->illusion[BATTLE_OPPOSITE(battler)].on) + && !(gStatuses3[BATTLE_OPPOSITE(battler)] & STATUS3_SEMI_INVULNERABLE)) + { + gBattlerAttacker = battler; + gBattlerTarget = BATTLE_OPPOSITE(battler); + BattleScriptPushCursorAndCallback(BattleScript_ImposterActivates); + effect++; + } + break; + case ABILITY_MOLD_BREAKER: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_MOLDBREAKER; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_TERAVOLT: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TERAVOLT; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_TURBOBLAZE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TURBOBLAZE; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_SLOW_START: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gDisableStructs[battler].slowStartTimer = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SLOWSTART; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_UNNERVE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_UNNERVE; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_AS_ONE_ICE_RIDER: + case ABILITY_AS_ONE_SHADOW_RIDER: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ASONE; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_ActivateAsOne); + effect++; + } + break; + case ABILITY_CURIOUS_MEDICINE: + if (!gSpecialStatuses[battler].switchInAbilityDone && IsDoubleBattle() + && IsBattlerAlive(BATTLE_PARTNER(battler)) && TryResetBattlerStatChanges(BATTLE_PARTNER(battler))) + { + gEffectBattler = BATTLE_PARTNER(battler); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_CURIOUS_MEDICINE; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_PASTEL_VEIL: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattlerTarget = battler; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL; + BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates); + effect++; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + } + break; + case ABILITY_ANTICIPATION: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + u32 side = GetBattlerSide(battler); + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (IsBattlerAlive(i) && side != GetBattlerSide(i)) { - if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) - gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless; + for (j = 0; j < MAX_MON_MOVES; j++) + { + move = gBattleMons[i].moves[j]; + GET_MOVE_TYPE(move, moveType); + if (CalcTypeEffectivenessMultiplier(move, moveType, i, battler, ABILITY_ANTICIPATION, FALSE) >= UQ_4_12(2.0)) + { + effect++; + break; + } + } + } + } + + if (effect != 0) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ANTICIPATION; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + } + } + break; + case ABILITY_FRISK: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + gBattlerAttacker = battler; + BattleScriptPushCursorAndCallback(BattleScript_FriskActivates); // Try activate + effect++; + } + return effect; // Note: It returns effect as to not record the ability if Frisk does not activate. + case ABILITY_FOREWARN: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + ForewarnChooseMove(battler); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FOREWARN; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_DOWNLOAD: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + u32 statId, opposingBattler; + u32 opposingDef = 0, opposingSpDef = 0; + + opposingBattler = BATTLE_OPPOSITE(battler); + for (i = 0; i < 2; opposingBattler ^= BIT_FLANK, i++) + { + if (IsBattlerAlive(opposingBattler)) + { + opposingDef += gBattleMons[opposingBattler].defense + * gStatStageRatios[gBattleMons[opposingBattler].statStages[STAT_DEF]][0] + / gStatStageRatios[gBattleMons[opposingBattler].statStages[STAT_DEF]][1]; + opposingSpDef += gBattleMons[opposingBattler].spDefense + * gStatStageRatios[gBattleMons[opposingBattler].statStages[STAT_SPDEF]][0] + / gStatStageRatios[gBattleMons[opposingBattler].statStages[STAT_SPDEF]][1]; + } + } + + if (opposingDef < opposingSpDef) + statId = STAT_ATK; + else + statId = STAT_SPATK; + + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + + if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(statId, 1, FALSE); + gBattlerAttacker = battler; + PREPARE_STAT_BUFFER(gBattleTextBuff1, statId); + BattleScriptPushCursorAndCallback(BattleScript_AttackerAbilityStatRaiseEnd3); + effect++; + } + } + break; + case ABILITY_PRESSURE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PRESSURE; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_DARK_AURA: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_DARKAURA; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_FAIRY_AURA: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FAIRYAURA; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_AURA_BREAK: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_AURABREAK; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_COMATOSE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_COMATOSE; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_SCREEN_CLEANER: + if (!gSpecialStatuses[battler].switchInAbilityDone && TryRemoveScreens(battler)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SCREENCLEANER; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_DRIZZLE: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_RAIN, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates); + effect++; + } + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } + break; + case ABILITY_SAND_STREAM: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates); + effect++; + } + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } + break; + case ABILITY_DROUGHT: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates); + effect++; + } + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } + break; + case ABILITY_SNOW_WARNING: + if (B_SNOW_WARNING >= GEN_9 && TryChangeBattleWeather(battler, ENUM_WEATHER_SNOW, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivatesSnow); + effect++; + } + else if (B_SNOW_WARNING < GEN_9 && TryChangeBattleWeather(battler, ENUM_WEATHER_HAIL, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivatesHail); + effect++; + } + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } + break; + case ABILITY_ELECTRIC_SURGE: + case ABILITY_HADRON_ENGINE: + if (TryChangeBattleTerrain(battler, STATUS_FIELD_ELECTRIC_TERRAIN, &gFieldTimers.terrainTimer)) + { + BattleScriptPushCursorAndCallback(BattleScript_ElectricSurgeActivates); + effect++; + } + break; + case ABILITY_GRASSY_SURGE: + if (TryChangeBattleTerrain(battler, STATUS_FIELD_GRASSY_TERRAIN, &gFieldTimers.terrainTimer)) + { + BattleScriptPushCursorAndCallback(BattleScript_GrassySurgeActivates); + effect++; + } + break; + case ABILITY_MISTY_SURGE: + if (TryChangeBattleTerrain(battler, STATUS_FIELD_MISTY_TERRAIN, &gFieldTimers.terrainTimer)) + { + BattleScriptPushCursorAndCallback(BattleScript_MistySurgeActivates); + effect++; + } + break; + case ABILITY_PSYCHIC_SURGE: + if (TryChangeBattleTerrain(battler, STATUS_FIELD_PSYCHIC_TERRAIN, &gFieldTimers.terrainTimer)) + { + BattleScriptPushCursorAndCallback(BattleScript_PsychicSurgeActivates); + effect++; + } + break; + case ABILITY_INTIMIDATE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattlerAttacker = battler; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + SET_STATCHANGER(STAT_ATK, 1, TRUE); + BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivates); + effect++; + } + break; + case ABILITY_SUPERSWEET_SYRUP: + if (!gSpecialStatuses[battler].switchInAbilityDone + && !(gBattleStruct->supersweetSyrup[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]])) + { + gBattlerAttacker = battler; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + gBattleStruct->supersweetSyrup[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]]; + BattleScriptPushCursorAndCallback(BattleScript_SupersweetSyrupActivates); + effect++; + } + break; + case ABILITY_TRACE: + if (!(gSpecialStatuses[battler].traced)) + { + gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_TRACED; + gSpecialStatuses[battler].traced = TRUE; + } + break; + case ABILITY_CLOUD_NINE: + case ABILITY_AIR_LOCK: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_AnnounceAirLockCloudNine); + effect++; + } + break; + case ABILITY_SCHOOLING: + if (gBattleMons[battler].level < 20) + break; + // Fallthrough + case ABILITY_ZEN_MODE: + case ABILITY_SHIELDS_DOWN: + if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_HP_PERCENT)) + { + gBattlerAttacker = battler; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); + effect++; + } + break; + case ABILITY_INTREPID_SWORD: + if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN) + && !(gBattleStruct->intrepidSwordBoost[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]])) + { + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; + if (B_INTREPID_SWORD == GEN_9) + gBattleStruct->intrepidSwordBoost[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]]; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + SET_STATCHANGER(STAT_ATK, 1, FALSE); + BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); + effect++; + } + break; + case ABILITY_DAUNTLESS_SHIELD: + if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN) + && !(gBattleStruct->dauntlessShieldBoost[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]])) + { + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; + if (B_DAUNTLESS_SHIELD == GEN_9) + gBattleStruct->dauntlessShieldBoost[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]]; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + SET_STATCHANGER(STAT_DEF, 1, FALSE); + BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); + effect++; + } + break; + case ABILITY_DESOLATE_LAND: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN_PRIMAL, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DesolateLandActivates); + effect++; + } + break; + case ABILITY_PRIMORDIAL_SEA: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_RAIN_PRIMAL, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_PrimordialSeaActivates); + effect++; + } + break; + case ABILITY_DELTA_STREAM: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_STRONG_WINDS, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DeltaStreamActivates); + effect++; + } + break; + case ABILITY_VESSEL_OF_RUIN: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK); + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_RuinAbilityActivates); + effect++; + } + break; + case ABILITY_SWORD_OF_RUIN: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_DEF); + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_RuinAbilityActivates); + effect++; + } + break; + case ABILITY_TABLETS_OF_RUIN: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK); + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_RuinAbilityActivates); + effect++; + } + break; + case ABILITY_BEADS_OF_RUIN: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPDEF); + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + BattleScriptPushCursorAndCallback(BattleScript_RuinAbilityActivates); + effect++; + } + break; + case ABILITY_ORICHALCUM_PULSE: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates); + effect++; + } + break; + case ABILITY_SUPREME_OVERLORD: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + gBattleStruct->supremeOverlordCounter[battler] = min(5, GetBattlerSideFaintCounter(battler)); + if (gBattleStruct->supremeOverlordCounter[battler] > 0) + { + BattleScriptPushCursorAndCallback(BattleScript_SupremeOverlordActivates); + effect++; + } + } + break; + case ABILITY_COSTAR: + if (!gSpecialStatuses[battler].switchInAbilityDone + && IsDoubleBattle() + && IsBattlerAlive(BATTLE_PARTNER(battler)) + && CountBattlerStatIncreases(BATTLE_PARTNER(battler), FALSE)) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + for (i = 0; i < NUM_BATTLE_STATS; i++) + gBattleMons[battler].statStages[i] = gBattleMons[BATTLE_PARTNER(battler)].statStages[i]; + gBattlerTarget = BATTLE_PARTNER(battler); + BattleScriptPushCursorAndCallback(BattleScript_CostarActivates); + effect++; + } + break; + case ABILITY_ZERO_TO_HERO: + side = GetBattlerSide(battler); + mon = &GetSideParty(side)[gBattlerPartyIndexes[battler]]; + + if (!gSpecialStatuses[battler].switchInAbilityDone + && GetMonData(mon, MON_DATA_SPECIES) == SPECIES_PALAFIN_HERO + && !(gBattleStruct->transformZeroToHero[side] & gBitTable[gBattlerPartyIndexes[battler]])) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + gBattleStruct->transformZeroToHero[side] |= gBitTable[gBattlerPartyIndexes[battler]]; + BattleScriptPushCursorAndCallback(BattleScript_ZeroToHeroActivates); + effect++; + } + break; + case ABILITY_HOSPITALITY: + partner = BATTLE_PARTNER(battler); + + if (!gSpecialStatuses[battler].switchInAbilityDone + && IsDoubleBattle() + && gBattleMons[partner].hp < gBattleMons[partner].maxHP + && IsBattlerAlive(partner)) + { + gBattlerTarget = partner; + gBattlerAttacker = battler; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + // TODO: Dynamax + // gBattleMoveDamage = (GetNonDynamaxMaxHP(partner) / 4) * -1; + gBattleMoveDamage = (gBattleMons[partner].maxHP / 4) * -1; + BattleScriptPushCursorAndCallback(BattleScript_HospitalityActivates); + effect++; + } + break; + case ABILITY_EMBODY_ASPECT_TEAL: + case ABILITY_EMBODY_ASPECT_HEARTHFLAME: + case ABILITY_EMBODY_ASPECT_WELLSPRING: + case ABILITY_EMBODY_ASPECT_CORNERSTONE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + u32 stat = STAT_SPATK; + + if (gLastUsedAbility == ABILITY_EMBODY_ASPECT_TEAL) + stat = STAT_SPATK; + else if (gLastUsedAbility == ABILITY_EMBODY_ASPECT_HEARTHFLAME) + stat = STAT_ATK; + else if (gLastUsedAbility == ABILITY_EMBODY_ASPECT_WELLSPRING) + stat = STAT_SPDEF; + else if (gLastUsedAbility == ABILITY_EMBODY_ASPECT_CORNERSTONE) + stat = STAT_DEF; + + if (CompareStat(battler, stat, MAX_STAT_STAGE, CMP_EQUAL)) + break; + + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + SET_STATCHANGER(stat, 1, FALSE); + BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); + effect++; + } + break; + } + break; + case ABILITYEFFECT_ENDTURN: // 1 + if (gBattleMons[battler].hp != 0) + { + gBattlerAttacker = battler; + switch (gLastUsedAbility) + { + case ABILITY_HARVEST: + if ((IsBattlerWeatherAffected(battler, B_WEATHER_SUN) || Random() % 2 == 0) + && gBattleMons[battler].item == ITEM_NONE + && gBattleStruct->changedItems[battler] == ITEM_NONE // Will not inherit an item + && ItemId_GetPocket(GetUsedHeldItem(battler)) == POCKET_BERRY_POUCH) + { + gLastUsedItem = GetUsedHeldItem(battler); + BattleScriptPushCursorAndCallback(BattleScript_HarvestActivates); + effect++; + } + break; + case ABILITY_DRY_SKIN: + if (IsBattlerWeatherAffected(battler, B_WEATHER_SUN)) + goto SOLAR_POWER_HP_DROP; + // Dry Skin works similarly to Rain Dish in Rain + case ABILITY_RAIN_DISH: + if (IsBattlerWeatherAffected(battler, B_WEATHER_RAIN) + && !BATTLER_MAX_HP(battler) + && !(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) + { + BattleScriptPushCursorAndCallback(BattleScript_RainDishActivates); + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / (gLastUsedAbility == ABILITY_RAIN_DISH ? 16 : 8); + gBattleMoveDamage = gBattleMons[battler].maxHP / (gLastUsedAbility == ABILITY_RAIN_DISH ? 16 : 8); + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + effect++; + } + break; + case ABILITY_HYDRATION: + if (IsBattlerWeatherAffected(battler, B_WEATHER_RAIN) + && gBattleMons[battler].status1 & STATUS1_ANY) + { + goto ABILITY_HEAL_MON_STATUS; + } + break; + case ABILITY_SHED_SKIN: + if ((gBattleMons[battler].status1 & STATUS1_ANY) && (Random() % 3) == 0) + { + ABILITY_HEAL_MON_STATUS: + if (gBattleMons[battler].status1 & (STATUS1_POISON | STATUS1_TOXIC_POISON)) + StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); + if (gBattleMons[battler].status1 & STATUS1_SLEEP) + StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) + StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); + if (gBattleMons[battler].status1 & STATUS1_BURN) + StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); + if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) + StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); + + gBattleMons[battler].status1 = 0; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + gBattleScripting.battler = gActiveBattler = battler; + BattleScriptPushCursorAndCallback(BattleScript_ShedSkinActivates); + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + effect++; + } + break; + case ABILITY_SPEED_BOOST: + if (CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) && gDisableStructs[battler].isFirstTurn != 2) + { + SET_STATCHANGER(STAT_SPEED, 1, FALSE); + BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates); + gBattleScripting.battler = battler; + effect++; + } + break; + case ABILITY_MOODY: + if (gDisableStructs[battler].isFirstTurn != 2) + { + u32 validToRaise = 0, validToLower = 0; + u32 statsNum = B_MOODY_ACC_EVASION >= GEN_8 ? NUM_STATS : NUM_BATTLE_STATS; + + for (i = STAT_ATK; i < statsNum; i++) + { + if (CompareStat(battler, i, MIN_STAT_STAGE, CMP_GREATER_THAN)) + validToLower |= gBitTable[i]; + if (CompareStat(battler, i, MAX_STAT_STAGE, CMP_LESS_THAN)) + validToRaise |= gBitTable[i]; + } + + if (validToLower != 0 || validToRaise != 0) // Can lower one stat, or can raise one stat + { + gBattleScripting.statChanger = gBattleScripting.savedStatChanger = 0; // for raising and lowering stat respectively + if (validToRaise != 0) // Find stat to raise + { + do + { + i = (Random() % statsNum) + STAT_ATK; + } while (!(validToRaise & gBitTable[i])); + SET_STATCHANGER(i, 2, FALSE); + validToLower &= ~(gBitTable[i]); // Can't lower the same stat as raising. + } + if (validToLower != 0) // Find stat to lower + { + do + { + i = (Random() % statsNum) + STAT_ATK; + } while (!(validToLower & gBitTable[i])); + SET_STATCHANGER2(gBattleScripting.savedStatChanger, i, 1, TRUE); + } + BattleScriptPushCursorAndCallback(BattleScript_MoodyActivates); + effect++; + } + } + break; + case ABILITY_TRUANT: + gDisableStructs[gBattlerAttacker].truantCounter ^= 1; + break; + case ABILITY_BAD_DREAMS: + BattleScriptPushCursorAndCallback(BattleScript_BadDreamsActivates); + effect++; + break; + SOLAR_POWER_HP_DROP: + case ABILITY_SOLAR_POWER: + if (IsBattlerWeatherAffected(battler, B_WEATHER_SUN)) + { + BattleScriptPushCursorAndCallback(BattleScript_SolarPowerActivates); + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 8; + gBattleMoveDamage = gBattleMons[battler].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + effect++; + } + break; + case ABILITY_HEALER: + gBattleScripting.battler = BATTLE_PARTNER(battler); + if (IsBattlerAlive(gBattleScripting.battler) + && gBattleMons[gBattleScripting.battler].status1 & STATUS1_ANY + && (Random() % 100) < 30) + { + BattleScriptPushCursorAndCallback(BattleScript_HealerActivates); + effect++; + } + break; + case ABILITY_SCHOOLING: + if (gBattleMons[battler].level < 20) + break; + // Fallthrough + case ABILITY_ZEN_MODE: + case ABILITY_SHIELDS_DOWN: + case ABILITY_POWER_CONSTRUCT: + if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_HP_PERCENT)) + { + gBattlerAttacker = battler; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); + effect++; + } + break; + case ABILITY_BALL_FETCH: + if (gBattleMons[battler].item == ITEM_NONE + && gBattleResults.catchAttempts[gLastUsedBall - ITEM_ULTRA_BALL] >= 1 + && !gHasFetchedBall) + { + gBattleScripting.battler = gActiveBattler = battler; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, 2, &gLastUsedBall); + MarkBattlerForControllerExec(battler); + gHasFetchedBall = TRUE; + gLastUsedItem = gLastUsedBall; + BattleScriptPushCursorAndCallback(BattleScript_BallFetch); + effect++; + } + break; + case ABILITY_HUNGER_SWITCH: + if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_TURN_END)) + { + gBattlerAttacker = battler; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup); + effect++; + } + break; + case ABILITY_CUD_CHEW: + if (gDisableStructs[battler].cudChew == TRUE) + { + gBattleScripting.battler = battler; + gDisableStructs[battler].cudChew = FALSE; + gLastUsedItem = gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; + gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = ITEM_NONE; + BattleScriptPushCursorAndCallback(BattleScript_CudChewActivates); + effect++; + } + break; + } + } + break; + case ABILITYEFFECT_MOVES_BLOCK: // 2 + { + u16 moveTarget = GetBattlerMoveTargetType(battler, move); + u16 battlerAbility = GetBattlerAbility(battler); + u16 targetAbility = GetBattlerAbility(gBattlerTarget); + + if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gMovesInfo[move].soundMove && !(moveTarget & MOVE_TARGET_USER)) + || (gLastUsedAbility == ABILITY_BULLETPROOF && gMovesInfo[move].ballisticMove)) + { + if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) + gHitMarker |= HITMARKER_NO_PPDEDUCT; + gBattlescriptCurrInstr = BattleScript_SoundproofProtected; + effect = 1; + } + else if ((gLastUsedAbility == ABILITY_DAZZLING || gLastUsedAbility == ABILITY_QUEENLY_MAJESTY || gLastUsedAbility == ABILITY_ARMOR_TAIL || IsBattlerAlive(battler ^= BIT_FLANK)) + && (battlerAbility == ABILITY_DAZZLING || battlerAbility == ABILITY_QUEENLY_MAJESTY || battlerAbility == ABILITY_ARMOR_TAIL) + && GetChosenMovePriority(gBattlerAttacker) > 0 + && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(battler)) + { + if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) + gHitMarker |= HITMARKER_NO_PPDEDUCT; + gBattlescriptCurrInstr = BattleScript_DazzlingProtected; + effect = 1; + } + else if (GetChosenMovePriority(gBattlerAttacker) > 0 + && BlocksPrankster(move, gBattlerAttacker, gBattlerTarget, TRUE) + && !(IS_MOVE_STATUS(move) && (targetAbility == ABILITY_MAGIC_BOUNCE || gProtectStructs[gBattlerTarget].bounceMove))) + { + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) + CancelMultiTurnMoves(gBattlerAttacker); // Don't cancel moves that can hit two targets bc one target might not be protected + gBattleScripting.battler = gBattlerAbility = gBattlerTarget; + gBattlescriptCurrInstr = BattleScript_DarkTypePreventsPrankster; + effect = 1; + } + else if (GetBattlerAbility(gBattlerTarget) == ABILITY_GOOD_AS_GOLD + && IS_MOVE_STATUS(gCurrentMove) + && !(moveTarget & MOVE_TARGET_USER) + && !(moveTarget & MOVE_TARGET_OPPONENTS_FIELD) + && !(moveTarget & MOVE_TARGET_ALL_BATTLERS)) + { + gBattlescriptCurrInstr = BattleScript_GoodAsGoldActivates; + effect = 1; + } + break; + } + case ABILITYEFFECT_ABSORBING: // 3 + if (move != MOVE_NONE) + { + u8 statId = 0; + u8 statAmount = 1; + switch (gLastUsedAbility) + { + case ABILITY_VOLT_ABSORB: + if (moveType == TYPE_ELECTRIC && gMovesInfo[move].target != MOVE_TARGET_ALL_BATTLERS) + effect = 1; + break; + case ABILITY_WATER_ABSORB: + case ABILITY_DRY_SKIN: + if (moveType == TYPE_WATER) + effect = 1; + break; + case ABILITY_MOTOR_DRIVE: + if (moveType == TYPE_ELECTRIC && gMovesInfo[move].target != MOVE_TARGET_ALL_BATTLERS) + effect = 2, statId = STAT_SPEED; + break; + case ABILITY_LIGHTNING_ROD: + if (moveType == TYPE_ELECTRIC && gMovesInfo[move].target != MOVE_TARGET_ALL_BATTLERS) + effect = 2, statId = STAT_SPATK; + break; + case ABILITY_STORM_DRAIN: + if (moveType == TYPE_WATER) + effect = 2, statId = STAT_SPATK; + break; + case ABILITY_SAP_SIPPER: + if (moveType == TYPE_GRASS) + effect = 2, statId = STAT_ATK; + break; + case ABILITY_FLASH_FIRE: + if (moveType == TYPE_FIRE + && (B_FLASH_FIRE_FROZEN >= GEN_5 || !(gBattleMons[battler].status1 & STATUS1_FREEZE))) + { + if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_BOOST; + if (gProtectStructs[gBattlerAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_FlashFireBoost; else - gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless_PPLoss; + gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; + + gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_FLASH_FIRE; + effect = 3; } else { - gBattleMoveDamage = gBattleMons[battler].maxHP / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - gBattleMoveDamage *= -1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_NO_BOOST; + if (gProtectStructs[gBattlerAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_FlashFireBoost; + else + gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; + + effect = 3; } } + break; + case ABILITY_WELL_BAKED_BODY: + if (moveType == TYPE_FIRE) + effect = 2, statId = STAT_DEF, statAmount = 2; + break; + case ABILITY_WIND_RIDER: + if (gMovesInfo[gCurrentMove].windMove && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) + effect = 2, statId = STAT_ATK; + break; + case ABILITY_EARTH_EATER: + if (moveType == TYPE_GROUND) + effect = 1; + break; + } + + if (effect == 1) // Drain Hp ability. + { + if (BATTLER_MAX_HP(battler) || (B_HEAL_BLOCKING >= GEN_5 && gStatuses3[battler] & STATUS3_HEAL_BLOCK)) + { + if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) + gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless; + else + gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless_PPLoss; + } + else + { + if (gProtectStructs[gBattlerAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_MoveHPDrain; + else + gBattlescriptCurrInstr = BattleScript_MoveHPDrain_PPLoss; + + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 4; + gBattleMoveDamage = gBattleMons[battler].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + } + } + else if (effect == 2) // Boost Stat ability; + { + if (!CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) + gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless; + else + gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless_PPLoss; + } + else + { + if (gProtectStructs[gBattlerAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_MoveStatDrain; + else + gBattlescriptCurrInstr = BattleScript_MoveStatDrain_PPLoss; + + SET_STATCHANGER(statId, statAmount, FALSE); + if (B_ABSORBING_ABILITY_STRING < GEN_5) + PREPARE_STAT_BUFFER(gBattleTextBuff1, statId); + } + } + + if (effect) + gMultiHitCounter = 0; // Prevent multi-hit moves from hitting more than once after move has been absorbed. + } + break; + case ABILITYEFFECT_MOVE_END: // Think contact abilities. + switch (gLastUsedAbility) + { + case ABILITY_JUSTIFIED: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && moveType == TYPE_DARK + && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gEffectBattler = battler; + SET_STATCHANGER(STAT_ATK, 1, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; } break; - case ABILITYEFFECT_ON_DAMAGE: // Think contact abilities. - switch (gLastUsedAbility) + case ABILITY_RATTLED: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && (moveType == TYPE_DARK || moveType == TYPE_BUG || moveType == TYPE_GHOST) + && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) { - case ABILITY_COLOR_CHANGE: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && move != MOVE_STRUGGLE - && gBattleMoves[move].power != 0 - && TARGET_TURN_DAMAGED - && !IS_BATTLER_OF_TYPE(battler, moveType) - && gBattleMons[battler].hp != 0) + gEffectBattler = battler; + SET_STATCHANGER(STAT_SPEED, 1, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; + } + break; + case ABILITY_WATER_COMPACTION: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && moveType == TYPE_WATER + && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gEffectBattler = battler; + SET_STATCHANGER(STAT_DEF, 2, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; + } + break; + case ABILITY_STAMINA: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattlerAttacker != gBattlerTarget + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gEffectBattler = battler; + SET_STATCHANGER(STAT_DEF, 1, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; + } + break; + case ABILITY_BERSERK: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && HadMoreThanHalfHpNowHasLess(battler) + && (gMultiHitCounter == 0 || gMultiHitCounter == 1) + && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) + && CompareStat(battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gEffectBattler = battler; + SET_STATCHANGER(STAT_SPATK, 1, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; + } + break; + case ABILITY_EMERGENCY_EXIT: + case ABILITY_WIMP_OUT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + // Had more than half of hp before, now has less + && HadMoreThanHalfHpNowHasLess(battler) + && (gMultiHitCounter == 0 || gMultiHitCounter == 1) + && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) + && (CanBattlerSwitch(battler) || !(gBattleTypeFlags & BATTLE_TYPE_TRAINER)) + && CountUsablePartyMons(battler) > 0 + // Not currently held by Sky Drop + && !(gStatuses3[battler] & STATUS3_SKY_DROPPED)) + { + gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_EMERGENCY_EXIT; + effect++; + } + break; + case ABILITY_WEAK_ARMOR: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && IS_MOVE_PHYSICAL(gCurrentMove) + && (CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) // Don't activate if both Speed and Defense cannot be raised. + || CompareStat(battler, STAT_DEF, MIN_STAT_STAGE, CMP_GREATER_THAN))) + { + if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker)) + gProtectStructs[battler].disableEjectPack = TRUE; // Set flag for target + + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_WeakArmorActivates; + effect++; + } + break; + case ABILITY_CURSED_BODY: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && gDisableStructs[gBattlerAttacker].disabledMove == MOVE_NONE + && IsBattlerAlive(gBattlerAttacker) + && !IsAbilityOnSide(gBattlerAttacker, ABILITY_AROMA_VEIL) + && gBattleMons[gBattlerAttacker].pp[gChosenMovePos] != 0 + /* && !IsDynamaxed(gBattlerAttacker) */ // TODO: Dynamax // TODO: Max Moves don't make contact, useless? + && (Random() % 3) == 0) + { + gDisableStructs[gBattlerAttacker].disabledMove = gChosenMove; + gDisableStructs[gBattlerAttacker].disableTimer = 4; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, gChosenMove); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_CursedBodyActivates; + effect++; + } + break; + case ABILITY_LINGERING_AROMA: + case ABILITY_MUMMY: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && IsBattlerAlive(gBattlerAttacker) + && TARGET_TURN_DAMAGED + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + && gBattleStruct->overwrittenAbilities[gBattlerAttacker] != GetBattlerAbility(gBattlerTarget) + && gBattleMons[gBattlerTarget].ability != ABILITY_MUMMY + && gBattleMons[gBattlerTarget].ability != ABILITY_LINGERING_AROMA + && !gAbilitiesInfo[gBattleMons[gBattlerTarget].ability].cantBeSuppressed) + { + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) { - SET_BATTLER_TYPE(battler, moveType); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ColorChangeActivates; - effect++; + RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_ABILITY_SHIELD); + break; } + + gLastUsedAbility = gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MummyActivates; + effect++; break; - case ABILITY_ROUGH_SKIN: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gBattleMons[gBattlerAttacker].hp != 0 - && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && TARGET_TURN_DAMAGED - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) + } + break; + case ABILITY_WANDERING_SPIRIT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && IsBattlerAlive(gBattlerAttacker) + && TARGET_TURN_DAMAGED + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + /* && !IsDynamaxed(gBattlerTarget) */ // TODO: Dynamax + && !gAbilitiesInfo[gBattleMons[gBattlerAttacker].ability].cantBeSwapped) + { + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) { - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; + RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_ABILITY_SHIELD); + break; + } + + gLastUsedAbility = gBattleMons[gBattlerAttacker].ability; + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gLastUsedAbility; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_WanderingSpiritActivates; + effect++; + break; + } + break; + case ABILITY_ANGER_POINT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gIsCriticalHit + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + SET_STATCHANGER(STAT_ATK, (MAX_STAT_STAGE - gBattleMons[battler].statStages[STAT_ATK]), FALSE); // TODO: check if (MAX_STAT_STAGE - gBattleMons[battler].statStages[STAT_ATK]) should be in brackets + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetsStatWasMaxedOut; + effect++; + } + break; + case ABILITY_COLOR_CHANGE: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && move != MOVE_STRUGGLE + && gMovesInfo[move].power != 0 + && TARGET_TURN_DAMAGED + && !IS_BATTLER_OF_TYPE(battler, moveType) + && gBattleMons[battler].hp != 0) + { + SET_BATTLER_TYPE(battler, moveType); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ColorChangeActivates; + effect++; + } + break; + case ABILITY_GOOEY: + case ABILITY_TANGLING_HAIR: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && (CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) || GetBattlerAbility(gBattlerAttacker) == ABILITY_MIRROR_ARMOR) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker)) + { + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_GooeyActivates; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + break; + case ABILITY_ROUGH_SKIN: + case ABILITY_IRON_BARBS: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker)) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / (B_ROUGH_SKIN_DMG >= GEN_4 ? 8 : 16); + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / (B_ROUGH_SKIN_DMG >= GEN_4 ? 8 : 16); + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_RoughSkinActivates; + effect++; + } + break; + case ABILITY_AFTERMATH: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].hp == 0 + && IsBattlerAlive(gBattlerAttacker) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker)) + { + u32 battler; + if ((battler = IsAbilityOnField(ABILITY_DAMP))) + { + gBattleScripting.battler = battler - 1; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_DampPreventsAftermath; + } + else + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_RoughSkinActivates; - effect++; + gBattlescriptCurrInstr = BattleScript_AftermathDmg; } - break; - case ABILITY_EFFECT_SPORE: + effect++; + } + break; + case ABILITY_INNARDS_OUT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].hp == 0 + && IsBattlerAlive(gBattlerAttacker)) + { + gBattleMoveDamage = gSpecialStatuses[gBattlerTarget].shellBellDmg; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AftermathDmg; + effect++; + } + break; + case ABILITY_EFFECT_SPORE: + if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GRASS) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_OVERCOAT + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) + { + i = Random() % 3; + if (i == 0) + goto POISON_POINT; + if (i == 1) + goto STATIC; + // Sleep if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerAttacker].hp != 0 && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) - && (Random() % 10) == 0) + && CanSleep(gBattlerAttacker) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + && (Random() % 3) == 0) { - do + gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_SLEEP; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + } + break; + POISON_POINT: + case ABILITY_POISON_POINT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && CanBePoisoned(gBattlerTarget, gBattlerAttacker) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + && RandomWeighted(RNG_POISON_POINT, 2, 1)) + { + gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + break; + STATIC: + case ABILITY_STATIC: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && CanBeParalyzed(gBattlerAttacker) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + && RandomWeighted(RNG_STATIC, 2, 1)) + { + gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + break; + case ABILITY_FLAME_BODY: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && (IsMoveMakingContact(move, gBattlerAttacker)) + && TARGET_TURN_DAMAGED + && CanBeBurned(gBattlerAttacker) + && RandomWeighted(RNG_FLAME_BODY, 2, 1)) + { + gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + break; + case ABILITY_CUTE_CHARM: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && gBattleMons[gBattlerTarget].hp != 0 + && RandomWeighted(RNG_CUTE_CHARM, 2, 1) + && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) + && AreBattlersOfOppositeGender(gBattlerAttacker, gBattlerTarget) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_OBLIVIOUS + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + && !IsAbilityOnSide(gBattlerAttacker, ABILITY_AROMA_VEIL)) + { + gBattleMons[gBattlerAttacker].status2 |= STATUS2_INFATUATED_WITH(gBattlerTarget); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_CuteCharmActivates; + effect++; + } + break; + case ABILITY_ILLUSION: + if (gBattleStruct->illusion[gBattlerTarget].on && !gBattleStruct->illusion[gBattlerTarget].broken && TARGET_TURN_DAMAGED) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_IllusionOff; + effect++; + } + break; + case ABILITY_COTTON_DOWN: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerAttacker].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED) + { + gEffectBattler = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_CottonDownActivates; + effect++; + } + break; + case ABILITY_STEAM_ENGINE: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) + && (moveType == TYPE_FIRE || moveType == TYPE_WATER)) + { + gEffectBattler = battler; + SET_STATCHANGER(STAT_SPEED, 6, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; + } + break; + case ABILITY_SAND_SPIT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && !(gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT)) + { + if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; + effect++; + } + else if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)) + { + gBattleScripting.battler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SandSpitActivates; + effect++; + } + } + break; + case ABILITY_PERISH_BODY: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && (IsMoveMakingContact(move, gBattlerAttacker)) + && !(gStatuses3[gBattlerAttacker] & STATUS3_PERISH_SONG)) + { + if (!(gStatuses3[battler] & STATUS3_PERISH_SONG)) + { + gStatuses3[battler] |= STATUS3_PERISH_SONG; + gDisableStructs[battler].perishSongTimer = 3; + } + gStatuses3[gBattlerAttacker] |= STATUS3_PERISH_SONG; + gDisableStructs[gBattlerAttacker].perishSongTimer = 3; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PerishBodyActivates; + effect++; + } + break; + case ABILITY_GULP_MISSILE: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && IsBattlerAlive(battler)) + { + // TODO: Convert this to a proper FORM_CHANGE type. + if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING) + { + gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT; + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { - gBattleCommunication[MOVE_EFFECT_BYTE] = Random() & 3; - } while (gBattleCommunication[MOVE_EFFECT_BYTE] == 0); + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + } + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_GulpMissileGorging; + effect++; + } + else if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GULPING) + { + gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT; + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + } + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_GulpMissileGulping; + effect++; + } + } + break; + case ABILITY_SEED_SOWER: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && IsBattlerAlive(gBattlerTarget) + && TryChangeBattleTerrain(gBattlerTarget, STATUS_FIELD_GRASSY_TERRAIN, &gFieldTimers.terrainTimer)) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SeedSowerActivates; + effect++; + } + break; + case ABILITY_THERMAL_EXCHANGE: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(gBattlerTarget) + && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN) + && moveType == TYPE_FIRE) + { + gEffectBattler = gBattlerTarget; + SET_STATCHANGER(STAT_ATK, 1, FALSE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; + effect++; + } + break; + case ABILITY_ANGER_SHELL: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && (gMultiHitCounter == 0 || gMultiHitCounter == 1) // Activates after all hits from a multi-hit move. + && IsBattlerAlive(gBattlerTarget) + && HadMoreThanHalfHpNowHasLess(gBattlerTarget) + && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))) + { + gBattlerAttacker = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AngerShellActivates; + effect++; + } + break; + case ABILITY_WIND_POWER: + if (!(gMovesInfo[gCurrentMove].windMove)) + break; + // fall through + case ABILITY_ELECTROMORPHOSIS: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && IsBattlerAlive(gBattlerTarget)) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_WindPowerActivates; + effect++; + } + break; + case ABILITY_TOXIC_DEBRIS: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && (!gBattleStruct->isSkyBattle) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && IS_MOVE_PHYSICAL(gCurrentMove) + && TARGET_TURN_DAMAGED + && (gSideTimers[gBattlerAttacker].toxicSpikesAmount != 2)) + { + SWAP(gBattlerAttacker, gBattlerTarget, i); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ToxicDebrisActivates; + effect++; + } + break; + } + break; + case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker + switch (gLastUsedAbility) + { + case ABILITY_POISON_TOUCH: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && CanBePoisoned(gBattlerAttacker, gBattlerTarget) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(move, gBattlerAttacker) + && TARGET_TURN_DAMAGED // Need to actually hit the target + && (Random() % 3) == 0) + { + gBattleScripting.moveEffect = MOVE_EFFECT_POISON; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + break; + case ABILITY_STENCH: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && RandomWeighted(RNG_STENCH, 9, 1) + && TARGET_TURN_DAMAGED + && !MoveHasAdditionalEffect(gCurrentMove, MOVE_EFFECT_FLINCH)) + { + gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; + BattleScriptPushCursor(); + SetMoveEffect(FALSE, FALSE); + BattleScriptPop(); + effect++; + } + break; + case ABILITY_GULP_MISSILE: + if ((gBattleMons[gBattlerAttacker].species == SPECIES_CRAMORANT) + && ((gCurrentMove == MOVE_SURF && TARGET_TURN_DAMAGED) || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER) + && TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_HP_PERCENT)) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AttackerFormChange; + effect++; + } + break; + } + break; + case ABILITYEFFECT_MOVE_END_OTHER: // Abilities that activate on *another* battler's moveend: Dancer, Soul-Heart, Receiver, Symbiosis + switch (GetBattlerAbility(battler)) + { + case ABILITY_DANCER: + if (IsBattlerAlive(battler) + && (gMovesInfo[gCurrentMove].danceMove) + && !gSpecialStatuses[battler].dancerUsedMove + && gBattlerAttacker != battler) + { + // Set bit and save Dancer mon's original target + gSpecialStatuses[battler].dancerUsedMove = TRUE; + gSpecialStatuses[battler].dancerOriginalTarget = *(gBattleStruct->moveTarget + battler) | 0x4; + gBattleStruct->atkCancellerTracker = 0; + gBattlerAttacker = gBattlerAbility = battler; + gCalledMove = gCurrentMove; - if (gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_BURN) - gBattleCommunication[MOVE_EFFECT_BYTE] += 2; // 5 MOVE_EFFECT_PARALYSIS + // Set the target to the original target of the mon that first used a Dance move + gBattlerTarget = gBattleScripting.savedBattler & 0x3; - gBattleCommunication[MOVE_EFFECT_BYTE] += MOVE_EFFECT_AFFECTS_USER; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; - gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; - effect++; - } - break; - case ABILITY_POISON_POINT: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gBattleMons[gBattlerAttacker].hp != 0 - && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && TARGET_TURN_DAMAGED - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) - && (Random() % 3) == 0) + // Edge case for dance moves that hit multiply targets + gHitMarker &= ~HITMARKER_NO_ATTACKSTRING; + + // Make sure that the target isn't an ally - if it is, target the original user + if (GetBattlerSide(gBattlerTarget) == GetBattlerSide(gBattlerAttacker)) + gBattlerTarget = (gBattleScripting.savedBattler & 0xF0) >> 4; + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + BattleScriptExecute(BattleScript_DancerActivates); + effect++; + } + break; + } + break; + case ABILITYEFFECT_OPPORTUNIST: + /* Similar to ABILITYEFFECT_IMMUNITY in that it loops through all battlers. + * Is called after ABILITYEFFECT_ON_SWITCHIN to copy any boosts + * from switch in abilities e.g. intrepid sword, as + */ + for (battler = 0; battler < gBattlersCount; battler++) + { + switch (GetBattlerAbility(battler)) + { + case ABILITY_OPPORTUNIST: + if (gProtectStructs[battler].activateOpportunist == 2) { - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; - gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; - effect++; - } - break; - case ABILITY_STATIC: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gBattleMons[gBattlerAttacker].hp != 0 - && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && TARGET_TURN_DAMAGED - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) - && (Random() % 3) == 0) - { - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; - gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; - effect++; - } - break; - case ABILITY_FLAME_BODY: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gBattleMons[gBattlerAttacker].hp != 0 - && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) - && TARGET_TURN_DAMAGED - && (Random() % 3) == 0) - { - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; - gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; - effect++; - } - break; - case ABILITY_CUTE_CHARM: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gBattleMons[gBattlerAttacker].hp != 0 - && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) - && TARGET_TURN_DAMAGED - && gBattleMons[gBattlerTarget].hp != 0 - && (Random() % 3) == 0 - && gBattleMons[gBattlerAttacker].ability != ABILITY_OBLIVIOUS - && GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) - && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) - && GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != MON_GENDERLESS - && GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) != MON_GENDERLESS) - { - gBattleMons[gBattlerAttacker].status2 |= STATUS2_INFATUATED_WITH(gBattlerTarget); - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_CuteCharmActivates; - effect++; + gBattleScripting.savedBattler = gBattlerAttacker; + gBattleScripting.battler = gBattlerAttacker = gBattlerAbility = battler; + gProtectStructs[battler].activateOpportunist--; + BattleScriptPushCursorAndCallback(BattleScript_OpportunistCopyStatChange); + effect = 1; } break; } - break; - case ABILITYEFFECT_IMMUNITY: // 5 - for (battler = 0; battler < gBattlersCount; battler++) + } + break; + case ABILITYEFFECT_IMMUNITY: // 5 + for (battler = 0; battler < gBattlersCount; battler++) + { + switch (GetBattlerAbility(battler)) { - switch (gBattleMons[battler].ability) + case ABILITY_IMMUNITY: + case ABILITY_PASTEL_VEIL: + if (gBattleMons[battler].status1 & (STATUS1_POISON | STATUS1_TOXIC_POISON | STATUS1_TOXIC_COUNTER)) { - case ABILITY_IMMUNITY: - if (gBattleMons[battler].status1 & (STATUS1_POISON | STATUS1_TOXIC_POISON | STATUS1_TOXIC_COUNTER)) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); - effect = 1; - } - break; - case ABILITY_OWN_TEMPO: - if (gBattleMons[battler].status2 & STATUS2_CONFUSION) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); - effect = 2; - } - break; - case ABILITY_LIMBER: - if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); - effect = 1; - } - break; - case ABILITY_INSOMNIA: - case ABILITY_VITAL_SPIRIT: - if (gBattleMons[battler].status1 & STATUS1_SLEEP) - { - gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; - StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); - effect = 1; - } - break; - case ABILITY_WATER_VEIL: - if (gBattleMons[battler].status1 & STATUS1_BURN) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); - effect = 1; - } - break; - case ABILITY_MAGMA_ARMOR: - if (gBattleMons[battler].status1 & STATUS1_FREEZE) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); - effect = 1; - } - break; - case ABILITY_OBLIVIOUS: - if (gBattleMons[battler].status2 & STATUS2_INFATUATION) - { - StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); - effect = 3; - } - break; + StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); + effect = 1; } - if (effect != 0) + break; + case ABILITY_OWN_TEMPO: + if (gBattleMons[battler].status2 & STATUS2_CONFUSION) { - switch (effect) - { - case 1: // status cleared - gBattleMons[battler].status1 = 0; - break; - case 2: // get rid of confusion - gBattleMons[battler].status2 &= ~STATUS2_CONFUSION; - break; - case 3: // get rid of infatuation - gBattleMons[battler].status2 &= ~STATUS2_INFATUATION; - break; - } + StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); + effect = 2; + } + break; + case ABILITY_LIMBER: + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); + effect = 1; + } + break; + case ABILITY_INSOMNIA: + case ABILITY_VITAL_SPIRIT: + if (gBattleMons[battler].status1 & STATUS1_SLEEP) + { + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + effect = 1; + } + break; + case ABILITY_WATER_VEIL: + case ABILITY_WATER_BUBBLE: + if (gBattleMons[battler].status1 & STATUS1_BURN) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); + effect = 1; + } + break; + case ABILITY_MAGMA_ARMOR: + if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); + effect = 1; + } + break; + case ABILITY_OBLIVIOUS: + if (gBattleMons[battler].status2 & STATUS2_INFATUATION) + effect = 3; + else if (gDisableStructs[battler].tauntTimer != 0) + effect = 4; + break; + } + if (effect != 0) + { + switch (effect) + { + case 1: // status cleared + gBattleMons[battler].status1 = 0; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; - gBattleScripting.battler = battler; - gActiveBattler = battler; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); - return effect; - } - } - break; - case ABILITYEFFECT_FORECAST: // 6 - for (battler = 0; battler < gBattlersCount; battler++) - { - if (gBattleMons[battler].ability == ABILITY_FORECAST) - { - effect = CastformDataTypeChange(battler); - if (effect != 0) - { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); - gBattleScripting.battler = battler; - *(&gBattleStruct->formToChangeInto) = effect - 1; - return effect; - } - } - } - break; - case ABILITYEFFECT_SYNCHRONIZE: // 7 - if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT)) - { - gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; - gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); - if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) - gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; - - gBattleCommunication[MOVE_EFFECT_BYTE] = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER; - gBattleScripting.battler = gBattlerTarget; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; - gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; - effect++; - } - break; - case ABILITYEFFECT_ATK_SYNCHRONIZE: // 8 - if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT)) - { - gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; - gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); - if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) - gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; - - gBattleCommunication[MOVE_EFFECT_BYTE] = gBattleStruct->synchronizeMoveEffect; - gBattleScripting.battler = gBattlerAttacker; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; - gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; - effect++; - } - break; - case ABILITYEFFECT_INTIMIDATE1: // 9 - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ABILITY_INTIMIDATE && gStatuses3[i] & STATUS3_INTIMIDATE_POKES) - { - gLastUsedAbility = ABILITY_INTIMIDATE; - gStatuses3[i] &= ~STATUS3_INTIMIDATE_POKES; - BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivatesEnd3); - gBattleStruct->intimidateBattler = i; - effect++; break; - } - } - break; - case ABILITYEFFECT_TRACE: // 11 - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE)) - { - u8 target2; - side = (GetBattlerPosition(i) ^ BIT_SIDE) & BIT_SIDE; // side of the opposing pokemon - target1 = GetBattlerAtPosition(side); - target2 = GetBattlerAtPosition(side + BIT_FLANK); - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - { - if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0 - && gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0) - { - gActiveBattler = GetBattlerAtPosition(((Random() & 1) * 2) | side); - gBattleMons[i].ability = gBattleMons[gActiveBattler].ability; - gLastUsedAbility = gBattleMons[gActiveBattler].ability; - effect++; - } - else if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0) - { - gActiveBattler = target1; - gBattleMons[i].ability = gBattleMons[gActiveBattler].ability; - gLastUsedAbility = gBattleMons[gActiveBattler].ability; - effect++; - } - else if (gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0) - { - gActiveBattler = target2; - gBattleMons[i].ability = gBattleMons[gActiveBattler].ability; - gLastUsedAbility = gBattleMons[gActiveBattler].ability; - effect++; - } - } - else - { - gActiveBattler = target1; - if (gBattleMons[target1].ability && gBattleMons[target1].hp) - { - gBattleMons[i].ability = gBattleMons[target1].ability; - gLastUsedAbility = gBattleMons[target1].ability; - effect++; - } - } - if (effect != 0) - { - BattleScriptPushCursorAndCallback(BattleScript_TraceActivates); - gStatuses3[i] &= ~STATUS3_TRACE; - gBattleScripting.battler = i; - - PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gActiveBattler, gBattlerPartyIndexes[gActiveBattler]) - PREPARE_ABILITY_BUFFER(gBattleTextBuff2, gLastUsedAbility) - break; - } - } - } - break; - case ABILITYEFFECT_INTIMIDATE2: // 10 - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ABILITY_INTIMIDATE && (gStatuses3[i] & STATUS3_INTIMIDATE_POKES)) - { - gLastUsedAbility = ABILITY_INTIMIDATE; - gStatuses3[i] &= ~STATUS3_INTIMIDATE_POKES; + case 2: // get rid of confusion + RemoveConfusionStatus(battler); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_IntimidateActivates; - gBattleStruct->intimidateBattler = i; - effect++; + gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; + break; + case 3: // get rid of infatuation + gBattleMons[battler].status2 &= ~STATUS2_INFATUATION; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BattlerGotOverItsInfatuation; + break; + case 4: // get rid of taunt + gDisableStructs[battler].tauntTimer = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BattlerShookOffTaunt; + break; + } + + gBattleScripting.battler = gActiveBattler = gBattlerAbility = battler; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + return effect; + } + } + break; + case ABILITYEFFECT_SYNCHRONIZE: + if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT)) + { + gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; + + if (!(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY)) + { + gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + if (B_SYNCHRONIZE_TOXIC < GEN_5 && gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) + gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; + + gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER; + gBattleScripting.battler = gBattlerAbility = gBattlerTarget; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, ABILITY_SYNCHRONIZE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + } + break; + case ABILITYEFFECT_ATK_SYNCHRONIZE: // 8 + if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT)) + { + gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; + + if (!(gBattleMons[gBattlerTarget].status1 & STATUS1_ANY)) + { + gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) + gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; + + gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect; + gBattleScripting.battler = gBattlerAbility = gBattlerAttacker; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, ABILITY_SYNCHRONIZE); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; + gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT; + effect++; + } + } + break; + case ABILITYEFFECT_TRACE1: + case ABILITYEFFECT_TRACE2: + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleMons[i].ability == ABILITY_TRACE && (gBattleResources->flags->flags[i] & RESOURCE_FLAG_TRACED)) + { + u32 chosenTarget; + u32 side = (BATTLE_OPPOSITE(GetBattlerPosition(i))) & BIT_SIDE; // side of the opposing Pokémon + u32 target1 = GetBattlerAtPosition(side); + u32 target2 = GetBattlerAtPosition(side + BIT_FLANK); + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + if (!gAbilitiesInfo[gBattleMons[target1].ability].cantBeTraced && gBattleMons[target1].hp != 0 + && !gAbilitiesInfo[gBattleMons[target2].ability].cantBeTraced && gBattleMons[target2].hp != 0) + chosenTarget = GetBattlerAtPosition((RandomPercentage(RNG_TRACE, 50) * 2) | side), effect++; + else if (!gAbilitiesInfo[gBattleMons[target1].ability].cantBeTraced && gBattleMons[target1].hp != 0) + chosenTarget = target1, effect++; + else if (!gAbilitiesInfo[gBattleMons[target2].ability].cantBeTraced && gBattleMons[target2].hp != 0) + chosenTarget = target2, effect++; + } + else + { + if (!gAbilitiesInfo[gBattleMons[target1].ability].cantBeTraced && gBattleMons[target1].hp != 0) + chosenTarget = target1, effect++; + } + + if (effect != 0) + { + BattleScriptPushCursorAndCallback(BattleScript_TraceActivatesEnd3); + gBattleResources->flags->flags[i] &= ~RESOURCE_FLAG_TRACED; + gBattleStruct->tracedAbility[i] = gLastUsedAbility = gBattleMons[chosenTarget].ability; + RecordAbilityBattle(chosenTarget, gLastUsedAbility); // Record the opposing battler has this ability + battler = gBattlerAbility = gBattleScripting.battler = i; + + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, chosenTarget, gBattlerPartyIndexes[chosenTarget]) + PREPARE_ABILITY_BUFFER(gBattleTextBuff2, gLastUsedAbility) break; } } - break; - case ABILITYEFFECT_CHECK_OTHER_SIDE: // 12 - side = GetBattlerSide(battler); - for (i = 0; i < gBattlersCount; i++) + } + break; + case ABILITYEFFECT_NEUTRALIZINGGAS: + // Prints message only. separate from ABILITYEFFECT_ON_SWITCHIN bc activates before entry hazards + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleMons[i].ability == ABILITY_NEUTRALIZING_GAS && !(gBattleResources->flags->flags[i] & RESOURCE_FLAG_NEUTRALIZING_GAS)) { - if (GetBattlerSide(i) != side && gBattleMons[i].ability == ability) - { - gLastUsedAbility = ability; - effect = i + 1; - } + gBattleResources->flags->flags[i] |= RESOURCE_FLAG_NEUTRALIZING_GAS; + gBattlerAbility = i; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_NEUTRALIZING_GAS; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; } - break; - case ABILITYEFFECT_CHECK_BATTLER_SIDE: // 13 - side = GetBattlerSide(battler); - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerSide(i) == side && gBattleMons[i].ability == ability) - { - gLastUsedAbility = ability; - effect = i + 1; - } - } - break; - case ABILITYEFFECT_FIELD_SPORT: // 14 - switch (gLastUsedAbility) - { - case ABILITYEFFECT_MUD_SPORT: - for (i = 0; i < gBattlersCount; i++) - { - if (gStatuses4[i] & STATUS4_MUD_SPORT) - effect = i + 1; - } + + if (effect != 0) break; - case ABILITYEFFECT_WATER_SPORT: - for (i = 0; i < gBattlersCount; i++) - { - if (gStatuses4[i] & STATUS4_WATER_SPORT) - effect = i + 1; - } - break; - default: - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ability) - { - gLastUsedAbility = ability; - effect = i + 1; - } - } - break; - } - break; - case ABILITYEFFECT_CHECK_ON_FIELD: // 19 + } + break; + case ABILITYEFFECT_FIELD_SPORT: + switch (gLastUsedAbility) + { + case ABILITYEFFECT_MUD_SPORT: for (i = 0; i < gBattlersCount; i++) { - if (gBattleMons[i].ability == ability && gBattleMons[i].hp != 0) + if (gStatuses4[i] & STATUS4_MUD_SPORT) + effect = i + 1; + } + break; + case ABILITYEFFECT_WATER_SPORT: + for (i = 0; i < gBattlersCount; i++) + { + if (gStatuses4[i] & STATUS4_WATER_SPORT) + effect = i + 1; + } + break; + default: + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleMons[i].ability == ability) { gLastUsedAbility = ability; effect = i + 1; } } break; - case ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER: // 15 - side = GetBattlerSide(battler); - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerSide(i) != side && gBattleMons[i].ability == ability) - { - gLastUsedAbility = ability; - effect = i + 1; - break; - } - } - if (effect == 0) - { - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ability && GetBattlerSide(i) == side && i != battler) - { - gLastUsedAbility = ability; - effect = i + 1; - } - } - } - break; - case ABILITYEFFECT_COUNT_OTHER_SIDE: // 16 - side = GetBattlerSide(battler); - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerSide(i) != side && gBattleMons[i].ability == ability) - { - gLastUsedAbility = ability; - effect++; - } - } - break; - case ABILITYEFFECT_COUNT_BATTLER_SIDE: // 17 - side = GetBattlerSide(battler); - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerSide(i) == side && gBattleMons[i].ability == ability) - { - gLastUsedAbility = ability; - effect++; - } - } - break; - case ABILITYEFFECT_COUNT_ON_FIELD: // 18 - for (i = 0; i < gBattlersCount; i++) - { - if (gBattleMons[i].ability == ability && i != battler) - { - gLastUsedAbility = ability; - effect++; - } - } - break; } - - if (effect && caseID < ABILITYEFFECT_CHECK_OTHER_SIDE && gLastUsedAbility != 0xFF) - RecordAbilityBattle(battler, gLastUsedAbility); + break; + case ABILITYEFFECT_ON_WEATHER: // For ability effects that activate when the battle weather changes. + battler = gBattlerAbility = gBattleScripting.battler; + gLastUsedAbility = GetBattlerAbility(battler); + switch (gLastUsedAbility) + { + case ABILITY_FORECAST: + case ABILITY_FLOWER_GIFT: + if ((IsBattlerWeatherAffected(battler, gBattleWeather) + || gBattleWeather == B_WEATHER_NONE + || !WEATHER_HAS_EFFECT) // Air Lock active + && TryBattleFormChange(battler, FORM_CHANGE_BATTLE_WEATHER)) + { + BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3); + effect++; + } + break; + case ABILITY_ICE_FACE: + if (IsBattlerWeatherAffected(battler, B_WEATHER_HAIL | B_WEATHER_SNOW) + && gBattleMons[battler].species == SPECIES_EISCUE_NOICE_FACE + && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) + && gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]) + { + // TODO: Convert this to a proper FORM_CHANGE type. + gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = FALSE; + gBattleMons[battler].species = SPECIES_EISCUE_ICE_FACE; + BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3); + effect++; + } + break; + case ABILITY_PROTOSYNTHESIS: + if (!gDisableStructs[battler].weatherAbilityDone && IsBattlerWeatherAffected(battler, B_WEATHER_SUN)) + { + gDisableStructs[battler].weatherAbilityDone = TRUE; + PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler)); + gBattlerAbility = gBattleScripting.battler = battler; + BattleScriptPushCursorAndCallback(BattleScript_ProtosynthesisActivates); + effect++; + } + break; + } + break; + case ABILITYEFFECT_ON_TERRAIN: // For ability effects that activate when the field terrain changes. + gLastUsedAbility = GetBattlerAbility(battler); + switch (gLastUsedAbility) + { + case ABILITY_MIMICRY: + if (!gDisableStructs[battler].terrainAbilityDone && ChangeTypeBasedOnTerrain(battler)) + { + gDisableStructs[battler].terrainAbilityDone = TRUE; + ChangeTypeBasedOnTerrain(battler); + gBattlerAbility = gBattleScripting.battler = battler; + BattleScriptPushCursorAndCallback(BattleScript_MimicryActivates_End3); + effect++; + } + break; + case ABILITY_QUARK_DRIVE: + if (!gDisableStructs[battler].terrainAbilityDone && IsBattlerTerrainAffected(battler, STATUS_FIELD_ELECTRIC_TERRAIN)) + { + gDisableStructs[battler].terrainAbilityDone = TRUE; + PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler)); + gBattlerAbility = gBattleScripting.battler = battler; + BattleScriptPushCursorAndCallback(BattleScript_QuarkDriveActivates); + effect++; + } + break; + } + break; } + if (effect && gLastUsedAbility != 0xFFFF) + RecordAbilityBattle(battler, gLastUsedAbility); + if (effect && caseID <= ABILITYEFFECT_MOVE_END) + gBattlerAbility = battler; + return effect; } @@ -2481,327 +4275,820 @@ enum effect = ITEM_STATS_CHANGE; \ } -u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) +// second argument is 1/X of current hp compared to max hp +bool32 HasEnoughHpToEatBerry(u32 battler, u32 hpFraction, u32 itemId) { - int i = 0; - u8 effect = ITEM_NO_EFFECT; - u8 changedPP = 0; - u8 battlerHoldEffect, atkHoldEffect, defHoldEffect; - u8 battlerHoldEffectParam, atkHoldEffectParam, defHoldEffectParam; - u16 atkItem, defItem; + bool32 isBerry = (ItemId_GetPocket(itemId) == POCKET_BERRY_POUCH); - gLastUsedItem = gBattleMons[battlerId].item; - if (gLastUsedItem == ITEM_ENIGMA_BERRY) + if (gBattleMons[battler].hp == 0) + return FALSE; + if (gBattleScripting.overrideBerryRequirements) + return TRUE; + // Unnerve prevents consumption of opponents' berries. + if (isBerry && IsUnnerveAbilityOnOpposingSide(battler)) + return FALSE; + if (gBattleMons[battler].hp <= gBattleMons[battler].maxHP / hpFraction) + return TRUE; + + if (hpFraction <= 4 && GetBattlerAbility(battler) == ABILITY_GLUTTONY && isBerry + && gBattleMons[battler].hp <= gBattleMons[battler].maxHP / 2) { - battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect; - battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam; + RecordAbilityBattle(battler, ABILITY_GLUTTONY); + return TRUE; } - else + + return FALSE; +} + +static u8 HealConfuseBerry(u32 battler, u32 itemId, u32 flavorId, bool32 end2) +{ + if (HasEnoughHpToEatBerry(battler, (B_CONFUSE_BERRIES_HEAL >= GEN_7 ? 4 : 2), itemId) + && (B_HEAL_BLOCKING < GEN_5 || !(gStatuses3[battler] & STATUS3_HEAL_BLOCK))) { - battlerHoldEffect = ItemId_GetHoldEffect(gLastUsedItem); - battlerHoldEffectParam = ItemId_GetHoldEffectParam(gLastUsedItem); + PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId); + + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / GetBattlerItemHoldEffectParam(battler, itemId); + gBattleMoveDamage = gBattleMons[battler].maxHP / GetBattlerItemHoldEffectParam(battler, itemId); + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + { + gBattleMoveDamage *= 2; + gBattlerAbility = battler; + } + gBattleScripting.battler = battler; + if (end2) + { + if (GetFlavorRelationByPersonality(gBattleMons[battler].personality, flavorId) < 0) + BattleScriptExecute(BattleScript_BerryConfuseHealEnd2); + else + BattleScriptExecute(BattleScript_ItemHealHP_RemoveItemEnd2); + } + else + { + BattleScriptPushCursor(); + if (GetFlavorRelationByPersonality(gBattleMons[battler].personality, flavorId) < 0) + gBattlescriptCurrInstr = BattleScript_BerryConfuseHealRet; + else + gBattlescriptCurrInstr = BattleScript_ItemHealHP_RemoveItemRet; + } + + return ITEM_HP_CHANGE; + } + return 0; +} + +static u8 StatRaiseBerry(u32 battler, u32 itemId, u32 statId, bool32 end2) +{ + if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN) && HasEnoughHpToEatBerry(battler, GetBattlerItemHoldEffectParam(battler, itemId), itemId)) + { + BufferStatChange(battler, statId, STRINGID_STATROSE); + gEffectBattler = battler; + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + SET_STATCHANGER(statId, 2, FALSE); + else + SET_STATCHANGER(statId, 1, FALSE); + + gBattleScripting.animArg1 = 14 + statId; + gBattleScripting.animArg2 = 0; + + if (end2) + { + BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryStatRaiseRet; + } + return ITEM_STATS_CHANGE; + } + return 0; +} + +static u8 RandomStatRaiseBerry(u32 battler, u32 itemId, bool32 end2) +{ + s32 i; + u16 stringId; + + for (i = 0; i < NUM_STATS - 1; i++) + { + if (CompareStat(battler, STAT_ATK + i, MAX_STAT_STAGE, CMP_LESS_THAN)) + break; + } + if (i != NUM_STATS - 1 && HasEnoughHpToEatBerry(battler, GetBattlerItemHoldEffectParam(battler, itemId), itemId)) + { + u16 battlerAbility = GetBattlerAbility(battler); + do + { + i = Random() % (NUM_STATS - 1); + } while (!CompareStat(battler, STAT_ATK + i, MAX_STAT_STAGE, CMP_LESS_THAN)); + + PREPARE_STAT_BUFFER(gBattleTextBuff1, i + 1); + stringId = (battlerAbility == ABILITY_CONTRARY) ? STRINGID_STATFELL : STRINGID_STATROSE; + gBattleTextBuff2[0] = B_BUFF_PLACEHOLDER_BEGIN; + gBattleTextBuff2[1] = B_BUFF_STRING; + gBattleTextBuff2[2] = STRINGID_STATSHARPLY; + gBattleTextBuff2[3] = STRINGID_STATSHARPLY >> 8; + gBattleTextBuff2[4] = B_BUFF_STRING; + gBattleTextBuff2[5] = stringId; + gBattleTextBuff2[6] = stringId >> 8; + gBattleTextBuff2[7] = EOS; + gEffectBattler = battler; + if (battlerAbility == ABILITY_RIPEN) + SET_STATCHANGER(i + 1, 4, FALSE); + else + SET_STATCHANGER(i + 1, 2, FALSE); + + gBattleScripting.animArg1 = 0x21 + i + 6; + gBattleScripting.animArg2 = 0; + if (end2) + { + BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryStatRaiseRet; + } + + return ITEM_STATS_CHANGE; + } + return 0; +} + +static u8 TrySetMicleBerry(u32 battler, u32 itemId, bool32 end2) +{ + if (HasEnoughHpToEatBerry(battler, 4, itemId)) + { + gProtectStructs[battler].usedMicleBerry = TRUE; // battler's next attack has increased accuracy + + if (end2) + { + BattleScriptExecute(BattleScript_MicleBerryActivateEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MicleBerryActivateRet; + } + return ITEM_EFFECT_OTHER; + } + return 0; +} + +static u8 TrySetEnigmaBerry(u32 battler) +{ + if (IsBattlerAlive(battler) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && ((TARGET_TURN_DAMAGED && gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) || gBattleScripting.overrideBerryRequirements) + && !(gBattleScripting.overrideBerryRequirements && gBattleMons[battler].hp == gBattleMons[battler].maxHP) + && (B_HEAL_BLOCKING < GEN_5 || !(gStatuses3[battler] & STATUS3_HEAL_BLOCK))) + { + gBattleScripting.battler = battler; + gBattleMoveDamage = (gBattleMons[battler].maxHP * 25 / 100) * -1; + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + gBattleMoveDamage *= 2; + + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ItemHealHP_RemoveItemRet; + return ITEM_HP_CHANGE; + } + return 0; +} + +static u8 DamagedStatBoostBerryEffect(u32 battler, u8 statId, u8 category) +{ + if (IsBattlerAlive(battler) + && CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN) + && (gBattleScripting.overrideBerryRequirements + || (!DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && GetBattleMoveCategory(gCurrentMove) == category + && battler != gBattlerAttacker + && TARGET_TURN_DAMAGED)) + ) + { + BufferStatChange(battler, statId, STRINGID_STATROSE); + + gEffectBattler = battler; + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + SET_STATCHANGER(statId, 2, FALSE); + else + SET_STATCHANGER(statId, 1, FALSE); + + gBattleScripting.battler = battler; + gBattleScripting.animArg1 = 14 + statId; + gBattleScripting.animArg2 = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryStatRaiseRet; + return ITEM_STATS_CHANGE; + } + return 0; +} + +static u32 ItemRestorePp(u32 battler, u32 itemId, bool32 execute) +{ + struct Pokemon *party = GetBattlerParty(battler); + struct Pokemon *mon = &party[gBattlerPartyIndexes[battler]]; + u32 i, changedPP = 0; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + u32 move = GetMonData(mon, MON_DATA_MOVE1 + i); + u32 currentPP = GetMonData(mon, MON_DATA_PP1 + i); + u32 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); + u32 maxPP = CalculatePPWithBonus(move, ppBonuses, i); + if (move && (currentPP == 0 || (gBattleScripting.overrideBerryRequirements && currentPP != maxPP))) + { + u32 ppRestored = GetBattlerItemHoldEffectParam(battler, itemId); + + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + { + ppRestored *= 2; + gBattlerAbility = battler; + } + if (currentPP + ppRestored > maxPP) + changedPP = maxPP; + else + changedPP = currentPP + ppRestored; + + PREPARE_MOVE_BUFFER(gBattleTextBuff1, move); + + if (execute) + { + BattleScriptExecute(BattleScript_BerryPPHealEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryPPHealRet; + } + gActiveBattler = battler; + BtlController_EmitSetMonData(BUFFER_A, i + REQUEST_PPMOVE1_BATTLE, 0, 1, &changedPP); + MarkBattlerForControllerExec(battler); + if (MOVE_IS_PERMANENT(battler, i)) + gBattleMons[battler].pp[i] = changedPP; + return ITEM_PP_CHANGE; + } + } + return 0; +} + +static u8 ItemHealHp(u32 battler, u32 itemId, bool32 end2, bool32 percentHeal) +{ + if (!(gBattleScripting.overrideBerryRequirements && gBattleMons[battler].hp == gBattleMons[battler].maxHP) + && (B_HEAL_BLOCKING < GEN_5 || !(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) + && HasEnoughHpToEatBerry(battler, 2, itemId)) + { + if (percentHeal) + { + // TODO: Dynamax + // gBattleMoveDamage = (GetNonDynamaxMaxHP(battler) * GetBattlerItemHoldEffectParam(battler, itemId) / 100) * -1; + gBattleMoveDamage = (gBattleMons[battler].maxHP * GetBattlerItemHoldEffectParam(battler, itemId) / 100) * -1; + } + else + { + gBattleMoveDamage = GetBattlerItemHoldEffectParam(battler, itemId) * -1; + } + + // check ripen + if (ItemId_GetPocket(itemId) == POCKET_BERRY_POUCH && GetBattlerAbility(battler) == ABILITY_RIPEN) + gBattleMoveDamage *= 2; + + gBattlerAbility = battler; // in SWSH, berry juice shows ability pop up but has no effect. This is mimicked here + if (end2) + { + BattleScriptExecute(BattleScript_ItemHealHP_RemoveItemEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ItemHealHP_RemoveItemRet; + } + if (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_EMERGENCY_EXIT + && gBattleMons[battler].hp >= gBattleMons[battler].maxHP / 2) /* GetNonDynamaxHP(battler) >= GetNonDynamaxMaxHP(battler) / 2) */ // TODO: Dynamax + gBattleResources->flags->flags[battler] &= ~RESOURCE_FLAG_EMERGENCY_EXIT; + + return ITEM_HP_CHANGE; + } + return 0; +} + +static bool32 UnnerveOn(u32 battler, u32 itemId) +{ + if (ItemId_GetPocket(itemId) == POCKET_BERRY_POUCH && IsUnnerveAbilityOnOpposingSide(battler)) + return TRUE; + return FALSE; +} + +static bool32 GetMentalHerbEffect(u32 battler) +{ + bool32 ret = FALSE; + + // Check infatuation + if (gBattleMons[battler].status2 & STATUS2_INFATUATION) + { + gBattleMons[battler].status2 &= ~STATUS2_INFATUATION; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_INFATUATION; // STRINGID_TARGETGOTOVERINFATUATION + StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); + ret = TRUE; + } + if (B_MENTAL_HERB >= GEN_5) + { + // Check taunt + if (gDisableStructs[battler].tauntTimer != 0) + { + gDisableStructs[battler].tauntTimer = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_TAUNT; + PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT); + ret = TRUE; + } + // Check encore + if (gDisableStructs[battler].encoreTimer != 0) + { + gDisableStructs[battler].encoredMove = 0; + gDisableStructs[battler].encoreTimer = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_ENCORE; // STRINGID_PKMNENCOREENDED + ret = TRUE; + } + // Check torment + if (gBattleMons[battler].status2 & STATUS2_TORMENT) + { + gBattleMons[battler].status2 &= ~STATUS2_TORMENT; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_TORMENT; + ret = TRUE; + } + // Check heal block + if (gStatuses3[battler] & STATUS3_HEAL_BLOCK) + { + gStatuses3[battler] &= ~STATUS3_HEAL_BLOCK; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_HEALBLOCK; + ret = TRUE; + } + // Check disable + if (gDisableStructs[battler].disableTimer != 0) + { + gDisableStructs[battler].disableTimer = 0; + gDisableStructs[battler].disabledMove = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_DISABLE; + ret = TRUE; + } + } + return ret; +} + +static u8 TryConsumeMirrorHerb(u32 battler, bool32 execute) +{ + u8 effect = 0; + + if (gProtectStructs[battler].eatMirrorHerb) + { + gLastUsedItem = gBattleMons[battler].item; + gBattleScripting.savedBattler = gBattlerAttacker; + gBattleScripting.battler = gBattlerAttacker = battler; + gProtectStructs[battler].eatMirrorHerb = 0; + if (execute) + { + BattleScriptExecute(BattleScript_MirrorHerbCopyStatChangeEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MirrorHerbCopyStatChange; + } + effect = ITEM_STATS_CHANGE; + } + return effect; +} + +static u32 RestoreWhiteHerbStats(u32 battler) +{ + u32 i, effect = 0; + + for (i = 0; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battler].statStages[i] < DEFAULT_STAT_STAGE) + { + gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE; + effect = ITEM_STATS_CHANGE; + } + } + if (effect != 0) + { + gBattleScripting.battler = battler; + gPotentialItemEffectBattler = battler; + } + return effect; +} + +static u8 ItemEffectMoveEnd(u32 battler, u16 holdEffect) +{ + u8 effect = 0; + + switch (holdEffect) + { + case HOLD_EFFECT_MICLE_BERRY: + if (B_HP_BERRIES >= GEN_4) + effect = TrySetMicleBerry(battler, gLastUsedItem, FALSE); + break; + case HOLD_EFFECT_RESTORE_HP: + if (B_HP_BERRIES >= GEN_4) + effect = ItemHealHp(battler, gLastUsedItem, FALSE, FALSE); + break; + case HOLD_EFFECT_RESTORE_PCT_HP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = ItemHealHp(battler, gLastUsedItem, FALSE, TRUE); + break; + case HOLD_EFFECT_RESTORE_PP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = ItemRestorePp(battler, gLastUsedItem, FALSE); + break; + case HOLD_EFFECT_CONFUSE_SPICY: + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SPICY, FALSE); + break; + case HOLD_EFFECT_CONFUSE_DRY: + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_DRY, FALSE); + break; + case HOLD_EFFECT_CONFUSE_SWEET: + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SWEET, FALSE); + break; + case HOLD_EFFECT_CONFUSE_BITTER: + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_BITTER, FALSE); + break; + case HOLD_EFFECT_CONFUSE_SOUR: + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SOUR, FALSE); + break; + case HOLD_EFFECT_ATTACK_UP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_ATK, FALSE); + break; + case HOLD_EFFECT_DEFENSE_UP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_DEF, FALSE); + break; + case HOLD_EFFECT_SPEED_UP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPEED, FALSE); + break; + case HOLD_EFFECT_SP_ATTACK_UP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPATK, FALSE); + break; + case HOLD_EFFECT_SP_DEFENSE_UP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPDEF, FALSE); + break; + case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move + if (B_BERRIES_INSTANT >= GEN_4) + effect = TrySetEnigmaBerry(battler); + break; + case HOLD_EFFECT_KEE_BERRY: // consume and boost defense if used physical move + if (B_BERRIES_INSTANT >= GEN_4) + effect = DamagedStatBoostBerryEffect(battler, STAT_DEF, DAMAGE_CATEGORY_PHYSICAL); + break; + case HOLD_EFFECT_MARANGA_BERRY: // consume and boost sp. defense if used special move + if (B_BERRIES_INSTANT >= GEN_4) + effect = DamagedStatBoostBerryEffect(battler, STAT_SPDEF, DAMAGE_CATEGORY_SPECIAL); + break; + case HOLD_EFFECT_RANDOM_STAT_UP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = RandomStatRaiseBerry(battler, gLastUsedItem, FALSE); + break; + case HOLD_EFFECT_CURE_PAR: + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_PARALYSIS; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureParRet; + effect = ITEM_STATUS_CHANGE; + } + break; + case HOLD_EFFECT_CURE_PSN: + if (gBattleMons[battler].status1 & STATUS1_PSN_ANY && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCurePsnRet; + effect = ITEM_STATUS_CHANGE; + } + break; + case HOLD_EFFECT_CURE_BRN: + if (gBattleMons[battler].status1 & STATUS1_BURN && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_BURN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureBrnRet; + effect = ITEM_STATUS_CHANGE; + } + break; + case HOLD_EFFECT_CURE_FRZ: + if (gBattleMons[battler].status1 & STATUS1_FREEZE && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_FREEZE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureFrzRet; + effect = ITEM_STATUS_CHANGE; + } + if (gBattleMons[battler].status1 & STATUS1_FROSTBITE && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_FROSTBITE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureFrbRet; + effect = ITEM_STATUS_CHANGE; + } + break; + case HOLD_EFFECT_CURE_SLP: + if (gBattleMons[battler].status1 & STATUS1_SLEEP && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_SLEEP; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureSlpRet; + effect = ITEM_STATUS_CHANGE; + } + break; + case HOLD_EFFECT_CURE_CONFUSION: + if (gBattleMons[battler].status2 & STATUS2_CONFUSION && !UnnerveOn(battler, gLastUsedItem)) + { + RemoveConfusionStatus(battler); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureConfusionRet; + effect = ITEM_EFFECT_OTHER; + } + break; + case HOLD_EFFECT_MENTAL_HERB: + if (GetMentalHerbEffect(battler)) + { + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MentalHerbCureRet; + effect = ITEM_EFFECT_OTHER; + } + break; + case HOLD_EFFECT_CURE_STATUS: + if ((gBattleMons[battler].status1 & STATUS1_ANY || gBattleMons[battler].status2 & STATUS2_CONFUSION) && !UnnerveOn(battler, gLastUsedItem)) + { + if (gBattleMons[battler].status1 & STATUS1_PSN_ANY) + StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); + + if (gBattleMons[battler].status1 & STATUS1_SLEEP) + { + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + } + + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) + StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); + + if (gBattleMons[battler].status1 & STATUS1_BURN) + StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); + + if (gBattleMons[battler].status1 & STATUS1_FREEZE || gBattleMons[battler].status1 & STATUS1_FROSTBITE) + StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); + + if (gBattleMons[battler].status2 & STATUS2_CONFUSION) + StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); + + gBattleMons[battler].status1 = 0; + RemoveConfusionStatus(battler); + BattleScriptPushCursor(); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; + gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; + effect = ITEM_STATUS_CHANGE; + } + break; + case HOLD_EFFECT_CRITICAL_UP: // lansat berry + if (B_BERRIES_INSTANT >= GEN_4 + && !(gBattleMons[battler].status2 & STATUS2_FOCUS_ENERGY_ANY) + && HasEnoughHpToEatBerry(battler, GetBattlerItemHoldEffectParam(battler, gLastUsedItem), gLastUsedItem)) + { + gBattleMons[battler].status2 |= STATUS2_FOCUS_ENERGY; + gBattleScripting.battler = battler; + gPotentialItemEffectBattler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryFocusEnergyRet; + effect = ITEM_EFFECT_OTHER; + } + break; + case HOLD_EFFECT_BERSERK_GENE: + BufferStatChange(battler, STAT_ATK, STRINGID_STATROSE); + gEffectBattler = battler; + if (CanBeInfinitelyConfused(gEffectBattler)) + { + gStatuses4[gEffectBattler] |= STATUS4_INFINITE_CONFUSION; + } + SET_STATCHANGER(STAT_ATK, 2, FALSE); + + gBattleScripting.animArg1 = 14 + STAT_ATK; + gBattleScripting.animArg2 = 0; + + BattleScriptPushCursorAndCallback(BattleScript_BerserkGeneRet); + effect = ITEM_STATS_CHANGE; + break; + case HOLD_EFFECT_MIRROR_HERB: + effect = TryConsumeMirrorHerb(battler, FALSE); + break; + } + + return effect; +} + +u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn) +{ + int i = 0, moveType; + u8 effect = ITEM_NO_EFFECT; + u32 battlerHoldEffect = 0, atkHoldEffect; + u8 atkHoldEffectParam; + u16 atkItem; + + if (caseID != ITEMEFFECT_USE_LAST_ITEM) + { + gLastUsedItem = gBattleMons[battler].item; + battlerHoldEffect = GetBattlerHoldEffect(battler, TRUE); } atkItem = gBattleMons[gBattlerAttacker].item; - if (atkItem == ITEM_ENIGMA_BERRY) - { - atkHoldEffect = gEnigmaBerries[gBattlerAttacker].holdEffect; - atkHoldEffectParam = gEnigmaBerries[gBattlerAttacker].holdEffectParam; - } - else - { - atkHoldEffect = ItemId_GetHoldEffect(atkItem); - atkHoldEffectParam = ItemId_GetHoldEffectParam(atkItem); - } - - // def variables are unused - defItem = gBattleMons[gBattlerTarget].item; - if (defItem == ITEM_ENIGMA_BERRY) - { - defHoldEffect = gEnigmaBerries[gBattlerTarget].holdEffect; - defHoldEffectParam = gEnigmaBerries[gBattlerTarget].holdEffectParam; - } - else - { - defHoldEffect = ItemId_GetHoldEffect(defItem); - defHoldEffectParam = ItemId_GetHoldEffectParam(defItem); - } + atkHoldEffect = GetBattlerHoldEffect(gBattlerAttacker, TRUE); + atkHoldEffectParam = GetBattlerHoldEffectParam(gBattlerAttacker); switch (caseID) { case ITEMEFFECT_ON_SWITCH_IN: - switch (battlerHoldEffect) - { - case HOLD_EFFECT_DOUBLE_PRIZE: - gBattleStruct->moneyMultiplier = 2; - break; - case HOLD_EFFECT_RESTORE_STATS: - for (i = 0; i < NUM_BATTLE_STATS; i++) - { - if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE) - { - gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE; - effect = ITEM_STATS_CHANGE; - } - } - if (effect != 0) - { - gBattleScripting.battler = battlerId; - gPotentialItemEffectBattler = battlerId; - gActiveBattler = gBattlerAttacker = battlerId; - BattleScriptExecute(BattleScript_WhiteHerbEnd2); - } - break; - } - break; - case ITEMEFFECT_NORMAL: - if (gBattleMons[battlerId].hp) + if (!gSpecialStatuses[battler].switchInItemDone) { switch (battlerHoldEffect) { - case HOLD_EFFECT_RESTORE_HP: - if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2 && !moveTurn) + case HOLD_EFFECT_DOUBLE_PRIZE: + if (GetBattlerSide(battler) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierItem) { - gBattleMoveDamage = battlerHoldEffectParam; - if (gBattleMons[battlerId].hp + battlerHoldEffectParam > gBattleMons[battlerId].maxHP) - gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp; - gBattleMoveDamage *= -1; - BattleScriptExecute(BattleScript_ItemHealHP_RemoveItem); - effect = ITEM_HP_CHANGE; - } - break; - case HOLD_EFFECT_RESTORE_PP: - if (!moveTurn) - { - struct Pokemon *mon; - u8 ppBonuses; - u16 move; - - if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; - for (i = 0; i < MAX_MON_MOVES; i++) - { - move = GetMonData(mon, MON_DATA_MOVE1 + i); - changedPP = GetMonData(mon, MON_DATA_PP1 + i); - ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); - if (move && changedPP == 0) - break; - } - if (i != MAX_MON_MOVES) - { - u8 maxPP = CalculatePPWithBonus(move, ppBonuses, i); - if (changedPP + battlerHoldEffectParam > maxPP) - changedPP = maxPP; - else - changedPP = changedPP + battlerHoldEffectParam; - - PREPARE_MOVE_BUFFER(gBattleTextBuff1, move); - - BattleScriptExecute(BattleScript_BerryPPHealEnd2); - BtlController_EmitSetMonData(BUFFER_A, i + REQUEST_PPMOVE1_BATTLE, 0, 1, &changedPP); - MarkBattlerForControllerExec(gActiveBattler); - effect = ITEM_PP_CHANGE; - } + gBattleStruct->moneyMultiplier *= 2; + gBattleStruct->moneyMultiplierItem = 1; } break; case HOLD_EFFECT_RESTORE_STATS: - for (i = 0; i < NUM_BATTLE_STATS; i++) - { - if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE) - { - gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE; - effect = ITEM_STATS_CHANGE; - } - } + effect = RestoreWhiteHerbStats(battler); if (effect != 0) { - gBattleScripting.battler = battlerId; - gPotentialItemEffectBattler = battlerId; - gActiveBattler = gBattlerAttacker = battlerId; + gActiveBattler = gBattlerAttacker = battler; BattleScriptExecute(BattleScript_WhiteHerbEnd2); } break; - case HOLD_EFFECT_LEFTOVERS: - if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn) - { - gBattleMoveDamage = gBattleMons[battlerId].maxHP / 16; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - if (gBattleMons[battlerId].hp + gBattleMoveDamage > gBattleMons[battlerId].maxHP) - gBattleMoveDamage = gBattleMons[battlerId].maxHP - gBattleMons[battlerId].hp; - gBattleMoveDamage *= -1; - BattleScriptExecute(BattleScript_ItemHealHP_End2); - effect = ITEM_HP_CHANGE; - RecordItemEffectBattle(battlerId, battlerHoldEffect); - } - break; case HOLD_EFFECT_CONFUSE_SPICY: - TRY_EAT_CONFUSE_BERRY(FLAVOR_SPICY); + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SPICY, TRUE); break; case HOLD_EFFECT_CONFUSE_DRY: - TRY_EAT_CONFUSE_BERRY(FLAVOR_DRY); + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_DRY, TRUE); break; case HOLD_EFFECT_CONFUSE_SWEET: - TRY_EAT_CONFUSE_BERRY(FLAVOR_SWEET); + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SWEET, TRUE); break; case HOLD_EFFECT_CONFUSE_BITTER: - TRY_EAT_CONFUSE_BERRY(FLAVOR_BITTER); + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_BITTER, TRUE); break; case HOLD_EFFECT_CONFUSE_SOUR: - TRY_EAT_CONFUSE_BERRY(FLAVOR_SOUR); + if (B_BERRIES_INSTANT >= GEN_4) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SOUR, TRUE); break; case HOLD_EFFECT_ATTACK_UP: - if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam - && !moveTurn && gBattleMons[battlerId].statStages[STAT_ATK] < MAX_STAT_STAGE) - { - PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK); - PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATROSE); // Only the Attack stat-up berry has this - gEffectBattler = battlerId; - SET_STATCHANGER(STAT_ATK, 1, FALSE); - gBattleScripting.animArg1 = 14 + STAT_ATK; - gBattleScripting.animArg2 = 0; - BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); - effect = ITEM_STATS_CHANGE; - } + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_ATK, TRUE); break; case HOLD_EFFECT_DEFENSE_UP: - TRY_EAT_STAT_UP_BERRY(STAT_DEF); + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_DEF, TRUE); break; case HOLD_EFFECT_SPEED_UP: - TRY_EAT_STAT_UP_BERRY(STAT_SPEED); + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPEED, TRUE); break; case HOLD_EFFECT_SP_ATTACK_UP: - TRY_EAT_STAT_UP_BERRY(STAT_SPATK); + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPATK, TRUE); break; case HOLD_EFFECT_SP_DEFENSE_UP: - TRY_EAT_STAT_UP_BERRY(STAT_SPDEF); + if (B_BERRIES_INSTANT >= GEN_4) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPDEF, TRUE); break; case HOLD_EFFECT_CRITICAL_UP: - if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn - && !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY)) + if (B_BERRIES_INSTANT >= GEN_4 + && !(gBattleMons[battler].status2 & STATUS2_FOCUS_ENERGY_ANY) + && HasEnoughHpToEatBerry(battler, GetBattlerItemHoldEffectParam(battler, gLastUsedItem), gLastUsedItem)) { - gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY; + gBattleMons[battler].status2 |= STATUS2_FOCUS_ENERGY; + gBattleScripting.battler = battler; BattleScriptExecute(BattleScript_BerryFocusEnergyEnd2); effect = ITEM_EFFECT_OTHER; } break; case HOLD_EFFECT_RANDOM_STAT_UP: - if (!moveTurn && gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam) - { - for (i = 0; i < NUM_STATS - 1; i++) - { - if (gBattleMons[battlerId].statStages[STAT_ATK + i] < MAX_STAT_STAGE) - break; - } - if (i != NUM_STATS - 1) - { - do - { - i = Random() % (NUM_STATS - 1); - } while (gBattleMons[battlerId].statStages[STAT_ATK + i] == MAX_STAT_STAGE); - - PREPARE_STAT_BUFFER(gBattleTextBuff1, i + 1); - - gBattleTextBuff2[0] = B_BUFF_PLACEHOLDER_BEGIN; - gBattleTextBuff2[1] = B_BUFF_STRING; - gBattleTextBuff2[2] = STRINGID_STATSHARPLY; - gBattleTextBuff2[3] = STRINGID_STATSHARPLY >> 8; - gBattleTextBuff2[4] = B_BUFF_STRING; - gBattleTextBuff2[5] = STRINGID_STATROSE; - gBattleTextBuff2[6] = STRINGID_STATROSE >> 8; - gBattleTextBuff2[7] = EOS; - - gEffectBattler = battlerId; - SET_STATCHANGER(i + 1, 2, FALSE); - gBattleScripting.animArg1 = 0x21 + i + 6; - gBattleScripting.animArg2 = 0; - BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); - effect = ITEM_STATS_CHANGE; - } - } + if (B_BERRIES_INSTANT >= GEN_4) + effect = RandomStatRaiseBerry(battler, gLastUsedItem, TRUE); break; case HOLD_EFFECT_CURE_PAR: - if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS) + if (B_BERRIES_INSTANT >= GEN_4 + && gBattleMons[battler].status1 & STATUS1_PARALYSIS + && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_PARALYSIS; + gBattleMons[battler].status1 &= ~STATUS1_PARALYSIS; BattleScriptExecute(BattleScript_BerryCurePrlzEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_PSN: - if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY) + if (B_BERRIES_INSTANT >= GEN_4 + && (gBattleMons[battler].status1 & STATUS1_PSN_ANY) + && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER); + gBattleMons[battler].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER); BattleScriptExecute(BattleScript_BerryCurePsnEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_BRN: - if (gBattleMons[battlerId].status1 & STATUS1_BURN) + if (B_BERRIES_INSTANT >= GEN_4 + && (gBattleMons[battler].status1 & STATUS1_BURN) + && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_BURN; + gBattleMons[battler].status1 &= ~STATUS1_BURN; BattleScriptExecute(BattleScript_BerryCureBrnEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_FRZ: - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + if (B_BERRIES_INSTANT >= GEN_4 + && (gBattleMons[battler].status1 & STATUS1_FREEZE) + && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_FREEZE; + gBattleMons[battler].status1 &= ~STATUS1_FREEZE; BattleScriptExecute(BattleScript_BerryCureFrzEnd2); effect = ITEM_STATUS_CHANGE; } + if (B_BERRIES_INSTANT >= GEN_4 + && (gBattleMons[battler].status1 & STATUS1_FROSTBITE) + && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_FROSTBITE; + BattleScriptExecute(BattleScript_BerryCureFrbEnd2); + effect = ITEM_STATUS_CHANGE; + } break; case HOLD_EFFECT_CURE_SLP: - if (gBattleMons[battlerId].status1 & STATUS1_SLEEP) + if (B_BERRIES_INSTANT >= GEN_4 + && (gBattleMons[battler].status1 & STATUS1_SLEEP) + && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_SLEEP; - gBattleMons[battlerId].status2 &= ~STATUS2_NIGHTMARE; + gBattleMons[battler].status1 &= ~STATUS1_SLEEP; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; BattleScriptExecute(BattleScript_BerryCureSlpEnd2); effect = ITEM_STATUS_CHANGE; } break; - case HOLD_EFFECT_CURE_CONFUSION: - if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION) - { - gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION; - BattleScriptExecute(BattleScript_BerryCureConfusionEnd2); - effect = ITEM_EFFECT_OTHER; - } - break; case HOLD_EFFECT_CURE_STATUS: - if (gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerId].status2 & STATUS2_CONFUSION) + if (B_BERRIES_INSTANT >= GEN_4 + && (gBattleMons[battler].status1 & STATUS1_ANY || gBattleMons[battler].status2 & STATUS2_CONFUSION) + && !UnnerveOn(battler, gLastUsedItem)) { i = 0; - if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY) + if (gBattleMons[battler].status1 & STATUS1_PSN_ANY) { StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); i++; } - if (gBattleMons[battlerId].status1 & STATUS1_SLEEP) + if (gBattleMons[battler].status1 & STATUS1_SLEEP) { - gBattleMons[battlerId].status2 &= ~STATUS2_NIGHTMARE; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); i++; } - if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS) + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) { StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); i++; } - if (gBattleMons[battlerId].status1 & STATUS1_BURN) + if (gBattleMons[battler].status1 & STATUS1_BURN) { StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); i++; } - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + if (gBattleMons[battler].status1 & STATUS1_FREEZE || gBattleMons[battler].status1 & STATUS1_FROSTBITE) { StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); i++; } - if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION) + if (gBattleMons[battler].status2 & STATUS2_CONFUSION) { StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); i++; @@ -2810,231 +5097,716 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS; - gBattleMons[battlerId].status1 = 0; - gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION; + gBattleMons[battler].status1 = 0; + RemoveConfusionStatus(battler); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); effect = ITEM_STATUS_CHANGE; } break; - case HOLD_EFFECT_CURE_ATTRACT: - if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION) + case HOLD_EFFECT_RESTORE_HP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = ItemHealHp(battler, gLastUsedItem, TRUE, FALSE); + break; + case HOLD_EFFECT_RESTORE_PCT_HP: + if (B_BERRIES_INSTANT >= GEN_4) + effect = ItemHealHp(battler, gLastUsedItem, TRUE, TRUE); + break; + case HOLD_EFFECT_AIR_BALLOON: + effect = ITEM_EFFECT_OTHER; + gBattleScripting.battler = battler; + BattleScriptPushCursorAndCallback(BattleScript_AirBaloonMsgIn); + RecordItemEffectBattle(battler, HOLD_EFFECT_AIR_BALLOON); + break; + case HOLD_EFFECT_ROOM_SERVICE: + if (TryRoomService(battler)) { - gBattleMons[battlerId].status2 &= ~STATUS2_INFATUATION; - StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); - BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; - effect = ITEM_EFFECT_OTHER; + BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); + effect = ITEM_STATS_CHANGE; } break; + case HOLD_EFFECT_SEEDS: + switch (GetBattlerHoldEffectParam(battler)) + { + case HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_ELECTRIC_TERRAIN, STAT_DEF, gLastUsedItem, TRUE); + break; + case HOLD_EFFECT_PARAM_GRASSY_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_GRASSY_TERRAIN, STAT_DEF, gLastUsedItem, TRUE); + break; + case HOLD_EFFECT_PARAM_MISTY_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_MISTY_TERRAIN, STAT_SPDEF, gLastUsedItem, TRUE); + break; + case HOLD_EFFECT_PARAM_PSYCHIC_TERRAIN: + effect = TryHandleSeed(battler, STATUS_FIELD_PSYCHIC_TERRAIN, STAT_SPDEF, gLastUsedItem, TRUE); + break; + } + break; + case HOLD_EFFECT_EJECT_PACK: + if (gProtectStructs[battler].statFell + && gProtectStructs[battler].disableEjectPack == 0 + && CountUsablePartyMons(battler) > 0 + && !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out + { + gProtectStructs[battler].statFell = FALSE; + gBattleScripting.battler = battler; + effect = ITEM_STATS_CHANGE; + if (moveTurn) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_EjectPackActivate_Ret; + } + else + { + BattleScriptExecute(BattleScript_EjectPackActivate_End2); + } + } + break; + case HOLD_EFFECT_BERSERK_GENE: + BufferStatChange(battler, STAT_ATK, STRINGID_STATROSE); + gEffectBattler = battler; + if (CanBeInfinitelyConfused(gEffectBattler)) + { + gStatuses4[gEffectBattler] |= STATUS4_INFINITE_CONFUSION; + } + SET_STATCHANGER(STAT_ATK, 2, FALSE); + + gBattleScripting.animArg1 = 14 + STAT_ATK; + gBattleScripting.animArg2 = 0; + + BattleScriptPushCursorAndCallback(BattleScript_BerserkGeneRet); + effect = ITEM_STATS_CHANGE; + break; } if (effect != 0) { - gBattleScripting.battler = battlerId; - gPotentialItemEffectBattler = battlerId; - gActiveBattler = gBattlerAttacker = battlerId; + gSpecialStatuses[battler].switchInItemDone = TRUE; + gActiveBattler = gBattlerAttacker = gPotentialItemEffectBattler = gBattleScripting.battler = battler; switch (effect) { case ITEM_STATUS_CHANGE: - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battlerId].status1); - MarkBattlerForControllerExec(gActiveBattler); - break; - case ITEM_PP_CHANGE: - if (MOVE_IS_PERMANENT(battlerId, i)) - gBattleMons[battlerId].pp[i] = changedPP; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); break; } } } break; - case ITEMEFFECT_DUMMY: - break; - case ITEMEFFECT_MOVE_END: - for (battlerId = 0; battlerId < gBattlersCount; battlerId++) + case ITEMEFFECT_NORMAL: + if (gBattleMons[battler].hp) { - gLastUsedItem = gBattleMons[battlerId].item; - if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY) - { - battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect; - battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam; - } - else - { - battlerHoldEffect = ItemId_GetHoldEffect(gLastUsedItem); - battlerHoldEffectParam = ItemId_GetHoldEffectParam(gLastUsedItem); - } switch (battlerHoldEffect) { - case HOLD_EFFECT_CURE_PAR: - if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS) + case HOLD_EFFECT_RESTORE_HP: + if (!moveTurn) + effect = ItemHealHp(battler, gLastUsedItem, TRUE, FALSE); + break; + case HOLD_EFFECT_RESTORE_PCT_HP: + if (!moveTurn) + effect = ItemHealHp(battler, gLastUsedItem, TRUE, TRUE); + break; + case HOLD_EFFECT_RESTORE_PP: + if (!moveTurn) + effect = ItemRestorePp(battler, gLastUsedItem, TRUE); + break; + case HOLD_EFFECT_RESTORE_STATS: + effect = RestoreWhiteHerbStats(battler); + if (effect != 0) { - gBattleMons[battlerId].status1 &= ~STATUS1_PARALYSIS; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BerryCureParRet; + gBattlerAttacker = battler; + BattleScriptExecute(BattleScript_WhiteHerbEnd2); + } + break; + case HOLD_EFFECT_BLACK_SLUDGE: + if (IS_BATTLER_OF_TYPE(battler, TYPE_POISON)) + { + goto LEFTOVERS; + } + else if (GetBattlerAbility(battler) != ABILITY_MAGIC_GUARD && !moveTurn) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 8; + gBattleMoveDamage = gBattleMons[battler].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + BattleScriptExecute(BattleScript_ItemHurtEnd2); + effect = ITEM_HP_CHANGE; + RecordItemEffectBattle(battler, battlerHoldEffect); + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + } + break; + case HOLD_EFFECT_LEFTOVERS: + LEFTOVERS: + if (gBattleMons[battler].hp < gBattleMons[battler].maxHP && !moveTurn + && (B_HEAL_BLOCKING < GEN_5 || !(gStatuses3[battler] & STATUS3_HEAL_BLOCK))) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 16; + gBattleMoveDamage = gBattleMons[battler].maxHP / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + BattleScriptExecute(BattleScript_ItemHealHP_End2); + effect = ITEM_HP_CHANGE; + RecordItemEffectBattle(battler, battlerHoldEffect); + } + break; + case HOLD_EFFECT_CONFUSE_SPICY: + if (!moveTurn) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SPICY, TRUE); + break; + case HOLD_EFFECT_CONFUSE_DRY: + if (!moveTurn) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_DRY, TRUE); + break; + case HOLD_EFFECT_CONFUSE_SWEET: + if (!moveTurn) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SWEET, TRUE); + break; + case HOLD_EFFECT_CONFUSE_BITTER: + if (!moveTurn) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_BITTER, TRUE); + break; + case HOLD_EFFECT_CONFUSE_SOUR: + if (!moveTurn) + effect = HealConfuseBerry(battler, gLastUsedItem, FLAVOR_SOUR, TRUE); + break; + case HOLD_EFFECT_ATTACK_UP: + if (!moveTurn) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_ATK, TRUE); + break; + case HOLD_EFFECT_DEFENSE_UP: + if (!moveTurn) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_DEF, TRUE); + break; + case HOLD_EFFECT_SPEED_UP: + if (!moveTurn) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPEED, TRUE); + break; + case HOLD_EFFECT_SP_ATTACK_UP: + if (!moveTurn) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPATK, TRUE); + break; + case HOLD_EFFECT_SP_DEFENSE_UP: + if (!moveTurn) + effect = StatRaiseBerry(battler, gLastUsedItem, STAT_SPDEF, TRUE); + break; + case HOLD_EFFECT_CRITICAL_UP: + if (!moveTurn && !(gBattleMons[battler].status2 & STATUS2_FOCUS_ENERGY_ANY) + && HasEnoughHpToEatBerry(battler, GetBattlerItemHoldEffectParam(battler, gLastUsedItem), gLastUsedItem)) + { + gBattleMons[battler].status2 |= STATUS2_FOCUS_ENERGY; + gBattleScripting.battler = battler; + BattleScriptExecute(BattleScript_BerryFocusEnergyEnd2); + effect = ITEM_EFFECT_OTHER; + } + break; + case HOLD_EFFECT_RANDOM_STAT_UP: + if (!moveTurn) + effect = RandomStatRaiseBerry(battler, gLastUsedItem, TRUE); + break; + case HOLD_EFFECT_CURE_PAR: + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_PARALYSIS; + BattleScriptExecute(BattleScript_BerryCurePrlzEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_PSN: - if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY) + if (gBattleMons[battler].status1 & STATUS1_PSN_ANY && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER); - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BerryCurePsnRet; + gBattleMons[battler].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER); + BattleScriptExecute(BattleScript_BerryCurePsnEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_BRN: - if (gBattleMons[battlerId].status1 & STATUS1_BURN) + if (gBattleMons[battler].status1 & STATUS1_BURN && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_BURN; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BerryCureBrnRet; + gBattleMons[battler].status1 &= ~STATUS1_BURN; + BattleScriptExecute(BattleScript_BerryCureBrnEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_FRZ: - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + if (gBattleMons[battler].status1 & STATUS1_FREEZE && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_FREEZE; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BerryCureFrzRet; + gBattleMons[battler].status1 &= ~STATUS1_FREEZE; + BattleScriptExecute(BattleScript_BerryCureFrzEnd2); + effect = ITEM_STATUS_CHANGE; + } + if (gBattleMons[battler].status1 & STATUS1_FROSTBITE && !UnnerveOn(battler, gLastUsedItem)) + { + gBattleMons[battler].status1 &= ~STATUS1_FROSTBITE; + BattleScriptExecute(BattleScript_BerryCureFrbEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_SLP: - if (gBattleMons[battlerId].status1 & STATUS1_SLEEP) + if (gBattleMons[battler].status1 & STATUS1_SLEEP && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status1 &= ~STATUS1_SLEEP; - gBattleMons[battlerId].status2 &= ~STATUS2_NIGHTMARE; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BerryCureSlpRet; + gBattleMons[battler].status1 &= ~STATUS1_SLEEP; + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + BattleScriptExecute(BattleScript_BerryCureSlpEnd2); effect = ITEM_STATUS_CHANGE; } break; case HOLD_EFFECT_CURE_CONFUSION: - if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION) + if (gBattleMons[battler].status2 & STATUS2_CONFUSION && !UnnerveOn(battler, gLastUsedItem)) { - gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BerryCureConfusionRet; - effect = ITEM_EFFECT_OTHER; - } - break; - case HOLD_EFFECT_CURE_ATTRACT: - if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION) - { - gBattleMons[battlerId].status2 &= ~STATUS2_INFATUATION; - StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); - BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; - gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; + RemoveConfusionStatus(battler); + BattleScriptExecute(BattleScript_BerryCureConfusionEnd2); effect = ITEM_EFFECT_OTHER; } break; case HOLD_EFFECT_CURE_STATUS: - if (gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerId].status2 & STATUS2_CONFUSION) + if ((gBattleMons[battler].status1 & STATUS1_ANY || gBattleMons[battler].status2 & STATUS2_CONFUSION) && !UnnerveOn(battler, gLastUsedItem)) { - if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY) - StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); - - if (gBattleMons[battlerId].status1 & STATUS1_SLEEP) + i = 0; + if (gBattleMons[battler].status1 & STATUS1_PSN_ANY) { - gBattleMons[battlerId].status2 &= ~STATUS2_NIGHTMARE; - StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); + i++; } - - if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS) + if (gBattleMons[battler].status1 & STATUS1_SLEEP) + { + gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; + StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + i++; + } + if (gBattleMons[battler].status1 & STATUS1_PARALYSIS) + { StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); - - if (gBattleMons[battlerId].status1 & STATUS1_BURN) + i++; + } + if (gBattleMons[battler].status1 & STATUS1_BURN) + { StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); - - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + i++; + } + if (gBattleMons[battler].status1 & STATUS1_FREEZE || gBattleMons[battler].status1 & STATUS1_FROSTBITE) + { StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); - - if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION) + i++; + } + if (gBattleMons[battler].status2 & STATUS2_CONFUSION) + { StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); - - gBattleMons[battlerId].status1 = 0; - gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION; - BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; - gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; + i++; + } + if (i <= 1) + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; + else + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS; + gBattleMons[battler].status1 = 0; + RemoveConfusionStatus(battler); + BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); effect = ITEM_STATUS_CHANGE; } break; - case HOLD_EFFECT_RESTORE_STATS: - for (i = 0; i < NUM_BATTLE_STATS; i++) + case HOLD_EFFECT_MENTAL_HERB: + if (GetMentalHerbEffect(battler)) { - if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE) - { - gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE; - effect = ITEM_STATS_CHANGE; - } - } - if (effect != 0) - { - gBattleScripting.battler = battlerId; - gPotentialItemEffectBattler = battlerId; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_WhiteHerbRet; - return effect; + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; + BattleScriptExecute(BattleScript_MentalHerbCureEnd2); + effect = ITEM_EFFECT_OTHER; } break; + case HOLD_EFFECT_MICLE_BERRY: + if (!moveTurn) + effect = TrySetMicleBerry(battler, gLastUsedItem, TRUE); + break; + case HOLD_EFFECT_BERSERK_GENE: + BufferStatChange(battler, STAT_ATK, STRINGID_STATROSE); + gEffectBattler = battler; + if (CanBeInfinitelyConfused(gEffectBattler)) + { + gStatuses4[gEffectBattler] |= STATUS4_INFINITE_CONFUSION; + } + SET_STATCHANGER(STAT_ATK, 2, FALSE); + + gBattleScripting.animArg1 = 14 + STAT_ATK; + gBattleScripting.animArg2 = 0; + + BattleScriptPushCursorAndCallback(BattleScript_BerserkGeneRet); + effect = ITEM_STATS_CHANGE; + break; + case HOLD_EFFECT_MIRROR_HERB: + effect = TryConsumeMirrorHerb(battler, TRUE); + break; } + if (effect != 0) { - gBattleScripting.battler = battlerId; - gPotentialItemEffectBattler = battlerId; - gActiveBattler = battlerId; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); + gActiveBattler = gBattlerAttacker = gPotentialItemEffectBattler = gBattleScripting.battler = battler; + switch (effect) + { + case ITEM_STATUS_CHANGE: + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + break; + } + } + } + break; + case ITEMEFFECT_USE_LAST_ITEM: + effect = ItemEffectMoveEnd(battler, ItemId_GetHoldEffect(gLastUsedItem)); + gBattleScripting.overrideBerryRequirements = 2; // to exit VARIOUS_CONSUME_BERRIES + if (effect) + { + gActiveBattler = gPotentialItemEffectBattler = gBattleScripting.battler = battler; + if (effect == ITEM_STATUS_CHANGE) + { + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + } + break; + } + break; + case ITEMEFFECT_MOVE_END: + for (battler = 0; battler < gBattlersCount; battler++) + { + gLastUsedItem = gBattleMons[battler].item; + effect = ItemEffectMoveEnd(battler, GetBattlerHoldEffect(battler, TRUE)); + if (effect) + { + gActiveBattler = gPotentialItemEffectBattler = gBattleScripting.battler = battler; + if (effect == ITEM_STATUS_CHANGE) + { + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + } break; } } break; - case ITEMEFFECT_KINGSROCK_SHELLBELL: - if (gBattleMoveDamage) + case ITEMEFFECT_KINGSROCK: + // Occur on each hit of a multi-strike move + switch (atkHoldEffect) { - switch (atkHoldEffect) + case HOLD_EFFECT_FLINCH: { - case HOLD_EFFECT_FLINCH: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + u16 ability = GetBattlerAbility(gBattlerAttacker); + if (B_SERENE_GRACE_BOOST >= GEN_5 && ability == ABILITY_SERENE_GRACE) + atkHoldEffectParam *= 2; + if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_RAINBOW && gCurrentMove != MOVE_SECRET_POWER) + atkHoldEffectParam *= 2; + if (gBattleMoveDamage != 0 // Need to have done damage + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED - && (Random() % 100) < battlerHoldEffectParam - && gBattleMoves[gCurrentMove].flags & FLAG_KINGS_ROCK_AFFECTED - && gBattleMons[gBattlerTarget].hp) + && !gMovesInfo[gCurrentMove].ignoresKingsRock + && gBattleMons[gBattlerTarget].hp + && RandomPercentage(RNG_HOLD_EFFECT_FLINCH, atkHoldEffectParam) + && ability != ABILITY_STENCH) { - gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_FLINCH; + gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; BattleScriptPushCursor(); - SetMoveEffect(FALSE, 0); + SetMoveEffect(FALSE, FALSE); BattleScriptPop(); } - break; - case HOLD_EFFECT_SHELL_BELL: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gSpecialStatuses[gBattlerTarget].dmg != 0 - && gSpecialStatuses[gBattlerTarget].dmg != 0xFFFF - && gBattlerAttacker != gBattlerTarget - && gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP - && gBattleMons[gBattlerAttacker].hp != 0) + } + break; + case HOLD_EFFECT_BLUNDER_POLICY: + if (gBattleStruct->blunderPolicy + && gBattleMons[gBattlerAttacker].hp != 0 + && CompareStat(gBattlerAttacker, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gBattleStruct->blunderPolicy = FALSE; + gLastUsedItem = atkItem; + SET_STATCHANGER(STAT_SPEED, 2, FALSE); + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AttackerItemStatRaise; + } + break; + } + break; + case ITEMEFFECT_LIFEORB_SHELLBELL: + // Occur after the final hit of a multi-strike move + switch (atkHoldEffect) + { + case HOLD_EFFECT_SHELL_BELL: + if (gSpecialStatuses[gBattlerAttacker].damagedMons // Need to have done damage + && gBattlerAttacker != gBattlerTarget + && gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP + && gBattleMons[gBattlerAttacker].hp != 0 + && (B_HEAL_BLOCKING < GEN_5 || !(gStatuses3[battler] & STATUS3_HEAL_BLOCK))) + { + gLastUsedItem = atkItem; + gPotentialItemEffectBattler = gBattlerAttacker; + gBattleScripting.battler = gBattlerAttacker; + gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].shellBellDmg / atkHoldEffectParam) * -1; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = -1; + gSpecialStatuses[gBattlerTarget].shellBellDmg = 0; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ItemHealHP_Ret; + effect = ITEM_HP_CHANGE; + } + break; + case HOLD_EFFECT_LIFE_ORB: + if (IsBattlerAlive(gBattlerAttacker) + && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD + && !gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage + && gSpecialStatuses[gBattlerAttacker].damagedMons) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 10; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 10; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + effect = ITEM_HP_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ItemHurtRet; + gLastUsedItem = gBattleMons[gBattlerAttacker].item; + } + break; + case HOLD_EFFECT_THROAT_SPRAY: // Does NOT need to be a damaging move + if (gProtectStructs[gBattlerAttacker].targetAffected + && gBattleMons[gBattlerAttacker].hp != 0 + && gMovesInfo[gCurrentMove].soundMove + && CompareStat(gBattlerAttacker, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN) + && !NoAliveMonsForEitherParty()) // Don't activate if battle will end + { + gLastUsedItem = atkItem; + gBattleScripting.battler = gBattlerAttacker; + SET_STATCHANGER(STAT_SPATK, 1, FALSE); + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AttackerItemStatRaise; + } + break; + } + break; + case ITEMEFFECT_TARGET: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + GET_MOVE_TYPE(gCurrentMove, moveType); + switch (battlerHoldEffect) + { + case HOLD_EFFECT_AIR_BALLOON: + if (TARGET_TURN_DAMAGED) { - gLastUsedItem = atkItem; - gPotentialItemEffectBattler = gBattlerAttacker; - gBattleScripting.battler = gBattlerAttacker; - gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].dmg / atkHoldEffectParam) * -1; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = -1; - gSpecialStatuses[gBattlerTarget].dmg = 0; + effect = ITEM_EFFECT_OTHER; BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ItemHealHP_Ret; - effect++; + gBattlescriptCurrInstr = BattleScript_AirBaloonMsgPop; + } + break; + case HOLD_EFFECT_ROCKY_HELMET: + if (TARGET_TURN_DAMAGED + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(gCurrentMove, gBattlerAttacker) + && IsBattlerAlive(gBattlerAttacker) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 6; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 6; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + effect = ITEM_HP_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_RockyHelmetActivates; + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + RecordItemEffectBattle(battler, HOLD_EFFECT_ROCKY_HELMET); + } + break; + case HOLD_EFFECT_WEAKNESS_POLICY: + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) + { + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_WeaknessPolicy; + } + break; + case HOLD_EFFECT_SNOWBALL: + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && moveType == TYPE_ICE) + { + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise; + SET_STATCHANGER(STAT_ATK, 1, FALSE); + } + break; + case HOLD_EFFECT_LUMINOUS_MOSS: + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && moveType == TYPE_WATER) + { + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise; + SET_STATCHANGER(STAT_SPDEF, 1, FALSE); + } + break; + case HOLD_EFFECT_CELL_BATTERY: + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && moveType == TYPE_ELECTRIC) + { + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise; + SET_STATCHANGER(STAT_ATK, 1, FALSE); + } + break; + case HOLD_EFFECT_ABSORB_BULB: + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && moveType == TYPE_WATER) + { + effect = ITEM_STATS_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise; + SET_STATCHANGER(STAT_SPATK, 1, FALSE); + } + break; + case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move + effect = TrySetEnigmaBerry(battler); + break; + case HOLD_EFFECT_JABOCA_BERRY: // consume and damage attacker if used physical move + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && IS_MOVE_PHYSICAL(gCurrentMove) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + gBattleMoveDamage *= 2; + + effect = ITEM_HP_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_JabocaRowapBerryActivates; + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + RecordItemEffectBattle(battler, HOLD_EFFECT_ROCKY_HELMET); + } + break; + case HOLD_EFFECT_ROWAP_BERRY: // consume and damage attacker if used special move + if (IsBattlerAlive(battler) + && TARGET_TURN_DAMAGED + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && IS_MOVE_SPECIAL(gCurrentMove) + && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + if (GetBattlerAbility(battler) == ABILITY_RIPEN) + gBattleMoveDamage *= 2; + + effect = ITEM_HP_CHANGE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_JabocaRowapBerryActivates; + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + RecordItemEffectBattle(battler, HOLD_EFFECT_ROCKY_HELMET); + } + break; + case HOLD_EFFECT_KEE_BERRY: // consume and boost defense if used physical move + effect = DamagedStatBoostBerryEffect(battler, STAT_DEF, DAMAGE_CATEGORY_PHYSICAL); + break; + case HOLD_EFFECT_MARANGA_BERRY: // consume and boost sp. defense if used special move + effect = DamagedStatBoostBerryEffect(battler, STAT_SPDEF, DAMAGE_CATEGORY_SPECIAL); + break; + case HOLD_EFFECT_STICKY_BARB: + if (TARGET_TURN_DAMAGED + && (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + && IsMoveMakingContact(gCurrentMove, gBattlerAttacker) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && IsBattlerAlive(gBattlerAttacker) + && CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) + && gBattleMons[gBattlerAttacker].item == ITEM_NONE) + { + // No sticky hold checks. + gEffectBattler = battler; // gEffectBattler = target + StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker takes target's barb + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StickyBarbTransfer; + effect = ITEM_EFFECT_OTHER; } break; } } break; + case ITEMEFFECT_ORBS: + { + u16 battlerAbility = GetBattlerAbility(battler); + switch (battlerHoldEffect) + { + case HOLD_EFFECT_TOXIC_ORB: + if (CanBePoisoned(battler, battler)) + { + effect = ITEM_STATUS_CHANGE; + gBattleMons[battler].status1 = STATUS1_TOXIC_POISON; + BattleScriptExecute(BattleScript_ToxicOrb); + RecordItemEffectBattle(battler, battlerHoldEffect); + } + break; + case HOLD_EFFECT_FLAME_ORB: + if (CanBeBurned(battler)) + { + effect = ITEM_STATUS_CHANGE; + gBattleMons[battler].status1 = STATUS1_BURN; + BattleScriptExecute(BattleScript_FlameOrb); + RecordItemEffectBattle(battler, battlerHoldEffect); + } + break; + case HOLD_EFFECT_STICKY_BARB: // Not an orb per se, but similar effect, and needs to NOT activate with pickpocket + if (battlerAbility != ABILITY_MAGIC_GUARD) + { + // TODO: Dynamax + // gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 8; + gBattleMoveDamage = gBattleMons[battler].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + BattleScriptExecute(BattleScript_ItemHurtEnd2); + effect = ITEM_HP_CHANGE; + RecordItemEffectBattle(battler, battlerHoldEffect); + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + } + break; + } + + gActiveBattler = battler; + if (effect == ITEM_STATUS_CHANGE) + { + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); + MarkBattlerForControllerExec(battler); + } + } + break; + case ITEMEFFECT_STATS_CHANGED: + switch (battlerHoldEffect) + { + case HOLD_EFFECT_RESTORE_STATS: + effect = RestoreWhiteHerbStats(battler); + if (effect != 0) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_WhiteHerbRet; + } + break; + } + break; } + // Berry was successfully used on a Pokemon. + if (effect && (gLastUsedItem >= FIRST_BERRY_INDEX && gLastUsedItem <= LAST_BERRY_INDEX)) + gBattleStruct->ateBerry[battler & BIT_SIDE] |= gBitTable[gBattlerPartyIndexes[battler]]; + return effect; } @@ -3051,6 +5823,172 @@ void HandleAction_RunBattleScript(void) // identical to RunBattleScriptCommands gBattleScriptingCommandsTable[*gBattlescriptCurrInstr](); } +static const u8 sHoldEffectToType[][2] = +{ + {HOLD_EFFECT_BUG_POWER, TYPE_BUG}, + {HOLD_EFFECT_STEEL_POWER, TYPE_STEEL}, + {HOLD_EFFECT_GROUND_POWER, TYPE_GROUND}, + {HOLD_EFFECT_ROCK_POWER, TYPE_ROCK}, + {HOLD_EFFECT_GRASS_POWER, TYPE_GRASS}, + {HOLD_EFFECT_DARK_POWER, TYPE_DARK}, + {HOLD_EFFECT_FIGHTING_POWER, TYPE_FIGHTING}, + {HOLD_EFFECT_ELECTRIC_POWER, TYPE_ELECTRIC}, + {HOLD_EFFECT_WATER_POWER, TYPE_WATER}, + {HOLD_EFFECT_FLYING_POWER, TYPE_FLYING}, + {HOLD_EFFECT_POISON_POWER, TYPE_POISON}, + {HOLD_EFFECT_ICE_POWER, TYPE_ICE}, + {HOLD_EFFECT_GHOST_POWER, TYPE_GHOST}, + {HOLD_EFFECT_PSYCHIC_POWER, TYPE_PSYCHIC}, + {HOLD_EFFECT_FIRE_POWER, TYPE_FIRE}, + {HOLD_EFFECT_DRAGON_POWER, TYPE_DRAGON}, + {HOLD_EFFECT_NORMAL_POWER, TYPE_NORMAL}, + {HOLD_EFFECT_FAIRY_POWER, TYPE_FAIRY}, +}; + +// percent in UQ_4_12 format +static const uq4_12_t sPercentToModifier[] = +{ + UQ_4_12(0.00), // 0 + UQ_4_12(0.01), // 1 + UQ_4_12(0.02), // 2 + UQ_4_12(0.03), // 3 + UQ_4_12(0.04), // 4 + UQ_4_12(0.05), // 5 + UQ_4_12(0.06), // 6 + UQ_4_12(0.07), // 7 + UQ_4_12(0.08), // 8 + UQ_4_12(0.09), // 9 + UQ_4_12(0.10), // 10 + UQ_4_12(0.11), // 11 + UQ_4_12(0.12), // 12 + UQ_4_12(0.13), // 13 + UQ_4_12(0.14), // 14 + UQ_4_12(0.15), // 15 + UQ_4_12(0.16), // 16 + UQ_4_12(0.17), // 17 + UQ_4_12(0.18), // 18 + UQ_4_12(0.19), // 19 + UQ_4_12(0.20), // 20 + UQ_4_12(0.21), // 21 + UQ_4_12(0.22), // 22 + UQ_4_12(0.23), // 23 + UQ_4_12(0.24), // 24 + UQ_4_12(0.25), // 25 + UQ_4_12(0.26), // 26 + UQ_4_12(0.27), // 27 + UQ_4_12(0.28), // 28 + UQ_4_12(0.29), // 29 + UQ_4_12(0.30), // 30 + UQ_4_12(0.31), // 31 + UQ_4_12(0.32), // 32 + UQ_4_12(0.33), // 33 + UQ_4_12(0.34), // 34 + UQ_4_12(0.35), // 35 + UQ_4_12(0.36), // 36 + UQ_4_12(0.37), // 37 + UQ_4_12(0.38), // 38 + UQ_4_12(0.39), // 39 + UQ_4_12(0.40), // 40 + UQ_4_12(0.41), // 41 + UQ_4_12(0.42), // 42 + UQ_4_12(0.43), // 43 + UQ_4_12(0.44), // 44 + UQ_4_12(0.45), // 45 + UQ_4_12(0.46), // 46 + UQ_4_12(0.47), // 47 + UQ_4_12(0.48), // 48 + UQ_4_12(0.49), // 49 + UQ_4_12(0.50), // 50 + UQ_4_12(0.51), // 51 + UQ_4_12(0.52), // 52 + UQ_4_12(0.53), // 53 + UQ_4_12(0.54), // 54 + UQ_4_12(0.55), // 55 + UQ_4_12(0.56), // 56 + UQ_4_12(0.57), // 57 + UQ_4_12(0.58), // 58 + UQ_4_12(0.59), // 59 + UQ_4_12(0.60), // 60 + UQ_4_12(0.61), // 61 + UQ_4_12(0.62), // 62 + UQ_4_12(0.63), // 63 + UQ_4_12(0.64), // 64 + UQ_4_12(0.65), // 65 + UQ_4_12(0.66), // 66 + UQ_4_12(0.67), // 67 + UQ_4_12(0.68), // 68 + UQ_4_12(0.69), // 69 + UQ_4_12(0.70), // 70 + UQ_4_12(0.71), // 71 + UQ_4_12(0.72), // 72 + UQ_4_12(0.73), // 73 + UQ_4_12(0.74), // 74 + UQ_4_12(0.75), // 75 + UQ_4_12(0.76), // 76 + UQ_4_12(0.77), // 77 + UQ_4_12(0.78), // 78 + UQ_4_12(0.79), // 79 + UQ_4_12(0.80), // 80 + UQ_4_12(0.81), // 81 + UQ_4_12(0.82), // 82 + UQ_4_12(0.83), // 83 + UQ_4_12(0.84), // 84 + UQ_4_12(0.85), // 85 + UQ_4_12(0.86), // 86 + UQ_4_12(0.87), // 87 + UQ_4_12(0.88), // 88 + UQ_4_12(0.89), // 89 + UQ_4_12(0.90), // 90 + UQ_4_12(0.91), // 91 + UQ_4_12(0.92), // 92 + UQ_4_12(0.93), // 93 + UQ_4_12(0.94), // 94 + UQ_4_12(0.95), // 95 + UQ_4_12(0.96), // 96 + UQ_4_12(0.97), // 97 + UQ_4_12(0.98), // 98 + UQ_4_12(0.99), // 99 + UQ_4_12(1.00), // 100 +}; + +#define X UQ_4_12 +#define ______ X(1.0) // Regular effectiveness. + +static const uq4_12_t sTypeEffectivenessTable[NUMBER_OF_MON_TYPES][NUMBER_OF_MON_TYPES] = +{// Defender --> + // Attacker Normal Fighting Flying Poison Ground Rock Bug Ghost Steel Mystery Fire Water Grass Electric Psychic Ice Dragon Dark Fairy + [TYPE_NORMAL] = {______, ______, ______, ______, ______, X(0.5), ______, X(0.0), X(0.5), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______}, + [TYPE_FIGHTING] = {X(2.0), ______, X(0.5), X(0.5), ______, X(2.0), X(0.5), X(0.0), X(2.0), ______, ______, ______, ______, ______, X(0.5), X(2.0), ______, X(2.0), X(0.5)}, + [TYPE_FLYING] = {______, X(2.0), ______, ______, ______, X(0.5), X(2.0), ______, X(0.5), ______, ______, ______, X(2.0), X(0.5), ______, ______, ______, ______, ______}, + [TYPE_POISON] = {______, ______, ______, X(0.5), X(0.5), X(0.5), ______, X(0.5), X(0.0), ______, ______, ______, X(2.0), ______, ______, ______, ______, ______, X(2.0)}, + [TYPE_GROUND] = {______, ______, X(0.0), X(2.0), ______, X(2.0), X(0.5), ______, X(2.0), ______, X(2.0), ______, X(0.5), X(2.0), ______, ______, ______, ______, ______}, + [TYPE_ROCK] = {______, X(0.5), X(2.0), ______, X(0.5), ______, X(2.0), ______, X(0.5), ______, X(2.0), ______, ______, ______, ______, X(2.0), ______, ______, ______}, + [TYPE_BUG] = {______, X(0.5), X(0.5), X(0.5), ______, ______, ______, X(0.5), X(0.5), ______, X(0.5), ______, X(2.0), ______, X(2.0), ______, ______, X(2.0), X(0.5)}, +#if B_STEEL_RESISTANCES >= GEN_6 + [TYPE_GHOST] = {X(0.0), ______, ______, ______, ______, ______, ______, X(2.0), ______, ______, ______, ______, ______, ______, X(2.0), ______, ______, X(0.5), ______}, +#else + [TYPE_GHOST] = {X(0.0), ______, ______, ______, ______, ______, ______, X(2.0), X(0.5), ______, ______, ______, ______, ______, X(2.0), ______, ______, X(0.5), ______}, +#endif + [TYPE_STEEL] = {______, ______, ______, ______, ______, X(2.0), ______, ______, X(0.5), ______, X(0.5), X(0.5), ______, X(0.5), ______, X(2.0), ______, ______, X(2.0)}, + [TYPE_MYSTERY] = {______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______}, + [TYPE_FIRE] = {______, ______, ______, ______, ______, X(0.5), X(2.0), ______, X(2.0), ______, X(0.5), X(0.5), X(2.0), ______, ______, X(2.0), X(0.5), ______, ______}, + [TYPE_WATER] = {______, ______, ______, ______, X(2.0), X(2.0), ______, ______, ______, ______, X(2.0), X(0.5), X(0.5), ______, ______, ______, X(0.5), ______, ______}, + [TYPE_GRASS] = {______, ______, X(0.5), X(0.5), X(2.0), X(2.0), X(0.5), ______, X(0.5), ______, X(0.5), X(2.0), X(0.5), ______, ______, ______, X(0.5), ______, ______}, + [TYPE_ELECTRIC] = {______, ______, X(2.0), ______, X(0.0), ______, ______, ______, ______, ______, ______, X(2.0), X(0.5), X(0.5), ______, ______, X(0.5), ______, ______}, + [TYPE_PSYCHIC] = {______, X(2.0), ______, X(2.0), ______, ______, ______, ______, X(0.5), ______, ______, ______, ______, ______, X(0.5), ______, ______, X(0.0), ______}, + [TYPE_ICE] = {______, ______, X(2.0), ______, X(2.0), ______, ______, ______, X(0.5), ______, X(0.5), X(0.5), X(2.0), ______, ______, X(0.5), X(2.0), ______, ______}, + [TYPE_DRAGON] = {______, ______, ______, ______, ______, ______, ______, ______, X(0.5), ______, ______, ______, ______, ______, ______, ______, X(2.0), ______, X(0.0)}, +#if B_STEEL_RESISTANCES >= GEN_6 + [TYPE_DARK] = {______, X(0.5), ______, ______, ______, ______, ______, X(2.0), ______, ______, ______, ______, ______, ______, X(2.0), ______, ______, X(0.5), X(0.5)}, +#else + [TYPE_DARK] = {______, X(0.5), ______, ______, ______, ______, ______, X(2.0), X(0.5), ______, ______, ______, ______, ______, X(2.0), ______, ______, X(0.5), X(0.5)}, +#endif + [TYPE_FAIRY] = {______, X(2.0), ______, X(0.5), ______, ______, ______, ______, X(0.5), ______, X(0.5), ______, ______, ______, ______, ______, X(2.0), X(2.0), ______}, +}; + +#undef ______ +#undef X + u8 GetMoveTarget(u16 move, u8 setTarget) { u8 targetBattler = 0; @@ -3060,7 +5998,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) if (setTarget != NO_TARGET_OVERRIDE) moveTarget = setTarget - 1; else - moveTarget = gBattleMoves[move].target; + moveTarget = gMovesInfo[move].target; switch (moveTarget) { @@ -3075,7 +6013,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) { targetBattler = Random() % gBattlersCount; } while (targetBattler == gBattlerAttacker || side == GetBattlerSide(targetBattler) || gAbsentBattlerFlags & gBitTable[targetBattler]); - if (gBattleMoves[move].type == TYPE_ELECTRIC + if (gMovesInfo[move].type == TYPE_ELECTRIC && AbilityBattleEffects(ABILITYEFFECT_COUNT_OTHER_SIDE, gBattlerAttacker, ABILITY_LIGHTNING_ROD, 0, 0) && gBattleMons[targetBattler].ability != ABILITY_LIGHTNING_ROD) { @@ -3140,6 +6078,2244 @@ static bool32 IsBattlerModernFatefulEncounter(u8 battlerId) return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL); } +bool32 TryPrimalReversion(u32 battler) +{ + if (GetBattlerHoldEffect(battler, FALSE) == HOLD_EFFECT_PRIMAL_ORB + && GetBattleFormChangeTargetSpecies(battler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE) + { + if (gBattlerAttacker == battler) + { + BattleScriptExecute(BattleScript_PrimalReversion); + } + else + { + // edge case for scenarios like a switch-in after activated eject button + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battler; + BattleScriptExecute(BattleScript_PrimalReversionRestoreAttacker); + } + return TRUE; + } + return FALSE; +} + +bool32 IsNeutralizingGasOnField(void) +{ + u32 i; + + for (i = 0; i < gBattlersCount; i++) + { + if (IsBattlerAlive(i) && gBattleMons[i].ability == ABILITY_NEUTRALIZING_GAS && !(gStatuses3[i] & STATUS3_GASTRO_ACID)) + return TRUE; + } + + return FALSE; +} + +bool32 IsMyceliumMightOnField(void) +{ + u32 i; + + for (i = 0; i < gBattlersCount; i++) + { + if (IsBattlerAlive(i) && gBattleMons[i].ability == ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gCurrentMove)) + return TRUE; + } + + return FALSE; +} + +bool32 IsMoldBreakerTypeAbility(u32 ability) +{ + return (ability == ABILITY_MOLD_BREAKER || ability == ABILITY_TERAVOLT || ability == ABILITY_TURBOBLAZE); +} + +u32 GetBattlerAbility(u32 battler) +{ + if (gAbilitiesInfo[gBattleMons[battler].ability].cantBeSuppressed) + return gBattleMons[battler].ability; + + if (gStatuses3[battler] & STATUS3_GASTRO_ACID) + return ABILITY_NONE; + + if (IsNeutralizingGasOnField() + && gBattleMons[battler].ability != ABILITY_NEUTRALIZING_GAS + && GetBattlerHoldEffectIgnoreAbility(battler, TRUE) != HOLD_EFFECT_ABILITY_SHIELD) + return ABILITY_NONE; + + if (IsMyceliumMightOnField()) + return ABILITY_NONE; + + if (((IsMoldBreakerTypeAbility(gBattleMons[gBattlerAttacker].ability) + && !(gStatuses3[gBattlerAttacker] & STATUS3_GASTRO_ACID)) + || gMovesInfo[gCurrentMove].ignoresTargetAbility) + && gAbilitiesInfo[gBattleMons[battler].ability].breakable + && gBattlerByTurnOrder[gCurrentTurnActionNumber] == gBattlerAttacker + && gActionsByTurnOrder[gBattlerByTurnOrder[gBattlerAttacker]] == B_ACTION_USE_MOVE + && gCurrentTurnActionNumber < gBattlersCount) + return ABILITY_NONE; + + return gBattleMons[battler].ability; +} + +u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating) +{ + return GetBattlerHoldEffectInternal(battler, checkNegating, TRUE); +} + +u32 GetBattlerHoldEffectIgnoreAbility(u32 battler, bool32 checkNegating) +{ + return GetBattlerHoldEffectInternal(battler, checkNegating, FALSE); +} + +u32 GetBattlerHoldEffectInternal(u32 battler, bool32 checkNegating, bool32 checkAbility) +{ + if (checkNegating) + { + if (gStatuses3[battler] & STATUS3_EMBARGO) + return HOLD_EFFECT_NONE; + if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM) + return HOLD_EFFECT_NONE; + if (checkAbility && GetBattlerAbility(battler) == ABILITY_KLUTZ) + return HOLD_EFFECT_NONE; + } + + gPotentialItemEffectBattler = battler; + + if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY_E_READER) + return gEnigmaBerries[battler].holdEffect; + else + return ItemId_GetHoldEffect(gBattleMons[battler].item); +} + +bool32 IsBattlerAlive(u32 battler) +{ + if (gBattleMons[battler].hp == 0) + return FALSE; + else if (battler >= gBattlersCount) + return FALSE; + else if (gAbsentBattlerFlags & gBitTable[battler]) + return FALSE; + else + return TRUE; +} + +u32 GetMoveSlot(u16 *moves, u32 move) +{ + u32 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] == move) + break; + } + return i; +} + +u32 GetBattlerWeight(u32 battler) +{ + u32 i; + u32 weight = GetSpeciesWeight(gBattleMons[battler].species); + u32 ability = GetBattlerAbility(battler); + u32 holdEffect = GetBattlerHoldEffect(battler, TRUE); + + if (ability == ABILITY_HEAVY_METAL) + weight *= 2; + else if (ability == ABILITY_LIGHT_METAL) + weight /= 2; + + if (holdEffect == HOLD_EFFECT_FLOAT_STONE) + weight /= 2; + + for (i = 0; i < gDisableStructs[battler].autotomizeCount; i++) + { + if (weight > 1000) + { + weight -= 1000; + } + else if (weight <= 1000) + { + weight = 1; + break; + } + } + + if (weight == 0) + weight = 1; + + return weight; +} + +u32 CountBattlerStatIncreases(u32 battler, bool32 countEvasionAcc) +{ + u32 i; + u32 count = 0; + + for (i = 0; i < NUM_BATTLE_STATS; i++) + { + if ((i == STAT_ACC || i == STAT_EVASION) && !countEvasionAcc) + continue; + if (gBattleMons[battler].statStages[i] > DEFAULT_STAT_STAGE) // Stat is increased. + count += gBattleMons[battler].statStages[i] - DEFAULT_STAT_STAGE; + } + + return count; +} + +// This function is the body of "jumpifstat", but can be used dynamically in a function +bool32 CompareStat(u32 battler, u8 statId, u8 cmpTo, u8 cmpKind) +{ + bool32 ret = FALSE; + u8 statValue = gBattleMons[battler].statStages[statId]; + + // Because this command is used as a way of checking if a stat can be lowered/raised, + // we need to do some modification at run-time. + if (GetBattlerAbility(battler) == ABILITY_CONTRARY) + { + if (cmpKind == CMP_GREATER_THAN) + cmpKind = CMP_LESS_THAN; + else if (cmpKind == CMP_LESS_THAN) + cmpKind = CMP_GREATER_THAN; + + if (cmpTo == MIN_STAT_STAGE) + cmpTo = MAX_STAT_STAGE; + else if (cmpTo == MAX_STAT_STAGE) + cmpTo = MIN_STAT_STAGE; + } + + switch (cmpKind) + { + case CMP_EQUAL: + if (statValue == cmpTo) + ret = TRUE; + break; + case CMP_NOT_EQUAL: + if (statValue != cmpTo) + ret = TRUE; + break; + case CMP_GREATER_THAN: + if (statValue > cmpTo) + ret = TRUE; + break; + case CMP_LESS_THAN: + if (statValue < cmpTo) + ret = TRUE; + break; + case CMP_COMMON_BITS: + if (statValue & cmpTo) + ret = TRUE; + break; + case CMP_NO_COMMON_BITS: + if (!(statValue & cmpTo)) + ret = TRUE; + break; + } + + return ret; +} + +u32 CalcSecondaryEffectChance(u32 battler, u32 battlerAbility, const struct AdditionalEffect *additionalEffect) +{ + bool8 hasSereneGrace = (battlerAbility == ABILITY_SERENE_GRACE); + bool8 hasRainbow = (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_RAINBOW) != 0; + u16 secondaryEffectChance = additionalEffect->chance; + + if (hasRainbow && hasSereneGrace && additionalEffect->moveEffect == MOVE_EFFECT_FLINCH) + return secondaryEffectChance * 2; + + if (hasSereneGrace) + secondaryEffectChance *= 2; + if (hasRainbow && additionalEffect->moveEffect != MOVE_EFFECT_SECRET_POWER) + secondaryEffectChance *= 2; + + return secondaryEffectChance; +} + +bool32 MoveHasAdditionalEffect(u32 move, u32 moveEffect) +{ + u32 i; + for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + { + if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect + && gMovesInfo[move].additionalEffects[i].self == FALSE) + return TRUE; + } + return FALSE; +} + +u32 IsAbilityOnSide(u32 battler, u32 ability) +{ + if (IsBattlerAlive(battler) && GetBattlerAbility(battler) == ability) + return battler + 1; + else if (IsBattlerAlive(BATTLE_PARTNER(battler)) && GetBattlerAbility(BATTLE_PARTNER(battler)) == ability) + return BATTLE_PARTNER(battler) + 1; + else + return 0; +} + +u32 IsAbilityOnOpposingSide(u32 battler, u32 ability) +{ + return IsAbilityOnSide(BATTLE_OPPOSITE(battler), ability); +} + +u32 IsAbilityOnField(u32 ability) +{ + u32 i; + + for (i = 0; i < gBattlersCount; i++) + { + if (IsBattlerAlive(i) && GetBattlerAbility(i) == ability) + return i + 1; + } + + return 0; +} + +u32 IsAbilityOnFieldExcept(u32 battler, u32 ability) +{ + u32 i; + + for (i = 0; i < gBattlersCount; i++) + { + if (i != battler && IsBattlerAlive(i) && GetBattlerAbility(i) == ability) + return i + 1; + } + + return 0; +} + +u32 IsAbilityPreventingEscape(u32 battler) +{ + u32 id; + if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) + return 0; + if ((id = IsAbilityOnOpposingSide(battler, ABILITY_SHADOW_TAG)) + && (B_SHADOW_TAG_ESCAPE >= GEN_4 && GetBattlerAbility(battler) != ABILITY_SHADOW_TAG)) + return id; + if ((id = IsAbilityOnOpposingSide(battler, ABILITY_ARENA_TRAP)) && IsBattlerGrounded(battler)) + return id; + if ((id = IsAbilityOnOpposingSide(battler, ABILITY_MAGNET_PULL)) && IS_BATTLER_OF_TYPE(battler, TYPE_STEEL)) + return id; + + return 0; +} + +static bool32 IsUnnerveAbilityOnOpposingSide(u32 battler) +{ + if (IsAbilityOnOpposingSide(battler, ABILITY_UNNERVE) + || IsAbilityOnOpposingSide(battler, ABILITY_AS_ONE_ICE_RIDER) + || IsAbilityOnOpposingSide(battler, ABILITY_AS_ONE_SHADOW_RIDER)) + return TRUE; + return FALSE; +} + +u8 GetBattleMoveCategory(u32 moveId) +{ + // TODO: Z-Move and Dynamax + // if (gBattleStruct != NULL && gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId)) + // return gBattleStruct->zmove.activeCategory; + // if (gBattleStruct != NULL && IsMaxMove(moveId)) // TODO: Might be buggy depending on when this is called. + // return gBattleStruct->dynamax.activeCategory; + if (gBattleStruct != NULL && gBattleStruct->swapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + return DAMAGE_CATEGORY_PHYSICAL; + if (B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) + return gMovesInfo[moveId].category; + + if (IS_MOVE_STATUS(moveId)) + return DAMAGE_CATEGORY_STATUS; + else if (gMovesInfo[moveId].type < TYPE_MYSTERY) + return DAMAGE_CATEGORY_PHYSICAL; + else + return DAMAGE_CATEGORY_SPECIAL; +} + +static bool32 TryRemoveScreens(u32 battler) +{ + bool32 removed = FALSE; + u32 battlerSide = GetBattlerSide(battler); + u8 enemySide = GetBattlerSide(BATTLE_OPPOSITE(battler)); + + // try to remove from battler's side + if (gSideStatuses[battlerSide] & (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL)) + { + gSideStatuses[battlerSide] &= ~(SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL); + gSideTimers[battlerSide].reflectTimer = 0; + gSideTimers[battlerSide].lightscreenTimer = 0; + gSideTimers[battlerSide].auroraVeilTimer = 0; + removed = TRUE; + } + + // try to remove from battler opponent's side + if (gSideStatuses[enemySide] & (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL)) + { + gSideStatuses[enemySide] &= ~(SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL); + gSideTimers[enemySide].reflectTimer = 0; + gSideTimers[enemySide].lightscreenTimer = 0; + gSideTimers[enemySide].auroraVeilTimer = 0; + removed = TRUE; + } + + return removed; +} + +// Gets move target before redirection effects etc. are applied +// Possible return values are defined in battle.h following MOVE_TARGET_SELECTED +u32 GetBattlerMoveTargetType(u32 battler, u32 move) +{ + if (gMovesInfo[move].effect == EFFECT_EXPANDING_FORCE + && IsBattlerTerrainAffected(battler, STATUS_FIELD_PSYCHIC_TERRAIN)) + return MOVE_TARGET_BOTH; + else + return gMovesInfo[move].target; +} + +bool32 IsBattlerTerrainAffected(u32 battler, u32 terrainFlag) +{ + if (!(gFieldStatuses & terrainFlag)) + return FALSE; + else if (gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) + return FALSE; + + return IsBattlerGrounded(battler); +} + +bool32 IsMoveMakingContact(u32 move, u32 battlerAtk) +{ + u32 atkHoldEffect = GetBattlerHoldEffect(battlerAtk, TRUE); + + if (!gMovesInfo[move].makesContact) + { + if (gMovesInfo[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory) + return TRUE; + else + return FALSE; + } + else if ((atkHoldEffect == HOLD_EFFECT_PUNCHING_GLOVE && gMovesInfo[move].punchingMove) + || GetBattlerAbility(battlerAtk) == ABILITY_LONG_REACH) + { + return FALSE; + } + else + { + return TRUE; + } +} + +bool32 IsBattlerProtected(u32 battler, u32 move) +{ + // Decorate bypasses protect and detect, but not crafty shield + if (move == MOVE_DECORATE) + { + if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_CRAFTY_SHIELD) + return TRUE; + else if (gProtectStructs[battler].protected) + return FALSE; + } + + // TODO: Z-Moves and Dynamax + // Z-Moves and Max Moves bypass protection (except Max Guard). + // if ((IsMaxMove(move) || gBattleStruct->zmove.active) + // && (!gProtectStructs[battler].maxGuarded + // || gMovesInfo[move].argument == MAX_EFFECT_BYPASS_PROTECT)) + // return FALSE; + + // TODO: Z-Moves and Dynamax + // Max Guard is silly about the moves it blocks, including Teatime. + // if (gProtectStructs[battler].maxGuarded && IsMoveBlockedByMaxGuard(move)) + // return TRUE; + + // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. + // This means extra logic is needed to handle Shell Side Arm. + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST + && (gMovesInfo[move].makesContact || (gMovesInfo[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory)) + && !gProtectStructs[battler].maxGuarded) // Max Guard cannot be bypassed by Unseen Fist + return FALSE; + else if (gMovesInfo[move].ignoresProtect) + return FALSE; + else if (gProtectStructs[battler].protected) + return TRUE; + else if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_WIDE_GUARD + && GetBattlerMoveTargetType(gBattlerAttacker, move) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) + return TRUE; + else if (gProtectStructs[battler].banefulBunkered) + return TRUE; + else if (gProtectStructs[battler].burningBulwarked) + return TRUE; + else if ((gProtectStructs[battler].obstructed || gProtectStructs[battler].silkTrapped) && !IS_MOVE_STATUS(move)) + return TRUE; + else if (gProtectStructs[battler].spikyShielded) + return TRUE; + else if (gProtectStructs[battler].kingsShielded && gMovesInfo[move].power != 0) + return TRUE; + else if (gProtectStructs[battler].maxGuarded) + return TRUE; + else if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_QUICK_GUARD + && GetChosenMovePriority(gBattlerAttacker) > 0) + return TRUE; + else if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_CRAFTY_SHIELD + && IS_MOVE_STATUS(move)) + return TRUE; + else if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_MAT_BLOCK + && !IS_MOVE_STATUS(move)) + return TRUE; + else + return FALSE; +} + +// Only called directly when calculating damage type effectiveness +static bool32 IsBattlerGrounded2(u32 battler, bool32 considerInverse) +{ + u32 holdEffect = GetBattlerHoldEffect(battler, TRUE); + + if (holdEffect == HOLD_EFFECT_IRON_BALL) + return TRUE; + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + return TRUE; + if (B_ROOTED_GROUNDING >= GEN_4 && gStatuses3[battler] & STATUS3_ROOTED) + return TRUE; + if (gStatuses3[battler] & STATUS3_SMACKED_DOWN) + return TRUE; + if (gStatuses3[battler] & STATUS3_TELEKINESIS) + return FALSE; + if (gStatuses3[battler] & STATUS3_MAGNET_RISE) + return FALSE; + if (holdEffect == HOLD_EFFECT_AIR_BALLOON) + return FALSE; + if (GetBattlerAbility(battler) == ABILITY_LEVITATE) + return FALSE; + if (IS_BATTLER_OF_TYPE(battler, TYPE_FLYING) && (!considerInverse || !FlagGet(B_FLAG_INVERSE_BATTLE))) + return FALSE; + return TRUE; +} + +bool32 IsBattlerGrounded(u32 battler) +{ + return IsBattlerGrounded2(battler, FALSE); +} + +void SetAtkCancellerForCalledMove(void) +{ + gBattleStruct->atkCancellerTracker = CANCELLER_HEAL_BLOCKED; + gBattleStruct->isAtkCancelerForCalledMove = TRUE; +} + +bool32 BlocksPrankster(u16 move, u32 battlerPrankster, u32 battlerDef, bool32 checkTarget) +{ + if (B_PRANKSTER_DARK_TYPES < GEN_7) + return FALSE; + if (!gProtectStructs[battlerPrankster].pranksterElevated) + return FALSE; + if (GetBattlerSide(battlerPrankster) == GetBattlerSide(battlerDef)) + return FALSE; + if (checkTarget && (GetBattlerMoveTargetType(battlerPrankster, move) & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) + return FALSE; + if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) + return FALSE; + if (gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE) + return FALSE; + + return TRUE; +} + +u32 GetMoveTargetCount(u32 move, u32 battlerAtk, u32 battlerDef) +{ + switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) + { + case MOVE_TARGET_BOTH: + return IsBattlerAlive(battlerDef) + + IsBattlerAlive(BATTLE_PARTNER(battlerDef)); + case MOVE_TARGET_FOES_AND_ALLY: + return IsBattlerAlive(battlerDef) + + IsBattlerAlive(BATTLE_PARTNER(battlerDef)) + + IsBattlerAlive(BATTLE_PARTNER(battlerAtk)); + case MOVE_TARGET_OPPONENTS_FIELD: + return 1; + case MOVE_TARGET_DEPENDS: + case MOVE_TARGET_SELECTED: + case MOVE_TARGET_RANDOM: + case MOVE_TARGET_USER_OR_SELECTED: + return IsBattlerAlive(battlerDef); + case MOVE_TARGET_USER: + return IsBattlerAlive(battlerAtk); + default: + return 0; + } +} + +static const u8 sFlailHpScaleToPowerTable[] = +{ + 1, 200, + 4, 150, + 9, 100, + 16, 80, + 32, 40, + 48, 20 +}; + +// format: min. weight (hectograms), base power +static const u16 sWeightToDamageTable[] = +{ + 100, 20, + 250, 40, + 500, 60, + 1000, 80, + 2000, 100, + 0xFFFF, 0xFFFF +}; + +static const u8 sSpeedDiffPowerTable[] = {40, 60, 80, 120, 150}; +static const u8 sHeatCrashPowerTable[] = {40, 40, 60, 80, 100, 120}; +static const u8 sTrumpCardPowerTable[] = {200, 80, 60, 50, 40}; + +const struct TypePower gNaturalGiftTable[] = +{ + [ITEM_TO_BERRY(ITEM_CHERI_BERRY)] = {TYPE_FIRE, 80}, + [ITEM_TO_BERRY(ITEM_CHESTO_BERRY)] = {TYPE_WATER, 80}, + [ITEM_TO_BERRY(ITEM_PECHA_BERRY)] = {TYPE_ELECTRIC, 80}, + [ITEM_TO_BERRY(ITEM_RAWST_BERRY)] = {TYPE_GRASS, 80}, + [ITEM_TO_BERRY(ITEM_ASPEAR_BERRY)] = {TYPE_ICE, 80}, + [ITEM_TO_BERRY(ITEM_LEPPA_BERRY)] = {TYPE_FIGHTING, 80}, + [ITEM_TO_BERRY(ITEM_ORAN_BERRY)] = {TYPE_POISON, 80}, + [ITEM_TO_BERRY(ITEM_PERSIM_BERRY)] = {TYPE_GROUND, 80}, + [ITEM_TO_BERRY(ITEM_LUM_BERRY)] = {TYPE_FLYING, 80}, + [ITEM_TO_BERRY(ITEM_SITRUS_BERRY)] = {TYPE_PSYCHIC, 80}, + [ITEM_TO_BERRY(ITEM_FIGY_BERRY)] = {TYPE_BUG, 80}, + [ITEM_TO_BERRY(ITEM_WIKI_BERRY)] = {TYPE_ROCK, 80}, + [ITEM_TO_BERRY(ITEM_MAGO_BERRY)] = {TYPE_GHOST, 80}, + [ITEM_TO_BERRY(ITEM_AGUAV_BERRY)] = {TYPE_DRAGON, 80}, + [ITEM_TO_BERRY(ITEM_IAPAPA_BERRY)] = {TYPE_DARK, 80}, + [ITEM_TO_BERRY(ITEM_RAZZ_BERRY)] = {TYPE_STEEL, 80}, + [ITEM_TO_BERRY(ITEM_OCCA_BERRY)] = {TYPE_FIRE, 80}, + [ITEM_TO_BERRY(ITEM_PASSHO_BERRY)] = {TYPE_WATER, 80}, + [ITEM_TO_BERRY(ITEM_WACAN_BERRY)] = {TYPE_ELECTRIC, 80}, + [ITEM_TO_BERRY(ITEM_RINDO_BERRY)] = {TYPE_GRASS, 80}, + [ITEM_TO_BERRY(ITEM_YACHE_BERRY)] = {TYPE_ICE, 80}, + [ITEM_TO_BERRY(ITEM_CHOPLE_BERRY)] = {TYPE_FIGHTING, 80}, + [ITEM_TO_BERRY(ITEM_KEBIA_BERRY)] = {TYPE_POISON, 80}, + [ITEM_TO_BERRY(ITEM_SHUCA_BERRY)] = {TYPE_GROUND, 80}, + [ITEM_TO_BERRY(ITEM_COBA_BERRY)] = {TYPE_FLYING, 80}, + [ITEM_TO_BERRY(ITEM_PAYAPA_BERRY)] = {TYPE_PSYCHIC, 80}, + [ITEM_TO_BERRY(ITEM_TANGA_BERRY)] = {TYPE_BUG, 80}, + [ITEM_TO_BERRY(ITEM_CHARTI_BERRY)] = {TYPE_ROCK, 80}, + [ITEM_TO_BERRY(ITEM_KASIB_BERRY)] = {TYPE_GHOST, 80}, + [ITEM_TO_BERRY(ITEM_HABAN_BERRY)] = {TYPE_DRAGON, 80}, + [ITEM_TO_BERRY(ITEM_COLBUR_BERRY)] = {TYPE_DARK, 80}, + [ITEM_TO_BERRY(ITEM_BABIRI_BERRY)] = {TYPE_STEEL, 80}, + [ITEM_TO_BERRY(ITEM_CHILAN_BERRY)] = {TYPE_NORMAL, 80}, + [ITEM_TO_BERRY(ITEM_ROSELI_BERRY)] = {TYPE_FAIRY, 80}, + [ITEM_TO_BERRY(ITEM_BLUK_BERRY)] = {TYPE_FIRE, 90}, + [ITEM_TO_BERRY(ITEM_NANAB_BERRY)] = {TYPE_WATER, 90}, + [ITEM_TO_BERRY(ITEM_WEPEAR_BERRY)] = {TYPE_ELECTRIC, 90}, + [ITEM_TO_BERRY(ITEM_PINAP_BERRY)] = {TYPE_GRASS, 90}, + [ITEM_TO_BERRY(ITEM_POMEG_BERRY)] = {TYPE_ICE, 90}, + [ITEM_TO_BERRY(ITEM_KELPSY_BERRY)] = {TYPE_FIGHTING, 90}, + [ITEM_TO_BERRY(ITEM_QUALOT_BERRY)] = {TYPE_POISON, 90}, + [ITEM_TO_BERRY(ITEM_HONDEW_BERRY)] = {TYPE_GROUND, 90}, + [ITEM_TO_BERRY(ITEM_GREPA_BERRY)] = {TYPE_FLYING, 90}, + [ITEM_TO_BERRY(ITEM_TAMATO_BERRY)] = {TYPE_PSYCHIC, 90}, + [ITEM_TO_BERRY(ITEM_CORNN_BERRY)] = {TYPE_BUG, 90}, + [ITEM_TO_BERRY(ITEM_MAGOST_BERRY)] = {TYPE_ROCK, 90}, + [ITEM_TO_BERRY(ITEM_RABUTA_BERRY)] = {TYPE_GHOST, 90}, + [ITEM_TO_BERRY(ITEM_NOMEL_BERRY)] = {TYPE_DRAGON, 90}, + [ITEM_TO_BERRY(ITEM_SPELON_BERRY)] = {TYPE_DARK, 90}, + [ITEM_TO_BERRY(ITEM_PAMTRE_BERRY)] = {TYPE_STEEL, 90}, + [ITEM_TO_BERRY(ITEM_WATMEL_BERRY)] = {TYPE_FIRE, 100}, + [ITEM_TO_BERRY(ITEM_DURIN_BERRY)] = {TYPE_WATER, 100}, + [ITEM_TO_BERRY(ITEM_BELUE_BERRY)] = {TYPE_ELECTRIC, 100}, + [ITEM_TO_BERRY(ITEM_LIECHI_BERRY)] = {TYPE_GRASS, 100}, + [ITEM_TO_BERRY(ITEM_GANLON_BERRY)] = {TYPE_ICE, 100}, + [ITEM_TO_BERRY(ITEM_SALAC_BERRY)] = {TYPE_FIGHTING, 100}, + [ITEM_TO_BERRY(ITEM_PETAYA_BERRY)] = {TYPE_POISON, 100}, + [ITEM_TO_BERRY(ITEM_APICOT_BERRY)] = {TYPE_GROUND, 100}, + [ITEM_TO_BERRY(ITEM_LANSAT_BERRY)] = {TYPE_FLYING, 100}, + [ITEM_TO_BERRY(ITEM_STARF_BERRY)] = {TYPE_PSYCHIC, 100}, + [ITEM_TO_BERRY(ITEM_ENIGMA_BERRY)] = {TYPE_BUG, 100}, + [ITEM_TO_BERRY(ITEM_MICLE_BERRY)] = {TYPE_ROCK, 100}, + [ITEM_TO_BERRY(ITEM_CUSTAP_BERRY)] = {TYPE_GHOST, 100}, + [ITEM_TO_BERRY(ITEM_JABOCA_BERRY)] = {TYPE_DRAGON, 100}, + [ITEM_TO_BERRY(ITEM_ROWAP_BERRY)] = {TYPE_DARK, 100}, + [ITEM_TO_BERRY(ITEM_KEE_BERRY)] = {TYPE_FAIRY, 100}, + [ITEM_TO_BERRY(ITEM_MARANGA_BERRY)] = {TYPE_DARK, 100}, +}; + +u32 CalcRolloutBasePower(u32 battlerAtk, u32 basePower, u32 rolloutTimer) +{ + u32 i; + for (i = 1; i < (5 - rolloutTimer); i++) + basePower *= 2; + if (gBattleMons[battlerAtk].status2 & STATUS2_DEFENSE_CURL) + basePower *= 2; + return basePower; +} + +u32 CalcFuryCutterBasePower(u32 basePower, u32 furyCutterCounter) +{ + u32 i; + for (i = 1; i < furyCutterCounter; i++) + basePower *= 2; + return basePower; +} + +// base damage formula before adding any modifiers +static inline s32 CalculateBaseDamage(u32 power, u32 userFinalAttack, u32 level, u32 targetFinalDefense) +{ + return power * userFinalAttack * (2 * level / 5 + 2) / targetFinalDefense / 50 + 2; +} + +static inline uq4_12_t GetTargetDamageModifier(u32 move, u32 battlerAtk, u32 battlerDef) +{ + if (GetMoveTargetCount(move, battlerAtk, battlerDef) >= 2) + return B_MULTIPLE_TARGETS_DMG >= GEN_4 ? UQ_4_12(0.75) : UQ_4_12(0.5); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetParentalBondModifier(u32 battlerAtk) +{ + if (gSpecialStatuses[battlerAtk].parentalBondState != PARENTAL_BOND_2ND_HIT) + return UQ_4_12(1.0); + return B_PARENTAL_BOND_DMG >= GEN_7 ? UQ_4_12(0.25) : UQ_4_12(0.5); +} + +static inline uq4_12_t GetSameTypeAttackBonusModifier(u32 battlerAtk, u32 moveType, u32 move, u32 abilityAtk) +{ + if (gBattleStruct->pledgeMove && IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerAtk), moveType)) + return (abilityAtk == ABILITY_ADAPTABILITY) ? UQ_4_12(2.0) : UQ_4_12(1.5); + else if (!IS_BATTLER_OF_TYPE(battlerAtk, moveType) || move == MOVE_STRUGGLE || move == MOVE_NONE) + return UQ_4_12(1.0); + return (abilityAtk == ABILITY_ADAPTABILITY) ? UQ_4_12(2.0) : UQ_4_12(1.5); +} + +// Utility Umbrella holders take normal damage from what would be rain- and sun-weakened attacks. +static uq4_12_t GetWeatherDamageModifier(u32 battlerAtk, u32 move, u32 moveType, u32 holdEffectAtk, u32 holdEffectDef, u32 weather) +{ + if (weather == B_WEATHER_NONE) + return UQ_4_12(1.0); + if (gMovesInfo[move].effect == EFFECT_HYDRO_STEAM && (weather & B_WEATHER_SUN) && holdEffectAtk != HOLD_EFFECT_UTILITY_UMBRELLA) + return UQ_4_12(1.5); + if (holdEffectDef == HOLD_EFFECT_UTILITY_UMBRELLA) + return UQ_4_12(1.0); + + if (weather & B_WEATHER_RAIN) + { + if (moveType != TYPE_FIRE && moveType != TYPE_WATER) + return UQ_4_12(1.0); + return (moveType == TYPE_FIRE) ? UQ_4_12(0.5) : UQ_4_12(1.5); + } + if (weather & B_WEATHER_SUN) + { + if (moveType != TYPE_FIRE && moveType != TYPE_WATER) + return UQ_4_12(1.0); + return (moveType == TYPE_WATER) ? UQ_4_12(0.5) : UQ_4_12(1.5); + } + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetBurnOrFrostBiteModifier(u32 battlerAtk, u32 move, u32 abilityAtk) +{ + if (gBattleMons[battlerAtk].status1 & STATUS1_BURN + && IS_MOVE_PHYSICAL(move) + && (B_BURN_FACADE_DMG < GEN_6 || gMovesInfo[move].effect != EFFECT_FACADE) + && abilityAtk != ABILITY_GUTS) + return UQ_4_12(0.5); + if (gBattleMons[battlerAtk].status1 & STATUS1_FROSTBITE + && IS_MOVE_SPECIAL(move) + && (B_BURN_FACADE_DMG < GEN_6 || gMovesInfo[move].effect != EFFECT_FACADE)) + return UQ_4_12(0.5); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetCriticalModifier(bool32 isCrit) +{ + if (isCrit) + return B_CRIT_MULTIPLIER >= GEN_6 ? UQ_4_12(1.5) : UQ_4_12(2.0); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetGlaiveRushModifier(u32 battlerDef) +{ + if (gStatuses4[battlerDef] & STATUS4_GLAIVE_RUSH) + return UQ_4_12(2.0); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetZMaxMoveAgainstProtectionModifier(u32 battlerDef, u32 move) +{ + // TODO: Dynamax/Z-Moves + // if ((gBattleStruct->zmove.active || IsMaxMove(move)) && IS_BATTLER_PROTECTED(battlerDef)) + // return UQ_4_12(0.25); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetMinimizeModifier(u32 move, u32 battlerDef) +{ + if (gMovesInfo[move].minimizeDoubleDamage && gStatuses3[battlerDef] & STATUS3_MINIMIZED) + return UQ_4_12(2.0); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetUndergroundModifier(u32 move, u32 battlerDef) +{ + if (gMovesInfo[move].damagesUnderground && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) + return UQ_4_12(2.0); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetDiveModifier(u32 move, u32 battlerDef) +{ + if (gMovesInfo[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER) + return UQ_4_12(2.0); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetAirborneModifier(u32 move, u32 battlerDef) +{ + if (gMovesInfo[move].damagesAirborneDoubleDamage && gStatuses3[battlerDef] & STATUS3_ON_AIR) + return UQ_4_12(2.0); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetScreensModifier(u32 move, u32 battlerAtk, u32 battlerDef, bool32 isCrit, u32 abilityAtk) +{ + u32 sideStatus = gSideStatuses[GetBattlerSide(battlerDef)]; + bool32 lightScreen = (sideStatus & SIDE_STATUS_LIGHTSCREEN) && IS_MOVE_SPECIAL(move); + bool32 reflect = (sideStatus & SIDE_STATUS_REFLECT) && IS_MOVE_PHYSICAL(move); + bool32 auroraVeil = sideStatus & SIDE_STATUS_AURORA_VEIL; + + if (isCrit || abilityAtk == ABILITY_INFILTRATOR || gProtectStructs[battlerAtk].confusionSelfDmg) + return UQ_4_12(1.0); + if (reflect || lightScreen || auroraVeil) + return (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) ? UQ_4_12(0.667) : UQ_4_12(0.5); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetCollisionCourseElectroDriftModifier(u32 move, uq4_12_t typeEffectivenessModifier) +{ + if (gMovesInfo[move].effect == EFFECT_COLLISION_COURSE && typeEffectivenessModifier >= UQ_4_12(2.0)) + return UQ_4_12(1.3333); + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetAttackerAbilitiesModifier(u32 battlerAtk, uq4_12_t typeEffectivenessModifier, bool32 isCrit, u32 abilityAtk) +{ + switch (abilityAtk) + { + case ABILITY_NEUROFORCE: + if (typeEffectivenessModifier >= UQ_4_12(2.0)) + return UQ_4_12(1.25); + break; + case ABILITY_SNIPER: + if (isCrit) + return UQ_4_12(1.5); + break; + case ABILITY_TINTED_LENS: + if (typeEffectivenessModifier <= UQ_4_12(0.5)) + return UQ_4_12(2.0); + break; + } + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetDefenderAbilitiesModifier(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, uq4_12_t typeEffectivenessModifier, u32 abilityDef) +{ + switch (abilityDef) + { + case ABILITY_MULTISCALE: + case ABILITY_SHADOW_SHIELD: + if (BATTLER_MAX_HP(battlerDef)) + return UQ_4_12(0.5); + break; + case ABILITY_FILTER: + case ABILITY_SOLID_ROCK: + case ABILITY_PRISM_ARMOR: + if (typeEffectivenessModifier >= UQ_4_12(2.0)) + return UQ_4_12(0.75); + break; + case ABILITY_FLUFFY: + if (!IsMoveMakingContact(move, battlerAtk) && moveType == TYPE_FIRE) + return UQ_4_12(2.0); + if (IsMoveMakingContact(move, battlerAtk) && moveType != TYPE_FIRE) + return UQ_4_12(0.5); + break; + case ABILITY_PUNK_ROCK: + if (gMovesInfo[move].soundMove) + return UQ_4_12(0.5); + break; + case ABILITY_ICE_SCALES: + if (IS_MOVE_SPECIAL(move)) + return UQ_4_12(0.5); + break; + } + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetDefenderPartnerAbilitiesModifier(u32 battlerPartnerDef) +{ + if (!IsBattlerAlive(battlerPartnerDef)) + return UQ_4_12(1.0); + + switch (GetBattlerAbility(battlerPartnerDef)) + { + case ABILITY_FRIEND_GUARD: + return UQ_4_12(0.75); + break; + } + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetAttackerItemsModifier(u32 battlerAtk, uq4_12_t typeEffectivenessModifier, u32 holdEffectAtk) +{ + u32 percentBoost; + switch (holdEffectAtk) + { + case HOLD_EFFECT_METRONOME: + percentBoost = min((gBattleStruct->sameMoveTurns[battlerAtk] * GetBattlerHoldEffectParam(battlerAtk)), 100); + return uq4_12_add(sPercentToModifier[percentBoost], UQ_4_12(1.0)); + break; + case HOLD_EFFECT_EXPERT_BELT: + if (typeEffectivenessModifier >= UQ_4_12(2.0)) + return UQ_4_12(1.2); + break; + case HOLD_EFFECT_LIFE_ORB: + return UQ_4_12(1.3); + break; + } + return UQ_4_12(1.0); +} + +static inline uq4_12_t GetDefenderItemsModifier(u32 moveType, u32 battlerDef, uq4_12_t typeEffectivenessModifier, bool32 updateFlags, u32 abilityDef, u32 holdEffectDef) +{ + u32 holdEffectDefParam = GetBattlerHoldEffectParam(battlerDef); + u32 itemDef = gBattleMons[battlerDef].item; + + switch (holdEffectDef) + { + case HOLD_EFFECT_RESIST_BERRY: + if (UnnerveOn(battlerDef, itemDef)) + return UQ_4_12(1.0); + if (moveType == holdEffectDefParam && (moveType == TYPE_NORMAL || typeEffectivenessModifier >= UQ_4_12(2.0))) + { + if (updateFlags) + gSpecialStatuses[battlerDef].berryReduced = TRUE; + return (abilityDef == ABILITY_RIPEN) ? UQ_4_12(0.25) : UQ_4_12(0.5); + } + break; + } + return UQ_4_12(1.0); +} + +#define DAMAGE_MULTIPLY_MODIFIER(modifier) do { \ + finalModifier = uq4_12_multiply_half_down(modifier, finalModifier); \ +} while (0) + +// Calculates the "other" modifier which accounts for held items, abilities, +// or very specific interactions of moves that are not handled in the basic +// damage calculation. It is implemented as described by bulbapedia: +// https://bulbapedia.bulbagarden.net/wiki/Damage#Generation_V_onward +// Please Note: Fixed Point Multiplication is not associative. +// The order of operations is relevant. +static inline uq4_12_t GetOtherModifiers(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, bool32 isCrit, uq4_12_t typeEffectivenessModifier, bool32 updateFlags, + u32 abilityAtk, u32 abilityDef, u32 holdEffectAtk, u32 holdEffectDef) +{ + uq4_12_t finalModifier = UQ_4_12(1.0); + u32 battlerDefPartner = BATTLE_PARTNER(battlerDef); + u32 unmodifiedAttackerSpeed = gBattleMons[battlerAtk].speed; + u32 unmodifiedDefenderSpeed = gBattleMons[battlerDef].speed; + //TODO: Behemoth Blade, Behemoth Bash, Dynamax Cannon (Dynamax) + DAMAGE_MULTIPLY_MODIFIER(GetMinimizeModifier(move, battlerDef)); + DAMAGE_MULTIPLY_MODIFIER(GetUndergroundModifier(move, battlerDef)); + DAMAGE_MULTIPLY_MODIFIER(GetDiveModifier(move, battlerDef)); + DAMAGE_MULTIPLY_MODIFIER(GetAirborneModifier(move, battlerDef)); + DAMAGE_MULTIPLY_MODIFIER(GetScreensModifier(move, battlerAtk, battlerDef, isCrit, abilityAtk)); + DAMAGE_MULTIPLY_MODIFIER(GetCollisionCourseElectroDriftModifier(move, typeEffectivenessModifier)); + + if (unmodifiedAttackerSpeed >= unmodifiedDefenderSpeed) + { + DAMAGE_MULTIPLY_MODIFIER(GetAttackerAbilitiesModifier(battlerAtk, typeEffectivenessModifier, isCrit, abilityAtk)); + DAMAGE_MULTIPLY_MODIFIER(GetDefenderAbilitiesModifier(move, moveType, battlerAtk, battlerDef, typeEffectivenessModifier, abilityDef)); + DAMAGE_MULTIPLY_MODIFIER(GetDefenderPartnerAbilitiesModifier(battlerDefPartner)); + DAMAGE_MULTIPLY_MODIFIER(GetAttackerItemsModifier(battlerAtk, typeEffectivenessModifier, holdEffectAtk)); + DAMAGE_MULTIPLY_MODIFIER(GetDefenderItemsModifier(moveType, battlerDef, typeEffectivenessModifier, updateFlags, abilityDef, holdEffectDef)); + } + else + { + DAMAGE_MULTIPLY_MODIFIER(GetDefenderAbilitiesModifier(move, moveType, battlerAtk, battlerDef, typeEffectivenessModifier, abilityDef)); + DAMAGE_MULTIPLY_MODIFIER(GetDefenderPartnerAbilitiesModifier(battlerDefPartner)); + DAMAGE_MULTIPLY_MODIFIER(GetAttackerAbilitiesModifier(battlerAtk, typeEffectivenessModifier, isCrit, abilityAtk)); + DAMAGE_MULTIPLY_MODIFIER(GetDefenderItemsModifier(moveType, battlerDef, typeEffectivenessModifier, updateFlags, abilityDef, holdEffectDef)); + DAMAGE_MULTIPLY_MODIFIER(GetAttackerItemsModifier(battlerAtk, typeEffectivenessModifier, holdEffectAtk)); + } + return finalModifier; +} + +#undef DAMAGE_MULTIPLY_MODIFIER + +static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u32 abilityDef, u32 weather) +{ + u32 i; + u32 basePower = gMovesInfo[move].power; + u32 weight, hpFraction, speed; + + // TODO: Z-Moves + // if (gBattleStruct->zmove.active) + // return GetZMovePower(gBattleStruct->zmove.baseMoves[battlerAtk]); + + switch (gMovesInfo[move].effect) + { + case EFFECT_PLEDGE: + if (gBattleStruct->pledgeMove) + basePower = 150; + break; + case EFFECT_FLING: + basePower = GetFlingPowerFromItemId(gBattleMons[battlerAtk].item); + break; + case EFFECT_ERUPTION: + basePower = gBattleMons[battlerAtk].hp * basePower / gBattleMons[battlerAtk].maxHP; + break; + case EFFECT_FLAIL: + hpFraction = GetScaledHPFraction(gBattleMons[battlerAtk].hp, gBattleMons[battlerAtk].maxHP, 48); + for (i = 0; i < sizeof(sFlailHpScaleToPowerTable); i += 2) + { + if (hpFraction <= sFlailHpScaleToPowerTable[i]) + break; + } + basePower = sFlailHpScaleToPowerTable[i + 1]; + break; + case EFFECT_RETURN: + basePower = 10 * (gBattleMons[battlerAtk].friendship) / 25; + break; + case EFFECT_FRUSTRATION: + basePower = 10 * (MAX_FRIENDSHIP - gBattleMons[battlerAtk].friendship) / 25; + break; + case EFFECT_FURY_CUTTER: + basePower = CalcFuryCutterBasePower(basePower, gDisableStructs[battlerAtk].furyCutterCounter); + break; + case EFFECT_ROLLOUT: + basePower = CalcRolloutBasePower(battlerAtk, basePower, gDisableStructs[battlerAtk].rolloutTimer); + break; + case EFFECT_MAGNITUDE: + basePower = gBattleStruct->magnitudeBasePower; + break; + case EFFECT_PRESENT: + basePower = gBattleStruct->presentBasePower; + break; + case EFFECT_TRIPLE_KICK: + if (gMultiHitCounter == 0) // Calc damage with max BP for move consideration + basePower *= 6; + else + basePower *= (4 - gMultiHitCounter); + break; + case EFFECT_SPIT_UP: + basePower = 100 * gDisableStructs[battlerAtk].stockpileCounter; + break; + case EFFECT_REVENGE: + if ((gProtectStructs[battlerAtk].physicalDmg + && gProtectStructs[battlerAtk].physicalBattlerId == battlerDef) + || (gProtectStructs[battlerAtk].specialDmg + && gProtectStructs[battlerAtk].specialBattlerId == battlerDef)) + basePower *= 2; + break; + case EFFECT_WEATHER_BALL: + if (weather & B_WEATHER_ANY) + basePower *= 2; + break; + case EFFECT_PURSUIT: + if (gActionsByTurnOrder[GetBattlerTurnOrderNum(battlerDef)] == B_ACTION_SWITCH) + basePower *= 2; + break; + case EFFECT_NATURAL_GIFT: + basePower = gNaturalGiftTable[ITEM_TO_BERRY(gBattleMons[battlerAtk].item)].power; + break; + case EFFECT_DOUBLE_POWER_ON_ARG_STATUS: + // Comatose targets treated as if asleep + if ((gBattleMons[battlerDef].status1 | (STATUS1_SLEEP * (abilityDef == ABILITY_COMATOSE))) & gMovesInfo[move].argument) + basePower *= 2; + break; + case EFFECT_VARY_POWER_BASED_ON_HP: + basePower = gMovesInfo[move].argument * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP; + break; + case EFFECT_ASSURANCE: + if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg) + basePower *= 2; + break; + case EFFECT_TRUMP_CARD: + i = GetMoveSlot(gBattleMons[battlerAtk].moves, move); + if (i != MAX_MON_MOVES) + { + if (gBattleMons[battlerAtk].pp[i] >= ARRAY_COUNT(sTrumpCardPowerTable)) + basePower = sTrumpCardPowerTable[ARRAY_COUNT(sTrumpCardPowerTable) - 1]; + else + basePower = sTrumpCardPowerTable[gBattleMons[battlerAtk].pp[i]]; + } + break; + case EFFECT_ACROBATICS: + if (gBattleMons[battlerAtk].item == ITEM_NONE + // Edge case, because removal of items happens after damage calculation. + || (gSpecialStatuses[battlerAtk].gemBoost && GetBattlerHoldEffect(battlerAtk, FALSE) == HOLD_EFFECT_GEMS)) + basePower *= 2; + break; + case EFFECT_LOW_KICK: + weight = GetBattlerWeight(battlerDef); + for (i = 0; sWeightToDamageTable[i] != 0xFFFF; i += 2) + { + if (sWeightToDamageTable[i] > weight) + break; + } + if (sWeightToDamageTable[i] != 0xFFFF) + basePower = sWeightToDamageTable[i + 1]; + else + basePower = 120; + break; + case EFFECT_HEAT_CRASH: + weight = GetBattlerWeight(battlerAtk) / GetBattlerWeight(battlerDef); + if (weight >= ARRAY_COUNT(sHeatCrashPowerTable)) + basePower = sHeatCrashPowerTable[ARRAY_COUNT(sHeatCrashPowerTable) - 1]; + else + basePower = sHeatCrashPowerTable[weight]; + break; + case EFFECT_PUNISHMENT: + basePower = 60 + (CountBattlerStatIncreases(battlerDef, FALSE) * 20); + if (basePower > 200) + basePower = 200; + break; + case EFFECT_STORED_POWER: + basePower += (CountBattlerStatIncreases(battlerAtk, TRUE) * 20); + break; + case EFFECT_ELECTRO_BALL: + speed = GetBattlerTotalSpeedStat(battlerAtk) / GetBattlerTotalSpeedStat(battlerDef); + if (speed >= ARRAY_COUNT(sSpeedDiffPowerTable)) + speed = ARRAY_COUNT(sSpeedDiffPowerTable) - 1; + basePower = sSpeedDiffPowerTable[speed]; + break; + case EFFECT_GYRO_BALL: + basePower = ((25 * GetBattlerTotalSpeedStat(battlerDef)) / GetBattlerTotalSpeedStat(battlerAtk)) + 1; + if (basePower > 150) + basePower = 150; + break; + case EFFECT_ECHOED_VOICE: + // gBattleStruct->sameMoveTurns incremented in ppreduce + if (gBattleStruct->sameMoveTurns[battlerAtk] != 0) + { + basePower += (basePower * gBattleStruct->sameMoveTurns[battlerAtk]); + if (basePower > 200) + basePower = 200; + } + break; + case EFFECT_PAYBACK: + if (GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef) + && (B_PAYBACK_SWITCH_BOOST < GEN_5 || gDisableStructs[battlerDef].isFirstTurn != 2)) + basePower *= 2; + break; + case EFFECT_BOLT_BEAK: + if (GetBattlerTurnOrderNum(battlerAtk) < GetBattlerTurnOrderNum(battlerDef) + || gDisableStructs[battlerDef].isFirstTurn == 2) + basePower *= 2; + break; + case EFFECT_ROUND: + for (i = 0; i < gBattlersCount; i++) + { + if (i != battlerAtk && IsBattlerAlive(i) && gLastMoves[i] == MOVE_ROUND) + { + basePower *= 2; + break; + } + } + break; + case EFFECT_FUSION_COMBO: + if (gMovesInfo[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) + basePower *= 2; + break; + case EFFECT_LASH_OUT: + if (gProtectStructs[battlerAtk].statFell) + basePower *= 2; + break; + case EFFECT_EXPLOSION: + if (move == MOVE_MISTY_EXPLOSION && gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && IsBattlerGrounded(battlerAtk)) + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); + break; + case EFFECT_DYNAMAX_DOUBLE_DMG: + // TODO: Dynamax + // if (IsDynamaxed(battlerDef)) + // basePower *= 2; + break; + case EFFECT_HIDDEN_POWER: + { + if (B_HIDDEN_POWER_DMG < GEN_6) + { + u8 powerBits = ((gBattleMons[battlerAtk].hpIV & 2) >> 1) + | ((gBattleMons[battlerAtk].attackIV & 2) << 0) + | ((gBattleMons[battlerAtk].defenseIV & 2) << 1) + | ((gBattleMons[battlerAtk].speedIV & 2) << 2) + | ((gBattleMons[battlerAtk].spAttackIV & 2) << 3) + | ((gBattleMons[battlerAtk].spDefenseIV & 2) << 4); + + basePower = (40 * powerBits) / 63 + 30; + } + break; + } + case EFFECT_GRAV_APPLE: + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); + break; + case EFFECT_TERRAIN_PULSE: + if ((gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + && IsBattlerGrounded(battlerAtk)) + basePower *= 2; + break; + case EFFECT_EXPANDING_FORCE: + if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_PSYCHIC_TERRAIN)) + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); + break; + case EFFECT_RISING_VOLTAGE: + if (IsBattlerTerrainAffected(battlerDef, STATUS_FIELD_ELECTRIC_TERRAIN)) + basePower *= 2; + break; + case EFFECT_BEAT_UP: + if (B_BEAT_UP >= GEN_5) + basePower = CalcBeatUpPower(); + break; + case EFFECT_PSYBLADE: + if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_ELECTRIC_TERRAIN)) + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); + break; + case EFFECT_MAX_MOVE: + // TODO: Dynamax + // basePower = GetMaxMovePower(gBattleMons[battlerAtk].moves[gBattleStruct->chosenMovePositions[battlerAtk]]); + break; + case EFFECT_RAGE_FIST: + basePower += 50 * gBattleStruct->timesGotHit[GetBattlerSide(battlerAtk)][gBattlerPartyIndexes[battlerAtk]]; + basePower = (basePower > 350) ? 350 : basePower; + break; + case EFFECT_FICKLE_BEAM: + if (RandomPercentage(RNG_FICKLE_BEAM, 30)) + basePower *= 2; + break; + case EFFECT_LAST_RESPECTS: + basePower += (basePower * min(100, GetBattlerSideFaintCounter(battlerAtk))); + break; + } + + // Move-specific base power changes + switch (move) + { + case MOVE_WATER_SHURIKEN: + if (gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH) + basePower = 20; + break; + } + + if (basePower == 0) + basePower = 1; + return basePower; +} + +static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, bool32 updateFlags, u32 atkAbility, u32 defAbility, u32 holdEffectAtk, u32 weather) +{ + u32 i; + u32 holdEffectParamAtk; + u32 basePower = CalcMoveBasePower(move, battlerAtk, battlerDef, defAbility, weather); + uq4_12_t holdEffectModifier; + uq4_12_t modifier = UQ_4_12(1.0); + u32 atkSide = GetBattlerSide(battlerAtk); + + // move effect + switch (gMovesInfo[move].effect) + { + case EFFECT_FACADE: + if (gBattleMons[battlerAtk].status1 & (STATUS1_BURN | STATUS1_PSN_ANY | STATUS1_PARALYSIS | STATUS1_FROSTBITE)) + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); + break; + case EFFECT_BRINE: + if (gBattleMons[battlerDef].hp <= (gBattleMons[battlerDef].maxHP / 2)) + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); + break; + case EFFECT_RETALIATE: + if (gSideTimers[atkSide].retaliateTimer == 1) + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); + break; + case EFFECT_SOLAR_BEAM: + if (IsBattlerWeatherAffected(battlerAtk, (B_WEATHER_HAIL | B_WEATHER_SANDSTORM | B_WEATHER_RAIN | B_WEATHER_SNOW))) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); + break; + case EFFECT_STOMPING_TANTRUM: + if (gBattleStruct->lastMoveFailed & gBitTable[battlerAtk]) + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); + break; + case EFFECT_BULLDOZE: + case EFFECT_MAGNITUDE: + case EFFECT_EARTHQUAKE: + if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE)) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); + break; + case EFFECT_KNOCK_OFF: + if (B_KNOCK_OFF_DMG >= GEN_6 + && gBattleMons[battlerDef].item != ITEM_NONE + && CanBattlerGetOrLoseItem(battlerDef, gBattleMons[battlerDef].item)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + } + + // various effects + if (gProtectStructs[battlerAtk].helpingHand) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + if (gSpecialStatuses[battlerAtk].gemBoost) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.0) + sPercentToModifier[gSpecialStatuses[battlerAtk].gemParam]); + if (gStatuses3[battlerAtk] & STATUS3_CHARGED_UP && moveType == TYPE_ELECTRIC) + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); + if (gStatuses3[battlerAtk] & STATUS3_ME_FIRST) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_GRASSY_TERRAIN) && moveType == TYPE_GRASS) + modifier = uq4_12_multiply(modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8 ? UQ_4_12(1.3) : UQ_4_12(1.5))); + if (IsBattlerTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN) && moveType == TYPE_DRAGON) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); + if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_ELECTRIC_TERRAIN) && moveType == TYPE_ELECTRIC) + modifier = uq4_12_multiply(modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8 ? UQ_4_12(1.3) : UQ_4_12(1.5))); + if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_PSYCHIC_TERRAIN) && moveType == TYPE_PSYCHIC) + modifier = uq4_12_multiply(modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8 ? UQ_4_12(1.3) : UQ_4_12(1.5))); + if (moveType == TYPE_ELECTRIC && ((gFieldStatuses & STATUS_FIELD_MUDSPORT) + || AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, ABILITYEFFECT_MUD_SPORT, 0))) + modifier = uq4_12_multiply(modifier, UQ_4_12(B_SPORT_DMG_REDUCTION >= GEN_5 ? 0.23 : 0.5)); + if (moveType == TYPE_FIRE && ((gFieldStatuses & STATUS_FIELD_WATERSPORT) + || AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, ABILITYEFFECT_WATER_SPORT, 0))) + modifier = uq4_12_multiply(modifier, UQ_4_12(B_SPORT_DMG_REDUCTION >= GEN_5 ? 0.23 : 0.5)); + + // attacker's abilities + switch (atkAbility) + { + case ABILITY_TECHNICIAN: + if (basePower <= 60) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_FLARE_BOOST: + if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_TOXIC_BOOST: + if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_RECKLESS: + if (IS_MOVE_RECOIL(move)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_IRON_FIST: + if (gMovesInfo[move].punchingMove) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_SHEER_FORCE: + if (MoveIsAffectedBySheerForce(move)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_SAND_FORCE: + if ((moveType == TYPE_STEEL || moveType == TYPE_ROCK || moveType == TYPE_GROUND) + && weather & B_WEATHER_SANDSTORM) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_RIVALRY: + if (AreBattlersOfSameGender(battlerAtk, battlerDef)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.25)); + else if (AreBattlersOfOppositeGender(battlerAtk, battlerDef)) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.75)); + break; + case ABILITY_ANALYTIC: + if (GetBattlerTurnOrderNum(battlerAtk) == gBattlersCount - 1 && move != MOVE_FUTURE_SIGHT && move != MOVE_DOOM_DESIRE) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_TOUGH_CLAWS: + if (IsMoveMakingContact(move, battlerAtk)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_STRONG_JAW: + if (gMovesInfo[move].bitingMove) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_MEGA_LAUNCHER: + if (gMovesInfo[move].pulseMove) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_WATER_BUBBLE: + if (moveType == TYPE_WATER) + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); + break; + case ABILITY_STEELWORKER: + if (moveType == TYPE_STEEL) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_PIXILATE: + if (moveType == TYPE_FAIRY && gBattleStruct->ateBoost[battlerAtk]) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_GALVANIZE: + if (moveType == TYPE_ELECTRIC && gBattleStruct->ateBoost[battlerAtk]) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_REFRIGERATE: + if (moveType == TYPE_ICE && gBattleStruct->ateBoost[battlerAtk]) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_AERILATE: + if (moveType == TYPE_FLYING && gBattleStruct->ateBoost[battlerAtk]) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_NORMALIZE: + if (moveType == TYPE_NORMAL && gBattleStruct->ateBoost[battlerAtk]) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; + case ABILITY_PUNK_ROCK: + if (gMovesInfo[move].soundMove) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_STEELY_SPIRIT: + if (moveType == TYPE_STEEL) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_TRANSISTOR: + if (moveType == TYPE_ELECTRIC) + { + if (B_TRANSISTOR_BOOST >= GEN_9) + modifier = uq4_12_multiply(modifier, UQ_4_12(5325 / 4096)); + else + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + } + break; + case ABILITY_DRAGONS_MAW: + if (moveType == TYPE_DRAGON) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_GORILLA_TACTICS: + if (IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_ROCKY_PAYLOAD: + if (moveType == TYPE_ROCK) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_PROTOSYNTHESIS: + { + u8 atkHighestStat = GetHighestStatId(battlerAtk); + if (weather & B_WEATHER_SUN + && ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + } + break; + case ABILITY_QUARK_DRIVE: + { + u8 atkHighestStat = GetHighestStatId(battlerAtk); + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN + && ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + } + break; + case ABILITY_ORICHALCUM_PULSE: + if (weather & B_WEATHER_SUN) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_HADRON_ENGINE: + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_SHARPNESS: + if (gMovesInfo[move].slicingMove) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + case ABILITY_SUPREME_OVERLORD: + modifier = uq4_12_multiply(modifier, GetSupremeOverlordModifier(battlerAtk)); + break; + } + + // field abilities + if ((IsAbilityOnField(ABILITY_DARK_AURA) && moveType == TYPE_DARK) + || (IsAbilityOnField(ABILITY_FAIRY_AURA) && moveType == TYPE_FAIRY)) + { + if (IsAbilityOnField(ABILITY_AURA_BREAK)) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.75)); + else + modifier = uq4_12_multiply(modifier, UQ_4_12(1.33)); + } + + // attacker partner's abilities + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + { + switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) + { + case ABILITY_BATTERY: + if (IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_POWER_SPOT: + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); + break; + case ABILITY_STEELY_SPIRIT: + if (moveType == TYPE_STEEL) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + break; + } + } + + // target's abilities + switch (defAbility) + { + case ABILITY_HEATPROOF: + case ABILITY_WATER_BUBBLE: + if (moveType == TYPE_FIRE) + { + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); + if (updateFlags) + RecordAbilityBattle(battlerDef, defAbility); + } + break; + case ABILITY_DRY_SKIN: + if (moveType == TYPE_FIRE) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.25)); + break; + case ABILITY_PROTOSYNTHESIS: + { + u8 defHighestStat = GetHighestStatId(battlerDef); + if (weather & B_WEATHER_SUN + && ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF))) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.7)); + } + break; + case ABILITY_QUARK_DRIVE: + { + u8 defHighestStat = GetHighestStatId(battlerDef); + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN + && ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF))) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.7)); + } + break; + } + + holdEffectParamAtk = GetBattlerHoldEffectParam(battlerAtk); + if (holdEffectParamAtk > 100) + holdEffectParamAtk = 100; + + holdEffectModifier = UQ_4_12(1.0) + sPercentToModifier[holdEffectParamAtk]; + + // attacker's hold effect + switch (holdEffectAtk) + { + case HOLD_EFFECT_MUSCLE_BAND: + if (IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_WISE_GLASSES: + if (IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_LUSTROUS_ORB: + if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_PALKIA && (moveType == TYPE_WATER || moveType == TYPE_DRAGON)) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_ADAMANT_ORB: + if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_DIALGA && (moveType == TYPE_STEEL || moveType == TYPE_DRAGON)) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_GRISEOUS_ORB: + if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_GIRATINA && (moveType == TYPE_GHOST || moveType == TYPE_DRAGON)) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_SOUL_DEW: + if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) + && ((B_SOUL_DEW_BOOST >= GEN_7 && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON)) + || (B_SOUL_DEW_BOOST < GEN_7 && !(gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) && IS_MOVE_SPECIAL(move)))) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_BUG_POWER: + case HOLD_EFFECT_STEEL_POWER: + case HOLD_EFFECT_GROUND_POWER: + case HOLD_EFFECT_ROCK_POWER: + case HOLD_EFFECT_GRASS_POWER: + case HOLD_EFFECT_DARK_POWER: + case HOLD_EFFECT_FIGHTING_POWER: + case HOLD_EFFECT_ELECTRIC_POWER: + case HOLD_EFFECT_WATER_POWER: + case HOLD_EFFECT_FLYING_POWER: + case HOLD_EFFECT_POISON_POWER: + case HOLD_EFFECT_ICE_POWER: + case HOLD_EFFECT_GHOST_POWER: + case HOLD_EFFECT_PSYCHIC_POWER: + case HOLD_EFFECT_FIRE_POWER: + case HOLD_EFFECT_DRAGON_POWER: + case HOLD_EFFECT_NORMAL_POWER: + case HOLD_EFFECT_FAIRY_POWER: + for (i = 0; i < ARRAY_COUNT(sHoldEffectToType); i++) + { + if (holdEffectAtk == sHoldEffectToType[i][0]) + { + if (moveType == sHoldEffectToType[i][1]) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + } + } + break; + case HOLD_EFFECT_PLATE: + if (moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item)) + modifier = uq4_12_multiply(modifier, holdEffectModifier); + break; + case HOLD_EFFECT_PUNCHING_GLOVE: + if (gMovesInfo[move].punchingMove) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); + break; + } + return uq4_12_multiply_by_int_half_down(modifier, basePower); +} + +static inline u32 CalcAttackStat(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, bool32 isCrit, bool32 updateFlags, u32 atkAbility, u32 defAbility, u32 holdEffectAtk) +{ + u8 atkStage; + u32 atkStat; + uq4_12_t modifier; + u16 atkBaseSpeciesId; + + atkBaseSpeciesId = GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species); + + if (gMovesInfo[move].effect == EFFECT_FOUL_PLAY) + { + if (IS_MOVE_PHYSICAL(move)) + { + atkStat = gBattleMons[battlerDef].attack; + atkStage = gBattleMons[battlerDef].statStages[STAT_ATK]; + } + else + { + atkStat = gBattleMons[battlerDef].spAttack; + atkStage = gBattleMons[battlerDef].statStages[STAT_SPATK]; + } + } + else if (gMovesInfo[move].effect == EFFECT_BODY_PRESS) + { + atkStat = gBattleMons[battlerAtk].defense; + atkStage = gBattleMons[battlerAtk].statStages[STAT_DEF]; + } + else + { + if (IS_MOVE_PHYSICAL(move)) + { + atkStat = gBattleMons[battlerAtk].attack; + atkStage = gBattleMons[battlerAtk].statStages[STAT_ATK]; + } + else + { + atkStat = gBattleMons[battlerAtk].spAttack; + atkStage = gBattleMons[battlerAtk].statStages[STAT_SPATK]; + } + } + + // critical hits ignore attack stat's stage drops + if (isCrit && atkStage < DEFAULT_STAT_STAGE) + atkStage = DEFAULT_STAT_STAGE; + // pokemon with unaware ignore attack stat changes while taking damage + if (defAbility == ABILITY_UNAWARE) + atkStage = DEFAULT_STAT_STAGE; + + atkStat *= gStatStageRatios[atkStage][0]; + atkStat /= gStatStageRatios[atkStage][1]; + + // apply attack stat modifiers + modifier = UQ_4_12(1.0); + + // attacker's abilities + switch (atkAbility) + { + case ABILITY_HUGE_POWER: + case ABILITY_PURE_POWER: + if (IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case ABILITY_SLOW_START: + if (gDisableStructs[battlerAtk].slowStartTimer != 0) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.5)); + break; + case ABILITY_SOLAR_POWER: + if (IS_MOVE_SPECIAL(move) && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_DEFEATIST: + if (gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 2)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.5)); + break; + case ABILITY_FLASH_FIRE: + if (moveType == TYPE_FIRE && gBattleResources->flags->flags[battlerAtk] & RESOURCE_FLAG_FLASH_FIRE) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_SWARM: + if (moveType == TYPE_BUG && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_TORRENT: + if (moveType == TYPE_WATER && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_BLAZE: + if (moveType == TYPE_FIRE && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_OVERGROW: + if (moveType == TYPE_GRASS && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_PLUS: + if (IS_MOVE_SPECIAL(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + { + u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); + if (partnerAbility == ABILITY_MINUS + || (B_PLUS_MINUS_INTERACTION >= GEN_5 && partnerAbility == ABILITY_PLUS)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + } + break; + case ABILITY_MINUS: + if (IS_MOVE_SPECIAL(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + { + u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); + if (partnerAbility == ABILITY_PLUS + || (B_PLUS_MINUS_INTERACTION >= GEN_5 && partnerAbility == ABILITY_MINUS)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + } + break; + case ABILITY_FLOWER_GIFT: + if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_HUSTLE: + if (IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_STAKEOUT: + if (gDisableStructs[battlerDef].isFirstTurn == 2) // just switched in + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case ABILITY_GUTS: + if (gBattleMons[battlerAtk].status1 & STATUS1_ANY && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + } + + // target's abilities + switch (defAbility) + { + case ABILITY_THICK_FAT: + if (moveType == TYPE_FIRE || moveType == TYPE_ICE) + { + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.5)); + if (updateFlags) + RecordAbilityBattle(battlerDef, ABILITY_THICK_FAT); + } + break; + } + + // ally's abilities + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + { + switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) + { + case ABILITY_FLOWER_GIFT: + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + } + } + + // field abilities + if (IsAbilityOnField(ABILITY_VESSEL_OF_RUIN) && atkAbility != ABILITY_VESSEL_OF_RUIN && IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75)); + + if (IsAbilityOnField(ABILITY_TABLETS_OF_RUIN) && atkAbility != ABILITY_TABLETS_OF_RUIN && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75)); + + // attacker's hold effect + switch (holdEffectAtk) + { + case HOLD_EFFECT_THICK_CLUB: + if ((atkBaseSpeciesId == SPECIES_CUBONE || atkBaseSpeciesId == SPECIES_MAROWAK) && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case HOLD_EFFECT_DEEP_SEA_TOOTH: + if (gBattleMons[battlerAtk].species == SPECIES_CLAMPERL && IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case HOLD_EFFECT_LIGHT_BALL: + if (atkBaseSpeciesId == SPECIES_PIKACHU && (B_LIGHT_BALL_ATTACK_BOOST >= GEN_4 || IS_MOVE_SPECIAL(move))) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case HOLD_EFFECT_CHOICE_BAND: + // TODO: Dynamax + if (IS_MOVE_PHYSICAL(move) /* && !IsDynamaxed(battlerAtk) */) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case HOLD_EFFECT_CHOICE_SPECS: + // TODO: Dynamax + if (IS_MOVE_SPECIAL(move) /* && !IsDynamaxed(battlerAtk) */) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + } + + // The offensive stats of a Player's Pokémon are boosted by x1.1 (+10%) if they have the 1st badge and 7th badges. + // Having the 1st badge boosts physical attack while having the 7th badge boosts special attack. + if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerAtk) && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); + if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerAtk) && IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); + + return uq4_12_multiply_by_int_half_down(modifier, atkStat); +} + +static bool32 CanEvolve(u32 species) +{ + u32 i; + const struct Evolution *evolutions = GetSpeciesEvolutions(species); + + if (evolutions != NULL) + { + for (i = 0; evolutions[i].method != EVOLUTIONS_END; i++) + { + if (evolutions[i].method + && SanitizeSpeciesId(evolutions[i].targetSpecies) != SPECIES_NONE) + return TRUE; + } + } + return FALSE; +} + +static inline u32 CalcDefenseStat(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, bool32 isCrit, bool32 updateFlags, u32 atkAbility, u32 defAbility, u32 holdEffectDef, u32 weather) +{ + bool32 usesDefStat; + u8 defStage; + u32 defStat, def, spDef; + uq4_12_t modifier; + + if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM) // the defense stats are swapped + { + def = gBattleMons[battlerDef].spDefense; + spDef = gBattleMons[battlerDef].defense; + } + else + { + def = gBattleMons[battlerDef].defense; + spDef = gBattleMons[battlerDef].spDefense; + } + + if (gMovesInfo[move].effect == EFFECT_PSYSHOCK || IS_MOVE_PHYSICAL(move)) // uses defense stat instead of sp.def + { + defStat = def; + defStage = gBattleMons[battlerDef].statStages[STAT_DEF]; + usesDefStat = TRUE; + } + else // is special + { + defStat = spDef; + defStage = gBattleMons[battlerDef].statStages[STAT_SPDEF]; + usesDefStat = FALSE; + } + + // Self-destruct / Explosion cut defense in half + if (B_EXPLOSION_DEFENSE < GEN_5 && gMovesInfo[gCurrentMove].effect == EFFECT_EXPLOSION) + defStat /= 2; + + // critical hits ignore positive stat changes + if (isCrit && defStage > DEFAULT_STAT_STAGE) + defStage = DEFAULT_STAT_STAGE; + // pokemon with unaware ignore defense stat changes while dealing damage + if (atkAbility == ABILITY_UNAWARE) + defStage = DEFAULT_STAT_STAGE; + // certain moves also ignore stat changes + if (gMovesInfo[move].ignoresTargetDefenseEvasionStages) + defStage = DEFAULT_STAT_STAGE; + + defStat *= gStatStageRatios[defStage][0]; + defStat /= gStatStageRatios[defStage][1]; + + // apply defense stat modifiers + modifier = UQ_4_12(1.0); + + // target's abilities + switch (defAbility) + { + case ABILITY_MARVEL_SCALE: + if (gBattleMons[battlerDef].status1 & STATUS1_ANY && usesDefStat) + { + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + if (updateFlags) + RecordAbilityBattle(battlerDef, ABILITY_MARVEL_SCALE); + } + break; + case ABILITY_FUR_COAT: + if (usesDefStat) + { + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + if (updateFlags) + RecordAbilityBattle(battlerDef, ABILITY_FUR_COAT); + } + break; + case ABILITY_GRASS_PELT: + if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && usesDefStat) + { + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + if (updateFlags) + RecordAbilityBattle(battlerDef, ABILITY_GRASS_PELT); + } + break; + case ABILITY_FLOWER_GIFT: + if (gBattleMons[battlerDef].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && !usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case ABILITY_PURIFYING_SALT: + if (gMovesInfo[move].type == TYPE_GHOST) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + } + + // ally's abilities + if (IsBattlerAlive(BATTLE_PARTNER(battlerDef))) + { + switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef))) + { + case ABILITY_FLOWER_GIFT: + if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), B_WEATHER_SUN) && !usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + } + } + + // field abilities + if (IsAbilityOnField(ABILITY_SWORD_OF_RUIN) && defAbility != ABILITY_SWORD_OF_RUIN && usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75)); + + if (IsAbilityOnField(ABILITY_BEADS_OF_RUIN) && defAbility != ABILITY_BEADS_OF_RUIN && !usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75)); + + // target's hold effects + switch (holdEffectDef) + { + case HOLD_EFFECT_DEEP_SEA_SCALE: + if (gBattleMons[battlerDef].species == SPECIES_CLAMPERL && !usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case HOLD_EFFECT_METAL_POWDER: + if (gBattleMons[battlerDef].species == SPECIES_DITTO && usesDefStat && !(gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); + break; + case HOLD_EFFECT_EVIOLITE: + if (CanEvolve(gBattleMons[battlerDef].species)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case HOLD_EFFECT_ASSAULT_VEST: + if (!usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + case HOLD_EFFECT_SOUL_DEW: + if (B_SOUL_DEW_BOOST < GEN_7 + && (gBattleMons[battlerDef].species == SPECIES_LATIAS || gBattleMons[battlerDef].species == SPECIES_LATIOS) + && !(gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) + && !usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + break; + } + + // sandstorm sp.def boost for rock types + if (B_SANDSTORM_SPDEF_BOOST >= GEN_4 && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && IsBattlerWeatherAffected(battlerDef, B_WEATHER_SANDSTORM) && !usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + // snow def boost for ice types + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE) && IsBattlerWeatherAffected(battlerDef, B_WEATHER_SNOW) && usesDefStat) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); + + // The defensive stats of a Player's Pokémon are boosted by x1.1 (+10%) if they have the 5th badge and 7th badges. + // Having the 5th badge boosts physical defense while having the 7th badge boosts special defense. + if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerDef) && IS_MOVE_PHYSICAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); + if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerDef) && IS_MOVE_SPECIAL(move)) + modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); + + return uq4_12_multiply_by_int_half_down(modifier, defStat); +} + +static u32 GetWeather(void) +{ + if (gBattleWeather == B_WEATHER_NONE || !WEATHER_HAS_EFFECT) + return B_WEATHER_NONE; + else + return gBattleWeather; +} + +#define DAMAGE_APPLY_MODIFIER(modifier) do { \ + dmg = uq4_12_multiply_by_int_half_down(modifier, dmg); \ +} while (0) + +static inline s32 DoMoveDamageCalcVars(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, s32 fixedBasePower, + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, uq4_12_t typeEffectivenessModifier, u32 weather, + u32 holdEffectAtk, u32 holdEffectDef, u32 abilityAtk, u32 abilityDef) +{ + s32 dmg; + u32 userFinalAttack; + u32 targetFinalDefense; + + if (fixedBasePower) + gBattleMovePower = fixedBasePower; + else + gBattleMovePower = CalcMoveBasePowerAfterModifiers(move, battlerAtk, battlerDef, moveType, updateFlags, abilityAtk, abilityDef, holdEffectAtk, weather); + + userFinalAttack = CalcAttackStat(move, battlerAtk, battlerDef, moveType, isCrit, updateFlags, abilityAtk, abilityDef, holdEffectAtk); + targetFinalDefense = CalcDefenseStat(move, battlerAtk, battlerDef, moveType, isCrit, updateFlags, abilityAtk, abilityDef, holdEffectDef, weather); + + dmg = CalculateBaseDamage(gBattleMovePower, userFinalAttack, gBattleMons[battlerAtk].level, targetFinalDefense); + DAMAGE_APPLY_MODIFIER(GetTargetDamageModifier(move, battlerAtk, battlerDef)); + DAMAGE_APPLY_MODIFIER(GetParentalBondModifier(battlerAtk)); + DAMAGE_APPLY_MODIFIER(GetWeatherDamageModifier(battlerAtk, move, moveType, holdEffectAtk, holdEffectDef, weather)); + DAMAGE_APPLY_MODIFIER(GetCriticalModifier(isCrit)); + DAMAGE_APPLY_MODIFIER(GetGlaiveRushModifier(battlerDef)); + + if (randomFactor) + { + dmg *= 100 - RandomUniform(RNG_DAMAGE_MODIFIER, 0, 15); + dmg /= 100; + } + + DAMAGE_APPLY_MODIFIER(GetSameTypeAttackBonusModifier(battlerAtk, moveType, move, abilityAtk)); + DAMAGE_APPLY_MODIFIER(typeEffectivenessModifier); + DAMAGE_APPLY_MODIFIER(GetBurnOrFrostBiteModifier(battlerAtk, move, abilityAtk)); + DAMAGE_APPLY_MODIFIER(GetZMaxMoveAgainstProtectionModifier(battlerDef, move)); + DAMAGE_APPLY_MODIFIER(GetOtherModifiers(move, moveType, battlerAtk, battlerDef, isCrit, typeEffectivenessModifier, updateFlags, abilityAtk, abilityDef, holdEffectAtk, holdEffectDef)); + + if (dmg == 0) + dmg = 1; + return dmg; +} + +static inline s32 DoMoveDamageCalc(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, s32 fixedBasePower, + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, uq4_12_t typeEffectivenessModifier, u32 weather) +{ + u32 holdEffectAtk, holdEffectDef, abilityAtk, abilityDef; + + if (typeEffectivenessModifier == UQ_4_12(0.0)) + return 0; + + holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); + holdEffectDef = GetBattlerHoldEffect(battlerDef, TRUE); + abilityAtk = GetBattlerAbility(battlerAtk); + abilityDef = GetBattlerAbility(battlerDef); + + return DoMoveDamageCalcVars(move, battlerAtk, battlerDef, moveType, fixedBasePower, isCrit, randomFactor, + updateFlags, typeEffectivenessModifier, weather, holdEffectAtk, holdEffectDef, abilityAtk, abilityDef); +} + +static inline s32 DoFutureSightAttackDamageCalcVars(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, uq4_12_t typeEffectivenessModifier, u32 weather, + u32 holdEffectDef, u32 abilityDef) +{ + s32 dmg; + u32 userFinalAttack; + u32 targetFinalDefense; + + struct Pokemon *party = GetSideParty(GetBattlerSide(battlerAtk)); + struct Pokemon *partyMon = &party[gWishFutureKnock.futureSightPartyIndex[battlerDef]]; + u32 partyMonLevel = GetMonData(partyMon, MON_DATA_LEVEL, NULL); + u32 partyMonSpecies = GetMonData(partyMon, MON_DATA_SPECIES, NULL); + gBattleMovePower = gMovesInfo[move].power; + + if (IS_MOVE_PHYSICAL(move)) + userFinalAttack = GetMonData(partyMon, MON_DATA_ATK, NULL); + else + userFinalAttack = GetMonData(partyMon, MON_DATA_SPATK, NULL); + + targetFinalDefense = CalcDefenseStat(move, battlerAtk, battlerDef, moveType, isCrit, updateFlags, ABILITY_NONE, abilityDef, holdEffectDef, weather); + dmg = CalculateBaseDamage(gBattleMovePower, userFinalAttack, partyMonLevel, targetFinalDefense); + + DAMAGE_APPLY_MODIFIER(GetCriticalModifier(isCrit)); + + if (randomFactor) + { + dmg *= 100 - RandomUniform(RNG_DAMAGE_MODIFIER, 0, 15); + dmg /= 100; + } + + // Same type attack bonus + if (gSpeciesInfo[partyMonSpecies].types[0] == moveType || gSpeciesInfo[partyMonSpecies].types[1] == moveType) + DAMAGE_APPLY_MODIFIER(UQ_4_12(1.5)); + else + DAMAGE_APPLY_MODIFIER(UQ_4_12(1.0)); + DAMAGE_APPLY_MODIFIER(typeEffectivenessModifier); + + if (dmg == 0) + dmg = 1; + + gSpecialStatuses[battlerAtk].preventLifeOrbDamage = TRUE; + + return dmg; +} + +static inline s32 DoFutureSightAttackDamageCalc(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, uq4_12_t typeEffectivenessModifier, u32 weather) +{ + u32 holdEffectDef, abilityDef; + + if (typeEffectivenessModifier == UQ_4_12(0.0)) + return 0; + + holdEffectDef = GetBattlerHoldEffect(battlerDef, TRUE); + abilityDef = GetBattlerAbility(battlerDef); + + return DoFutureSightAttackDamageCalcVars(move, battlerAtk, battlerDef, moveType, isCrit, randomFactor, + updateFlags, typeEffectivenessModifier, weather, holdEffectDef, abilityDef); +} + +#undef DAMAGE_APPLY_MODIFIER + +s32 CalculateMoveDamage(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags) +{ + struct Pokemon *party = GetSideParty(GetBattlerSide(gBattlerAttacker)); + + if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT + && (&party[gWishFutureKnock.futureSightPartyIndex[battlerDef]] != &party[gBattlerPartyIndexes[battlerAtk]]) ) + { + return DoFutureSightAttackDamageCalc(move, battlerAtk, battlerDef, moveType, isCrit, randomFactor, + updateFlags, CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, GetBattlerAbility(battlerDef), updateFlags), + GetWeather()); + } + else + { + return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, fixedBasePower, isCrit, randomFactor, + updateFlags, CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, GetBattlerAbility(battlerDef), updateFlags), + GetWeather()); + } +} + +bool32 MoveHasAdditionalEffectSelfArg(u32 move, u32 moveEffect, u32 argument) +{ + return (gMovesInfo[move].argument == argument) && MoveHasAdditionalEffectSelf(move, moveEffect); +} + +static u32 GetFlingPowerFromItemId(u32 itemId) +{ + if (itemId >= ITEM_TM01 && itemId <= ITEM_HM08) + { + u32 power = gMovesInfo[ItemIdToBattleMoveId(itemId)].power; + if (power > 1) + return power; + return 10; // Status moves and moves with variable power always return 10 power. + } + else + return ItemId_GetFlingPower(itemId); +} + +static void SetRandomMultiHitCounter() +{ + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) + gMultiHitCounter = RandomUniform(RNG_LOADED_DICE, 4, 5); + else if (B_MULTI_HIT_CHANCE >= GEN_5) + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 7, 7, 3, 3); // 35%: 2 hits, 35%: 3 hits, 15% 4 hits, 15% 5 hits. + else + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 3, 3, 1, 1); // 37.5%: 2 hits, 37.5%: 3 hits, 12.5% 4 hits, 12.5% 5 hits. +} + +bool32 ShouldGetStatBadgeBoost(u16 badgeFlag, u32 battler) +{ + if (B_BADGE_BOOST == GEN_3) + { + if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER)) + return FALSE; + else if (GetBattlerSide(battler) != B_SIDE_PLAYER) + return FALSE; + else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gTrainerBattleOpponent_A == TRAINER_SECRET_BASE) + return FALSE; + else if (FlagGet(badgeFlag)) + return TRUE; + } + return FALSE; +} + +bool32 IsBattlerWeatherAffected(u32 battler, u32 weatherFlags) +{ + if (gBattleWeather & weatherFlags && WEATHER_HAS_EFFECT) + { + // given weather is active -> check if its sun, rain against utility umbrella ( since only 1 weather can be active at once) + if (gBattleWeather & (B_WEATHER_SUN | B_WEATHER_RAIN) && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) + return FALSE; // utility umbrella blocks sun, rain effects + + return TRUE; + } + return FALSE; +} + +bool32 DoesSpeciesUseHoldItemToChangeForm(u16 species, u16 heldItemId) +{ + // TODO: Form changes + // u32 i; + // const struct FormChange *formChanges = GetSpeciesFormChanges(species); + + // if (formChanges != NULL) + // { + // for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++) + // { + // switch (formChanges[i].method) + // { + // case FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM: + // case FORM_CHANGE_BATTLE_PRIMAL_REVERSION: + // case FORM_CHANGE_BATTLE_ULTRA_BURST: + // case FORM_CHANGE_ITEM_HOLD: + // if (formChanges[i].param1 == heldItemId) + // return TRUE; + // break; + // } + // } + // } + return FALSE; +} + +bool32 CanBattlerGetOrLoseItem(u32 battler, u16 itemId) +{ + u16 species = gBattleMons[battler].species; + u16 holdEffect = ItemId_GetHoldEffect(itemId); + + // Mail can be stolen now + if (itemId == ITEM_ENIGMA_BERRY_E_READER) + return FALSE; + else if (DoesSpeciesUseHoldItemToChangeForm(species, itemId)) + return FALSE; + else if (holdEffect == HOLD_EFFECT_Z_CRYSTAL) + return FALSE; + else + return TRUE; +} + +bool32 MoveIsAffectedBySheerForce(u32 move) +{ + u32 i; + for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + { + if (gMovesInfo[move].additionalEffects[i].chance > 0) + return TRUE; + } + return FALSE; +} + +u8 GetBattlerGender(u32 battler) +{ + return GetGenderFromSpeciesAndPersonality(gBattleMons[battler].species, + gBattleMons[battler].personality); +} + +bool32 AreBattlersOfOppositeGender(u32 battler1, u32 battler2) +{ + u8 gender1 = GetBattlerGender(battler1); + u8 gender2 = GetBattlerGender(battler2); + + return (gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS && gender1 != gender2); +} + +bool32 AreBattlersOfSameGender(u32 battler1, u32 battler2) +{ + u8 gender1 = GetBattlerGender(battler1); + u8 gender2 = GetBattlerGender(battler2); + + return (gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS && gender1 == gender2); +} + +u32 GetBattlerHoldEffectParam(u32 battler) +{ + if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY_E_READER) + return gEnigmaBerries[battler].holdEffectParam; + else + return ItemId_GetHoldEffectParam(gBattleMons[battler].item); +} u8 IsMonDisobedient(void) { s32 rnd; @@ -3194,7 +8370,7 @@ u8 IsMonDisobedient(void) // Randomly select, then print a disobedient string // B_MSG_LOAFING, B_MSG_WONT_OBEY, B_MSG_TURNED_AWAY, or B_MSG_PRETEND_NOT_NOTICE gBattleCommunication[MULTISTRING_CHOOSER] = Random() & (NUM_LOAF_STRINGS - 1); - gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; + gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAroundMsg; return 1; } else // use a random move @@ -3234,7 +8410,7 @@ u8 IsMonDisobedient(void) calc -= obedienceLevel; if (calc < obedienceLevel) { - gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker); + gBattleMoveDamage = CalculateMoveDamage(MOVE_NONE, gBattlerAttacker, gBattlerAttacker, TYPE_MYSTERY, 40, FALSE, FALSE, TRUE); gBattlerTarget = gBattlerAttacker; gBattlescriptCurrInstr = BattleScript_IgnoresAndHitsItself; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3245,115 +8421,1202 @@ u8 IsMonDisobedient(void) // Randomly select, then print a disobedient string // B_MSG_LOAFING, B_MSG_WONT_OBEY, B_MSG_TURNED_AWAY, or B_MSG_PRETEND_NOT_NOTICE gBattleCommunication[MULTISTRING_CHOOSER] = Random() & (NUM_LOAF_STRINGS - 1); - gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; + gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAroundMsg; return 1; } } } -u32 GetBattlerAbility(u32 battler) +static inline void MulByTypeEffectiveness(uq4_12_t *modifier, u32 move, u32 moveType, u32 battlerDef, u32 defType, u32 battlerAtk, bool32 recordAbilities) { - // if (gStatuses3[battler] & STATUS3_GASTRO_ACID) - // return ABILITY_NONE; + uq4_12_t mod = GetTypeModifier(moveType, defType); + u32 abilityAtk = GetBattlerAbility(battlerAtk); - // if (IsNeutralizingGasOnField() && !IsNeutralizingGasBannedAbility(gBattleMons[battler].ability)) - // return ABILITY_NONE; - - // if (IsMyceliumMightOnField()) - // return ABILITY_NONE; - - // if (((IsMoldBreakerTypeAbility(gBattleMons[gBattlerAttacker].ability) - // && !(gStatuses3[gBattlerAttacker] & STATUS3_GASTRO_ACID)) - // || gBattleMoves[gCurrentMove].ignoresTargetAbility) - // && sAbilitiesAffectedByMoldBreaker[gBattleMons[battler].ability] - // && gBattlerByTurnOrder[gCurrentTurnActionNumber] == gBattlerAttacker - // && gActionsByTurnOrder[gBattlerByTurnOrder[gBattlerAttacker]] == B_ACTION_USE_MOVE - // && gCurrentTurnActionNumber < gBattlersCount) - // return ABILITY_NONE; - - return gBattleMons[battler].ability; -} - -u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating) -{ - if (checkNegating) + if (mod == UQ_4_12(0.0) && GetBattlerHoldEffect(battlerDef, TRUE) == HOLD_EFFECT_RING_TARGET) { - // if (gStatuses3[battler] & STATUS3_EMBARGO) - // return HOLD_EFFECT_NONE; - // if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM) - // return HOLD_EFFECT_NONE; - if (GetBattlerAbility(battler) == ABILITY_KLUTZ) - return HOLD_EFFECT_NONE; + mod = UQ_4_12(1.0); + if (recordAbilities) + RecordItemEffectBattle(battlerDef, HOLD_EFFECT_RING_TARGET); + } + else if ((moveType == TYPE_FIGHTING || moveType == TYPE_NORMAL) && defType == TYPE_GHOST && gBattleMons[battlerDef].status2 & STATUS2_FORESIGHT && mod == UQ_4_12(0.0)) + { + mod = UQ_4_12(1.0); + } + else if ((moveType == TYPE_FIGHTING || moveType == TYPE_NORMAL) && defType == TYPE_GHOST + && (abilityAtk == ABILITY_SCRAPPY || abilityAtk == ABILITY_MINDS_EYE) + && mod == UQ_4_12(0.0)) + { + mod = UQ_4_12(1.0); + if (recordAbilities) + RecordAbilityBattle(battlerAtk, abilityAtk); } - gPotentialItemEffectBattler = battler; + if (moveType == TYPE_PSYCHIC && defType == TYPE_DARK && gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED && mod == UQ_4_12(0.0)) + mod = UQ_4_12(1.0); + if (gMovesInfo[move].effect == EFFECT_FREEZE_DRY && defType == TYPE_WATER) + mod = UQ_4_12(2.0); + if (moveType == TYPE_GROUND && defType == TYPE_FLYING && IsBattlerGrounded(battlerDef) && mod == UQ_4_12(0.0)) + mod = UQ_4_12(1.0); + if (moveType == TYPE_FIRE && gDisableStructs[battlerDef].tarShot) + mod = UQ_4_12(2.0); - if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY) - return gEnigmaBerries[battler].holdEffect; - else - return ItemId_GetHoldEffect(gBattleMons[battler].item); + // B_WEATHER_STRONG_WINDS weakens Super Effective moves against Flying-type Pokémon + if (gBattleWeather & B_WEATHER_STRONG_WINDS && WEATHER_HAS_EFFECT) + { + if (defType == TYPE_FLYING && mod >= UQ_4_12(2.0)) + mod = UQ_4_12(1.0); + } + + *modifier = uq4_12_multiply(*modifier, mod); } -bool32 IsBattlerAlive(u32 battler) +static inline void TryNoticeIllusionInTypeEffectiveness(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, uq4_12_t resultingModifier, u32 illusionSpecies) { - if (gBattleMons[battler].hp == 0) + // Check if the type effectiveness would've been different if the pokemon really had the types as the disguise. + uq4_12_t presumedModifier = UQ_4_12(1.0); + MulByTypeEffectiveness(&presumedModifier, move, moveType, battlerDef, gSpeciesInfo[illusionSpecies].types[0], battlerAtk, FALSE); + if (gSpeciesInfo[illusionSpecies].types[1] != gSpeciesInfo[illusionSpecies].types[0]) + MulByTypeEffectiveness(&presumedModifier, move, moveType, battlerDef, gSpeciesInfo[illusionSpecies].types[1], battlerAtk, FALSE); + + if (presumedModifier != resultingModifier) + RecordAbilityBattle(battlerDef, ABILITY_ILLUSION); +} + +static void UpdateMoveResultFlags(uq4_12_t modifier) +{ + if (modifier == UQ_4_12(0.0)) + { + gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE; + gMoveResultFlags &= ~(MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE); + } + else if (modifier == UQ_4_12(1.0)) + { + gMoveResultFlags &= ~(MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_DOESNT_AFFECT_FOE); + } + else if (modifier > UQ_4_12(1.0)) + { + gMoveResultFlags |= MOVE_RESULT_SUPER_EFFECTIVE; + gMoveResultFlags &= ~(MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_DOESNT_AFFECT_FOE); + } + else //if (modifier < UQ_4_12(1.0)) + { + gMoveResultFlags |= MOVE_RESULT_NOT_VERY_EFFECTIVE; + gMoveResultFlags &= ~(MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_DOESNT_AFFECT_FOE); + } +} + +static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, bool32 recordAbilities, uq4_12_t modifier, u32 defAbility) +{ + u32 illusionSpecies; + + MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, GetBattlerType(battlerDef, 0), battlerAtk, recordAbilities); + if (GetBattlerType(battlerDef, 1) != GetBattlerType(battlerDef, 0)) + MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, GetBattlerType(battlerDef, 1), battlerAtk, recordAbilities); + if (GetBattlerType(battlerDef, 2) != TYPE_MYSTERY && GetBattlerType(battlerDef, 2) != GetBattlerType(battlerDef, 1) + && GetBattlerType(battlerDef, 2) != GetBattlerType(battlerDef, 0)) + MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, GetBattlerType(battlerDef, 2), battlerAtk, recordAbilities); + + if (recordAbilities && (illusionSpecies = GetIllusionMonSpecies(battlerDef))) + TryNoticeIllusionInTypeEffectiveness(move, moveType, battlerAtk, battlerDef, modifier, illusionSpecies); + + if (gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS && move != MOVE_THUNDER_WAVE) + { + modifier = UQ_4_12(1.0); + if (B_GLARE_GHOST < GEN_4 && move == MOVE_GLARE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) + modifier = UQ_4_12(0.0); + } + else if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded)) + { + modifier = UQ_4_12(0.0); + if (recordAbilities && defAbility == ABILITY_LEVITATE) + { + gLastUsedAbility = ABILITY_LEVITATE; + gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); + gLastLandedMoves[battlerDef] = 0; + gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS; + RecordAbilityBattle(battlerDef, ABILITY_LEVITATE); + } + } + else if (B_SHEER_COLD_IMMUNITY >= GEN_7 && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE)) + { + modifier = UQ_4_12(0.0); + } + + // Thousand Arrows ignores type modifiers for flying mons + if (!IsBattlerGrounded(battlerDef) && (gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded) + && (gBattleMons[battlerDef].type1 == TYPE_FLYING || gBattleMons[battlerDef].type2 == TYPE_FLYING || gBattleMons[battlerDef].type3 == TYPE_FLYING)) + { + modifier = UQ_4_12(1.0); + } + + if (((defAbility == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0)) + || (defAbility == ABILITY_TELEPATHY && battlerDef == BATTLE_PARTNER(battlerAtk))) + && gMovesInfo[move].power) + { + modifier = UQ_4_12(0.0); + if (recordAbilities) + { + gLastUsedAbility = gBattleMons[battlerDef].ability; + gMoveResultFlags |= MOVE_RESULT_MISSED; + gLastLandedMoves[battlerDef] = 0; + gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; + RecordAbilityBattle(battlerDef, gBattleMons[battlerDef].ability); + } + } + + // Signal for the trainer slide-in system. + if (GetBattlerSide(battlerDef) != B_SIDE_PLAYER && modifier && gBattleStruct->trainerSlideFirstSTABMoveMsgState != 2) + gBattleStruct->trainerSlideFirstSTABMoveMsgState = 1; + + return modifier; +} + + +uq4_12_t CalcTypeEffectivenessMultiplier(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, u32 defAbility, bool32 recordAbilities) +{ + uq4_12_t modifier = UQ_4_12(1.0); + + if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY) + { + modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, modifier, defAbility); + if (gMovesInfo[move].effect == EFFECT_TWO_TYPED_MOVE) + modifier = CalcTypeEffectivenessMultiplierInternal(move, gMovesInfo[move].argument, battlerAtk, battlerDef, recordAbilities, modifier, defAbility); + } + + if (recordAbilities) + UpdateMoveResultFlags(modifier); + return modifier; +} + +bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect) +{ + u32 i; + for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + { + if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect + && gMovesInfo[move].additionalEffects[i].self == TRUE) + return TRUE; + } + return FALSE; +} + +static uq4_12_t GetInverseTypeMultiplier(uq4_12_t multiplier) +{ + switch (multiplier) + { + case UQ_4_12(0.0): + case UQ_4_12(0.5): + return UQ_4_12(2.0); + case UQ_4_12(2.0): + return UQ_4_12(0.5); + case UQ_4_12(1.0): + default: + return UQ_4_12(1.0); + } +} + +uq4_12_t GetTypeModifier(u32 atkType, u32 defType) +{ + if (B_FLAG_INVERSE_BATTLE != 0 && FlagGet(B_FLAG_INVERSE_BATTLE)) + return GetInverseTypeMultiplier(sTypeEffectivenessTable[atkType][defType]); + return sTypeEffectivenessTable[atkType][defType]; +} + +u8 GetBattlerType(u32 battler, u8 typeIndex) +{ + u16 types[3] = {0}; + types[0] = gBattleMons[battler].type1; + types[1] = gBattleMons[battler].type2; + types[2] = gBattleMons[battler].type3; + + // Handle Roost's Flying-type suppression + if (typeIndex == 0 || typeIndex == 1) + { + if (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_ROOST) + { + if (types[0] == TYPE_FLYING && types[1] == TYPE_FLYING) + return B_ROOST_PURE_FLYING >= GEN_5 ? TYPE_NORMAL : TYPE_MYSTERY; + else + return types[typeIndex] == TYPE_FLYING ? TYPE_MYSTERY : types[typeIndex]; + } + } + + return types[typeIndex]; +} + +struct Pokemon *GetIllusionMonPtr(u32 battler) +{ + if (gBattleStruct->illusion[battler].broken) + return NULL; + if (!gBattleStruct->illusion[battler].set) + { + if (GetBattlerSide(battler) == B_SIDE_PLAYER) + SetIllusionMon(&gPlayerParty[gBattlerPartyIndexes[battler]], battler); + else + SetIllusionMon(&gEnemyParty[gBattlerPartyIndexes[battler]], battler); + } + if (!gBattleStruct->illusion[battler].on) + return NULL; + + return gBattleStruct->illusion[battler].mon; +} + +void ClearIllusionMon(u32 battler) +{ + memset(&gBattleStruct->illusion[battler], 0, sizeof(gBattleStruct->illusion[battler])); +} + +u32 GetIllusionMonSpecies(u32 battler) +{ + struct Pokemon *illusionMon = GetIllusionMonPtr(battler); + if (illusionMon != NULL) + return GetMonData(illusionMon, MON_DATA_SPECIES); + return SPECIES_NONE; +} + +bool32 SetIllusionMon(struct Pokemon *mon, u32 battler) +{ + struct Pokemon *party, *partnerMon; + s32 i, id; + u8 side, partyCount; + + gBattleStruct->illusion[battler].set = 1; + if (GetMonAbility(mon) != ABILITY_ILLUSION) return FALSE; - else if (battler >= gBattlersCount) + + party = GetBattlerParty(battler); + side = GetBattlerSide(battler); + partyCount = side == B_SIDE_PLAYER ? gPlayerPartyCount : gEnemyPartyCount; + + // If this pokemon is last in the party, ignore Illusion. + if (&party[partyCount - 1] == mon) return FALSE; - else if (gAbsentBattlerFlags & gBitTable[battler]) + + if (IsBattlerAlive(BATTLE_PARTNER(battler))) + partnerMon = &party[gBattlerPartyIndexes[BATTLE_PARTNER(battler)]]; + else + partnerMon = mon; + + // Find last alive non-egg pokemon. + for (i = PARTY_SIZE - 1; i >= 0; i--) + { + id = i; + if (GetMonData(&party[id], MON_DATA_SANITY_HAS_SPECIES) + && GetMonData(&party[id], MON_DATA_HP) + && !GetMonData(&party[id], MON_DATA_IS_EGG) + && &party[id] != mon + && &party[id] != partnerMon) + { + gBattleStruct->illusion[battler].on = 1; + gBattleStruct->illusion[battler].broken = 0; + gBattleStruct->illusion[battler].partyId = id; + gBattleStruct->illusion[battler].mon = &party[id]; + return TRUE; + } + } + + return FALSE; +} + +u32 GetBattlerAffectionHearts(u32 battler) +{ + u8 side = GetBattlerSide(battler); + struct Pokemon *party = GetSideParty(side); + u16 species = GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); + + if (side != B_SIDE_PLAYER) + return AFFECTION_NO_HEARTS; + else if (gSpeciesInfo[species].isMegaEvolution + || (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_BATTLE_TOWER + | BATTLE_TYPE_LINK))) + return AFFECTION_NO_HEARTS; + + return GetMonAffectionHearts(&party[gBattlerPartyIndexes[battler]]); +} + +void CopyMonLevelAndBaseStatsToBattleMon(u32 battler, struct Pokemon *mon) +{ + gBattleMons[battler].level = GetMonData(mon, MON_DATA_LEVEL); + gBattleMons[battler].hp = GetMonData(mon, MON_DATA_HP); + gBattleMons[battler].maxHP = GetMonData(mon, MON_DATA_MAX_HP); + gBattleMons[battler].attack = GetMonData(mon, MON_DATA_ATK); + gBattleMons[battler].defense = GetMonData(mon, MON_DATA_DEF); + gBattleMons[battler].speed = GetMonData(mon, MON_DATA_SPEED); + gBattleMons[battler].spAttack = GetMonData(mon, MON_DATA_SPATK); + gBattleMons[battler].spDefense = GetMonData(mon, MON_DATA_SPDEF); +} + +void CopyMonAbilityAndTypesToBattleMon(u32 battler, struct Pokemon *mon) +{ + gBattleMons[battler].ability = GetMonAbility(mon); + gBattleMons[battler].type1 = gSpeciesInfo[gBattleMons[battler].species].types[0]; + gBattleMons[battler].type2 = gSpeciesInfo[gBattleMons[battler].species].types[1]; + gBattleMons[battler].type3 = TYPE_MYSTERY; +} + +void RecalcBattlerStats(u32 battler, struct Pokemon *mon) +{ + CalculateMonStats(mon); + // TODO: Dynamax + // if (IsDynamaxed(battler) && gChosenActionByBattler[battler] != B_ACTION_SWITCH) + // ApplyDynamaxHPMultiplier(battler, mon); + CopyMonLevelAndBaseStatsToBattleMon(battler, mon); + CopyMonAbilityAndTypesToBattleMon(battler, mon); +} + +bool32 TestIfSheerForceAffected(u32 battler, u16 move) +{ + return GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && MoveIsAffectedBySheerForce(move); +} + +bool32 CanSleep(u32 battler) +{ + u16 ability = GetBattlerAbility(battler); + if (ability == ABILITY_INSOMNIA + || ability == ABILITY_VITAL_SPIRIT + || ability == ABILITY_COMATOSE + || ability == ABILITY_PURIFYING_SALT + || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battler].status1 & STATUS1_ANY + || IsAbilityOnSide(battler, ABILITY_SWEET_VEIL) + || IsAbilityStatusProtected(battler) + || IsBattlerTerrainAffected(battler, STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanBePoisoned(u32 battlerAttacker, u32 battlerTarget) +{ + u16 ability = GetBattlerAbility(battlerTarget); + + if (!(CanPoisonType(battlerAttacker, battlerTarget)) + || gSideStatuses[GetBattlerSide(battlerTarget)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battlerTarget].status1 & STATUS1_ANY + || ability == ABILITY_IMMUNITY + || ability == ABILITY_COMATOSE + || ability == ABILITY_PURIFYING_SALT + || IsAbilityOnSide(battlerTarget, ABILITY_PASTEL_VEIL) + || IsAbilityStatusProtected(battlerTarget) + || IsBattlerTerrainAffected(battlerTarget, STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanBeBurned(u32 battler) +{ + u16 ability = GetBattlerAbility(battler); + if (IS_BATTLER_OF_TYPE(battler, TYPE_FIRE) + || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battler].status1 & STATUS1_ANY + || ability == ABILITY_WATER_VEIL + || ability == ABILITY_WATER_BUBBLE + || ability == ABILITY_COMATOSE + || ability == ABILITY_THERMAL_EXCHANGE + || ability == ABILITY_PURIFYING_SALT + || IsAbilityStatusProtected(battler) + || IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanBeParalyzed(u32 battler) +{ + u16 ability = GetBattlerAbility(battler); + if ((B_PARALYZE_ELECTRIC >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_ELECTRIC)) + || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD + || ability == ABILITY_LIMBER + || ability == ABILITY_COMATOSE + || ability == ABILITY_PURIFYING_SALT + || gBattleMons[battler].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battler) + || IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanBeFrozen(u32 battler) +{ + u16 ability = GetBattlerAbility(battler); + if (IS_BATTLER_OF_TYPE(battler, TYPE_ICE) + || IsBattlerWeatherAffected(battler, B_WEATHER_SUN) + || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD + || ability == ABILITY_MAGMA_ARMOR + || ability == ABILITY_COMATOSE + || ability == ABILITY_PURIFYING_SALT + || gBattleMons[battler].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battler) + || IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanGetFrostbite(u32 battler) +{ + u16 ability = GetBattlerAbility(battler); + if (IS_BATTLER_OF_TYPE(battler, TYPE_ICE) + || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD + || ability == ABILITY_MAGMA_ARMOR + || ability == ABILITY_COMATOSE + || ability == ABILITY_PURIFYING_SALT + || gBattleMons[battler].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battler) + || IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanBeConfused(u32 battler) +{ + if (GetBattlerAbility(battler) == ABILITY_OWN_TEMPO + || gBattleMons[battler].status2 & STATUS2_CONFUSION + || IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN)) + return FALSE; + return TRUE; +} + +bool32 CanStealItem(u32 battlerStealing, u32 battlerItem, u16 item) +{ + u8 stealerSide = GetBattlerSide(battlerStealing); + + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER) + return FALSE; + + // Check if the battler trying to steal should be able to + if (stealerSide == B_SIDE_OPPONENT + && !(gBattleTypeFlags & + (BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_TRAINER_TOWER + | BATTLE_TYPE_LINK + | (B_TRAINERS_KNOCK_OFF_ITEMS == TRUE ? BATTLE_TYPE_TRAINER : 0) + ))) + { + return FALSE; + } + else if (!(gBattleTypeFlags & + (BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_BATTLE_TOWER + | BATTLE_TYPE_LINK)) + && (gWishFutureKnock.knockedOffMons[stealerSide] & gBitTable[gBattlerPartyIndexes[battlerStealing]])) + { + return FALSE; + } + + if (!CanBattlerGetOrLoseItem(battlerItem, item) // Battler with item cannot have it stolen + ||!CanBattlerGetOrLoseItem(battlerStealing, item)) // Stealer cannot take the item + return FALSE; + + return TRUE; +} + +void TrySaveExchangedItem(u32 battler, u16 stolenItem) +{ + // Because BtlController_EmitSetMonData does SetMonData, we need to save the stolen item only if it matches the battler's original + // So, if the player steals an item during battle and has it stolen from it, it will not end the battle with it (naturally) + if (B_TRAINERS_KNOCK_OFF_ITEMS == FALSE) + return; + // If regular trainer battle and mon's original item matches what is being stolen, save it to be restored at end of battle + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER + && !(gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) + && GetBattlerSide(battler) == B_SIDE_PLAYER + && stolenItem == gBattleStruct->itemLost[gBattlerPartyIndexes[battler]].originalItem) + gBattleStruct->itemLost[gBattlerPartyIndexes[battler]].stolen = TRUE; +} + +void RemoveBattlerType(u32 battler, u8 type) +{ + u32 i; + for (i = 0; i < 3; i++) + { + if (*(u8 *)(&gBattleMons[battler].type1 + i) == type) + *(u8 *)(&gBattleMons[battler].type1 + i) = TYPE_MYSTERY; + } +} + +// Returns SPECIES_NONE if no form change is possible +u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method) +{ + u32 i; + u16 targetSpecies = SPECIES_NONE; + u16 species = gBattleMons[battler].species; + const struct FormChange *formChanges = GetSpeciesFormChanges(species); + struct Pokemon *mon = &GetBattlerParty(battler)[gBattlerPartyIndexes[battler]]; + u16 heldItem; + + if (formChanges != NULL) + { + heldItem = gBattleMons[battler].item; + + for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++) + { + if (method == formChanges[i].method && species != formChanges[i].targetSpecies) + { + switch (method) + { + case FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM: + case FORM_CHANGE_BATTLE_PRIMAL_REVERSION: + case FORM_CHANGE_BATTLE_ULTRA_BURST: + if (heldItem == formChanges[i].param1) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE: + if (gBattleMons[battler].moves[0] == formChanges[i].param1 + || gBattleMons[battler].moves[1] == formChanges[i].param1 + || gBattleMons[battler].moves[2] == formChanges[i].param1 + || gBattleMons[battler].moves[3] == formChanges[i].param1) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_BATTLE_SWITCH: + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_BATTLE_HP_PERCENT: + if (formChanges[i].param1 == GetBattlerAbility(battler)) + { + // We multiply by 100 to make sure that integer division doesn't mess with the health check. + u32 hpCheck = gBattleMons[battler].hp * 100 * 100 / gBattleMons[battler].maxHP; + switch(formChanges[i].param2) + { + case HP_HIGHER_THAN: + if (hpCheck > formChanges[i].param3 * 100) + targetSpecies = formChanges[i].targetSpecies; + break; + case HP_LOWER_EQ_THAN: + if (hpCheck <= formChanges[i].param3 * 100) + targetSpecies = formChanges[i].targetSpecies; + break; + } + } + break; + case FORM_CHANGE_BATTLE_GIGANTAMAX: + if (GetMonData(mon, MON_DATA_GIGANTAMAX_FACTOR)) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_BATTLE_WEATHER: + // Check if there is a required ability and if the battler's ability does not match it + // or is suppressed. If so, revert to the no weather form. + if (formChanges[i].param2 + && GetBattlerAbility(battler) != formChanges[i].param2 + && formChanges[i].param1 == B_WEATHER_NONE) + { + targetSpecies = formChanges[i].targetSpecies; + } + // We need to revert the weather form if the field is under Air Lock, too. + else if (!WEATHER_HAS_EFFECT && formChanges[i].param1 == B_WEATHER_NONE) + { + targetSpecies = formChanges[i].targetSpecies; + } + // Otherwise, just check for a match between the weather and the form change table. + // Added a check for whether the weather is in effect to prevent end-of-turn soft locks with Cloud Nine / Air Lock + else if (((gBattleWeather & formChanges[i].param1) && WEATHER_HAS_EFFECT) + || (gBattleWeather == B_WEATHER_NONE && formChanges[i].param1 == B_WEATHER_NONE)) + { + targetSpecies = formChanges[i].targetSpecies; + } + break; + case FORM_CHANGE_BATTLE_TURN_END: + if (formChanges[i].param1 == GetBattlerAbility(battler)) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_STATUS: + if (gBattleMons[battler].status1 & formChanges[i].param1) + targetSpecies = formChanges[i].targetSpecies; + break; + } + } + } + } + + return targetSpecies; +} + +bool32 IsBattlerMegaEvolved(u32 battler) +{ + // While Transform does copy stats and visuals, it shouldn't be counted as true Mega Evolution. + if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED) + return FALSE; + return (gSpeciesInfo[gBattleMons[battler].species].isMegaEvolution); +} + +bool32 IsBattlerPrimalReverted(u32 battler) +{ + // While Transform does copy stats and visuals, it shouldn't be counted as true Primal Revesion. + if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED) + return FALSE; + return (gSpeciesInfo[gBattleMons[battler].species].isPrimalReversion); +} + +bool32 IsBattlerUltraBursted(u32 battler) +{ + // While Transform does copy stats and visuals, it shouldn't be counted as true Ultra Burst. + if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED) + return FALSE; + return (gSpeciesInfo[gBattleMons[battler].species].isUltraBurst); +} + +bool32 CanBattlerFormChange(u32 battler, u16 method) +{ + // Can't change form if transformed. + if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED + && B_TRANSFORM_FORM_CHANGES >= GEN_5) + return FALSE; + // Mega Evolved and Ultra Bursted Pokémon should always revert to normal upon fainting or ending the battle. + if ((IsBattlerMegaEvolved(battler) || IsBattlerUltraBursted(battler)) && (method == FORM_CHANGE_FAINT || method == FORM_CHANGE_END_BATTLE)) + return TRUE; + else if (IsBattlerPrimalReverted(battler) && (method == FORM_CHANGE_END_BATTLE)) + return TRUE; + // TODO: Dynamax + // Gigantamaxed Pokemon should revert upon fainting, switching, or ending the battle. + /* else if (IsGigantamaxed(battler) && (method == FORM_CHANGE_FAINT || method == FORM_CHANGE_BATTLE_SWITCH || method == FORM_CHANGE_END_BATTLE)) + return TRUE; */ + return DoesSpeciesHaveFormChangeMethod(gBattleMons[battler].species, method); +} + +bool32 TryBattleFormChange(u32 battler, u16 method) +{ + u8 monId = gBattlerPartyIndexes[battler]; + u8 side = GetBattlerSide(battler); + struct Pokemon *party = GetBattlerParty(battler); + u16 targetSpecies; + + if (!CanBattlerFormChange(battler, method)) + return FALSE; + + targetSpecies = GetBattleFormChangeTargetSpecies(battler, method); + if (targetSpecies == SPECIES_NONE) + targetSpecies = GetFormChangeTargetSpecies(&party[monId], method, 0); + if (targetSpecies != SPECIES_NONE) + { + // Saves the original species on the first form change. + if (gBattleStruct->changedSpecies[side][monId] == SPECIES_NONE) + gBattleStruct->changedSpecies[side][monId] = gBattleMons[battler].species; + + TryToSetBattleFormChangeMoves(&party[monId], method); + SetMonData(&party[monId], MON_DATA_SPECIES, &targetSpecies); + gBattleMons[battler].species = targetSpecies; + RecalcBattlerStats(battler, &party[monId]); + return TRUE; + } + else if (gBattleStruct->changedSpecies[side][monId] != SPECIES_NONE) + { + bool32 restoreSpecies = FALSE; + + // Mega Evolved and Ultra Bursted Pokémon should always revert to normal upon fainting or ending the battle, so no need to add it to the form change tables. + if ((IsBattlerMegaEvolved(battler) || IsBattlerUltraBursted(battler)) && (method == FORM_CHANGE_FAINT || method == FORM_CHANGE_END_BATTLE)) + restoreSpecies = TRUE; + + // Unlike Megas, Primal Reversion isn't canceled on fainting. + else if (IsBattlerPrimalReverted(battler) && (method == FORM_CHANGE_END_BATTLE)) + restoreSpecies = TRUE; + + // Gigantamax Pokemon have their forms reverted after fainting, switching, or ending the battle. + else if (FALSE /* IsGigantamaxed(battler) */ && (method == FORM_CHANGE_FAINT || method == FORM_CHANGE_BATTLE_SWITCH || method == FORM_CHANGE_END_BATTLE)) + restoreSpecies = TRUE; + + if (restoreSpecies) + { + // Reverts the original species + TryToSetBattleFormChangeMoves(&party[monId], method); + SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[side][monId]); + RecalcBattlerStats(battler, &party[monId]); + return TRUE; + } + } + + return FALSE; +} + +static const u16 sWeatherFlagsInfo[][3] = +{ + [ENUM_WEATHER_RAIN] = {B_WEATHER_RAIN_TEMPORARY, B_WEATHER_RAIN_PERMANENT, HOLD_EFFECT_DAMP_ROCK}, + [ENUM_WEATHER_RAIN_PRIMAL] = {B_WEATHER_RAIN_PRIMAL, B_WEATHER_RAIN_PRIMAL, HOLD_EFFECT_DAMP_ROCK}, + [ENUM_WEATHER_SUN] = {B_WEATHER_SUN_TEMPORARY, B_WEATHER_SUN_PERMANENT, HOLD_EFFECT_HEAT_ROCK}, + [ENUM_WEATHER_SUN_PRIMAL] = {B_WEATHER_SUN_PRIMAL, B_WEATHER_SUN_PRIMAL, HOLD_EFFECT_HEAT_ROCK}, + [ENUM_WEATHER_SANDSTORM] = {B_WEATHER_SANDSTORM_TEMPORARY, B_WEATHER_SANDSTORM_PERMANENT, HOLD_EFFECT_SMOOTH_ROCK}, + [ENUM_WEATHER_HAIL] = {B_WEATHER_HAIL_TEMPORARY, B_WEATHER_HAIL_PERMANENT, HOLD_EFFECT_ICY_ROCK}, + [ENUM_WEATHER_STRONG_WINDS] = {B_WEATHER_STRONG_WINDS, B_WEATHER_STRONG_WINDS, HOLD_EFFECT_NONE}, + [ENUM_WEATHER_SNOW] = {B_WEATHER_SNOW_TEMPORARY, B_WEATHER_SNOW_PERMANENT, HOLD_EFFECT_ICY_ROCK}, +}; + +static void ShouldChangeFormInWeather(u32 battler) +{ + int i; + int side = GetBattlerSide(battler); + struct Pokemon *party = GetSideParty(side); + + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_EISCUE_NOICE_FACE) + gBattleStruct->allowedToChangeFormInWeather[i][side] = TRUE; + else + gBattleStruct->allowedToChangeFormInWeather[i][side] = FALSE; + } +} + +bool32 TryChangeBattleWeather(u32 battler, u32 weatherEnumId, bool32 viaAbility) +{ + u16 battlerAbility = GetBattlerAbility(battler); + if (gBattleWeather & B_WEATHER_PRIMAL_ANY + && battlerAbility != ABILITY_DESOLATE_LAND + && battlerAbility != ABILITY_PRIMORDIAL_SEA + && battlerAbility != ABILITY_DELTA_STREAM) + { + return FALSE; + } + else if (B_ABILITY_WEATHER < GEN_6 && viaAbility && !(gBattleWeather & sWeatherFlagsInfo[weatherEnumId][1])) + { + gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]); + ShouldChangeFormInWeather(battler); + return TRUE; + } + else if (!(gBattleWeather & (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]))) + { + gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0]); + if (GetBattlerHoldEffect(battler, TRUE) == sWeatherFlagsInfo[weatherEnumId][2]) + gWishFutureKnock.weatherDuration = 8; + else + gWishFutureKnock.weatherDuration = 5; + ShouldChangeFormInWeather(battler); + return TRUE; + } + return FALSE; +} + +u16 GetUsedHeldItem(u32 battler) +{ + return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; +} + +void RemoveConfusionStatus(u32 battler) +{ + gBattleMons[battler].status2 &= ~STATUS2_CONFUSION; + gStatuses4[battler] &= ~STATUS4_INFINITE_CONFUSION; +} + +void BufferStatChange(u32 battler, u8 statId, u8 stringId) +{ + bool32 hasContrary = (GetBattlerAbility(battler) == ABILITY_CONTRARY); + + PREPARE_STAT_BUFFER(gBattleTextBuff1, statId); + if (stringId == STRINGID_STATFELL) + { + if (hasContrary) + PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATROSE) + else + PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATFELL) + } + else if (stringId == STRINGID_STATROSE) + { + if (hasContrary) + PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATFELL) + else + PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATROSE) + } + else + { + PREPARE_STRING_BUFFER(gBattleTextBuff2, stringId) + } +} + +bool32 TryRoomService(u32 battler) +{ + if (gFieldStatuses & STATUS_FIELD_TRICK_ROOM && CompareStat(battler, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN)) + { + BufferStatChange(battler, STAT_SPEED, STRINGID_STATFELL); + gEffectBattler = gBattleScripting.battler = battler; + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + gBattleScripting.animArg1 = 14 + STAT_SPEED; + gBattleScripting.animArg2 = 0; + gLastUsedItem = gBattleMons[battler].item; + return TRUE; + } + else + { + return FALSE; + } +} + +// Ingrain, Leech Seed, Strength Sap and Aqua Ring +s32 GetDrainedBigRootHp(u32 battler, s32 hp) +{ + if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_BIG_ROOT) + hp = (hp * 1300) / 1000; + if (hp == 0) + hp = 1; + + return hp * -1; +} + +u8 TryHandleSeed(u32 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 execute) +{ + if (gFieldStatuses & terrainFlag && CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + BufferStatChange(battler, statId, STRINGID_STATROSE); + gLastUsedItem = itemId; // For surge abilities + gEffectBattler = gBattleScripting.battler = battler; + SET_STATCHANGER(statId, 1, FALSE); + gBattleScripting.animArg1 = 14 + statId; + gBattleScripting.animArg2 = 0; + if (execute) + { + BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryStatRaiseRet; + } + return ITEM_STATS_CHANGE; + } + return 0; +} + +static u32 GetBattlerItemHoldEffectParam(u32 battler, u32 item) +{ + if (item == ITEM_ENIGMA_BERRY_E_READER) + return gEnigmaBerries[battler].holdEffectParam; + else + return ItemId_GetHoldEffectParam(item); +} + +static bool32 CanBeInfinitelyConfused(u32 battler) +{ + if (gBattleMons[battler].ability == ABILITY_OWN_TEMPO + || IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN) + || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD) + { + return FALSE; + } + return TRUE; +} + +bool32 IsGen6ExpShareEnabled(void) +{ + if (I_EXP_SHARE_FLAG <= TEMP_FLAGS_END) + return FALSE; + + return FlagGet(I_EXP_SHARE_FLAG); +} + +// Sort an array of battlers by speed +// Useful for effects like pickpocket, eject button, red card, dancer +void SortBattlersBySpeed(u8 *battlers, bool32 slowToFast) +{ + int i, j, currSpeed, currBattler; + u16 speeds[MAX_BATTLERS_COUNT] = {0}; + + for (i = 0; i < gBattlersCount; i++) + speeds[i] = GetBattlerTotalSpeedStat(battlers[i]); + + for (i = 1; i < gBattlersCount; i++) + { + currBattler = battlers[i]; + currSpeed = speeds[i]; + j = i - 1; + + if (slowToFast) + { + while (j >= 0 && speeds[j] > currSpeed) + { + battlers[j + 1] = battlers[j]; + speeds[j + 1] = speeds[j]; + j = j - 1; + } + } + else + { + while (j >= 0 && speeds[j] < currSpeed) + { + battlers[j + 1] = battlers[j]; + speeds[j + 1] = speeds[j]; + j = j - 1; + } + } + + battlers[j + 1] = currBattler; + speeds[j + 1] = currSpeed; + } +} + +bool32 CanBattlerEscape(u32 battler) // no ability check +{ + if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_SHED_SHELL) + return TRUE; + else if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) + return TRUE; + else if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)) + return FALSE; + else if (gStatuses3[battler] & STATUS3_ROOTED) + return FALSE; + else if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) + return FALSE; + else if (gStatuses3[battler] & STATUS3_SKY_DROPPED) return FALSE; else return TRUE; } -// This function is the body of "jumpifstat", but can be used dynamically in a function -bool32 CompareStat(u32 battler, u8 statId, u8 cmpTo, u8 cmpKind) +void SwitchPartyOrderInGameMulti(u8 battler, u8 arg1) { - bool32 ret = FALSE; - u8 statValue = gBattleMons[battler].statStages[statId]; - - // Because this command is used as a way of checking if a stat can be lowered/raised, - // we need to do some modification at run-time. - if (GetBattlerAbility(battler) == ABILITY_CONTRARY) + if (GetBattlerSide(battler) != B_SIDE_OPPONENT) { - if (cmpKind == CMP_GREATER_THAN) - cmpKind = CMP_LESS_THAN; - else if (cmpKind == CMP_LESS_THAN) - cmpKind = CMP_GREATER_THAN; + s32 i; + for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) + gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)); - if (cmpTo == MIN_STAT_STAGE) - cmpTo = MAX_STAT_STAGE; - else if (cmpTo == MAX_STAT_STAGE) - cmpTo = MIN_STAT_STAGE; + SwitchPartyMonSlots(GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]), GetPartyIdFromBattlePartyId(arg1)); + + for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) + *(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; + } +} + +bool32 IsBattlerAffectedByHazards(u32 battler, bool32 toxicSpikes) +{ + bool32 ret = TRUE; + u32 holdEffect = GetBattlerHoldEffect(battler, TRUE); + if (toxicSpikes && holdEffect == HOLD_EFFECT_HEAVY_DUTY_BOOTS && !IS_BATTLER_OF_TYPE(battler, TYPE_POISON)) + { + ret = FALSE; + RecordItemEffectBattle(battler, holdEffect); + } + else if (holdEffect == HOLD_EFFECT_HEAVY_DUTY_BOOTS) + { + ret = FALSE; + RecordItemEffectBattle(battler, holdEffect); + } + return ret; +} + +s32 GetStealthHazardDamageByTypesAndHP(u8 hazardType, u8 type1, u8 type2, u32 maxHp) +{ + s32 dmg = 0; + uq4_12_t modifier = UQ_4_12(1.0); + + modifier = uq4_12_multiply(modifier, GetTypeModifier(hazardType, type1)); + if (type2 != type1) + modifier = uq4_12_multiply(modifier, GetTypeModifier(hazardType, type2)); + + switch (modifier) + { + case UQ_4_12(0.0): + dmg = 0; + break; + case UQ_4_12(0.25): + dmg = maxHp / 32; + if (dmg == 0) + dmg = 1; + break; + case UQ_4_12(0.5): + dmg = maxHp / 16; + if (dmg == 0) + dmg = 1; + break; + case UQ_4_12(1.0): + dmg = maxHp / 8; + if (dmg == 0) + dmg = 1; + break; + case UQ_4_12(2.0): + dmg = maxHp / 4; + if (dmg == 0) + dmg = 1; + break; + case UQ_4_12(4.0): + dmg = maxHp / 2; + if (dmg == 0) + dmg = 1; + break; } - switch (cmpKind) + return dmg; +} + +s32 GetStealthHazardDamage(u8 hazardType, u32 battler) +{ + u8 type1 = gBattleMons[battler].type1; + u8 type2 = gBattleMons[battler].type2; + u32 maxHp = gBattleMons[battler].maxHP; + + return GetStealthHazardDamageByTypesAndHP(hazardType, type1, type2, maxHp); +} + +bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) +{ + u32 ability = GetBattlerAbility(battlerAtk); + + if (gSideTimers[defSide].followmeTimer == 0 + || gBattleMons[gSideTimers[defSide].followmeTarget].hp == 0 + || gMovesInfo[move].effect == EFFECT_SNIPE_SHOT + || gMovesInfo[move].effect == EFFECT_SKY_DROP + || ability == ABILITY_PROPELLER_TAIL || ability == ABILITY_STALWART) + return FALSE; + + if (gSideTimers[defSide].followmePowder && !IsAffectedByPowder(battlerAtk, ability, GetBattlerHoldEffect(battlerAtk, TRUE))) + return FALSE; + + return TRUE; +} + +bool32 DoBattlersShareType(u32 battler1, u32 battler2) +{ + s32 i; + u8 types1[3] = {GetBattlerType(battler1, 0), GetBattlerType(battler1, 1), GetBattlerType(battler1, 2)}; + u8 types2[3] = {GetBattlerType(battler2, 0), GetBattlerType(battler2, 1), GetBattlerType(battler2, 2)}; + + if (types1[2] == TYPE_MYSTERY) + types1[2] = types1[0]; + if (types2[2] == TYPE_MYSTERY) + types2[2] = types2[0]; + + for (i = 0; i < 3; i++) { - case CMP_EQUAL: - if (statValue == cmpTo) - ret = TRUE; - break; - case CMP_NOT_EQUAL: - if (statValue != cmpTo) - ret = TRUE; - break; - case CMP_GREATER_THAN: - if (statValue > cmpTo) - ret = TRUE; - break; - case CMP_LESS_THAN: - if (statValue < cmpTo) - ret = TRUE; - break; - case CMP_COMMON_BITS: - if (statValue & cmpTo) - ret = TRUE; - break; - case CMP_NO_COMMON_BITS: - if (!(statValue & cmpTo)) - ret = TRUE; - break; + if (types1[i] == types2[0] || types1[i] == types2[1] || types1[i] == types2[2]) + return TRUE; + } + + return FALSE; +} + +bool32 MoveHasChargeTurnAdditionalEffect(u32 move) +{ + u32 i; + for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + { + if (gMovesInfo[move].additionalEffects[i].onChargeTurnOnly) + return TRUE; + } + return FALSE; +} + +bool32 IsPartnerMonFromSameTrainer(u32 battler) +{ + if (GetBattlerSide(battler) == B_SIDE_OPPONENT && gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + return FALSE; + else if (GetBattlerSide(battler) == B_SIDE_PLAYER && gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + return FALSE; + else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + return FALSE; + else + return TRUE; +} + + + +// battle_ai_util.c +bool32 IsHealingMove(u32 move) +{ + return gMovesInfo[move].healingMove; +} + +void RecordKnownMove(u32 battlerId, u32 move) +{ + s32 i; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (BATTLE_HISTORY->usedMoves[battlerId][i] == move) + break; + if (BATTLE_HISTORY->usedMoves[battlerId][i] == MOVE_NONE) + { + BATTLE_HISTORY->usedMoves[battlerId][i] = move; + // TODO: AI + // AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].moves[i] = move; + break; + } + } +} + +s32 CountUsablePartyMons(u32 battlerId) +{ + s32 battlerOnField1, battlerOnField2, i, ret; + struct Pokemon *party; + + if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + battlerOnField1 = gBattlerPartyIndexes[battlerId]; + battlerOnField2 = gBattlerPartyIndexes[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(battlerId)))]; + } + else // In singles there's only one battlerId by side. + { + battlerOnField1 = gBattlerPartyIndexes[battlerId]; + battlerOnField2 = gBattlerPartyIndexes[battlerId]; + } + + ret = 0; + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != battlerOnField1 && i != battlerOnField2 + && GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) + { + ret++; + } } return ret; } + +bool32 IsAiVsAiBattle(void) +{ + // TODO: Flag? + return (B_FLAG_AI_VS_AI_BATTLE && FlagGet(B_FLAG_AI_VS_AI_BATTLE)); +} + +void RecordLastUsedMoveBy(u32 battlerId, u32 move) +{ + u8 *index = &BATTLE_HISTORY->moveHistoryIndex[battlerId]; + + if (++(*index) >= AI_MOVE_HISTORY_COUNT) + *index = 0; + BATTLE_HISTORY->moveHistory[battlerId][*index] = move; +} + +bool32 BattlerHasAi(u32 battlerId) +{ + switch (GetBattlerPosition(battlerId)) + { + case B_POSITION_PLAYER_LEFT: + if (IsAiVsAiBattle()) + return TRUE; + default: + return FALSE; + case B_POSITION_OPPONENT_LEFT: + return TRUE; + case B_POSITION_PLAYER_RIGHT: + if ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) || IsAiVsAiBattle()) + return TRUE; + else + return FALSE; + case B_POSITION_OPPONENT_RIGHT: + return TRUE; + } +} + +void ClearBattlerItemEffectHistory(u32 battlerId) +{ + BATTLE_HISTORY->itemEffects[battlerId] = 0; +} + +// move checks +bool32 IsAffectedByPowder(u32 battler, u32 ability, u32 holdEffect) +{ + if (ability == ABILITY_OVERCOAT + || (B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GRASS)) + || holdEffect == HOLD_EFFECT_SAFETY_GOGGLES) + return FALSE; + return TRUE; +} + +void RecordAllMoves(u32 battler) +{ + // TODO: AI + // memcpy(AI_PARTY->mons[GetBattlerSide(battler)][gBattlerPartyIndexes[battler]].moves, gBattleMons[battler].moves, MAX_MON_MOVES * sizeof(u16)); +} + + +// end battle_ai_util.c \ No newline at end of file diff --git a/src/battle_util2.c b/src/battle_util2.c index 8a5fbccf6..05a38bfa6 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -75,7 +75,7 @@ void FreeBattleResources(void) } } -void AdjustFriendshipOnBattleFaint(u8 battlerId) +void AdjustFriendshipOnBattleFaint(u8 battler) { u8 opposingBattlerId; @@ -94,15 +94,15 @@ void AdjustFriendshipOnBattleFaint(u8 battlerId) opposingBattlerId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); } - if (gBattleMons[opposingBattlerId].level > gBattleMons[battlerId].level) + if (gBattleMons[opposingBattlerId].level > gBattleMons[battler].level) { - if (gBattleMons[opposingBattlerId].level - gBattleMons[battlerId].level > 29) - AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], FRIENDSHIP_EVENT_FAINT_LARGE); + if (gBattleMons[opposingBattlerId].level - gBattleMons[battler].level > 29) + AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battler]], FRIENDSHIP_EVENT_FAINT_LARGE); else - AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], FRIENDSHIP_EVENT_FAINT_SMALL); + AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battler]], FRIENDSHIP_EVENT_FAINT_SMALL); } else { - AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], FRIENDSHIP_EVENT_FAINT_SMALL); + AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battler]], FRIENDSHIP_EVENT_FAINT_SMALL); } } diff --git a/src/data.c b/src/data.c index 76889a715..6ba84360c 100644 --- a/src/data.c +++ b/src/data.c @@ -284,22 +284,12 @@ const union AnimCmd *const gAnims_MonPic[] = #define TRAINER_SPRITE(trainerPic, sprite, size) [TRAINER_PIC_##trainerPic] = {sprite, size, TRAINER_PIC_##trainerPic} #define TRAINER_PAL(trainerPic, pal) [TRAINER_PIC_##trainerPic] = {pal, TRAINER_PIC_##trainerPic} -#include "data/pokemon_graphics/front_pic_coordinates.h" -#include "data/pokemon_graphics/front_pic_table.h" -#include "data/pokemon_graphics/back_pic_coordinates.h" -#include "data/pokemon_graphics/back_pic_table.h" -#include "data/pokemon_graphics/palette_table.h" -#include "data/pokemon_graphics/shiny_palette_table.h" - #include "data/trainer_graphics/front_pic_anims.h" #include "data/trainer_graphics/front_pic_tables.h" #include "data/trainer_graphics/back_pic_anims.h" #include "data/trainer_graphics/back_pic_tables.h" -#include "data/pokemon_graphics/enemy_mon_elevation.h" - #include "data/trainer_parties.h" #include "data/text/trainer_class_names.h" #include "data/trainers.h" -#include "data/text/species_names.h" #include "data/text/move_names.h" diff --git a/src/data/battle_move_effects.h b/src/data/battle_move_effects.h new file mode 100644 index 000000000..ca8711333 --- /dev/null +++ b/src/data/battle_move_effects.h @@ -0,0 +1,1886 @@ +#include "battle.h" +#include "battle_scripts.h" +#include "constants/battle_move_effects.h" + +// TODO: use correct battlescripts, currently replaced with _EffectHit +const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = +{ + [EFFECT_PLACEHOLDER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SLEEP] = + { + .battleScript = BattleScript_EffectSleep, + }, + + [EFFECT_ABSORB] = + { + .battleScript = BattleScript_EffectAbsorb, + }, + + [EFFECT_EXPLOSION] = + { + .battleScript = BattleScript_EffectExplosion, + }, + + [EFFECT_DREAM_EATER] = + { + .battleScript = BattleScript_EffectDreamEater, + .encourageEncore = TRUE, + }, + + [EFFECT_MIRROR_MOVE] = + { + .battleScript = BattleScript_EffectMirrorMove, + }, + + [EFFECT_ATTACK_UP] = + { + .battleScript = BattleScript_EffectAttackUp, + .encourageEncore = TRUE, + }, + + [EFFECT_DEFENSE_UP] = + { + .battleScript = BattleScript_EffectDefenseUp, + .encourageEncore = TRUE, + }, + + [EFFECT_SPEED_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SPECIAL_ATTACK_UP] = + { + .battleScript = BattleScript_EffectSpecialAttackUp, + .encourageEncore = TRUE, + }, + + [EFFECT_SPECIAL_DEFENSE_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ACCURACY_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_EVASION_UP] = + { + .battleScript = BattleScript_EffectEvasionUp, + }, + + [EFFECT_SPECIAL_ATTACK_UP_3] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ATTACK_DOWN] = + { + .battleScript = BattleScript_EffectAttackDown, + }, + + [EFFECT_DEFENSE_DOWN] = + { + .battleScript = BattleScript_EffectDefenseDown, + }, + + [EFFECT_SPEED_DOWN] = + { + .battleScript = BattleScript_EffectSpeedDown, + }, + + [EFFECT_SPECIAL_ATTACK_DOWN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPECIAL_DEFENSE_DOWN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ACCURACY_DOWN] = + { + .battleScript = BattleScript_EffectAccuracyDown, + }, + + [EFFECT_EVASION_DOWN] = + { + .battleScript = BattleScript_EffectEvasionDown, + }, + + [EFFECT_HAZE] = + { + .battleScript = BattleScript_EffectHaze, + .encourageEncore = TRUE, + }, + + [EFFECT_BIDE] = + { + .battleScript = BattleScript_EffectBide, + }, + + [EFFECT_ROAR] = + { + .battleScript = BattleScript_EffectRoar, + .encourageEncore = TRUE, + }, + + [EFFECT_MULTI_HIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_CONVERSION] = + { + .battleScript = BattleScript_EffectConversion, + .encourageEncore = TRUE, + }, + + [EFFECT_RESTORE_HP] = + { + .battleScript = BattleScript_EffectRestoreHp, + .encourageEncore = TRUE, + }, + + [EFFECT_TOXIC] = + { + .battleScript = BattleScript_EffectToxic, + .encourageEncore = TRUE, + }, + + [EFFECT_LIGHT_SCREEN] = + { + .battleScript = BattleScript_EffectLightScreen, + .encourageEncore = TRUE, + }, + + [EFFECT_REST] = + { + .battleScript = BattleScript_EffectRest, + .encourageEncore = TRUE, + }, + + [EFFECT_OHKO] = + { + .battleScript = BattleScript_EffectOHKO, + }, + + [EFFECT_FUSION_COMBO] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SUPER_FANG] = + { + .battleScript = BattleScript_EffectSuperFang, + .encourageEncore = TRUE, + }, + + [EFFECT_FIXED_DAMAGE_ARG] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HEAL_BLOCK] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_RECOIL_IF_MISS] = + { + .battleScript = BattleScript_EffectRecoilIfMiss, + }, + + [EFFECT_MIST] = + { + .battleScript = BattleScript_EffectMist, + .encourageEncore = TRUE, + }, + + [EFFECT_FOCUS_ENERGY] = + { + .battleScript = BattleScript_EffectFocusEnergy, + .encourageEncore = TRUE, + }, + + [EFFECT_CONFUSE] = + { + .battleScript = BattleScript_EffectConfuse, + .encourageEncore = TRUE, + }, + + [EFFECT_ATTACK_UP_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_DEFENSE_UP_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SPEED_UP_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SPECIAL_ATTACK_UP_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SPECIAL_DEFENSE_UP_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ACCURACY_UP_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_EVASION_UP_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TRANSFORM] = + { + .battleScript = BattleScript_EffectTransform, + }, + + [EFFECT_ATTACK_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_DEFENSE_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPEED_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPECIAL_ATTACK_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPECIAL_DEFENSE_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ACCURACY_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_EVASION_DOWN_2] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_REFLECT] = + { + .battleScript = BattleScript_EffectReflect, + .encourageEncore = TRUE, + }, + + [EFFECT_POISON] = + { + .battleScript = BattleScript_EffectPoison, + .encourageEncore = TRUE, + }, + + [EFFECT_PARALYZE] = + { + .battleScript = BattleScript_EffectParalyze, + .encourageEncore = TRUE, + }, + + [EFFECT_TWO_TURNS_ATTACK] = + { + .battleScript = BattleScript_EffectHit, + .twoTurnEffect = TRUE, + }, + + [EFFECT_SUBSTITUTE] = + { + .battleScript = BattleScript_EffectSubstitute, + }, + + [EFFECT_RAGE] = + { + .battleScript = BattleScript_EffectRage, + }, + + [EFFECT_MIMIC] = + { + .battleScript = BattleScript_EffectMimic, + }, + + [EFFECT_METRONOME] = + { + .battleScript = BattleScript_EffectMetronome, + }, + + [EFFECT_LEECH_SEED] = + { + .battleScript = BattleScript_EffectLeechSeed, + .encourageEncore = TRUE, + }, + + [EFFECT_DO_NOTHING] = + { + .battleScript = BattleScript_EffectDoNothing, + .encourageEncore = TRUE, + }, + + [EFFECT_DISABLE] = + { + .battleScript = BattleScript_EffectDisable, + }, + + [EFFECT_LEVEL_DAMAGE] = + { + .battleScript = BattleScript_EffectLevelDamage, + }, + + [EFFECT_PSYWAVE] = + { + .battleScript = BattleScript_EffectPsywave, + }, + + [EFFECT_COUNTER] = + { + .battleScript = BattleScript_EffectCounter, + .encourageEncore = TRUE, + }, + + [EFFECT_ENCORE] = + { + .battleScript = BattleScript_EffectEncore, + }, + + [EFFECT_PAIN_SPLIT] = + { + .battleScript = BattleScript_EffectPainSplit, + }, + + [EFFECT_SNORE] = + { + .battleScript = BattleScript_EffectSnore, + }, + + [EFFECT_CONVERSION_2] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_LOCK_ON] = + { + .battleScript = BattleScript_EffectLockOn, + .encourageEncore = TRUE, + }, + + [EFFECT_SKETCH] = + { + .battleScript = BattleScript_EffectSketch, + }, + + [EFFECT_SLEEP_TALK] = + { + .battleScript = BattleScript_EffectSleepTalk, + .encourageEncore = TRUE, + }, + + [EFFECT_DESTINY_BOND] = + { + .battleScript = BattleScript_EffectDestinyBond, + }, + + [EFFECT_FLAIL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPITE] = + { + .battleScript = BattleScript_EffectSpite, + }, + + [EFFECT_FALSE_SWIPE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HEAL_BELL] = + { + .battleScript = BattleScript_EffectHealBell, + .encourageEncore = TRUE, + }, + + [EFFECT_TRIPLE_KICK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MEAN_LOOK] = + { + .battleScript = BattleScript_EffectMeanLook, + .encourageEncore = TRUE, + }, + + [EFFECT_NIGHTMARE] = + { + .battleScript = BattleScript_EffectNightmare, + .encourageEncore = TRUE, + }, + + [EFFECT_MINIMIZE] = + { + .battleScript = BattleScript_EffectMinimize, + }, + + [EFFECT_CURSE] = + { + .battleScript = BattleScript_EffectCurse, + .encourageEncore = TRUE, + }, + + [EFFECT_HEALING_WISH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PROTECT] = + { + .battleScript = BattleScript_EffectProtect, + .encourageEncore = TRUE, + .usesProtectCounter = TRUE, + }, + + [EFFECT_SPIKES] = + { + .battleScript = BattleScript_EffectSpikes, + }, + + [EFFECT_FORESIGHT] = + { + .battleScript = BattleScript_EffectForesight, + .encourageEncore = TRUE, + }, + + [EFFECT_PERISH_SONG] = + { + .battleScript = BattleScript_EffectPerishSong, + .encourageEncore = TRUE, + }, + + [EFFECT_SANDSTORM] = + { + .battleScript = BattleScript_EffectSandstorm, + .encourageEncore = TRUE, + }, + + [EFFECT_ENDURE] = + { + .battleScript = BattleScript_EffectEndure, + .encourageEncore = TRUE, + .usesProtectCounter = TRUE, + }, + + [EFFECT_ROLLOUT] = + { + .battleScript = BattleScript_EffectRollout, + }, + + [EFFECT_SWAGGER] = + { + .battleScript = BattleScript_EffectSwagger, + .encourageEncore = TRUE, + }, + + [EFFECT_FURY_CUTTER] = + { + .battleScript = BattleScript_EffectFuryCutter, + }, + + [EFFECT_ATTRACT] = + { + .battleScript = BattleScript_EffectAttract, + .encourageEncore = TRUE, + }, + + [EFFECT_RETURN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PRESENT] = + { + .battleScript = BattleScript_EffectPresent, + }, + + [EFFECT_FRUSTRATION] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SAFEGUARD] = + { + .battleScript = BattleScript_EffectSafeguard, + .encourageEncore = TRUE, + }, + + [EFFECT_MAGNITUDE] = + { + .battleScript = BattleScript_EffectMagnitude, + }, + + [EFFECT_BATON_PASS] = + { + .battleScript = BattleScript_EffectBatonPass, + }, + + [EFFECT_PURSUIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_CAPTIVATE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MORNING_SUN] = + { + .battleScript = BattleScript_EffectMorningSun, + .encourageEncore = TRUE, + }, + + [EFFECT_SYNTHESIS] = + { + .battleScript = BattleScript_EffectSynthesis, + .encourageEncore = TRUE, + }, + + [EFFECT_MOONLIGHT] = + { + .battleScript = BattleScript_EffectMoonlight, + .encourageEncore = TRUE, + }, + + [EFFECT_HIDDEN_POWER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RAIN_DANCE] = + { + .battleScript = BattleScript_EffectRainDance, + .encourageEncore = TRUE, + }, + + [EFFECT_SUNNY_DAY] = + { + .battleScript = BattleScript_EffectSunnyDay, + .encourageEncore = TRUE, + }, + + [EFFECT_FELL_STINGER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BELLY_DRUM] = + { + .battleScript = BattleScript_EffectBellyDrum, + .encourageEncore = TRUE, + }, + + [EFFECT_PSYCH_UP] = + { + .battleScript = BattleScript_EffectPsychUp, + .encourageEncore = TRUE, + }, + + [EFFECT_MIRROR_COAT] = + { + .battleScript = BattleScript_EffectMirrorCoat, + .encourageEncore = TRUE, + }, + + [EFFECT_EARTHQUAKE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FUTURE_SIGHT] = + { + .battleScript = BattleScript_EffectFutureSight, + .encourageEncore = TRUE, + }, + + [EFFECT_SOLAR_BEAM] = + { + .battleScript = BattleScript_EffectHit, + .twoTurnEffect = TRUE, + }, + + [EFFECT_THUNDER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TELEPORT] = + { + .battleScript = BattleScript_EffectTeleport, + }, + + [EFFECT_BEAT_UP] = + { + .battleScript = BattleScript_EffectBeatUp, + }, + + [EFFECT_SEMI_INVULNERABLE] = + { + .battleScript = BattleScript_EffectHit, + .twoTurnEffect = TRUE, + .semiInvulnerableEffect = TRUE, + }, + + [EFFECT_DEFENSE_CURL] = + { + .battleScript = BattleScript_EffectDefenseCurl, + .encourageEncore = TRUE, + }, + + [EFFECT_SOFTBOILED] = + { + .battleScript = BattleScript_EffectSoftboiled, + .encourageEncore = TRUE, + }, + + [EFFECT_FIRST_TURN_ONLY] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_UPROAR] = + { + .battleScript = BattleScript_EffectUproar, + }, + + [EFFECT_STOCKPILE] = + { + .battleScript = BattleScript_EffectStockpile, + .encourageEncore = TRUE, + }, + + [EFFECT_SPIT_UP] = + { + .battleScript = BattleScript_EffectSpitUp, + .encourageEncore = TRUE, + }, + + [EFFECT_SWALLOW] = + { + .battleScript = BattleScript_EffectSwallow, + .encourageEncore = TRUE, + }, + + [EFFECT_WORRY_SEED] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_HAIL] = + { + .battleScript = BattleScript_EffectHail, + .encourageEncore = TRUE, + }, + + [EFFECT_TORMENT] = + { + .battleScript = BattleScript_EffectTorment, + .encourageEncore = TRUE, + }, + + [EFFECT_FLATTER] = + { + .battleScript = BattleScript_EffectFlatter, + }, + + [EFFECT_WILL_O_WISP] = + { + .battleScript = BattleScript_EffectWillOWisp, + .encourageEncore = TRUE, + }, + + [EFFECT_MEMENTO] = + { + .battleScript = BattleScript_EffectMemento, + }, + + [EFFECT_FACADE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FOCUS_PUNCH] = + { + .battleScript = BattleScript_EffectFocusPunch, + }, + + [EFFECT_DOUBLE_POWER_ON_ARG_STATUS] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FOLLOW_ME] = + { + .battleScript = BattleScript_EffectFollowMe, + .encourageEncore = TRUE, + }, + + [EFFECT_NATURE_POWER] = + { + .battleScript = BattleScript_EffectNaturePower, + }, + + [EFFECT_CHARGE] = + { + .battleScript = BattleScript_EffectCharge, + .encourageEncore = TRUE, + }, + + [EFFECT_TAUNT] = + { + .battleScript = BattleScript_EffectTaunt, + }, + + [EFFECT_HELPING_HAND] = + { + .battleScript = BattleScript_EffectHelpingHand, + }, + + [EFFECT_TRICK] = + { + .battleScript = BattleScript_EffectTrick, + .encourageEncore = TRUE, + }, + + [EFFECT_ROLE_PLAY] = + { + .battleScript = BattleScript_EffectRolePlay, + .encourageEncore = TRUE, + }, + + [EFFECT_WISH] = + { + .battleScript = BattleScript_EffectWish, + }, + + [EFFECT_ASSIST] = + { + .battleScript = BattleScript_EffectAssist, + }, + + [EFFECT_INGRAIN] = + { + .battleScript = BattleScript_EffectIngrain, + .encourageEncore = TRUE, + }, + + [EFFECT_MAGIC_COAT] = + { + .battleScript = BattleScript_EffectMagicCoat, + }, + + [EFFECT_RECYCLE] = + { + .battleScript = BattleScript_EffectRecycle, + .encourageEncore = TRUE, + }, + + [EFFECT_REVENGE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BRICK_BREAK] = + { + .battleScript = BattleScript_EffectBrickBreak, + }, + + [EFFECT_YAWN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_KNOCK_OFF] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ENDEAVOR] = + { + .battleScript = BattleScript_EffectEndeavor, + }, + + [EFFECT_ERUPTION] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SKILL_SWAP] = + { + .battleScript = BattleScript_EffectSkillSwap, + .encourageEncore = TRUE, + }, + + [EFFECT_IMPRISON] = + { + .battleScript = BattleScript_EffectImprison, + .encourageEncore = TRUE, + }, + + [EFFECT_REFRESH] = + { + .battleScript = BattleScript_EffectRefresh, + .encourageEncore = TRUE, + }, + + [EFFECT_GRUDGE] = + { + .battleScript = BattleScript_EffectGrudge, + .encourageEncore = TRUE, + }, + + [EFFECT_SNATCH] = + { + .battleScript = BattleScript_EffectSnatch, + }, + + [EFFECT_LOW_KICK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HIT_ESCAPE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MUD_SPORT] = + { + .battleScript = BattleScript_EffectMudSport, + .encourageEncore = TRUE, + }, + + [EFFECT_WEATHER_BALL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TICKLE] = + { + .battleScript = BattleScript_EffectTickle, + }, + + [EFFECT_COSMIC_POWER] = + { + .battleScript = BattleScript_EffectCosmicPower, + .encourageEncore = TRUE, + }, + + [EFFECT_BULK_UP] = + { + .battleScript = BattleScript_EffectBulkUp, + .encourageEncore = TRUE, + }, + + [EFFECT_WATER_SPORT] = + { + .battleScript = BattleScript_EffectWaterSport, + .encourageEncore = TRUE, + }, + + [EFFECT_CALM_MIND] = + { + .battleScript = BattleScript_EffectCalmMind, + .encourageEncore = TRUE, + }, + + [EFFECT_DRAGON_DANCE] = + { + .battleScript = BattleScript_EffectDragonDance, + .encourageEncore = TRUE, + }, + + [EFFECT_CAMOUFLAGE] = + { + .battleScript = BattleScript_EffectCamouflage, + .encourageEncore = TRUE, + }, + + [EFFECT_PLEDGE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FLING] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_NATURAL_GIFT] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_VARY_POWER_BASED_ON_HP] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ASSURANCE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TRUMP_CARD] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ACROBATICS] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HEAT_CRASH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PUNISHMENT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_STORED_POWER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ELECTRO_BALL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GYRO_BALL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ECHOED_VOICE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PAYBACK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ROUND] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BRINE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RETALIATE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BULLDOZE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FOUL_PLAY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PSYSHOCK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ROOST] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_GRAVITY] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_MIRACLE_EYE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_TAILWIND] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_EMBARGO] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_AQUA_RING] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_TRICK_ROOM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_WONDER_ROOM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MAGIC_ROOM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MAGNET_RISE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_TOXIC_SPIKES] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GASTRO_ACID] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_STEALTH_ROCK] = + { + .battleScript = BattleScript_EffectStealthRock, + .encourageEncore = TRUE, + }, + + [EFFECT_TELEKINESIS] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_POWER_SWAP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_GUARD_SWAP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_HEART_SWAP] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_POWER_SPLIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GUARD_SPLIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_STICKY_WEB] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_METAL_BURST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_LUCKY_CHANT] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SUCKER_PUNCH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SIMPLE_BEAM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ENTRAINMENT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HEAL_PULSE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_QUASH] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ION_DELUGE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FREEZE_DRY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TOPSY_TURVY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MISTY_TERRAIN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GRASSY_TERRAIN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ELECTRIC_TERRAIN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PSYCHIC_TERRAIN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ATTACK_ACCURACY_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ATTACK_SPATK_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_TWO_TYPED_MOVE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ME_FIRST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_QUIVER_DANCE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_COIL] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ELECTRIFY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_REFLECT_TYPE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SOAK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GROWTH] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_LAST_RESORT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SHELL_SMASH] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SHIFT_GEAR] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_DEFENSE_UP_3] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_NOBLE_ROAR] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_VENOM_DRENCH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TOXIC_THREAD] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HIT_SWITCH_TARGET] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FINAL_GAMBIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_CHANGE_TYPE_ON_ITEM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_AUTOTOMIZE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_COPYCAT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_DEFOG] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_HIT_ENEMY_HEAL_ALLY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SYNCHRONOISE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PSYCHO_SHIFT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_POWER_TRICK] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_AFTER_YOU] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_BESTOW] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ROTOTILLER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FLOWER_SHIELD] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPEED_SWAP] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_REVELATION_DANCE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_AURORA_VEIL] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_THIRD_TYPE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ACUPRESSURE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_AROMATIC_MIST] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_POWDER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BELCH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PARTING_SHOT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MAT_BLOCK] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_STOMPING_TANTRUM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_INSTRUCT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_LASER_FOCUS] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_MAGNETIC_FLUX] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_GEAR_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_STRENGTH_SAP] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MIND_BLOWN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PURIFY] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_FAIL_IF_NOT_ARG_TYPE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SHORE_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_GEOMANCY] = + { + .battleScript = BattleScript_EffectHit, + .twoTurnEffect = TRUE, + }, + + [EFFECT_FAIRY_LOCK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_ALLY_SWITCH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RELIC_SONG] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BODY_PRESS] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_EERIE_SPELL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_JUNGLE_HEALING] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_COACHING] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_LASH_OUT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GRASSY_GLIDE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_DYNAMAX_DOUBLE_DMG] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_DECORATE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_SNIPE_SHOT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RECOIL_HP_25] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_STUFF_CHEEKS] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_GRAV_APPLE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GLITZY_GLOW] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BADDY_BAD] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SAPPY_SEED] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FREEZY_FROST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SPARKLY_SWIRL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PLASMA_FISTS] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HYPERSPACE_FURY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_AURA_WHEEL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PHOTON_GEYSER] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SHELL_SIDE_ARM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TERRAIN_PULSE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_NO_RETREAT] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_TAR_SHOT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_POLTERGEIST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_OCTOLOCK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_CLANGOROUS_SOUL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BOLT_BEAK] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SKY_DROP] = + { + .battleScript = BattleScript_EffectHit, + .twoTurnEffect = TRUE, + .semiInvulnerableEffect = TRUE, + }, + + [EFFECT_EXPANDING_FORCE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RISING_VOLTAGE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BEAK_BLAST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_COURT_CHANGE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MAX_HP_50_RECOIL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_EXTREME_EVOBOOST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HIT_SET_REMOVE_TERRAIN] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_DARK_VOID] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_VICTORY_DANCE] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_TEATIME] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_ATTACK_UP_USER_ALLY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SHELL_TRAP] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_PSYBLADE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_HYDRO_STEAM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_REVIVAL_BLESSING] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SNOWSCAPE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TAKE_HEART] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_COLLISION_COURSE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_CORROSIVE_GAS] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_POPULATION_BOMB] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SALT_CURE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_CHILLY_RECEPTION] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_MAX_MOVE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_GLAIVE_RUSH] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RAGING_BULL] = + { + .battleScript = BattleScript_EffectBrickBreak, + }, + + [EFFECT_RAGE_FIST] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_DOODLE] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FILLET_AWAY] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_IVY_CUDGEL] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_FICKLE_BEAM] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_BLIZZARD] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_RAIN_ALWAYS_HIT] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_SHED_TAIL] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_UPPER_HAND] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, + + [EFFECT_DRAGON_CHEER] = + { + .battleScript = BattleScript_EffectFocusEnergy, + .encourageEncore = TRUE, + }, + + [EFFECT_LAST_RESPECTS] = + { + .battleScript = BattleScript_EffectHit, + }, + + [EFFECT_TIDY_UP] = + { + .battleScript = BattleScript_EffectHit, + .encourageEncore = TRUE, + }, +}; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h deleted file mode 100644 index 23c22dfcd..000000000 --- a/src/data/battle_moves.h +++ /dev/null @@ -1,12444 +0,0 @@ -const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = -{ - [MOVE_NONE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 0, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_POUND] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_KARATE_CHOP] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 50, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DOUBLE_SLAP] = - { - .effect = EFFECT_MULTI_HIT, - .power = 15, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_COMET_PUNCH] = - { - .effect = EFFECT_MULTI_HIT, - .power = 18, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MEGA_PUNCH] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_PAY_DAY] = - { - .effect = EFFECT_PAY_DAY, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FIRE_PUNCH] = - { - .effect = EFFECT_BURN_HIT, - .power = 75, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ICE_PUNCH] = - { - .effect = EFFECT_FREEZE_HIT, - .power = 75, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_THUNDER_PUNCH] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 75, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SCRATCH] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_VICE_GRIP] = - { - .effect = EFFECT_HIT, - .power = 55, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_GUILLOTINE] = - { - .effect = EFFECT_OHKO, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 30, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_RAZOR_WIND] = - { - .effect = EFFECT_RAZOR_WIND, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SWORDS_DANCE] = - { - .effect = EFFECT_ATTACK_UP_2, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_CUT] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 95, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_GUST] = - { - .effect = EFFECT_GUST, - .power = 40, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_WING_ATTACK] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_WHIRLWIND] = - { - .effect = EFFECT_ROAR, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -6, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FLY] = - { - .effect = EFFECT_SEMI_INVULNERABLE, - .power = 70, - .type = TYPE_FLYING, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BIND] = - { - .effect = EFFECT_TRAP, - .power = 15, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SLAM] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_VINE_WHIP] = - { - .effect = EFFECT_HIT, - .power = 35, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_STOMP] = - { - .effect = EFFECT_FLINCH_MINIMIZE_HIT, - .power = 65, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DOUBLE_KICK] = - { - .effect = EFFECT_DOUBLE_HIT, - .power = 30, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MEGA_KICK] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_JUMP_KICK] = - { - .effect = EFFECT_RECOIL_IF_MISS, - .power = 70, - .type = TYPE_FIGHTING, - .accuracy = 95, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ROLLING_KICK] = - { - .effect = EFFECT_FLINCH_HIT, - .power = 60, - .type = TYPE_FIGHTING, - .accuracy = 85, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SAND_ATTACK] = - { - .effect = EFFECT_ACCURACY_DOWN, - .power = 0, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HEADBUTT] = - { - .effect = EFFECT_FLINCH_HIT, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HORN_ATTACK] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FURY_ATTACK] = - { - .effect = EFFECT_MULTI_HIT, - .power = 15, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_HORN_DRILL] = - { - .effect = EFFECT_OHKO, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 30, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_TACKLE] = - { - .effect = EFFECT_HIT, - .power = 35, - .type = TYPE_NORMAL, - .accuracy = 95, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BODY_SLAM] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 85, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_WRAP] = - { - .effect = EFFECT_TRAP, - .power = 15, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_TAKE_DOWN] = - { - .effect = EFFECT_RECOIL, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_THRASH] = - { - .effect = EFFECT_RAMPAGE, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_RANDOM, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DOUBLE_EDGE] = - { - .effect = EFFECT_DOUBLE_EDGE, - .power = 120, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_TAIL_WHIP] = - { - .effect = EFFECT_DEFENSE_DOWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_POISON_STING] = - { - .effect = EFFECT_POISON_HIT, - .power = 15, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_TWINEEDLE] = - { - .effect = EFFECT_TWINEEDLE, - .power = 25, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PIN_MISSILE] = - { - .effect = EFFECT_MULTI_HIT, - .power = 14, - .type = TYPE_BUG, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_LEER] = - { - .effect = EFFECT_DEFENSE_DOWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BITE] = - { - .effect = EFFECT_FLINCH_HIT, - .power = 60, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_GROWL] = - { - .effect = EFFECT_ATTACK_DOWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ROAR] = - { - .effect = EFFECT_ROAR, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -6, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SING] = - { - .effect = EFFECT_SLEEP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 55, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SUPERSONIC] = - { - .effect = EFFECT_CONFUSE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 55, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SONIC_BOOM] = - { - .effect = EFFECT_SONICBOOM, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DISABLE] = - { - .effect = EFFECT_DISABLE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 55, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ACID] = - { - .effect = EFFECT_DEFENSE_DOWN_HIT, - .power = 40, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_EMBER] = - { - .effect = EFFECT_BURN_HIT, - .power = 40, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FLAMETHROWER] = - { - .effect = EFFECT_BURN_HIT, - .power = 95, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MIST] = - { - .effect = EFFECT_MIST, - .power = 0, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_WATER_GUN] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_HYDRO_PUMP] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_WATER, - .accuracy = 80, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SURF] = - { - .effect = EFFECT_HIT, - .power = 95, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ICE_BEAM] = - { - .effect = EFFECT_FREEZE_HIT, - .power = 95, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BLIZZARD] = - { - .effect = EFFECT_FREEZE_HIT, - .power = 120, - .type = TYPE_ICE, - .accuracy = 70, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PSYBEAM] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 65, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BUBBLE_BEAM] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 65, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_AURORA_BEAM] = - { - .effect = EFFECT_ATTACK_DOWN_HIT, - .power = 65, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HYPER_BEAM] = - { - .effect = EFFECT_RECHARGE, - .power = 150, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_PECK] = - { - .effect = EFFECT_HIT, - .power = 35, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DRILL_PECK] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SUBMISSION] = - { - .effect = EFFECT_RECOIL, - .power = 80, - .type = TYPE_FIGHTING, - .accuracy = 80, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_LOW_KICK] = - { - .effect = EFFECT_LOW_KICK, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_COUNTER] = - { - .effect = EFFECT_COUNTER, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = -5, - .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SEISMIC_TOSS] = - { - .effect = EFFECT_LEVEL_DAMAGE, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_STRENGTH] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ABSORB] = - { - .effect = EFFECT_ABSORB, - .power = 20, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MEGA_DRAIN] = - { - .effect = EFFECT_ABSORB, - .power = 40, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_LEECH_SEED] = - { - .effect = EFFECT_LEECH_SEED, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_GROWTH] = - { - .effect = EFFECT_SPECIAL_ATTACK_UP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_RAZOR_LEAF] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 55, - .type = TYPE_GRASS, - .accuracy = 95, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SOLAR_BEAM] = - { - .effect = EFFECT_SOLAR_BEAM, - .power = 120, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_POISON_POWDER] = - { - .effect = EFFECT_POISON, - .power = 0, - .type = TYPE_POISON, - .accuracy = 75, - .pp = 35, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_STUN_SPORE] = - { - .effect = EFFECT_PARALYZE, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 75, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SLEEP_POWDER] = - { - .effect = EFFECT_SLEEP, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 75, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PETAL_DANCE] = - { - .effect = EFFECT_RAMPAGE, - .power = 70, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_RANDOM, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_STRING_SHOT] = - { - .effect = EFFECT_SPEED_DOWN, - .power = 0, - .type = TYPE_BUG, - .accuracy = 95, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DRAGON_RAGE] = - { - .effect = EFFECT_DRAGON_RAGE, - .power = 1, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FIRE_SPIN] = - { - .effect = EFFECT_TRAP, - .power = 15, - .type = TYPE_FIRE, - .accuracy = 70, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_THUNDER_SHOCK] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 40, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_THUNDERBOLT] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 95, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_THUNDER_WAVE] = - { - .effect = EFFECT_PARALYZE, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_THUNDER] = - { - .effect = EFFECT_THUNDER, - .power = 120, - .type = TYPE_ELECTRIC, - .accuracy = 70, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ROCK_THROW] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_EARTHQUAKE] = - { - .effect = EFFECT_EARTHQUAKE, - .power = 100, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FISSURE] = - { - .effect = EFFECT_OHKO, - .power = 1, - .type = TYPE_GROUND, - .accuracy = 30, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DIG] = - { - .effect = EFFECT_SEMI_INVULNERABLE, - .power = 60, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_TOXIC] = - { - .effect = EFFECT_TOXIC, - .power = 0, - .type = TYPE_POISON, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_CONFUSION] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 50, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PSYCHIC] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 90, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HYPNOSIS] = - { - .effect = EFFECT_SLEEP, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 60, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MEDITATE] = - { - .effect = EFFECT_ATTACK_UP, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_AGILITY] = - { - .effect = EFFECT_SPEED_UP_2, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_QUICK_ATTACK] = - { - .effect = EFFECT_QUICK_ATTACK, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_RAGE] = - { - .effect = EFFECT_RAGE, - .power = 20, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_TELEPORT] = - { - .effect = EFFECT_TELEPORT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_NIGHT_SHADE] = - { - .effect = EFFECT_LEVEL_DAMAGE, - .power = 1, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MIMIC] = - { - .effect = EFFECT_MIMIC, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_SCREECH] = - { - .effect = EFFECT_DEFENSE_DOWN_2, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DOUBLE_TEAM] = - { - .effect = EFFECT_EVASION_UP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_RECOVER] = - { - .effect = EFFECT_RESTORE_HP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_HARDEN] = - { - .effect = EFFECT_DEFENSE_UP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_MINIMIZE] = - { - .effect = EFFECT_MINIMIZE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_SMOKESCREEN] = - { - .effect = EFFECT_ACCURACY_DOWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_CONFUSE_RAY] = - { - .effect = EFFECT_CONFUSE, - .power = 0, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_WITHDRAW] = - { - .effect = EFFECT_DEFENSE_UP, - .power = 0, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_DEFENSE_CURL] = - { - .effect = EFFECT_DEFENSE_CURL, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_BARRIER] = - { - .effect = EFFECT_DEFENSE_UP_2, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_LIGHT_SCREEN] = - { - .effect = EFFECT_LIGHT_SCREEN, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_HAZE] = - { - .effect = EFFECT_HAZE, - .power = 0, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_REFLECT] = - { - .effect = EFFECT_REFLECT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_FOCUS_ENERGY] = - { - .effect = EFFECT_FOCUS_ENERGY, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_BIDE] = - { - .effect = EFFECT_BIDE, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_METRONOME] = - { - .effect = EFFECT_METRONOME, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 0, - .flags = 0, - }, - - [MOVE_MIRROR_MOVE] = - { - .effect = EFFECT_MIRROR_MOVE, - .power = 0, - .type = TYPE_FLYING, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 0, - .flags = 0, - }, - - [MOVE_SELF_DESTRUCT] = - { - .effect = EFFECT_EXPLOSION, - .power = 200, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_EGG_BOMB] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_LICK] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 20, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SMOG] = - { - .effect = EFFECT_POISON_HIT, - .power = 20, - .type = TYPE_POISON, - .accuracy = 70, - .pp = 20, - .secondaryEffectChance = 40, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SLUDGE] = - { - .effect = EFFECT_POISON_HIT, - .power = 65, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BONE_CLUB] = - { - .effect = EFFECT_FLINCH_HIT, - .power = 65, - .type = TYPE_GROUND, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FIRE_BLAST] = - { - .effect = EFFECT_BURN_HIT, - .power = 120, - .type = TYPE_FIRE, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_WATERFALL] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_CLAMP] = - { - .effect = EFFECT_TRAP, - .power = 35, - .type = TYPE_WATER, - .accuracy = 75, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SWIFT] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 60, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SKULL_BASH] = - { - .effect = EFFECT_SKULL_BASH, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SPIKE_CANNON] = - { - .effect = EFFECT_MULTI_HIT, - .power = 20, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_CONSTRICT] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 10, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 35, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_AMNESIA] = - { - .effect = EFFECT_SPECIAL_DEFENSE_UP_2, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_KINESIS] = - { - .effect = EFFECT_ACCURACY_DOWN, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 80, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SOFT_BOILED] = - { - .effect = EFFECT_SOFTBOILED, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HI_JUMP_KICK] = - { - .effect = EFFECT_RECOIL_IF_MISS, - .power = 85, - .type = TYPE_FIGHTING, - .accuracy = 90, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_GLARE] = - { - .effect = EFFECT_PARALYZE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DREAM_EATER] = - { - .effect = EFFECT_DREAM_EATER, - .power = 100, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_POISON_GAS] = - { - .effect = EFFECT_POISON, - .power = 0, - .type = TYPE_POISON, - .accuracy = 55, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BARRAGE] = - { - .effect = EFFECT_MULTI_HIT, - .power = 15, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_LEECH_LIFE] = - { - .effect = EFFECT_ABSORB, - .power = 20, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_LOVELY_KISS] = - { - .effect = EFFECT_SLEEP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SKY_ATTACK] = - { - .effect = EFFECT_SKY_ATTACK, - .power = 140, - .type = TYPE_FLYING, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_TRANSFORM] = - { - .effect = EFFECT_TRANSFORM, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_BUBBLE] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 20, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DIZZY_PUNCH] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SPORE] = - { - .effect = EFFECT_SLEEP, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FLASH] = - { - .effect = EFFECT_ACCURACY_DOWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 70, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PSYWAVE] = - { - .effect = EFFECT_PSYWAVE, - .power = 1, - .type = TYPE_PSYCHIC, - .accuracy = 80, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SPLASH] = - { - .effect = EFFECT_SPLASH, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_ACID_ARMOR] = - { - .effect = EFFECT_DEFENSE_UP_2, - .power = 0, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_CRABHAMMER] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 90, - .type = TYPE_WATER, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_EXPLOSION] = - { - .effect = EFFECT_EXPLOSION, - .power = 250, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FURY_SWIPES] = - { - .effect = EFFECT_MULTI_HIT, - .power = 18, - .type = TYPE_NORMAL, - .accuracy = 80, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BONEMERANG] = - { - .effect = EFFECT_DOUBLE_HIT, - .power = 50, - .type = TYPE_GROUND, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_REST] = - { - .effect = EFFECT_REST, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_ROCK_SLIDE] = - { - .effect = EFFECT_FLINCH_HIT, - .power = 75, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HYPER_FANG] = - { - .effect = EFFECT_FLINCH_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SHARPEN] = - { - .effect = EFFECT_ATTACK_UP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_CONVERSION] = - { - .effect = EFFECT_CONVERSION, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_TRI_ATTACK] = - { - .effect = EFFECT_TRI_ATTACK, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SUPER_FANG] = - { - .effect = EFFECT_SUPER_FANG, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SLASH] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SUBSTITUTE] = - { - .effect = EFFECT_SUBSTITUTE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_STRUGGLE] = - { - .effect = EFFECT_RECOIL, - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SKETCH] = - { - .effect = EFFECT_SKETCH, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_TRIPLE_KICK] = - { - .effect = EFFECT_TRIPLE_KICK, - .power = 10, - .type = TYPE_FIGHTING, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_THIEF] = - { - .effect = EFFECT_THIEF, - .power = 40, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SPIDER_WEB] = - { - .effect = EFFECT_MEAN_LOOK, - .power = 0, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MIND_READER] = - { - .effect = EFFECT_LOCK_ON, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_NIGHTMARE] = - { - .effect = EFFECT_NIGHTMARE, - .power = 0, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FLAME_WHEEL] = - { - .effect = EFFECT_THAW_HIT, - .power = 60, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SNORE] = - { - .effect = EFFECT_SNORE, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_CURSE] = - { - .effect = EFFECT_CURSE, - .power = 0, - .type = TYPE_MYSTERY, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_FLAIL] = - { - .effect = EFFECT_FLAIL, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_CONVERSION_2] = - { - .effect = EFFECT_CONVERSION_2, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_AEROBLAST] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 100, - .type = TYPE_FLYING, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_COTTON_SPORE] = - { - .effect = EFFECT_SPEED_DOWN_2, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 85, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_REVERSAL] = - { - .effect = EFFECT_FLAIL, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SPITE] = - { - .effect = EFFECT_SPITE, - .power = 0, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_POWDER_SNOW] = - { - .effect = EFFECT_FREEZE_HIT, - .power = 40, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PROTECT] = - { - .effect = EFFECT_PROTECT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 3, - .flags = 0, - }, - - [MOVE_MACH_PUNCH] = - { - .effect = EFFECT_QUICK_ATTACK, - .power = 40, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SCARY_FACE] = - { - .effect = EFFECT_SPEED_DOWN_2, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FAINT_ATTACK] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 60, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SWEET_KISS] = - { - .effect = EFFECT_CONFUSE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 75, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BELLY_DRUM] = - { - .effect = EFFECT_BELLY_DRUM, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_SLUDGE_BOMB] = - { - .effect = EFFECT_POISON_HIT, - .power = 90, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MUD_SLAP] = - { - .effect = EFFECT_ACCURACY_DOWN_HIT, - .power = 20, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_OCTAZOOKA] = - { - .effect = EFFECT_ACCURACY_DOWN_HIT, - .power = 65, - .type = TYPE_WATER, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SPIKES] = - { - .effect = EFFECT_SPIKES, - .power = 0, - .type = TYPE_GROUND, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_OPPONENTS_FIELD, - .priority = 0, - .flags = 0, - }, - - [MOVE_ZAP_CANNON] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 100, - .type = TYPE_ELECTRIC, - .accuracy = 50, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FORESIGHT] = - { - .effect = EFFECT_FORESIGHT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DESTINY_BOND] = - { - .effect = EFFECT_DESTINY_BOND, - .power = 0, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_PERISH_SONG] = - { - .effect = EFFECT_PERISH_SONG, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_ICY_WIND] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 55, - .type = TYPE_ICE, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DETECT] = - { - .effect = EFFECT_PROTECT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 3, - .flags = 0, - }, - - [MOVE_BONE_RUSH] = - { - .effect = EFFECT_MULTI_HIT, - .power = 25, - .type = TYPE_GROUND, - .accuracy = 80, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_LOCK_ON] = - { - .effect = EFFECT_LOCK_ON, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_OUTRAGE] = - { - .effect = EFFECT_RAMPAGE, - .power = 90, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_RANDOM, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SANDSTORM] = - { - .effect = EFFECT_SANDSTORM, - .power = 0, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_GIGA_DRAIN] = - { - .effect = EFFECT_ABSORB, - .power = 60, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ENDURE] = - { - .effect = EFFECT_ENDURE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 3, - .flags = 0, - }, - - [MOVE_CHARM] = - { - .effect = EFFECT_ATTACK_DOWN_2, - .power = 0, - .type = TYPE_FAIRY, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ROLLOUT] = - { - .effect = EFFECT_ROLLOUT, - .power = 30, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FALSE_SWIPE] = - { - .effect = EFFECT_FALSE_SWIPE, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SWAGGER] = - { - .effect = EFFECT_SWAGGER, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MILK_DRINK] = - { - .effect = EFFECT_SOFTBOILED, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, - }, - - [MOVE_SPARK] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 65, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FURY_CUTTER] = - { - .effect = EFFECT_FURY_CUTTER, - .power = 10, - .type = TYPE_BUG, - .accuracy = 95, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_STEEL_WING] = - { - .effect = EFFECT_DEFENSE_UP_HIT, - .power = 70, - .type = TYPE_STEEL, - .accuracy = 90, - .pp = 25, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MEAN_LOOK] = - { - .effect = EFFECT_MEAN_LOOK, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ATTRACT] = - { - .effect = EFFECT_ATTRACT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SLEEP_TALK] = - { - .effect = EFFECT_SLEEP_TALK, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 0, - .flags = 0, - }, - - [MOVE_HEAL_BELL] = - { - .effect = EFFECT_HEAL_BELL, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_RETURN] = - { - .effect = EFFECT_RETURN, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_PRESENT] = - { - .effect = EFFECT_PRESENT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FRUSTRATION] = - { - .effect = EFFECT_FRUSTRATION, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SAFEGUARD] = - { - .effect = EFFECT_SAFEGUARD, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_PAIN_SPLIT] = - { - .effect = EFFECT_PAIN_SPLIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SACRED_FIRE] = - { - .effect = EFFECT_THAW_HIT, - .power = 100, - .type = TYPE_FIRE, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MAGNITUDE] = - { - .effect = EFFECT_MAGNITUDE, - .power = 1, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DYNAMIC_PUNCH] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 100, - .type = TYPE_FIGHTING, - .accuracy = 50, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MEGAHORN] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_BUG, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DRAGON_BREATH] = - { - .effect = EFFECT_PARALYZE_HIT, - .power = 60, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BATON_PASS] = - { - .effect = EFFECT_BATON_PASS, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_ENCORE] = - { - .effect = EFFECT_ENCORE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PURSUIT] = - { - .effect = EFFECT_PURSUIT, - .power = 40, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_RAPID_SPIN] = - { - .effect = EFFECT_RAPID_SPIN, - .power = 20, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SWEET_SCENT] = - { - .effect = EFFECT_EVASION_DOWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_IRON_TAIL] = - { - .effect = EFFECT_DEFENSE_DOWN_HIT, - .power = 100, - .type = TYPE_STEEL, - .accuracy = 75, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_METAL_CLAW] = - { - .effect = EFFECT_ATTACK_UP_HIT, - .power = 50, - .type = TYPE_STEEL, - .accuracy = 95, - .pp = 35, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_VITAL_THROW] = - { - .effect = EFFECT_VITAL_THROW, - .power = 70, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -1, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MORNING_SUN] = - { - .effect = EFFECT_MORNING_SUN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_SYNTHESIS] = - { - .effect = EFFECT_SYNTHESIS, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_MOONLIGHT] = - { - .effect = EFFECT_MOONLIGHT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_HIDDEN_POWER] = - { - .effect = EFFECT_HIDDEN_POWER, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_CROSS_CHOP] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 100, - .type = TYPE_FIGHTING, - .accuracy = 80, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_TWISTER] = - { - .effect = EFFECT_TWISTER, - .power = 40, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_RAIN_DANCE] = - { - .effect = EFFECT_RAIN_DANCE, - .power = 0, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_SUNNY_DAY] = - { - .effect = EFFECT_SUNNY_DAY, - .power = 0, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_CRUNCH] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MIRROR_COAT] = - { - .effect = EFFECT_MIRROR_COAT, - .power = 1, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = -5, - .flags = FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_PSYCH_UP] = - { - .effect = EFFECT_PSYCH_UP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_EXTREME_SPEED] = - { - .effect = EFFECT_QUICK_ATTACK, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ANCIENT_POWER] = - { - .effect = EFFECT_ALL_STATS_UP_HIT, - .power = 60, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SHADOW_BALL] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 80, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FUTURE_SIGHT] = - { - .effect = EFFECT_FUTURE_SIGHT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_ROCK_SMASH] = - { - .effect = EFFECT_DEFENSE_DOWN_HIT, - .power = 20, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_WHIRLPOOL] = - { - .effect = EFFECT_TRAP, - .power = 15, - .type = TYPE_WATER, - .accuracy = 70, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BEAT_UP] = - { - .effect = EFFECT_BEAT_UP, - .power = 10, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FAKE_OUT] = - { - .effect = EFFECT_FAKE_OUT, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_UPROAR] = - { - .effect = EFFECT_UPROAR, - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_RANDOM, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_STOCKPILE] = - { - .effect = EFFECT_STOCKPILE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_SPIT_UP] = - { - .effect = EFFECT_SPIT_UP, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SWALLOW] = - { - .effect = EFFECT_SWALLOW, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_HEAT_WAVE] = - { - .effect = EFFECT_BURN_HIT, - .power = 100, - .type = TYPE_FIRE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HAIL] = - { - .effect = EFFECT_HAIL, - .power = 0, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_TORMENT] = - { - .effect = EFFECT_TORMENT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FLATTER] = - { - .effect = EFFECT_FLATTER, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_WILL_O_WISP] = - { - .effect = EFFECT_WILL_O_WISP, - .power = 0, - .type = TYPE_FIRE, - .accuracy = 75, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MEMENTO] = - { - .effect = EFFECT_MEMENTO, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FACADE] = - { - .effect = EFFECT_FACADE, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FOCUS_PUNCH] = - { - .effect = EFFECT_FOCUS_PUNCH, - .power = 150, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -3, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, - }, - - [MOVE_SMELLINGSALT] = - { - .effect = EFFECT_SMELLINGSALT, - .power = 60, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FOLLOW_ME] = - { - .effect = EFFECT_FOLLOW_ME, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 3, - .flags = 0, - }, - - [MOVE_NATURE_POWER] = - { - .effect = EFFECT_NATURE_POWER, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 0, - .flags = 0, - }, - - [MOVE_CHARGE] = - { - .effect = EFFECT_CHARGE, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_TAUNT] = - { - .effect = EFFECT_TAUNT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_HELPING_HAND] = - { - .effect = EFFECT_HELPING_HAND, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 5, - .flags = 0, - }, - - [MOVE_TRICK] = - { - .effect = EFFECT_TRICK, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ROLE_PLAY] = - { - .effect = EFFECT_ROLE_PLAY, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_WISH] = - { - .effect = EFFECT_WISH, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_ASSIST] = - { - .effect = EFFECT_ASSIST, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 0, - .flags = 0, - }, - - [MOVE_INGRAIN] = - { - .effect = EFFECT_INGRAIN, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_SUPERPOWER] = - { - .effect = EFFECT_SUPERPOWER, - .power = 120, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MAGIC_COAT] = - { - .effect = EFFECT_MAGIC_COAT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 4, - .flags = 0, - }, - - [MOVE_RECYCLE] = - { - .effect = EFFECT_RECYCLE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_REVENGE] = - { - .effect = EFFECT_REVENGE, - .power = 60, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -4, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BRICK_BREAK] = - { - .effect = EFFECT_BRICK_BREAK, - .power = 75, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_YAWN] = - { - .effect = EFFECT_YAWN, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_KNOCK_OFF] = - { - .effect = EFFECT_KNOCK_OFF, - .power = 20, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ENDEAVOR] = - { - .effect = EFFECT_ENDEAVOR, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ERUPTION] = - { - .effect = EFFECT_ERUPTION, - .power = 150, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SKILL_SWAP] = - { - .effect = EFFECT_SKILL_SWAP, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_IMPRISON] = - { - .effect = EFFECT_IMPRISON, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_REFRESH] = - { - .effect = EFFECT_REFRESH, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_GRUDGE] = - { - .effect = EFFECT_GRUDGE, - .power = 0, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SNATCH] = - { - .effect = EFFECT_SNATCH, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_DEPENDS, - .priority = 4, - .flags = 0, - }, - - [MOVE_SECRET_POWER] = - { - .effect = EFFECT_SECRET_POWER, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_DIVE] = - { - .effect = EFFECT_SEMI_INVULNERABLE, - .power = 60, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ARM_THRUST] = - { - .effect = EFFECT_MULTI_HIT, - .power = 15, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_CAMOUFLAGE] = - { - .effect = EFFECT_CAMOUFLAGE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_TAIL_GLOW] = - { - .effect = EFFECT_SPECIAL_ATTACK_UP_2, - .power = 0, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_LUSTER_PURGE] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 70, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MIST_BALL] = - { - .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, - .power = 70, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_FEATHER_DANCE] = - { - .effect = EFFECT_ATTACK_DOWN_2, - .power = 0, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_TEETER_DANCE] = - { - .effect = EFFECT_TEETER_DANCE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, - }, - - [MOVE_BLAZE_KICK] = - { - .effect = EFFECT_BLAZE_KICK, - .power = 85, - .type = TYPE_FIRE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MUD_SPORT] = - { - .effect = EFFECT_MUD_SPORT, - .power = 0, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_ICE_BALL] = - { - .effect = EFFECT_ROLLOUT, - .power = 30, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_NEEDLE_ARM] = - { - .effect = EFFECT_FLINCH_MINIMIZE_HIT, - .power = 60, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SLACK_OFF] = - { - .effect = EFFECT_RESTORE_HP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_HYPER_VOICE] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_POISON_FANG] = - { - .effect = EFFECT_POISON_FANG, - .power = 50, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_CRUSH_CLAW] = - { - .effect = EFFECT_DEFENSE_DOWN_HIT, - .power = 75, - .type = TYPE_NORMAL, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_BLAST_BURN] = - { - .effect = EFFECT_RECHARGE, - .power = 150, - .type = TYPE_FIRE, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_HYDRO_CANNON] = - { - .effect = EFFECT_RECHARGE, - .power = 150, - .type = TYPE_WATER, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_METEOR_MASH] = - { - .effect = EFFECT_ATTACK_UP_HIT, - .power = 100, - .type = TYPE_STEEL, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ASTONISH] = - { - .effect = EFFECT_FLINCH_MINIMIZE_HIT, - .power = 30, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_WEATHER_BALL] = - { - .effect = EFFECT_WEATHER_BALL, - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_AROMATHERAPY] = - { - .effect = EFFECT_HEAL_BELL, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_FAKE_TEARS] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_2, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_AIR_CUTTER] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 55, - .type = TYPE_FLYING, - .accuracy = 95, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_OVERHEAT] = - { - .effect = EFFECT_OVERHEAT, - .power = 140, - .type = TYPE_FIRE, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ODOR_SLEUTH] = - { - .effect = EFFECT_FORESIGHT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_ROCK_TOMB] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 50, - .type = TYPE_ROCK, - .accuracy = 80, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SILVER_WIND] = - { - .effect = EFFECT_ALL_STATS_UP_HIT, - .power = 60, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_METAL_SOUND] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_2, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 85, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_GRASS_WHISTLE] = - { - .effect = EFFECT_SLEEP, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 55, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_TICKLE] = - { - .effect = EFFECT_TICKLE, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_COSMIC_POWER] = - { - .effect = EFFECT_COSMIC_POWER, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_WATER_SPOUT] = - { - .effect = EFFECT_ERUPTION, - .power = 150, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SIGNAL_BEAM] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 75, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SHADOW_PUNCH] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 60, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_EXTRASENSORY] = - { - .effect = EFFECT_FLINCH_MINIMIZE_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_SKY_UPPERCUT] = - { - .effect = EFFECT_SKY_UPPERCUT, - .power = 85, - .type = TYPE_FIGHTING, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SAND_TOMB] = - { - .effect = EFFECT_TRAP, - .power = 15, - .type = TYPE_GROUND, - .accuracy = 70, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SHEER_COLD] = - { - .effect = EFFECT_OHKO, - .power = 1, - .type = TYPE_ICE, - .accuracy = 30, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_MUDDY_WATER] = - { - .effect = EFFECT_ACCURACY_DOWN_HIT, - .power = 95, - .type = TYPE_WATER, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BULLET_SEED] = - { - .effect = EFFECT_MULTI_HIT, - .power = 10, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_AERIAL_ACE] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 60, - .type = TYPE_FLYING, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_ICICLE_SPEAR] = - { - .effect = EFFECT_MULTI_HIT, - .power = 10, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_IRON_DEFENSE] = - { - .effect = EFFECT_DEFENSE_UP_2, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_BLOCK] = - { - .effect = EFFECT_MEAN_LOOK, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_HOWL] = - { - .effect = EFFECT_ATTACK_UP, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_DRAGON_CLAW] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_FRENZY_PLANT] = - { - .effect = EFFECT_RECHARGE, - .power = 150, - .type = TYPE_GRASS, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_BULK_UP] = - { - .effect = EFFECT_BULK_UP, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_BOUNCE] = - { - .effect = EFFECT_SEMI_INVULNERABLE, - .power = 85, - .type = TYPE_FLYING, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MUD_SHOT] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 55, - .type = TYPE_GROUND, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_POISON_TAIL] = - { - .effect = EFFECT_POISON_TAIL, - .power = 50, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_COVET] = - { - .effect = EFFECT_THIEF, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - }, - - [MOVE_VOLT_TACKLE] = - { - .effect = EFFECT_DOUBLE_EDGE, - .power = 120, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_MAGICAL_LEAF] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 60, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_WATER_SPORT] = - { - .effect = EFFECT_WATER_SPORT, - .power = 0, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - }, - - [MOVE_CALM_MIND] = - { - .effect = EFFECT_CALM_MIND, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_LEAF_BLADE] = - { - .effect = EFFECT_HIGH_CRITICAL, - .power = 70, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DRAGON_DANCE] = - { - .effect = EFFECT_DRAGON_DANCE, - .power = 0, - .type = TYPE_DRAGON, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - }, - - [MOVE_ROCK_BLAST] = - { - .effect = EFFECT_MULTI_HIT, - .power = 25, - .type = TYPE_ROCK, - .accuracy = 80, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_SHOCK_WAVE] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 60, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_WATER_PULSE] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 60, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - - [MOVE_DOOM_DESIRE] = - { - .effect = EFFECT_FUTURE_SIGHT, - .power = 120, - .type = TYPE_STEEL, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - }, - - [MOVE_PSYCHO_BOOST] = - { - .effect = EFFECT_OVERHEAT, - .power = 140, - .type = TYPE_PSYCHIC, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, - }, - [MOVE_ROOST] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .pp = 5, - #else - .pp = 10, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FLYING, - .accuracy = 0, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GRAVITY] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MIRACLE_EYE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WAKE_UP_SLAP] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 70, - #else - .power = 60, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HAMMER_ARM] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FIGHTING, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GYRO_BALL] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEALING_WISH] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BRINE] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NATURAL_GIFT] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FEINT] = - { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 30, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 2, - .flags = 0 -}, - - [MOVE_PLUCK] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TAILWIND] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 15, - #else - .pp = 30, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FLYING, - .accuracy = 0, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ACUPRESSURE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_METAL_BURST] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_U_TURN] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CLOSE_COMBAT] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PAYBACK] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ASSURANCE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_EMBARGO] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLING] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYCHO_SHIFT] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 100, - #else - .accuracy = 90, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRUMP_CARD] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAL_BLOCK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WRING_OUT] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_TRICK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GASTRO_ACID] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LUCKY_CHANT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ME_FIRST] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COPYCAT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_SWAP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GUARD_SWAP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PUNISHMENT] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LAST_RESORT] = - { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 140, - #else - .power = 130, - #endif - .effect = EFFECT_HIT, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WORRY_SEED] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SUCKER_PUNCH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 70, - #else - .power = 80, - #endif - .effect = EFFECT_HIT, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_TOXIC_SPIKES] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEART_SWAP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AQUA_RING] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGNET_RISE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLARE_BLITZ] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FORCE_PALM] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AURA_SPHERE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 90, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ROCK_POLISH] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POISON_JAB] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DARK_PULSE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NIGHT_SLASH] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AQUA_TAIL] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_WATER, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SEED_BOMB] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 - }, - - [MOVE_AIR_SLASH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 15, - #else - .pp = 20, - #endif - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_FLYING, - .accuracy = 95, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_X_SCISSOR] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BUG_BUZZ] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_PULSE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 85, - #else - .power = 90, - #endif - .effect = EFFECT_HIT, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_RUSH] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_DRAGON, - .accuracy = 75, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_GEM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 70, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAIN_PUNCH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 75, - .pp = 10, - #else - .power = 60, - .pp = 5, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 100, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_VACUUM_WAVE] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_FOCUS_BLAST] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FIGHTING, - .accuracy = 70, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ENERGY_BALL] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - #else - .power = 80, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BRAVE_BIRD] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_EARTH_POWER] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SWITCHEROO] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GIGA_IMPACT] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NASTY_PLOT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BULLET_PUNCH] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_AVALANCHE] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -4, - .flags = 0 -}, - - [MOVE_ICE_SHARD] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_SHADOW_CLAW] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_THUNDER_FANG] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_ELECTRIC, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ICE_FANG] = - { - #if B_USE_FROSTBITE == TRUE - #else - #endif - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_ICE, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FIRE_FANG] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_FIRE, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHADOW_SNEAK] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_MUD_BOMB] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_GROUND, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYCHO_CUT] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ZEN_HEADBUTT] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MIRROR_SHOT] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_STEEL, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLASH_CANNON] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ROCK_CLIMB] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 20, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DEFOG] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FLYING, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRICK_ROOM] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -7, - .flags = 0 -}, - - [MOVE_DRACO_METEOR] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 130, - #else - .power = 140, - #endif - .effect = EFFECT_HIT, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DISCHARGE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LAVA_PLUME] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LEAF_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 130, - #else - .power = 140, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GRASS, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_WHIP] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_GRASS, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ROCK_WRECKER] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CROSS_POISON] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GUNK_SHOT] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 80, - #else - .accuracy = 70, - #endif - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_POISON, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_IRON_HEAD] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGNET_BOMB] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STONE_EDGE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ROCK, - .accuracy = 80, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CAPTIVATE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STEALTH_ROCK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GRASS_KNOT] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CHATTER] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - .secondaryEffectChance = 100, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 60, - .secondaryEffectChance = 10, - #else - .power = 60, - .secondaryEffectChance = 31, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_JUDGMENT] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BUG_BITE] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CHARGE_BEAM] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_ELECTRIC, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 70, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WOOD_HAMMER] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AQUA_JET] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_ATTACK_ORDER] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DEFEND_ORDER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAL_ORDER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAD_SMASH] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_ROCK, - .accuracy = 80, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DOUBLE_HIT] = - { - .effect = EFFECT_HIT, - .power = 35, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ROAR_OF_TIME] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPACIAL_REND] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_DRAGON, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LUNAR_DANCE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CRUSH_GRIP] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGMA_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 100, - .accuracy = 75, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 120, - .accuracy = 75, - #else - .power = 120, - .accuracy = 70, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIRE, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DARK_VOID] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .accuracy = 50, - #else - .accuracy = 80, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SEED_FLARE] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_GRASS, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 40, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_OMINOUS_WIND] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHADOW_FORCE] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HONE_CLAWS] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WIDE_GUARD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 3, - .flags = 0 -}, - - [MOVE_GUARD_SPLIT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_SPLIT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WONDER_ROOM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .priority = 0, - #else - .priority = -7, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .flags = 0 -}, - - [MOVE_PSYSHOCK] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_VENOSHOCK] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AUTOTOMIZE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RAGE_POWDER] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .priority = 2, - #else - .priority = 3, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .flags = 0 -}, - - [MOVE_TELEKINESIS] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGIC_ROOM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .priority = 0, - #else - .priority = -7, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .flags = 0 -}, - - [MOVE_SMACK_DOWN] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STORM_THROW] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 40, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLAME_BURST] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SLUDGE_WAVE] = - { - .effect = EFFECT_HIT, - .power = 95, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_QUIVER_DANCE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAVY_SLAM] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SYNCHRONOISE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 120, - .pp = 10, - #else - .power = 70, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ELECTRO_BALL] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SOAK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLAME_CHARGE] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COIL] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LOW_SWEEP] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - #else - .power = 60, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ACID_SPRAY] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FOUL_PLAY] = - { - .effect = EFFECT_HIT, - .power = 95, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SIMPLE_BEAM] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ENTRAINMENT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AFTER_YOU] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ROUND] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ECHOED_VOICE] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CHIP_AWAY] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CLEAR_SMOG] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STORED_POWER] = - { - .effect = EFFECT_HIT, - .power = 20, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_QUICK_GUARD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 3, - .flags = 0 -}, - - [MOVE_ALLY_SWITCH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .priority = 2, - #else - .priority = 1, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .flags = 0 -}, - - [MOVE_SCALD] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHELL_SMASH] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAL_PULSE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEX] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SKY_DROP] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHIFT_GEAR] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CIRCLE_THROW] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_FIGHTING, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -6, - .flags = 0 -}, - - [MOVE_INCINERATE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 30, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_QUASH] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ACROBATICS] = - { - .effect = EFFECT_HIT, - .power = 55, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_REFLECT_TYPE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RETALIATE] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FINAL_GAMBIT] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BESTOW] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_INFERNO] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FIRE, - .accuracy = 50, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WATER_PLEDGE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FIRE_PLEDGE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GRASS_PLEDGE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_VOLT_SWITCH] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STRUGGLE_BUG] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 50, - #else - .power = 30, - #endif - .effect = EFFECT_HIT, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BULLDOZE] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FROST_BREATH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 40, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_TAIL] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -6, - .flags = 0 -}, - - [MOVE_WORK_UP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ELECTROWEB] = - { - .effect = EFFECT_HIT, - .power = 55, - .type = TYPE_ELECTRIC, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WILD_CHARGE] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRILL_RUN] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GROUND, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DUAL_CHOP] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEART_STAMP] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HORN_LEECH] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SACRED_SWORD] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 15, - #else - .pp = 20, - #endif - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_FIGHTING, - .accuracy = 100, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RAZOR_SHELL] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_WATER, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAT_CRASH] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LEAF_TORNADO] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_GRASS, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STEAMROLLER] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COTTON_GUARD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NIGHT_DAZE] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_DARK, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 40, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYSTRIKE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TAIL_SLAP] = - { - .effect = EFFECT_HIT, - .power = 25, - .type = TYPE_NORMAL, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HURRICANE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 110, - #else - .power = 120, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FLYING, - .accuracy = 70, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEAD_CHARGE] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GEAR_GRIND] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_STEEL, - .accuracy = 85, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SEARING_SHOT] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TECHNO_BLAST] = - { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 120, - #else - .power = 85, - #endif - .effect = EFFECT_HIT, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RELIC_SONG] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SECRET_SWORD] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GLACIATE] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_ICE, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BOLT_STRIKE] = - { - .effect = EFFECT_HIT, - .power = 130, - .type = TYPE_ELECTRIC, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BLUE_FLARE] = - { - .effect = EFFECT_HIT, - .power = 130, - .type = TYPE_FIRE, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FIERY_DANCE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FREEZE_SHOCK] = - { - .effect = EFFECT_HIT, - .power = 140, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ICE_BURN] = - { - .effect = EFFECT_HIT, - .power = 140, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SNARL] = - { - .effect = EFFECT_HIT, - .power = 55, - .type = TYPE_DARK, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ICICLE_CRASH] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_V_CREATE] = - { - .effect = EFFECT_HIT, - .power = 180, - .type = TYPE_FIRE, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FUSION_FLARE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FUSION_BOLT] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLYING_PRESS] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 100, - #else - .power = 80, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAT_BLOCK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BELCH] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_POISON, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ROTOTILLER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GROUND, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STICKY_WEB] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FELL_STINGER] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 50, - #else - .power = 30, - #endif - .effect = EFFECT_HIT, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PHANTOM_FORCE] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRICK_OR_TREAT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NOBLE_ROAR] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ION_DELUGE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 25, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_PARABOLIC_CHARGE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 65, - #else - .power = 50, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FORESTS_CURSE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PETAL_BLIZZARD] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FREEZE_DRY] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DISARMING_VOICE] = - { - .effect = EFFECT_ALWAYS_HIT, - .power = 40, - .type = TYPE_FAIRY, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PARTING_SHOT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TOPSY_TURVY] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .accuracy = 0, - #else - .accuracy = 100, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAINING_KISS] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CRAFTY_SHIELD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 3, - .flags = 0 -}, - - [MOVE_FLOWER_SHIELD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GRASSY_TERRAIN] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MISTY_TERRAIN] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ELECTRIFY] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PLAY_ROUGH] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FAIRY_WIND] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MOONBLAST] = - { - .effect = EFFECT_HIT, - .power = 95, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BOOMBURST] = - { - .effect = EFFECT_HIT, - .power = 140, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FAIRY_LOCK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_KINGS_SHIELD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_PLAY_NICE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CONFIDE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DIAMOND_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .effect = EFFECT_HIT, - #else - .effect = EFFECT_HIT, - #endif - .power = 100, - .type = TYPE_ROCK, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STEAM_ERUPTION] = - { - .effect = EFFECT_HIT, - .power = 110, - .type = TYPE_WATER, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HYPERSPACE_HOLE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WATER_SHURIKEN] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - #else - #endif - .effect = EFFECT_HIT, - .power = 15, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - - .flags = 0 -}, - - [MOVE_MYSTICAL_FIRE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 75, - #else - .power = 65, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPIKY_SHIELD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_AROMATIC_MIST] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_EERIE_IMPULSE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_VENOM_DRENCH] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWDER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_GEOMANCY] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGNETIC_FLUX] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HAPPY_HOUR] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ELECTRIC_TERRAIN] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DAZZLING_GLEAM] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CELEBRATE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HOLD_HANDS] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BABY_DOLL_EYES] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FAIRY, - .accuracy = 100, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_NUZZLE] = - { - .effect = EFFECT_HIT, - .power = 20, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HOLD_BACK] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_INFESTATION] = - { - .effect = EFFECT_HIT, - .power = 20, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_UP_PUNCH] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_OBLIVION_WING] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_THOUSAND_ARROWS] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_THOUSAND_WAVES] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LANDS_WRATH] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LIGHT_OF_RUIN] = - { - .effect = EFFECT_HIT, - .power = 140, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ORIGIN_PULSE] = - { - .effect = EFFECT_HIT, - .power = 110, - .type = TYPE_WATER, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PRECIPICE_BLADES] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_GROUND, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_ASCENT] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HYPERSPACE_FURY] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHORE_UP] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .pp = 5, - #else - .pp = 10, - #endif - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GROUND, - .accuracy = 0, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FIRST_IMPRESSION] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 2, - .flags = 0 -}, - - [MOVE_BANEFUL_BUNKER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_SPIRIT_SHACKLE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DARKEST_LARIAT] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPARKLING_ARIA] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ICE_HAMMER] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLORAL_HEALING] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HIGH_HORSEPOWER] = - { - .effect = EFFECT_HIT, - .power = 95, - .type = TYPE_GROUND, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STRENGTH_SAP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SOLAR_BLADE] = - { - .effect = EFFECT_HIT, - .power = 125, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LEAFAGE] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPOTLIGHT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 3, - .flags = 0 -}, - - [MOVE_TOXIC_THREAD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LASER_FOCUS] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 30, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GEAR_UP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_THROAT_CHOP] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POLLEN_PUFF] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ANCHOR_SHOT] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYCHIC_TERRAIN] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LUNGE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FIRE_LASH] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_TRIP] = - { - .effect = EFFECT_HIT, - .power = 20, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BURN_UP] = - { - .effect = EFFECT_HIT, - .power = 130, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPEED_SWAP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SMART_STRIKE] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PURIFY] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_REVELATION_DANCE] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CORE_ENFORCER] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TROP_KICK] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_INSTRUCT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BEAK_BLAST] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FLYING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -3, - .flags = 0 -}, - - [MOVE_CLANGING_SCALES] = - { - .effect = EFFECT_HIT, - .power = 110, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_HAMMER] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BRUTAL_SWING] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AURORA_VEIL] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHELL_TRAP] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = -3, - .flags = 0 -}, - - [MOVE_FLEUR_CANNON] = - { - .effect = EFFECT_HIT, - .power = 130, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYCHIC_FANGS] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STOMPING_TANTRUM] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHADOW_BONE] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ACCELEROCK] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_LIQUIDATION] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PRISMATIC_LASER] = - { - .effect = EFFECT_HIT, - .power = 160, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPECTRAL_THIEF] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SUNSTEEL_STRIKE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MOONGEIST_BEAM] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TEARFUL_LOOK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ZING_ZAP] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NATURES_MADNESS] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MULTI_ATTACK] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 120, - #else - .power = 90, - #endif - .effect = EFFECT_HIT, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MIND_BLOWN] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PLASMA_FISTS] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PHOTON_GEYSER] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ZIPPY_ZAP] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 80, - .effect = EFFECT_HIT, - .pp = 10, - #else - .effect = EFFECT_HIT, - .power = 50, - .pp = 15, - #endif - .type = TYPE_ELECTRIC, - .accuracy = 100, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 2, - .flags = 0 -}, - - [MOVE_SPLISHY_SPLASH] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLOATY_FALL] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_FLYING, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PIKA_PAPOW] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BOUNCY_BUBBLE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 60, - .pp = 20, - #else - .power = 90, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_WATER, - .accuracy = 100, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BUZZY_BUZZ] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 60, - .pp = 20, - #else - .power = 90, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SIZZLY_SLIDE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 60, - .pp = 20, - #else - .power = 90, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIRE, - .accuracy = 100, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GLITZY_GLOW] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 80, - .accuracy = 95, - #else - .power = 90, - .accuracy = 100, - #endif - .effect = EFFECT_HIT, - .type = TYPE_PSYCHIC, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BADDY_BAD] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 80, - .accuracy = 95, - #else - .power = 90, - .accuracy = 100, - #endif - .effect = EFFECT_HIT, - .type = TYPE_DARK, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SAPPY_SEED] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 100, - .accuracy = 90, - .pp = 10, - #else - .power = 90, - .accuracy = 100, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GRASS, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FREEZY_FROST] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 100, - .accuracy = 90, - .pp = 10, - #else - .power = 90, - .accuracy = 100, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ICE, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPARKLY_SWIRL] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 120, - .accuracy = 85, - .pp = 5, - #else - .power = 90, - .accuracy = 100, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_NORMAL, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_VEEVEE_VOLLEY] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DOUBLE_IRON_BASH] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DYNAMAX_CANNON] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SNIPE_SHOT] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_JAW_LOCK] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STUFF_CHEEKS] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NO_RETREAT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TAR_SHOT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGIC_POWDER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_DARTS] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TEATIME] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_OCTOLOCK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BOLT_BEAK] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FISHIOUS_REND] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COURT_CHANGE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CLANGOROUS_SOUL] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BODY_PRESS] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DECORATE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRUM_BEATING] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SNAP_TRAP] = - { - .effect = EFFECT_HIT, - .power = 35, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PYRO_BALL] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FIRE, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BEHEMOTH_BLADE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BEHEMOTH_BASH] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AURA_WHEEL] = - { - .effect = EFFECT_HIT, - .power = 110, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BREAKING_SWIPE] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BRANCH_POKE] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_OVERDRIVE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_APPLE_ACID] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GRAV_APPLE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPIRIT_BREAK] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STRANGE_STEAM] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LIFE_DEW] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_OBSTRUCT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_FALSE_SURRENDER] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_METEOR_ASSAULT] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ETERNABEAM] = - { - .effect = EFFECT_HIT, - .power = 160, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STEEL_BEAM] = - { - .effect = EFFECT_HIT, - .power = 140, - .type = TYPE_STEEL, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_EXPANDING_FORCE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STEEL_ROLLER] = - { - .effect = EFFECT_HIT, - .power = 130, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SCALE_SHOT] = - { - .effect = EFFECT_HIT, - .power = 25, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_METEOR_BEAM] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHELL_SIDE_ARM] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MISTY_EXPLOSION] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GRASSY_GLIDE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 55, - #else - .power = 70, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RISING_VOLTAGE] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TERRAIN_PULSE] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SKITTER_SMACK] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_BUG, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BURNING_JEALOUSY] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LASH_OUT] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POLTERGEIST] = - { - .effect = EFFECT_HIT, - .power = 110, - .type = TYPE_GHOST, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CORROSIVE_GAS] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COACHING] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLIP_TURN] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRIPLE_AXEL] = - { - .effect = EFFECT_HIT, - .power = 20, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DUAL_WINGBEAT] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_FLYING, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SCORCHING_SANDS] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_JUNGLE_HEALING] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WICKED_BLOW] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 75, - #else - .power = 80, - #endif - .effect = EFFECT_HIT, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SURGING_STRIKES] = - { - .effect = EFFECT_HIT, - .power = 25, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_THUNDER_CAGE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_ELECTRIC, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_ENERGY] = - { - .effect = EFFECT_HIT, - .power = 150, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FREEZING_GLARE] = - { - .power = 90, - #if B_USE_FROSTBITE == TRUE - .effect = EFFECT_HIT, - #else - .effect = EFFECT_HIT, - #endif - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FIERY_WRATH] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_THUNDEROUS_KICK] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GLACIAL_LANCE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 120, - #else - .power = 130, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ASTRAL_BARRAGE] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_EERIE_SPELL] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DIRE_CLAW] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 80, - #else - .power = 60, - #endif - .effect = EFFECT_HIT, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYSHIELD_BASH] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_PSYCHIC, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POWER_SHIFT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_STONE_AXE] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPRINGTIDE_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 100, - #else - .power = 95, - #endif - .effect = EFFECT_HIT, - .type = TYPE_NORMAL, - .accuracy = 80, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MYSTICAL_POWER] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_PSYCHIC, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RAGING_FURY] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 120, - #else - .power = 90, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WAVE_CRASH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 120, - #else - .power = 75, - #endif - .effect = EFFECT_HIT, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CHLOROBLAST] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 150, - #else - .power = 120, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GRASS, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MOUNTAIN_GALE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ICE, - .accuracy = 85, - .pp = 5, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_VICTORY_DANCE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HEADLONG_RUSH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 120, - #else - .power = 100, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BARB_BARRAGE] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_POISON, - .accuracy = 100, - #if B_UPDATED_MOVE_DATA >= GEN_9 - .pp = 10, - #else - .pp = 15, - #endif - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ESPER_WING] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 80, - .accuracy = 100, - #else - .power = 75, - .accuracy = 90, - #endif - .effect = EFFECT_HIT, - .type = TYPE_PSYCHIC, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BITTER_MALICE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 75, - #else - .power = 60, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHELTER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRIPLE_ARROWS] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 90, - .pp = 10, - #else - .power = 50, - .pp = 15, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FIGHTING, - .accuracy = 100, - .secondaryEffectChance = 100, // 50% Defense down, 30% Flinch. Can be modified in 'SetMoveEffect' - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_INFERNAL_PARADE] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CEASELESS_EDGE] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_DARK, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BLEAKWIND_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 100, - .pp = 10, - #else - .power = 95, - .pp = 5, - #endif - .effect = EFFECT_HIT, - .type = TYPE_FLYING, - .accuracy = 80, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WILDBOLT_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 100, - .pp = 10, - #else - .power = 95, - .pp = 5, - #endif - .effect = EFFECT_HIT, - .type = TYPE_ELECTRIC, - .accuracy = 80, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SANDSEAR_STORM] = - { - #if B_UPDATED_MOVE_DATA >= GEN_9 - .power = 100, - .pp = 10, - #else - .power = 95, - .pp = 5, - #endif - .effect = EFFECT_HIT, - .type = TYPE_GROUND, - .accuracy = 80, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LUNAR_BLESSING] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TAKE_HEART] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TERA_BLAST] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SILK_TRAP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_AXE_KICK] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FIGHTING, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LAST_RESPECTS] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_LUMINA_CRASH] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ORDER_UP] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_JET_PUNCH] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_SPICY_EXTRACT] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SPIN_OUT] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POPULATION_BOMB] = - { - .effect = EFFECT_HIT, - .power = 20, - .type = TYPE_NORMAL, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ICE_SPINNER] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_ICE, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GLAIVE_RUSH] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_REVIVAL_BLESSING] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SALT_CURE] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRIPLE_DIVE] = - { - .effect = EFFECT_HIT, - .power = 30, - .type = TYPE_WATER, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MORTAL_SPIN] = - { - .effect = EFFECT_HIT, - .power = 30, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DOODLE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FILLET_AWAY] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_KOWTOW_CLEAVE] = - { - .effect = EFFECT_HIT, - .power = 85, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FLOWER_TRICK] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TORCH_SONG] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AQUA_STEP] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RAGING_BULL] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAKE_IT_RAIN] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RUINATION] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DARK, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COLLISION_COURSE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ELECTRO_DRIFT] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SHED_TAIL] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CHILLY_RECEPTION] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TIDY_UP] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SNOWSCAPE] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_POUNCE] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_BUG, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TRAILBLAZE] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_CHILLING_WATER] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HYPER_DRILL] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TWIN_BEAM] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_RAGE_FIST] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_GHOST, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ARMOR_CANNON] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BITTER_BLADE] = - { - .effect = EFFECT_HIT, - .power = 90, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DOUBLE_SHOCK] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_GIGATON_HAMMER] = - { - .effect = EFFECT_HIT, - .power = 160, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COMEUPPANCE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_AQUA_CUTTER] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BLAZING_TORQUE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_WICKED_TORQUE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_NOXIOUS_TORQUE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_COMBAT_TORQUE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAGICAL_TORQUE] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYBLADE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HYDRO_STEAM] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BLOOD_MOON] = - { - .effect = EFFECT_HIT, - .power = 140, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MATCHA_GOTCHA] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 90, - .pp = 15, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SYRUP_BOMB] = - { - .effect = EFFECT_HIT, - .power = 60, - .type = TYPE_GRASS, - .accuracy = 85, - .pp = 10, - .secondaryEffectChance = 100, // syrup bomb volatile status - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_IVY_CUDGEL] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ELECTRO_SHOT] = - { - .effect = EFFECT_HIT, - .power = 130, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TERA_STARSTORM] = - { - .effect = EFFECT_HIT, - .power = 120, - .type = TYPE_NORMAL, // Stellar type if used by Terapagos-Stellar - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_FICKLE_BEAM] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_BURNING_BULWARK] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_THUNDERCLAP] = - { - .effect = EFFECT_HIT, - .power = 70, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = 0 -}, - - [MOVE_MIGHTY_CLEAVE] = - { - .effect = EFFECT_HIT, - .power = 95, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TACHYON_CUTTER] = - { - .effect = EFFECT_HIT, - .power = 50, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_HARD_PRESS] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_DRAGON_CHEER] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_DRAGON, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_ALLURING_VOICE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_TEMPER_FLARE] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_SUPERCELL_SLAM] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_ELECTRIC, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_PSYCHIC_NOISE] = - { - .effect = EFFECT_HIT, - .power = 75, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_UPPER_HAND] = - { - .effect = EFFECT_HIT, - .power = 65, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 3, - .flags = 0 -}, - - [MOVE_MALIGNANT_CHAIN] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 50, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - // Z-Moves - [MOVE_BREAKNECK_BLITZ] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_ALL_OUT_PUMMELING] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SUPERSONIC_SKYSTRIKE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FLYING, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_ACID_DOWNPOUR] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_TECTONIC_RAGE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_GROUND, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_CONTINENTAL_CRUSH] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SAVAGE_SPIN_OUT] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_NEVER_ENDING_NIGHTMARE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_CORKSCREW_CRASH] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_INFERNO_OVERDRIVE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_HYDRO_VORTEX] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_BLOOM_DOOM] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_GIGAVOLT_HAVOC] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SHATTERED_PSYCHE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SUBZERO_SLAMMER] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_DEVASTATING_DRAKE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DRAGON, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_BLACK_HOLE_ECLIPSE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_TWINKLE_TACKLE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_CATASTROPIKA] = - { - .effect = EFFECT_HIT, - .power = 210, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_10000000_VOLT_THUNDERBOLT] = - { - .effect = EFFECT_HIT, - .power = 195, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_STOKED_SPARKSURFER] = - { - .effect = EFFECT_HIT, - .power = 175, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_EXTREME_EVOBOOST] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_PULVERIZING_PANCAKE] = - { - .effect = EFFECT_HIT, - .power = 210, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_GENESIS_SUPERNOVA] = - { - .effect = EFFECT_HIT, - .power = 185, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SINISTER_ARROW_RAID] = - { - .effect = EFFECT_HIT, - .power = 180, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_MALICIOUS_MOONSAULT] = - { - .effect = EFFECT_HIT, - .power = 180, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_OCEANIC_OPERETTA] = - { - .effect = EFFECT_HIT, - .power = 195, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SPLINTERED_STORMSHARDS] = - { - .effect = EFFECT_HIT, - .power = 190, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_LETS_SNUGGLE_FOREVER] = - { - .effect = EFFECT_HIT, - .power = 190, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_CLANGOROUS_SOULBLAZE] = - { - .effect = EFFECT_HIT, - .power = 185, - .type = TYPE_DRAGON, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_GUARDIAN_OF_ALOLA] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SEARING_SUNRAZE_SMASH] = - { - .effect = EFFECT_HIT, - .power = 200, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_MENACING_MOONRAZE_MAELSTROM] = - { - .effect = EFFECT_HIT, - .power = 200, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_LIGHT_THAT_BURNS_THE_SKY] = - { - .effect = EFFECT_HIT, - .power = 200, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - [MOVE_SOUL_STEALING_7_STAR_STRIKE] = - { - .effect = EFFECT_HIT, - .power = 195, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 1, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_GUARD] = - { - .effect = EFFECT_HIT, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 4, - .flags = 0 -}, - - [MOVE_MAX_FLARE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_FLUTTERBY] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_LIGHTNING] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_STRIKE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_KNUCKLE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_PHANTASM] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_HAILSTORM] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_OOZE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_GEYSER] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_AIRSTREAM] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_FLYING, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_STARFALL] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_WYRMWIND] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DRAGON, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_MINDSTORM] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_ROCKFALL] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_QUAKE] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_GROUND, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_DARKNESS] = - { - .effect = EFFECT_HIT, - .power = 1, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_OVERGROWTH] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_MAX_STEELSPIKE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_VINE_LASH] = - { //ANIM TODO - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_WILDFIRE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_CANNONADE] = - { //ANIM TODO - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_BEFUDDLE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_BUG, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_VOLT_CRASH] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_GOLD_RUSH] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_CHI_STRIKE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_TERROR] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GHOST, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_FOAM_BURST] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_RESONANCE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_ICE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_CUDDLE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_REPLENISH] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_MALODOR] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_POISON, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_MELTDOWN] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_DRUM_SOLO] = - { //ANIM TODO - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_FIREBALL] = - { //ANIM TODO - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_HYDROSNIPE] = - { //ANIM TODO - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_WIND_RAGE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_FLYING, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_GRAVITAS] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_PSYCHIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_STONESURGE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_VOLCALITH] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_ROCK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_TARTNESS] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_SWEETNESS] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_SANDBLAST] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_GROUND, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_STUN_SHOCK] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_CENTIFERNO] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_FIRE, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_SMITE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - - [MOVE_G_MAX_SNOOZE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_FINALE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_STEELSURGE] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_STEEL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_DEPLETION] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_DRAGON, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_ONE_BLOW] = - { - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - - [MOVE_G_MAX_RAPID_FLOW] = - { //ANIM TODO - .effect = EFFECT_HIT, - .power = 10, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0 -}, - -}; diff --git a/src/data/moves_info.h b/src/data/moves_info.h new file mode 100644 index 000000000..4bdf8400c --- /dev/null +++ b/src/data/moves_info.h @@ -0,0 +1,18118 @@ +#include "battle_dynamax.h" +#include "constants/battle.h" +#include "constants/battle_move_effects.h" +#include "constants/battle_script_commands.h" +#include "constants/battle_string_ids.h" +#include "constants/battle_z_move_effects.h" +#include "constants/hold_effects.h" +#include "constants/moves.h" +// #include "constants/contest.h" + +// The Gen. 4+ contest data comes from urpg's contest movedex. + +#if B_EXPANDED_MOVE_NAMES == TRUE +#define HANDLE_EXPANDED_MOVE_NAME(_name, ...) COMPOUND_STRING(DEFAULT(_name, __VA_ARGS__)) +#else +#define HANDLE_EXPANDED_MOVE_NAME(_name, ...) COMPOUND_STRING(_name) +#endif + +#if B_BINDING_TURNS >= GEN_5 +#define BINDING_TURNS "4 or 5" +#else +#define BINDING_TURNS "2 to 5" +#endif + +/* First arg is the charge turn string id, second arg depends on effect +EFFECT_SEMI_INVULNERABLE/EFFECT_SKY_DROP: semi-invulnerable STATUS3 to apply to battler +EFFECT_TWO_TURNS_ATTACK/EFFECT_SOLAR_BEAM: weather in which to skip charge turn */ +#define TWO_TURN_ARG(stringid, ...) (stringid) __VA_OPT__(| ((__VA_ARGS__) << 16)) + +// Shared Move Description entries + +const u8 gNotDoneYetDescription[] = _( + "This move can't be used. Its\n" + "effect is in development."); + +static const u8 sNullDescription[] = _(""); + +static const u8 sMegaDrainDescription[] = _( + "An attack that absorbs\n" + "half the damage inflicted."); + +static const u8 sHyperBeamDescription[] = _( + "Powerful, but leaves the\n" + "user immobile the next turn."); + +static const u8 sRevengeDescription[] = _( + "An attack that gains power\n" + "if injured by the foe."); + +static const u8 sPluckDescription[] = _( + "Eats the foe's held Berry\n" + "gaining its effect."); + +static const u8 sHealingWishDescription[] = _( + "The user faints to heal up\n" + "the recipient."); + +static const u8 sWringOutDescription[] = _( + "The higher the foe's HP\n" + "the more damage caused."); + +static const u8 sUTurnDescription[] = _( + "Does damage then switches\n" + "out the user."); + +static const u8 sStormThrowDescription[] = _( + "This attack always results\n" + "in a critical hit."); + +static const u8 sCircleThrowDescription[] = _( + "Knocks the foe away to end\n" + "the battle."); + +static const u8 sChipAwayDescription[] = _( + "Strikes through the foe's\n" + "stat changes."); + +static const u8 sHeavySlamDescription[] = _( + "Does more damage if the\n" + "user outweighs the foe."); + +static const u8 sPsyshockDescription[] = _( + "Attacks with a psychic wave\n" + "that does physical damage."); + +static const u8 sLavaPlumeDescription[] = _( + "Scarlet flames torch\n" + "everything around the user."); + +static const u8 sShadowForceDescription[] = _( + "Vanishes on the first turn\n" + "then strikes the next turn."); + +static const u8 sFalseSwipeDescription[] = _( + "An attack that leaves the\n" + "foe with at least 1 HP."); + +static const u8 sDrainingKissDescription[] = _( + "An attack that absorbs over\n" + "half the damage inflicted."); + +static const u8 sCloseCombatDescription[] = _( + "A strong attack but lowers\n" + "the defensive stats."); + +static const u8 sHyperspaceHoleDescription[] = _( + "Uses a warp hole to attack.\n" + "Can't be evaded."); + +static const u8 sSuckerPunchDescription[] = _( + "Strikes first if the foe\n" + "is preparing an attack."); + +static const u8 sFeintDescription[] = _( + "An attack that hits foes\n" + "using moves like Protect."); + +const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = +{ + [MOVE_NONE] = + { + .name = COMPOUND_STRING("-"), + .description = COMPOUND_STRING(""), + .effect = EFFECT_HIT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .mirrorMoveBanned = TRUE, + .sketchBanned = TRUE, + }, + + [MOVE_POUND] = + { + .name = COMPOUND_STRING("Pound"), + .description = COMPOUND_STRING( + "Pounds the foe with\n" + "forelegs or tail."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS == GEN_4, + }, + + [MOVE_KARATE_CHOP] = + { + .name = COMPOUND_STRING("Karate Chop"), + .description = COMPOUND_STRING( + "A chopping attack with a\n" + "high critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_FIGHTING, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_DOUBLE_SLAP] = + { + .name = COMPOUND_STRING("Double Slap"), + .description = COMPOUND_STRING( + "Repeatedly slaps the foe\n" + "2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 15, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_COMET_PUNCH] = + { + .name = COMPOUND_STRING("Comet Punch"), + .description = COMPOUND_STRING( + "Repeatedly punches the foe\n" + "2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 18, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + }, + + [MOVE_MEGA_PUNCH] = + { + .name = COMPOUND_STRING("Mega Punch"), + .description = COMPOUND_STRING( + "A strong punch thrown with\n" + "incredible power."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + }, + + [MOVE_PAY_DAY] = + { + .name = COMPOUND_STRING("Pay Day"), + .description = COMPOUND_STRING( + "Throws coins at the foe.\n" + "Money is recovered after."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PAYDAY, + }), + }, + + [MOVE_FIRE_PUNCH] = + { + .name = COMPOUND_STRING("Fire Punch"), + .description = COMPOUND_STRING( + "A fiery punch that may burn\n" + "the foe."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_ICE_PUNCH] = + { + .name = COMPOUND_STRING("Ice Punch"), + .description = COMPOUND_STRING( + "An icy punch that may\n" + #if B_USE_FROSTBITE == TRUE + "leave the foe with frostbite."), + #else + "freeze the foe."), + #endif + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }), + }, + + [MOVE_THUNDER_PUNCH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ThunderPunch", "Thunder Punch"), + .description = COMPOUND_STRING( + "An electrified punch that\n" + "may paralyze the foe."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 10, + }), + }, + + [MOVE_SCRATCH] = + { + .name = COMPOUND_STRING("Scratch"), + .description = COMPOUND_STRING( + "Scratches the foe with\n" + "sharp claws."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_VISE_GRIP] = + { + .name = COMPOUND_STRING("Vise Grip"), + .description = COMPOUND_STRING( + "Grips the foe with large and\n" + "powerful pincers."), + .effect = EFFECT_HIT, + .power = 55, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_GUILLOTINE] = + { + .name = COMPOUND_STRING("Guillotine"), + .description = COMPOUND_STRING( + "A powerful pincer attack\n" + "that may cause fainting."), + .effect = EFFECT_OHKO, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 30, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_RAZOR_WIND] = + { + .name = COMPOUND_STRING("Razor Wind"), + .description = COMPOUND_STRING( + "A 2-turn move that strikes\n" + "the foe on the 2nd turn."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .windMove = B_EXTRAPOLATED_MOVE_FLAGS, + .argument = TWO_TURN_ARG(STRINGID_PKMNWHIPPEDWHIRLWIND), + }, + + [MOVE_SWORDS_DANCE] = + { + .name = COMPOUND_STRING("Swords Dance"), + .description = COMPOUND_STRING( + "A fighting dance that\n" + "sharply raises Attack."), + .effect = EFFECT_ATTACK_UP_2, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .danceMove = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_CUT] = + { + .name = COMPOUND_STRING("Cut"), + .description = COMPOUND_STRING( + "Cuts the foe with sharp\n" + "scythes, claws, etc."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_NORMAL, + .accuracy = 95, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_GUST] = + { + .name = COMPOUND_STRING("Gust"), + .description = COMPOUND_STRING( + "Strikes the foe with a gust\n" + "of wind whipped up by wings."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_4) || (B_UPDATED_MOVE_FLAGS < GEN_3), + .damagesAirborneDoubleDamage = TRUE, + .windMove = TRUE, + }, + + [MOVE_WING_ATTACK] = + { + .name = COMPOUND_STRING("Wing Attack"), + .description = COMPOUND_STRING( + "Strikes the foe with wings\n" + "spread wide."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_WHIRLWIND] = + { + .name = COMPOUND_STRING("Whirlwind"), + .description = COMPOUND_STRING( + "Blows away the foe with\n" + "wind and ends the battle."), + .effect = EFFECT_ROAR, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 0 : 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = -6, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .windMove = TRUE, + .ignoresProtect = B_UPDATED_MOVE_FLAGS >= GEN_6, + .ignoresSubstitute = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_FLY] = + { + .name = COMPOUND_STRING("Fly"), + .description = COMPOUND_STRING( + "Flies up on the first turn,\n" + "then strikes the next turn."), + .effect = EFFECT_SEMI_INVULNERABLE, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 90 : 70, + .type = TYPE_FLYING, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .gravityBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNFLEWHIGH, COMPRESS_BITS(STATUS3_ON_AIR)), + }, + + [MOVE_BIND] = + { + .name = COMPOUND_STRING("Bind"), + .description = COMPOUND_STRING( + "Binds and squeezes the foe\n" + "for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = 15, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 85 : 75, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_SLAM] = + { + .name = COMPOUND_STRING("Slam"), + .description = COMPOUND_STRING( + "Slams the foe with a long\n" + "tail, vine, etc."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 75, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_VINE_WHIP] = + { + .name = COMPOUND_STRING("Vine Whip"), + .description = COMPOUND_STRING( + "Strikes the foe with\n" + "slender, whiplike vines."), + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 25, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .pp = 15, + #else + .pp = 10, + #endif + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 45 : 35, + .type = TYPE_GRASS, + .accuracy = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_STOMP] = + { + .name = COMPOUND_STRING("Stomp"), + .description = COMPOUND_STRING( + "Stomps the enemy with a big\n" + "foot. May cause flinching."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = TRUE, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_DOUBLE_KICK] = + { + .name = COMPOUND_STRING("Double Kick"), + .description = COMPOUND_STRING( + "A double-kicking attack\n" + "that strikes the foe twice."), + .effect = EFFECT_HIT, + .power = 30, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 2, + }, + + [MOVE_MEGA_KICK] = + { + .name = COMPOUND_STRING("Mega Kick"), + .description = COMPOUND_STRING( + "An extremely powerful kick\n" + "with intense force."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_NORMAL, + .accuracy = 75, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_JUMP_KICK] = + { + .name = COMPOUND_STRING("Jump Kick"), + .description = COMPOUND_STRING( + "A strong jumping kick. May\n" + "miss and hurt the kicker."), + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 100, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .power = 85, + #else + .power = 70, + #endif + .effect = EFFECT_RECOIL_IF_MISS, + .type = TYPE_FIGHTING, + .accuracy = 95, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .gravityBanned = TRUE, + }, + + [MOVE_ROLLING_KICK] = + { + .name = COMPOUND_STRING("Rolling Kick"), + .description = COMPOUND_STRING( + "A fast kick delivered from\n" + "a rapid spin."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_FIGHTING, + .accuracy = 85, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_SAND_ATTACK] = + { + .name = COMPOUND_STRING("Sand Attack"), + .description = COMPOUND_STRING( + "Reduces the foe's accuracy\n" + "by hurling sand in its face."), + .effect = EFFECT_ACCURACY_DOWN, + .power = 0, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_HEADBUTT] = + { + .name = COMPOUND_STRING("Headbutt"), + .description = COMPOUND_STRING( + "A ramming attack that may\n" + "cause flinching."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_HORN_ATTACK] = + { + .name = COMPOUND_STRING("Horn Attack"), + .description = COMPOUND_STRING( + "Jabs the foe with sharp\n" + "horns."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_FURY_ATTACK] = + { + .name = COMPOUND_STRING("Fury Attack"), + .description = COMPOUND_STRING( + "Jabs the foe 2 to 5 times\n" + "with sharp horns, etc."), + .effect = EFFECT_MULTI_HIT, + .power = 15, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_HORN_DRILL] = + { + .name = COMPOUND_STRING("Horn Drill"), + .description = COMPOUND_STRING( + "A one-hit KO attack that\n" + "uses a horn like a drill."), + .effect = EFFECT_OHKO, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 30, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_TACKLE] = + { + .name = COMPOUND_STRING("Tackle"), + .description = COMPOUND_STRING( + "Charges the foe with a full-\n" + "body tackle."), + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 40, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .power = 50, + #else + .power = 35, + #endif + .effect = EFFECT_HIT, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 100 : 95, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_BODY_SLAM] = + { + .name = COMPOUND_STRING("Body Slam"), + .description = COMPOUND_STRING( + "A full-body slam that may\n" + "cause paralysis."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS >= GEN_6, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_WRAP] = + { + .name = COMPOUND_STRING("Wrap"), + .description = COMPOUND_STRING( + "Wraps and squeezes the foe\n" + BINDING_TURNS" times with vines, etc."), + .effect = EFFECT_HIT, + .power = 15, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 90 : 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_TAKE_DOWN] = + { + .name = COMPOUND_STRING("Take Down"), + .description = COMPOUND_STRING( + "A reckless charge attack\n" + "that also hurts the user."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_NORMAL, + .accuracy = 85, + .recoil = 25, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_THRASH] = + { + .name = COMPOUND_STRING("Thrash"), + .description = COMPOUND_STRING( + "A rampage of 2 to 3 turns\n" + "that confuses the user."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 120 : 90, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 20, + .target = MOVE_TARGET_RANDOM, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .instructBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_THRASH, + .self = TRUE, + }), + }, + + [MOVE_DOUBLE_EDGE] = + { + .name = COMPOUND_STRING("Double-Edge"), + .description = COMPOUND_STRING( + "A life-risking tackle that\n" + "also hurts the user."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_NORMAL, + .accuracy = 100, + .recoil = 33, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_TAIL_WHIP] = + { + .name = COMPOUND_STRING("Tail Whip"), + .description = COMPOUND_STRING( + "Wags the tail to lower the\n" + "foe's Defense."), + .effect = EFFECT_DEFENSE_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_POISON_STING] = + { + .name = COMPOUND_STRING("Poison Sting"), + .description = COMPOUND_STRING( + "A toxic attack with barbs,\n" + "etc., that may poison."), + .effect = EFFECT_HIT, + .power = 15, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 30, + }), + }, + + [MOVE_TWINEEDLE] = + { + .name = COMPOUND_STRING("Twineedle"), + .description = COMPOUND_STRING( + "Stingers on the forelegs\n" + "jab the foe twice."), + .effect = EFFECT_HIT, + .power = 25, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .strikeCount = 2, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 20, + }), + }, + + [MOVE_PIN_MISSILE] = + { + .name = COMPOUND_STRING("Pin Missile"), + .description = COMPOUND_STRING( + "Sharp pins are fired to\n" + "strike 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 25 : 14, + .type = TYPE_BUG, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 95 : 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_LEER] = + { + .name = COMPOUND_STRING("Leer"), + .description = COMPOUND_STRING( + "Frightens the foe with a\n" + "leer to lower Defense."), + .effect = EFFECT_DEFENSE_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_BITE] = + { + .name = COMPOUND_STRING("Bite"), + .description = COMPOUND_STRING( + "Bites with vicious fangs.\n" + "May cause flinching."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_GROWL] = + { + .name = COMPOUND_STRING("Growl"), + .description = COMPOUND_STRING( + "Growls cutely to reduce the\n" + "foe's Attack."), + .effect = EFFECT_ATTACK_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + }, + + [MOVE_ROAR] = + { + .name = COMPOUND_STRING("Roar"), + .description = COMPOUND_STRING( + "Makes the foe flee to end\n" + "the battle."), + .effect = EFFECT_ROAR, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 0 : 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = -6, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = B_UPDATED_MOVE_FLAGS >= GEN_6, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .soundMove = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SING] = + { + .name = COMPOUND_STRING("Sing"), + .description = COMPOUND_STRING( + "A soothing song lulls the\n" + "foe into a deep slumber."), + .effect = EFFECT_SLEEP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 55, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + }, + + [MOVE_SUPERSONIC] = + { + .name = COMPOUND_STRING("Supersonic"), + .description = COMPOUND_STRING( + "Emits bizarre sound waves\n" + "that may confuse the foe."), + .effect = EFFECT_CONFUSE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 55, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + }, + + [MOVE_SONIC_BOOM] = + { + .name = COMPOUND_STRING("Sonic Boom"), + .description = COMPOUND_STRING( + "Launches shock waves that\n" + "always inflict 20 HP damage."), + .effect = EFFECT_FIXED_DAMAGE_ARG, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = 20, + }, + + [MOVE_DISABLE] = + { + .name = COMPOUND_STRING("Disable"), + .description = COMPOUND_STRING( + "Psychically disables one of\n" + "the foe's moves."), + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 100, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .accuracy = 80, + #else + .accuracy = 55, + #endif + .effect = EFFECT_DISABLE, + .power = 0, + .type = TYPE_NORMAL, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresSubstitute = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_ACID] = + { + .name = COMPOUND_STRING("Acid"), + .description = COMPOUND_STRING( + "Sprays a hide-melting acid.\n" + #if B_UPDATED_MOVE_DATA >= GEN_4 + "May lower Sp. Def."), + #else + "May lower Defense."), + #endif + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = B_UPDATED_MOVE_DATA >= GEN_4 ? MOVE_EFFECT_SP_DEF_MINUS_1 : MOVE_EFFECT_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_EMBER] = + { + .name = COMPOUND_STRING("Ember"), + .description = COMPOUND_STRING( + "A weak fire attack that may\n" + "inflict a burn."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_FLAMETHROWER] = + { + .name = COMPOUND_STRING("Flamethrower"), + .description = COMPOUND_STRING( + "A powerful fire attack that\n" + "may inflict a burn."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 95, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_MIST] = + { + .name = COMPOUND_STRING("Mist"), + .description = COMPOUND_STRING( + "Creates a mist that stops\n" + "reduction of abilities."), + .effect = EFFECT_MIST, + .power = 0, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_WATER_GUN] = + { + .name = COMPOUND_STRING("Water Gun"), + .description = COMPOUND_STRING( + "Squirts water to attack\n" + "the foe."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_HYDRO_PUMP] = + { + .name = COMPOUND_STRING("Hydro Pump"), + .description = COMPOUND_STRING( + "Blasts water at high power\n" + "to strike the foe."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 110 : 120, + .type = TYPE_WATER, + .accuracy = 80, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_SURF] = + { + .name = COMPOUND_STRING("Surf"), + .description = COMPOUND_STRING( + "Creates a huge wave, then\n" + "crashes it down on the foe."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 95, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = B_UPDATED_MOVE_DATA >= GEN_4 ? MOVE_TARGET_FOES_AND_ALLY : MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .damagesUnderwater = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_ICE_BEAM] = + { + .name = COMPOUND_STRING("Ice Beam"), + .description = COMPOUND_STRING( + "Blasts the foe with an icy\n" + #if B_USE_FROSTBITE == TRUE + "beam. May cause frostbite."), + #else + "beam that may freeze it."), + #endif + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 95, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + // The following effect is also relevant in battle_pike.c + // If you cherry-pick this to use something other than the config, make sure to update it there too + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }), + }, + + [MOVE_BLIZZARD] = + { + .name = COMPOUND_STRING("Blizzard"), + .description = COMPOUND_STRING( + "Hits the foe with an icy\n" + #if B_USE_FROSTBITE == TRUE + "storm. May cause frostbite."), + #else + "storm that may freeze it."), + #endif + .effect = B_BLIZZARD_HAIL >= GEN_4 ? EFFECT_BLIZZARD : EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 110 : 120, + .type = TYPE_ICE, + .accuracy = 70, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }), + }, + + [MOVE_PSYBEAM] = + { + .name = COMPOUND_STRING("Psybeam"), + .description = COMPOUND_STRING( + "Fires a peculiar ray that\n" + "may confuse the foe."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 10, + }), + }, + + [MOVE_BUBBLE_BEAM] = + { + .name = COMPOUND_STRING("Bubble Beam"), + .description = COMPOUND_STRING( + "Forcefully sprays bubbles\n" + "that may lower Speed."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_AURORA_BEAM] = + { + .name = COMPOUND_STRING("Aurora Beam"), + .description = COMPOUND_STRING( + "Fires a rainbow-colored\n" + "beam that may lower Attack."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_HYPER_BEAM] = + { + .name = COMPOUND_STRING("Hyper Beam"), + .description = sHyperBeamDescription, + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_PECK] = + { + .name = COMPOUND_STRING("Peck"), + .description = COMPOUND_STRING( + "Attacks the foe with a\n" + "jabbing beak, etc."), + .effect = EFFECT_HIT, + .power = 35, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_DRILL_PECK] = + { + .name = COMPOUND_STRING("Drill Peck"), + .description = COMPOUND_STRING( + "A corkscrewing attack with\n" + "the beak acting as a drill."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SUBMISSION] = + { + .name = COMPOUND_STRING("Submission"), + .description = COMPOUND_STRING( + "A reckless body slam that\n" + "also hurts the user."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FIGHTING, + .accuracy = 80, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 25, + .recoil = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_LOW_KICK] = + { + .name = COMPOUND_STRING("Low Kick"), + .description = COMPOUND_STRING( + "A kick that inflicts more\n" + "damage on heavier foes."), + .effect = EFFECT_LOW_KICK, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_COUNTER] = + { + .name = COMPOUND_STRING("Counter"), + .description = COMPOUND_STRING( + "Retaliates any physical hit\n" + "with double the power."), + .effect = EFFECT_COUNTER, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_DEPENDS, + .priority = -5, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .meFirstBanned = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_2, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SEISMIC_TOSS] = + { + .name = COMPOUND_STRING("Seismic Toss"), + .description = COMPOUND_STRING( + "Inflicts damage identical\n" + "to the user's level."), + .effect = EFFECT_LEVEL_DAMAGE, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_STRENGTH] = + { + .name = COMPOUND_STRING("Strength"), + .description = COMPOUND_STRING( + "Builds enormous power,\n" + "then slams the foe."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_ABSORB] = + { + .name = COMPOUND_STRING("Absorb"), + .description = COMPOUND_STRING( + "An attack that absorbs\n" + "half the damage inflicted."), + .effect = EFFECT_ABSORB, + .power = 20, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_4 ? 25 : 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_MEGA_DRAIN] = + { + .name = COMPOUND_STRING("Mega Drain"), + .description = sMegaDrainDescription, + .effect = EFFECT_ABSORB, + .power = 40, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_4 ? 15 : 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .zMove = { .powerOverride = 120 }, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_LEECH_SEED] = + { + .name = COMPOUND_STRING("Leech Seed"), + .description = COMPOUND_STRING( + "Plants a seed on the foe to\n" + "steal HP on every turn."), + .effect = EFFECT_LEECH_SEED, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + }, + + [MOVE_GROWTH] = + { + .name = COMPOUND_STRING("Growth"), + .description = COMPOUND_STRING( + "Forces the body to grow\n" + "and heightens Sp. Atk."), + .effect = B_GROWTH_STAT_RAISE >= GEN_5 ? EFFECT_GROWTH : EFFECT_SPECIAL_ATTACK_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_RAZOR_LEAF] = + { + .name = COMPOUND_STRING("Razor Leaf"), + .description = COMPOUND_STRING( + "Cuts the enemy with leaves.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 55, + .type = TYPE_GRASS, + .accuracy = 95, + .criticalHitStage = 1, + .pp = 25, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .slicingMove = TRUE, + }, + + [MOVE_SOLAR_BEAM] = + { + .name = COMPOUND_STRING("Solar Beam"), + .description = COMPOUND_STRING( + "Absorbs light in one turn,\n" + "then attacks next turn."), + .effect = EFFECT_SOLAR_BEAM, + .power = 120, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNTOOKSUNLIGHT, B_WEATHER_SUN), + }, + + [MOVE_POISON_POWDER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PoisonPowder", "Poison Powder"), + .description = COMPOUND_STRING( + "Scatters a toxic powder\n" + "that may poison the foe."), + .effect = EFFECT_POISON, + .power = 0, + .type = TYPE_POISON, + .accuracy = 75, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + .powderMove = TRUE, + }, + + [MOVE_STUN_SPORE] = + { + .name = COMPOUND_STRING("Stun Spore"), + .description = COMPOUND_STRING( + "Scatters a powder that may\n" + "paralyze the foe."), + .effect = EFFECT_PARALYZE, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 75, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + .powderMove = TRUE, + }, + + [MOVE_SLEEP_POWDER] = + { + .name = COMPOUND_STRING("Sleep Powder"), + .description = COMPOUND_STRING( + "Scatters a powder that may\n" + "cause the foe to sleep."), + .effect = EFFECT_SLEEP, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 75, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + .powderMove = TRUE, + }, + + [MOVE_PETAL_DANCE] = + { + .name = COMPOUND_STRING("Petal Dance"), + .description = COMPOUND_STRING( + "A rampage of 2 to 3 turns\n" + "that confuses the user."), + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 120, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 90, + #else + .power = 70, + #endif + .effect = EFFECT_HIT, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 20, + .target = MOVE_TARGET_RANDOM, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = TRUE, + .danceMove = TRUE, + .instructBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_THRASH, + .self = TRUE, + }), + }, + + [MOVE_STRING_SHOT] = + { + .name = COMPOUND_STRING("String Shot"), + .description = COMPOUND_STRING( + "Binds the foe with string\n" + "to reduce its Speed."), + .effect = B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_SPEED_DOWN_2 : EFFECT_SPEED_DOWN, + .power = 0, + .type = TYPE_BUG, + .accuracy = 95, + .pp = 40, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_DRAGON_RAGE] = + { + .name = COMPOUND_STRING("Dragon Rage"), + .description = COMPOUND_STRING( + "Launches shock waves that\n" + "always inflict 40 HP damage."), + .effect = EFFECT_FIXED_DAMAGE_ARG, + .power = 1, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_4) || (B_UPDATED_MOVE_FLAGS < GEN_3), + .argument = 40, + }, + + [MOVE_FIRE_SPIN] = + { + .name = COMPOUND_STRING("Fire Spin"), + .description = COMPOUND_STRING( + "Traps the foe in a ring of\n" + "fire for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 35 : 15, + .type = TYPE_FIRE, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 85 : 70, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_THUNDER_SHOCK] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ThunderShock", "Thunder Shock"), + .description = COMPOUND_STRING( + "An electrical attack that\n" + "may paralyze the foe."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 10, + }), + }, + + [MOVE_THUNDERBOLT] = + { + .name = COMPOUND_STRING("Thunderbolt"), + .description = COMPOUND_STRING( + "A strong electrical attack\n" + "that may paralyze the foe."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 95, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 10, + }), + }, + + [MOVE_THUNDER_WAVE] = + { + .name = COMPOUND_STRING("Thunder Wave"), + .description = COMPOUND_STRING( + "A weak jolt of electricity\n" + "that paralyzes the foe."), + .effect = EFFECT_PARALYZE, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_7 ? 90 : 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_THUNDER] = + { + .name = COMPOUND_STRING("Thunder"), + .description = COMPOUND_STRING( + "A lightning attack that may\n" + "cause paralysis."), + .effect = EFFECT_THUNDER, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 110 : 120, + .type = TYPE_ELECTRIC, + .accuracy = 70, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .damagesAirborne = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_ROCK_THROW] = + { + .name = COMPOUND_STRING("Rock Throw"), + .description = COMPOUND_STRING( + "Throws small rocks to\n" + "strike the foe."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_EARTHQUAKE] = + { + .name = COMPOUND_STRING("Earthquake"), + .description = COMPOUND_STRING( + "A powerful quake, but has\n" + "no effect on flying foes."), + .effect = EFFECT_EARTHQUAKE, + .power = 100, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .damagesUnderground = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_FISSURE] = + { + .name = COMPOUND_STRING("Fissure"), + .description = COMPOUND_STRING( + "A one-hit KO move that\n" + "drops the foe in a fissure."), + .effect = EFFECT_OHKO, + .power = 1, + .type = TYPE_GROUND, + .accuracy = 30, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .damagesUnderground = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_DIG] = + { + .name = COMPOUND_STRING("Dig"), + .description = COMPOUND_STRING( + "Digs underground the first\n" + "turn and strikes next turn."), + .effect = EFFECT_SEMI_INVULNERABLE, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 80 : 60, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .skyBattleBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNDUGHOLE, COMPRESS_BITS(STATUS3_UNDERGROUND)), + }, + + [MOVE_TOXIC] = + { + .name = COMPOUND_STRING("Toxic"), + .description = COMPOUND_STRING( + "Poisons the foe with an\n" + "intensifying toxin."), + .effect = EFFECT_TOXIC, + .power = 0, + .type = TYPE_POISON, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 90 : 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_CONFUSION] = + { + .name = COMPOUND_STRING("Confusion"), + .description = COMPOUND_STRING( + "A psychic attack that may\n" + "cause confusion."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 10, + }), + }, + + [MOVE_PSYCHIC] = + { + .name = COMPOUND_STRING("Psychic"), + .description = COMPOUND_STRING( + "A powerful psychic attack\n" + "that may lower Sp. Def."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_HYPNOSIS] = + { + .name = COMPOUND_STRING("Hypnosis"), + .description = COMPOUND_STRING( + "A hypnotizing move that\n" + "may induce sleep."), + .effect = EFFECT_SLEEP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 60, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_MEDITATE] = + { + .name = COMPOUND_STRING("Meditate"), + .description = COMPOUND_STRING( + "Meditates in a peaceful\n" + "fashion to raise Attack."), + .effect = EFFECT_ATTACK_UP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_AGILITY] = + { + .name = COMPOUND_STRING("Agility"), + .description = COMPOUND_STRING( + "Relaxes the body to sharply\n" + "boost Speed."), + .effect = EFFECT_SPEED_UP_2, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_QUICK_ATTACK] = + { + .name = COMPOUND_STRING("Quick Attack"), + .description = COMPOUND_STRING( + "An extremely fast attack\n" + "that always strikes first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_RAGE] = + { + .name = COMPOUND_STRING("Rage"), + .description = COMPOUND_STRING( + "Raises the user's Attack\n" + "every time it is hit."), + .effect = EFFECT_RAGE, + .power = 20, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_TELEPORT] = + { + .name = COMPOUND_STRING("Teleport"), + .description = COMPOUND_STRING( + "A psychic move for fleeing\n" + "from battle instantly."), + .effect = EFFECT_TELEPORT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = -6, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_NIGHT_SHADE] = + { + .name = COMPOUND_STRING("Night Shade"), + .description = COMPOUND_STRING( + "Inflicts damage identical\n" + "to the user's level."), + .effect = EFFECT_LEVEL_DAMAGE, + .power = 1, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_MIMIC] = + { + .name = COMPOUND_STRING("Mimic"), + .description = COMPOUND_STRING( + "Copies a move used by the\n" + "foe during one battle."), + .effect = EFFECT_MIMIC, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + .ignoresSubstitute = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_2, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SCREECH] = + { + .name = COMPOUND_STRING("Screech"), + .description = COMPOUND_STRING( + "Emits a screech to sharply\n" + "reduce the foe's Defense."), + .effect = EFFECT_DEFENSE_DOWN_2, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + }, + + [MOVE_DOUBLE_TEAM] = + { + .name = COMPOUND_STRING("Double Team"), + .description = COMPOUND_STRING( + "Creates illusory copies to\n" + "raise evasiveness."), + .effect = EFFECT_EVASION_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_RECOVER] = + { + .name = COMPOUND_STRING("Recover"), + .description = COMPOUND_STRING( + "Recovers up to half the\n" + "user's maximum HP."), + #if B_UPDATED_MOVE_DATA >= GEN_9 + .pp = 5, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .pp = 10, + #else + .pp = 20, + #endif + .effect = EFFECT_RESTORE_HP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_HARDEN] = + { + .name = COMPOUND_STRING("Harden"), + .description = COMPOUND_STRING( + "Stiffens the body's \n" + "muscles to raise Defense."), + .effect = EFFECT_DEFENSE_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_MINIMIZE] = + { + .name = COMPOUND_STRING("Minimize"), + .description = COMPOUND_STRING( + "Minimizes the user's size\n" + "to raise evasiveness."), + .effect = EFFECT_MINIMIZE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 10 : 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_SMOKESCREEN] = + { + .name = COMPOUND_STRING("Smokescreen"), + .description = COMPOUND_STRING( + "Lowers the foe's accuracy\n" + "using smoke, ink, etc."), + .effect = EFFECT_ACCURACY_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_CONFUSE_RAY] = + { + .name = COMPOUND_STRING("Confuse Ray"), + .description = COMPOUND_STRING( + "A sinister ray that\n" + "confuses the foe."), + .effect = EFFECT_CONFUSE, + .power = 0, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_WITHDRAW] = + { + .name = COMPOUND_STRING("Withdraw"), + .description = COMPOUND_STRING( + "Withdraws the body into its\n" + "hard shell to raise Defense."), + .effect = EFFECT_DEFENSE_UP, + .power = 0, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_DEFENSE_CURL] = + { + .name = COMPOUND_STRING("Defense Curl"), + .description = COMPOUND_STRING( + "Curls up to conceal weak\n" + "spots and raise Defense."), + .effect = EFFECT_DEFENSE_CURL, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_BARRIER] = + { + .name = COMPOUND_STRING("Barrier"), + .description = COMPOUND_STRING( + "Creates a barrier that\n" + "sharply raises Defense."), + .effect = EFFECT_DEFENSE_UP_2, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_LIGHT_SCREEN] = + { + .name = COMPOUND_STRING("Light Screen"), + .description = COMPOUND_STRING( + "Creates a wall of light that\n" + "lowers Sp. Atk damage."), + .effect = EFFECT_LIGHT_SCREEN, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_HAZE] = + { + .name = COMPOUND_STRING("Haze"), + .description = COMPOUND_STRING( + "Creates a black haze that\n" + "eliminates all stat changes."), + .effect = EFFECT_HAZE, + .power = 0, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_REFLECT] = + { + .name = COMPOUND_STRING("Reflect"), + .description = COMPOUND_STRING( + "Creates a wall of light that\n" + "weakens physical attacks."), + .effect = EFFECT_REFLECT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_FOCUS_ENERGY] = + { + .name = COMPOUND_STRING("Focus Energy"), + .description = COMPOUND_STRING( + "Focuses power to raise the\n" + "critical-hit ratio."), + .effect = EFFECT_FOCUS_ENERGY, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + .argument = STATUS2_FOCUS_ENERGY, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_BIDE] = + { + .name = COMPOUND_STRING("Bide"), + .description = COMPOUND_STRING( + "Endures attack for 2\n" + "turns to retaliate double."), + .effect = EFFECT_BIDE, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_4 ? 0 : 100, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_4 ? 1 : 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_METRONOME] = + { + .name = COMPOUND_STRING("Metronome"), + .description = COMPOUND_STRING( + "Waggles a finger to use any\n" + "Pokémon move at random."), + .effect = EFFECT_METRONOME, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = B_UPDATED_MOVE_FLAGS >= GEN_3, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_MIRROR_MOVE] = + { + .name = COMPOUND_STRING("Mirror Move"), + .description = COMPOUND_STRING( + "Counters the foe's attack\n" + "with the same move."), + .effect = EFFECT_MIRROR_MOVE, + .power = 0, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_2 }, + .mimicBanned = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_4, + .copycatBanned = TRUE, + .sleepTalkBanned = B_UPDATED_MOVE_FLAGS >= GEN_3, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SELF_DESTRUCT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SelfDestruct", "Self-Destruct"), + .description = COMPOUND_STRING( + "Inflicts severe damage but\n" + "makes the user faint."), + .effect = EFFECT_EXPLOSION, + .power = 200, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .parentalBondBanned = TRUE, + }, + + [MOVE_EGG_BOMB] = + { + .name = COMPOUND_STRING("Egg Bomb"), + .description = COMPOUND_STRING( + "An egg is forcibly hurled at\n" + "the foe."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_NORMAL, + .accuracy = 75, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = TRUE, + }, + + [MOVE_LICK] = + { + .name = COMPOUND_STRING("Lick"), + .description = COMPOUND_STRING( + "Licks with a long tongue to\n" + "injure. May also paralyze."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 30 : 20, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_SMOG] = + { + .name = COMPOUND_STRING("Smog"), + .description = COMPOUND_STRING( + "An exhaust-gas attack\n" + "that may also poison."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 30 : 20, + .type = TYPE_POISON, + .accuracy = 70, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 40, + }), + }, + + [MOVE_SLUDGE] = + { + .name = COMPOUND_STRING("Sludge"), + .description = COMPOUND_STRING( + "Sludge is hurled to inflict\n" + "damage. May also poison."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 30, + }), + }, + + [MOVE_BONE_CLUB] = + { + .name = COMPOUND_STRING("Bone Club"), + .description = COMPOUND_STRING( + "Clubs the foe with a bone.\n" + "May cause flinching."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_GROUND, + .accuracy = 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 10, + }), + }, + + [MOVE_FIRE_BLAST] = + { + .name = COMPOUND_STRING("Fire Blast"), + .description = COMPOUND_STRING( + "Incinerates everything it\n" + "strikes. May cause a burn."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 110 : 120, + .type = TYPE_FIRE, + .accuracy = 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_WATERFALL] = + { + .name = COMPOUND_STRING("Waterfall"), + .description = COMPOUND_STRING( + "Charges the foe with speed\n" + "to climb waterfalls."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 20, + }), + #endif + }, + + [MOVE_CLAMP] = + { + .name = COMPOUND_STRING("Clamp"), + .description = COMPOUND_STRING( + "Traps and squeezes the\n" + "foe for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = 35, + .type = TYPE_WATER, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 85 : 75, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 15 : 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_SWIFT] = + { + .name = COMPOUND_STRING("Swift"), + .description = COMPOUND_STRING( + "Sprays star-shaped rays\n" + "that never miss."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_SKULL_BASH] = + { + .name = COMPOUND_STRING("Skull Bash"), + .description = COMPOUND_STRING( + "Tucks in the head, then\n" + "attacks on the next turn."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 130 : 100, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNLOWEREDHEAD), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_PLUS_1, + .self = TRUE, + .onChargeTurnOnly = TRUE, + }), + }, + + [MOVE_SPIKE_CANNON] = + { + .name = COMPOUND_STRING("Spike Cannon"), + .description = COMPOUND_STRING( + "Launches sharp spikes that\n" + "strike 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 20, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_CONSTRICT] = + { + .name = COMPOUND_STRING("Constrict"), + .description = COMPOUND_STRING( + "Constricts to inflict pain.\n" + "May lower Speed."), + .effect = EFFECT_HIT, + .power = 10, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_AMNESIA] = + { + .name = COMPOUND_STRING("Amnesia"), + .description = COMPOUND_STRING( + "Forgets about something\n" + "and sharply raises Sp. Def."), + .effect = EFFECT_SPECIAL_DEFENSE_UP_2, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_KINESIS] = + { + .name = COMPOUND_STRING("Kinesis"), + .description = COMPOUND_STRING( + "Distracts the foe.\n" + "May lower accuracy."), + .effect = EFFECT_ACCURACY_DOWN, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 80, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_SOFT_BOILED] = + { + .name = COMPOUND_STRING("Soft-Boiled"), + .description = COMPOUND_STRING( + "Recovers up to half the\n" + "user's maximum HP."), + .effect = EFFECT_SOFTBOILED, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 5 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = TRUE, + }, + + [MOVE_HIGH_JUMP_KICK] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("HighJumpKick", "High Jump Kick"), + .description = COMPOUND_STRING( + "A jumping knee kick. If it\n" + "misses, the user is hurt."), + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 130, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 100, + #else + .power = 85, + #endif + .effect = EFFECT_RECOIL_IF_MISS, + .type = TYPE_FIGHTING, + .accuracy = 90, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .gravityBanned = TRUE, + }, + + [MOVE_GLARE] = + { + .name = COMPOUND_STRING("Glare"), + .description = COMPOUND_STRING( + "Intimidates and frightens\n" + "the foe into paralysis."), + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 100, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .accuracy = 90, + #else + .accuracy = 75, + #endif + .effect = EFFECT_PARALYZE, + .power = 0, + .type = TYPE_NORMAL, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_DREAM_EATER] = + { + .name = COMPOUND_STRING("Dream Eater"), + .description = COMPOUND_STRING( + "Takes one half the damage\n" + "inflicted on a sleeping foe."), + .effect = EFFECT_DREAM_EATER, + .power = 100, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_POISON_GAS] = + { + .name = COMPOUND_STRING("Poison Gas"), + .description = COMPOUND_STRING( + "Envelops the foe in a toxic\n" + "gas that may poison."), + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 90, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 80, + #else + .accuracy = 55, + #endif + .effect = EFFECT_POISON, + .power = 0, + .type = TYPE_POISON, + .pp = 40, + .target = B_UPDATED_MOVE_DATA >= GEN_5 ? MOVE_TARGET_BOTH : MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_BARRAGE] = + { + .name = COMPOUND_STRING("Barrage"), + .description = COMPOUND_STRING( + "Hurls round objects at the\n" + "foe 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 15, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = TRUE, + }, + + [MOVE_LEECH_LIFE] = + { + .name = COMPOUND_STRING("Leech Life"), + .description = COMPOUND_STRING( + "An attack that steals half\n" + "the damage inflicted."), + .effect = EFFECT_ABSORB, + .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 80 : 20, + .type = TYPE_BUG, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_7 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_LOVELY_KISS] = + { + .name = COMPOUND_STRING("Lovely Kiss"), + .description = COMPOUND_STRING( + "Demands a kiss with a scary\n" + "face that induces sleep."), + .effect = EFFECT_SLEEP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 75, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_SKY_ATTACK] = + { + .name = COMPOUND_STRING("Sky Attack"), + .description = COMPOUND_STRING( + "Searches out weak spots,\n" + "then strikes the next turn."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = 140, + .type = TYPE_FLYING, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .criticalHitStage = B_UPDATED_MOVE_DATA >= GEN_3, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(B_UPDATED_MOVE_DATA >= GEN_4 ? STRINGID_CLOAKEDINAHARSHLIGHT : STRINGID_PKMNISGLOWING), + #if B_UPDATED_MOVE_DATA >= GEN_3 + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + #endif + }, + + [MOVE_TRANSFORM] = + { + .name = COMPOUND_STRING("Transform"), + .description = COMPOUND_STRING( + "Alters the user's cells to\n" + "become a copy of the foe."), + .effect = EFFECT_TRANSFORM, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_5, + .copycatBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_BUBBLE] = + { + .name = COMPOUND_STRING("Bubble"), + .description = COMPOUND_STRING( + "An attack using bubbles.\n" + "May lower the foe's Speed."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 40 : 20, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_DIZZY_PUNCH] = + { + .name = COMPOUND_STRING("Dizzy Punch"), + .description = COMPOUND_STRING( + "A rhythmic punch that may\n" + "confuse the foe."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 20, + }), + }, + + [MOVE_SPORE] = + { + .name = COMPOUND_STRING("Spore"), + .description = COMPOUND_STRING( + "Scatters a cloud of spores\n" + "that always induce sleep."), + .effect = EFFECT_SLEEP, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + .powderMove = TRUE, + }, + + [MOVE_FLASH] = + { + .name = COMPOUND_STRING("Flash"), + .description = COMPOUND_STRING( + "Looses a powerful blast of\n" + "light that cuts accuracy."), + .effect = EFFECT_ACCURACY_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_4 ? 100 : 70, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_PSYWAVE] = + { + .name = COMPOUND_STRING("Psywave"), + .description = COMPOUND_STRING( + "Attacks with a psychic\n" + "wave of varying intensity."), + .effect = EFFECT_PSYWAVE, + .power = 1, + .type = TYPE_PSYCHIC, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 100 : 80, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_SPLASH] = + { + .name = COMPOUND_STRING("Splash"), + .description = COMPOUND_STRING( + "It's just a splash...\n" + "Has no effect whatsoever."), + .effect = EFFECT_DO_NOTHING, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_3 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .gravityBanned = TRUE, + }, + + [MOVE_ACID_ARMOR] = + { + .name = COMPOUND_STRING("Acid Armor"), + .description = COMPOUND_STRING( + "Liquifies the user's body\n" + "to sharply raise Defense."), + .effect = EFFECT_DEFENSE_UP_2, + .power = 0, + .type = TYPE_POISON, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_CRABHAMMER] = + { + .name = COMPOUND_STRING("Crabhammer"), + .description = COMPOUND_STRING( + "Hammers with a pincer. Has a\n" + "high critical-hit ratio."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 100 : 90, + .type = TYPE_WATER, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 90 : 85, + .criticalHitStage = 1, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_EXPLOSION] = + { + .name = COMPOUND_STRING("Explosion"), + .description = COMPOUND_STRING( + "Inflicts severe damage but\n" + "makes the user faint."), + .effect = EFFECT_EXPLOSION, + .power = 250, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .parentalBondBanned = TRUE, + }, + + [MOVE_FURY_SWIPES] = + { + .name = COMPOUND_STRING("Fury Swipes"), + .description = COMPOUND_STRING( + "Rakes the foe with sharp\n" + "claws, etc., 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 18, + .type = TYPE_NORMAL, + .accuracy = 80, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_BONEMERANG] = + { + .name = COMPOUND_STRING("Bonemerang"), + .description = COMPOUND_STRING( + "Throws a bone boomerang\n" + "that strikes twice."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_GROUND, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .strikeCount = 2, + }, + + [MOVE_REST] = + { + .name = COMPOUND_STRING("Rest"), + .description = COMPOUND_STRING( + "The user sleeps for 2 turns,\n" + "restoring HP and status."), + .effect = EFFECT_REST, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 5 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + }, + + [MOVE_ROCK_SLIDE] = + { + .name = COMPOUND_STRING("Rock Slide"), + .description = COMPOUND_STRING( + "Large boulders are hurled.\n" + "May cause flinching."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_HYPER_FANG] = + { + .name = COMPOUND_STRING("Hyper Fang"), + .description = COMPOUND_STRING( + "Attacks with sharp fangs.\n" + "May cause flinching."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 10, + }), + }, + + [MOVE_SHARPEN] = + { + .name = COMPOUND_STRING("Sharpen"), + .description = COMPOUND_STRING( + "Reduces the polygon count\n" + "and raises Attack."), + .effect = EFFECT_ATTACK_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_CONVERSION] = + { + .name = COMPOUND_STRING("Conversion"), + .description = COMPOUND_STRING( + "Changes the user's type\n" + "into a known move's type."), + .effect = EFFECT_CONVERSION, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TRI_ATTACK] = + { + .name = COMPOUND_STRING("Tri Attack"), + .description = COMPOUND_STRING( + "Fires three types of beams\n" + "at the same time."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_TRI_ATTACK, + .chance = 20, + }), + }, + + [MOVE_SUPER_FANG] = + { + .name = COMPOUND_STRING("Super Fang"), + .description = COMPOUND_STRING( + "Attacks with sharp fangs\n" + "and cuts half the foe's HP."), + .effect = EFFECT_SUPER_FANG, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + }, + + [MOVE_SLASH] = + { + .name = COMPOUND_STRING("Slash"), + .description = COMPOUND_STRING( + "Slashes with claws, etc. Has\n" + "a high critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_SUBSTITUTE] = + { + .name = COMPOUND_STRING("Substitute"), + .description = COMPOUND_STRING( + "Creates a decoy using 1/4\n" + "of the user's maximum HP."), + .effect = EFFECT_SUBSTITUTE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_STRUGGLE] = + { + .name = COMPOUND_STRING("Struggle"), + .description = COMPOUND_STRING( + "Used only if all PP are gone.\n" + "Also hurts the user a little."), + #if B_UPDATED_MOVE_DATA >= GEN_4 + .effect = EFFECT_RECOIL_HP_25, + .accuracy = 0, + .mirrorMoveBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECOIL_HP_25, + .self = TRUE, + }), + #else + .effect = EFFECT_HIT, + .accuracy = 100, + .recoil = 25, + #endif + .power = 50, + .type = TYPE_NORMAL, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .meFirstBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .sleepTalkBanned = TRUE, + .copycatBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = TRUE, + }, + + [MOVE_SKETCH] = + { + .name = COMPOUND_STRING("Sketch"), + .description = COMPOUND_STRING( + "Copies the foe's last move\n" + "permanently."), + .effect = EFFECT_SKETCH, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = B_UPDATED_MOVE_FLAGS >= GEN_5, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = TRUE, + }, + + [MOVE_TRIPLE_KICK] = + { + .name = COMPOUND_STRING("Triple Kick"), + .description = COMPOUND_STRING( + "Kicks the foe 3 times in a\n" + "row with rising intensity."), + .effect = EFFECT_TRIPLE_KICK, + .power = 10, + .type = TYPE_FIGHTING, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 3, + }, + + [MOVE_THIEF] = + { + .name = COMPOUND_STRING("Thief"), + .description = COMPOUND_STRING( + "While attacking, it may\n" + "steal the foe's held item."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 40, + .type = TYPE_DARK, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 25 : 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_STEAL_ITEM, + }), + }, + + [MOVE_SPIDER_WEB] = + { + .name = COMPOUND_STRING("Spider Web"), + .description = COMPOUND_STRING( + "Ensnares the foe to stop it\n" + "from fleeing or switching."), + .effect = EFFECT_MEAN_LOOK, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = (B_UPDATED_MOVE_FLAGS >= GEN_6) || (B_UPDATED_MOVE_FLAGS <= GEN_3), + .magicCoatAffected = TRUE, + }, + + [MOVE_MIND_READER] = + { + .name = COMPOUND_STRING("Mind Reader"), + .description = COMPOUND_STRING( + "Senses the foe's action to\n" + "ensure the next move's hit."), + .effect = EFFECT_LOCK_ON, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_4 ? 0 : 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + }, + + [MOVE_NIGHTMARE] = + { + .name = COMPOUND_STRING("Nightmare"), + .description = COMPOUND_STRING( + "Inflicts 1/4 damage on a\n" + "sleeping foe every turn."), + .effect = EFFECT_NIGHTMARE, + .power = 0, + .type = TYPE_GHOST, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_4 ? 100 : 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresProtect = B_UPDATED_MOVE_FLAGS <= GEN_3, + }, + + [MOVE_FLAME_WHEEL] = + { + .name = COMPOUND_STRING("Flame Wheel"), + .description = COMPOUND_STRING( + "A fiery charge attack that\n" + "may inflict a burn."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .thawsUser = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_SNORE] = + { + .name = COMPOUND_STRING("Snore"), + .description = COMPOUND_STRING( + "A loud attack that can be\n" + "used only while asleep."), + .effect = EFFECT_SNORE, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 50 : 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_5, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_CURSE] = + { + .name = COMPOUND_STRING("Curse"), + .description = COMPOUND_STRING( + "A move that functions\n" + "differently for GHOSTS."), + .effect = EFFECT_CURSE, + .power = 0, + .type = B_UPDATED_MOVE_TYPES >= GEN_5 ? TYPE_GHOST : TYPE_MYSTERY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_CURSE }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_FLAIL] = + { + .name = COMPOUND_STRING("Flail"), + .description = COMPOUND_STRING( + "Inflicts more damage when\n" + "the user's HP is down."), + .effect = EFFECT_FLAIL, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_CONVERSION_2] = + { + .name = COMPOUND_STRING("Conversion 2"), + .description = COMPOUND_STRING( + "Makes the user resistant\n" + "to the last attack's type."), + .effect = EFFECT_CONVERSION_2, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .ignoresProtect = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_AEROBLAST] = + { + .name = COMPOUND_STRING("Aeroblast"), + .description = COMPOUND_STRING( + "Launches a vacuumed blast.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FLYING, + .accuracy = 95, + .criticalHitStage = 1, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + }, + + [MOVE_COTTON_SPORE] = + { + .name = COMPOUND_STRING("Cotton Spore"), + .description = COMPOUND_STRING( + "Spores cling to the foe,\n" + "sharply reducing Speed."), + .effect = EFFECT_SPEED_DOWN_2, + .power = 0, + .type = TYPE_GRASS, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 100 : 85, + .pp = 40, + .target = B_UPDATED_MOVE_DATA >= GEN_6 ? MOVE_TARGET_BOTH : MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + .powderMove = TRUE, + }, + + [MOVE_REVERSAL] = + { + .name = COMPOUND_STRING("Reversal"), + .description = COMPOUND_STRING( + "Inflicts more damage when\n" + "the user's HP is down."), + .effect = EFFECT_FLAIL, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SPITE] = + { + .name = COMPOUND_STRING("Spite"), + .description = COMPOUND_STRING( + "Spitefully cuts the PP\n" + "of the foe's last move."), + .effect = EFFECT_SPITE, + .power = 0, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresSubstitute = TRUE, + }, + + [MOVE_POWDER_SNOW] = + { + .name = COMPOUND_STRING("Powder Snow"), + .description = COMPOUND_STRING( + "Blasts the foe with a snowy\n" + #if B_USE_FROSTBITE == TRUE + "gust. May cause frostbite."), + #else + "gust. May cause freezing."), + #endif + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }), + }, + + [MOVE_PROTECT] = + { + .name = COMPOUND_STRING("Protect"), + .description = COMPOUND_STRING( + "Evades attack, but may fail\n" + "if used in succession."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_5 ? 4 : 3, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_MACH_PUNCH] = + { + .name = COMPOUND_STRING("Mach Punch"), + .description = COMPOUND_STRING( + "A punch is thrown at wicked\n" + "speed to strike first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + }, + + [MOVE_SCARY_FACE] = + { + .name = COMPOUND_STRING("Scary Face"), + .description = COMPOUND_STRING( + "Frightens with a scary face\n" + "to sharply reduce Speed."), + .effect = EFFECT_SPEED_DOWN_2, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 100 : 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_FEINT_ATTACK] = + { + .name = COMPOUND_STRING("Feint Attack"), + .description = sFeintDescription, + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = B_UPDATED_MOVE_DATA >= GEN_4, + }, + + [MOVE_SWEET_KISS] = + { + .name = COMPOUND_STRING("Sweet Kiss"), + .description = COMPOUND_STRING( + "Demands a kiss with a cute\n" + "look. May cause confusion."), + .effect = EFFECT_CONFUSE, + .power = 0, + .type = B_UPDATED_MOVE_TYPES >= GEN_6 ? TYPE_FAIRY : TYPE_NORMAL, + .accuracy = 75, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_BELLY_DRUM] = + { + .name = COMPOUND_STRING("Belly Drum"), + .description = COMPOUND_STRING( + "Maximizes Attack while\n" + "sacrificing HP."), + .effect = EFFECT_BELLY_DRUM, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SLUDGE_BOMB] = + { + .name = COMPOUND_STRING("Sludge Bomb"), + .description = COMPOUND_STRING( + "Sludge is hurled to inflict\n" + "damage. May also poison."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 30, + }), + }, + + [MOVE_MUD_SLAP] = + { + .name = COMPOUND_STRING("Mud-Slap"), + .description = COMPOUND_STRING( + "Hurls mud in the foe's face\n" + "to reduce its accuracy."), + .effect = EFFECT_HIT, + .power = 20, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_OCTAZOOKA] = + { + .name = COMPOUND_STRING("Octazooka"), + .description = COMPOUND_STRING( + "Fires a lump of ink to\n" + "damage and cut accuracy."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_WATER, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_SPIKES] = + { + .name = COMPOUND_STRING("Spikes"), + .description = COMPOUND_STRING( + "Sets spikes that hurt a \n" + "foe switching in."), + .effect = EFFECT_SPIKES, + .power = 0, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_OPPONENTS_FIELD, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .forcePressure = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_ZAP_CANNON] = + { + .name = COMPOUND_STRING("Zap Cannon"), + .description = COMPOUND_STRING( + "Powerful and sure to cause\n" + "paralysis, but inaccurate."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 120 : 100, + .type = TYPE_ELECTRIC, + .accuracy = 50, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 100, + }), + }, + + [MOVE_FORESIGHT] = + { + .name = COMPOUND_STRING("Foresight"), + .description = COMPOUND_STRING( + "Negates the foe's efforts\n" + "to heighten evasiveness."), + .effect = EFFECT_FORESIGHT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 0 : 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_BOOST_CRITS }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresSubstitute = TRUE, + }, + + [MOVE_DESTINY_BOND] = + { + .name = COMPOUND_STRING("Destiny Bond"), + .description = COMPOUND_STRING( + "If the user faints, the foe\n" + "is also made to faint."), + .effect = EFFECT_DESTINY_BOND, + .power = 0, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_FOLLOW_ME }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_PERISH_SONG] = + { + .name = COMPOUND_STRING("Perish Song"), + .description = COMPOUND_STRING( + "Any Pokémon hearing this\n" + "song faints in 3 turns."), + .effect = EFFECT_PERISH_SONG, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .mirrorMoveBanned = TRUE, + .soundMove = TRUE, + }, + + [MOVE_ICY_WIND] = + { + .name = COMPOUND_STRING("Icy Wind"), + .description = COMPOUND_STRING( + "A chilling attack that\n" + "lowers the foe's Speed."), + .effect = EFFECT_HIT, + .power = 55, + .type = TYPE_ICE, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_DETECT] = + { + .name = COMPOUND_STRING("Detect"), + .description = COMPOUND_STRING( + "Evades attack, but may fail\n" + "if used in succession."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_5 ? 4 : 3, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_BONE_RUSH] = + { + .name = COMPOUND_STRING("Bone Rush"), + .description = COMPOUND_STRING( + "Strikes the foe with a bone\n" + "in hand 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 25, + .type = TYPE_GROUND, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 90 : 80, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_LOCK_ON] = + { + .name = COMPOUND_STRING("Lock-On"), + .description = COMPOUND_STRING( + "Locks on to the foe to\n" + "ensure the next move hits."), + .effect = EFFECT_LOCK_ON, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_4 ? 0 : 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + }, + + [MOVE_OUTRAGE] = + { + .name = COMPOUND_STRING("Outrage"), + .description = COMPOUND_STRING( + "A rampage of 2 to 3 turns\n" + "that confuses the user."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 120 : 90, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 15, + .target = MOVE_TARGET_RANDOM, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .instructBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_THRASH, + .self = TRUE, + }), + }, + + [MOVE_SANDSTORM] = + { + .name = COMPOUND_STRING("Sandstorm"), + .description = COMPOUND_STRING( + "Causes a sandstorm that\n" + "rages for several turns."), + .effect = EFFECT_SANDSTORM, + .power = 0, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .windMove = TRUE, + }, + + [MOVE_GIGA_DRAIN] = + { + .name = COMPOUND_STRING("Giga Drain"), + .description = COMPOUND_STRING( + "An attack that steals half\n" + "the damage inflicted."), + .effect = EFFECT_ABSORB, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 75 : 60, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_4 ? 10 : 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_ENDURE] = + { + .name = COMPOUND_STRING("Endure"), + .description = COMPOUND_STRING( + "Endures any attack for\n" + "1 turn, leaving at least 1HP."), + .effect = EFFECT_ENDURE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_5 ? 4 : 3, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_CHARM] = + { + .name = COMPOUND_STRING("Charm"), + .description = COMPOUND_STRING( + "Charms the foe and sharply\n" + "reduces its Attack."), + .effect = EFFECT_ATTACK_DOWN_2, + .power = 0, + .type = B_UPDATED_MOVE_TYPES >= GEN_6 ? TYPE_FAIRY : TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_ROLLOUT] = + { + .name = COMPOUND_STRING("Rollout"), + .description = COMPOUND_STRING( + "An attack lasting 5 turns\n" + "with rising intensity."), + .effect = EFFECT_ROLLOUT, + .power = 30, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .instructBanned = TRUE, + .parentalBondBanned = TRUE, + }, + + [MOVE_FALSE_SWIPE] = + { + .name = COMPOUND_STRING("False Swipe"), + .description = sFalseSwipeDescription, + .effect = EFFECT_FALSE_SWIPE, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SWAGGER] = + { + .name = COMPOUND_STRING("Swagger"), + .description = COMPOUND_STRING( + "Confuses the foe, but also\n" + "sharply raises Attack."), + .effect = EFFECT_SWAGGER, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_7 ? 85 : 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + }, + + [MOVE_MILK_DRINK] = + { + .name = COMPOUND_STRING("Milk Drink"), + .description = COMPOUND_STRING( + "Recovers up to half the\n" + "user's maximum HP."), + .effect = EFFECT_SOFTBOILED, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 5 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SPARK] = + { + .name = COMPOUND_STRING("Spark"), + .description = COMPOUND_STRING( + "An electrified tackle that\n" + "may paralyze the foe."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_FURY_CUTTER] = + { + .name = COMPOUND_STRING("Fury Cutter"), + .description = COMPOUND_STRING( + "An attack that intensifies\n" + "on each successive hit."), + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 40, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .power = 20, + #else + .power = 10, + #endif + .effect = EFFECT_FURY_CUTTER, + .type = TYPE_BUG, + .accuracy = 95, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_STEEL_WING] = + { + .name = COMPOUND_STRING("Steel Wing"), + .description = COMPOUND_STRING( + "Strikes the foe with hard\n" + "wings spread wide."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_STEEL, + .accuracy = 90, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_PLUS_1, + .self = TRUE, + .chance = 10, + }), + }, + + [MOVE_MEAN_LOOK] = + { + .name = COMPOUND_STRING("Mean Look"), + .description = COMPOUND_STRING( + "Fixes the foe with a mean\n" + "look that prevents escape."), + .effect = EFFECT_MEAN_LOOK, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = (B_UPDATED_MOVE_FLAGS >= GEN_6) || (B_UPDATED_MOVE_FLAGS <= GEN_3), + .magicCoatAffected = TRUE, + }, + + [MOVE_ATTRACT] = + { + .name = COMPOUND_STRING("Attract"), + .description = COMPOUND_STRING( + "Makes the opposite gender\n" + "less likely to attack."), + .effect = EFFECT_ATTRACT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + .ignoresSubstitute = TRUE, + }, + + [MOVE_SLEEP_TALK] = + { + .name = COMPOUND_STRING("Sleep Talk"), + .description = COMPOUND_STRING( + "Uses an available move\n" + "randomly while asleep."), + .effect = EFFECT_SLEEP_TALK, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_BOOST_CRITS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .mimicBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_HEAL_BELL] = + { + .name = COMPOUND_STRING("Heal Bell"), + .description = COMPOUND_STRING( + "Chimes soothingly to heal\n" + "all status abnormalities."), + .effect = EFFECT_HEAL_BELL, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER | MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .soundMove = B_UPDATED_MOVE_FLAGS != GEN_5, + }, + + [MOVE_RETURN] = + { + .name = COMPOUND_STRING("Return"), + .description = COMPOUND_STRING( + "An attack that increases\n" + "in power with friendship."), + .effect = EFFECT_RETURN, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_PRESENT] = + { + .name = COMPOUND_STRING("Present"), + .description = COMPOUND_STRING( + "A gift in the form of a\n" + "bomb. May restore HP."), + .effect = EFFECT_PRESENT, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + }, + + [MOVE_FRUSTRATION] = + { + .name = COMPOUND_STRING("Frustration"), + .description = COMPOUND_STRING( + "An attack that is stronger\n" + "if the Trainer is disliked."), + .effect = EFFECT_FRUSTRATION, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SAFEGUARD] = + { + .name = COMPOUND_STRING("Safeguard"), + .description = COMPOUND_STRING( + "A mystical force prevents\n" + "all status problems."), + .effect = EFFECT_SAFEGUARD, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 25, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_PAIN_SPLIT] = + { + .name = COMPOUND_STRING("Pain Split"), + .description = COMPOUND_STRING( + "Adds the user and foe's HP,\n" + "then shares them equally."), + .effect = EFFECT_PAIN_SPLIT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + }, + + [MOVE_SACRED_FIRE] = + { + .name = COMPOUND_STRING("Sacred Fire"), + .description = COMPOUND_STRING( + "A mystical fire attack that\n" + "may inflict a burn."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIRE, + .accuracy = 95, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .thawsUser = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 50, + }), + }, + + [MOVE_MAGNITUDE] = + { + .name = COMPOUND_STRING("Magnitude"), + .description = COMPOUND_STRING( + "A ground-shaking attack\n" + "of random intensity."), + .effect = EFFECT_MAGNITUDE, + .power = 1, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .damagesUnderground = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_DYNAMIC_PUNCH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DynamicPunch", "Dynamic Punch"), + .description = COMPOUND_STRING( + "Powerful and sure to cause\n" + "confusion, but inaccurate."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIGHTING, + .accuracy = 50, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 100, + }), + }, + + [MOVE_MEGAHORN] = + { + .name = COMPOUND_STRING("Megahorn"), + .description = COMPOUND_STRING( + "A brutal ramming attack\n" + "using out-thrust horns."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_BUG, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_DRAGON_BREATH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DragonBreath", "Dragon Breath"), + .description = COMPOUND_STRING( + "Strikes the foe with an\n" + "incredible blast of breath."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_BATON_PASS] = + { + .name = COMPOUND_STRING("Baton Pass"), + .description = COMPOUND_STRING( + "Switches out the user while\n" + "keeping effects in play."), + .effect = EFFECT_BATON_PASS, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ENCORE] = + { + .name = COMPOUND_STRING("Encore"), + .description = COMPOUND_STRING( + "Makes the foe repeat its\n" + "last move over 2 to 6 turns."), + .effect = EFFECT_ENCORE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .encoreBanned = TRUE, + .ignoresSubstitute = TRUE, + }, + + [MOVE_PURSUIT] = + { + .name = COMPOUND_STRING("Pursuit"), + .description = COMPOUND_STRING( + "Inflicts bad damage if used\n" + "on a foe switching out."), + .effect = EFFECT_PURSUIT, + .power = 40, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresKingsRock = (B_UPDATED_MOVE_FLAGS == GEN_3 || B_UPDATED_MOVE_FLAGS == GEN_4), + }, + + [MOVE_RAPID_SPIN] = + { + .name = COMPOUND_STRING("Rapid Spin"), + .description = COMPOUND_STRING( + "Spins the body at high\n" + "speed to strike the foe."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 50 : 20, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RAPID_SPIN, + .self = TRUE, + } + #if B_SPEED_BUFFING_RAPID_SPIN >= GEN_8 + ,{ + .moveEffect = MOVE_EFFECT_SPD_PLUS_1, + .self = TRUE, + .chance = 100, + } + #endif + ), + }, + + [MOVE_SWEET_SCENT] = + { + .name = COMPOUND_STRING("Sweet Scent"), + .description = COMPOUND_STRING( + "Allures the foe to reduce\n" + "evasiveness."), + .effect = B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_IRON_TAIL] = + { + .name = COMPOUND_STRING("Iron Tail"), + .description = COMPOUND_STRING( + "Attacks with a rock-hard\n" + "tail. May lower Defense."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_STEEL, + .accuracy = 75, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_METAL_CLAW] = + { + .name = COMPOUND_STRING("Metal Claw"), + .description = COMPOUND_STRING( + "A claw attack that may\n" + "raise the user's Attack."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_STEEL, + .accuracy = 95, + .pp = 35, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_PLUS_1, + .self = TRUE, + .chance = 10, + }), + }, + + [MOVE_VITAL_THROW] = + { + .name = COMPOUND_STRING("Vital Throw"), + .description = COMPOUND_STRING( + "Makes the user's move last,\n" + "but it never misses."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = -1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_MORNING_SUN] = + { + .name = COMPOUND_STRING("Morning Sun"), + .description = COMPOUND_STRING( + "Restores HP. The amount\n" + "varies with the weather."), + .effect = EFFECT_MORNING_SUN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SYNTHESIS] = + { + .name = COMPOUND_STRING("Synthesis"), + .description = COMPOUND_STRING( + "Restores HP. The amount\n" + "varies with the weather."), + .effect = EFFECT_SYNTHESIS, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_MOONLIGHT] = + { + .name = COMPOUND_STRING("Moonlight"), + .description = COMPOUND_STRING( + "Restores HP. The amount\n" + "varies with the weather."), + .effect = EFFECT_MOONLIGHT, + .power = 0, + .type = B_UPDATED_MOVE_TYPES >= GEN_6 ? TYPE_FAIRY : TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HIDDEN_POWER] = + { + .name = COMPOUND_STRING("Hidden Power"), + .description = COMPOUND_STRING( + "The effectiveness varies\n" + "with the user."), + .power = B_HIDDEN_POWER_DMG >= GEN_6 ? 60 : 1, + .effect = EFFECT_HIDDEN_POWER, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_CROSS_CHOP] = + { + .name = COMPOUND_STRING("Cross Chop"), + .description = COMPOUND_STRING( + "A double-chopping attack.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIGHTING, + .accuracy = 80, + .criticalHitStage = 1, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_TWISTER] = + { + .name = COMPOUND_STRING("Twister"), + .description = COMPOUND_STRING( + "Whips up a vicious twister\n" + "to tear at the foe."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .damagesAirborneDoubleDamage = TRUE, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 20, + }), + }, + + [MOVE_RAIN_DANCE] = + { + .name = COMPOUND_STRING("Rain Dance"), + .description = COMPOUND_STRING( + "Boosts the power of Water-\n" + "type moves for 5 turns."), + .effect = EFFECT_RAIN_DANCE, + .power = 0, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SUNNY_DAY] = + { + .name = COMPOUND_STRING("Sunny Day"), + .description = COMPOUND_STRING( + "Boosts the power of Fire-\n" + "type moves for 5 turns."), + .effect = EFFECT_SUNNY_DAY, + .power = 0, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_CRUNCH] = + { + .name = COMPOUND_STRING("Crunch"), + .description = COMPOUND_STRING( + "Crunches with sharp fangs.\n" + #if B_UPDATED_MOVE_DATA >= GEN_4 + "May lower Defense."), + #else + "May lower Sp. Def."), + #endif + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + #if B_UPDATED_MOVE_DATA >= GEN_4 + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + #else + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + #endif + .chance = 20, + }), + }, + + [MOVE_MIRROR_COAT] = + { + .name = COMPOUND_STRING("Mirror Coat"), + .description = COMPOUND_STRING( + "Counters the foe's special\n" + "attack at double the power."), + .effect = EFFECT_MIRROR_COAT, + .power = 1, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_DEPENDS, + .priority = -5, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS >= GEN_4, + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_PSYCH_UP] = + { + .name = COMPOUND_STRING("Psych Up"), + .description = COMPOUND_STRING( + "Copies the foe's effect(s)\n" + "and gives to the user."), + .effect = EFFECT_PSYCH_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = B_UPDATED_MOVE_FLAGS < GEN_5, + }, + + [MOVE_EXTREME_SPEED] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ExtremeSpeed", "Extreme Speed"), + .description = COMPOUND_STRING( + "An extremely fast and\n" + "powerful attack."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = B_UPDATED_MOVE_DATA >= GEN_5 ? 2 : 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_ANCIENT_POWER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("AncientPower", "Ancient Power"), + .description = COMPOUND_STRING( + "An attack that may raise\n" + "all stats."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = B_UPDATED_MOVE_DATA < GEN_4, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ALL_STATS_UP, + .self = TRUE, + .chance = 10, + }), + }, + + [MOVE_SHADOW_BALL] = + { + .name = COMPOUND_STRING("Shadow Ball"), + .description = COMPOUND_STRING( + "Hurls a black blob that may\n" + "lower the foe's Sp. Def."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 20, + }), + }, + + [MOVE_FUTURE_SIGHT] = + { + .name = COMPOUND_STRING("Future Sight"), + .description = COMPOUND_STRING( + "Heightens inner power to\n" + "strike 2 turns later."), + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 120, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .power = 100, + #else + .power = 80, + #endif + .effect = EFFECT_FUTURE_SIGHT, + .type = TYPE_PSYCHIC, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 100 : 90, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ROCK_SMASH] = + { + .name = COMPOUND_STRING("Rock Smash"), + .description = COMPOUND_STRING( + "A rock-crushing attack\n" + "that may lower Defense."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 40 : 20, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_WHIRLPOOL] = + { + .name = COMPOUND_STRING("Whirlpool"), + .description = COMPOUND_STRING( + "Traps and hurts the foe in\n" + "a whirlpool for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 35 : 15, + .type = TYPE_WATER, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 85 : 70, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .damagesUnderwater = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_BEAT_UP] = + { + .name = COMPOUND_STRING("Beat Up"), + .description = COMPOUND_STRING( + "Summons party Pokémon to\n" + "join in the attack."), + .effect = EFFECT_BEAT_UP, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 1 : 10, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_FAKE_OUT] = + { + .name = COMPOUND_STRING("Fake Out"), + .description = COMPOUND_STRING( + "A 1st-turn, 1st-strike move\n" + "that causes flinching."), + .priority = B_UPDATED_MOVE_DATA >= GEN_5 ? 3 : 1, + .makesContact = B_UPDATED_MOVE_DATA >= GEN_4, + .effect = EFFECT_FIRST_TURN_ONLY, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 100, + }), + }, + + [MOVE_UPROAR] = + { + .name = COMPOUND_STRING("Uproar"), + .description = COMPOUND_STRING( + #if B_UPROAR_TURNS >= GEN_5 + "Causes an uproar for 2 to 5\n" + #else + "Causes an uproar for 3\n" + #endif + "turns and prevents sleep."), + .effect = EFFECT_UPROAR, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 90 : 50, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_RANDOM, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_UPROAR, + .self = TRUE, + }), + }, + + [MOVE_STOCKPILE] = + { + .name = COMPOUND_STRING("Stockpile"), + .description = COMPOUND_STRING( + "Charges up power for up to\n" + "3 turns."), + .effect = EFFECT_STOCKPILE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_4 ? 20 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SPIT_UP] = + { + .name = COMPOUND_STRING("Spit Up"), + .description = COMPOUND_STRING( + "Releases stockpiled power\n" + "(the more the better)."), + .effect = EFFECT_SPIT_UP, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 1 : 100, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SWALLOW] = + { + .name = COMPOUND_STRING("Swallow"), + .description = COMPOUND_STRING( + "Absorbs stockpiled power\n" + "and restores HP."), + .effect = EFFECT_SWALLOW, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HEAT_WAVE] = + { + .name = COMPOUND_STRING("Heat Wave"), + .description = COMPOUND_STRING( + "Exhales a hot breath on the\n" + "foe. May inflict a burn."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 95 : 100, + .type = TYPE_FIRE, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_HAIL] = + { + .name = COMPOUND_STRING("Hail"), + .description = COMPOUND_STRING( + "Summons a hailstorm that\n" + "strikes every turn."), + .effect = EFFECT_HAIL, + .power = 0, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TORMENT] = + { + .name = COMPOUND_STRING("Torment"), + .description = COMPOUND_STRING( + "Torments the foe and stops\n" + "successive use of a move."), + .effect = EFFECT_TORMENT, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_FLATTER] = + { + .name = COMPOUND_STRING("Flatter"), + .description = COMPOUND_STRING( + "Confuses the foe, but\n" + "raises its Sp. Atk."), + .effect = EFFECT_FLATTER, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_WILL_O_WISP] = + { + .name = COMPOUND_STRING("Will-O-Wisp"), + .description = COMPOUND_STRING( + "Inflicts a burn on the foe\n" + "with intense fire."), + .effect = EFFECT_WILL_O_WISP, + .power = 0, + .type = TYPE_FIRE, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 85 : 75, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_MEMENTO] = + { + .name = COMPOUND_STRING("Memento"), + .description = COMPOUND_STRING( + "The user faints and lowers\n" + "the foe's abilities."), + .effect = EFFECT_MEMENTO, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESTORE_REPLACEMENT_HP }, + }, + + [MOVE_FACADE] = + { + .name = COMPOUND_STRING("Facade"), + .description = COMPOUND_STRING( + "Boosts Attack when burned,\n" + "paralyzed, or poisoned."), + .effect = EFFECT_FACADE, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_FOCUS_PUNCH] = + { + .name = COMPOUND_STRING("Focus Punch"), + .description = COMPOUND_STRING( + "A powerful loyalty attack.\n" + "The user flinches if hit."), + .effect = EFFECT_FOCUS_PUNCH, + .power = 150, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = -3, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .mirrorMoveBanned = TRUE, + .punchingMove = TRUE, + .meFirstBanned = TRUE, + .sleepTalkBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SMELLING_SALTS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SmellngSalts", "Smelling Salts"), + .description = COMPOUND_STRING( + "Powerful against paralyzed\n" + "foes, but also heals them."), + .effect = EFFECT_DOUBLE_POWER_ON_ARG_STATUS, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 70 : 60, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = STATUS1_PARALYSIS, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_REMOVE_STATUS, + }), + }, + + [MOVE_FOLLOW_ME] = + { + .name = COMPOUND_STRING("Follow Me"), + .description = COMPOUND_STRING( + "Draws attention to make\n" + "foes attack only the user."), + .effect = EFFECT_FOLLOW_ME, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_6 ? 2 : 3, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_NATURE_POWER] = + { + .name = COMPOUND_STRING("Nature Power"), + .description = COMPOUND_STRING( + "The type of attack varies\n" + "depending on the location."), + .effect = EFFECT_NATURE_POWER, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_4, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .mimicBanned = TRUE, + }, + + [MOVE_CHARGE] = + { + .name = COMPOUND_STRING("Charge"), + .description = COMPOUND_STRING( + "Charges power to boost the\n" + "electric move used next."), + .effect = EFFECT_CHARGE, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TAUNT] = + { + .name = COMPOUND_STRING("Taunt"), + .description = COMPOUND_STRING( + "Taunts the foe into only\n" + "using attack moves."), + .effect = EFFECT_TAUNT, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .ignoresSubstitute = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_HELPING_HAND] = + { + .name = COMPOUND_STRING("Helping Hand"), + .description = COMPOUND_STRING( + "Boosts the power of the\n" + "recipient's moves."), + .effect = EFFECT_HELPING_HAND, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = B_UPDATED_MOVE_DATA >= GEN_4 ? MOVE_TARGET_ALLY : MOVE_TARGET_USER, + .priority = 5, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_TRICK] = + { + .name = COMPOUND_STRING("Trick"), + .description = COMPOUND_STRING( + "Tricks the foe into trading\n" + "held items."), + .effect = EFFECT_TRICK, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_ROLE_PLAY] = + { + .name = COMPOUND_STRING("Role Play"), + .description = COMPOUND_STRING( + "Mimics the target and\n" + "copies its special ability."), + .effect = EFFECT_ROLE_PLAY, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_WISH] = + { + .name = COMPOUND_STRING("Wish"), + .description = COMPOUND_STRING( + "A wish that restores HP.\n" + "It takes time to work."), + .effect = EFFECT_WISH, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .healingMove = TRUE, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ASSIST] = + { + .name = COMPOUND_STRING("Assist"), + .description = COMPOUND_STRING( + "Attacks randomly with one\n" + "of the partner's moves."), + .effect = EFFECT_ASSIST, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_4, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .mimicBanned = TRUE, + }, + + [MOVE_INGRAIN] = + { + .name = COMPOUND_STRING("Ingrain"), + .description = COMPOUND_STRING( + "Lays roots that restore HP.\n" + "The user can't switch out."), + .effect = EFFECT_INGRAIN, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_SUPERPOWER] = + { + .name = COMPOUND_STRING("Superpower"), + .description = COMPOUND_STRING( + "Boosts strength sharply,\n" + "but lowers abilities."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_DEF_DOWN, + .self = TRUE, + }), + }, + + [MOVE_MAGIC_COAT] = + { + .name = COMPOUND_STRING("Magic Coat"), + .description = COMPOUND_STRING( + "Reflects special effects\n" + "back to the attacker."), + .effect = EFFECT_MAGIC_COAT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_DEPENDS, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_2 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_RECYCLE] = + { + .name = COMPOUND_STRING("Recycle"), + .description = COMPOUND_STRING( + "Recycles a used item for\n" + "one more use."), + .effect = EFFECT_RECYCLE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_REVENGE] = + { + .name = COMPOUND_STRING("Revenge"), + .description = sRevengeDescription, + .effect = EFFECT_REVENGE, + .power = 60, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = -4, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_BRICK_BREAK] = + { + .name = COMPOUND_STRING("Brick Break"), + .description = COMPOUND_STRING( + "Destroys barriers such as\n" + "REFLECT and causes damage."), + .effect = EFFECT_BRICK_BREAK, + .power = 75, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_YAWN] = + { + .name = COMPOUND_STRING("Yawn"), + .description = COMPOUND_STRING( + "Lulls the foe into yawning,\n" + "then sleeping next turn."), + .effect = EFFECT_YAWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_KNOCK_OFF] = + { + .name = COMPOUND_STRING("Knock Off"), + .description = COMPOUND_STRING( + "Knocks down the foe's held\n" + "item to prevent its use."), + .effect = EFFECT_KNOCK_OFF, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 65 : 20, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_KNOCK_OFF, + }), + }, + + [MOVE_ENDEAVOR] = + { + .name = COMPOUND_STRING("Endeavor"), + .description = COMPOUND_STRING( + "Gains power if the user's HP\n" + "is lower than the foe's HP."), + .effect = EFFECT_ENDEAVOR, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .parentalBondBanned = TRUE, + }, + + [MOVE_ERUPTION] = + { + .name = COMPOUND_STRING("Eruption"), + .description = COMPOUND_STRING( + "The higher the user's HP,\n" + "the more damage caused."), + .effect = EFFECT_ERUPTION, + .power = 150, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_SKILL_SWAP] = + { + .name = COMPOUND_STRING("Skill Swap"), + .description = COMPOUND_STRING( + "The user swaps special\n" + "abilities with the target."), + .effect = EFFECT_SKILL_SWAP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = TRUE, + }, + + [MOVE_IMPRISON] = + { + .name = COMPOUND_STRING("Imprison"), + .description = COMPOUND_STRING( + "Prevents foes from using\n" + "moves known by the user."), + .effect = EFFECT_IMPRISON, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_2 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .forcePressure = TRUE, + }, + + [MOVE_REFRESH] = + { + .name = COMPOUND_STRING("Refresh"), + .description = COMPOUND_STRING( + "Heals poisoning, paralysis,\n" + "or a burn."), + .effect = EFFECT_REFRESH, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_GRUDGE] = + { + .name = COMPOUND_STRING("Grudge"), + .description = COMPOUND_STRING( + "If the user faints, deletes\n" + "all PP of foe's last move."), + .effect = EFFECT_GRUDGE, + .power = 0, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_FOLLOW_ME }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SNATCH] = + { + .name = COMPOUND_STRING("Snatch"), + .description = COMPOUND_STRING( + "Steals the effects of the\n" + "move the target uses next."), + .effect = EFFECT_SNATCH, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_DEPENDS, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .ignoresSubstitute = TRUE, + .forcePressure = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SECRET_POWER] = + { + .name = COMPOUND_STRING("Secret Power"), + .description = COMPOUND_STRING( + "An attack with effects\n" + "that vary by location."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SECRET_POWER, + .chance = 30, + }), + }, + + [MOVE_DIVE] = + { + .name = COMPOUND_STRING("Dive"), + .description = COMPOUND_STRING( + "Dives underwater the first\n" + "turn and strikes next turn."), + .effect = EFFECT_SEMI_INVULNERABLE, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 80 : 60, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .skyBattleBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNHIDUNDERWATER, COMPRESS_BITS(STATUS3_UNDERWATER)), + }, + + [MOVE_ARM_THRUST] = + { + .name = COMPOUND_STRING("Arm Thrust"), + .description = COMPOUND_STRING( + "Straight-arm punches that\n" + "strike the foe 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 15, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_CAMOUFLAGE] = + { + .name = COMPOUND_STRING("Camouflage"), + .description = COMPOUND_STRING( + "Alters the Pokémon's type\n" + "depending on the location."), + .effect = EFFECT_CAMOUFLAGE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TAIL_GLOW] = + { + .name = COMPOUND_STRING("Tail Glow"), + .description = COMPOUND_STRING( + "Flashes a light that sharply\n" + "raises Sp. Atk."), + .effect = B_UPDATED_MOVE_DATA >= GEN_5 ? EFFECT_SPECIAL_ATTACK_UP_3 : EFFECT_SPECIAL_ATTACK_UP_2, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_LUSTER_PURGE] = + { + .name = COMPOUND_STRING("Luster Purge"), + .description = COMPOUND_STRING( + "Attacks with a burst of\n" + "light. May lower Sp. Def."), + .effect = EFFECT_HIT, + .power = (B_UPDATED_MOVE_DATA >= GEN_9) ? 95 : 70, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_MIST_BALL] = + { + .name = COMPOUND_STRING("Mist Ball"), + .description = COMPOUND_STRING( + "Attacks with a flurry of\n" + "down. May lower Sp. Atk."), + .effect = EFFECT_HIT, + .power = (B_UPDATED_MOVE_DATA >= GEN_9) ? 95 : 70, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_FEATHER_DANCE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FeatherDance", "Feather Dance"), + .description = COMPOUND_STRING( + "Envelops the foe with down\n" + "to sharply reduce Attack."), + .effect = EFFECT_ATTACK_DOWN_2, + .power = 0, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + .danceMove = TRUE, + }, + + [MOVE_TEETER_DANCE] = + { + .name = COMPOUND_STRING("Teeter Dance"), + .description = COMPOUND_STRING( + "Confuses all Pokémon on\n" + "the scene."), + .effect = EFFECT_CONFUSE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .danceMove = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_4, + }, + + [MOVE_BLAZE_KICK] = + { + .name = COMPOUND_STRING("Blaze Kick"), + .description = COMPOUND_STRING( + "A kick with a high critical-\n" + "hit ratio. May cause a burn."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_FIRE, + .accuracy = 90, + .criticalHitStage = 1, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_MUD_SPORT] = + { + .name = COMPOUND_STRING("Mud Sport"), + .description = COMPOUND_STRING( + "Covers the user in mud to\n" + "raise electrical resistance."), + .effect = EFFECT_MUD_SPORT, + .power = 0, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_ICE_BALL] = + { + .name = COMPOUND_STRING("Ice Ball"), + .description = COMPOUND_STRING( + "A 5-turn attack that gains\n" + "power on successive hits."), + .effect = EFFECT_ROLLOUT, + .power = 30, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ballisticMove = TRUE, + .instructBanned = TRUE, + .parentalBondBanned = TRUE, + }, + + [MOVE_NEEDLE_ARM] = + { + .name = COMPOUND_STRING("Needle Arm"), + .description = COMPOUND_STRING( + "Attacks with thorny arms.\n" + "May cause flinching."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_4, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_SLACK_OFF] = + { + .name = COMPOUND_STRING("Slack Off"), + .description = COMPOUND_STRING( + "Slacks off and restores\n" + "half the maximum HP."), + .effect = EFFECT_RESTORE_HP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 5 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HYPER_VOICE] = + { + .name = COMPOUND_STRING("Hyper Voice"), + .description = COMPOUND_STRING( + "A loud attack that uses\n" + "sound waves to injure."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + }, + + [MOVE_POISON_FANG] = + { + .name = COMPOUND_STRING("Poison Fang"), + .description = COMPOUND_STRING( + "A sharp-fanged attack.\n" + "May badly poison the foe."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_TOXIC, + .chance = B_UPDATED_MOVE_DATA >= GEN_6 ? 50 : 30, + }), + }, + + [MOVE_CRUSH_CLAW] = + { + .name = COMPOUND_STRING("Crush Claw"), + .description = COMPOUND_STRING( + "Tears at the foe with sharp\n" + "claws. May lower Defense."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_NORMAL, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_BLAST_BURN] = + { + .name = COMPOUND_STRING("Blast Burn"), + .description = COMPOUND_STRING( + "Powerful, but leaves the\n" + "user immobile the next turn."), + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_FIRE, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_HYDRO_CANNON] = + { + .name = COMPOUND_STRING("Hydro Cannon"), + .description = COMPOUND_STRING( + "Powerful, but leaves the\n" + "user immobile the next turn."), + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_WATER, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_METEOR_MASH] = + { + .name = COMPOUND_STRING("Meteor Mash"), + .description = COMPOUND_STRING( + "Fires a meteor-like punch.\n" + "May raise Attack."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 100, + .type = TYPE_STEEL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_PLUS_1, + .self = TRUE, + .chance = 20, + }), + }, + + [MOVE_ASTONISH] = + { + .name = COMPOUND_STRING("Astonish"), + .description = COMPOUND_STRING( + "An attack that may shock\n" + "the foe into flinching."), + .effect = EFFECT_HIT, + .power = 30, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_4, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_WEATHER_BALL] = + { + .name = COMPOUND_STRING("Weather Ball"), + .description = COMPOUND_STRING( + "The move's type and power\n" + "change with the weather."), + .effect = EFFECT_WEATHER_BALL, + .power = 50, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .zMove = { .powerOverride = 160 }, + .ballisticMove = TRUE, + }, + + [MOVE_AROMATHERAPY] = + { + .name = COMPOUND_STRING("Aromatherapy"), + .description = COMPOUND_STRING( + "Heals all status problems\n" + "with a soothing scent."), + .effect = EFFECT_HEAL_BELL, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER | MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_FAKE_TEARS] = + { + .name = COMPOUND_STRING("Fake Tears"), + .description = COMPOUND_STRING( + "Feigns crying to sharply\n" + "lower the foe's Sp. Def."), + .effect = EFFECT_SPECIAL_DEFENSE_DOWN_2, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_AIR_CUTTER] = + { + .name = COMPOUND_STRING("Air Cutter"), + .description = COMPOUND_STRING( + "Hacks with razorlike wind.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 55, + .type = TYPE_FLYING, + .accuracy = 95, + .criticalHitStage = 1, + .pp = 25, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_OVERHEAT] = + { + .name = COMPOUND_STRING("Overheat"), + .description = COMPOUND_STRING( + "Allows a full-power attack,\n" + "but sharply lowers Sp. Atk."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 130 : 140, + .type = TYPE_FIRE, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = B_UPDATED_MOVE_DATA < GEN_4, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_TWO_DOWN, + .self = TRUE, + }), + }, + + [MOVE_ODOR_SLEUTH] = + { + .name = COMPOUND_STRING("Odor Sleuth"), + .description = COMPOUND_STRING( + "Negates the foe's efforts\n" + "to heighten evasiveness."), + .effect = EFFECT_FORESIGHT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_4 ? 0 : 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .ignoresSubstitute = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_ROCK_TOMB] = + { + .name = COMPOUND_STRING("Rock Tomb"), + .description = COMPOUND_STRING( + "Stops the foe from moving\n" + "with rocks and cuts Speed."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 50, + .type = TYPE_ROCK, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 95 : 80, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 15 : 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_SILVER_WIND] = + { + .name = COMPOUND_STRING("Silver Wind"), + .description = COMPOUND_STRING( + "A powdery attack that may\n" + "raise abilities."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = B_EXTRAPOLATED_MOVE_FLAGS, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ALL_STATS_UP, + .self = TRUE, + .chance = 10, + }), + }, + + [MOVE_METAL_SOUND] = + { + .name = COMPOUND_STRING("Metal Sound"), + .description = COMPOUND_STRING( + "Emits a horrible screech\n" + "that sharply lowers Sp. Def."), + .effect = EFFECT_SPECIAL_DEFENSE_DOWN_2, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 85, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + }, + + [MOVE_GRASS_WHISTLE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("GrassWhistle", "Grass Whistle"), + .description = COMPOUND_STRING( + "Lulls the foe into sleep\n" + "with a pleasant melody."), + .effect = EFFECT_SLEEP, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 55, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + }, + + [MOVE_TICKLE] = + { + .name = COMPOUND_STRING("Tickle"), + .description = COMPOUND_STRING( + "Makes the foe laugh to\n" + "lower Attack and Defense."), + .effect = EFFECT_TICKLE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_COSMIC_POWER] = + { + .name = COMPOUND_STRING("Cosmic Power"), + .description = COMPOUND_STRING( + "Raises Defense and Sp. Def\n" + "with a mystic power."), + .effect = EFFECT_COSMIC_POWER, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_WATER_SPOUT] = + { + .name = COMPOUND_STRING("Water Spout"), + .description = COMPOUND_STRING( + "Inflicts more damage if the\n" + "user's HP is high."), + .effect = EFFECT_ERUPTION, + .power = 150, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_SIGNAL_BEAM] = + { + .name = COMPOUND_STRING("Signal Beam"), + .description = COMPOUND_STRING( + "A strange beam attack that\n" + "may confuse the foe."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 10, + }), + }, + + [MOVE_SHADOW_PUNCH] = + { + .name = COMPOUND_STRING("Shadow Punch"), + .description = COMPOUND_STRING( + "An unavoidable punch that\n" + "is thrown from shadows."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + }, + + [MOVE_EXTRASENSORY] = + { + .name = COMPOUND_STRING("Extrasensory"), + .description = COMPOUND_STRING( + "Attacks with a peculiar\n" + "power. May cause flinching."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_4, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 10, + }), + }, + + [MOVE_SKY_UPPERCUT] = + { + .name = COMPOUND_STRING("Sky Uppercut"), + .description = COMPOUND_STRING( + "An uppercut thrown as if\n" + "leaping into the sky."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_FIGHTING, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .damagesAirborne = TRUE, + }, + + [MOVE_SAND_TOMB] = + { + .name = COMPOUND_STRING("Sand Tomb"), + .description = COMPOUND_STRING( + "Traps and hurts the foe in\n" + "quicksand for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 35 : 15, + .type = TYPE_GROUND, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 85 : 70, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_SHEER_COLD] = + { + .name = COMPOUND_STRING("Sheer Cold"), + .description = COMPOUND_STRING( + "A chilling attack that\n" + "causes fainting if it hits."), + .effect = EFFECT_OHKO, + .power = 1, + .type = TYPE_ICE, + .accuracy = 30, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_MUDDY_WATER] = + { + .name = COMPOUND_STRING("Muddy Water"), + .description = COMPOUND_STRING( + "Attacks with muddy water.\n" + "May lower accuracy."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 95, + .type = TYPE_WATER, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_BULLET_SEED] = + { + .name = COMPOUND_STRING("Bullet Seed"), + .description = COMPOUND_STRING( + "Shoots 2 to 5 seeds in a row\n" + "to strike the foe."), + .effect = EFFECT_MULTI_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 25 : 10, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = TRUE, + }, + + [MOVE_AERIAL_ACE] = + { + .name = COMPOUND_STRING("Aerial Ace"), + .description = COMPOUND_STRING( + "An extremely speedy and\n" + "unavoidable attack."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_ICICLE_SPEAR] = + { + .name = COMPOUND_STRING("Icicle Spear"), + .description = COMPOUND_STRING( + "Attacks the foe by firing\n" + "2 to 5 icicles in a row."), + .effect = EFFECT_MULTI_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 25 : 10, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_IRON_DEFENSE] = + { + .name = COMPOUND_STRING("Iron Defense"), + .description = COMPOUND_STRING( + "Hardens the body's surface\n" + "to sharply raise Defense."), + .effect = EFFECT_DEFENSE_UP_2, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_BLOCK] = + { + .name = COMPOUND_STRING("Block"), + .description = COMPOUND_STRING( + "Blocks the foe's way to\n" + "prevent escape."), + .effect = EFFECT_MEAN_LOOK, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = (B_UPDATED_MOVE_FLAGS >= GEN_6) || (B_UPDATED_MOVE_FLAGS <= GEN_3), + .magicCoatAffected = TRUE, + }, + + [MOVE_HOWL] = + { + .name = COMPOUND_STRING("Howl"), + .description = COMPOUND_STRING( + "Howls to raise the spirit\n" + "and boosts Attack."), + .power = 0, + .effect = B_UPDATED_MOVE_DATA >= GEN_8 ? EFFECT_ATTACK_UP_USER_ALLY : EFFECT_ATTACK_UP, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .soundMove = B_UPDATED_MOVE_FLAGS >= GEN_8, + }, + + [MOVE_DRAGON_CLAW] = + { + .name = COMPOUND_STRING("Dragon Claw"), + .description = COMPOUND_STRING( + "Slashes the foe with sharp\n" + "claws."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_FRENZY_PLANT] = + { + .name = COMPOUND_STRING("Frenzy Plant"), + .description = COMPOUND_STRING( + "Powerful, but leaves the\n" + "user immobile the next turn."), + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_GRASS, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_BULK_UP] = + { + .name = COMPOUND_STRING("Bulk Up"), + .description = COMPOUND_STRING( + "Bulks up the body to boost\n" + "both Attack and Defense."), + .effect = EFFECT_BULK_UP, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_BOUNCE] = + { + .name = COMPOUND_STRING("Bounce"), + .description = COMPOUND_STRING( + "Bounces up, then down the\n" + "next turn. May paralyze."), + .effect = EFFECT_SEMI_INVULNERABLE, + .power = 85, + .type = TYPE_FLYING, + .accuracy = 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .gravityBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNSPRANGUP, COMPRESS_BITS(STATUS3_ON_AIR)), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_MUD_SHOT] = + { + .name = COMPOUND_STRING("Mud Shot"), + .description = COMPOUND_STRING( + "Hurls mud at the foe and\n" + "reduces Speed."), + .effect = EFFECT_HIT, + .power = 55, + .type = TYPE_GROUND, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_POISON_TAIL] = + { + .name = COMPOUND_STRING("Poison Tail"), + .description = COMPOUND_STRING( + "Has a high critical-hit\n" + "ratio. May also poison."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_POISON, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 10, + }), + }, + + [MOVE_COVET] = + { + .name = COMPOUND_STRING("Covet"), + .description = COMPOUND_STRING( + "Cutely begs to obtain an\n" + "item held by the foe."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 60 : 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 25 : 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = B_UPDATED_MOVE_DATA >= GEN_4, + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_STEAL_ITEM, + }), + }, + + [MOVE_VOLT_TACKLE] = + { + .name = COMPOUND_STRING("Volt Tackle"), + .description = COMPOUND_STRING( + "A life-risking tackle that\n" + "slightly hurts the user."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .recoil = 33, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 10, + }), + #endif + }, + + [MOVE_MAGICAL_LEAF] = + { + .name = COMPOUND_STRING("Magical Leaf"), + .description = COMPOUND_STRING( + "Attacks with a strange leaf\n" + "that cannot be evaded."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_WATER_SPORT] = + { + .name = COMPOUND_STRING("Water Sport"), + .description = COMPOUND_STRING( + "The user becomes soaked to\n" + "raise resistance to fire."), + .effect = EFFECT_WATER_SPORT, + .power = 0, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_CALM_MIND] = + { + .name = COMPOUND_STRING("Calm Mind"), + .description = COMPOUND_STRING( + "Raises Sp. Atk and Sp. Def\n" + "by focusing the mind."), + .effect = EFFECT_CALM_MIND, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_LEAF_BLADE] = + { + .name = COMPOUND_STRING("Leaf Blade"), + .description = COMPOUND_STRING( + "Slashes with a sharp leaf.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_4 ? 90 : 70, + .type = TYPE_GRASS, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_DRAGON_DANCE] = + { + .name = COMPOUND_STRING("Dragon Dance"), + .description = COMPOUND_STRING( + "A mystical dance that ups\n" + "Attack and Speed."), + .effect = EFFECT_DRAGON_DANCE, + .power = 0, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .danceMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ROCK_BLAST] = + { + .name = COMPOUND_STRING("Rock Blast"), + .description = COMPOUND_STRING( + "Hurls boulders at the foe\n" + "2 to 5 times in a row."), + .effect = EFFECT_MULTI_HIT, + .power = 25, + .type = TYPE_ROCK, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 90 : 80, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = B_UPDATED_MOVE_FLAGS >= GEN_6, + }, + + [MOVE_SHOCK_WAVE] = + { + .name = COMPOUND_STRING("Shock Wave"), + .description = COMPOUND_STRING( + "A fast and unavoidable\n" + "electric attack."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_WATER_PULSE] = + { + .name = COMPOUND_STRING("Water Pulse"), + .description = COMPOUND_STRING( + "Attacks with ultrasonic\n" + "waves. May confuse the foe."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .pulseMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 20, + }), + }, + + [MOVE_DOOM_DESIRE] = + { + .name = COMPOUND_STRING("Doom Desire"), + .description = COMPOUND_STRING( + "Summons strong sunlight to\n" + "attack 2 turns later."), + .effect = EFFECT_FUTURE_SIGHT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 140 : 120, + .type = TYPE_STEEL, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 100 : 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_PSYCHO_BOOST] = + { + .name = COMPOUND_STRING("Psycho Boost"), + .description = COMPOUND_STRING( + "Allows a full-power attack,\n" + "but sharply lowers Sp. Atk."), + .effect = EFFECT_HIT, + .power = 140, + .type = TYPE_PSYCHIC, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_TWO_DOWN, + .self = TRUE, + }), + }, + + [MOVE_ROOST] = + { + .name = COMPOUND_STRING("Roost"), + .description = COMPOUND_STRING( + "Restores the user's HP by\n" + "half of its max HP."), + .effect = EFFECT_ROOST, + .power = 0, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 5 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_GRAVITY] = + { + .name = COMPOUND_STRING("Gravity"), + .description = COMPOUND_STRING( + "Gravity is intensified\n" + "negating levitation."), + .effect = EFFECT_GRAVITY, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_MIRACLE_EYE] = + { + .name = COMPOUND_STRING("Miracle Eye"), + .description = COMPOUND_STRING( + "Negate evasiveness and\n" + "Dark-type's immunities."), + .effect = EFFECT_MIRACLE_EYE, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresSubstitute = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_WAKE_UP_SLAP] = + { + .name = COMPOUND_STRING("Wake-Up Slap"), + .description = COMPOUND_STRING( + "Powerful against sleeping\n" + "foes, but also heals them."), + .effect = EFFECT_DOUBLE_POWER_ON_ARG_STATUS, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 70 : 60, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = STATUS1_SLEEP, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_REMOVE_STATUS, + }), + }, + + [MOVE_HAMMER_ARM] = + { + .name = COMPOUND_STRING("Hammer Arm"), + .description = COMPOUND_STRING( + "A swinging fist attack\n" + "that also lowers Speed."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIGHTING, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .self = TRUE, + }), + }, + + [MOVE_GYRO_BALL] = + { + .name = COMPOUND_STRING("Gyro Ball"), + .description = COMPOUND_STRING( + "A high-speed spin that does\n" + "more damage to faster foes."), + .effect = EFFECT_GYRO_BALL, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ballisticMove = TRUE, + }, + + [MOVE_HEALING_WISH] = + { + .name = COMPOUND_STRING("Healing Wish"), + .description = sHealingWishDescription, + .effect = EFFECT_HEALING_WISH, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .healingMove = TRUE, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_BRINE] = + { + .name = COMPOUND_STRING("Brine"), + .description = COMPOUND_STRING( + "Does double damage to foes\n" + "with half HP."), + .effect = EFFECT_BRINE, + .power = 65, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_NATURAL_GIFT] = + { + .name = COMPOUND_STRING("Natural Gift"), + .description = COMPOUND_STRING( + "The effectiveness varies\n" + "with the held Berry."), + .effect = EFFECT_NATURAL_GIFT, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_FEINT] = + { + .name = COMPOUND_STRING("Feint"), + .description = COMPOUND_STRING( + "An attack that hits foes\n" + "using moves like Protect."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 30 : 50, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 2, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresProtect = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_6, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FEINT, + }), + }, + + [MOVE_PLUCK] = + { + .name = COMPOUND_STRING("Pluck"), + .description = sPluckDescription, + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BUG_BITE, + }), + }, + + [MOVE_TAILWIND] = + { + .name = COMPOUND_STRING("Tailwind"), + .description = COMPOUND_STRING( + "Whips up a turbulent breeze\n" + "that raises Speed."), + .effect = EFFECT_TAILWIND, + .power = 0, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 15 : 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_BOOST_CRITS }, + .snatchAffected = TRUE, + .windMove = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ACUPRESSURE] = + { + .name = COMPOUND_STRING("Acupressure"), + .description = COMPOUND_STRING( + "The user sharply raises\n" + "one of its stats."), + .effect = EFFECT_ACUPRESSURE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER | MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_BOOST_CRITS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .snatchAffected = B_UPDATED_MOVE_FLAGS < GEN_5, + }, + + [MOVE_METAL_BURST] = + { + .name = COMPOUND_STRING("Metal Burst"), + .description = COMPOUND_STRING( + "Retaliates any hit with\n" + "greater power."), + .effect = EFFECT_METAL_BURST, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .meFirstBanned = TRUE, + }, + + [MOVE_U_TURN] = + { + .name = COMPOUND_STRING("U-turn"), + .description = sUTurnDescription, + .effect = EFFECT_HIT_ESCAPE, + .power = 70, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_CLOSE_COMBAT] = + { + .name = COMPOUND_STRING("Close Combat"), + .description = sCloseCombatDescription, + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_SPDEF_DOWN, + .self = TRUE, + }), + }, + + [MOVE_PAYBACK] = + { + .name = COMPOUND_STRING("Payback"), + .description = COMPOUND_STRING( + "An attack that gains power\n" + "if the user moves last."), + .effect = EFFECT_PAYBACK, + .power = 50, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_ASSURANCE] = + { + .name = COMPOUND_STRING("Assurance"), + .description = COMPOUND_STRING( + "An attack that gains power\n" + "if the foe has been hurt."), + .effect = EFFECT_ASSURANCE, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 50, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_EMBARGO] = + { + .name = COMPOUND_STRING("Embargo"), + .description = COMPOUND_STRING( + "Prevents the foe from\n" + "using any items."), + .effect = EFFECT_EMBARGO, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_FLING] = + { + .name = COMPOUND_STRING("Fling"), + .description = COMPOUND_STRING( + "The effectiveness varies\n" + "with the held item."), + .effect = EFFECT_FLING, + .power = 1, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .parentalBondBanned = TRUE, + }, + + [MOVE_PSYCHO_SHIFT] = + { + .name = COMPOUND_STRING("Psycho Shift"), + .description = COMPOUND_STRING( + "Transfers status problems\n" + "to the foe."), + .effect = EFFECT_PSYCHO_SHIFT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 100 : 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_2 }, + }, + + [MOVE_TRUMP_CARD] = + { + .name = COMPOUND_STRING("Trump Card"), + .description = COMPOUND_STRING( + "The less PP the move has\n" + "the more damage it does."), + .effect = EFFECT_TRUMP_CARD, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = TRUE, + }, + + [MOVE_HEAL_BLOCK] = + { + .name = COMPOUND_STRING("Heal Block"), + .description = COMPOUND_STRING( + "Prevents the foe from\n" + "recovering any HP."), + .effect = EFFECT_HEAL_BLOCK, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_2 }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_WRING_OUT] = + { + .name = COMPOUND_STRING("Wring Out"), + .description = sWringOutDescription, + .effect = EFFECT_VARY_POWER_BASED_ON_HP, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = 120, + .makesContact = TRUE, + }, + + [MOVE_POWER_TRICK] = + { + .name = COMPOUND_STRING("Power Trick"), + .description = COMPOUND_STRING( + "The user swaps its Attack\n" + "and Defense stats."), + .effect = EFFECT_POWER_TRICK, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_GASTRO_ACID] = + { + .name = COMPOUND_STRING("Gastro Acid"), + .description = COMPOUND_STRING( + "Stomach acid suppresses\n" + "the foe's ability."), + .effect = EFFECT_GASTRO_ACID, + .power = 0, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_LUCKY_CHANT] = + { + .name = COMPOUND_STRING("Lucky Chant"), + .description = COMPOUND_STRING( + "Prevents the foe from\n" + "landing critical hits."), + .effect = EFFECT_LUCKY_CHANT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ME_FIRST] = + { + .name = COMPOUND_STRING("Me First"), + .description = COMPOUND_STRING( + "Executes the foe's attack\n" + "with greater power."), + .effect = EFFECT_ME_FIRST, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .ignoresSubstitute = TRUE, + .metronomeBanned = TRUE, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .mimicBanned = TRUE, + }, + + [MOVE_COPYCAT] = + { + .name = COMPOUND_STRING("Copycat"), + .description = COMPOUND_STRING( + "The user mimics the last\n" + "move used by a foe."), + .effect = EFFECT_COPYCAT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .mimicBanned = TRUE, + }, + + [MOVE_POWER_SWAP] = + { + .name = COMPOUND_STRING("Power Swap"), + .description = COMPOUND_STRING( + "Swaps changes to Attack\n" + "and Sp. Atk with the foe."), + .effect = EFFECT_POWER_SWAP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = TRUE, + }, + + [MOVE_GUARD_SWAP] = + { + .name = COMPOUND_STRING("Guard Swap"), + .description = COMPOUND_STRING( + "Swaps changes to Defense\n" + "and Sp. Def with the foe."), + .effect = EFFECT_GUARD_SWAP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = TRUE, + }, + + [MOVE_PUNISHMENT] = + { + .name = COMPOUND_STRING("Punishment"), + .description = COMPOUND_STRING( + "Does more damage if the\n" + "foe has powered up."), + .effect = EFFECT_PUNISHMENT, + .power = 60, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_LAST_RESORT] = + { + .name = COMPOUND_STRING("Last Resort"), + .description = COMPOUND_STRING( + "Can only be used if every\n" + "other move has been used."), + .effect = EFFECT_LAST_RESORT, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 140 : 130, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_WORRY_SEED] = + { + .name = COMPOUND_STRING("Worry Seed"), + .description = COMPOUND_STRING( + "Plants a seed on the foe\n" + "giving it Insomnia."), + .effect = EFFECT_WORRY_SEED, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_SUCKER_PUNCH] = + { + .name = COMPOUND_STRING("Sucker Punch"), + .description = sSuckerPunchDescription, + .effect = EFFECT_SUCKER_PUNCH, + .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 70 : 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_TOXIC_SPIKES] = + { + .name = COMPOUND_STRING("Toxic Spikes"), + .description = COMPOUND_STRING( + "Sets spikes that poison a\n" + "foe switching in."), + .effect = EFFECT_TOXIC_SPIKES, + .power = 0, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_OPPONENTS_FIELD, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .forcePressure = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_HEART_SWAP] = + { + .name = COMPOUND_STRING("Heart Swap"), + .description = COMPOUND_STRING( + "Swaps any stat changes\n" + "with the foe."), + .effect = EFFECT_HEART_SWAP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_BOOST_CRITS }, + .ignoresSubstitute = TRUE, + }, + + [MOVE_AQUA_RING] = + { + .name = COMPOUND_STRING("Aqua Ring"), + .description = COMPOUND_STRING( + "Forms a veil of water\n" + "that restores HP."), + .effect = EFFECT_AQUA_RING, + .power = 0, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_MAGNET_RISE] = + { + .name = COMPOUND_STRING("Magnet Rise"), + .description = COMPOUND_STRING( + "The user levitates with\n" + "electromagnetism."), + .effect = EFFECT_MAGNET_RISE, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_EVSN_UP_1 }, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .gravityBanned = TRUE, + }, + + [MOVE_FLARE_BLITZ] = + { + .name = COMPOUND_STRING("Flare Blitz"), + .description = COMPOUND_STRING( + "A charge that may burn the\n" + "foe. Also hurts the user."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FIRE, + .accuracy = 100, + .recoil = 33, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .thawsUser = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_FORCE_PALM] = + { + .name = COMPOUND_STRING("Force Palm"), + .description = COMPOUND_STRING( + "A shock wave attack that\n" + "may paralyze the foe."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_AURA_SPHERE] = + { + .name = COMPOUND_STRING("Aura Sphere"), + .description = COMPOUND_STRING( + "Attacks with an aura blast\n" + "that cannot be evaded."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 80 : 90, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .pulseMove = TRUE, + .ballisticMove = TRUE, + }, + + [MOVE_ROCK_POLISH] = + { + .name = COMPOUND_STRING("Rock Polish"), + .description = COMPOUND_STRING( + "Polishes the body to\n" + "sharply raise Speed."), + .effect = EFFECT_SPEED_UP_2, + .power = 0, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_POISON_JAB] = + { + .name = COMPOUND_STRING("Poison Jab"), + .description = COMPOUND_STRING( + "A stabbing attack that\n" + "may poison the foe."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 30, + }), + }, + + [MOVE_DARK_PULSE] = + { + .name = COMPOUND_STRING("Dark Pulse"), + .description = COMPOUND_STRING( + "Attacks with a horrible\n" + "aura. May cause flinching."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .pulseMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 20, + }), + }, + + [MOVE_NIGHT_SLASH] = + { + .name = COMPOUND_STRING("Night Slash"), + .description = COMPOUND_STRING( + "Hits as soon as possible.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_DARK, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_AQUA_TAIL] = + { + .name = COMPOUND_STRING("Aqua Tail"), + .description = COMPOUND_STRING( + "The user swings its tail\n" + "like a wave to attack."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_WATER, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SEED_BOMB] = + { + .name = COMPOUND_STRING("Seed Bomb"), + .description = COMPOUND_STRING( + "A barrage of hard seeds\n" + "is fired at the foe."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = TRUE, + }, + + [MOVE_AIR_SLASH] = + { + .name = COMPOUND_STRING("Air Slash"), + .description = COMPOUND_STRING( + "Attacks with a blade of\n" + "air. May cause flinching."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_FLYING, + .accuracy = 95, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 15 : 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .slicingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_X_SCISSOR] = + { + .name = COMPOUND_STRING("X-Scissor"), + .description = COMPOUND_STRING( + "Slashes the foe with crossed\n" + "scythes, claws, etc."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_BUG_BUZZ] = + { + .name = COMPOUND_STRING("Bug Buzz"), + .description = COMPOUND_STRING( + "A damaging sound wave that\n" + "may lower Sp. Def."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_DRAGON_PULSE] = + { + .name = COMPOUND_STRING("Dragon Pulse"), + .description = COMPOUND_STRING( + "Generates a shock wave to\n" + "damage the foe."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 85 : 90, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .pulseMove = TRUE, + }, + + [MOVE_DRAGON_RUSH] = + { + .name = COMPOUND_STRING("Dragon Rush"), + .description = COMPOUND_STRING( + "Tackles the foe with menace.\n" + "May cause flinching."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_DRAGON, + .accuracy = 75, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS >= GEN_6, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 20, + }), + }, + + [MOVE_POWER_GEM] = + { + .name = COMPOUND_STRING("Power Gem"), + .description = COMPOUND_STRING( + "Attacks with rays of light\n" + "that sparkle like diamonds."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 80 : 70, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_DRAIN_PUNCH] = + { + .name = COMPOUND_STRING("Drain Punch"), + .description = sMegaDrainDescription, + .effect = EFFECT_ABSORB, + .power = B_UPDATED_MOVE_DATA >= GEN_5 ? 75 : 60, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_5 ? 10 : 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_VACUUM_WAVE] = + { + .name = COMPOUND_STRING("Vacuum Wave"), + .description = COMPOUND_STRING( + "Whirls its fists to send\n" + "a wave that strikes first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_FOCUS_BLAST] = + { + .name = COMPOUND_STRING("Focus Blast"), + .description = COMPOUND_STRING( + "Attacks at full power.\n" + "May lower Sp. Def."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FIGHTING, + .accuracy = 70, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_ENERGY_BALL] = + { + .name = COMPOUND_STRING("Energy Ball"), + .description = COMPOUND_STRING( + "Draws power from nature to\n" + "attack. May lower Sp. Def."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 90 : 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_BRAVE_BIRD] = + { + .name = COMPOUND_STRING("Brave Bird"), + .description = COMPOUND_STRING( + "A low altitude charge that\n" + "also hurts the user."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FLYING, + .accuracy = 100, + .recoil = 33, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_EARTH_POWER] = + { + .name = COMPOUND_STRING("Earth Power"), + .description = COMPOUND_STRING( + "Makes the ground erupt with\n" + "power. May lower Sp. Def."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_SWITCHEROO] = + { + .name = COMPOUND_STRING("Switcheroo"), + .description = COMPOUND_STRING( + "Swaps items with the foe\n" + "faster than the eye can see."), + .effect = EFFECT_TRICK, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_GIGA_IMPACT] = + { + .name = COMPOUND_STRING("Giga Impact"), + .description = sHyperBeamDescription, + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_NASTY_PLOT] = + { + .name = COMPOUND_STRING("Nasty Plot"), + .description = COMPOUND_STRING( + "Thinks bad thoughts to\n" + "sharply boost Sp. Atk."), + .effect = EFFECT_SPECIAL_ATTACK_UP_2, + .power = 0, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_BULLET_PUNCH] = + { + .name = COMPOUND_STRING("Bullet Punch"), + .description = COMPOUND_STRING( + "Punches as fast as a bul-\n" + "let. It always hits first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + }, + + [MOVE_AVALANCHE] = + { + .name = COMPOUND_STRING("Avalanche"), + .description = sRevengeDescription, + .effect = EFFECT_REVENGE, + .power = 60, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = -4, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_ICE_SHARD] = + { + .name = COMPOUND_STRING("Ice Shard"), + .description = COMPOUND_STRING( + "Hurls a chunk of ice that\n" + "always strike first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_SHADOW_CLAW] = + { + .name = COMPOUND_STRING("Shadow Claw"), + .description = COMPOUND_STRING( + "Strikes with a shadow claw.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_GHOST, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_THUNDER_FANG] = + { + .name = COMPOUND_STRING("Thunder Fang"), + .description = COMPOUND_STRING( + "May cause flinching or\n" + "leave the foe paralyzed."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_ELECTRIC, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 10, + }, + { + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 10, + }), + }, + + [MOVE_ICE_FANG] = + { + .name = COMPOUND_STRING("Ice Fang"), + .description = COMPOUND_STRING( + "May cause flinching or\n" + #if B_USE_FROSTBITE == TRUE + "leave the foe frozen."), + #else + "leave the foe with frostbite."), + #endif + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_ICE, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }, + { + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 10, + }), + }, + + [MOVE_FIRE_FANG] = + { + .name = COMPOUND_STRING("Fire Fang"), + .description = COMPOUND_STRING( + "May cause flinching or\n" + "leave the foe with a burn."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_FIRE, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }, + { + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 10, + }), + }, + + [MOVE_SHADOW_SNEAK] = + { + .name = COMPOUND_STRING("Shadow Sneak"), + .description = COMPOUND_STRING( + "Extends the user's shadow\n" + "to strike first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_MUD_BOMB] = + { + .name = COMPOUND_STRING("Mud Bomb"), + .description = COMPOUND_STRING( + "Throws a blob of mud to\n" + "damage and cut accuracy."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_GROUND, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_PSYCHO_CUT] = + { + .name = COMPOUND_STRING("Psycho Cut"), + .description = COMPOUND_STRING( + "Tears with psychic blades.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .slicingMove = TRUE, + }, + + [MOVE_ZEN_HEADBUTT] = + { + .name = COMPOUND_STRING("Zen Headbutt"), + .description = COMPOUND_STRING( + "Hits with a strong head-\n" + "butt. May cause flinching."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 20, + }), + }, + + [MOVE_MIRROR_SHOT] = + { + .name = COMPOUND_STRING("Mirror Shot"), + .description = COMPOUND_STRING( + "Emits a flash of energy to\n" + "damage and cut accuracy."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_STEEL, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_FLASH_CANNON] = + { + .name = COMPOUND_STRING("Flash Cannon"), + .description = COMPOUND_STRING( + "Releases a blast of light\n" + "that may lower Sp. Def."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_ROCK_CLIMB] = + { + .name = COMPOUND_STRING("Rock Climb"), + .description = COMPOUND_STRING( + "A charging attack that may\n" + "confuse the foe."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 20, + }), + }, + + [MOVE_DEFOG] = + { + .name = COMPOUND_STRING("Defog"), + .description = COMPOUND_STRING( + "Removes obstacles and\n" + "lowers evasion."), + .effect = EFFECT_DEFOG, + .power = 0, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + //.ignoresSubstitute = TRUE, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + }, + + [MOVE_TRICK_ROOM] = + { + .name = COMPOUND_STRING("Trick Room"), + .description = COMPOUND_STRING( + "Slower Pokémon get to move\n" + "first for 5 turns."), + .effect = EFFECT_TRICK_ROOM, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = -7, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ACC_UP_1 }, + .ignoresProtect = TRUE, + }, + + [MOVE_DRACO_METEOR] = + { + .name = COMPOUND_STRING("Draco Meteor"), + .description = COMPOUND_STRING( + "Casts comets onto the foe.\n" + "Harshly lowers the Sp. Atk."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 130 : 140, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_TWO_DOWN, + .self = TRUE, + }), + }, + + [MOVE_DISCHARGE] = + { + .name = COMPOUND_STRING("Discharge"), + .description = COMPOUND_STRING( + "Zaps the foes with electri-\n" + "city. May paralyze them."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_LAVA_PLUME] = + { + .name = COMPOUND_STRING("Lava Plume"), + .description = sLavaPlumeDescription, + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_LEAF_STORM] = + { + .name = COMPOUND_STRING("Leaf Storm"), + .description = COMPOUND_STRING( + "Whips up a storm of leaves.\n" + "Harshly lowers the Sp. Atk."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 130 : 140, + .type = TYPE_GRASS, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_TWO_DOWN, + .self = TRUE, + }), + }, + + [MOVE_POWER_WHIP] = + { + .name = COMPOUND_STRING("Power Whip"), + .description = COMPOUND_STRING( + "Violently lashes the foe\n" + "with vines or tentacles."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_GRASS, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_ROCK_WRECKER] = + { + .name = COMPOUND_STRING("Rock Wrecker"), + .description = sHyperBeamDescription, + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_CROSS_POISON] = + { + .name = COMPOUND_STRING("Cross Poison"), + .description = COMPOUND_STRING( + "A slash that may poison a\n" + "foe and do critical damage."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_POISON, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 10, + }), + }, + + [MOVE_GUNK_SHOT] = + { + .name = COMPOUND_STRING("Gunk Shot"), + .description = COMPOUND_STRING( + "Shoots filthy garbage at\n" + "the foe. May also poison."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_POISON, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_6 ? 80 : 70, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 30, + }), + }, + + [MOVE_IRON_HEAD] = + { + .name = COMPOUND_STRING("Iron Head"), + .description = COMPOUND_STRING( + "Slams the foe with a hard\n" + "head. May cause flinching."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_MAGNET_BOMB] = + { + .name = COMPOUND_STRING("Magnet Bomb"), + .description = COMPOUND_STRING( + "Launches a magnet that\n" + "strikes without fail."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ballisticMove = TRUE, + }, + + [MOVE_STONE_EDGE] = + { + .name = COMPOUND_STRING("Stone Edge"), + .description = COMPOUND_STRING( + "Stabs the foe with stones.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_ROCK, + .accuracy = 80, + .criticalHitStage = 1, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_CAPTIVATE] = + { + .name = COMPOUND_STRING("Captivate"), + .description = COMPOUND_STRING( + "Makes the opposite gender\n" + "sharply reduce its Sp. Atk."), + .effect = EFFECT_CAPTIVATE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_2 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_STEALTH_ROCK] = + { + .name = COMPOUND_STRING("Stealth Rock"), + .description = COMPOUND_STRING( + "Sets floating stones that\n" + "hurt a foe switching in."), + .effect = EFFECT_STEALTH_ROCK, + .power = 0, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_OPPONENTS_FIELD, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .forcePressure = TRUE, + }, + + [MOVE_GRASS_KNOT] = + { + .name = COMPOUND_STRING("Grass Knot"), + .description = COMPOUND_STRING( + "A snare attack that does\n" + "more damage to heavier foes."), + .effect = EFFECT_LOW_KICK, + .power = 1, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_CHATTER] = + { + .name = COMPOUND_STRING("Chatter"), + .description = COMPOUND_STRING( + "Attacks with a sound wave\n" + "that causes confusion."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 65 : 60, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_6, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + #if B_UPDATED_MOVE_DATA >= GEN_6 + .chance = 100, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .chance = 10, + #else + .chance = 31, + #endif + }), + }, + + [MOVE_JUDGMENT] = + { + .name = COMPOUND_STRING("Judgment"), + .description = COMPOUND_STRING( + "The type varies with the\n" + "kind of Plate held."), + .effect = EFFECT_CHANGE_TYPE_ON_ITEM, + .power = 100, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = HOLD_EFFECT_PLATE, + }, + + [MOVE_BUG_BITE] = + { + .name = COMPOUND_STRING("Bug Bite"), + .description = sPluckDescription, + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BUG_BITE, + }), + }, + + [MOVE_CHARGE_BEAM] = + { + .name = COMPOUND_STRING("Charge Beam"), + .description = COMPOUND_STRING( + "Fires a beam of electricity.\n" + "May raise Sp. Atk."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_ELECTRIC, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, + .self = TRUE, + .chance = 70, + }), + }, + + [MOVE_WOOD_HAMMER] = + { + .name = COMPOUND_STRING("Wood Hammer"), + .description = COMPOUND_STRING( + "Slams the body into a foe.\n" + "The user gets hurt too."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_GRASS, + .accuracy = 100, + .recoil = 33, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_AQUA_JET] = + { + .name = COMPOUND_STRING("Aqua Jet"), + .description = COMPOUND_STRING( + "Strikes first by dashing\n" + "at the foe at a high speed."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_ATTACK_ORDER] = + { + .name = COMPOUND_STRING("Attack Order"), + .description = COMPOUND_STRING( + "Underlings pummel the foe.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_BUG, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_DEFEND_ORDER] = + { + .name = COMPOUND_STRING("Defend Order"), + .description = COMPOUND_STRING( + "Raises Defense and Sp. Def\n" + "with a living shield."), + .effect = EFFECT_COSMIC_POWER, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HEAL_ORDER] = + { + .name = COMPOUND_STRING("Heal Order"), + .description = COMPOUND_STRING( + "The user's underlings show\n" + "up to heal half its max HP."), + .effect = EFFECT_RESTORE_HP, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HEAD_SMASH] = + { + .name = COMPOUND_STRING("Head Smash"), + .description = COMPOUND_STRING( + "A life-risking headbutt that\n" + "seriously hurts the user."), + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_ROCK, + .accuracy = 80, + .recoil = 50, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_DOUBLE_HIT] = + { + .name = COMPOUND_STRING("Double Hit"), + .description = COMPOUND_STRING( + "Slams the foe with a tail\n" + "etc. Strikes twice."), + .effect = EFFECT_HIT, + .power = 35, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 2, + }, + + [MOVE_ROAR_OF_TIME] = + { + .name = COMPOUND_STRING("Roar of Time"), + .description = COMPOUND_STRING( + "Powerful, but leaves the\n" + "user immobile the next turn."), + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_SPACIAL_REND] = + { + .name = COMPOUND_STRING("Spacial Rend"), + .description = COMPOUND_STRING( + "Tears the foe, and space.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_DRAGON, + .accuracy = 95, + .criticalHitStage = 1, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_LUNAR_DANCE] = + { + .name = COMPOUND_STRING("Lunar Dance"), + .description = sHealingWishDescription, + .effect = EFFECT_HEALING_WISH, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = B_UPDATED_MOVE_FLAGS >= GEN_5, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .danceMove = TRUE, + }, + + [MOVE_CRUSH_GRIP] = + { + .name = COMPOUND_STRING("Crush Grip"), + .description = sWringOutDescription, + .effect = EFFECT_VARY_POWER_BASED_ON_HP, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = 120, + .makesContact = TRUE, + }, + + [MOVE_MAGMA_STORM] = + { + .name = COMPOUND_STRING("Magma Storm"), + .description = COMPOUND_STRING( + "Traps the foe in a vortex\n" + "of fire for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 100 : 120, + .type = TYPE_FIRE, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_5 ? 75 : 70, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_DARK_VOID] = + { + .name = COMPOUND_STRING("Dark Void"), + .description = COMPOUND_STRING( + "Drags the foe into total\n" + "darkness, inducing Sleep."), + .effect = EFFECT_DARK_VOID, + .power = 0, + .type = TYPE_DARK, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_7 ? 50 : 80, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + }, + + [MOVE_SEED_FLARE] = + { + .name = COMPOUND_STRING("Seed Flare"), + .description = COMPOUND_STRING( + "Generates a shock wave that\n" + "sharply reduces Sp. Def."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_GRASS, + .accuracy = 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_2, + .chance = 40, + }), + }, + + [MOVE_OMINOUS_WIND] = + { + .name = COMPOUND_STRING("Ominous Wind"), + .description = COMPOUND_STRING( + "A repulsive attack that may\n" + "raise all stats."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = B_EXTRAPOLATED_MOVE_FLAGS, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ALL_STATS_UP, + .self = TRUE, + .chance = 10, + }), + }, + + [MOVE_SHADOW_FORCE] = + { + .name = COMPOUND_STRING("Shadow Force"), + .description = sShadowForceDescription, + .effect = EFFECT_SEMI_INVULNERABLE, + .power = 120, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresProtect = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS == GEN_6, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_VANISHEDINSTANTLY, COMPRESS_BITS(STATUS3_PHANTOM_FORCE)), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FEINT, + }), + }, + + [MOVE_HONE_CLAWS] = + { + .name = COMPOUND_STRING("Hone Claws"), + .description = COMPOUND_STRING( + "Sharpens its claws to raise\n" + "Attack and Accuracy."), + .effect = EFFECT_ATTACK_ACCURACY_UP, + .power = 0, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_WIDE_GUARD] = + { + .name = COMPOUND_STRING("Wide Guard"), + .description = COMPOUND_STRING( + "Evades wide-ranging attacks\n" + "for one turn."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 3, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TRUE, // Protects the whole side. + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_GUARD_SPLIT] = + { + .name = COMPOUND_STRING("Guard Split"), + .description = COMPOUND_STRING( + "Averages changes to Defense\n" + "and Sp. Def with the foe."), + .effect = EFFECT_GUARD_SPLIT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_POWER_SPLIT] = + { + .name = COMPOUND_STRING("Power Split"), + .description = COMPOUND_STRING( + "Averages changes to Attack\n" + "and Sp. Atk with the foe."), + .effect = EFFECT_POWER_SPLIT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_WONDER_ROOM] = + { + .name = COMPOUND_STRING("Wonder Room"), + .description = COMPOUND_STRING( + "Defense and Sp. Def stats\n" + "are swapped for 5 turns."), + .effect = EFFECT_WONDER_ROOM, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = B_UPDATED_MOVE_DATA >= GEN_6 ? 0 : -7, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + }, + + [MOVE_PSYSHOCK] = + { + .name = COMPOUND_STRING("Psyshock"), + .description = sPsyshockDescription, + .effect = EFFECT_PSYSHOCK, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_VENOSHOCK] = + { + .name = COMPOUND_STRING("Venoshock"), + .description = COMPOUND_STRING( + "Does double damage if the\n" + "foe is poisoned."), + .effect = EFFECT_DOUBLE_POWER_ON_ARG_STATUS, + .power = 65, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = STATUS1_PSN_ANY, + }, + + [MOVE_AUTOTOMIZE] = + { + .name = COMPOUND_STRING("Autotomize"), + .description = COMPOUND_STRING( + "Sheds additional weight to\n" + "sharply boost Speed."), + .effect = EFFECT_AUTOTOMIZE, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_RAGE_POWDER] = + { + .name = COMPOUND_STRING("Rage Powder"), + .description = COMPOUND_STRING( + "Scatters powder to make\n" + "foes attack only the user."), + .effect = EFFECT_FOLLOW_ME, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_6 ? 2 : 3, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .powderMove = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_TELEKINESIS] = + { + .name = COMPOUND_STRING("Telekinesis"), + .description = COMPOUND_STRING( + "Makes the foe float. It is\n" + "easier to hit for 3 turns."), + .effect = EFFECT_TELEKINESIS, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = TRUE, + .gravityBanned = TRUE, + }, + + [MOVE_MAGIC_ROOM] = + { + .name = COMPOUND_STRING("Magic Room"), + .description = COMPOUND_STRING( + "Hold items lose their\n" + "effects for 5 turns."), + .effect = EFFECT_MAGIC_ROOM, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = B_UPDATED_MOVE_DATA >= GEN_6 ? 0 : -7, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + }, + + [MOVE_SMACK_DOWN] = + { + .name = COMPOUND_STRING("Smack Down"), + .description = COMPOUND_STRING( + "Throws a rock to knock the\n" + "foe down to the ground."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .damagesAirborne = TRUE, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SMACK_DOWN, + }), + }, + + [MOVE_STORM_THROW] = + { + .name = COMPOUND_STRING("Storm Throw"), + .description = sStormThrowDescription, + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 40, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .alwaysCriticalHit = TRUE, + }, + + [MOVE_FLAME_BURST] = + { + .name = COMPOUND_STRING("Flame Burst"), + .description = COMPOUND_STRING( + "A bursting flame that does\n" + "damage to all foes."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLAME_BURST, + .self = TRUE, + }), + }, + + [MOVE_SLUDGE_WAVE] = + { + .name = COMPOUND_STRING("Sludge Wave"), + .description = COMPOUND_STRING( + "Swamps the foe with a wave\n" + "of sludge. May also poison."), + .effect = EFFECT_HIT, + .power = 95, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 10, + }), + }, + + [MOVE_QUIVER_DANCE] = + { + .name = COMPOUND_STRING("Quiver Dance"), + .description = COMPOUND_STRING( + "Dances to raise Sp. Atk\n" + "Sp. Def and Speed."), + .effect = EFFECT_QUIVER_DANCE, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .danceMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HEAVY_SLAM] = + { + .name = COMPOUND_STRING("Heavy Slam"), + .description = sHeavySlamDescription, + .effect = EFFECT_HEAT_CRASH, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS >= GEN_7, + .skyBattleBanned = TRUE, + }, + + [MOVE_SYNCHRONOISE] = + { + .name = COMPOUND_STRING("Synchronoise"), + .description = COMPOUND_STRING( + "An odd shock wave that only\n" + "damages same-type foes."), + .effect = EFFECT_SYNCHRONOISE, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 120 : 70, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 10 : 15, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_ELECTRO_BALL] = + { + .name = COMPOUND_STRING("Electro Ball"), + .description = COMPOUND_STRING( + "Hurls an orb that does more\n" + "damage to slower foes."), + .effect = EFFECT_ELECTRO_BALL, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + }, + + [MOVE_SOAK] = + { + .name = COMPOUND_STRING("Soak"), + .description = COMPOUND_STRING( + "Sprays water at the foe\n" + "making it Water-type."), + .effect = EFFECT_SOAK, + .power = 0, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_FLAME_CHARGE] = + { + .name = COMPOUND_STRING("Flame Charge"), + .description = COMPOUND_STRING( + "Attacks in a cloak of\n" + "flames. Raises Speed."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_COIL] = + { + .name = COMPOUND_STRING("Coil"), + .description = COMPOUND_STRING( + "Coils up to raise Attack\n" + "Defense and Accuracy."), + .effect = EFFECT_COIL, + .power = 0, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_LOW_SWEEP] = + { + .name = COMPOUND_STRING("Low Sweep"), + .description = COMPOUND_STRING( + "Attacks the foe's legs\n" + "lowering its Speed."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 65 : 60, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_ACID_SPRAY] = + { + .name = COMPOUND_STRING("Acid Spray"), + .description = COMPOUND_STRING( + "Sprays a hide-melting acid.\n" + "Sharply reduces Sp. Def."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_2, + .chance = 100, + }), + }, + + [MOVE_FOUL_PLAY] = + { + .name = COMPOUND_STRING("Foul Play"), + .description = COMPOUND_STRING( + "The higher the foe's Attack\n" + "the more damage caused."), + .effect = EFFECT_FOUL_PLAY, + .power = 95, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SIMPLE_BEAM] = + { + .name = COMPOUND_STRING("Simple Beam"), + .description = COMPOUND_STRING( + "A beam that changes the\n" + "foe's ability to Simple."), + .effect = EFFECT_SIMPLE_BEAM, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_ENTRAINMENT] = + { + .name = COMPOUND_STRING("Entrainment"), + .description = COMPOUND_STRING( + "Makes the foe mimic the\n" + "user, gaining its ability."), + .effect = EFFECT_ENTRAINMENT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_AFTER_YOU] = + { + .name = COMPOUND_STRING("After You"), + .description = COMPOUND_STRING( + "Helps out the foe, letting\n" + "it move next."), + .effect = EFFECT_AFTER_YOU, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_ROUND] = + { + .name = COMPOUND_STRING("Round"), + .description = COMPOUND_STRING( + "A song that inflicts damage.\n" + "Others can join in too."), + .effect = EFFECT_ROUND, + .power = 60, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ROUND, + }), + }, + + [MOVE_ECHOED_VOICE] = + { + .name = COMPOUND_STRING("Echoed Voice"), + .description = COMPOUND_STRING( + "Does more damage every turn\n" + "it is used."), + .effect = EFFECT_ECHOED_VOICE, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + }, + + [MOVE_CHIP_AWAY] = + { + .name = COMPOUND_STRING("Chip Away"), + .description = sChipAwayDescription, + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresTargetDefenseEvasionStages = TRUE, + }, + + [MOVE_CLEAR_SMOG] = + { + .name = COMPOUND_STRING("Clear Smog"), + .description = COMPOUND_STRING( + "Attacks with white haze that\n" + "eliminates all stat changes."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CLEAR_SMOG, + }), + }, + + [MOVE_STORED_POWER] = + { + .name = COMPOUND_STRING("Stored Power"), + .description = COMPOUND_STRING( + "The higher the user's stats\n" + "the more damage caused."), + .effect = EFFECT_STORED_POWER, + .power = 20, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_QUICK_GUARD] = + { + .name = COMPOUND_STRING("Quick Guard"), + .description = COMPOUND_STRING( + "Evades priority attacks\n" + "for one turn."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 3, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TRUE, // Protects the whole side. + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_ALLY_SWITCH] = + { + .name = COMPOUND_STRING("Ally Switch"), + .description = COMPOUND_STRING( + "The user switches places\n" + "with its partner."), + .effect = EFFECT_ALLY_SWITCH, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = B_UPDATED_MOVE_DATA >= GEN_7 ? 2 : 1, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SCALD] = + { + .name = COMPOUND_STRING("Scald"), + .description = COMPOUND_STRING( + "Shoots boiling water at the\n" + "foe. May inflict a burn."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_SHELL_SMASH] = + { + .name = COMPOUND_STRING("Shell Smash"), + .description = COMPOUND_STRING( + "Raises offensive stats, but\n" + "lowers defensive stats."), + .effect = EFFECT_SHELL_SMASH, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HEAL_PULSE] = + { + .name = COMPOUND_STRING("Heal Pulse"), + .description = COMPOUND_STRING( + "Recovers up to half the\n" + "target's maximum HP."), + .effect = EFFECT_HEAL_PULSE, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .magicCoatAffected = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .pulseMove = TRUE, + }, + + [MOVE_HEX] = + { + .name = COMPOUND_STRING("Hex"), + .description = COMPOUND_STRING( + "Does double damage if the\n" + "foe has a status problem."), + .effect = EFFECT_DOUBLE_POWER_ON_ARG_STATUS, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 65 : 50, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .zMove = { .powerOverride = 160 }, + .argument = STATUS1_ANY, + }, + + [MOVE_SKY_DROP] = + { + .name = COMPOUND_STRING("Sky Drop"), + .description = COMPOUND_STRING( + "Takes the foe into the sky\n" + "then drops it the next turn."), + .effect = EFFECT_SKY_DROP, + .power = 60, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .gravityBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNTOOKTARGETHIGH, COMPRESS_BITS(STATUS3_ON_AIR)), + }, + + [MOVE_SHIFT_GEAR] = + { + .name = COMPOUND_STRING("Shift Gear"), + .description = COMPOUND_STRING( + "Rotates its gears to raise\n" + "Attack and Speed."), + .effect = EFFECT_SHIFT_GEAR, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_CIRCLE_THROW] = + { + .name = COMPOUND_STRING("Circle Throw"), + .description = sCircleThrowDescription, + .effect = EFFECT_HIT_SWITCH_TARGET, + .power = 60, + .type = TYPE_FIGHTING, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = -6, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_INCINERATE] = + { + .name = COMPOUND_STRING("Incinerate"), + .description = COMPOUND_STRING( + "Burns up Berries and Gems\n" + "preventing their use."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 30, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_INCINERATE, + }), + }, + + [MOVE_QUASH] = + { + .name = COMPOUND_STRING("Quash"), + .description = COMPOUND_STRING( + "Suppresses the foe, making\n" + "it move last."), + .effect = EFFECT_QUASH, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .metronomeBanned = TRUE, + }, + + [MOVE_ACROBATICS] = + { + .name = COMPOUND_STRING("Acrobatics"), + .description = COMPOUND_STRING( + "Does double damage if the\n" + "user has no item."), + .effect = EFFECT_ACROBATICS, + .power = 55, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_REFLECT_TYPE] = + { + .name = COMPOUND_STRING("Reflect Type"), + .description = COMPOUND_STRING( + "The user reflects the foe's\n" + "type, copying it."), + .effect = EFFECT_REFLECT_TYPE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_RETALIATE] = + { + .name = COMPOUND_STRING("Retaliate"), + .description = COMPOUND_STRING( + "An attack that does more\n" + "damage if an ally fainted."), + .effect = EFFECT_RETALIATE, + .power = 70, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_FINAL_GAMBIT] = + { + .name = COMPOUND_STRING("Final Gambit"), + .description = COMPOUND_STRING( + "The user faints to damage\n" + "the foe equal to its HP."), + .effect = EFFECT_FINAL_GAMBIT, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = TRUE, + .parentalBondBanned = TRUE, + }, + + [MOVE_BESTOW] = + { + .name = COMPOUND_STRING("Bestow"), + .description = COMPOUND_STRING( + "The user gives its held\n" + "item to the foe."), + .effect = EFFECT_BESTOW, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_2 }, + .ignoresProtect = B_UPDATED_MOVE_FLAGS >= GEN_6, + .ignoresSubstitute = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_INFERNO] = + { + .name = COMPOUND_STRING("Inferno"), + .description = COMPOUND_STRING( + "Powerful and sure to inflict\n" + "a burn, but inaccurate."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIRE, + .accuracy = 50, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 100, + }), + }, + + [MOVE_WATER_PLEDGE] = + { + .name = COMPOUND_STRING("Water Pledge"), + .description = COMPOUND_STRING( + "Attacks with a column of\n" + "water. May make a rainbow."), + .effect = EFFECT_PLEDGE, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 80 : 50, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .skyBattleBanned = TRUE, + }, + + [MOVE_FIRE_PLEDGE] = + { + .name = COMPOUND_STRING("Fire Pledge"), + .description = COMPOUND_STRING( + "Attacks with a column of\n" + "fire. May burn the grass."), + .effect = EFFECT_PLEDGE, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 80 : 50, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .skyBattleBanned = TRUE, + }, + + [MOVE_GRASS_PLEDGE] = + { + .name = COMPOUND_STRING("Grass Pledge"), + .description = COMPOUND_STRING( + "Attacks with a column of\n" + "grass. May create a swamp."), + .effect = EFFECT_PLEDGE, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 80 : 50, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .skyBattleBanned = TRUE, + }, + + [MOVE_VOLT_SWITCH] = + { + .name = COMPOUND_STRING("Volt Switch"), + .description = sUTurnDescription, + .effect = EFFECT_HIT_ESCAPE, + .power = 70, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_STRUGGLE_BUG] = + { + .name = COMPOUND_STRING("Struggle Bug"), + .description = COMPOUND_STRING( + "Resisting, the user attacks\n" + "the foe. Lowers Sp. Atk."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 50 : 30, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_BULLDOZE] = + { + .name = COMPOUND_STRING("Bulldoze"), + .description = COMPOUND_STRING( + "Stomps down on the ground.\n" + "Lowers Speed."), + .effect = EFFECT_BULLDOZE, + .power = 60, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_FROST_BREATH] = + { + .name = COMPOUND_STRING("Frost Breath"), + .description = sStormThrowDescription, + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 60 : 40, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .alwaysCriticalHit = TRUE, + }, + + [MOVE_DRAGON_TAIL] = + { + .name = COMPOUND_STRING("Dragon Tail"), + .description = sCircleThrowDescription, + .effect = EFFECT_HIT_SWITCH_TARGET, + .power = 60, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = -6, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_WORK_UP] = + { + .name = COMPOUND_STRING("Work Up"), + .description = COMPOUND_STRING( + "The user is roused.\n" + "Ups Attack and Sp. Atk."), + .effect = EFFECT_ATTACK_SPATK_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ELECTROWEB] = + { + .name = COMPOUND_STRING("Electroweb"), + .description = COMPOUND_STRING( + "Snares the foe with an\n" + "electric net. Lowers Speed."), + .effect = EFFECT_HIT, + .power = 55, + .type = TYPE_ELECTRIC, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_WILD_CHARGE] = + { + .name = COMPOUND_STRING("Wild Charge"), + .description = COMPOUND_STRING( + "An electrical tackle that\n" + "also hurts the user."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .recoil = 25, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_DRILL_RUN] = + { + .name = COMPOUND_STRING("Drill Run"), + .description = COMPOUND_STRING( + "Spins its body like a drill.\n" + "High critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_GROUND, + .accuracy = 95, + .criticalHitStage = 1, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_DUAL_CHOP] = + { + .name = COMPOUND_STRING("Dual Chop"), + .description = COMPOUND_STRING( + "Attacks with brutal hits\n" + "that strike twice."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 2, + }, + + [MOVE_HEART_STAMP] = + { + .name = COMPOUND_STRING("Heart Stamp"), + .description = COMPOUND_STRING( + "A sudden blow after a cute\n" + "act. May cause flinching."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_HORN_LEECH] = + { + .name = COMPOUND_STRING("Horn Leech"), + .description = sMegaDrainDescription, + .effect = EFFECT_ABSORB, + .power = 75, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_SACRED_SWORD] = + { + .name = COMPOUND_STRING("Sacred Sword"), + .description = sChipAwayDescription, + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 15 : 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresTargetDefenseEvasionStages = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_RAZOR_SHELL] = + { + .name = COMPOUND_STRING("Razor Shell"), + .description = COMPOUND_STRING( + "Tears at the foe with sharp\n" + "shells. May lower Defense."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_WATER, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_HEAT_CRASH] = + { + .name = COMPOUND_STRING("Heat Crash"), + .description = sHeavySlamDescription, + .effect = EFFECT_HEAT_CRASH, + .power = 1, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS >= GEN_6, + }, + + [MOVE_LEAF_TORNADO] = + { + .name = COMPOUND_STRING("Leaf Tornado"), + .description = COMPOUND_STRING( + "Circles the foe with leaves\n" + "to damage and cut accuracy."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_GRASS, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + //.windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 50, + }), + }, + + [MOVE_STEAMROLLER] = + { + .name = COMPOUND_STRING("Steamroller"), + .description = COMPOUND_STRING( + "Crushes the foe with its\n" + "body. May cause flinching."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .minimizeDoubleDamage = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_COTTON_GUARD] = + { + .name = COMPOUND_STRING("Cotton Guard"), + .description = COMPOUND_STRING( + "Wraps its body in cotton.\n" + "Drastically raises Defense."), + .effect = EFFECT_DEFENSE_UP_3, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_NIGHT_DAZE] = + { + .name = COMPOUND_STRING("Night Daze"), + .description = COMPOUND_STRING( + "Looses a pitch-black shock\n" + "wave. May lower accuracy."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_DARK, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ACC_MINUS_1, + .chance = 40, + }), + }, + + [MOVE_PSYSTRIKE] = + { + .name = COMPOUND_STRING("Psystrike"), + .description = sPsyshockDescription, + .effect = EFFECT_PSYSHOCK, + .power = 100, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_TAIL_SLAP] = + { + .name = COMPOUND_STRING("Tail Slap"), + .description = COMPOUND_STRING( + "Strikes the foe with its\n" + "tail 2 to 5 times."), + .effect = EFFECT_MULTI_HIT, + .power = 25, + .type = TYPE_NORMAL, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_HURRICANE] = + { + .name = COMPOUND_STRING("Hurricane"), + .description = COMPOUND_STRING( + "Traps the foe in a fierce\n" + "wind. May cause confusion."), + .effect = EFFECT_THUNDER, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 110 : 120, + .type = TYPE_FLYING, + .accuracy = 70, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .damagesAirborne = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 30, + }), + }, + + [MOVE_HEAD_CHARGE] = + { + .name = COMPOUND_STRING("Head Charge"), + .description = COMPOUND_STRING( + "A charge using guard hair.\n" + "It hurts the user a little."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_NORMAL, + .accuracy = 100, + .recoil = 25, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_GEAR_GRIND] = + { + .name = COMPOUND_STRING("Gear Grind"), + .description = COMPOUND_STRING( + "Throws two steel gears\n" + "that strike twice."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_STEEL, + .accuracy = 85, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .zMove = { .powerOverride = 180 }, + .makesContact = TRUE, + .strikeCount = 2, + }, + + [MOVE_SEARING_SHOT] = + { + .name = COMPOUND_STRING("Searing Shot"), + .description = sLavaPlumeDescription, + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_TECHNO_BLAST] = + { + .name = COMPOUND_STRING("Techno Blast"), + .description = COMPOUND_STRING( + "The type varies with the\n" + "kind of Drive held."), + .effect = EFFECT_CHANGE_TYPE_ON_ITEM, + .power = B_UPDATED_MOVE_DATA >= GEN_6 ? 120 : 85, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = HOLD_EFFECT_DRIVE, + .metronomeBanned = TRUE, + }, + + [MOVE_RELIC_SONG] = + { + .name = COMPOUND_STRING("Relic Song"), + .description = COMPOUND_STRING( + "Attacks with an ancient\n" + "song. May induce sleep."), + .effect = EFFECT_RELIC_SONG, + .power = 75, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = STATUS1_SLEEP, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SLEEP, + .chance = 10, + }), + }, + + [MOVE_SECRET_SWORD] = + { + .name = COMPOUND_STRING("Secret Sword"), + .description = COMPOUND_STRING( + "Cuts with a long horn that\n" + "does physical damage."), + .effect = EFFECT_PSYSHOCK, + .power = 85, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .slicingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_GLACIATE] = + { + .name = COMPOUND_STRING("Glaciate"), + .description = COMPOUND_STRING( + "Blows very cold air at the\n" + "foe. It lowers their Speed."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_ICE, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_BOLT_STRIKE] = + { + .name = COMPOUND_STRING("Bolt Strike"), + .description = COMPOUND_STRING( + "Strikes with a great amount\n" + "of lightning. May paralyze."), + .effect = EFFECT_HIT, + .power = 130, + .type = TYPE_ELECTRIC, + .accuracy = 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 20, + }), + }, + + [MOVE_BLUE_FLARE] = + { + .name = COMPOUND_STRING("Blue Flare"), + .description = COMPOUND_STRING( + "Engulfs the foe in a blue\n" + "flame. May inflict a burn."), + .effect = EFFECT_HIT, + .power = 130, + .type = TYPE_FIRE, + .accuracy = 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 20, + }), + }, + + [MOVE_FIERY_DANCE] = + { + .name = COMPOUND_STRING("Fiery Dance"), + .description = COMPOUND_STRING( + "Dances cloaked in flames.\n" + "May raise Sp. Atk."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .danceMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, + .self = TRUE, + .chance = 50, + }), + }, + + [MOVE_FREEZE_SHOCK] = + { + .name = COMPOUND_STRING("Freeze Shock"), + .description = COMPOUND_STRING( + "A powerful 2-turn move that\n" + "may paralyze the foe."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = 140, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_CLOAKEDINAFREEZINGLIGHT), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_ICE_BURN] = + { + .name = COMPOUND_STRING("Ice Burn"), + .description = COMPOUND_STRING( + "A powerful 2-turn move that\n" + "may inflict a burn."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = 140, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_CLOAKEDINAFREEZINGLIGHT), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_SNARL] = + { + .name = COMPOUND_STRING("Snarl"), + .description = COMPOUND_STRING( + "Yells and rants at the foe\n" + "lowering its Sp. Atk."), + .effect = EFFECT_HIT, + .power = 55, + .type = TYPE_DARK, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_ICICLE_CRASH] = + { + .name = COMPOUND_STRING("Icicle Crash"), + .description = COMPOUND_STRING( + "Drops large icicles on the\n" + "foe. May cause flinching."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_V_CREATE] = + { + .name = COMPOUND_STRING("V-create"), + .description = COMPOUND_STRING( + "Very powerful, but lowers\n" + "Defense, Sp. Def and Speed."), + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_FIRE, + .accuracy = 95, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .zMove = { .powerOverride = 220 }, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_V_CREATE, + .self = TRUE, + }), + }, + + [MOVE_FUSION_FLARE] = + { + .name = COMPOUND_STRING("Fusion Flare"), + .description = COMPOUND_STRING( + "Summons a fireball. Works\n" + "well with a thunderbolt."), + .effect = EFFECT_FUSION_COMBO, + .power = 100, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + }, + + [MOVE_FUSION_BOLT] = + { + .name = COMPOUND_STRING("Fusion Bolt"), + .description = COMPOUND_STRING( + "Summons a thunderbolt.\n" + "Works well with a fireball."), + .effect = EFFECT_FUSION_COMBO, + .power = 100, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_FLYING_PRESS] = + { + .name = COMPOUND_STRING("Flying Press"), + .description = COMPOUND_STRING( + "This attack does Fighting\n" + "and Flying-type damage."), + .effect = EFFECT_TWO_TYPED_MOVE, + .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 100 : 80, + .type = TYPE_FIGHTING, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .zMove = { .powerOverride = 170 }, + .argument = TYPE_FLYING, + .makesContact = TRUE, + .minimizeDoubleDamage = TRUE, + .gravityBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_MAT_BLOCK] = + { + .name = COMPOUND_STRING("Mat Block"), + .description = COMPOUND_STRING( + "Evades damaging moves\n" + "for one turn."), + .effect = EFFECT_MAT_BLOCK, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TRUE, // Protects the whole side. + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_BELCH] = + { + .name = COMPOUND_STRING("Belch"), + .description = COMPOUND_STRING( + "Lets out a loud belch.\n" + "Must eat a Berry to use it."), + .effect = EFFECT_BELCH, + .power = 120, + .type = TYPE_POISON, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + .mimicBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_ROTOTILLER] = + { + .name = COMPOUND_STRING("Rototiller"), + .description = COMPOUND_STRING( + "Ups the Attack and Sp. Atk\n" + "of Grass-type Pokémon."), + .effect = EFFECT_ROTOTILLER, + .power = 0, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_STICKY_WEB] = + { + .name = COMPOUND_STRING("Sticky Web"), + .description = COMPOUND_STRING( + "Weaves a sticky net that\n" + "slows foes switching in."), + .effect = EFFECT_STICKY_WEB, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_OPPONENTS_FIELD, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .magicCoatAffected = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_FELL_STINGER] = + { + .name = COMPOUND_STRING("Fell Stinger"), + .description = COMPOUND_STRING( + "If it knocks out a foe\n" + "the Attack stat is raised."), + .effect = EFFECT_FELL_STINGER, + .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 50 : 30, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 25, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_PHANTOM_FORCE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PhantomForce", "Phantom Force"), + .description = sShadowForceDescription, + .effect = EFFECT_SEMI_INVULNERABLE, + .power = 90, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresProtect = TRUE, + .makesContact = TRUE, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS == GEN_6, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_VANISHEDINSTANTLY, COMPRESS_BITS(STATUS3_PHANTOM_FORCE)), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FEINT, + }), + }, + + [MOVE_TRICK_OR_TREAT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("TrickOrTreat", "Trick-or-Treat"), + .description = COMPOUND_STRING( + "Goes trick-or-treating\n" + "making the foe Ghost-type."), + .effect = EFFECT_THIRD_TYPE, + .power = 0, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TYPE_GHOST, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_NOBLE_ROAR] = + { + .name = COMPOUND_STRING("Noble Roar"), + .description = COMPOUND_STRING( + "Intimidates the foe, to cut\n" + "Attack and Sp. Atk."), + .effect = EFFECT_NOBLE_ROAR, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .magicCoatAffected = TRUE, + .soundMove = TRUE, + }, + + [MOVE_ION_DELUGE] = + { + .name = COMPOUND_STRING("Ion Deluge"), + .description = COMPOUND_STRING( + "Electrifies Normal-type\n" + "moves with charged atoms."), + .effect = EFFECT_ION_DELUGE, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 25, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 1, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_PARABOLIC_CHARGE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ParabolcChrg", "Parabolic Charge"), + .description = COMPOUND_STRING( + "Damages adjacent Pokémon and\n" + "heals up by half of it."), + .effect = EFFECT_ABSORB, + .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 65 : 50, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_FORESTS_CURSE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("Forest'sCurs", "Forest's Curse"), + .description = COMPOUND_STRING( + "Puts a curse on the foe\n" + "making the foe Grass-type."), + .effect = EFFECT_THIRD_TYPE, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TYPE_GRASS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_PETAL_BLIZZARD] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PetalBlizzrd", "Petal Blizzard"), + .description = COMPOUND_STRING( + "Stirs up a violent storm\n" + "of petals to attack."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .windMove = TRUE, + }, + + [MOVE_FREEZE_DRY] = + { + .name = COMPOUND_STRING("Freeze-Dry"), + .description = COMPOUND_STRING( + "Super effective on Water-\n" + #if B_USE_FROSTBITE == TRUE + "types. May cause frostbite."), + #else + "types. May cause freezing."), + #endif + .effect = EFFECT_FREEZE_DRY, + .power = 70, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }), + }, + + [MOVE_DISARMING_VOICE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DisrmngVoice", "Disarming Voice"), + .description = COMPOUND_STRING( + "Lets out a charming cry\n" + "that cannot be evaded."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + }, + + [MOVE_PARTING_SHOT] = + { + .name = COMPOUND_STRING("Parting Shot"), + .description = COMPOUND_STRING( + "Lowers the foe's Attack and\n" + "Sp. Atk, then switches out."), + .effect = EFFECT_PARTING_SHOT, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESTORE_REPLACEMENT_HP }, + .magicCoatAffected = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + }, + + [MOVE_TOPSY_TURVY] = + { + .name = COMPOUND_STRING("Topsy-Turvy"), + .description = COMPOUND_STRING( + "Swaps all stat changes that\n" + "affect the target."), + .effect = EFFECT_TOPSY_TURVY, + .power = 0, + .type = TYPE_DARK, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_7 ? 0 : 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_DRAINING_KISS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DrainingKiss", "Draining Kiss"), + .description = sDrainingKissDescription, + .effect = EFFECT_ABSORB, + .power = 50, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = 75, // restores 75% HP instead of 50% HP + .makesContact = TRUE, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_CRAFTY_SHIELD] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("CraftyShield", "Crafty Shield"), + .description = COMPOUND_STRING( + "Evades status moves for\n" + "one turn."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 3, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TRUE, // Protects the whole side. + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_FLOWER_SHIELD] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FlowerShield", "Flower Shield"), + .description = COMPOUND_STRING( + "Raises the Defense of\n" + "Grass-type Pokémon."), + .effect = EFFECT_FLOWER_SHIELD, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_GRASSY_TERRAIN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("GrssyTerrain", "Grassy Terrain"), + .description = COMPOUND_STRING( + "The ground turns to grass\n" + "for 5 turns. Restores HP."), + .effect = EFFECT_GRASSY_TERRAIN, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_MISTY_TERRAIN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MistyTerrain", "Misty Terrain"), + .description = COMPOUND_STRING( + "Covers the ground with mist\n" + "for 5 turns. Blocks status."), + .effect = EFFECT_MISTY_TERRAIN, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_ELECTRIFY] = + { + .name = COMPOUND_STRING("Electrify"), + .description = COMPOUND_STRING( + "Electrifies the foe, making\n" + "its next move Electric-type."), + .effect = EFFECT_ELECTRIFY, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + }, + + [MOVE_PLAY_ROUGH] = + { + .name = COMPOUND_STRING("Play Rough"), + .description = COMPOUND_STRING( + "Plays rough with the foe.\n" + "May lower Attack."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_FAIRY, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 10, + }), + }, + + [MOVE_FAIRY_WIND] = + { + .name = COMPOUND_STRING("Fairy Wind"), + .description = COMPOUND_STRING( + "Stirs up a fairy wind to\n" + "strike the foe."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + }, + + [MOVE_MOONBLAST] = + { + .name = COMPOUND_STRING("Moonblast"), + .description = COMPOUND_STRING( + "Attacks with the power of\n" + "the moon. May lower Sp. Atk."), + .effect = EFFECT_HIT, + .power = 95, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_BOOMBURST] = + { + .name = COMPOUND_STRING("Boomburst"), + .description = COMPOUND_STRING( + "Attacks everything with a\n" + "destructive sound wave."), + .effect = EFFECT_HIT, + .power = 140, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + }, + + [MOVE_FAIRY_LOCK] = + { + .name = COMPOUND_STRING("Fairy Lock"), + .description = COMPOUND_STRING( + "Locks down the battlefield\n" + "preventing escape next turn."), + .effect = EFFECT_FAIRY_LOCK, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + }, + + [MOVE_KINGS_SHIELD] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("King'sShield", "King's Shield"), + .description = COMPOUND_STRING( + "Evades damage, and sharply\n" + "reduces Attack if struck."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_PLAY_NICE] = + { + .name = COMPOUND_STRING("Play Nice"), + .description = COMPOUND_STRING( + "Befriend the foe, lowering\n" + "its Attack without fail."), + .effect = EFFECT_ATTACK_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .magicCoatAffected = TRUE, + }, + + [MOVE_CONFIDE] = + { + .name = COMPOUND_STRING("Confide"), + .description = COMPOUND_STRING( + "Shares a secret with the\n" + "foe, lowering Sp. Atk."), + .effect = EFFECT_SPECIAL_ATTACK_DOWN, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .ignoresProtect = TRUE, + .magicCoatAffected = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + }, + + [MOVE_DIAMOND_STORM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DiamondStorm", "Diamond Storm"), + .description = COMPOUND_STRING( + "Whips up a storm of\n" + "diamonds. May up Defense."), + .power = 100, + .type = TYPE_ROCK, + .accuracy = 95, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = B_UPDATED_MOVE_DATA >= GEN_7 ? MOVE_EFFECT_DEF_PLUS_2: MOVE_EFFECT_DEF_PLUS_1, + .chance = 50, + }), + }, + + [MOVE_STEAM_ERUPTION] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SteamErption", "Steam Eruption"), + .description = COMPOUND_STRING( + "Immerses the foe in heated\n" + "steam. May inflict a burn."), + .effect = EFFECT_HIT, + .power = 110, + .type = TYPE_WATER, + .accuracy = 95, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_HYPERSPACE_HOLE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("HyprspceHole", "Hyprspace Hole"), + .description = sHyperspaceHoleDescription, + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FEINT, + }), + }, + + [MOVE_WATER_SHURIKEN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("WatrShuriken", "Water Shuriken"), + .description = COMPOUND_STRING( + "Throws 2 to 5 stars that\n" + "are sure to strike first."), + .effect = EFFECT_MULTI_HIT, + .power = 15, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = B_UPDATED_MOVE_DATA >= GEN_7 ? DAMAGE_CATEGORY_SPECIAL : DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_MYSTICAL_FIRE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MysticalFire", "Mystical Fire"), + .description = COMPOUND_STRING( + "Breathes a special, hot\n" + "fire. Lowers Sp. Atk."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 75 : 65, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_SPIKY_SHIELD] = + { + .name = COMPOUND_STRING("Spiky Shield"), + .description = COMPOUND_STRING( + "Evades attack, and damages\n" + "the foe if struck."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_AROMATIC_MIST] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("AromaticMist", "Aromatic Mist"), + .description = COMPOUND_STRING( + "Raises the Sp. Def of a\n" + "partner Pokémon."), + .effect = EFFECT_AROMATIC_MIST, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_2 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_EERIE_IMPULSE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("EerieImpulse", "Eerie Impulse"), + .description = COMPOUND_STRING( + "Exposes the foe to a pulse\n" + "that sharply cuts Sp. Atk."), + .effect = EFFECT_SPECIAL_ATTACK_DOWN_2, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_VENOM_DRENCH] = + { + .name = COMPOUND_STRING("Venom Drench"), + .description = COMPOUND_STRING( + "Lowers the Attack, Sp. Atk\n" + "and Speed of a poisoned foe."), + .effect = EFFECT_VENOM_DRENCH, + .power = 0, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_POWDER] = + { + .name = COMPOUND_STRING("Powder"), + .description = COMPOUND_STRING( + "Damages the foe if it uses\n" + "a Fire-type move."), + .effect = EFFECT_POWDER, + .power = 0, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_2 }, + .powderMove = TRUE, + .magicCoatAffected = TRUE, + }, + + [MOVE_GEOMANCY] = + { + .name = COMPOUND_STRING("Geomancy"), + .description = COMPOUND_STRING( + "Raises Sp. Atk, Sp. Def and\n" + "Speed on the 2nd turn."), + .effect = EFFECT_GEOMANCY, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .skyBattleBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKNMABSORBINGPOWER), + }, + + [MOVE_MAGNETIC_FLUX] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MagneticFlux", "Magnetic Flux"), + .description = COMPOUND_STRING( + "Boosts the defenses of\n" + "those with Plus or Minus."), + .effect = EFFECT_MAGNETIC_FLUX, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HAPPY_HOUR] = + { + .name = COMPOUND_STRING("Happy Hour"), + .description = COMPOUND_STRING( + "Doubles the amount of\n" + "Prize Money received."), + .effect = EFFECT_DO_NOTHING, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_ELECTRIC_TERRAIN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ElctrcTrrain", "Electric Terrain"), + .description = COMPOUND_STRING( + "Electrifies the ground for\n" + "5 turns. Prevents sleep."), + .effect = EFFECT_ELECTRIC_TERRAIN, + .power = 0, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .skyBattleBanned = TRUE, + }, + + [MOVE_DAZZLING_GLEAM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DazzlngGleam", "Dazzling Gleam"), + .description = COMPOUND_STRING( + "Damages foes by emitting\n" + "a bright flash."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_CELEBRATE] = + { + .name = COMPOUND_STRING("Celebrate"), + .description = COMPOUND_STRING( + "Congratulates you on your\n" + "special day."), + .effect = EFFECT_DO_NOTHING, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .mimicBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_HOLD_HANDS] = + { + .name = COMPOUND_STRING("Hold Hands"), + .description = COMPOUND_STRING( + "The user and ally hold hands\n" + "making them happy."), + .effect = EFFECT_DO_NOTHING, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 40, + .target = MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .metronomeBanned = TRUE, + .mimicBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_BABY_DOLL_EYES] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BabyDollEyes", "Baby-Doll Eyes"), + .description = COMPOUND_STRING( + "Lowers the foe's Attack\n" + "before it can move."), + .effect = EFFECT_ATTACK_DOWN, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_NUZZLE] = + { + .name = COMPOUND_STRING("Nuzzle"), + .description = COMPOUND_STRING( + "Rubs its cheecks against\n" + "the foe, paralyzing it."), + .effect = EFFECT_HIT, + .power = 20, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 100, + }), + }, + + [MOVE_HOLD_BACK] = + { + .name = COMPOUND_STRING("Hold Back"), + .description = sFalseSwipeDescription, + .effect = EFFECT_FALSE_SWIPE, + .power = 40, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_INFESTATION] = + { + .name = COMPOUND_STRING("Infestation"), + .description = COMPOUND_STRING( + "The foe is infested and\n" + "attacked for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = 20, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_POWER_UP_PUNCH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PowerUpPunch", "Power-Up Punch"), + .description = COMPOUND_STRING( + "A hard punch that raises\n" + "the user's Attack."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_OBLIVION_WING] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("OblivionWing", "Oblivion Wing"), + .description = sDrainingKissDescription, + .effect = EFFECT_ABSORB, + .power = 80, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = 75, // restores 75% HP instead of 50% HP + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_THOUSAND_ARROWS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ThousndArrws", "Thousand Arrows"), + .description = COMPOUND_STRING( + "Can hit Flying foes, then\n" + "knocks them to the ground."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .damagesAirborne = TRUE, + .ignoreTypeIfFlyingAndUngrounded = TRUE, + .metronomeBanned = TRUE, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SMACK_DOWN, + }), + }, + + [MOVE_THOUSAND_WAVES] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ThousndWaves", "Thousand Waves"), + .description = COMPOUND_STRING( + "Those hit by the wave can\n" + "no longer escape."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .skyBattleBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PREVENT_ESCAPE, + }), + }, + + [MOVE_LANDS_WRATH] = + { + .name = COMPOUND_STRING("Land's Wrath"), + .description = COMPOUND_STRING( + "Gathers the energy of the\n" + "land to attack every foe."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .skyBattleBanned = TRUE, + }, + + [MOVE_LIGHT_OF_RUIN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("LightOfRuin", "Light Of Ruin"), + .description = COMPOUND_STRING( + "Fires a great beam of light\n" + "that also hurts the user."), + .effect = EFFECT_HIT, + .power = 140, + .type = TYPE_FAIRY, + .accuracy = 90, + .recoil = 50, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + }, + + [MOVE_ORIGIN_PULSE] = + { + .name = COMPOUND_STRING("Origin Pulse"), + .description = COMPOUND_STRING( + "Beams of glowing blue light\n" + "blast both foes."), + .effect = EFFECT_HIT, + .power = 110, + .type = TYPE_WATER, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .pulseMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_PRECIPICE_BLADES] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PrcipceBldes", "Precipice Blades"), + .description = COMPOUND_STRING( + "Fearsome blades of stone\n" + "attack both foes."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_GROUND, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + }, + + [MOVE_DRAGON_ASCENT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DragonAscent", "Dragon Ascent"), + .description = sCloseCombatDescription, + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_SPDEF_DOWN, + .self = TRUE, + }), + }, + + [MOVE_HYPERSPACE_FURY] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("HyprspceFury", "Hyperspace Fury"), + .description = sHyperspaceHoleDescription, + .effect = EFFECT_HYPERSPACE_FURY, + .power = 100, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .metronomeBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + .additionalEffects = ADDITIONAL_EFFECTS({ + // Feint move effect handled in script as it goes before animation + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .self = TRUE, + }), + }, + + [MOVE_SHORE_UP] = + { + .name = COMPOUND_STRING("Shore Up"), + .description = COMPOUND_STRING( + "Restores the user's HP.\n" + "More HP in a sandstorm."), + .effect = EFFECT_SHORE_UP, + .power = 0, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 5 : 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .healingMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_FIRST_IMPRESSION] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FrstImpressn", "First Impression"), + .description = COMPOUND_STRING( + "Hits hard and first.\n" + "Only works first turn."), + .effect = EFFECT_FIRST_TURN_ONLY, + .power = 90, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 2, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MOVE_FIRST_IMPRESSION, + .makesContact = TRUE, + }, + + [MOVE_BANEFUL_BUNKER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BanefulBunkr", "Baneful Bunker"), + .description = COMPOUND_STRING( + "Protects user and poisons\n" + "foes on contact."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_SPIRIT_SHACKLE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SpiritShackl", "Spirit Shackle"), + .description = COMPOUND_STRING( + "After being hit, foes can\n" + "no longer escape."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PREVENT_ESCAPE, + .chance = 100, + }), + }, + + [MOVE_DARKEST_LARIAT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DarkstLariat", "Darkest Lariat"), + .description = COMPOUND_STRING( + "Swings the arms to strike\n" + "It ignores stat changes."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresTargetDefenseEvasionStages = TRUE, + }, + + [MOVE_SPARKLING_ARIA] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SparklngAria", "Sparkling Aria"), + .description = COMPOUND_STRING( + "Sings with bubbles. Cures\n" + "burns on contact."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = STATUS1_BURN, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_REMOVE_STATUS, + .chance = 100, + }), + }, + + [MOVE_ICE_HAMMER] = + { + .name = COMPOUND_STRING("Ice Hammer"), + .description = COMPOUND_STRING( + "Swings the fist to strike.\n" + "Lowers the user's Speed."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .self = TRUE, + }), + }, + + [MOVE_FLORAL_HEALING] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FloralHealng", "Floral Healng"), + .description = COMPOUND_STRING( + "Restores an ally's HP.\n" + "Heals more on grass."), + .effect = EFFECT_HEAL_PULSE, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .argument = MOVE_EFFECT_FLORAL_HEALING, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .magicCoatAffected = TRUE, + }, + + [MOVE_HIGH_HORSEPOWER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("HighHorsepwr", "High Horsepower"), + .description = COMPOUND_STRING( + "Slams hard into the foe with\n" + "its entire body."), + .effect = EFFECT_HIT, + .power = 95, + .type = TYPE_GROUND, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_STRENGTH_SAP] = + { + .name = COMPOUND_STRING("Strength Sap"), + .description = COMPOUND_STRING( + "Saps the foe's Attack to\n" + "heal HP, then drops Attack."), + .effect = EFFECT_STRENGTH_SAP, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .magicCoatAffected = TRUE, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_SOLAR_BLADE] = + { + .name = COMPOUND_STRING("Solar Blade"), + .description = COMPOUND_STRING( + "Charges first turn, then\n" + "chops with a blade of light."), + .effect = EFFECT_SOLAR_BEAM, + .power = 125, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_PKMNTOOKSUNLIGHT, B_WEATHER_SUN), + }, + + [MOVE_LEAFAGE] = + { + .name = COMPOUND_STRING("Leafage"), + .description = COMPOUND_STRING( + "Attacks with a flurry of\n" + "small leaves."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_SPOTLIGHT] = + { + .name = COMPOUND_STRING("Spotlight"), + .description = COMPOUND_STRING( + "Makes the foe attack the\n" + "spotlighted Pokémon."), + .effect = EFFECT_FOLLOW_ME, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 3, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPDEF_UP_1 }, + .magicCoatAffected = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_TOXIC_THREAD] = + { + .name = COMPOUND_STRING("Toxic Thread"), + .description = COMPOUND_STRING( + "Attacks with a thread that\n" + "poisons and drops Speed."), + .effect = EFFECT_TOXIC_THREAD, + .power = 0, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .magicCoatAffected = TRUE, + }, + + [MOVE_LASER_FOCUS] = + { + .name = COMPOUND_STRING("Laser Focus"), + .description = COMPOUND_STRING( + "Guarantees the next move\n" + "will be a critical hit."), + .effect = EFFECT_LASER_FOCUS, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 30, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_GEAR_UP] = + { + .name = COMPOUND_STRING("Gear Up"), + .description = COMPOUND_STRING( + "Boosts the attacks of\n" + "those with Plus or Minus."), + .effect = EFFECT_GEAR_UP, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_THROAT_CHOP] = + { + .name = COMPOUND_STRING("Throat Chop"), + .description = COMPOUND_STRING( + "Chops the throat to disable\n" + "sound moves for a while."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_THROAT_CHOP, + .chance = 100, + }), + }, + + [MOVE_POLLEN_PUFF] = + { + .name = COMPOUND_STRING("Pollen Puff"), + .description = COMPOUND_STRING( + "Explodes on foes, but\n" + "restores ally's HP."), + .effect = EFFECT_HIT_ENEMY_HEAL_ALLY, + .power = 90, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + }, + + [MOVE_ANCHOR_SHOT] = + { + .name = COMPOUND_STRING("Anchor Shot"), + .description = COMPOUND_STRING( + "Strangles the foe with a\n" + "chain. The foe can't escape."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PREVENT_ESCAPE, + .chance = 100, + }), + }, + + [MOVE_PSYCHIC_TERRAIN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PsychcTrrain", "Psychic Terrain"), + .description = COMPOUND_STRING( + "The ground turns weird for\n" + "5 turns. Blocks priority."), + .effect = EFFECT_PSYCHIC_TERRAIN, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_LUNGE] = + { + .name = COMPOUND_STRING("Lunge"), + .description = COMPOUND_STRING( + "Lunges at the foe to lower\n" + "its Attack stat."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_FIRE_LASH] = + { + .name = COMPOUND_STRING("Fire Lash"), + .description = COMPOUND_STRING( + "Whips the foe with fire\n" + "lowering its Defense."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_POWER_TRIP] = + { + .name = COMPOUND_STRING("Power Trip"), + .description = COMPOUND_STRING( + "It hits harder the more\n" + "stat boosts the user has."), + .effect = EFFECT_STORED_POWER, + .power = 20, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_BURN_UP] = + { + .name = COMPOUND_STRING("Burn Up"), + .description = COMPOUND_STRING( + "Burns out the user fully\n" + "removing the Fire type."), + .effect = EFFECT_FAIL_IF_NOT_ARG_TYPE, + .power = 130, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + .argument = TYPE_FIRE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_REMOVE_ARG_TYPE, + .self = TRUE, + }), + }, + + [MOVE_SPEED_SWAP] = + { + .name = COMPOUND_STRING("Speed Swap"), + .description = COMPOUND_STRING( + "Swaps user's Speed with\n" + "the target's."), + .effect = EFFECT_SPEED_SWAP, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresSubstitute = TRUE, + }, + + [MOVE_SMART_STRIKE] = + { + .name = COMPOUND_STRING("Smart Strike"), + .description = COMPOUND_STRING( + "Hits with an accurate\n" + "horn that never misses."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_PURIFY] = + { + .name = COMPOUND_STRING("Purify"), + .description = COMPOUND_STRING( + "Cures the foe's status\n" + "to restore HP."), + .effect = EFFECT_PURIFY, + .power = 0, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_ALL_STATS_UP_1 }, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .magicCoatAffected = TRUE, + }, + + [MOVE_REVELATION_DANCE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("RvlationDnce", "Revelation Dance"), + .description = COMPOUND_STRING( + "Dances with mystical power.\n" + "Matches user's first type."), + .effect = EFFECT_REVELATION_DANCE, + .power = 90, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .danceMove = TRUE, + }, + + [MOVE_CORE_ENFORCER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("CoreEnforcer", "Core Enforcer"), + .description = COMPOUND_STRING( + "Hits with a ray that\n" + "nullifies the foe's ability."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .zMove = { .powerOverride = 140 }, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CORE_ENFORCER, + }), + }, + + [MOVE_TROP_KICK] = + { + .name = COMPOUND_STRING("Trop Kick"), + .description = COMPOUND_STRING( + "An intense kick from the\n" + "tropics. Lowers Attack."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_INSTRUCT] = + { + .name = COMPOUND_STRING("Instruct"), + .description = COMPOUND_STRING( + "Orders the target to use\n" + "its last move again."), + .effect = EFFECT_INSTRUCT, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPATK_UP_1 }, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .instructBanned = TRUE, + }, + + [MOVE_BEAK_BLAST] = + { + .name = COMPOUND_STRING("Beak Blast"), + .description = COMPOUND_STRING( + "Heats up beak to attack.\n" + "Burns foe on contact."), + .effect = EFFECT_BEAK_BLAST, + .power = 100, + .type = TYPE_FLYING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = -3, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .ballisticMove = TRUE, + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_CLANGING_SCALES] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ClngngScales", "Clanging Scales"), + .description = COMPOUND_STRING( + "Makes a big noise with\n" + "its scales. Drops Defense."), + .effect = EFFECT_HIT, + .power = 110, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .soundMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .self = TRUE, + }), + }, + + [MOVE_DRAGON_HAMMER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DragonHammer", "Dragon Hammer"), + .description = COMPOUND_STRING( + "Swings its whole body\n" + "like a hammer to damage."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_BRUTAL_SWING] = + { + .name = COMPOUND_STRING("Brutal Swing"), + .description = COMPOUND_STRING( + "Violently swings around\n" + "to hurt everyone nearby."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_AURORA_VEIL] = + { + .name = COMPOUND_STRING("Aurora Veil"), + .description = COMPOUND_STRING( + "Weakens all attacks, but\n" + "only usable with hail."), + .effect = EFFECT_AURORA_VEIL, + .power = 0, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_SHELL_TRAP] = + { + .name = COMPOUND_STRING("Shell Trap"), + .description = COMPOUND_STRING( + "Sets a shell trap that\n" + "damages on contact."), + .effect = EFFECT_SHELL_TRAP, + .power = 150, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = -3, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_FLEUR_CANNON] = + { + .name = COMPOUND_STRING("Fleur Cannon"), + .description = COMPOUND_STRING( + "A strong ray that harshly\n" + "lowers Sp. Attack."), + .effect = EFFECT_HIT, + .power = 130, + .type = TYPE_FAIRY, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_TWO_DOWN, + .self = TRUE, + }), + }, + + [MOVE_PSYCHIC_FANGS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PsychicFangs", "Psychic Fangs"), + .description = COMPOUND_STRING( + "Chomps with psychic fangs.\n" + "Destroys any barriers."), + .effect = EFFECT_BRICK_BREAK, + .power = 85, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + }, + + [MOVE_STOMPING_TANTRUM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("StmpngTantrm", "Stomping Tantrum"), + .description = COMPOUND_STRING( + "Stomps around angrily.\n" + "Stronger after a failure."), + .effect = EFFECT_STOMPING_TANTRUM, + .power = 75, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_SHADOW_BONE] = + { + .name = COMPOUND_STRING("Shadow Bone"), + .description = COMPOUND_STRING( + "Strikes with a haunted\n" + "bone. Might drop Defense."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 20, + }), + }, + + [MOVE_ACCELEROCK] = + { + .name = COMPOUND_STRING("Accelerock"), + .description = COMPOUND_STRING( + "Hits with a high-speed\n" + "rock that always goes first."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_LIQUIDATION] = + { + .name = COMPOUND_STRING("Liquidation"), + .description = COMPOUND_STRING( + "Slams the foe with water.\n" + "Can lower Defense."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 20, + }), + }, + + [MOVE_PRISMATIC_LASER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PrsmaticLasr", "Prismatic Laser"), + .description = COMPOUND_STRING( + "A high power laser that\n" + "forces recharge next turn."), + .effect = EFFECT_HIT, + .power = 160, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_SPECTRAL_THIEF] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SpectrlThief", "Spectral Thief"), + .description = COMPOUND_STRING( + "Steals the target's stat\n" + "boosts, then attacks."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresSubstitute = TRUE, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPECTRAL_THIEF, + }), + }, + + [MOVE_SUNSTEEL_STRIKE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SnsteelStrke", "Sunsteel Strike"), + .description = COMPOUND_STRING( + "A sun-fueled strike that\n" + "ignores abilities."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresTargetAbility = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_8, + }, + + [MOVE_MOONGEIST_BEAM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MoongestBeam", "Moongeist Beam"), + .description = COMPOUND_STRING( + "A moon-powered beam that\n" + "ignores abilities."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresTargetAbility = TRUE, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_8, + }, + + [MOVE_TEARFUL_LOOK] = + { + .name = COMPOUND_STRING("Tearful Look"), + .description = COMPOUND_STRING( + "The user tears up, dropping\n" + "Attack and Sp. Attack."), + .effect = EFFECT_NOBLE_ROAR, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, + .ignoresProtect = TRUE, + .magicCoatAffected = TRUE, + }, + + [MOVE_ZING_ZAP] = + { + .name = COMPOUND_STRING("Zing Zap"), + .description = COMPOUND_STRING( + "An electrified impact that\n" + "can cause flinching."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_NATURES_MADNESS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("Natur'sMadns", "Nature's Madness"), + .description = COMPOUND_STRING( + "Halves the foe's HP with\n" + "the power of nature."), + .effect = EFFECT_SUPER_FANG, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = B_UPDATED_MOVE_FLAGS >= GEN_8, + }, + + [MOVE_MULTI_ATTACK] = + { + .name = COMPOUND_STRING("Multi-Attack"), + .description = COMPOUND_STRING( + "An attack that changes\n" + "with Memories."), + .effect = EFFECT_CHANGE_TYPE_ON_ITEM, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 120 : 90, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = HOLD_EFFECT_MEMORY, + .makesContact = TRUE, + }, + + [MOVE_MIND_BLOWN] = + { + .name = COMPOUND_STRING("Mind Blown"), + .description = COMPOUND_STRING( + "It explodes the user's head\n" + "to damage everything around."), + .effect = EFFECT_MIND_BLOWN, + .power = 150, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + }, + + [MOVE_PLASMA_FISTS] = + { + .name = COMPOUND_STRING("Plasma Fists"), + .description = COMPOUND_STRING( + "Hits with electrical fists.\n" + "Normal moves become Electric."), + .effect = EFFECT_PLASMA_FISTS, + .power = 100, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_PHOTON_GEYSER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PhotonGeyser", "Photon Geyser"), + .description = COMPOUND_STRING( + "User's highest attack stat\n" + "determines its category."), + .effect = EFFECT_PHOTON_GEYSER, + .power = 100, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresTargetAbility = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_ZIPPY_ZAP] = + { + .name = COMPOUND_STRING("Zippy Zap"), + .description = COMPOUND_STRING( + "Electric bursts always go\n" + "first and land a critical hit."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 80 : 50, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 2, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .alwaysCriticalHit = TRUE, + .metronomeBanned = TRUE, + #if B_UPDATED_MOVE_DATA >= GEN_8 + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_EVS_PLUS_1, + .chance = 100, + }), + #endif + }, + + [MOVE_SPLISHY_SPLASH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SplishySplsh", "Splishy Splash"), + .description = COMPOUND_STRING( + "A huge electrified wave that\n" + "may paralyze the foe."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_FLOATY_FALL] = + { + .name = COMPOUND_STRING("Floaty Fall"), + .description = COMPOUND_STRING( + "Floats in air and dives at\n" + "angle. May cause flinching."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_FLYING, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .gravityBanned = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_PIKA_PAPOW] = + { + .name = COMPOUND_STRING("Pika Papow"), + .description = COMPOUND_STRING( + "Pikachu's love increases its\n" + "power. It never misses."), + .effect = EFFECT_RETURN, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + }, + + [MOVE_BOUNCY_BUBBLE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BouncyBubble", "Bouncy Bubble"), + .description = COMPOUND_STRING( + "An attack that absorbs\n" + #if B_UPDATED_MOVE_DATA >= GEN_8 + "all the damage inflicted."), + #else + "half the damage inflicted."), + #endif + .effect = EFFECT_ABSORB, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 60 : 90, + .type = TYPE_WATER, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 20 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = B_UPDATED_MOVE_DATA >= GEN_8 ? 100 : 50, // restores 100% HP instead of 50% HP + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + .healingMove = B_HEAL_BLOCKING >= GEN_6, + }, + + [MOVE_BUZZY_BUZZ] = + { + .name = COMPOUND_STRING("Buzzy Buzz"), + .description = COMPOUND_STRING( + "Shoots a jolt of electricity\n" + "that always paralyzes."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 60 : 90, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 20 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 100, + }), + }, + + [MOVE_SIZZLY_SLIDE] = + { + .name = COMPOUND_STRING("Sizzly Slide"), + .description = COMPOUND_STRING( + "User cloaked in fire charges.\n" + "Leaves the foe with a burn."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 60 : 90, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 20 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .thawsUser = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 100, + }), + }, + + [MOVE_GLITZY_GLOW] = + { + .name = COMPOUND_STRING("Glitzy Glow"), + .description = COMPOUND_STRING( + "Telekinetic force that sets\n" + "wall, lowering Sp. Atk damage."), + .effect = EFFECT_GLITZY_GLOW, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 80 : 90, + .type = TYPE_PSYCHIC, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 95 : 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + }, + + [MOVE_BADDY_BAD] = + { + .name = COMPOUND_STRING("Baddy Bad"), + .description = COMPOUND_STRING( + "Acting badly, attacks. Sets\n" + "wall, lowering Attack damage."), + .effect = EFFECT_BADDY_BAD, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 80 : 90, + .type = TYPE_DARK, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 95 : 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + }, + + [MOVE_SAPPY_SEED] = + { + .name = COMPOUND_STRING("Sappy Seed"), + .description = COMPOUND_STRING( + "Giant stalk scatters seeds\n" + "that drain HP every turn."), + .effect = EFFECT_SAPPY_SEED, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 100 : 90, + .type = TYPE_GRASS, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 90 : 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .magicCoatAffected = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_FREEZY_FROST] = + { + .name = COMPOUND_STRING("Freezy Frost"), + .description = COMPOUND_STRING( + "Crystal from cold haze hits.\n" + "Eliminates all stat changes."), + .effect = EFFECT_FREEZY_FROST, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 100 : 90, + .type = TYPE_ICE, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 90 : 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + }, + + [MOVE_SPARKLY_SWIRL] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SparklySwirl", "Sparkly Swirl"), + .description = COMPOUND_STRING( + "Wrap foe with whirlwind of\n" + "scent. Heals party's status."), + .effect = EFFECT_SPARKLY_SWIRL, + .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 120 : 90, + .type = TYPE_FAIRY, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 85 : 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_8 ? 5 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + }, + + [MOVE_VEEVEE_VOLLEY] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("VeeveeVolley", "Veevee Volley"), + .description = COMPOUND_STRING( + "Eevee's love increases its\n" + "power. It never misses."), + .effect = EFFECT_RETURN, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + }, + + [MOVE_DOUBLE_IRON_BASH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DublIronBash", "Double Iron Bash"), + .description = COMPOUND_STRING( + "The user spins and hits with\n" + "its arms. May cause flinch."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .strikeCount = 2, + .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_8, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_DYNAMAX_CANNON] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DynamxCannon", "Dynamax Cannon"), + .description = COMPOUND_STRING( + "Fires a strong beam. Deals\n" + "2x damage to Dynamaxed foes."), + .effect = EFFECT_DYNAMAX_DOUBLE_DMG, + .power = 100, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .mimicBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = B_EXTRAPOLATED_MOVE_FLAGS, + .parentalBondBanned = TRUE, + }, + + [MOVE_SNIPE_SHOT] = + { + .name = COMPOUND_STRING("Snipe Shot"), + .description = COMPOUND_STRING( + "The user ignores effects\n" + "that draw in moves."), + .effect = EFFECT_SNIPE_SHOT, + .power = 80, + .type = TYPE_WATER, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_JAW_LOCK] = + { + .name = COMPOUND_STRING("Jaw Lock"), + .description = COMPOUND_STRING( + "Prevents the user and\n" + "the target from escaping."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_TRAP_BOTH, + }), + }, + + [MOVE_STUFF_CHEEKS] = + { + .name = COMPOUND_STRING("Stuff Cheeks"), + .description = COMPOUND_STRING( + "Consumes the user's Berry,\n" + "then sharply raises Def."), + .effect = EFFECT_STUFF_CHEEKS, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_NO_RETREAT] = + { + .name = COMPOUND_STRING("No Retreat"), + .description = COMPOUND_STRING( + "Raises all of the user's\n" + "stats but prevents escape."), + .effect = EFFECT_NO_RETREAT, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TAR_SHOT] = + { + .name = COMPOUND_STRING("Tar Shot"), + .description = COMPOUND_STRING( + "Lowers the foe's Speed and\n" + "makes it weak to Fire."), + .effect = EFFECT_TAR_SHOT, + .power = 0, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .magicCoatAffected = TRUE, + }, + + [MOVE_MAGIC_POWDER] = + { + .name = COMPOUND_STRING("Magic Powder"), + .description = COMPOUND_STRING( + "Magic powder changes the\n" + "target into a Psychic-type."), + .effect = EFFECT_SOAK, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .argument = TYPE_PSYCHIC, + .magicCoatAffected = TRUE, + .powderMove = TRUE, + }, + + [MOVE_DRAGON_DARTS] = + { + .name = COMPOUND_STRING("Dragon Darts"), + .description = COMPOUND_STRING( + "The user attacks twice. Two\n" + "targets are hit once each."), + .effect = EFFECT_HIT, // TODO: EFFECT_DRAGON_DARTS + .power = 50, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .strikeCount = 2, + .parentalBondBanned = TRUE, + }, + + [MOVE_TEATIME] = + { + .name = COMPOUND_STRING("Teatime"), + .description = COMPOUND_STRING( + "All Pokémon have teatime\n" + "and eat their Berries."), + .effect = EFFECT_TEATIME, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_OCTOLOCK] = + { + .name = COMPOUND_STRING("Octolock"), + .description = COMPOUND_STRING( + "Traps the foe to lower Def\n" + "and Sp. Def fall each turn."), + .effect = EFFECT_OCTOLOCK, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + }, + + [MOVE_BOLT_BEAK] = + { + .name = COMPOUND_STRING("Bolt Beak"), + .description = COMPOUND_STRING( + "Double power if the user\n" + "moves before the target."), + .effect = EFFECT_BOLT_BEAK, + .power = 85, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_FISHIOUS_REND] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FishiousRend", "Fishious Rend"), + .description = COMPOUND_STRING( + "Double power if the user\n" + "moves before the target."), + .effect = EFFECT_BOLT_BEAK, + .power = 85, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .bitingMove = TRUE, + }, + + [MOVE_COURT_CHANGE] = + { + .name = COMPOUND_STRING("Court Change"), + .description = COMPOUND_STRING( + "The user swaps effects on\n" + "either side of the field."), + .effect = EFFECT_COURT_CHANGE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + }, + + [MOVE_CLANGOROUS_SOUL] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ClngrousSoul", "Clangorous Soul"), + .description = COMPOUND_STRING( + "The user uses some of its\n" + "HP to raise all its stats."), + .effect = EFFECT_CLANGOROUS_SOUL, + .power = 0, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .soundMove = TRUE, + .danceMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_BODY_PRESS] = + { + .name = COMPOUND_STRING("Body Press"), + .description = COMPOUND_STRING( + "Does more damage the\n" + "higher the user's Def."), + .effect = EFFECT_BODY_PRESS, + .power = 80, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_DECORATE] = + { + .name = COMPOUND_STRING("Decorate"), + .description = COMPOUND_STRING( + "The user sharply raises\n" + "the target's Atk and Sp.Atk"), + .effect = EFFECT_DECORATE, + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_DRUM_BEATING] = + { + .name = COMPOUND_STRING("Drum Beating"), + .description = COMPOUND_STRING( + "Plays a drum to attack.\n" + "The foe's Speed is lowered."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_SNAP_TRAP] = + { + .name = COMPOUND_STRING("Snap Trap"), + .description = COMPOUND_STRING( + "Snares the target in a snap\n" + "trap for four to five turns."), + .effect = EFFECT_HIT, + .power = 35, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_PYRO_BALL] = + { + .name = COMPOUND_STRING("Pyro Ball"), + .description = COMPOUND_STRING( + "Launches a fiery ball at the\n" + "target. It may cause a burn."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FIRE, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .thawsUser = TRUE, + .ballisticMove = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 10, + }), + }, + + [MOVE_BEHEMOTH_BLADE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BehemthBlade", "Behemoth Blade"), + .description = COMPOUND_STRING( + "Strikes as a sword. Deals 2x\n" + "damage to Dynamaxed foes."), + .effect = EFFECT_DYNAMAX_DOUBLE_DMG, + .power = 100, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .mimicBanned = TRUE, + .assistBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_BEHEMOTH_BASH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BehemothBash", "Behemoth Bash"), + .description = COMPOUND_STRING( + "Attacks as a shield. Deals 2x\n" + "damage to Dynamaxed foes."), + .effect = EFFECT_DYNAMAX_DOUBLE_DMG, + .power = 100, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .mimicBanned = TRUE, + .assistBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_AURA_WHEEL] = + { + .name = COMPOUND_STRING("Aura Wheel"), + .description = COMPOUND_STRING( + "Raises Speed to attack. The\n" + "Type is based on its form."), + .effect = EFFECT_AURA_WHEEL, + .power = 110, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_BREAKING_SWIPE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BreakngSwipe", "Breaking Swipe"), + .description = COMPOUND_STRING( + "Swings its tail to attack.\n" + "Lowers the Atk of those hit."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_BRANCH_POKE] = + { + .name = COMPOUND_STRING("Branch Poke"), + .description = COMPOUND_STRING( + "The user pokes the target\n" + "with a pointed branch."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_OVERDRIVE] = + { + .name = COMPOUND_STRING("Overdrive"), + .description = COMPOUND_STRING( + "The user twangs its guitar,\n" + "causing strong vibrations."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .metronomeBanned = TRUE, + }, + + [MOVE_APPLE_ACID] = + { + .name = COMPOUND_STRING("Apple Acid"), + .description = COMPOUND_STRING( + "Attacks with tart apple acid\n" + "to lower the foe's Sp. Def."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_GRAV_APPLE] = + { + .name = COMPOUND_STRING("Grav Apple"), + .description = COMPOUND_STRING( + "Drops an apple from above.\n" + "Lowers the foe's Defense."), + .effect = EFFECT_GRAV_APPLE, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_SPIRIT_BREAK] = + { + .name = COMPOUND_STRING("Spirit Break"), + .description = COMPOUND_STRING( + "Attacks with spirit-breaking\n" + "force. Lowers Sp. Atk."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_STRANGE_STEAM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("StrangeSteam", "Strange Steam"), + .description = COMPOUND_STRING( + "Emits a strange steam to\n" + "potentially confuse the foe."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_FAIRY, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 20, + }), + }, + + [MOVE_LIFE_DEW] = + { + .name = COMPOUND_STRING("Life Dew"), + .description = COMPOUND_STRING( + "Scatters water to restore\n" + "the HP of itself and allies."), + .effect = EFFECT_JUNGLE_HEALING, + .power = 0, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_OBSTRUCT] = + { + .name = COMPOUND_STRING("Obstruct"), + .description = COMPOUND_STRING( + "Protects itself, harshly\n" + "lowering Def on contact."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .instructBanned = TRUE, + }, + + [MOVE_FALSE_SURRENDER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FalsSurrendr", "False Surrender"), + .description = COMPOUND_STRING( + "Bows to stab the foe\n" + "with hair. It never misses."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_METEOR_ASSAULT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MeteorAssalt", "Meteor Assault"), + .description = COMPOUND_STRING( + "Attacks with a thick leek.\n" + "The user must then rest."), + .effect = EFFECT_HIT, + .power = 150, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .instructBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_ETERNABEAM] = + { + .name = COMPOUND_STRING("Eternabeam"), + .description = COMPOUND_STRING( + "Eternatus' strongest move.\n" + "The user rests next turn."), + .effect = EFFECT_HIT, + .power = 160, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RECHARGE, + .self = TRUE, + }), + }, + + [MOVE_STEEL_BEAM] = + { + .name = COMPOUND_STRING("Steel Beam"), + .description = COMPOUND_STRING( + "Fires a beam of steel from\n" + "its body. It hurts the user."), + .effect = EFFECT_MAX_HP_50_RECOIL, + .power = 140, + .type = TYPE_STEEL, + .accuracy = 95, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + }, + + [MOVE_EXPANDING_FORCE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ExpandngForc", "Expanding Force"), + .description = COMPOUND_STRING( + "Power goes up and damages\n" + "all foes on Psychic Terrain."), + .effect = EFFECT_EXPANDING_FORCE, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_STEEL_ROLLER] = + { + .name = COMPOUND_STRING("Steel Roller"), + .description = COMPOUND_STRING( + "Destroys terrain. Fails if\n" + "ground isn't terrain."), + .effect = EFFECT_HIT_SET_REMOVE_TERRAIN, + .power = 130, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .argument = ARG_TRY_REMOVE_TERRAIN_FAIL, // Remove a field terrain if there is one and hit, otherwise fail. + .skyBattleBanned = TRUE, + }, + + [MOVE_SCALE_SHOT] = + { + .name = COMPOUND_STRING("Scale Shot"), + .description = COMPOUND_STRING( + "Shoots scales 2 to 5 times.\n" + "Ups Speed, lowers defense."), + .effect = EFFECT_MULTI_HIT, + .power = 25, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MOVE_EFFECT_SCALE_SHOT, + }, + + [MOVE_METEOR_BEAM] = + { + .name = COMPOUND_STRING("Meteor Beam"), + .description = COMPOUND_STRING( + "A 2-turn move that raises\n" + "Sp. Attack before attacking."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = 120, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .instructBanned = TRUE, + .argument = TWO_TURN_ARG(STRINGID_METEORBEAMCHARGING), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, + .self = TRUE, + .onChargeTurnOnly = TRUE, + }), + }, + + [MOVE_SHELL_SIDE_ARM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ShellSideArm", "Shell Side Arm"), + .description = COMPOUND_STRING( + "Deals better of physical and\n" + "special damage. May poison."), + .effect = EFFECT_SHELL_SIDE_ARM, + .power = 90, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 20, + }), + }, + + [MOVE_MISTY_EXPLOSION] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MstyExplsion", "Misty Explosion"), + .description = COMPOUND_STRING( + "Hit everything and faint.\n" + "Powers up on Misty Terrain."), + .effect = EFFECT_EXPLOSION, + .power = 100, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_GRASSY_GLIDE] = + { + .name = COMPOUND_STRING("Grassy Glide"), + .description = COMPOUND_STRING( + "Gliding on ground, hits. Goes\n" + "first on Grassy Terrain."), + .effect = EFFECT_GRASSY_GLIDE, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 55 : 70, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_RISING_VOLTAGE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("RisngVoltage", "Rising Voltage"), + .description = COMPOUND_STRING( + "This move's power doubles\n" + "when on Electric Terrain."), + .effect = EFFECT_RISING_VOLTAGE, + .power = 70, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_TERRAIN_PULSE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("TerrainPulse", "Terrain Pulse"), + .description = COMPOUND_STRING( + "Type and power changes\n" + "depending on the terrain."), + .effect = EFFECT_TERRAIN_PULSE, + .power = 50, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .pulseMove = TRUE, + }, + + [MOVE_SKITTER_SMACK] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SkitterSmack", "Skitter Smack"), + .description = COMPOUND_STRING( + "User skitters behind foe to\n" + "attack. Lowers foe's Sp. Atk."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_BUG, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_BURNING_JEALOUSY] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BrningJelosy", "Burning Jealousy"), + .description = COMPOUND_STRING( + "Foes that have stats upped\n" + "during the turn get burned."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .onlyIfTargetRaisedStats = TRUE, + .chance = 100, + }), + }, + + [MOVE_LASH_OUT] = + { + .name = COMPOUND_STRING("Lash Out"), + .description = COMPOUND_STRING( + "If stats lowered during this\n" + "turn, power is doubled."), + .effect = EFFECT_LASH_OUT, + .power = 75, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_POLTERGEIST] = + { + .name = COMPOUND_STRING("Poltergeist"), + .description = COMPOUND_STRING( + "Control foe's item to attack.\n" + "Fails if foe has no item."), + .effect = EFFECT_POLTERGEIST, + .power = 110, + .type = TYPE_GHOST, + .accuracy = 90, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_CORROSIVE_GAS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("CorrosiveGas", "Corrosive Gas"), + .description = COMPOUND_STRING( + "Highly acidic gas melts items\n" + "held by surrounding Pokémon."), + .effect = EFFECT_CORROSIVE_GAS, + .power = 0, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 40, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .magicCoatAffected = TRUE, + }, + + [MOVE_COACHING] = + { + .name = COMPOUND_STRING("Coaching"), + .description = COMPOUND_STRING( + "Properly coaches allies to\n" + "up their Attack and Defense."), + .effect = EFFECT_COACHING, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_FLIP_TURN] = + { + .name = COMPOUND_STRING("Flip Turn"), + .description = COMPOUND_STRING( + "Attacks and rushes back to\n" + "switch with a party Pokémon."), + .effect = EFFECT_HIT_ESCAPE, + .power = 60, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_TRIPLE_AXEL] = + { + .name = COMPOUND_STRING("Triple Axel"), + .description = COMPOUND_STRING( + "A 3-kick attack that gets\n" + "more powerful with each hit."), + .effect = EFFECT_TRIPLE_KICK, + .power = 20, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 3, + }, + + [MOVE_DUAL_WINGBEAT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DualWingbeat", "Dual Wingbeat"), + .description = COMPOUND_STRING( + "User slams the target with\n" + "wings and hits twice in a row."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_FLYING, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 2, + }, + + [MOVE_SCORCHING_SANDS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ScorchngSnds", "Scorching Sands"), + .description = COMPOUND_STRING( + "Throws scorching sand at\n" + "the target. May leave a burn."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_JUNGLE_HEALING] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("JungleHealng", "Jungle Healng"), + .description = COMPOUND_STRING( + "Heals HP and status of\n" + "itself and allies in battle."), + .effect = EFFECT_JUNGLE_HEALING, + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .ignoresSubstitute = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_WICKED_BLOW] = + { + .name = COMPOUND_STRING("Wicked Blow"), + .description = COMPOUND_STRING( + "Mastering the Dark style,\n" + "strikes with a critical hit."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 75 : 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .alwaysCriticalHit = TRUE, + .punchingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_SURGING_STRIKES] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SurgngStrkes", "Surging Strikes"), + .description = COMPOUND_STRING( + "Mastering the Water style,\n" + "strikes with 3 critical hits."), + .effect = EFFECT_HIT, + .power = 25, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .alwaysCriticalHit = TRUE, + .punchingMove = TRUE, + .strikeCount = 3, + .metronomeBanned = TRUE, + }, + + [MOVE_THUNDER_CAGE] = + { + .name = COMPOUND_STRING("Thunder Cage"), + .description = COMPOUND_STRING( + "Traps the foe in a cage of\n" + "electricity for "BINDING_TURNS" turns."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_ELECTRIC, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_WRAP, + }), + }, + + [MOVE_DRAGON_ENERGY] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("DragonEnergy", "Dragon Energy"), + .description = COMPOUND_STRING( + "The higher the user's HP\n" + "the more damage caused."), + .effect = EFFECT_ERUPTION, + .power = 150, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + }, + + [MOVE_FREEZING_GLARE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("FreezngGlare", "Freezing Glare"), + .description = COMPOUND_STRING( + "Shoots psychic power from\n" + #if B_USE_FROSTBITE == TRUE + "the eyes. May frostbite."), + #else + "the eyes. May freeze the foe."), + #endif + .power = 90, + .effect = EFFECT_HIT, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FREEZE_OR_FROSTBITE, + .chance = 10, + }), + }, + + [MOVE_FIERY_WRATH] = + { + .name = COMPOUND_STRING("Fiery Wrath"), + .description = COMPOUND_STRING( + "An attack fueled by your\n" + "wrath. May cause flinching."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 20, + }), + }, + + [MOVE_THUNDEROUS_KICK] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ThnderusKick", "Thunderous Kick"), + .description = COMPOUND_STRING( + "Uses a lightning-like kick\n" + "to hit. Lowers foe's Defense."), + .effect = EFFECT_HIT, + .power = 90, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_GLACIAL_LANCE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("GlacialLance", "Glacial Lance"), + .description = COMPOUND_STRING( + "Strikes by hurling a blizzard-\n" + "cloaked icicle lance at foes."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 120 : 130, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + }, + + [MOVE_ASTRAL_BARRAGE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("AstrlBarrage", "Astral Barrage"), + .description = COMPOUND_STRING( + "Strikes by sending a frightful\n" + "amount of ghosts at foes."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + }, + + [MOVE_EERIE_SPELL] = + { + .name = COMPOUND_STRING("Eerie Spell"), + .description = COMPOUND_STRING( + "Attacks with psychic power.\n" + "Foe's last move has 3 PP cut."), + .effect = EFFECT_EERIE_SPELL, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + }, + + [MOVE_DIRE_CLAW] = + { + .name = COMPOUND_STRING("Dire Claw"), + .description = COMPOUND_STRING( + "High critical hit chance. May\n" + "paralyze, poison or drowse."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 80 : 60, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DIRE_CLAW, + .chance = 50, + }), + }, + + [MOVE_PSYSHIELD_BASH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PsyshieldBsh", "Psyshield Bash"), + .description = COMPOUND_STRING( + "Hits a foe with psychic\n" + "energy. May raise Defense."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_PSYCHIC, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_POWER_SHIFT] = + { + .name = COMPOUND_STRING("Power Shift"), + .description = COMPOUND_STRING( + "The user swaps its Attack\n" + "and Defense stats."), + .effect = EFFECT_POWER_TRICK, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, +}, + + [MOVE_STONE_AXE] = + { + .name = COMPOUND_STRING("Stone Axe"), + .description = COMPOUND_STRING( + "High critical hit ratio. Sets\n" + "Splinters that hurt the foe."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_STEALTH_ROCK, + .chance = 100, + }), + }, + + [MOVE_SPRINGTIDE_STORM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SprngtdeStrm", "Springtide Storm"), + .description = COMPOUND_STRING( + "Wraps a foe in fierce winds.\n" + "Varies with the user's form."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 100 : 95, + .type = TYPE_FAIRY, + .accuracy = 80, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_MYSTICAL_POWER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MystcalPower", "Mystical Power"), + .description = COMPOUND_STRING( + "A mysterious power strikes,\n" + "raising the user's Sp. Atk."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_PSYCHIC, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_RAGING_FURY] = + { + .name = COMPOUND_STRING("Raging Fury"), + .description = COMPOUND_STRING( + "A rampage of 2 to 3 turns\n" + "that confuses the user."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 120 : 90, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_RANDOM, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_THRASH, + .self = TRUE, + }), + }, + + [MOVE_WAVE_CRASH] = + { + .name = COMPOUND_STRING("Wave Crash"), + .description = COMPOUND_STRING( + "A slam shrouded in water.\n" + "It also hurts the user."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 120 : 75, + .type = TYPE_WATER, + .accuracy = 100, + .recoil = 33, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_CHLOROBLAST] = + { + .name = COMPOUND_STRING("Chloroblast"), + .description = COMPOUND_STRING( + "A user-hurting blast of\n" + "amassed chlorophyll."), + .effect = EFFECT_MAX_HP_50_RECOIL, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 150 : 120, + .type = TYPE_GRASS, + .accuracy = 95, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_MOUNTAIN_GALE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MountainGale", "Mountain Gale"), + .description = COMPOUND_STRING( + "Giant chunks of ice damage\n" + "the foe. It may flinch."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_ICE, + .accuracy = 85, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_VICTORY_DANCE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("VictoryDance", "Victory Dance"), + .description = COMPOUND_STRING( + "Dances to raise Attack,\n" + "Defense and Speed."), + .effect = EFFECT_VICTORY_DANCE, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 20, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .danceMove = TRUE, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_HEADLONG_RUSH] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("HeadlongRush", "Headlong Rush"), + .description = COMPOUND_STRING( + "Hits with a full-body tackle.\n" + "Lowers the users's defenses."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 120 : 100, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_SPDEF_DOWN, + .self = TRUE, + }), + }, + + [MOVE_BARB_BARRAGE] = + { + .name = COMPOUND_STRING("Barb Barrage"), + .description = COMPOUND_STRING( + "Can poison on impact. Powers\n" + "up against poisoned foes."), + .effect = EFFECT_DOUBLE_POWER_ON_ARG_STATUS, + .power = 60, + .type = TYPE_POISON, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 10 : 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = STATUS1_PSN_ANY, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 50, + }), + }, + + [MOVE_ESPER_WING] = + { + .name = COMPOUND_STRING("Esper Wing"), + .description = COMPOUND_STRING( + "High critical hit ratio.\n" + "Ups the user's Speed."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 80 : 75, + .type = TYPE_PSYCHIC, + .accuracy = B_UPDATED_MOVE_DATA >= GEN_9 ? 100 : 90, + .criticalHitStage = 1, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_BITTER_MALICE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BitterMalice", "Bitter Malice"), + .description = COMPOUND_STRING( + "A spine-chilling resentment.\n" + "May lower the foe's Attack."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 75 : 60, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_SHELTER] = + { + .name = COMPOUND_STRING("Shelter"), + .description = COMPOUND_STRING( + "The user hardens their skin,\n" + "sharply raising its Defense."), + .effect = EFFECT_DEFENSE_UP_2, + .power = 0, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TRIPLE_ARROWS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("TripleArrows", "Triple Arrows"), + .description = COMPOUND_STRING( + "High critical hit ratio.\n" + "May lower Defense or flinch."), + .effect = EFFECT_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 90 : 50, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 10 : 15, + .criticalHitStage = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_MINUS_1, + .chance = 50, + }, + { + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 30, + }), + }, + + [MOVE_INFERNAL_PARADE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("InfrnlParade", "Infernal Parade"), + .description = COMPOUND_STRING( + "Hurts a foe harder if it has\n" + "an ailment. May leave a burn."), + .effect = EFFECT_DOUBLE_POWER_ON_ARG_STATUS, + .power = 60, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = STATUS1_ANY, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_CEASELESS_EDGE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("CeaslessEdge", "Ceaseless Edge"), + .description = COMPOUND_STRING( + "High critical hit ratio. Sets\n" + "Splinters that hurt the foe."), + .effect = EFFECT_HIT, + .power = 65, + .type = TYPE_DARK, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPIKES, + .chance = 100, + }), + }, + + [MOVE_BLEAKWIND_STORM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BlekwndStorm", "Bleakwind Storm"), + .description = COMPOUND_STRING( + "Hits with brutal, cold winds.\n" + "May lower the foe's Speed."), + .effect = EFFECT_RAIN_ALWAYS_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 100 : 95, + .type = TYPE_FLYING, + .accuracy = 80, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 10 : 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 30, + }), + }, + + [MOVE_WILDBOLT_STORM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("WildbltStorm", "Wildbolt Storm"), + .description = COMPOUND_STRING( + "Hits with a brutal tempest.\n" + "May inflict paralysis."), + .effect = EFFECT_RAIN_ALWAYS_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 100 : 95, + .type = TYPE_ELECTRIC, + .accuracy = 80, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 10 : 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 20, + }), + }, + + [MOVE_SANDSEAR_STORM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SndsearStorm", "Sandsear Storm"), + .description = COMPOUND_STRING( + "Hits with brutally hot sand.\n" + "May inflict a burn."), + .effect = EFFECT_RAIN_ALWAYS_HIT, + .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 100 : 95, + .type = TYPE_GROUND, + .accuracy = 80, + .pp = B_UPDATED_MOVE_DATA >= GEN_9 ? 10 : 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .windMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 20, + }), + }, + + [MOVE_LUNAR_BLESSING] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("LunarBlessng", "Lunar Blessing"), + .description = COMPOUND_STRING( + "The user heals and cures\n" + "itself and its ally."), + .effect = EFFECT_JUNGLE_HEALING, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .healingMove = TRUE, + }, + + [MOVE_TAKE_HEART] = + { + .name = COMPOUND_STRING("Take Heart"), + .description = COMPOUND_STRING( + "The user lifts its spirits to\n" + "heal and strengthen itself."), + .effect = EFFECT_TAKE_HEART, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + }, + + [MOVE_TERA_BLAST] = + { + .name = COMPOUND_STRING("Tera Blast"), + .description = COMPOUND_STRING( + "If the user's Terastallized,\n" + "it hits with its Tera-type."), + .effect = EFFECT_PLACEHOLDER, // EFFECT_TERA_BLAST, + .power = 80, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .forcePressure = TRUE, + }, + + [MOVE_SILK_TRAP] = + { + .name = COMPOUND_STRING("Silk Trap"), + .description = COMPOUND_STRING( + "Protects itself, lowering\n" + "Speed on contact."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_AXE_KICK] = + { + .name = COMPOUND_STRING("Axe Kick"), + .description = COMPOUND_STRING( + "May miss and hurt the kicker.\n" + "May cause confusion."), + .effect = EFFECT_RECOIL_IF_MISS, + .power = 120, + .type = TYPE_FIGHTING, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 30, + }), + }, + + [MOVE_LAST_RESPECTS] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("LastRespects", "Last Respects"), + .description = COMPOUND_STRING( + "This move deals more damage\n" + "for each defeated ally."), + .effect = EFFECT_LAST_RESPECTS, + .power = 50, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, // Only since it isn't implemented yet + }, + + [MOVE_LUMINA_CRASH] = + { + .name = COMPOUND_STRING("Lumina Crash"), + .description = COMPOUND_STRING( + "A mind-affecting light\n" + "harshly lowers Sp. Def."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_DEF_MINUS_2, + .chance = 100, + }), + }, + + [MOVE_ORDER_UP] = + { + .name = COMPOUND_STRING("Order Up"), + .description = COMPOUND_STRING( + "Boosts a user's stats\n" + "depending on Tatsugiri."), + .effect = EFFECT_PLACEHOLDER, // EFFECT_ORDER_UP + .power = 80, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_JET_PUNCH] = + { + .name = COMPOUND_STRING("Jet Punch"), + .description = COMPOUND_STRING( + "A punch is thrown at blinding\n" + "speed to strike first."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_SPICY_EXTRACT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SpicyExtract", "Spicy Extract"), + .description = COMPOUND_STRING( + "Sharply ups target's Attack,\n" + "harshly lowers its Defense."), + .effect = EFFECT_PLACEHOLDER, // EFFECT_SPICY_EXTRACT + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .magicCoatAffected = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_SPIN_OUT] = + { + .name = COMPOUND_STRING("Spin Out"), + .description = COMPOUND_STRING( + "Furiously strains its legs.\n" + "Harshly lowers user's Speed."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_2, + .self = TRUE, + }), + }, + + [MOVE_POPULATION_BOMB] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PoplatinBomb", "Population Bomb"), + .description = COMPOUND_STRING( + "The user's fellows hit one\n" + "to ten times in a row."), + .effect = EFFECT_POPULATION_BOMB, + .power = 20, + .type = TYPE_NORMAL, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .metronomeBanned = TRUE, + .strikeCount = 10, + }, + + [MOVE_ICE_SPINNER] = + { + .name = COMPOUND_STRING("Ice Spinner"), + .description = COMPOUND_STRING( + "Ice-covered feet hit a foe\n" + "and destroy the terrain."), + .effect = EFFECT_HIT_SET_REMOVE_TERRAIN, + .power = 80, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .argument = ARG_TRY_REMOVE_TERRAIN_HIT, // Remove the active field terrain if there is one. + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_GLAIVE_RUSH] = + { + .name = COMPOUND_STRING("Glaive Rush"), + .description = COMPOUND_STRING( + "Foe attacks next turn can't\n" + "miss and do double damage."), + .effect = EFFECT_GLAIVE_RUSH, + .power = 120, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_REVIVAL_BLESSING] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("RevivlBlesng", "Revival Blessing"), + .description = COMPOUND_STRING( + "Revives a fainted party {PKMN}\n" + "and restores half of its HP."), + .effect = EFFECT_REVIVAL_BLESSING, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .healingMove = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + }, + + [MOVE_SALT_CURE] = + { + .name = COMPOUND_STRING("Salt Cure"), + .description = COMPOUND_STRING( + "Hurts foe every turn. Double\n" + "damage to Steel and Water."), + .effect = EFFECT_SALT_CURE, + .power = 40, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + }, + + [MOVE_TRIPLE_DIVE] = + { + .name = COMPOUND_STRING("Triple Dive"), + .description = COMPOUND_STRING( + "Hits target with splashes\n" + "of water 3 times in a row."), + .effect = EFFECT_HIT, + .power = 30, + .type = TYPE_WATER, + .accuracy = 95, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .strikeCount = 3, + }, + + [MOVE_MORTAL_SPIN] = + { + .name = COMPOUND_STRING("Mortal Spin"), + .description = COMPOUND_STRING( + "Erases trap moves and Leech\n" + "Seed. Poisons adjecent foes."), + .effect = EFFECT_HIT, + .power = 30, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_RAPID_SPIN, + .self = TRUE, + }, + { + .moveEffect = MOVE_EFFECT_POISON, + .chance = 100, + }), + }, + + [MOVE_DOODLE] = + { + .name = COMPOUND_STRING("Doodle"), + .description = COMPOUND_STRING( + "Changes user's and ally's\n" + "Ability into the target's."), + .effect = EFFECT_DOODLE, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_FILLET_AWAY] = + { + .name = COMPOUND_STRING("Fillet Away"), + .description = COMPOUND_STRING( + "Sharply boosts offenses and\n" + "Speed by using its own HP."), + .effect = EFFECT_FILLET_AWAY, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RECOVER_HP }, + .snatchAffected = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_KOWTOW_CLEAVE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("KowtowCleave", "Kowtow Cleave"), + .description = COMPOUND_STRING( + "User slashes the foe after\n" + "kowtowing. It never misses."), + .effect = EFFECT_HIT, + .power = 85, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_FLOWER_TRICK] = + { + .name = COMPOUND_STRING("Flower Trick"), + .description = COMPOUND_STRING( + "Rigged bouquet. Always gets\n" + "a critical hit, never missing."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .alwaysCriticalHit = TRUE, + }, + + [MOVE_TORCH_SONG] = + { + .name = COMPOUND_STRING("Torch Song"), + .description = COMPOUND_STRING( + "Flames scorch the target.\n" + "Boosts the user's Sp. Atk."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_AQUA_STEP] = + { + .name = COMPOUND_STRING("Aqua Step"), + .description = COMPOUND_STRING( + "Hits with light, fluid dance\n" + "steps. Ups the user's Speed."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .danceMove = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_RAGING_BULL] = + { + .name = COMPOUND_STRING("Raging Bull"), + .description = COMPOUND_STRING( + "Tackle that breaks barriers.\n" + "User's form determines type."), + .effect = EFFECT_RAGING_BULL, + .power = 90, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_MAKE_IT_RAIN] = + { + .name = COMPOUND_STRING("Make It Rain"), + .description = COMPOUND_STRING( + "Lowers the user's Sp. Atk.\n" + "Money is recovered after."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PAYDAY, + }, + { + .moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1, + .self = TRUE, + }), + }, + + [MOVE_RUINATION] = + { + .name = COMPOUND_STRING("Ruination"), + .description = COMPOUND_STRING( + "Summons a ruinous disaster\n" + "and cuts half the foe's HP."), + .effect = EFFECT_SUPER_FANG, + .power = 1, + .type = TYPE_DARK, + .accuracy = 90, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + }, + + [MOVE_COLLISION_COURSE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ColisinCours", "Collision Course"), + .description = COMPOUND_STRING( + "Prehistoric explosion that's\n" + "stronger if supereffective."), + .effect = EFFECT_COLLISION_COURSE, + .power = 100, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_ELECTRO_DRIFT] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ElectroDrift", "Electro Drift"), + .description = COMPOUND_STRING( + "Futuristic electricity. It's\n" + "stronger if supereffective."), + .effect = EFFECT_COLLISION_COURSE, + .power = 100, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_SHED_TAIL] = + { + .name = COMPOUND_STRING("Shed Tail"), + .description = COMPOUND_STRING( + "Creates a Substitute for\n" + "itself before switching out."), + .effect = EFFECT_SHED_TAIL, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_CHILLY_RECEPTION] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ChilReceptin", "Chilly Reception"), + .description = COMPOUND_STRING( + "Bad joke summons snowstorm.\n" + "The user also switches out."), + .effect = EFFECT_CHILLY_RECEPTION, + .power = 0, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_TIDY_UP] = + { + .name = COMPOUND_STRING("Tidy Up"), + .description = COMPOUND_STRING( + "User tidies up hazards and\n" + "raises its Attack and Speed."), + .effect = EFFECT_TIDY_UP, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_SNOWSCAPE] = + { + .name = COMPOUND_STRING("Snowscape"), + .description = COMPOUND_STRING( + "Summons a snowstorm that\n" + "lasts for five turns."), + .effect = EFFECT_SNOWSCAPE, + .power = 0, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_ALL_BATTLERS, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_POUNCE] = + { + .name = COMPOUND_STRING("Pounce"), + .description = COMPOUND_STRING( + "The user pounces on the foe,\n" + "lowering its Speed."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_BUG, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_TRAILBLAZE] = + { + .name = COMPOUND_STRING("Trailblaze"), + .description = COMPOUND_STRING( + "The user attacks suddenly,\n" + "raising its Speed."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SPD_PLUS_1, + .self = TRUE, + .chance = 100, + }), + }, + + [MOVE_CHILLING_WATER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("ChillingWatr", "Chilling Water"), + .description = COMPOUND_STRING( + "A shower with ice-cold water\n" + "lowers the target's Attack."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ATK_MINUS_1, + .chance = 100, + }), + }, + + [MOVE_HYPER_DRILL] = + { + .name = COMPOUND_STRING("Hyper Drill"), + .description = COMPOUND_STRING( + "A spinning pointed part\n" + "bypasses a foe's Protect."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresProtect = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_TWIN_BEAM] = + { + .name = COMPOUND_STRING("Twin Beam"), + .description = COMPOUND_STRING( + "Mystical eye-beams that hit\n" + "the target twice in a row."), + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .strikeCount = 2, + .metronomeBanned = TRUE, + }, + + [MOVE_RAGE_FIST] = + { + .name = COMPOUND_STRING("Rage Fist"), + .description = COMPOUND_STRING( + "The more the user has been\n" + "hit, the stronger the move."), + .effect = EFFECT_RAGE_FIST, + .power = 50, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .punchingMove = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_ARMOR_CANNON] = + { + .name = COMPOUND_STRING("Armor Cannon"), + .description = COMPOUND_STRING( + "A strong attack but lowers\n" + "the defensive stats."), + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_DEF_SPDEF_DOWN, + .self = TRUE, + }), + }, + + [MOVE_BITTER_BLADE] = + { + .name = COMPOUND_STRING("Bitter Blade"), + .description = COMPOUND_STRING( + "An attack that absorbs\n" + "half the damage inflicted."), + .effect = EFFECT_ABSORB, + .power = 90, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + .healingMove = TRUE, + }, + + [MOVE_DOUBLE_SHOCK] = + { + .name = COMPOUND_STRING("Double Shock"), + .description = COMPOUND_STRING( + "Discharges all electricity,\n" + "losing the Electric type."), + .effect = EFFECT_FAIL_IF_NOT_ARG_TYPE, + .power = 120, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .metronomeBanned = TRUE, + .argument = TYPE_ELECTRIC, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_REMOVE_ARG_TYPE, + .self = TRUE, + }), + }, + + [MOVE_GIGATON_HAMMER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("GigatonHammr", "Gigaton Hammer"), + .description = COMPOUND_STRING( + "Swings a huge hammer. Can't\n" + "be used twice in a row."), + .effect = EFFECT_HIT, + .power = 160, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .cantUseTwice = TRUE, + }, + + [MOVE_COMEUPPANCE] = + { + .name = COMPOUND_STRING("Comeuppance"), + .description = COMPOUND_STRING( + "Retaliates strongly against\n" + "who last hurt the user."), + .effect = EFFECT_METAL_BURST, + .power = 1, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_DEPENDS, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .meFirstBanned = TRUE, + .metronomeBanned = TRUE, + }, + + [MOVE_AQUA_CUTTER] = + { + .name = COMPOUND_STRING("Aqua Cutter"), + .description = COMPOUND_STRING( + "Pressurized water cut with a\n" + "high critical-hit ratio."), + .effect = EFFECT_HIT, + .power = 70, + .type = TYPE_WATER, + .accuracy = 100, + .criticalHitStage = 1, + .pp = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .slicingMove = TRUE, + }, + + [MOVE_BLAZING_TORQUE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BlazngTorque", "Blazing Torque"), + .description = COMPOUND_STRING("---"), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 30, + }), + }, + + [MOVE_WICKED_TORQUE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("WickedTorque", "Wicked Torque"), + .description = COMPOUND_STRING("---"), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SLEEP, + .chance = 10, + }), + }, + + [MOVE_NOXIOUS_TORQUE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("NoxiusTorque", "Noxious Torque"), + .description = COMPOUND_STRING("---"), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_POISON, + .chance = 30, + }), + }, + + [MOVE_COMBAT_TORQUE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("CombatTorque", "Combat Torque"), + .description = COMPOUND_STRING("---"), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 30, + }), + }, + + [MOVE_MAGICAL_TORQUE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MagiclTorque", "Magical Torque"), + .description = COMPOUND_STRING("---"), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .mirrorMoveBanned = TRUE, + .meFirstBanned = TRUE, + .mimicBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .sleepTalkBanned = TRUE, + .instructBanned = TRUE, + .encoreBanned = TRUE, + .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .chance = 30, + }), + }, + + [MOVE_PSYBLADE] = + { + .name = COMPOUND_STRING("Psyblade"), + .description = COMPOUND_STRING( + "This move's power increases\n" + "when on Electric Terrain."), + .effect = EFFECT_PSYBLADE, + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_HYDRO_STEAM] = + { + .name = COMPOUND_STRING("Hydro Steam"), + .description = COMPOUND_STRING( + "This move's power increases\n" + "under harsh sunlight."), + .effect = EFFECT_HYDRO_STEAM, + .power = 80, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + }, + + [MOVE_BLOOD_MOON] = + { + .name = COMPOUND_STRING("Blood Moon"), + .description = COMPOUND_STRING( + "Unleashes the blood moon.\n" + "Can't be used twice in a row."), + .effect = EFFECT_HIT, + .power = 140, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .cantUseTwice = TRUE, + }, + + [MOVE_MATCHA_GOTCHA] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MatchaGotcha", "Matcha Gotcha"), + .description = COMPOUND_STRING( + "Absorbs half the damage\n" + "inflicted. May cause a burn."), + .effect = EFFECT_ABSORB, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 90, + .pp = 15, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .thawsUser = TRUE, + .metronomeBanned = TRUE, + .healingMove = B_EXTRAPOLATED_MOVE_FLAGS, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_BURN, + .chance = 20, + }), + }, + + [MOVE_SYRUP_BOMB] = + { + .name = COMPOUND_STRING("Syrup Bomb"), + .description = COMPOUND_STRING( + "Lowers the foe's speed\n" + "each turn for 3 turns."), + .effect = EFFECT_HIT, + .power = 60, + .type = TYPE_GRASS, + .accuracy = 85, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ballisticMove = TRUE, + .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SYRUP_BOMB, + .chance = 100, + }), + }, + + [MOVE_IVY_CUDGEL] = + { + .name = COMPOUND_STRING("Ivy Cudgel"), + .description = COMPOUND_STRING( + "Type changes with held mask.\n" + "High critical-hit ratio."), + .effect = EFFECT_IVY_CUDGEL, + .power = 100, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .criticalHitStage = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .metronomeBanned = TRUE, + }, + + [MOVE_ELECTRO_SHOT] = + { + .name = COMPOUND_STRING("Electro Shot"), + .description = COMPOUND_STRING( + "Absorbs electricity in one turn,\n" + "then attacks next turn."), + .effect = EFFECT_TWO_TURNS_ATTACK, + .power = 130, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = TWO_TURN_ARG(STRINGID_ELECTROSHOTCHARGING, B_WEATHER_RAIN), + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, + .self = TRUE, + .onChargeTurnOnly = TRUE, + }, SHEER_FORCE_HACK), + }, + + [MOVE_TERA_STARSTORM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("TeraStarstrm", "Tera Starstorm"), + .description = COMPOUND_STRING( + "Damages all opponents if user is\n" + "Stellar form Terapagos."), + .effect = EFFECT_PLACEHOLDER, //EFFECT_TERA_STARSTORM + .power = 120, + .type = TYPE_NORMAL, // Stellar type if used by Terapagos-Stellar + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, // MOVE_TARGET_BOTH if used by Terapagos-Stellar + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .assistBanned = TRUE, + .copycatBanned = TRUE, + .mimicBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + }, + + [MOVE_FICKLE_BEAM] = + { + .name = COMPOUND_STRING("Fickle Beam"), + .description = COMPOUND_STRING( + "Shoots a beam of light. Sometimes\n" + "twice as strong."), + .effect = EFFECT_FICKLE_BEAM, + .power = 80, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_BURNING_BULWARK] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("BurnngBulwrk", "Burning Bulwark"), + .description = COMPOUND_STRING( + "Evades attack, and burns\n" + "the foe if struck."), + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + .zMove = { .effect = Z_EFFECT_RESET_STATS }, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_THUNDERCLAP] = + { + .name = COMPOUND_STRING("Thunderclap"), + .description = sSuckerPunchDescription, + .effect = EFFECT_SUCKER_PUNCH, + .power = 70, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + + [MOVE_MIGHTY_CLEAVE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MightyCleave", "Mighty Cleave"), + .description = sFeintDescription, + .effect = EFFECT_HIT, + .power = 95, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .ignoresProtect = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_TACHYON_CUTTER] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("TachyonCuttr", "Tachyon Cutter"), + .description = COMPOUND_STRING( + "Launches particle blades at\n" + "the target. Strikes twice."), + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .strikeCount = 2, + .slicingMove = TRUE, + }, + + [MOVE_HARD_PRESS] = + { + .name = COMPOUND_STRING("Hard Press"), + .description = sWringOutDescription, + .effect = EFFECT_VARY_POWER_BASED_ON_HP, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = 100, + .makesContact = TRUE, + }, + + [MOVE_DRAGON_CHEER] = + { + .name = COMPOUND_STRING("Dragon Cheer"), + .description = COMPOUND_STRING( + "Increases allies' critical hit\n" + "ratio, especially if Dragons."), + .effect = EFFECT_DRAGON_CHEER, + .power = 0, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 15, + .target = MOVE_TARGET_ALLY, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + .ignoresSubstitute = TRUE, + }, + + [MOVE_ALLURING_VOICE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("AllurngVoice", "Alluring Voice"), + .description = COMPOUND_STRING( + "Confuses the target if their\n" + "stats were boosted this turn."), + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_CONFUSION, + .onlyIfTargetRaisedStats = TRUE, + .chance = 100, + }), + }, + + [MOVE_TEMPER_FLARE] = + { + .name = COMPOUND_STRING("Temper Flare"), + .description = COMPOUND_STRING( + "A desperation attack. Power\n" + "doubles if last move failed."), + .effect = EFFECT_STOMPING_TANTRUM, + .power = 75, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_SUPERCELL_SLAM] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("SuprcellSlam", "Supercell Slam"), + .description = COMPOUND_STRING( + "An electrified slam. If it\n" + "misses, the user is hurt."), + .effect = EFFECT_RECOIL_IF_MISS, + .power = 100, + .type = TYPE_ELECTRIC, + .accuracy = 95, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + }, + + [MOVE_PSYCHIC_NOISE] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("PsychicNoise", "Psychic Noise"), + .description = COMPOUND_STRING( + "Unpleasant sound waves that\n" + "damage and prevent healing."), + .effect = EFFECT_HIT, + .power = 75, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PSYCHIC_NOISE, + .chance = 100, + }), + }, + + [MOVE_UPPER_HAND] = + { + .effect = EFFECT_UPPER_HAND, + .name = COMPOUND_STRING("Upper Hand"), + .description = COMPOUND_STRING( + "Makes the target flinch if\n" + "readying a priority move."), + .power = 65, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .target = MOVE_TARGET_SELECTED, + .priority = 3, + .category = DAMAGE_CATEGORY_PHYSICAL, + .makesContact = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_FLINCH, + .chance = 100, + }), + }, + + [MOVE_MALIGNANT_CHAIN] = + { + .name = HANDLE_EXPANDED_MOVE_NAME("MalignntChan", "Malignant Chain"), + .description = COMPOUND_STRING( + "A corrosive chain attack\n" + "that may badly poison."), + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 5, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_TOXIC, + .chance = 50, + }), + }, + + // Z-Moves + [MOVE_BREAKNECK_BLITZ] = + { + .name = COMPOUND_STRING("Breakneck Blitz"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, //determined from move type + }, + [MOVE_ALL_OUT_PUMMELING] = + { + .name = COMPOUND_STRING("All Out Pummeling"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_SUPERSONIC_SKYSTRIKE] = + { + .name = COMPOUND_STRING("Supersonic Skystrike"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_ACID_DOWNPOUR] = + { + .name = COMPOUND_STRING("Acid Downpour"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_TECTONIC_RAGE] = + { + .name = COMPOUND_STRING("Tectonic Rage"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + [MOVE_CONTINENTAL_CRUSH] = + { + .name = COMPOUND_STRING("Continental Crush"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_SAVAGE_SPIN_OUT] = + { + .name = COMPOUND_STRING("Savage Spin Out"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_NEVER_ENDING_NIGHTMARE] = + { + .name = COMPOUND_STRING("Never Ending Nightmare"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_CORKSCREW_CRASH] = + { + .name = COMPOUND_STRING("Corkscrew Crash"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_INFERNO_OVERDRIVE] = + { + .name = COMPOUND_STRING("Inferno Overdrive"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_HYDRO_VORTEX] = + { + .name = COMPOUND_STRING("Hydro Vortex"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_BLOOM_DOOM] = + { + .name = COMPOUND_STRING("Bloom Doom"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_GIGAVOLT_HAVOC] = + { + .name = COMPOUND_STRING("Gigavolt Havoc"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_SHATTERED_PSYCHE] = + { + .name = COMPOUND_STRING("Shattered Psyche"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_SUBZERO_SLAMMER] = + { + .name = COMPOUND_STRING("Subzero Slammer"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_DEVASTATING_DRAKE] = + { + .name = COMPOUND_STRING("Devastating Drake"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_BLACK_HOLE_ECLIPSE] = + { + .name = COMPOUND_STRING("Black Hole Eclipse"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_TWINKLE_TACKLE] = + { + .name = COMPOUND_STRING("Twinkle Tackle"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_CATASTROPIKA] = + { + .name = COMPOUND_STRING("Catastropika"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 210, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_10000000_VOLT_THUNDERBOLT] = + { + .name = COMPOUND_STRING("10000000 Volt Thunderbolt"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .criticalHitStage = 2, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + [MOVE_STOKED_SPARKSURFER] = + { + .name = COMPOUND_STRING("Stoked Sparksurfer"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 175, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_PARALYSIS, + .chance = 100, + }), + }, + [MOVE_EXTREME_EVOBOOST] = + { + .name = COMPOUND_STRING("Extreme Evoboost"), + .description = sNullDescription, + .effect = EFFECT_EXTREME_EVOBOOST, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_USER, + .priority = 0, + .category = DAMAGE_CATEGORY_STATUS, + }, + [MOVE_PULVERIZING_PANCAKE] = + { + .name = COMPOUND_STRING("Pulverizing Pancake"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 210, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_GENESIS_SUPERNOVA] = + { + .name = COMPOUND_STRING("Genesis Supernova"), + .description = sNullDescription, + .effect = EFFECT_HIT_SET_REMOVE_TERRAIN, + .power = 185, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .argument = ARG_SET_PSYCHIC_TERRAIN, // Set Psychic Terrain. If there's a different field terrain active, overwrite it. + }, + [MOVE_SINISTER_ARROW_RAID] = + { + .name = COMPOUND_STRING("Sinister Arrow Raid"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_MALICIOUS_MOONSAULT] = + { + .name = COMPOUND_STRING("Malicious Moonsault"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_OCEANIC_OPERETTA] = + { + .name = COMPOUND_STRING("Oceaning Operetta"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + [MOVE_SPLINTERED_STORMSHARDS] = + { + .name = COMPOUND_STRING("Splintered Stormshards"), + .description = sNullDescription, + .effect = EFFECT_HIT_SET_REMOVE_TERRAIN, + .power = 190, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = ARG_TRY_REMOVE_TERRAIN_HIT, // Remove the active field terrain if there is one. + }, + [MOVE_LETS_SNUGGLE_FOREVER] = + { + .name = COMPOUND_STRING("Let's Snuggle Forever"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 190, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + [MOVE_CLANGOROUS_SOULBLAZE] = + { + .name = COMPOUND_STRING("Clangorous Soulblaze"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 185, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .soundMove = TRUE, + .ignoresSubstitute = B_UPDATED_MOVE_FLAGS >= GEN_6, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ALL_STATS_UP, + .self = TRUE, + .chance = 100, + }), + }, + [MOVE_GUARDIAN_OF_ALOLA] = + { + .name = COMPOUND_STRING("Guardian Of Alola"), + .description = sNullDescription, + .effect = EFFECT_SUPER_FANG, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + }, + [MOVE_SEARING_SUNRAZE_SMASH] = + { + .name = COMPOUND_STRING("Searing Sunraze Smash"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .ignoresTargetAbility = TRUE, + }, + [MOVE_MENACING_MOONRAZE_MAELSTROM] = + { + .name = COMPOUND_STRING("Menacing Moonraze Maelstrom"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresTargetAbility = TRUE, + }, + [MOVE_LIGHT_THAT_BURNS_THE_SKY] = + { + .name = COMPOUND_STRING("Light That Burns The Sky"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_SPECIAL, + .ignoresTargetAbility = TRUE, + }, + [MOVE_SOUL_STEALING_7_STAR_STRIKE] = + { + .name = COMPOUND_STRING("Soul Stealing 7 Star Strike"), + .description = sNullDescription, + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + }, + + [MOVE_MAX_GUARD] = + { + .name = COMPOUND_STRING("Max Guard"), + .description = sNullDescription, + .effect = EFFECT_PROTECT, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_USER, + .priority = 4, + .category = DAMAGE_CATEGORY_STATUS, + }, + + [MOVE_MAX_FLARE] = + { + .name = COMPOUND_STRING("Max Flare"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_SUN, + }, + + [MOVE_MAX_FLUTTERBY] = + { + .name = COMPOUND_STRING("Max Flutterby"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_SP_ATK, + }, + + [MOVE_MAX_LIGHTNING] = + { + .name = COMPOUND_STRING("Max Lightning"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_ELECTRIC_TERRAIN, + }, + + [MOVE_MAX_STRIKE] = + { + .name = COMPOUND_STRING("Max Strike"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_SPEED, + }, + + [MOVE_MAX_KNUCKLE] = + { + .name = COMPOUND_STRING("Max Knuckle"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RAISE_TEAM_ATTACK, + }, + + [MOVE_MAX_PHANTASM] = + { + .name = COMPOUND_STRING("Max Phantasm"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_DEFENSE, + }, + + [MOVE_MAX_HAILSTORM] = + { + .name = COMPOUND_STRING("Max Hailstorm"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_HAIL, + }, + + [MOVE_MAX_OOZE] = + { + .name = COMPOUND_STRING("Max Ooze"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RAISE_TEAM_SP_ATK, + }, + + [MOVE_MAX_GEYSER] = + { + .name = COMPOUND_STRING("Max Geyser"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RAIN, + }, + + [MOVE_MAX_AIRSTREAM] = + { + .name = COMPOUND_STRING("Max Airstream"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RAISE_TEAM_SPEED, + }, + + [MOVE_MAX_STARFALL] = + { + .name = COMPOUND_STRING("Max Starfall"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_MISTY_TERRAIN, + }, + + [MOVE_MAX_WYRMWIND] = + { + .name = COMPOUND_STRING("Max Wyrmwind"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_ATTACK, + }, + + [MOVE_MAX_MINDSTORM] = + { + .name = COMPOUND_STRING("Max Mindstorm"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_PSYCHIC_TERRAIN, + }, + + [MOVE_MAX_ROCKFALL] = + { + .name = COMPOUND_STRING("Max Rockfall"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_SANDSTORM, + }, + + [MOVE_MAX_QUAKE] = + { + .name = COMPOUND_STRING("Max Quake"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RAISE_TEAM_SP_DEF, + .skyBattleBanned = B_EXTRAPOLATED_MOVE_FLAGS, + }, + + [MOVE_MAX_DARKNESS] = + { + .name = COMPOUND_STRING("Max Darkness"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 1, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_SP_DEF, + }, + + [MOVE_MAX_OVERGROWTH] = + { + .name = COMPOUND_STRING("Max Overgrowth"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_GRASSY_TERRAIN, + }, + + [MOVE_MAX_STEELSPIKE] = + { + .name = COMPOUND_STRING("Max Steelspike"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RAISE_TEAM_DEFENSE, + }, + + [MOVE_G_MAX_VINE_LASH] = + { + .name = COMPOUND_STRING("G-Max Vine Lash"), + .description = sNullDescription, //ANIM TODO + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_VINE_LASH, + }, + + [MOVE_G_MAX_WILDFIRE] = + { + .name = COMPOUND_STRING("G-Max Wildfire"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_WILDFIRE, + }, + + [MOVE_G_MAX_CANNONADE] = + { + .name = COMPOUND_STRING("G-Max Canonade"), + .description = sNullDescription, //ANIM TODO + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_CANNONADE, + }, + + [MOVE_G_MAX_BEFUDDLE] = + { + .name = COMPOUND_STRING("G-Max Befuddle"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_EFFECT_SPORE_FOES, + }, + + [MOVE_G_MAX_VOLT_CRASH] = + { + .name = COMPOUND_STRING("G-Max Volt Crash"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_PARALYZE_FOES, + }, + + [MOVE_G_MAX_GOLD_RUSH] = + { + .name = COMPOUND_STRING("G-Max Gold Rush"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_CONFUSE_FOES_PAY_DAY, + }, + + [MOVE_G_MAX_CHI_STRIKE] = + { + .name = COMPOUND_STRING("G-Max Chi Strike"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_CRIT_PLUS, + }, + + [MOVE_G_MAX_TERROR] = + { + .name = COMPOUND_STRING("G-Max Terror"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_MEAN_LOOK, + }, + + [MOVE_G_MAX_FOAM_BURST] = + { + .name = COMPOUND_STRING("G-Max Foam Burst"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_SPEED_2_FOES, + }, + + [MOVE_G_MAX_RESONANCE] = + { + .name = COMPOUND_STRING("G-Max Resonance"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_AURORA_VEIL, + }, + + [MOVE_G_MAX_CUDDLE] = + { + .name = COMPOUND_STRING("G-Max Cuddle"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_INFATUATE_FOES, + }, + + [MOVE_G_MAX_REPLENISH] = + { + .name = COMPOUND_STRING("G-Max Replenish"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_RECYCLE_BERRIES, + }, + + [MOVE_G_MAX_MALODOR] = + { + .name = COMPOUND_STRING("G-Max Malodor"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_POISON_FOES, + }, + + [MOVE_G_MAX_MELTDOWN] = + { + .name = COMPOUND_STRING("G-Max Meltdown"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_TORMENT_FOES, + }, + + [MOVE_G_MAX_DRUM_SOLO] = + { + .name = COMPOUND_STRING("G-Max Drum Solo"), + .description = sNullDescription, //ANIM TODO + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_FIXED_POWER, //EFFECT TODO + .ignoresTargetAbility = TRUE, + }, + + [MOVE_G_MAX_FIREBALL] = + { + .name = COMPOUND_STRING("G-Max Fireball"), + .description = sNullDescription, //ANIM TODO + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_FIXED_POWER, //EFFECT TODO + .ignoresTargetAbility = TRUE, + }, + + [MOVE_G_MAX_HYDROSNIPE] = + { + .name = COMPOUND_STRING("G-Max Hydrosnipe"), + .description = sNullDescription, //ANIM TODO + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_FIXED_POWER, //EFFECT TODO + .ignoresTargetAbility = TRUE, + }, + + [MOVE_G_MAX_WIND_RAGE] = + { + .name = COMPOUND_STRING("G-Max Wind Rage"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_DEFOG, + }, + + [MOVE_G_MAX_GRAVITAS] = + { + .name = COMPOUND_STRING("G-Max Gravitas"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_GRAVITY, + }, + + [MOVE_G_MAX_STONESURGE] = + { + .name = COMPOUND_STRING("G-Max Stonesurge"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_STEALTH_ROCK, + }, + + [MOVE_G_MAX_VOLCALITH] = + { + .name = COMPOUND_STRING("G-Max Volcalith"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_VOLCALITH, + }, + + [MOVE_G_MAX_TARTNESS] = + { + .name = COMPOUND_STRING("G-Max Tartness"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_LOWER_EVASIVENESS_FOES, + }, + + [MOVE_G_MAX_SWEETNESS] = + { + .name = COMPOUND_STRING("G-Max Sweetness"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_AROMATHERAPY, + }, + + [MOVE_G_MAX_SANDBLAST] = + { + .name = COMPOUND_STRING("G-Max Sandblast"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_SANDBLAST_FOES, + }, + + [MOVE_G_MAX_STUN_SHOCK] = + { + .name = COMPOUND_STRING("G-Max Stun Shock"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_POISON_PARALYZE_FOES, + }, + + [MOVE_G_MAX_CENTIFERNO] = + { + .name = COMPOUND_STRING("G-Max Centiferno"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_FIRE_SPIN_FOES, + }, + + [MOVE_G_MAX_SMITE] = + { + .name = COMPOUND_STRING("G-Max Smite"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_CONFUSE_FOES, + }, + + + [MOVE_G_MAX_SNOOZE] = + { + .name = COMPOUND_STRING("G-Max Snooze"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_YAWN_FOE, + }, + + [MOVE_G_MAX_FINALE] = + { + .name = COMPOUND_STRING("G-Max Finale"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_HEAL_TEAM, + }, + + [MOVE_G_MAX_STEELSURGE] = + { + .name = COMPOUND_STRING("G-Max Steelsurge"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_STEELSURGE, + }, + + [MOVE_G_MAX_DEPLETION] = + { + .name = COMPOUND_STRING("G-Max Depletion"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_SPITE, + }, + + [MOVE_G_MAX_ONE_BLOW] = + { + .name = COMPOUND_STRING("G-Max One Blow"), + .description = sNullDescription, + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_BYPASS_PROTECT, //EFFECT TODO + }, + + [MOVE_G_MAX_RAPID_FLOW] = + { + .name = COMPOUND_STRING("G-Max Rapid Flow"), + .description = sNullDescription, //ANIM TODO + .effect = EFFECT_MAX_MOVE, + .power = 10, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MAX_EFFECT_BYPASS_PROTECT, //EFFECT TODO + }, + +}; diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 01154c024..5edd6f42b 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -1,101 +1,135 @@ #if P_FAMILY_BULBASAUR static const struct FormChange sVenusaurFormChangeTable[] = { - {}, - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_VENUSAUR_MEGA, ITEM_VENUSAURITE}, +#endif +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_VENUSAUR_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_BULBASAUR #if P_FAMILY_CHARMANDER static const struct FormChange sCharizardFormChangeTable[] = { - {}, - {}, - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_X, ITEM_CHARIZARDITE_X}, + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_Y, ITEM_CHARIZARDITE_Y}, +#endif +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CHARIZARD_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CHARMANDER #if P_FAMILY_SQUIRTLE static const struct FormChange sBlastoiseFormChangeTable[] = { - {}, - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLASTOISE_MEGA, ITEM_BLASTOISINITE}, +#endif +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_BLASTOISE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SQUIRTLE #if P_FAMILY_CATERPIE static const struct FormChange sButterfreeFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_BUTTERFREE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CATERPIE #if P_FAMILY_WEEDLE static const struct FormChange sBeedrillFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BEEDRILL_MEGA, ITEM_BEEDRILLITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_WEEDLE #if P_FAMILY_PIDGEY static const struct FormChange sPidgeotFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PIDGEOT_MEGA, ITEM_PIDGEOTITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_PIDGEY #if P_FAMILY_PIKACHU static const struct FormChange sPikachuFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_PIKACHU_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_PIKACHU #if P_FAMILY_MEOWTH static const struct FormChange sMeowthFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_MEOWTH_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MEOWTH #if P_FAMILY_ABRA static const struct FormChange sAlakazamFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALAKAZAM_MEGA, ITEM_ALAKAZITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ABRA #if P_FAMILY_MACHOP static const struct FormChange sMachampFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_MACHAMP_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MACHOP #if P_FAMILY_SLOWPOKE static const struct FormChange sSlowbroFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SLOWBRO_MEGA, ITEM_SLOWBRONITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SLOWPOKE #if P_FAMILY_GASTLY static const struct FormChange sGengarFormChangeTable[] = { - {}, - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GENGAR_MEGA, ITEM_GENGARITE}, +#endif +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_GENGAR_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_GASTLY #if P_FAMILY_ONIX #if P_GEN_2_CROSS_EVOS static const struct FormChange sSteelixFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_STEELIX_MEGA, ITEM_STEELIXITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_GEN_2_CROSS_EVOS #endif //P_FAMILY_ONIX @@ -103,461 +137,567 @@ static const struct FormChange sSteelixFormChangeTable[] = { #if P_FAMILY_KRABBY static const struct FormChange sKinglerFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_KINGLER_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_KRABBY #if P_FAMILY_KANGASKHAN static const struct FormChange sKangaskhanFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_KANGASKHAN_MEGA, ITEM_KANGASKHANITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_KANGASKHAN #if P_FAMILY_SCYTHER #if P_GEN_2_CROSS_EVOS static const struct FormChange sScizorFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCIZOR_MEGA, ITEM_SCIZORITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_GEN_2_CROSS_EVOS #endif //P_FAMILY_SCYTHER #if P_FAMILY_PINSIR static const struct FormChange sPinsirFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PINSIR_MEGA, ITEM_PINSIRITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_PINSIR #if P_FAMILY_MAGIKARP static const struct FormChange sGyaradosFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GYARADOS_MEGA, ITEM_GYARADOSITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MAGIKARP #if P_FAMILY_LAPRAS static const struct FormChange sLaprasFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_LAPRAS_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_LAPRAS #if P_FAMILY_EEVEE static const struct FormChange sEeveeFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_EEVEE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_EEVEE #if P_FAMILY_AERODACTYL static const struct FormChange sAerodactylFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AERODACTYL_MEGA, ITEM_AERODACTYLITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_AERODACTYL #if P_FAMILY_SNORLAX static const struct FormChange sSnorlaxFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_SNORLAX_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SNORLAX #if P_FAMILY_MEWTWO static const struct FormChange sMewtwoFormChangeTable[] = { - {}, - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_X, ITEM_MEWTWONITE_X}, + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_Y, ITEM_MEWTWONITE_Y}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MEWTWO #if P_FAMILY_MAREEP static const struct FormChange sAmpharosFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AMPHAROS_MEGA, ITEM_AMPHAROSITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MAREEP #if P_FAMILY_HERACROSS static const struct FormChange sHeracrossFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HERACROSS_MEGA, ITEM_HERACRONITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HERACROSS #if P_FAMILY_HOUNDOUR static const struct FormChange sHoundoomFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HOUNDOOM_MEGA, ITEM_HOUNDOOMINITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HOUNDOUR #if P_FAMILY_LARVITAR static const struct FormChange sTyranitarFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_TYRANITAR_MEGA, ITEM_TYRANITARITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_LARVITAR #if P_FAMILY_TREECKO static const struct FormChange sSceptileFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCEPTILE_MEGA, ITEM_SCEPTILITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_TREECKO #if P_FAMILY_TORCHIC static const struct FormChange sBlazikenFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLAZIKEN_MEGA, ITEM_BLAZIKENITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_TORCHIC #if P_FAMILY_MUDKIP static const struct FormChange sSwampertFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SWAMPERT_MEGA, ITEM_SWAMPERTITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MUDKIP #if P_FAMILY_RALTS static const struct FormChange sGardevoirFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARDEVOIR_MEGA, ITEM_GARDEVOIRITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #if P_GEN_4_CROSS_EVOS static const struct FormChange sGalladeFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GALLADE_MEGA, ITEM_GALLADITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_GEN_4_CROSS_EVOS #endif //P_FAMILY_RALTS #if P_FAMILY_SABLEYE static const struct FormChange sSableyeFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SABLEYE_MEGA, ITEM_SABLENITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SABLEYE #if P_FAMILY_MAWILE static const struct FormChange sMawileFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MAWILE_MEGA, ITEM_MAWILITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MAWILE #if P_FAMILY_ARON static const struct FormChange sAggronFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AGGRON_MEGA, ITEM_AGGRONITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ARON #if P_FAMILY_MEDITITE static const struct FormChange sMedichamFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEDICHAM_MEGA, ITEM_MEDICHAMITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MEDITITE #if P_FAMILY_ELECTRIKE static const struct FormChange sManectricFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MANECTRIC_MEGA, ITEM_MANECTITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ELECTRIKE #if P_FAMILY_CARVANHA static const struct FormChange sSharpedoFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SHARPEDO_MEGA, ITEM_SHARPEDONITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CARVANHA #if P_FAMILY_NUMEL static const struct FormChange sCameruptFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CAMERUPT_MEGA, ITEM_CAMERUPTITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_NUMEL #if P_FAMILY_SWABLU static const struct FormChange sAltariaFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALTARIA_MEGA, ITEM_ALTARIANITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SWABLU #if P_FAMILY_SHUPPET static const struct FormChange sBanetteFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BANETTE_MEGA, ITEM_BANETTITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SHUPPET #if P_FAMILY_ABSOL static const struct FormChange sAbsolFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABSOL_MEGA, ITEM_ABSOLITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ABSOL #if P_FAMILY_SNORUNT static const struct FormChange sGlalieFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GLALIE_MEGA, ITEM_GLALITITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SNORUNT #if P_FAMILY_CASTFORM static const struct FormChange sCastformFormChangeTable[] = { #if B_WEATHER_FORMS >= GEN_5 - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN, ABILITY_FORECAST}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN, ABILITY_FORECAST}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL | B_WEATHER_SNOW, ABILITY_FORECAST}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_NORMAL, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL | B_WEATHER_SNOW), ABILITY_FORECAST}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_NORMAL, B_WEATHER_NONE, ABILITY_FORECAST}, #else - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL | B_WEATHER_SNOW}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_NORMAL, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL | B_WEATHER_SNOW)}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_NORMAL, B_WEATHER_NONE}, #endif - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_CASTFORM_NORMAL}, + {FORM_CHANGE_FAINT, SPECIES_CASTFORM_NORMAL}, + {FORM_CHANGE_END_BATTLE, SPECIES_CASTFORM_NORMAL}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CASTFORM #if P_FAMILY_BAGON static const struct FormChange sSalamenceFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SALAMENCE_MEGA, ITEM_SALAMENCITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_BAGON #if P_FAMILY_BELDUM static const struct FormChange sMetagrossFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_METAGROSS_MEGA, ITEM_METAGROSSITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_BELDUM #if P_FAMILY_LATIAS static const struct FormChange sLatiasFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIAS_MEGA, ITEM_LATIASITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_LATIAS #if P_FAMILY_LATIOS static const struct FormChange sLatiosFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIOS_MEGA, ITEM_LATIOSITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_LATIOS #if P_FAMILY_KYOGRE static const struct FormChange sKyogreFormChangeTable[] = { - {}, - {}, +#if P_PRIMAL_REVERSIONS + {FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_KYOGRE_PRIMAL, ITEM_BLUE_ORB}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_KYOGRE #if P_FAMILY_GROUDON static const struct FormChange sGroudonFormChangeTable[] = { - {}, - {}, +#if P_PRIMAL_REVERSIONS + {FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_GROUDON_PRIMAL, ITEM_RED_ORB}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_GROUDON #if P_FAMILY_RAYQUAZA static const struct FormChange sRayquazaFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE, SPECIES_RAYQUAZA_MEGA, MOVE_DRAGON_ASCENT}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_RAYQUAZA +#if P_FAMILY_DEOXYS +static const struct FormChange sDeoxysNormalFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_ATTACK, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sDeoxysAttackFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_DEFENSE, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sDeoxysDefenseFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_SPEED, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sDeoxysSpeedFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_NORMAL, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; +#endif //P_FAMILY_DEOXYS + #if P_FAMILY_BURMY static const struct FormChange sBurmyFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_PLANT_CLOAK, BATTLE_TERRAIN_GRASS}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_PLANT_CLOAK, BATTLE_TERRAIN_LONG_GRASS}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_PLANT_CLOAK, BATTLE_TERRAIN_POND}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_PLANT_CLOAK, BATTLE_TERRAIN_MOUNTAIN}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_PLANT_CLOAK, BATTLE_TERRAIN_PLAIN}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_SANDY_CLOAK, BATTLE_TERRAIN_CAVE}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_SANDY_CLOAK, BATTLE_TERRAIN_SAND}, + {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_TRASH_CLOAK, BATTLE_TERRAIN_BUILDING}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_BURMY #if P_FAMILY_CHERUBI static const struct FormChange sCherrimFormChangeTable[] = { #if B_WEATHER_FORMS >= GEN_5 - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_SUNSHINE, B_WEATHER_SUN, ABILITY_FLOWER_GIFT}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_OVERCAST, ~B_WEATHER_SUN, ABILITY_FLOWER_GIFT}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_OVERCAST, B_WEATHER_NONE, ABILITY_FLOWER_GIFT}, #else - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_SUNSHINE, B_WEATHER_SUN}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_OVERCAST, ~B_WEATHER_SUN}, + {FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_OVERCAST, B_WEATHER_NONE}, #endif - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_CHERRIM_OVERCAST}, + {FORM_CHANGE_FAINT, SPECIES_CHERRIM_OVERCAST}, + {FORM_CHANGE_END_BATTLE, SPECIES_CHERRIM_OVERCAST}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CHERUBI #if P_FAMILY_BUNEARY static const struct FormChange sLopunnyFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LOPUNNY_MEGA, ITEM_LOPUNNITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_BUNEARY #if P_FAMILY_GIBLE static const struct FormChange sGarchompFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARCHOMP_MEGA, ITEM_GARCHOMPITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_GIBLE #if P_FAMILY_RIOLU static const struct FormChange sLucarioFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LUCARIO_MEGA, ITEM_LUCARIONITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_RIOLU #if P_FAMILY_SNOVER static const struct FormChange sAbomasnowFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABOMASNOW_MEGA, ITEM_ABOMASITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SNOVER #if P_FAMILY_ROTOM static const struct FormChange sRotomFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM, ITEM_ROTOM_CATALOG, 0}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_HEAT, ITEM_ROTOM_CATALOG, 1}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_WASH, ITEM_ROTOM_CATALOG, 2}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_FROST, ITEM_ROTOM_CATALOG, 3}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_FAN, ITEM_ROTOM_CATALOG, 4}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_MOW, ITEM_ROTOM_CATALOG, 5}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ROTOM #if P_FAMILY_DIALGA static const struct FormChange sDialgaFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_DIALGA, ITEM_NONE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_DIALGA_ORIGIN, ITEM_ADAMANT_CRYSTAL}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_DIALGA #if P_FAMILY_PALKIA static const struct FormChange sPalkiaFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_PALKIA, ITEM_NONE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_PALKIA_ORIGIN, ITEM_LUSTROUS_GLOBE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_PALKIA #if P_FAMILY_GIRATINA static const struct FormChange sGiratinaFormChangeTable[] = { - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA_ALTERED, ITEM_NONE}, #if I_GRISEOUS_ORB_FORM_CHANGE < GEN_9 - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA_ORIGIN, ITEM_GRISEOUS_ORB}, #endif - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA_ORIGIN, ITEM_GRISEOUS_CORE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_GIRATINA #if P_FAMILY_SHAYMIN static const struct FormChange sShayminFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, + {FORM_CHANGE_WITHDRAW, SPECIES_SHAYMIN_LAND}, + {FORM_CHANGE_TIME_OF_DAY, SPECIES_SHAYMIN_LAND, NIGHT}, + {FORM_CHANGE_STATUS, SPECIES_SHAYMIN_LAND, (STATUS1_FREEZE | STATUS1_FROSTBITE)}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SHAYMIN #if P_FAMILY_ARCEUS static const struct FormChange sArceusFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_NORMAL, ITEM_NONE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FIGHTING, ITEM_FIST_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FIGHTING, ITEM_FIGHTINIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FLYING, ITEM_SKY_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FLYING, ITEM_FLYINIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_POISON, ITEM_TOXIC_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_POISON, ITEM_POISONIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_ROCK, ITEM_STONE_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_ROCK, ITEM_ROCKIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_GROUND, ITEM_EARTH_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_GROUND, ITEM_GROUNDIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_BUG, ITEM_INSECT_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_BUG, ITEM_BUGINIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_GHOST, ITEM_SPOOKY_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_GHOST, ITEM_GHOSTIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_STEEL, ITEM_IRON_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_STEEL, ITEM_STEELIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FIRE, ITEM_FLAME_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FIRE, ITEM_FIRIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_WATER, ITEM_SPLASH_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_WATER, ITEM_WATERIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_GRASS, ITEM_MEADOW_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_GRASS, ITEM_GRASSIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_ELECTRIC, ITEM_ZAP_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_ELECTRIC, ITEM_ELECTRIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_PSYCHIC, ITEM_MIND_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_PSYCHIC, ITEM_PSYCHIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_ICE, ITEM_ICICLE_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_ICE, ITEM_ICIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_DRAGON, ITEM_DRACO_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_DRAGON, ITEM_DRAGONIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_DARK, ITEM_DREAD_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_DARK, ITEM_DARKINIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_PIXIE_PLATE, ABILITY_MULTITYPE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_FAIRIUM_Z, ABILITY_MULTITYPE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ARCEUS #if P_FAMILY_AUDINO static const struct FormChange sAudinoFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AUDINO_MEGA, ITEM_AUDINITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_AUDINO #if P_FAMILY_DARUMAKA static const struct FormChange sDarmanitanFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_STANDARD_MODE, ABILITY_ZEN_MODE, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_ZEN_MODE, ABILITY_ZEN_MODE, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_FAINT, SPECIES_DARMANITAN_STANDARD_MODE}, + {FORM_CHANGE_END_BATTLE, SPECIES_DARMANITAN_STANDARD_MODE}, + {FORM_CHANGE_TERMINATOR}, }; #if P_GALARIAN_FORMS static const struct FormChange sDarmanitanGalarianFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_GALARIAN_STANDARD_MODE, ABILITY_ZEN_MODE, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_GALARIAN_ZEN_MODE, ABILITY_ZEN_MODE, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_FAINT, SPECIES_DARMANITAN_GALARIAN_STANDARD_MODE}, + {FORM_CHANGE_END_BATTLE, SPECIES_DARMANITAN_GALARIAN_STANDARD_MODE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_GALARIAN_FORMS #endif //P_FAMILY_DARUMAKA @@ -565,510 +705,577 @@ static const struct FormChange sDarmanitanGalarianFormChangeTable[] = { #if P_FAMILY_TRUBBISH static const struct FormChange sGarbodorFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_GARBODOR_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_TRUBBISH #if P_FAMILY_TORNADUS static const struct FormChange sTornadusFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_ITEM_USE, SPECIES_TORNADUS_INCARNATE, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_TORNADUS #if P_FAMILY_THUNDURUS static const struct FormChange sThundurusFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_ITEM_USE, SPECIES_THUNDURUS_INCARNATE, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_THUNDURUS #if P_FAMILY_LANDORUS static const struct FormChange sLandorusFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_ITEM_USE, SPECIES_LANDORUS_INCARNATE, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_LANDORUS #if P_FAMILY_KYUREM static const struct Fusion sKyuremFusionTable[] = { - {}, - {}, - {}, + {0, ITEM_DNA_SPLICERS, SPECIES_KYUREM, SPECIES_RESHIRAM, SPECIES_KYUREM_WHITE}, + {0, ITEM_DNA_SPLICERS, SPECIES_KYUREM, SPECIES_ZEKROM, SPECIES_KYUREM_BLACK}, + {FUSION_TERMINATOR}, }; #endif //P_FAMILY_KYUREM #if P_FAMILY_KELDEO static const struct FormChange sKeldeoFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED}, + {FORM_CHANGE_MOVE, SPECIES_KELDEO_ORDINARY, MOVE_SECRET_SWORD, WHEN_FORGOTTEN}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_KELDEO #if P_FAMILY_MELOETTA static const struct FormChange sMeloettaFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_FAINT, SPECIES_MELOETTA_ARIA}, + {FORM_CHANGE_END_BATTLE, SPECIES_MELOETTA_ARIA}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MELOETTA #if P_FAMILY_GENESECT static const struct FormChange sGenesectFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT, ITEM_NONE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_DOUSE_DRIVE, ITEM_DOUSE_DRIVE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_SHOCK_DRIVE, ITEM_SHOCK_DRIVE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_BURN_DRIVE, ITEM_BURN_DRIVE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_CHILL_DRIVE, ITEM_CHILL_DRIVE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_GENESECT #if P_FAMILY_FROAKIE static const struct FormChange sGreninjaBattleBondFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_FAINT, SPECIES_GRENINJA_BATTLE_BOND}, + {FORM_CHANGE_END_BATTLE, SPECIES_GRENINJA_BATTLE_BOND}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_FROAKIE #if P_FAMILY_HONEDGE static const struct FormChange sAegislashFormChangeTable[] = { - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HONEDGE #if P_FAMILY_XERNEAS static const struct FormChange sXerneasFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_BEGIN_BATTLE, SPECIES_XERNEAS_ACTIVE}, + {FORM_CHANGE_END_BATTLE, SPECIES_XERNEAS_NEUTRAL}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_XERNEAS #if P_FAMILY_ZYGARDE static const struct FormChange sZygarde50AuraBreakFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10_AURA_BREAK, ITEM_ZYGARDE_CUBE, 0}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_50_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 1}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sZygarde10AuraBreakFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_50_AURA_BREAK, ITEM_ZYGARDE_CUBE, 0}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 1}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sZygarde50PowerConstructFormChangeTable[] = { - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 0}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_50_AURA_BREAK, ITEM_ZYGARDE_CUBE, 1}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_ZYGARDE_COMPLETE, ABILITY_POWER_CONSTRUCT, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sZygarde10PowerConstructFormChangeTable[] = { - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_50_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 0}, + {FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10_AURA_BREAK, ITEM_ZYGARDE_CUBE, 1}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_ZYGARDE_COMPLETE, ABILITY_POWER_CONSTRUCT, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sZygardeCompleteFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_FAINT}, + {FORM_CHANGE_END_BATTLE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ZYGARDE #if P_FAMILY_DIANCIE static const struct FormChange sDiancieFormChangeTable[] = { - {}, - {}, +#if P_MEGA_EVOLUTIONS + {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_DIANCIE_MEGA, ITEM_DIANCITE}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_DIANCIE #if P_FAMILY_HOOPA static const struct FormChange sHoopaFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA_CONFINED}, + {FORM_CHANGE_WITHDRAW, SPECIES_HOOPA_CONFINED}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HOOPA #if P_FAMILY_ORICORIO static const struct FormChange sOricorioFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_BAILE, ITEM_RED_NECTAR}, + {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_POM_POM, ITEM_YELLOW_NECTAR}, + {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_PAU, ITEM_PINK_NECTAR}, + {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_SENSU, ITEM_PURPLE_NECTAR}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ORICORIO #if P_FAMILY_WISHIWASHI static const struct FormChange sWishiwashiFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_WISHIWASHI_SCHOOL, ABILITY_SCHOOLING, HP_HIGHER_THAN, 25}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_WISHIWASHI_SOLO, ABILITY_SCHOOLING, HP_LOWER_EQ_THAN, 25}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_WISHIWASHI_SOLO}, + {FORM_CHANGE_FAINT, SPECIES_WISHIWASHI_SOLO}, + {FORM_CHANGE_END_BATTLE, SPECIES_WISHIWASHI_SOLO}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_WISHIWASHI #if P_FAMILY_TYPE_NULL static const struct FormChange sSilvallyFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_NORMAL, ITEM_NONE, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_FIGHTING, ITEM_FIGHTING_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_FLYING, ITEM_FLYING_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_POISON, ITEM_POISON_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_GROUND, ITEM_GROUND_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_ROCK, ITEM_ROCK_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_BUG, ITEM_BUG_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_GHOST, ITEM_GHOST_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_STEEL, ITEM_STEEL_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_FIRE, ITEM_FIRE_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_WATER, ITEM_WATER_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_GRASS, ITEM_GRASS_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_ELECTRIC, ITEM_ELECTRIC_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_PSYCHIC, ITEM_PSYCHIC_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_ICE, ITEM_ICE_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_DRAGON, ITEM_DRAGON_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_DARK, ITEM_DARK_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_FAIRY, ITEM_FAIRY_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_TYPE_NULL #if P_FAMILY_MINIOR static const struct FormChange sMiniorRedFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_RED, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_RED, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_RED}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_RED}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_RED}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMiniorBlueFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_BLUE, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_BLUE, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_BLUE}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_BLUE}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_BLUE}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMiniorGreenFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_GREEN, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_GREEN, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_GREEN}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_GREEN}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_GREEN}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMiniorIndigoFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_INDIGO, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_INDIGO, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_INDIGO}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_INDIGO}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_INDIGO}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMiniorOrangeFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_ORANGE, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_ORANGE, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_ORANGE}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_ORANGE}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_ORANGE}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMiniorVioletFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_VIOLET, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_VIOLET, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_VIOLET}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_VIOLET}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_VIOLET}, + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMiniorYellowFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_YELLOW, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_YELLOW, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_YELLOW}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_YELLOW}, + {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_YELLOW}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MINIOR #if P_FAMILY_MIMIKYU static const struct FormChange sMimikyuFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_FAINT, SPECIES_MIMIKYU_DISGUISED}, + {FORM_CHANGE_END_BATTLE, SPECIES_MIMIKYU_DISGUISED}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sMimikyuTotemFormChangeTable[] = { + {FORM_CHANGE_FAINT, SPECIES_MIMIKYU_TOTEM_DISGUISED}, + {FORM_CHANGE_END_BATTLE, SPECIES_MIMIKYU_TOTEM_DISGUISED}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MIMIKYU #if P_FAMILY_NECROZMA static const struct Fusion sNecrozmaFusionTable[] = { - {}, - {}, - {}, + {1, ITEM_N_SOLARIZER, SPECIES_NECROZMA, SPECIES_SOLGALEO, SPECIES_NECROZMA_DUSK_MANE, MOVE_SUNSTEEL_STRIKE, MOVE_CONFUSION}, + {2, ITEM_N_LUNARIZER, SPECIES_NECROZMA, SPECIES_LUNALA, SPECIES_NECROZMA_DAWN_WINGS, MOVE_MOONGEIST_BEAM, MOVE_CONFUSION}, + {FUSION_TERMINATOR}, }; static const struct FormChange sNecrozmaDuskManeFormChangeTable[] = { - {}, - {}, +#if P_ULTRA_BURST_FORMS + {FORM_CHANGE_BATTLE_ULTRA_BURST, SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z}, +#endif + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sNecrozmaDawnWingsFormChangeTable[] = { - {}, - {}, +#if P_ULTRA_BURST_FORMS + {FORM_CHANGE_BATTLE_ULTRA_BURST, SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_NECROZMA #if P_FAMILY_MELTAN static const struct FormChange sMelmetalFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_MELMETAL_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MELTAN #if P_FAMILY_GROOKEY static const struct FormChange sRillaboomFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_RILLABOOM_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_GROOKEY #if P_FAMILY_SCORBUNNY static const struct FormChange sCinderaceFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CINDERACE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SCORBUNNY #if P_FAMILY_SOBBLE static const struct FormChange sInteleonFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_INTELEON_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SOBBLE #if P_FAMILY_ROOKIDEE static const struct FormChange sCorviknightFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CORVIKNIGHT_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ROOKIDEE #if P_FAMILY_BLIPBUG static const struct FormChange sOrbeetleFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_ORBEETLE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_BLIPBUG #if P_FAMILY_CHEWTLE static const struct FormChange sDrednawFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_DREDNAW_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CHEWTLE #if P_FAMILY_ROLYCOLY static const struct FormChange sCoalossalFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_COALOSSAL_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ROLYCOLY #if P_FAMILY_APPLIN static const struct FormChange sFlappleFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_FLAPPLE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAppletunFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_APPLETUN_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_APPLIN #if P_FAMILY_SILICOBRA static const struct FormChange sSandacondaFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_SANDACONDA_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SILICOBRA #if P_FAMILY_CRAMORANT static const struct FormChange sCramorantFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GULPING, ABILITY_GULP_MISSILE, HP_HIGHER_THAN, 50}, + {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GORGING, ABILITY_GULP_MISSILE, HP_LOWER_EQ_THAN, 50}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT}, + {FORM_CHANGE_FAINT, SPECIES_CRAMORANT}, + {FORM_CHANGE_END_BATTLE, SPECIES_CRAMORANT}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CRAMORANT #if P_FAMILY_TOXEL static const struct FormChange sToxtricityAmpedFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_TOXTRICITY_AMPED_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sToxtricityLowKeyFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_TOXTRICITY_LOW_KEY_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_TOXEL #if P_FAMILY_SIZZLIPEDE static const struct FormChange sCentiskorchFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CENTISKORCH_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_SIZZLIPEDE #if P_FAMILY_HATENNA static const struct FormChange sHattereneFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_HATTERENE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HATENNA #if P_FAMILY_IMPIDIMP static const struct FormChange sGrimmsnarlFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_GRIMMSNARL_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_IMPIDIMP #if P_FAMILY_MILCERY static const struct FormChange sAlcremieFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_ALCREMIE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MILCERY #if P_FAMILY_EISCUE static const struct FormChange sEiscueFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_FAINT, SPECIES_EISCUE_ICE_FACE}, + {FORM_CHANGE_END_BATTLE, SPECIES_EISCUE_ICE_FACE}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_EISCUE #if P_FAMILY_MORPEKO static const struct FormChange sMorpekoFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_BATTLE_TURN_END, SPECIES_MORPEKO_HANGRY, ABILITY_HUNGER_SWITCH}, + {FORM_CHANGE_BATTLE_TURN_END, SPECIES_MORPEKO_FULL_BELLY, ABILITY_HUNGER_SWITCH}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO_FULL_BELLY}, + {FORM_CHANGE_FAINT, SPECIES_MORPEKO_FULL_BELLY}, + {FORM_CHANGE_END_BATTLE, SPECIES_MORPEKO_FULL_BELLY}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_MORPEKO #if P_FAMILY_CUFANT static const struct FormChange sCopperajahFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_COPPERAJAH_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_CUFANT #if P_FAMILY_DURALUDON static const struct FormChange sDuraludonFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_DURALUDON_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_DURALUDON #if P_FAMILY_ZACIAN static const struct FormChange sZacianFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_BEGIN_BATTLE, SPECIES_ZACIAN_CROWNED_SWORD, ITEM_RUSTED_SWORD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BLADE}, + {FORM_CHANGE_END_BATTLE, SPECIES_ZACIAN_HERO_OF_MANY_BATTLES, ITEM_RUSTED_SWORD, MOVE_BEHEMOTH_BLADE, MOVE_IRON_HEAD}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ZACIAN #if P_FAMILY_ZAMAZENTA static const struct FormChange sZamazentaFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_BEGIN_BATTLE, SPECIES_ZAMAZENTA_CROWNED_SHIELD, ITEM_RUSTED_SHIELD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BASH}, + {FORM_CHANGE_END_BATTLE, SPECIES_ZAMAZENTA_HERO_OF_MANY_BATTLES, ITEM_RUSTED_SHIELD, MOVE_BEHEMOTH_BASH, MOVE_IRON_HEAD}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ZAMAZENTA #if P_FAMILY_KUBFU static const struct FormChange sUrshifuSingleStrikeFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_URSHIFU_SINGLE_STRIKE_STYLE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sUrshifuRapidStrikeFormChangeTable[] = { - {}, - {}, +#if P_GIGANTAMAX_FORMS + {FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_URSHIFU_RAPID_STRIKE_STYLE_GIGANTAMAX}, +#endif + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_KUBFU #if P_FAMILY_CALYREX static const struct Fusion sCalyrexFusionTable[] = { - {}, - {}, - {}, + {3, ITEM_REINS_OF_UNITY, SPECIES_CALYREX, SPECIES_GLASTRIER, SPECIES_CALYREX_ICE_RIDER, MOVE_GLACIAL_LANCE, MOVE_CONFUSION}, + {3, ITEM_REINS_OF_UNITY, SPECIES_CALYREX, SPECIES_SPECTRIER, SPECIES_CALYREX_SHADOW_RIDER, MOVE_ASTRAL_BARRAGE, MOVE_CONFUSION}, + {FUSION_TERMINATOR}, }; #endif //P_FAMILY_CALYREX #if P_FAMILY_ENAMORUS static const struct FormChange sEnamorusFormChangeTable[] = { - {}, - {}, - {}, + {FORM_CHANGE_ITEM_USE, SPECIES_ENAMORUS_INCARNATE, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_ITEM_USE, SPECIES_ENAMORUS_THERIAN, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_ENAMORUS #if P_FAMILY_FINIZEN static const struct FormChange sPalafinZeroFormChangeTable[] = { - {}, - {}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_PALAFIN_HERO}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_FINIZEN #if P_FAMILY_OGERPON static const struct FormChange sOgerponFormChangeTable[] = { - {}, - {}, - {}, - {}, - {}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_OGERPON_TEAL_MASK, ITEM_NONE}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_OGERPON_WELLSPRING_MASK, ITEM_WELLSPRING_MASK}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_OGERPON_HEARTHFLAME_MASK, ITEM_HEARTHFLAME_MASK}, + {FORM_CHANGE_ITEM_HOLD, SPECIES_OGERPON_CORNERSTONE_MASK, ITEM_CORNERSTONE_MASK}, + {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_OGERPON +#if P_FAMILY_TERAPAGOS +static const struct FormChange sTerapagosFormChangeTable[] = { + {FORM_CHANGE_BEGIN_BATTLE, SPECIES_TERAPAGOS_TERASTAL}, //needs to be tied to the ability +#if P_TERA_FORMS + //{FORM_CHANGE_TERASTALLIZATION, SPECIES_TERAPAGOS_STELLAR}, +#endif + {FORM_CHANGE_END_BATTLE, SPECIES_TERAPAGOS_NORMAL}, + {FORM_CHANGE_TERMINATOR}, +}; +#endif //P_FAMILY_TERAPAGOS + #undef WHEN_LEARNED #undef WHEN_FORGOTTEN diff --git a/src/data/pokemon/level_up_learnset_pointers.h b/src/data/pokemon/level_up_learnset_pointers.h deleted file mode 100644 index 6161f18a2..000000000 --- a/src/data/pokemon/level_up_learnset_pointers.h +++ /dev/null @@ -1,415 +0,0 @@ -// const u16 *const gLevelUpLearnsets[NUM_SPECIES] = -// { -// [SPECIES_NONE] = sBulbasaurLevelUpLearnset, -// [SPECIES_BULBASAUR] = sBulbasaurLevelUpLearnset, -// [SPECIES_IVYSAUR] = sIvysaurLevelUpLearnset, -// [SPECIES_VENUSAUR] = sVenusaurLevelUpLearnset, -// [SPECIES_CHARMANDER] = sCharmanderLevelUpLearnset, -// [SPECIES_CHARMELEON] = sCharmeleonLevelUpLearnset, -// [SPECIES_CHARIZARD] = sCharizardLevelUpLearnset, -// [SPECIES_SQUIRTLE] = sSquirtleLevelUpLearnset, -// [SPECIES_WARTORTLE] = sWartortleLevelUpLearnset, -// [SPECIES_BLASTOISE] = sBlastoiseLevelUpLearnset, -// [SPECIES_CATERPIE] = sCaterpieLevelUpLearnset, -// [SPECIES_METAPOD] = sMetapodLevelUpLearnset, -// [SPECIES_BUTTERFREE] = sButterfreeLevelUpLearnset, -// [SPECIES_WEEDLE] = sWeedleLevelUpLearnset, -// [SPECIES_KAKUNA] = sKakunaLevelUpLearnset, -// [SPECIES_BEEDRILL] = sBeedrillLevelUpLearnset, -// [SPECIES_PIDGEY] = sPidgeyLevelUpLearnset, -// [SPECIES_PIDGEOTTO] = sPidgeottoLevelUpLearnset, -// [SPECIES_PIDGEOT] = sPidgeotLevelUpLearnset, -// [SPECIES_RATTATA] = sRattataLevelUpLearnset, -// [SPECIES_RATICATE] = sRaticateLevelUpLearnset, -// [SPECIES_SPEAROW] = sSpearowLevelUpLearnset, -// [SPECIES_FEAROW] = sFearowLevelUpLearnset, -// [SPECIES_EKANS] = sEkansLevelUpLearnset, -// [SPECIES_ARBOK] = sArbokLevelUpLearnset, -// [SPECIES_PIKACHU] = sPikachuLevelUpLearnset, -// [SPECIES_RAICHU] = sRaichuLevelUpLearnset, -// [SPECIES_SANDSHREW] = sSandshrewLevelUpLearnset, -// [SPECIES_SANDSLASH] = sSandslashLevelUpLearnset, -// [SPECIES_NIDORAN_F] = sNidoranFLevelUpLearnset, -// [SPECIES_NIDORINA] = sNidorinaLevelUpLearnset, -// [SPECIES_NIDOQUEEN] = sNidoqueenLevelUpLearnset, -// [SPECIES_NIDORAN_M] = sNidoranMLevelUpLearnset, -// [SPECIES_NIDORINO] = sNidorinoLevelUpLearnset, -// [SPECIES_NIDOKING] = sNidokingLevelUpLearnset, -// [SPECIES_CLEFAIRY] = sClefairyLevelUpLearnset, -// [SPECIES_CLEFABLE] = sClefableLevelUpLearnset, -// [SPECIES_VULPIX] = sVulpixLevelUpLearnset, -// [SPECIES_NINETALES] = sNinetalesLevelUpLearnset, -// [SPECIES_JIGGLYPUFF] = sJigglypuffLevelUpLearnset, -// [SPECIES_WIGGLYTUFF] = sWigglytuffLevelUpLearnset, -// [SPECIES_ZUBAT] = sZubatLevelUpLearnset, -// [SPECIES_GOLBAT] = sGolbatLevelUpLearnset, -// [SPECIES_ODDISH] = sOddishLevelUpLearnset, -// [SPECIES_GLOOM] = sGloomLevelUpLearnset, -// [SPECIES_VILEPLUME] = sVileplumeLevelUpLearnset, -// [SPECIES_PARAS] = sParasLevelUpLearnset, -// [SPECIES_PARASECT] = sParasectLevelUpLearnset, -// [SPECIES_VENONAT] = sVenonatLevelUpLearnset, -// [SPECIES_VENOMOTH] = sVenomothLevelUpLearnset, -// [SPECIES_DIGLETT] = sDiglettLevelUpLearnset, -// [SPECIES_DUGTRIO] = sDugtrioLevelUpLearnset, -// [SPECIES_MEOWTH] = sMeowthLevelUpLearnset, -// [SPECIES_PERSIAN] = sPersianLevelUpLearnset, -// [SPECIES_PSYDUCK] = sPsyduckLevelUpLearnset, -// [SPECIES_GOLDUCK] = sGolduckLevelUpLearnset, -// [SPECIES_MANKEY] = sMankeyLevelUpLearnset, -// [SPECIES_PRIMEAPE] = sPrimeapeLevelUpLearnset, -// [SPECIES_GROWLITHE] = sGrowlitheLevelUpLearnset, -// [SPECIES_ARCANINE] = sArcanineLevelUpLearnset, -// [SPECIES_POLIWAG] = sPoliwagLevelUpLearnset, -// [SPECIES_POLIWHIRL] = sPoliwhirlLevelUpLearnset, -// [SPECIES_POLIWRATH] = sPoliwrathLevelUpLearnset, -// [SPECIES_ABRA] = sAbraLevelUpLearnset, -// [SPECIES_KADABRA] = sKadabraLevelUpLearnset, -// [SPECIES_ALAKAZAM] = sAlakazamLevelUpLearnset, -// [SPECIES_MACHOP] = sMachopLevelUpLearnset, -// [SPECIES_MACHOKE] = sMachokeLevelUpLearnset, -// [SPECIES_MACHAMP] = sMachampLevelUpLearnset, -// [SPECIES_BELLSPROUT] = sBellsproutLevelUpLearnset, -// [SPECIES_WEEPINBELL] = sWeepinbellLevelUpLearnset, -// [SPECIES_VICTREEBEL] = sVictreebelLevelUpLearnset, -// [SPECIES_TENTACOOL] = sTentacoolLevelUpLearnset, -// [SPECIES_TENTACRUEL] = sTentacruelLevelUpLearnset, -// [SPECIES_GEODUDE] = sGeodudeLevelUpLearnset, -// [SPECIES_GRAVELER] = sGravelerLevelUpLearnset, -// [SPECIES_GOLEM] = sGolemLevelUpLearnset, -// [SPECIES_PONYTA] = sPonytaLevelUpLearnset, -// [SPECIES_RAPIDASH] = sRapidashLevelUpLearnset, -// [SPECIES_SLOWPOKE] = sSlowpokeLevelUpLearnset, -// [SPECIES_SLOWBRO] = sSlowbroLevelUpLearnset, -// [SPECIES_MAGNEMITE] = sMagnemiteLevelUpLearnset, -// [SPECIES_MAGNETON] = sMagnetonLevelUpLearnset, -// [SPECIES_FARFETCHD] = sFarfetchdLevelUpLearnset, -// [SPECIES_DODUO] = sDoduoLevelUpLearnset, -// [SPECIES_DODRIO] = sDodrioLevelUpLearnset, -// [SPECIES_SEEL] = sSeelLevelUpLearnset, -// [SPECIES_DEWGONG] = sDewgongLevelUpLearnset, -// [SPECIES_GRIMER] = sGrimerLevelUpLearnset, -// [SPECIES_MUK] = sMukLevelUpLearnset, -// [SPECIES_SHELLDER] = sShellderLevelUpLearnset, -// [SPECIES_CLOYSTER] = sCloysterLevelUpLearnset, -// [SPECIES_GASTLY] = sGastlyLevelUpLearnset, -// [SPECIES_HAUNTER] = sHaunterLevelUpLearnset, -// [SPECIES_GENGAR] = sGengarLevelUpLearnset, -// [SPECIES_ONIX] = sOnixLevelUpLearnset, -// [SPECIES_DROWZEE] = sDrowzeeLevelUpLearnset, -// [SPECIES_HYPNO] = sHypnoLevelUpLearnset, -// [SPECIES_KRABBY] = sKrabbyLevelUpLearnset, -// [SPECIES_KINGLER] = sKinglerLevelUpLearnset, -// [SPECIES_VOLTORB] = sVoltorbLevelUpLearnset, -// [SPECIES_ELECTRODE] = sElectrodeLevelUpLearnset, -// [SPECIES_EXEGGCUTE] = sExeggcuteLevelUpLearnset, -// [SPECIES_EXEGGUTOR] = sExeggutorLevelUpLearnset, -// [SPECIES_CUBONE] = sCuboneLevelUpLearnset, -// [SPECIES_MAROWAK] = sMarowakLevelUpLearnset, -// [SPECIES_HITMONLEE] = sHitmonleeLevelUpLearnset, -// [SPECIES_HITMONCHAN] = sHitmonchanLevelUpLearnset, -// [SPECIES_LICKITUNG] = sLickitungLevelUpLearnset, -// [SPECIES_KOFFING] = sKoffingLevelUpLearnset, -// [SPECIES_WEEZING] = sWeezingLevelUpLearnset, -// [SPECIES_RHYHORN] = sRhyhornLevelUpLearnset, -// [SPECIES_RHYDON] = sRhydonLevelUpLearnset, -// [SPECIES_CHANSEY] = sChanseyLevelUpLearnset, -// [SPECIES_TANGELA] = sTangelaLevelUpLearnset, -// [SPECIES_KANGASKHAN] = sKangaskhanLevelUpLearnset, -// [SPECIES_HORSEA] = sHorseaLevelUpLearnset, -// [SPECIES_SEADRA] = sSeadraLevelUpLearnset, -// [SPECIES_GOLDEEN] = sGoldeenLevelUpLearnset, -// [SPECIES_SEAKING] = sSeakingLevelUpLearnset, -// [SPECIES_STARYU] = sStaryuLevelUpLearnset, -// [SPECIES_STARMIE] = sStarmieLevelUpLearnset, -// [SPECIES_MR_MIME] = sMrMimeLevelUpLearnset, -// [SPECIES_SCYTHER] = sScytherLevelUpLearnset, -// [SPECIES_JYNX] = sJynxLevelUpLearnset, -// [SPECIES_ELECTABUZZ] = sElectabuzzLevelUpLearnset, -// [SPECIES_MAGMAR] = sMagmarLevelUpLearnset, -// [SPECIES_PINSIR] = sPinsirLevelUpLearnset, -// [SPECIES_TAUROS] = sTaurosLevelUpLearnset, -// [SPECIES_MAGIKARP] = sMagikarpLevelUpLearnset, -// [SPECIES_GYARADOS] = sGyaradosLevelUpLearnset, -// [SPECIES_LAPRAS] = sLaprasLevelUpLearnset, -// [SPECIES_DITTO] = sDittoLevelUpLearnset, -// [SPECIES_EEVEE] = sEeveeLevelUpLearnset, -// [SPECIES_VAPOREON] = sVaporeonLevelUpLearnset, -// [SPECIES_JOLTEON] = sJolteonLevelUpLearnset, -// [SPECIES_FLAREON] = sFlareonLevelUpLearnset, -// [SPECIES_PORYGON] = sPorygonLevelUpLearnset, -// [SPECIES_OMANYTE] = sOmanyteLevelUpLearnset, -// [SPECIES_OMASTAR] = sOmastarLevelUpLearnset, -// [SPECIES_KABUTO] = sKabutoLevelUpLearnset, -// [SPECIES_KABUTOPS] = sKabutopsLevelUpLearnset, -// [SPECIES_AERODACTYL] = sAerodactylLevelUpLearnset, -// [SPECIES_SNORLAX] = sSnorlaxLevelUpLearnset, -// [SPECIES_ARTICUNO] = sArticunoLevelUpLearnset, -// [SPECIES_ZAPDOS] = sZapdosLevelUpLearnset, -// [SPECIES_MOLTRES] = sMoltresLevelUpLearnset, -// [SPECIES_DRATINI] = sDratiniLevelUpLearnset, -// [SPECIES_DRAGONAIR] = sDragonairLevelUpLearnset, -// [SPECIES_DRAGONITE] = sDragoniteLevelUpLearnset, -// [SPECIES_MEWTWO] = sMewtwoLevelUpLearnset, -// [SPECIES_MEW] = sMewLevelUpLearnset, -// [SPECIES_CHIKORITA] = sChikoritaLevelUpLearnset, -// [SPECIES_BAYLEEF] = sBayleefLevelUpLearnset, -// [SPECIES_MEGANIUM] = sMeganiumLevelUpLearnset, -// [SPECIES_CYNDAQUIL] = sCyndaquilLevelUpLearnset, -// [SPECIES_QUILAVA] = sQuilavaLevelUpLearnset, -// [SPECIES_TYPHLOSION] = sTyphlosionLevelUpLearnset, -// [SPECIES_TOTODILE] = sTotodileLevelUpLearnset, -// [SPECIES_CROCONAW] = sCroconawLevelUpLearnset, -// [SPECIES_FERALIGATR] = sFeraligatrLevelUpLearnset, -// [SPECIES_SENTRET] = sSentretLevelUpLearnset, -// [SPECIES_FURRET] = sFurretLevelUpLearnset, -// [SPECIES_HOOTHOOT] = sHoothootLevelUpLearnset, -// [SPECIES_NOCTOWL] = sNoctowlLevelUpLearnset, -// [SPECIES_LEDYBA] = sLedybaLevelUpLearnset, -// [SPECIES_LEDIAN] = sLedianLevelUpLearnset, -// [SPECIES_SPINARAK] = sSpinarakLevelUpLearnset, -// [SPECIES_ARIADOS] = sAriadosLevelUpLearnset, -// [SPECIES_CROBAT] = sCrobatLevelUpLearnset, -// [SPECIES_CHINCHOU] = sChinchouLevelUpLearnset, -// [SPECIES_LANTURN] = sLanturnLevelUpLearnset, -// [SPECIES_PICHU] = sPichuLevelUpLearnset, -// [SPECIES_CLEFFA] = sCleffaLevelUpLearnset, -// [SPECIES_IGGLYBUFF] = sIgglybuffLevelUpLearnset, -// [SPECIES_TOGEPI] = sTogepiLevelUpLearnset, -// [SPECIES_TOGETIC] = sTogeticLevelUpLearnset, -// [SPECIES_NATU] = sNatuLevelUpLearnset, -// [SPECIES_XATU] = sXatuLevelUpLearnset, -// [SPECIES_MAREEP] = sMareepLevelUpLearnset, -// [SPECIES_FLAAFFY] = sFlaaffyLevelUpLearnset, -// [SPECIES_AMPHAROS] = sAmpharosLevelUpLearnset, -// [SPECIES_BELLOSSOM] = sBellossomLevelUpLearnset, -// [SPECIES_MARILL] = sMarillLevelUpLearnset, -// [SPECIES_AZUMARILL] = sAzumarillLevelUpLearnset, -// [SPECIES_SUDOWOODO] = sSudowoodoLevelUpLearnset, -// [SPECIES_POLITOED] = sPolitoedLevelUpLearnset, -// [SPECIES_HOPPIP] = sHoppipLevelUpLearnset, -// [SPECIES_SKIPLOOM] = sSkiploomLevelUpLearnset, -// [SPECIES_JUMPLUFF] = sJumpluffLevelUpLearnset, -// [SPECIES_AIPOM] = sAipomLevelUpLearnset, -// [SPECIES_SUNKERN] = sSunkernLevelUpLearnset, -// [SPECIES_SUNFLORA] = sSunfloraLevelUpLearnset, -// [SPECIES_YANMA] = sYanmaLevelUpLearnset, -// [SPECIES_WOOPER] = sWooperLevelUpLearnset, -// [SPECIES_QUAGSIRE] = sQuagsireLevelUpLearnset, -// [SPECIES_ESPEON] = sEspeonLevelUpLearnset, -// [SPECIES_UMBREON] = sUmbreonLevelUpLearnset, -// [SPECIES_MURKROW] = sMurkrowLevelUpLearnset, -// [SPECIES_SLOWKING] = sSlowkingLevelUpLearnset, -// [SPECIES_MISDREAVUS] = sMisdreavusLevelUpLearnset, -// [SPECIES_UNOWN] = sUnownLevelUpLearnset, -// [SPECIES_WOBBUFFET] = sWobbuffetLevelUpLearnset, -// [SPECIES_GIRAFARIG] = sGirafarigLevelUpLearnset, -// [SPECIES_PINECO] = sPinecoLevelUpLearnset, -// [SPECIES_FORRETRESS] = sForretressLevelUpLearnset, -// [SPECIES_DUNSPARCE] = sDunsparceLevelUpLearnset, -// [SPECIES_GLIGAR] = sGligarLevelUpLearnset, -// [SPECIES_STEELIX] = sSteelixLevelUpLearnset, -// [SPECIES_SNUBBULL] = sSnubbullLevelUpLearnset, -// [SPECIES_GRANBULL] = sGranbullLevelUpLearnset, -// [SPECIES_QWILFISH] = sQwilfishLevelUpLearnset, -// [SPECIES_SCIZOR] = sScizorLevelUpLearnset, -// [SPECIES_SHUCKLE] = sShuckleLevelUpLearnset, -// [SPECIES_HERACROSS] = sHeracrossLevelUpLearnset, -// [SPECIES_SNEASEL] = sSneaselLevelUpLearnset, -// [SPECIES_TEDDIURSA] = sTeddiursaLevelUpLearnset, -// [SPECIES_URSARING] = sUrsaringLevelUpLearnset, -// [SPECIES_SLUGMA] = sSlugmaLevelUpLearnset, -// [SPECIES_MAGCARGO] = sMagcargoLevelUpLearnset, -// [SPECIES_SWINUB] = sSwinubLevelUpLearnset, -// [SPECIES_PILOSWINE] = sPiloswineLevelUpLearnset, -// [SPECIES_CORSOLA] = sCorsolaLevelUpLearnset, -// [SPECIES_REMORAID] = sRemoraidLevelUpLearnset, -// [SPECIES_OCTILLERY] = sOctilleryLevelUpLearnset, -// [SPECIES_DELIBIRD] = sDelibirdLevelUpLearnset, -// [SPECIES_MANTINE] = sMantineLevelUpLearnset, -// [SPECIES_SKARMORY] = sSkarmoryLevelUpLearnset, -// [SPECIES_HOUNDOUR] = sHoundourLevelUpLearnset, -// [SPECIES_HOUNDOOM] = sHoundoomLevelUpLearnset, -// [SPECIES_KINGDRA] = sKingdraLevelUpLearnset, -// [SPECIES_PHANPY] = sPhanpyLevelUpLearnset, -// [SPECIES_DONPHAN] = sDonphanLevelUpLearnset, -// [SPECIES_PORYGON2] = sPorygon2LevelUpLearnset, -// [SPECIES_STANTLER] = sStantlerLevelUpLearnset, -// [SPECIES_SMEARGLE] = sSmeargleLevelUpLearnset, -// [SPECIES_TYROGUE] = sTyrogueLevelUpLearnset, -// [SPECIES_HITMONTOP] = sHitmontopLevelUpLearnset, -// [SPECIES_SMOOCHUM] = sSmoochumLevelUpLearnset, -// [SPECIES_ELEKID] = sElekidLevelUpLearnset, -// [SPECIES_MAGBY] = sMagbyLevelUpLearnset, -// [SPECIES_MILTANK] = sMiltankLevelUpLearnset, -// [SPECIES_BLISSEY] = sBlisseyLevelUpLearnset, -// [SPECIES_RAIKOU] = sRaikouLevelUpLearnset, -// [SPECIES_ENTEI] = sEnteiLevelUpLearnset, -// [SPECIES_SUICUNE] = sSuicuneLevelUpLearnset, -// [SPECIES_LARVITAR] = sLarvitarLevelUpLearnset, -// [SPECIES_PUPITAR] = sPupitarLevelUpLearnset, -// [SPECIES_TYRANITAR] = sTyranitarLevelUpLearnset, -// [SPECIES_LUGIA] = sLugiaLevelUpLearnset, -// [SPECIES_HO_OH] = sHoOhLevelUpLearnset, -// [SPECIES_CELEBI] = sCelebiLevelUpLearnset, -// [SPECIES_OLD_UNOWN_B] = sSpecies252LevelUpLearnset, -// [SPECIES_OLD_UNOWN_C] = sSpecies253LevelUpLearnset, -// [SPECIES_OLD_UNOWN_D] = sSpecies254LevelUpLearnset, -// [SPECIES_OLD_UNOWN_E] = sSpecies255LevelUpLearnset, -// [SPECIES_OLD_UNOWN_F] = sSpecies256LevelUpLearnset, -// [SPECIES_OLD_UNOWN_G] = sSpecies257LevelUpLearnset, -// [SPECIES_OLD_UNOWN_H] = sSpecies258LevelUpLearnset, -// [SPECIES_OLD_UNOWN_I] = sSpecies259LevelUpLearnset, -// [SPECIES_OLD_UNOWN_J] = sSpecies260LevelUpLearnset, -// [SPECIES_OLD_UNOWN_K] = sSpecies261LevelUpLearnset, -// [SPECIES_OLD_UNOWN_L] = sSpecies262LevelUpLearnset, -// [SPECIES_OLD_UNOWN_M] = sSpecies263LevelUpLearnset, -// [SPECIES_OLD_UNOWN_N] = sSpecies264LevelUpLearnset, -// [SPECIES_OLD_UNOWN_O] = sSpecies265LevelUpLearnset, -// [SPECIES_OLD_UNOWN_P] = sSpecies266LevelUpLearnset, -// [SPECIES_OLD_UNOWN_Q] = sSpecies267LevelUpLearnset, -// [SPECIES_OLD_UNOWN_R] = sSpecies268LevelUpLearnset, -// [SPECIES_OLD_UNOWN_S] = sSpecies269LevelUpLearnset, -// [SPECIES_OLD_UNOWN_T] = sSpecies270LevelUpLearnset, -// [SPECIES_OLD_UNOWN_U] = sSpecies271LevelUpLearnset, -// [SPECIES_OLD_UNOWN_V] = sSpecies272LevelUpLearnset, -// [SPECIES_OLD_UNOWN_W] = sSpecies273LevelUpLearnset, -// [SPECIES_OLD_UNOWN_X] = sSpecies274LevelUpLearnset, -// [SPECIES_OLD_UNOWN_Y] = sSpecies275LevelUpLearnset, -// [SPECIES_OLD_UNOWN_Z] = sSpecies276LevelUpLearnset, -// [SPECIES_TREECKO] = sTreeckoLevelUpLearnset, -// [SPECIES_GROVYLE] = sGrovyleLevelUpLearnset, -// [SPECIES_SCEPTILE] = sSceptileLevelUpLearnset, -// [SPECIES_TORCHIC] = sTorchicLevelUpLearnset, -// [SPECIES_COMBUSKEN] = sCombuskenLevelUpLearnset, -// [SPECIES_BLAZIKEN] = sBlazikenLevelUpLearnset, -// [SPECIES_MUDKIP] = sMudkipLevelUpLearnset, -// [SPECIES_MARSHTOMP] = sMarshtompLevelUpLearnset, -// [SPECIES_SWAMPERT] = sSwampertLevelUpLearnset, -// [SPECIES_POOCHYENA] = sPoochyenaLevelUpLearnset, -// [SPECIES_MIGHTYENA] = sMightyenaLevelUpLearnset, -// [SPECIES_ZIGZAGOON] = sZigzagoonLevelUpLearnset, -// [SPECIES_LINOONE] = sLinooneLevelUpLearnset, -// [SPECIES_WURMPLE] = sWurmpleLevelUpLearnset, -// [SPECIES_SILCOON] = sSilcoonLevelUpLearnset, -// [SPECIES_BEAUTIFLY] = sBeautiflyLevelUpLearnset, -// [SPECIES_CASCOON] = sCascoonLevelUpLearnset, -// [SPECIES_DUSTOX] = sDustoxLevelUpLearnset, -// [SPECIES_LOTAD] = sLotadLevelUpLearnset, -// [SPECIES_LOMBRE] = sLombreLevelUpLearnset, -// [SPECIES_LUDICOLO] = sLudicoloLevelUpLearnset, -// [SPECIES_SEEDOT] = sSeedotLevelUpLearnset, -// [SPECIES_NUZLEAF] = sNuzleafLevelUpLearnset, -// [SPECIES_SHIFTRY] = sShiftryLevelUpLearnset, -// [SPECIES_NINCADA] = sNincadaLevelUpLearnset, -// [SPECIES_NINJASK] = sNinjaskLevelUpLearnset, -// [SPECIES_SHEDINJA] = sShedinjaLevelUpLearnset, -// [SPECIES_TAILLOW] = sTaillowLevelUpLearnset, -// [SPECIES_SWELLOW] = sSwellowLevelUpLearnset, -// [SPECIES_SHROOMISH] = sShroomishLevelUpLearnset, -// [SPECIES_BRELOOM] = sBreloomLevelUpLearnset, -// [SPECIES_SPINDA] = sSpindaLevelUpLearnset, -// [SPECIES_WINGULL] = sWingullLevelUpLearnset, -// [SPECIES_PELIPPER] = sPelipperLevelUpLearnset, -// [SPECIES_SURSKIT] = sSurskitLevelUpLearnset, -// [SPECIES_MASQUERAIN] = sMasquerainLevelUpLearnset, -// [SPECIES_WAILMER] = sWailmerLevelUpLearnset, -// [SPECIES_WAILORD] = sWailordLevelUpLearnset, -// [SPECIES_SKITTY] = sSkittyLevelUpLearnset, -// [SPECIES_DELCATTY] = sDelcattyLevelUpLearnset, -// [SPECIES_KECLEON] = sKecleonLevelUpLearnset, -// [SPECIES_BALTOY] = sBaltoyLevelUpLearnset, -// [SPECIES_CLAYDOL] = sClaydolLevelUpLearnset, -// [SPECIES_NOSEPASS] = sNosepassLevelUpLearnset, -// [SPECIES_TORKOAL] = sTorkoalLevelUpLearnset, -// [SPECIES_SABLEYE] = sSableyeLevelUpLearnset, -// [SPECIES_BARBOACH] = sBarboachLevelUpLearnset, -// [SPECIES_WHISCASH] = sWhiscashLevelUpLearnset, -// [SPECIES_LUVDISC] = sLuvdiscLevelUpLearnset, -// [SPECIES_CORPHISH] = sCorphishLevelUpLearnset, -// [SPECIES_CRAWDAUNT] = sCrawdauntLevelUpLearnset, -// [SPECIES_FEEBAS] = sFeebasLevelUpLearnset, -// [SPECIES_MILOTIC] = sMiloticLevelUpLearnset, -// [SPECIES_CARVANHA] = sCarvanhaLevelUpLearnset, -// [SPECIES_SHARPEDO] = sSharpedoLevelUpLearnset, -// [SPECIES_TRAPINCH] = sTrapinchLevelUpLearnset, -// [SPECIES_VIBRAVA] = sVibravaLevelUpLearnset, -// [SPECIES_FLYGON] = sFlygonLevelUpLearnset, -// [SPECIES_MAKUHITA] = sMakuhitaLevelUpLearnset, -// [SPECIES_HARIYAMA] = sHariyamaLevelUpLearnset, -// [SPECIES_ELECTRIKE] = sElectrikeLevelUpLearnset, -// [SPECIES_MANECTRIC] = sManectricLevelUpLearnset, -// [SPECIES_NUMEL] = sNumelLevelUpLearnset, -// [SPECIES_CAMERUPT] = sCameruptLevelUpLearnset, -// [SPECIES_SPHEAL] = sSphealLevelUpLearnset, -// [SPECIES_SEALEO] = sSealeoLevelUpLearnset, -// [SPECIES_WALREIN] = sWalreinLevelUpLearnset, -// [SPECIES_CACNEA] = sCacneaLevelUpLearnset, -// [SPECIES_CACTURNE] = sCacturneLevelUpLearnset, -// [SPECIES_SNORUNT] = sSnoruntLevelUpLearnset, -// [SPECIES_GLALIE] = sGlalieLevelUpLearnset, -// [SPECIES_LUNATONE] = sLunatoneLevelUpLearnset, -// [SPECIES_SOLROCK] = sSolrockLevelUpLearnset, -// [SPECIES_AZURILL] = sAzurillLevelUpLearnset, -// [SPECIES_SPOINK] = sSpoinkLevelUpLearnset, -// [SPECIES_GRUMPIG] = sGrumpigLevelUpLearnset, -// [SPECIES_PLUSLE] = sPlusleLevelUpLearnset, -// [SPECIES_MINUN] = sMinunLevelUpLearnset, -// [SPECIES_MAWILE] = sMawileLevelUpLearnset, -// [SPECIES_MEDITITE] = sMedititeLevelUpLearnset, -// [SPECIES_MEDICHAM] = sMedichamLevelUpLearnset, -// [SPECIES_SWABLU] = sSwabluLevelUpLearnset, -// [SPECIES_ALTARIA] = sAltariaLevelUpLearnset, -// [SPECIES_WYNAUT] = sWynautLevelUpLearnset, -// [SPECIES_DUSKULL] = sDuskullLevelUpLearnset, -// [SPECIES_DUSCLOPS] = sDusclopsLevelUpLearnset, -// [SPECIES_ROSELIA] = sRoseliaLevelUpLearnset, -// [SPECIES_SLAKOTH] = sSlakothLevelUpLearnset, -// [SPECIES_VIGOROTH] = sVigorothLevelUpLearnset, -// [SPECIES_SLAKING] = sSlakingLevelUpLearnset, -// [SPECIES_GULPIN] = sGulpinLevelUpLearnset, -// [SPECIES_SWALOT] = sSwalotLevelUpLearnset, -// [SPECIES_TROPIUS] = sTropiusLevelUpLearnset, -// [SPECIES_WHISMUR] = sWhismurLevelUpLearnset, -// [SPECIES_LOUDRED] = sLoudredLevelUpLearnset, -// [SPECIES_EXPLOUD] = sExploudLevelUpLearnset, -// [SPECIES_CLAMPERL] = sClamperlLevelUpLearnset, -// [SPECIES_HUNTAIL] = sHuntailLevelUpLearnset, -// [SPECIES_GOREBYSS] = sGorebyssLevelUpLearnset, -// [SPECIES_ABSOL] = sAbsolLevelUpLearnset, -// [SPECIES_SHUPPET] = sShuppetLevelUpLearnset, -// [SPECIES_BANETTE] = sBanetteLevelUpLearnset, -// [SPECIES_SEVIPER] = sSeviperLevelUpLearnset, -// [SPECIES_ZANGOOSE] = sZangooseLevelUpLearnset, -// [SPECIES_RELICANTH] = sRelicanthLevelUpLearnset, -// [SPECIES_ARON] = sAronLevelUpLearnset, -// [SPECIES_LAIRON] = sLaironLevelUpLearnset, -// [SPECIES_AGGRON] = sAggronLevelUpLearnset, -// [SPECIES_CASTFORM] = sCastformLevelUpLearnset, -// [SPECIES_VOLBEAT] = sVolbeatLevelUpLearnset, -// [SPECIES_ILLUMISE] = sIllumiseLevelUpLearnset, -// [SPECIES_LILEEP] = sLileepLevelUpLearnset, -// [SPECIES_CRADILY] = sCradilyLevelUpLearnset, -// [SPECIES_ANORITH] = sAnorithLevelUpLearnset, -// [SPECIES_ARMALDO] = sArmaldoLevelUpLearnset, -// [SPECIES_RALTS] = sRaltsLevelUpLearnset, -// [SPECIES_KIRLIA] = sKirliaLevelUpLearnset, -// [SPECIES_GARDEVOIR] = sGardevoirLevelUpLearnset, -// [SPECIES_BAGON] = sBagonLevelUpLearnset, -// [SPECIES_SHELGON] = sShelgonLevelUpLearnset, -// [SPECIES_SALAMENCE] = sSalamenceLevelUpLearnset, -// [SPECIES_BELDUM] = sBeldumLevelUpLearnset, -// [SPECIES_METANG] = sMetangLevelUpLearnset, -// [SPECIES_METAGROSS] = sMetagrossLevelUpLearnset, -// [SPECIES_REGIROCK] = sRegirockLevelUpLearnset, -// [SPECIES_REGICE] = sRegiceLevelUpLearnset, -// [SPECIES_REGISTEEL] = sRegisteelLevelUpLearnset, -// [SPECIES_KYOGRE] = sKyogreLevelUpLearnset, -// [SPECIES_GROUDON] = sGroudonLevelUpLearnset, -// [SPECIES_RAYQUAZA] = sRayquazaLevelUpLearnset, -// [SPECIES_LATIAS] = sLatiasLevelUpLearnset, -// [SPECIES_LATIOS] = sLatiosLevelUpLearnset, -// [SPECIES_JIRACHI] = sJirachiLevelUpLearnset, -// [SPECIES_DEOXYS] = sDeoxysLevelUpLearnset, -// [SPECIES_CHIMECHO] = sChimechoLevelUpLearnset, -// }; diff --git a/src/data/pokemon/pokedex_entries.h b/src/data/pokemon/pokedex_entries.h deleted file mode 100644 index 2c5142611..000000000 --- a/src/data/pokemon/pokedex_entries.h +++ /dev/null @@ -1,5033 +0,0 @@ -// const struct PokedexEntry gPokedexEntries[] = -// { -// [NATIONAL_DEX_NONE] = -// { -// .categoryName = _("UNKNOWN"), -// .height = 0, -// .weight = 0, -// .description = gDummyPokedexText, -// .unusedDescription = gDummyPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_BULBASAUR] = -// { -// .categoryName = _("SEED"), -// .height = 7, -// .weight = 69, -// .description = gBulbasaurPokedexText, -// .unusedDescription = gBulbasaurPokedexTextUnused, -// .pokemonScale = 356, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_IVYSAUR] = -// { -// .categoryName = _("SEED"), -// .height = 10, -// .weight = 130, -// .description = gIvysaurPokedexText, -// .unusedDescription = gIvysaurPokedexTextUnused, -// .pokemonScale = 332, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VENUSAUR] = -// { -// .categoryName = _("SEED"), -// .height = 20, -// .weight = 1000, -// .description = gVenusaurPokedexText, -// .unusedDescription = gVenusaurPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 375, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_CHARMANDER] = -// { -// .categoryName = _("LIZARD"), -// .height = 6, -// .weight = 85, -// .description = gCharmanderPokedexText, -// .unusedDescription = gCharmanderPokedexTextUnused, -// .pokemonScale = 410, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CHARMELEON] = -// { -// .categoryName = _("FLAME"), -// .height = 11, -// .weight = 190, -// .description = gCharmeleonPokedexText, -// .unusedDescription = gCharmeleonPokedexTextUnused, -// .pokemonScale = 294, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CHARIZARD] = -// { -// .categoryName = _("FLAME"), -// .height = 17, -// .weight = 905, -// .description = gCharizardPokedexText, -// .unusedDescription = gCharizardPokedexTextUnused, -// .pokemonScale = 271, -// .pokemonOffset = 0, -// .trainerScale = 317, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_SQUIRTLE] = -// { -// .categoryName = _("TINY TURTLE"), -// .height = 5, -// .weight = 90, -// .description = gSquirtlePokedexText, -// .unusedDescription = gSquirtlePokedexTextUnused, -// .pokemonScale = 412, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WARTORTLE] = -// { -// .categoryName = _("TURTLE"), -// .height = 10, -// .weight = 225, -// .description = gWartortlePokedexText, -// .unusedDescription = gWartortlePokedexTextUnused, -// .pokemonScale = 334, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BLASTOISE] = -// { -// .categoryName = _("SHELLFISH"), -// .height = 16, -// .weight = 855, -// .description = gBlastoisePokedexText, -// .unusedDescription = gBlastoisePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 329, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_CATERPIE] = -// { -// .categoryName = _("WORM"), -// .height = 3, -// .weight = 29, -// .description = gCaterpiePokedexText, -// .unusedDescription = gCaterpiePokedexTextUnused, -// .pokemonScale = 549, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_METAPOD] = -// { -// .categoryName = _("COCOON"), -// .height = 7, -// .weight = 99, -// .description = gMetapodPokedexText, -// .unusedDescription = gMetapodPokedexTextUnused, -// .pokemonScale = 350, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BUTTERFREE] = -// { -// .categoryName = _("BUTTERFLY"), -// .height = 11, -// .weight = 320, -// .description = gButterfreePokedexText, -// .unusedDescription = gButterfreePokedexTextUnused, -// .pokemonScale = 312, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WEEDLE] = -// { -// .categoryName = _("HAIRY BUG"), -// .height = 3, -// .weight = 32, -// .description = gWeedlePokedexText, -// .unusedDescription = gWeedlePokedexTextUnused, -// .pokemonScale = 455, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KAKUNA] = -// { -// .categoryName = _("COCOON"), -// .height = 6, -// .weight = 100, -// .description = gKakunaPokedexText, -// .unusedDescription = gKakunaPokedexTextUnused, -// .pokemonScale = 424, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BEEDRILL] = -// { -// .categoryName = _("POISON BEE"), -// .height = 10, -// .weight = 295, -// .description = gBeedrillPokedexText, -// .unusedDescription = gBeedrillPokedexTextUnused, -// .pokemonScale = 366, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PIDGEY] = -// { -// .categoryName = _("TINY BIRD"), -// .height = 3, -// .weight = 18, -// .description = gPidgeyPokedexText, -// .unusedDescription = gPidgeyPokedexTextUnused, -// .pokemonScale = 492, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PIDGEOTTO] = -// { -// .categoryName = _("BIRD"), -// .height = 11, -// .weight = 300, -// .description = gPidgeottoPokedexText, -// .unusedDescription = gPidgeottoPokedexTextUnused, -// .pokemonScale = 334, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PIDGEOT] = -// { -// .categoryName = _("BIRD"), -// .height = 15, -// .weight = 395, -// .description = gPidgeotPokedexText, -// .unusedDescription = gPidgeotPokedexTextUnused, -// .pokemonScale = 269, -// .pokemonOffset = -2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RATTATA] = -// { -// .categoryName = _("MOUSE"), -// .height = 3, -// .weight = 35, -// .description = gRattataPokedexText, -// .unusedDescription = gRattataPokedexTextUnused, -// .pokemonScale = 481, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RATICATE] = -// { -// .categoryName = _("MOUSE"), -// .height = 7, -// .weight = 185, -// .description = gRaticatePokedexText, -// .unusedDescription = gRaticatePokedexTextUnused, -// .pokemonScale = 401, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SPEAROW] = -// { -// .categoryName = _("TINY BIRD"), -// .height = 3, -// .weight = 20, -// .description = gSpearowPokedexText, -// .unusedDescription = gSpearowPokedexTextUnused, -// .pokemonScale = 571, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FEAROW] = -// { -// .categoryName = _("BEAK"), -// .height = 12, -// .weight = 380, -// .description = gFearowPokedexText, -// .unusedDescription = gFearowPokedexTextUnused, -// .pokemonScale = 282, -// .pokemonOffset = -1, -// .trainerScale = 272, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_EKANS] = -// { -// .categoryName = _("SNAKE"), -// .height = 20, -// .weight = 69, -// .description = gEkansPokedexText, -// .unusedDescription = gEkansPokedexTextUnused, -// .pokemonScale = 298, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ARBOK] = -// { -// .categoryName = _("COBRA"), -// .height = 35, -// .weight = 650, -// .description = gArbokPokedexText, -// .unusedDescription = gArbokPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 296, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_PIKACHU] = -// { -// .categoryName = _("MOUSE"), -// .height = 4, -// .weight = 60, -// .description = gPikachuPokedexText, -// .unusedDescription = gPikachuPokedexTextUnused, -// .pokemonScale = 479, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RAICHU] = -// { -// .categoryName = _("MOUSE"), -// .height = 8, -// .weight = 300, -// .description = gRaichuPokedexText, -// .unusedDescription = gRaichuPokedexTextUnused, -// .pokemonScale = 426, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SANDSHREW] = -// { -// .categoryName = _("MOUSE"), -// .height = 6, -// .weight = 120, -// .description = gSandshrewPokedexText, -// .unusedDescription = gSandshrewPokedexTextUnused, -// .pokemonScale = 370, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SANDSLASH] = -// { -// .categoryName = _("MOUSE"), -// .height = 10, -// .weight = 295, -// .description = gSandslashPokedexText, -// .unusedDescription = gSandslashPokedexTextUnused, -// .pokemonScale = 341, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NIDORAN_F] = -// { -// .categoryName = _("POISON PIN"), -// .height = 4, -// .weight = 70, -// .description = gNidoranFPokedexText, -// .unusedDescription = gNidoranFPokedexTextUnused, -// .pokemonScale = 488, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NIDORINA] = -// { -// .categoryName = _("POISON PIN"), -// .height = 8, -// .weight = 200, -// .description = gNidorinaPokedexText, -// .unusedDescription = gNidorinaPokedexTextUnused, -// .pokemonScale = 381, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NIDOQUEEN] = -// { -// .categoryName = _("DRILL"), -// .height = 13, -// .weight = 600, -// .description = gNidoqueenPokedexText, -// .unusedDescription = gNidoqueenPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NIDORAN_M] = -// { -// .categoryName = _("POISON PIN"), -// .height = 5, -// .weight = 90, -// .description = gNidoranMPokedexText, -// .unusedDescription = gNidoranMPokedexTextUnused, -// .pokemonScale = 480, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NIDORINO] = -// { -// .categoryName = _("POISON PIN"), -// .height = 9, -// .weight = 195, -// .description = gNidorinoPokedexText, -// .unusedDescription = gNidorinoPokedexTextUnused, -// .pokemonScale = 408, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NIDOKING] = -// { -// .categoryName = _("DRILL"), -// .height = 14, -// .weight = 620, -// .description = gNidokingPokedexText, -// .unusedDescription = gNidokingPokedexTextUnused, -// .pokemonScale = 304, -// .pokemonOffset = 3, -// .trainerScale = 323, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_CLEFAIRY] = -// { -// .categoryName = _("FAIRY"), -// .height = 6, -// .weight = 75, -// .description = gClefairyPokedexText, -// .unusedDescription = gClefairyPokedexTextUnused, -// .pokemonScale = 425, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CLEFABLE] = -// { -// .categoryName = _("FAIRY"), -// .height = 13, -// .weight = 400, -// .description = gClefablePokedexText, -// .unusedDescription = gClefablePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 272, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_VULPIX] = -// { -// .categoryName = _("FOX"), -// .height = 6, -// .weight = 99, -// .description = gVulpixPokedexText, -// .unusedDescription = gVulpixPokedexTextUnused, -// .pokemonScale = 497, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NINETALES] = -// { -// .categoryName = _("FOX"), -// .height = 11, -// .weight = 199, -// .description = gNinetalesPokedexText, -// .unusedDescription = gNinetalesPokedexTextUnused, -// .pokemonScale = 339, -// .pokemonOffset = 6, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_JIGGLYPUFF] = -// { -// .categoryName = _("BALLOON"), -// .height = 5, -// .weight = 55, -// .description = gJigglypuffPokedexText, -// .unusedDescription = gJigglypuffPokedexTextUnused, -// .pokemonScale = 419, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WIGGLYTUFF] = -// { -// .categoryName = _("BALLOON"), -// .height = 10, -// .weight = 120, -// .description = gWigglytuffPokedexText, -// .unusedDescription = gWigglytuffPokedexTextUnused, -// .pokemonScale = 328, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ZUBAT] = -// { -// .categoryName = _("BAT"), -// .height = 8, -// .weight = 75, -// .description = gZubatPokedexText, -// .unusedDescription = gZubatPokedexTextUnused, -// .pokemonScale = 355, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GOLBAT] = -// { -// .categoryName = _("BAT"), -// .height = 16, -// .weight = 550, -// .description = gGolbatPokedexText, -// .unusedDescription = gGolbatPokedexTextUnused, -// .pokemonScale = 291, -// .pokemonOffset = 0, -// .trainerScale = 296, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_ODDISH] = -// { -// .categoryName = _("WEED"), -// .height = 5, -// .weight = 54, -// .description = gOddishPokedexText, -// .unusedDescription = gOddishPokedexTextUnused, -// .pokemonScale = 423, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GLOOM] = -// { -// .categoryName = _("WEED"), -// .height = 8, -// .weight = 86, -// .description = gGloomPokedexText, -// .unusedDescription = gGloomPokedexTextUnused, -// .pokemonScale = 329, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VILEPLUME] = -// { -// .categoryName = _("FLOWER"), -// .height = 12, -// .weight = 186, -// .description = gVileplumePokedexText, -// .unusedDescription = gVileplumePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 4, -// .trainerScale = 272, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PARAS] = -// { -// .categoryName = _("MUSHROOM"), -// .height = 3, -// .weight = 54, -// .description = gParasPokedexText, -// .unusedDescription = gParasPokedexTextUnused, -// .pokemonScale = 546, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PARASECT] = -// { -// .categoryName = _("MUSHROOM"), -// .height = 10, -// .weight = 295, -// .description = gParasectPokedexText, -// .unusedDescription = gParasectPokedexTextUnused, -// .pokemonScale = 307, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VENONAT] = -// { -// .categoryName = _("INSECT"), -// .height = 10, -// .weight = 300, -// .description = gVenonatPokedexText, -// .unusedDescription = gVenonatPokedexTextUnused, -// .pokemonScale = 360, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VENOMOTH] = -// { -// .categoryName = _("POISON MOTH"), -// .height = 15, -// .weight = 125, -// .description = gVenomothPokedexText, -// .unusedDescription = gVenomothPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 293, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_DIGLETT] = -// { -// .categoryName = _("MOLE"), -// .height = 2, -// .weight = 8, -// .description = gDiglettPokedexText, -// .unusedDescription = gDiglettPokedexTextUnused, -// .pokemonScale = 706, -// .pokemonOffset = 22, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DUGTRIO] = -// { -// .categoryName = _("MOLE"), -// .height = 7, -// .weight = 333, -// .description = gDugtrioPokedexText, -// .unusedDescription = gDugtrioPokedexTextUnused, -// .pokemonScale = 384, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MEOWTH] = -// { -// .categoryName = _("SCRATCH CAT"), -// .height = 4, -// .weight = 42, -// .description = gMeowthPokedexText, -// .unusedDescription = gMeowthPokedexTextUnused, -// .pokemonScale = 480, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PERSIAN] = -// { -// .categoryName = _("CLASSY CAT"), -// .height = 10, -// .weight = 320, -// .description = gPersianPokedexText, -// .unusedDescription = gPersianPokedexTextUnused, -// .pokemonScale = 320, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PSYDUCK] = -// { -// .categoryName = _("DUCK"), -// .height = 8, -// .weight = 196, -// .description = gPsyduckPokedexText, -// .unusedDescription = gPsyduckPokedexTextUnused, -// .pokemonScale = 347, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GOLDUCK] = -// { -// .categoryName = _("DUCK"), -// .height = 17, -// .weight = 766, -// .description = gGolduckPokedexText, -// .unusedDescription = gGolduckPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 4, -// .trainerScale = 287, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_MANKEY] = -// { -// .categoryName = _("PIG MONKEY"), -// .height = 5, -// .weight = 280, -// .description = gMankeyPokedexText, -// .unusedDescription = gMankeyPokedexTextUnused, -// .pokemonScale = 388, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PRIMEAPE] = -// { -// .categoryName = _("PIG MONKEY"), -// .height = 10, -// .weight = 320, -// .description = gPrimeapePokedexText, -// .unusedDescription = gPrimeapePokedexTextUnused, -// .pokemonScale = 326, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GROWLITHE] = -// { -// .categoryName = _("PUPPY"), -// .height = 7, -// .weight = 190, -// .description = gGrowlithePokedexText, -// .unusedDescription = gGrowlithePokedexTextUnused, -// .pokemonScale = 346, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ARCANINE] = -// { -// .categoryName = _("LEGENDARY"), -// .height = 19, -// .weight = 1550, -// .description = gArcaninePokedexText, -// .unusedDescription = gArcaninePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = -1, -// .trainerScale = 312, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_POLIWAG] = -// { -// .categoryName = _("TADPOLE"), -// .height = 6, -// .weight = 124, -// .description = gPoliwagPokedexText, -// .unusedDescription = gPoliwagPokedexTextUnused, -// .pokemonScale = 353, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_POLIWHIRL] = -// { -// .categoryName = _("TADPOLE"), -// .height = 10, -// .weight = 200, -// .description = gPoliwhirlPokedexText, -// .unusedDescription = gPoliwhirlPokedexTextUnused, -// .pokemonScale = 288, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_POLIWRATH] = -// { -// .categoryName = _("TADPOLE"), -// .height = 13, -// .weight = 540, -// .description = gPoliwrathPokedexText, -// .unusedDescription = gPoliwrathPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ABRA] = -// { -// .categoryName = _("PSI"), -// .height = 9, -// .weight = 195, -// .description = gAbraPokedexText, -// .unusedDescription = gAbraPokedexTextUnused, -// .pokemonScale = 374, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KADABRA] = -// { -// .categoryName = _("PSI"), -// .height = 13, -// .weight = 565, -// .description = gKadabraPokedexText, -// .unusedDescription = gKadabraPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ALAKAZAM] = -// { -// .categoryName = _("PSI"), -// .height = 15, -// .weight = 480, -// .description = gAlakazamPokedexText, -// .unusedDescription = gAlakazamPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = -1, -// .trainerScale = 271, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_MACHOP] = -// { -// .categoryName = _("SUPERPOWER"), -// .height = 8, -// .weight = 195, -// .description = gMachopPokedexText, -// .unusedDescription = gMachopPokedexTextUnused, -// .pokemonScale = 320, -// .pokemonOffset = 12, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MACHOKE] = -// { -// .categoryName = _("SUPERPOWER"), -// .height = 15, -// .weight = 705, -// .description = gMachokePokedexText, -// .unusedDescription = gMachokePokedexTextUnused, -// .pokemonScale = 304, -// .pokemonOffset = 6, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MACHAMP] = -// { -// .categoryName = _("SUPERPOWER"), -// .height = 16, -// .weight = 1300, -// .description = gMachampPokedexText, -// .unusedDescription = gMachampPokedexTextUnused, -// .pokemonScale = 278, -// .pokemonOffset = 2, -// .trainerScale = 283, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_BELLSPROUT] = -// { -// .categoryName = _("FLOWER"), -// .height = 7, -// .weight = 40, -// .description = gBellsproutPokedexText, -// .unusedDescription = gBellsproutPokedexTextUnused, -// .pokemonScale = 354, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WEEPINBELL] = -// { -// .categoryName = _("FLYCATCHER"), -// .height = 10, -// .weight = 64, -// .description = gWeepinbellPokedexText, -// .unusedDescription = gWeepinbellPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VICTREEBEL] = -// { -// .categoryName = _("FLYCATCHER"), -// .height = 17, -// .weight = 155, -// .description = gVictreebelPokedexText, -// .unusedDescription = gVictreebelPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 2, -// .trainerScale = 302, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_TENTACOOL] = -// { -// .categoryName = _("JELLYFISH"), -// .height = 9, -// .weight = 455, -// .description = gTentacoolPokedexText, -// .unusedDescription = gTentacoolPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TENTACRUEL] = -// { -// .categoryName = _("JELLYFISH"), -// .height = 16, -// .weight = 550, -// .description = gTentacruelPokedexText, -// .unusedDescription = gTentacruelPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = -1, -// .trainerScale = 312, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_GEODUDE] = -// { -// .categoryName = _("ROCK"), -// .height = 4, -// .weight = 200, -// .description = gGeodudePokedexText, -// .unusedDescription = gGeodudePokedexTextUnused, -// .pokemonScale = 330, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GRAVELER] = -// { -// .categoryName = _("ROCK"), -// .height = 10, -// .weight = 1050, -// .description = gGravelerPokedexText, -// .unusedDescription = gGravelerPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 8, -// .trainerScale = 305, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_GOLEM] = -// { -// .categoryName = _("MEGATON"), -// .height = 14, -// .weight = 3000, -// .description = gGolemPokedexText, -// .unusedDescription = gGolemPokedexTextUnused, -// .pokemonScale = 266, -// .pokemonOffset = 3, -// .trainerScale = 298, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_PONYTA] = -// { -// .categoryName = _("FIRE HORSE"), -// .height = 10, -// .weight = 300, -// .description = gPonytaPokedexText, -// .unusedDescription = gPonytaPokedexTextUnused, -// .pokemonScale = 288, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RAPIDASH] = -// { -// .categoryName = _("FIRE HORSE"), -// .height = 17, -// .weight = 950, -// .description = gRapidashPokedexText, -// .unusedDescription = gRapidashPokedexTextUnused, -// .pokemonScale = 282, -// .pokemonOffset = -1, -// .trainerScale = 312, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_SLOWPOKE] = -// { -// .categoryName = _("DOPEY"), -// .height = 12, -// .weight = 360, -// .description = gSlowpokePokedexText, -// .unusedDescription = gSlowpokePokedexTextUnused, -// .pokemonScale = 271, -// .pokemonOffset = 10, -// .trainerScale = 272, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SLOWBRO] = -// { -// .categoryName = _("HERMIT CRAB"), -// .height = 16, -// .weight = 785, -// .description = gSlowbroPokedexText, -// .unusedDescription = gSlowbroPokedexTextUnused, -// .pokemonScale = 257, -// .pokemonOffset = -2, -// .trainerScale = 312, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_MAGNEMITE] = -// { -// .categoryName = _("MAGNET"), -// .height = 3, -// .weight = 60, -// .description = gMagnemitePokedexText, -// .unusedDescription = gMagnemitePokedexTextUnused, -// .pokemonScale = 294, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAGNETON] = -// { -// .categoryName = _("MAGNET"), -// .height = 10, -// .weight = 600, -// .description = gMagnetonPokedexText, -// .unusedDescription = gMagnetonPokedexTextUnused, -// .pokemonScale = 293, -// .pokemonOffset = -4, -// .trainerScale = 273, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FARFETCHD] = -// { -// .categoryName = _("WILD DUCK"), -// .height = 8, -// .weight = 150, -// .description = gFarfetchdPokedexText, -// .unusedDescription = gFarfetchdPokedexTextUnused, -// .pokemonScale = 317, -// .pokemonOffset = -2, -// .trainerScale = 256, -// .trainerOffset = -3, -// }, - -// [NATIONAL_DEX_DODUO] = -// { -// .categoryName = _("TWIN BIRD"), -// .height = 14, -// .weight = 392, -// .description = gDoduoPokedexText, -// .unusedDescription = gDoduoPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 287, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_DODRIO] = -// { -// .categoryName = _("TRIPLE BIRD"), -// .height = 18, -// .weight = 852, -// .description = gDodrioPokedexText, -// .unusedDescription = gDodrioPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = -2, -// .trainerScale = 296, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_SEEL] = -// { -// .categoryName = _("SEA LION"), -// .height = 11, -// .weight = 900, -// .description = gSeelPokedexText, -// .unusedDescription = gSeelPokedexTextUnused, -// .pokemonScale = 298, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DEWGONG] = -// { -// .categoryName = _("SEA LION"), -// .height = 17, -// .weight = 1200, -// .description = gDewgongPokedexText, -// .unusedDescription = gDewgongPokedexTextUnused, -// .pokemonScale = 288, -// .pokemonOffset = 1, -// .trainerScale = 306, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_GRIMER] = -// { -// .categoryName = _("SLUDGE"), -// .height = 9, -// .weight = 300, -// .description = gGrimerPokedexText, -// .unusedDescription = gGrimerPokedexTextUnused, -// .pokemonScale = 258, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MUK] = -// { -// .categoryName = _("SLUDGE"), -// .height = 12, -// .weight = 300, -// .description = gMukPokedexText, -// .unusedDescription = gMukPokedexTextUnused, -// .pokemonScale = 288, -// .pokemonOffset = 7, -// .trainerScale = 288, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_SHELLDER] = -// { -// .categoryName = _("BIVALVE"), -// .height = 3, -// .weight = 40, -// .description = gShellderPokedexText, -// .unusedDescription = gShellderPokedexTextUnused, -// .pokemonScale = 643, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CLOYSTER] = -// { -// .categoryName = _("BIVALVE"), -// .height = 15, -// .weight = 1325, -// .description = gCloysterPokedexText, -// .unusedDescription = gCloysterPokedexTextUnused, -// .pokemonScale = 264, -// .pokemonOffset = 0, -// .trainerScale = 288, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_GASTLY] = -// { -// .categoryName = _("GAS"), -// .height = 13, -// .weight = 1, -// .description = gGastlyPokedexText, -// .unusedDescription = gGastlyPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HAUNTER] = -// { -// .categoryName = _("GAS"), -// .height = 16, -// .weight = 1, -// .description = gHaunterPokedexText, -// .unusedDescription = gHaunterPokedexTextUnused, -// .pokemonScale = 269, -// .pokemonOffset = 2, -// .trainerScale = 308, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_GENGAR] = -// { -// .categoryName = _("SHADOW"), -// .height = 15, -// .weight = 405, -// .description = gGengarPokedexText, -// .unusedDescription = gGengarPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 4, -// .trainerScale = 317, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_ONIX] = -// { -// .categoryName = _("ROCK SNAKE"), -// .height = 88, -// .weight = 2100, -// .description = gOnixPokedexText, -// .unusedDescription = gOnixPokedexTextUnused, -// .pokemonScale = 257, -// .pokemonOffset = 0, -// .trainerScale = 515, -// .trainerOffset = 12, -// }, - -// [NATIONAL_DEX_DROWZEE] = -// { -// .categoryName = _("HYPNOSIS"), -// .height = 10, -// .weight = 324, -// .description = gDrowzeePokedexText, -// .unusedDescription = gDrowzeePokedexTextUnused, -// .pokemonScale = 274, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HYPNO] = -// { -// .categoryName = _("HYPNOSIS"), -// .height = 16, -// .weight = 756, -// .description = gHypnoPokedexText, -// .unusedDescription = gHypnoPokedexTextUnused, -// .pokemonScale = 298, -// .pokemonOffset = 3, -// .trainerScale = 310, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_KRABBY] = -// { -// .categoryName = _("RIVER CRAB"), -// .height = 4, -// .weight = 65, -// .description = gKrabbyPokedexText, -// .unusedDescription = gKrabbyPokedexTextUnused, -// .pokemonScale = 469, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KINGLER] = -// { -// .categoryName = _("PINCER"), -// .height = 13, -// .weight = 600, -// .description = gKinglerPokedexText, -// .unusedDescription = gKinglerPokedexTextUnused, -// .pokemonScale = 287, -// .pokemonOffset = 3, -// .trainerScale = 308, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_VOLTORB] = -// { -// .categoryName = _("BALL"), -// .height = 5, -// .weight = 104, -// .description = gVoltorbPokedexText, -// .unusedDescription = gVoltorbPokedexTextUnused, -// .pokemonScale = 364, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ELECTRODE] = -// { -// .categoryName = _("BALL"), -// .height = 12, -// .weight = 666, -// .description = gElectrodePokedexText, -// .unusedDescription = gElectrodePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_EXEGGCUTE] = -// { -// .categoryName = _("EGG"), -// .height = 4, -// .weight = 25, -// .description = gExeggcutePokedexText, -// .unusedDescription = gExeggcutePokedexTextUnused, -// .pokemonScale = 495, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_EXEGGUTOR] = -// { -// .categoryName = _("COCONUT"), -// .height = 20, -// .weight = 1200, -// .description = gExeggutorPokedexText, -// .unusedDescription = gExeggutorPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 0, -// .trainerScale = 376, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_CUBONE] = -// { -// .categoryName = _("LONELY"), -// .height = 4, -// .weight = 65, -// .description = gCubonePokedexText, -// .unusedDescription = gCubonePokedexTextUnused, -// .pokemonScale = 545, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAROWAK] = -// { -// .categoryName = _("BONE KEEPER"), -// .height = 10, -// .weight = 450, -// .description = gMarowakPokedexText, -// .unusedDescription = gMarowakPokedexTextUnused, -// .pokemonScale = 293, -// .pokemonOffset = 12, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HITMONLEE] = -// { -// .categoryName = _("KICKING"), -// .height = 15, -// .weight = 498, -// .description = gHitmonleePokedexText, -// .unusedDescription = gHitmonleePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 273, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HITMONCHAN] = -// { -// .categoryName = _("PUNCHING"), -// .height = 14, -// .weight = 502, -// .description = gHitmonchanPokedexText, -// .unusedDescription = gHitmonchanPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 264, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LICKITUNG] = -// { -// .categoryName = _("LICKING"), -// .height = 12, -// .weight = 655, -// .description = gLickitungPokedexText, -// .unusedDescription = gLickitungPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 3, -// .trainerScale = 272, -// .trainerOffset = -3, -// }, - -// [NATIONAL_DEX_KOFFING] = -// { -// .categoryName = _("POISON GAS"), -// .height = 6, -// .weight = 10, -// .description = gKoffingPokedexText, -// .unusedDescription = gKoffingPokedexTextUnused, -// .pokemonScale = 369, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WEEZING] = -// { -// .categoryName = _("POISON GAS"), -// .height = 12, -// .weight = 95, -// .description = gWeezingPokedexText, -// .unusedDescription = gWeezingPokedexTextUnused, -// .pokemonScale = 321, -// .pokemonOffset = -1, -// .trainerScale = 276, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_RHYHORN] = -// { -// .categoryName = _("SPIKES"), -// .height = 10, -// .weight = 1150, -// .description = gRhyhornPokedexText, -// .unusedDescription = gRhyhornPokedexTextUnused, -// .pokemonScale = 291, -// .pokemonOffset = 7, -// .trainerScale = 276, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RHYDON] = -// { -// .categoryName = _("DRILL"), -// .height = 19, -// .weight = 1200, -// .description = gRhydonPokedexText, -// .unusedDescription = gRhydonPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = -1, -// .trainerScale = 344, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_CHANSEY] = -// { -// .categoryName = _("EGG"), -// .height = 11, -// .weight = 346, -// .description = gChanseyPokedexText, -// .unusedDescription = gChanseyPokedexTextUnused, -// .pokemonScale = 257, -// .pokemonOffset = 6, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TANGELA] = -// { -// .categoryName = _("VINE"), -// .height = 10, -// .weight = 350, -// .description = gTangelaPokedexText, -// .unusedDescription = gTangelaPokedexTextUnused, -// .pokemonScale = 320, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KANGASKHAN] = -// { -// .categoryName = _("PARENT"), -// .height = 22, -// .weight = 800, -// .description = gKangaskhanPokedexText, -// .unusedDescription = gKangaskhanPokedexTextUnused, -// .pokemonScale = 257, -// .pokemonOffset = -3, -// .trainerScale = 349, -// .trainerOffset = 5, -// }, - -// [NATIONAL_DEX_HORSEA] = -// { -// .categoryName = _("DRAGON"), -// .height = 4, -// .weight = 80, -// .description = gHorseaPokedexText, -// .unusedDescription = gHorseaPokedexTextUnused, -// .pokemonScale = 399, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SEADRA] = -// { -// .categoryName = _("DRAGON"), -// .height = 12, -// .weight = 250, -// .description = gSeadraPokedexText, -// .unusedDescription = gSeadraPokedexTextUnused, -// .pokemonScale = 296, -// .pokemonOffset = 3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GOLDEEN] = -// { -// .categoryName = _("GOLDFISH"), -// .height = 6, -// .weight = 150, -// .description = gGoldeenPokedexText, -// .unusedDescription = gGoldeenPokedexTextUnused, -// .pokemonScale = 379, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SEAKING] = -// { -// .categoryName = _("GOLDFISH"), -// .height = 13, -// .weight = 390, -// .description = gSeakingPokedexText, -// .unusedDescription = gSeakingPokedexTextUnused, -// .pokemonScale = 304, -// .pokemonOffset = 1, -// .trainerScale = 288, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_STARYU] = -// { -// .categoryName = _("STAR SHAPE"), -// .height = 8, -// .weight = 345, -// .description = gStaryuPokedexText, -// .unusedDescription = gStaryuPokedexTextUnused, -// .pokemonScale = 326, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_STARMIE] = -// { -// .categoryName = _("MYSTERIOUS"), -// .height = 11, -// .weight = 800, -// .description = gStarmiePokedexText, -// .unusedDescription = gStarmiePokedexTextUnused, -// .pokemonScale = 301, -// .pokemonOffset = 3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MR_MIME] = -// { -// .categoryName = _("BARRIER"), -// .height = 13, -// .weight = 545, -// .description = gMrmimePokedexText, -// .unusedDescription = gMrmimePokedexTextUnused, -// .pokemonScale = 258, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SCYTHER] = -// { -// .categoryName = _("MANTIS"), -// .height = 15, -// .weight = 560, -// .description = gScytherPokedexText, -// .unusedDescription = gScytherPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 0, -// .trainerScale = 293, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_JYNX] = -// { -// .categoryName = _("HUMAN SHAPE"), -// .height = 14, -// .weight = 406, -// .description = gJynxPokedexText, -// .unusedDescription = gJynxPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 300, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_ELECTABUZZ] = -// { -// .categoryName = _("ELECTRIC"), -// .height = 11, -// .weight = 300, -// .description = gElectabuzzPokedexText, -// .unusedDescription = gElectabuzzPokedexTextUnused, -// .pokemonScale = 330, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAGMAR] = -// { -// .categoryName = _("SPITFIRE"), -// .height = 13, -// .weight = 445, -// .description = gMagmarPokedexText, -// .unusedDescription = gMagmarPokedexTextUnused, -// .pokemonScale = 293, -// .pokemonOffset = 4, -// .trainerScale = 272, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PINSIR] = -// { -// .categoryName = _("STAG BEETLE"), -// .height = 15, -// .weight = 550, -// .description = gPinsirPokedexText, -// .unusedDescription = gPinsirPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 257, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TAUROS] = -// { -// .categoryName = _("WILD BULL"), -// .height = 14, -// .weight = 884, -// .description = gTaurosPokedexText, -// .unusedDescription = gTaurosPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 2, -// .trainerScale = 312, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_MAGIKARP] = -// { -// .categoryName = _("FISH"), -// .height = 9, -// .weight = 100, -// .description = gMagikarpPokedexText, -// .unusedDescription = gMagikarpPokedexTextUnused, -// .pokemonScale = 317, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GYARADOS] = -// { -// .categoryName = _("ATROCIOUS"), -// .height = 65, -// .weight = 2350, -// .description = gGyaradosPokedexText, -// .unusedDescription = gGyaradosPokedexTextUnused, -// .pokemonScale = 288, -// .pokemonOffset = -1, -// .trainerScale = 512, -// .trainerOffset = 11, -// }, - -// [NATIONAL_DEX_LAPRAS] = -// { -// .categoryName = _("TRANSPORT"), -// .height = 25, -// .weight = 2200, -// .description = gLaprasPokedexText, -// .unusedDescription = gLaprasPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 425, -// .trainerOffset = 8, -// }, - -// [NATIONAL_DEX_DITTO] = -// { -// .categoryName = _("TRANSFORM"), -// .height = 3, -// .weight = 40, -// .description = gDittoPokedexText, -// .unusedDescription = gDittoPokedexTextUnused, -// .pokemonScale = 602, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_EEVEE] = -// { -// .categoryName = _("EVOLUTION"), -// .height = 3, -// .weight = 65, -// .description = gEeveePokedexText, -// .unusedDescription = gEeveePokedexTextUnused, -// .pokemonScale = 476, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VAPOREON] = -// { -// .categoryName = _("BUBBLE JET"), -// .height = 10, -// .weight = 290, -// .description = gVaporeonPokedexText, -// .unusedDescription = gVaporeonPokedexTextUnused, -// .pokemonScale = 316, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_JOLTEON] = -// { -// .categoryName = _("LIGHTNING"), -// .height = 8, -// .weight = 245, -// .description = gJolteonPokedexText, -// .unusedDescription = gJolteonPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FLAREON] = -// { -// .categoryName = _("FLAME"), -// .height = 9, -// .weight = 250, -// .description = gFlareonPokedexText, -// .unusedDescription = gFlareonPokedexTextUnused, -// .pokemonScale = 302, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PORYGON] = -// { -// .categoryName = _("VIRTUAL"), -// .height = 8, -// .weight = 365, -// .description = gPorygonPokedexText, -// .unusedDescription = gPorygonPokedexTextUnused, -// .pokemonScale = 328, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_OMANYTE] = -// { -// .categoryName = _("SPIRAL"), -// .height = 4, -// .weight = 75, -// .description = gOmanytePokedexText, -// .unusedDescription = gOmanytePokedexTextUnused, -// .pokemonScale = 521, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_OMASTAR] = -// { -// .categoryName = _("SPIRAL"), -// .height = 10, -// .weight = 350, -// .description = gOmastarPokedexText, -// .unusedDescription = gOmastarPokedexTextUnused, -// .pokemonScale = 307, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KABUTO] = -// { -// .categoryName = _("SHELLFISH"), -// .height = 5, -// .weight = 115, -// .description = gKabutoPokedexText, -// .unusedDescription = gKabutoPokedexTextUnused, -// .pokemonScale = 438, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KABUTOPS] = -// { -// .categoryName = _("SHELLFISH"), -// .height = 13, -// .weight = 405, -// .description = gKabutopsPokedexText, -// .unusedDescription = gKabutopsPokedexTextUnused, -// .pokemonScale = 271, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_AERODACTYL] = -// { -// .categoryName = _("FOSSIL"), -// .height = 18, -// .weight = 590, -// .description = gAerodactylPokedexText, -// .unusedDescription = gAerodactylPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = -1, -// .trainerScale = 317, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_SNORLAX] = -// { -// .categoryName = _("SLEEPING"), -// .height = 21, -// .weight = 4600, -// .description = gSnorlaxPokedexText, -// .unusedDescription = gSnorlaxPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 1, -// .trainerScale = 408, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_ARTICUNO] = -// { -// .categoryName = _("FREEZE"), -// .height = 17, -// .weight = 554, -// .description = gArticunoPokedexText, -// .unusedDescription = gArticunoPokedexTextUnused, -// .pokemonScale = 278, -// .pokemonOffset = 0, -// .trainerScale = 308, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_ZAPDOS] = -// { -// .categoryName = _("ELECTRIC"), -// .height = 16, -// .weight = 526, -// .description = gZapdosPokedexText, -// .unusedDescription = gZapdosPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 1, -// .trainerScale = 330, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_MOLTRES] = -// { -// .categoryName = _("FLAME"), -// .height = 20, -// .weight = 600, -// .description = gMoltresPokedexText, -// .unusedDescription = gMoltresPokedexTextUnused, -// .pokemonScale = 270, -// .pokemonOffset = 1, -// .trainerScale = 379, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_DRATINI] = -// { -// .categoryName = _("DRAGON"), -// .height = 18, -// .weight = 33, -// .description = gDratiniPokedexText, -// .unusedDescription = gDratiniPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 8, -// .trainerScale = 386, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_DRAGONAIR] = -// { -// .categoryName = _("DRAGON"), -// .height = 40, -// .weight = 165, -// .description = gDragonairPokedexText, -// .unusedDescription = gDragonairPokedexTextUnused, -// .pokemonScale = 274, -// .pokemonOffset = 0, -// .trainerScale = 423, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_DRAGONITE] = -// { -// .categoryName = _("DRAGON"), -// .height = 22, -// .weight = 2100, -// .description = gDragonitePokedexText, -// .unusedDescription = gDragonitePokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = -1, -// .trainerScale = 342, -// .trainerOffset = 4, -// }, - -// [NATIONAL_DEX_MEWTWO] = -// { -// .categoryName = _("GENETIC"), -// .height = 20, -// .weight = 1220, -// .description = gMewtwoPokedexText, -// .unusedDescription = gMewtwoPokedexTextUnused, -// .pokemonScale = 276, -// .pokemonOffset = -1, -// .trainerScale = 342, -// .trainerOffset = 5, -// }, - -// [NATIONAL_DEX_MEW] = -// { -// .categoryName = _("NEW SPECIES"), -// .height = 4, -// .weight = 40, -// .description = gMewPokedexText, -// .unusedDescription = gMewPokedexTextUnused, -// .pokemonScale = 460, -// .pokemonOffset = -2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CHIKORITA] = -// { -// .categoryName = _("LEAF"), -// .height = 9, -// .weight = 64, -// .description = gChikoritaPokedexText, -// .unusedDescription = gChikoritaPokedexTextUnused, -// .pokemonScale = 512, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BAYLEEF] = -// { -// .categoryName = _("LEAF"), -// .height = 12, -// .weight = 158, -// .description = gBayleefPokedexText, -// .unusedDescription = gBayleefPokedexTextUnused, -// .pokemonScale = 296, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MEGANIUM] = -// { -// .categoryName = _("HERB"), -// .height = 18, -// .weight = 1005, -// .description = gMeganiumPokedexText, -// .unusedDescription = gMeganiumPokedexTextUnused, -// .pokemonScale = 286, -// .pokemonOffset = 0, -// .trainerScale = 317, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_CYNDAQUIL] = -// { -// .categoryName = _("FIRE MOUSE"), -// .height = 5, -// .weight = 79, -// .description = gCyndaquilPokedexText, -// .unusedDescription = gCyndaquilPokedexTextUnused, -// .pokemonScale = 539, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_QUILAVA] = -// { -// .categoryName = _("VOLCANO"), -// .height = 9, -// .weight = 190, -// .description = gQuilavaPokedexText, -// .unusedDescription = gQuilavaPokedexTextUnused, -// .pokemonScale = 329, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TYPHLOSION] = -// { -// .categoryName = _("VOLCANO"), -// .height = 17, -// .weight = 795, -// .description = gTyphlosionPokedexText, -// .unusedDescription = gTyphlosionPokedexTextUnused, -// .pokemonScale = 284, -// .pokemonOffset = -1, -// .trainerScale = 287, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_TOTODILE] = -// { -// .categoryName = _("BIG JAW"), -// .height = 6, -// .weight = 95, -// .description = gTotodilePokedexText, -// .unusedDescription = gTotodilePokedexTextUnused, -// .pokemonScale = 487, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CROCONAW] = -// { -// .categoryName = _("BIG JAW"), -// .height = 11, -// .weight = 250, -// .description = gCroconawPokedexText, -// .unusedDescription = gCroconawPokedexTextUnused, -// .pokemonScale = 378, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FERALIGATR] = -// { -// .categoryName = _("BIG JAW"), -// .height = 23, -// .weight = 888, -// .description = gFeraligatrPokedexText, -// .unusedDescription = gFeraligatrPokedexTextUnused, -// .pokemonScale = 282, -// .pokemonOffset = -1, -// .trainerScale = 375, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_SENTRET] = -// { -// .categoryName = _("SCOUT"), -// .height = 8, -// .weight = 60, -// .description = gSentretPokedexText, -// .unusedDescription = gSentretPokedexTextUnused, -// .pokemonScale = 439, -// .pokemonOffset = 12, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FURRET] = -// { -// .categoryName = _("LONG BODY"), -// .height = 18, -// .weight = 325, -// .description = gFurretPokedexText, -// .unusedDescription = gFurretPokedexTextUnused, -// .pokemonScale = 346, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HOOTHOOT] = -// { -// .categoryName = _("OWL"), -// .height = 7, -// .weight = 212, -// .description = gHoothootPokedexText, -// .unusedDescription = gHoothootPokedexTextUnused, -// .pokemonScale = 380, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NOCTOWL] = -// { -// .categoryName = _("OWL"), -// .height = 16, -// .weight = 408, -// .description = gNoctowlPokedexText, -// .unusedDescription = gNoctowlPokedexTextUnused, -// .pokemonScale = 278, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LEDYBA] = -// { -// .categoryName = _("FIVE STAR"), -// .height = 10, -// .weight = 108, -// .description = gLedybaPokedexText, -// .unusedDescription = gLedybaPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LEDIAN] = -// { -// .categoryName = _("FIVE STAR"), -// .height = 14, -// .weight = 356, -// .description = gLedianPokedexText, -// .unusedDescription = gLedianPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SPINARAK] = -// { -// .categoryName = _("STRING SPIT"), -// .height = 5, -// .weight = 85, -// .description = gSpinarakPokedexText, -// .unusedDescription = gSpinarakPokedexTextUnused, -// .pokemonScale = 414, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ARIADOS] = -// { -// .categoryName = _("LONG LEG"), -// .height = 11, -// .weight = 335, -// .description = gAriadosPokedexText, -// .unusedDescription = gAriadosPokedexTextUnused, -// .pokemonScale = 316, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CROBAT] = -// { -// .categoryName = _("BAT"), -// .height = 18, -// .weight = 750, -// .description = gCrobatPokedexText, -// .unusedDescription = gCrobatPokedexTextUnused, -// .pokemonScale = 279, -// .pokemonOffset = -1, -// .trainerScale = 313, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_CHINCHOU] = -// { -// .categoryName = _("ANGLER"), -// .height = 5, -// .weight = 120, -// .description = gChinchouPokedexText, -// .unusedDescription = gChinchouPokedexTextUnused, -// .pokemonScale = 424, -// .pokemonOffset = -2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LANTURN] = -// { -// .categoryName = _("LIGHT"), -// .height = 12, -// .weight = 225, -// .description = gLanturnPokedexText, -// .unusedDescription = gLanturnPokedexTextUnused, -// .pokemonScale = 269, -// .pokemonOffset = 6, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PICHU] = -// { -// .categoryName = _("TINY MOUSE"), -// .height = 3, -// .weight = 20, -// .description = gPichuPokedexText, -// .unusedDescription = gPichuPokedexTextUnused, -// .pokemonScale = 508, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CLEFFA] = -// { -// .categoryName = _("STAR SHAPE"), -// .height = 3, -// .weight = 30, -// .description = gCleffaPokedexText, -// .unusedDescription = gCleffaPokedexTextUnused, -// .pokemonScale = 462, -// .pokemonOffset = 22, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_IGGLYBUFF] = -// { -// .categoryName = _("BALLOON"), -// .height = 3, -// .weight = 10, -// .description = gIgglybuffPokedexText, -// .unusedDescription = gIgglybuffPokedexTextUnused, -// .pokemonScale = 457, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TOGEPI] = -// { -// .categoryName = _("SPIKE BALL"), -// .height = 3, -// .weight = 15, -// .description = gTogepiPokedexText, -// .unusedDescription = gTogepiPokedexTextUnused, -// .pokemonScale = 507, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TOGETIC] = -// { -// .categoryName = _("HAPPINESS"), -// .height = 6, -// .weight = 32, -// .description = gTogeticPokedexText, -// .unusedDescription = gTogeticPokedexTextUnused, -// .pokemonScale = 424, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NATU] = -// { -// .categoryName = _("TINY BIRD"), -// .height = 2, -// .weight = 20, -// .description = gNatuPokedexText, -// .unusedDescription = gNatuPokedexTextUnused, -// .pokemonScale = 610, -// .pokemonOffset = 23, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_XATU] = -// { -// .categoryName = _("MYSTIC"), -// .height = 15, -// .weight = 150, -// .description = gXatuPokedexText, -// .unusedDescription = gXatuPokedexTextUnused, -// .pokemonScale = 258, -// .pokemonOffset = 4, -// .trainerScale = 317, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_MAREEP] = -// { -// .categoryName = _("WOOL"), -// .height = 6, -// .weight = 78, -// .description = gMareepPokedexText, -// .unusedDescription = gMareepPokedexTextUnused, -// .pokemonScale = 379, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FLAAFFY] = -// { -// .categoryName = _("WOOL"), -// .height = 8, -// .weight = 133, -// .description = gFlaaffyPokedexText, -// .unusedDescription = gFlaaffyPokedexTextUnused, -// .pokemonScale = 372, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_AMPHAROS] = -// { -// .categoryName = _("LIGHT"), -// .height = 14, -// .weight = 615, -// .description = gAmpharosPokedexText, -// .unusedDescription = gAmpharosPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 2, -// .trainerScale = 283, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_BELLOSSOM] = -// { -// .categoryName = _("FLOWER"), -// .height = 4, -// .weight = 58, -// .description = gBellossomPokedexText, -// .unusedDescription = gBellossomPokedexTextUnused, -// .pokemonScale = 472, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MARILL] = -// { -// .categoryName = _("AQUA MOUSE"), -// .height = 4, -// .weight = 85, -// .description = gMarillPokedexText, -// .unusedDescription = gMarillPokedexTextUnused, -// .pokemonScale = 476, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_AZUMARILL] = -// { -// .categoryName = _("AQUA RABBIT"), -// .height = 8, -// .weight = 285, -// .description = gAzumarillPokedexText, -// .unusedDescription = gAzumarillPokedexTextUnused, -// .pokemonScale = 448, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SUDOWOODO] = -// { -// .categoryName = _("IMITATION"), -// .height = 12, -// .weight = 380, -// .description = gSudowoodoPokedexText, -// .unusedDescription = gSudowoodoPokedexTextUnused, -// .pokemonScale = 305, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_POLITOED] = -// { -// .categoryName = _("FROG"), -// .height = 11, -// .weight = 339, -// .description = gPolitoedPokedexText, -// .unusedDescription = gPolitoedPokedexTextUnused, -// .pokemonScale = 289, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HOPPIP] = -// { -// .categoryName = _("COTTONWEED"), -// .height = 4, -// .weight = 5, -// .description = gHoppipPokedexText, -// .unusedDescription = gHoppipPokedexTextUnused, -// .pokemonScale = 562, -// .pokemonOffset = -7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SKIPLOOM] = -// { -// .categoryName = _("COTTONWEED"), -// .height = 6, -// .weight = 10, -// .description = gSkiploomPokedexText, -// .unusedDescription = gSkiploomPokedexTextUnused, -// .pokemonScale = 387, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_JUMPLUFF] = -// { -// .categoryName = _("COTTONWEED"), -// .height = 8, -// .weight = 30, -// .description = gJumpluffPokedexText, -// .unusedDescription = gJumpluffPokedexTextUnused, -// .pokemonScale = 418, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_AIPOM] = -// { -// .categoryName = _("LONG TAIL"), -// .height = 8, -// .weight = 115, -// .description = gAipomPokedexText, -// .unusedDescription = gAipomPokedexTextUnused, -// .pokemonScale = 363, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SUNKERN] = -// { -// .categoryName = _("SEED"), -// .height = 3, -// .weight = 18, -// .description = gSunkernPokedexText, -// .unusedDescription = gSunkernPokedexTextUnused, -// .pokemonScale = 541, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SUNFLORA] = -// { -// .categoryName = _("SUN"), -// .height = 8, -// .weight = 85, -// .description = gSunfloraPokedexText, -// .unusedDescription = gSunfloraPokedexTextUnused, -// .pokemonScale = 374, -// .pokemonOffset = 12, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_YANMA] = -// { -// .categoryName = _("CLEAR WING"), -// .height = 12, -// .weight = 380, -// .description = gYanmaPokedexText, -// .unusedDescription = gYanmaPokedexTextUnused, -// .pokemonScale = 274, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WOOPER] = -// { -// .categoryName = _("WATER FISH"), -// .height = 4, -// .weight = 85, -// .description = gWooperPokedexText, -// .unusedDescription = gWooperPokedexTextUnused, -// .pokemonScale = 479, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_QUAGSIRE] = -// { -// .categoryName = _("WATER FISH"), -// .height = 14, -// .weight = 750, -// .description = gQuagsirePokedexText, -// .unusedDescription = gQuagsirePokedexTextUnused, -// .pokemonScale = 273, -// .pokemonOffset = 4, -// .trainerScale = 273, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ESPEON] = -// { -// .categoryName = _("SUN"), -// .height = 9, -// .weight = 265, -// .description = gEspeonPokedexText, -// .unusedDescription = gEspeonPokedexTextUnused, -// .pokemonScale = 363, -// .pokemonOffset = 12, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_UMBREON] = -// { -// .categoryName = _("MOONLIGHT"), -// .height = 10, -// .weight = 270, -// .description = gUmbreonPokedexText, -// .unusedDescription = gUmbreonPokedexTextUnused, -// .pokemonScale = 317, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MURKROW] = -// { -// .categoryName = _("DARKNESS"), -// .height = 5, -// .weight = 21, -// .description = gMurkrowPokedexText, -// .unusedDescription = gMurkrowPokedexTextUnused, -// .pokemonScale = 401, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SLOWKING] = -// { -// .categoryName = _("ROYAL"), -// .height = 20, -// .weight = 795, -// .description = gSlowkingPokedexText, -// .unusedDescription = gSlowkingPokedexTextUnused, -// .pokemonScale = 265, -// .pokemonOffset = -1, -// .trainerScale = 330, -// .trainerOffset = 4, -// }, - -// [NATIONAL_DEX_MISDREAVUS] = -// { -// .categoryName = _("SCREECH"), -// .height = 7, -// .weight = 10, -// .description = gMisdreavusPokedexText, -// .unusedDescription = gMisdreavusPokedexTextUnused, -// .pokemonScale = 407, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_UNOWN] = -// { -// .categoryName = _("SYMBOL"), -// .height = 5, -// .weight = 50, -// .description = gUnownPokedexText, -// .unusedDescription = gUnownPokedexTextUnused, -// .pokemonScale = 411, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WOBBUFFET] = -// { -// .categoryName = _("PATIENT"), -// .height = 13, -// .weight = 285, -// .description = gWobbuffetPokedexText, -// .unusedDescription = gWobbuffetPokedexTextUnused, -// .pokemonScale = 274, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GIRAFARIG] = -// { -// .categoryName = _("LONG NECK"), -// .height = 15, -// .weight = 415, -// .description = gGirafarigPokedexText, -// .unusedDescription = gGirafarigPokedexTextUnused, -// .pokemonScale = 281, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PINECO] = -// { -// .categoryName = _("BAGWORM"), -// .height = 6, -// .weight = 72, -// .description = gPinecoPokedexText, -// .unusedDescription = gPinecoPokedexTextUnused, -// .pokemonScale = 445, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FORRETRESS] = -// { -// .categoryName = _("BAGWORM"), -// .height = 12, -// .weight = 1258, -// .description = gForretressPokedexText, -// .unusedDescription = gForretressPokedexTextUnused, -// .pokemonScale = 293, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DUNSPARCE] = -// { -// .categoryName = _("LAND SNAKE"), -// .height = 15, -// .weight = 140, -// .description = gDunsparcePokedexText, -// .unusedDescription = gDunsparcePokedexTextUnused, -// .pokemonScale = 284, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GLIGAR] = -// { -// .categoryName = _("FLYSCORPION"), -// .height = 11, -// .weight = 648, -// .description = gGligarPokedexText, -// .unusedDescription = gGligarPokedexTextUnused, -// .pokemonScale = 350, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_STEELIX] = -// { -// .categoryName = _("IRON SNAKE"), -// .height = 92, -// .weight = 4000, -// .description = gSteelixPokedexText, -// .unusedDescription = gSteelixPokedexTextUnused, -// .pokemonScale = 278, -// .pokemonOffset = -1, -// .trainerScale = 557, -// .trainerOffset = 13, -// }, - -// [NATIONAL_DEX_SNUBBULL] = -// { -// .categoryName = _("FAIRY"), -// .height = 6, -// .weight = 78, -// .description = gSnubbullPokedexText, -// .unusedDescription = gSnubbullPokedexTextUnused, -// .pokemonScale = 465, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GRANBULL] = -// { -// .categoryName = _("FAIRY"), -// .height = 14, -// .weight = 487, -// .description = gGranbullPokedexText, -// .unusedDescription = gGranbullPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_QWILFISH] = -// { -// .categoryName = _("BALLOON"), -// .height = 5, -// .weight = 39, -// .description = gQwilfishPokedexText, -// .unusedDescription = gQwilfishPokedexTextUnused, -// .pokemonScale = 430, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SCIZOR] = -// { -// .categoryName = _("PINCER"), -// .height = 18, -// .weight = 1180, -// .description = gScizorPokedexText, -// .unusedDescription = gScizorPokedexTextUnused, -// .pokemonScale = 282, -// .pokemonOffset = 0, -// .trainerScale = 282, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_SHUCKLE] = -// { -// .categoryName = _("MOLD"), -// .height = 6, -// .weight = 205, -// .description = gShucklePokedexText, -// .unusedDescription = gShucklePokedexTextUnused, -// .pokemonScale = 485, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HERACROSS] = -// { -// .categoryName = _("SINGLE HORN"), -// .height = 15, -// .weight = 540, -// .description = gHeracrossPokedexText, -// .unusedDescription = gHeracrossPokedexTextUnused, -// .pokemonScale = 285, -// .pokemonOffset = 0, -// .trainerScale = 283, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SNEASEL] = -// { -// .categoryName = _("SHARP CLAW"), -// .height = 9, -// .weight = 280, -// .description = gSneaselPokedexText, -// .unusedDescription = gSneaselPokedexTextUnused, -// .pokemonScale = 413, -// .pokemonOffset = -3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TEDDIURSA] = -// { -// .categoryName = _("LITTLE BEAR"), -// .height = 6, -// .weight = 88, -// .description = gTeddiursaPokedexText, -// .unusedDescription = gTeddiursaPokedexTextUnused, -// .pokemonScale = 455, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_URSARING] = -// { -// .categoryName = _("HIBERNATOR"), -// .height = 18, -// .weight = 1258, -// .description = gUrsaringPokedexText, -// .unusedDescription = gUrsaringPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 0, -// .trainerScale = 280, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_SLUGMA] = -// { -// .categoryName = _("LAVA"), -// .height = 7, -// .weight = 350, -// .description = gSlugmaPokedexText, -// .unusedDescription = gSlugmaPokedexTextUnused, -// .pokemonScale = 329, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAGCARGO] = -// { -// .categoryName = _("LAVA"), -// .height = 8, -// .weight = 550, -// .description = gMagcargoPokedexText, -// .unusedDescription = gMagcargoPokedexTextUnused, -// .pokemonScale = 332, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SWINUB] = -// { -// .categoryName = _("PIG"), -// .height = 4, -// .weight = 65, -// .description = gSwinubPokedexText, -// .unusedDescription = gSwinubPokedexTextUnused, -// .pokemonScale = 324, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PILOSWINE] = -// { -// .categoryName = _("SWINE"), -// .height = 11, -// .weight = 558, -// .description = gPiloswinePokedexText, -// .unusedDescription = gPiloswinePokedexTextUnused, -// .pokemonScale = 306, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CORSOLA] = -// { -// .categoryName = _("CORAL"), -// .height = 6, -// .weight = 50, -// .description = gCorsolaPokedexText, -// .unusedDescription = gCorsolaPokedexTextUnused, -// .pokemonScale = 410, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_REMORAID] = -// { -// .categoryName = _("JET"), -// .height = 6, -// .weight = 120, -// .description = gRemoraidPokedexText, -// .unusedDescription = gRemoraidPokedexTextUnused, -// .pokemonScale = 316, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_OCTILLERY] = -// { -// .categoryName = _("JET"), -// .height = 9, -// .weight = 285, -// .description = gOctilleryPokedexText, -// .unusedDescription = gOctilleryPokedexTextUnused, -// .pokemonScale = 296, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DELIBIRD] = -// { -// .categoryName = _("DELIVERY"), -// .height = 9, -// .weight = 160, -// .description = gDelibirdPokedexText, -// .unusedDescription = gDelibirdPokedexTextUnused, -// .pokemonScale = 293, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MANTINE] = -// { -// .categoryName = _("KITE"), -// .height = 21, -// .weight = 2200, -// .description = gMantinePokedexText, -// .unusedDescription = gMantinePokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 0, -// .trainerScale = 360, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_SKARMORY] = -// { -// .categoryName = _("ARMOR BIRD"), -// .height = 17, -// .weight = 505, -// .description = gSkarmoryPokedexText, -// .unusedDescription = gSkarmoryPokedexTextUnused, -// .pokemonScale = 285, -// .pokemonOffset = 0, -// .trainerScale = 276, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_HOUNDOUR] = -// { -// .categoryName = _("DARK"), -// .height = 6, -// .weight = 108, -// .description = gHoundourPokedexText, -// .unusedDescription = gHoundourPokedexTextUnused, -// .pokemonScale = 393, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HOUNDOOM] = -// { -// .categoryName = _("DARK"), -// .height = 14, -// .weight = 350, -// .description = gHoundoomPokedexText, -// .unusedDescription = gHoundoomPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KINGDRA] = -// { -// .categoryName = _("DRAGON"), -// .height = 18, -// .weight = 1520, -// .description = gKingdraPokedexText, -// .unusedDescription = gKingdraPokedexTextUnused, -// .pokemonScale = 257, -// .pokemonOffset = 1, -// .trainerScale = 293, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_PHANPY] = -// { -// .categoryName = _("LONG NOSE"), -// .height = 5, -// .weight = 335, -// .description = gPhanpyPokedexText, -// .unusedDescription = gPhanpyPokedexTextUnused, -// .pokemonScale = 465, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DONPHAN] = -// { -// .categoryName = _("ARMOR"), -// .height = 11, -// .weight = 1200, -// .description = gDonphanPokedexText, -// .unusedDescription = gDonphanPokedexTextUnused, -// .pokemonScale = 313, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PORYGON2] = -// { -// .categoryName = _("VIRTUAL"), -// .height = 6, -// .weight = 325, -// .description = gPorygon2PokedexText, -// .unusedDescription = gPorygon2PokedexTextUnused, -// .pokemonScale = 320, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_STANTLER] = -// { -// .categoryName = _("BIG HORN"), -// .height = 14, -// .weight = 712, -// .description = gStantlerPokedexText, -// .unusedDescription = gStantlerPokedexTextUnused, -// .pokemonScale = 277, -// .pokemonOffset = -1, -// .trainerScale = 277, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_SMEARGLE] = -// { -// .categoryName = _("PAINTER"), -// .height = 12, -// .weight = 580, -// .description = gSmearglePokedexText, -// .unusedDescription = gSmearglePokedexTextUnused, -// .pokemonScale = 287, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TYROGUE] = -// { -// .categoryName = _("SCUFFLE"), -// .height = 7, -// .weight = 210, -// .description = gTyroguePokedexText, -// .unusedDescription = gTyroguePokedexTextUnused, -// .pokemonScale = 292, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HITMONTOP] = -// { -// .categoryName = _("HANDSTAND"), -// .height = 14, -// .weight = 480, -// .description = gHitmontopPokedexText, -// .unusedDescription = gHitmontopPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 2, -// .trainerScale = 257, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SMOOCHUM] = -// { -// .categoryName = _("KISS"), -// .height = 4, -// .weight = 60, -// .description = gSmoochumPokedexText, -// .unusedDescription = gSmoochumPokedexTextUnused, -// .pokemonScale = 440, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ELEKID] = -// { -// .categoryName = _("ELECTRIC"), -// .height = 6, -// .weight = 235, -// .description = gElekidPokedexText, -// .unusedDescription = gElekidPokedexTextUnused, -// .pokemonScale = 363, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAGBY] = -// { -// .categoryName = _("LIVE COAL"), -// .height = 7, -// .weight = 214, -// .description = gMagbyPokedexText, -// .unusedDescription = gMagbyPokedexTextUnused, -// .pokemonScale = 284, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MILTANK] = -// { -// .categoryName = _("MILK COW"), -// .height = 12, -// .weight = 755, -// .description = gMiltankPokedexText, -// .unusedDescription = gMiltankPokedexTextUnused, -// .pokemonScale = 280, -// .pokemonOffset = 3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BLISSEY] = -// { -// .categoryName = _("HAPPINESS"), -// .height = 15, -// .weight = 468, -// .description = gBlisseyPokedexText, -// .unusedDescription = gBlisseyPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 310, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_RAIKOU] = -// { -// .categoryName = _("THUNDER"), -// .height = 19, -// .weight = 1780, -// .description = gRaikouPokedexText, -// .unusedDescription = gRaikouPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 0, -// .trainerScale = 359, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_ENTEI] = -// { -// .categoryName = _("VOLCANO"), -// .height = 21, -// .weight = 1980, -// .description = gEnteiPokedexText, -// .unusedDescription = gEnteiPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 0, -// .trainerScale = 370, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_SUICUNE] = -// { -// .categoryName = _("AURORA"), -// .height = 20, -// .weight = 1870, -// .description = gSuicunePokedexText, -// .unusedDescription = gSuicunePokedexTextUnused, -// .pokemonScale = 286, -// .pokemonOffset = 0, -// .trainerScale = 371, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_LARVITAR] = -// { -// .categoryName = _("ROCK SKIN"), -// .height = 6, -// .weight = 720, -// .description = gLarvitarPokedexText, -// .unusedDescription = gLarvitarPokedexTextUnused, -// .pokemonScale = 472, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PUPITAR] = -// { -// .categoryName = _("HARD SHELL"), -// .height = 12, -// .weight = 1520, -// .description = gPupitarPokedexText, -// .unusedDescription = gPupitarPokedexTextUnused, -// .pokemonScale = 292, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TYRANITAR] = -// { -// .categoryName = _("ARMOR"), -// .height = 20, -// .weight = 2020, -// .description = gTyranitarPokedexText, -// .unusedDescription = gTyranitarPokedexTextUnused, -// .pokemonScale = 285, -// .pokemonOffset = 0, -// .trainerScale = 383, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_LUGIA] = -// { -// .categoryName = _("DIVING"), -// .height = 52, -// .weight = 2160, -// .description = gLugiaPokedexText, -// .unusedDescription = gLugiaPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 0, -// .trainerScale = 742, -// .trainerOffset = 18, -// }, - -// [NATIONAL_DEX_HO_OH] = -// { -// .categoryName = _("RAINBOW"), -// .height = 38, -// .weight = 1990, -// .description = gHoOhPokedexText, -// .unusedDescription = gHoOhPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 0, -// .trainerScale = 620, -// .trainerOffset = 16, -// }, - -// [NATIONAL_DEX_CELEBI] = -// { -// .categoryName = _("TIME TRAVEL"), -// .height = 6, -// .weight = 50, -// .description = gCelebiPokedexText, -// .unusedDescription = gCelebiPokedexTextUnused, -// .pokemonScale = 393, -// .pokemonOffset = -10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TREECKO] = -// { -// .categoryName = _("WOOD GECKO"), -// .height = 5, -// .weight = 50, -// .description = gTreeckoPokedexText, -// .unusedDescription = gTreeckoPokedexTextUnused, -// .pokemonScale = 541, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GROVYLE] = -// { -// .categoryName = _("WOOD GECKO"), -// .height = 9, -// .weight = 216, -// .description = gGrovylePokedexText, -// .unusedDescription = gGrovylePokedexTextUnused, -// .pokemonScale = 360, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SCEPTILE] = -// { -// .categoryName = _("FOREST"), -// .height = 17, -// .weight = 522, -// .description = gSceptilePokedexText, -// .unusedDescription = gSceptilePokedexTextUnused, -// .pokemonScale = 282, -// .pokemonOffset = -1, -// .trainerScale = 313, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_TORCHIC] = -// { -// .categoryName = _("CHICK"), -// .height = 4, -// .weight = 25, -// .description = gTorchicPokedexText, -// .unusedDescription = gTorchicPokedexTextUnused, -// .pokemonScale = 566, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_COMBUSKEN] = -// { -// .categoryName = _("YOUNG FOWL"), -// .height = 9, -// .weight = 195, -// .description = gCombuskenPokedexText, -// .unusedDescription = gCombuskenPokedexTextUnused, -// .pokemonScale = 343, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BLAZIKEN] = -// { -// .categoryName = _("BLAZE"), -// .height = 19, -// .weight = 520, -// .description = gBlazikenPokedexText, -// .unusedDescription = gBlazikenPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = -1, -// .trainerScale = 314, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_MUDKIP] = -// { -// .categoryName = _("MUD FISH"), -// .height = 4, -// .weight = 76, -// .description = gMudkipPokedexText, -// .unusedDescription = gMudkipPokedexTextUnused, -// .pokemonScale = 535, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MARSHTOMP] = -// { -// .categoryName = _("MUD FISH"), -// .height = 7, -// .weight = 280, -// .description = gMarshtompPokedexText, -// .unusedDescription = gMarshtompPokedexTextUnused, -// .pokemonScale = 340, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SWAMPERT] = -// { -// .categoryName = _("MUD FISH"), -// .height = 15, -// .weight = 819, -// .description = gSwampertPokedexText, -// .unusedDescription = gSwampertPokedexTextUnused, -// .pokemonScale = 276, -// .pokemonOffset = -1, -// .trainerScale = 282, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_POOCHYENA] = -// { -// .categoryName = _("BITE"), -// .height = 5, -// .weight = 136, -// .description = gPoochyenaPokedexText, -// .unusedDescription = gPoochyenaPokedexTextUnused, -// .pokemonScale = 481, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MIGHTYENA] = -// { -// .categoryName = _("BITE"), -// .height = 10, -// .weight = 370, -// .description = gMightyenaPokedexText, -// .unusedDescription = gMightyenaPokedexTextUnused, -// .pokemonScale = 359, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ZIGZAGOON] = -// { -// .categoryName = _("TINYRACCOON"), -// .height = 4, -// .weight = 175, -// .description = gZigzagoonPokedexText, -// .unusedDescription = gZigzagoonPokedexTextUnused, -// .pokemonScale = 560, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LINOONE] = -// { -// .categoryName = _("RUSHING"), -// .height = 5, -// .weight = 325, -// .description = gLinoonePokedexText, -// .unusedDescription = gLinoonePokedexTextUnused, -// .pokemonScale = 321, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WURMPLE] = -// { -// .categoryName = _("WORM"), -// .height = 3, -// .weight = 36, -// .description = gWurmplePokedexText, -// .unusedDescription = gWurmplePokedexTextUnused, -// .pokemonScale = 711, -// .pokemonOffset = 22, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SILCOON] = -// { -// .categoryName = _("COCOON"), -// .height = 6, -// .weight = 100, -// .description = gSilcoonPokedexText, -// .unusedDescription = gSilcoonPokedexTextUnused, -// .pokemonScale = 431, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BEAUTIFLY] = -// { -// .categoryName = _("BUTTERFLY"), -// .height = 10, -// .weight = 284, -// .description = gBeautiflyPokedexText, -// .unusedDescription = gBeautiflyPokedexTextUnused, -// .pokemonScale = 298, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CASCOON] = -// { -// .categoryName = _("COCOON"), -// .height = 7, -// .weight = 115, -// .description = gCascoonPokedexText, -// .unusedDescription = gCascoonPokedexTextUnused, -// .pokemonScale = 391, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DUSTOX] = -// { -// .categoryName = _("POISON MOTH"), -// .height = 12, -// .weight = 316, -// .description = gDustoxPokedexText, -// .unusedDescription = gDustoxPokedexTextUnused, -// .pokemonScale = 269, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LOTAD] = -// { -// .categoryName = _("WATER WEED"), -// .height = 5, -// .weight = 26, -// .description = gLotadPokedexText, -// .unusedDescription = gLotadPokedexTextUnused, -// .pokemonScale = 406, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LOMBRE] = -// { -// .categoryName = _("JOLLY"), -// .height = 12, -// .weight = 325, -// .description = gLombrePokedexText, -// .unusedDescription = gLombrePokedexTextUnused, -// .pokemonScale = 277, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LUDICOLO] = -// { -// .categoryName = _("CAREFREE"), -// .height = 15, -// .weight = 550, -// .description = gLudicoloPokedexText, -// .unusedDescription = gLudicoloPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = 0, -// .trainerScale = 282, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_SEEDOT] = -// { -// .categoryName = _("ACORN"), -// .height = 5, -// .weight = 40, -// .description = gSeedotPokedexText, -// .unusedDescription = gSeedotPokedexTextUnused, -// .pokemonScale = 472, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NUZLEAF] = -// { -// .categoryName = _("WILY"), -// .height = 10, -// .weight = 280, -// .description = gNuzleafPokedexText, -// .unusedDescription = gNuzleafPokedexTextUnused, -// .pokemonScale = 299, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SHIFTRY] = -// { -// .categoryName = _("WICKED"), -// .height = 13, -// .weight = 596, -// .description = gShiftryPokedexText, -// .unusedDescription = gShiftryPokedexTextUnused, -// .pokemonScale = 290, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TAILLOW] = -// { -// .categoryName = _("TINYSWALLOW"), -// .height = 3, -// .weight = 23, -// .description = gTaillowPokedexText, -// .unusedDescription = gTaillowPokedexTextUnused, -// .pokemonScale = 465, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SWELLOW] = -// { -// .categoryName = _("SWALLOW"), -// .height = 7, -// .weight = 198, -// .description = gSwellowPokedexText, -// .unusedDescription = gSwellowPokedexTextUnused, -// .pokemonScale = 428, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WINGULL] = -// { -// .categoryName = _("SEAGULL"), -// .height = 6, -// .weight = 95, -// .description = gWingullPokedexText, -// .unusedDescription = gWingullPokedexTextUnused, -// .pokemonScale = 295, -// .pokemonOffset = -2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PELIPPER] = -// { -// .categoryName = _("WATER BIRD"), -// .height = 12, -// .weight = 280, -// .description = gPelipperPokedexText, -// .unusedDescription = gPelipperPokedexTextUnused, -// .pokemonScale = 288, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RALTS] = -// { -// .categoryName = _("FEELING"), -// .height = 4, -// .weight = 66, -// .description = gRaltsPokedexText, -// .unusedDescription = gRaltsPokedexTextUnused, -// .pokemonScale = 457, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KIRLIA] = -// { -// .categoryName = _("EMOTION"), -// .height = 8, -// .weight = 202, -// .description = gKirliaPokedexText, -// .unusedDescription = gKirliaPokedexTextUnused, -// .pokemonScale = 354, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GARDEVOIR] = -// { -// .categoryName = _("EMBRACE"), -// .height = 16, -// .weight = 484, -// .description = gGardevoirPokedexText, -// .unusedDescription = gGardevoirPokedexTextUnused, -// .pokemonScale = 277, -// .pokemonOffset = 0, -// .trainerScale = 276, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_SURSKIT] = -// { -// .categoryName = _("POND SKATER"), -// .height = 5, -// .weight = 17, -// .description = gSurskitPokedexText, -// .unusedDescription = gSurskitPokedexTextUnused, -// .pokemonScale = 375, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MASQUERAIN] = -// { -// .categoryName = _("EYEBALL"), -// .height = 8, -// .weight = 36, -// .description = gMasquerainPokedexText, -// .unusedDescription = gMasquerainPokedexTextUnused, -// .pokemonScale = 378, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SHROOMISH] = -// { -// .categoryName = _("MUSHROOM"), -// .height = 4, -// .weight = 45, -// .description = gShroomishPokedexText, -// .unusedDescription = gShroomishPokedexTextUnused, -// .pokemonScale = 513, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BRELOOM] = -// { -// .categoryName = _("MUSHROOM"), -// .height = 12, -// .weight = 392, -// .description = gBreloomPokedexText, -// .unusedDescription = gBreloomPokedexTextUnused, -// .pokemonScale = 324, -// .pokemonOffset = 6, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SLAKOTH] = -// { -// .categoryName = _("SLACKER"), -// .height = 8, -// .weight = 240, -// .description = gSlakothPokedexText, -// .unusedDescription = gSlakothPokedexTextUnused, -// .pokemonScale = 291, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VIGOROTH] = -// { -// .categoryName = _("WILD MONKEY"), -// .height = 14, -// .weight = 465, -// .description = gVigorothPokedexText, -// .unusedDescription = gVigorothPokedexTextUnused, -// .pokemonScale = 301, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SLAKING] = -// { -// .categoryName = _("LAZY"), -// .height = 20, -// .weight = 1305, -// .description = gSlakingPokedexText, -// .unusedDescription = gSlakingPokedexTextUnused, -// .pokemonScale = 277, -// .pokemonOffset = 5, -// .trainerScale = 326, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_NINCADA] = -// { -// .categoryName = _("TRAINEE"), -// .height = 5, -// .weight = 55, -// .description = gNincadaPokedexText, -// .unusedDescription = gNincadaPokedexTextUnused, -// .pokemonScale = 405, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NINJASK] = -// { -// .categoryName = _("NINJA"), -// .height = 8, -// .weight = 120, -// .description = gNinjaskPokedexText, -// .unusedDescription = gNinjaskPokedexTextUnused, -// .pokemonScale = 383, -// .pokemonOffset = -9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SHEDINJA] = -// { -// .categoryName = _("SHED"), -// .height = 8, -// .weight = 12, -// .description = gShedinjaPokedexText, -// .unusedDescription = gShedinjaPokedexTextUnused, -// .pokemonScale = 372, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WHISMUR] = -// { -// .categoryName = _("WHISPER"), -// .height = 6, -// .weight = 163, -// .description = gWhismurPokedexText, -// .unusedDescription = gWhismurPokedexTextUnused, -// .pokemonScale = 373, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LOUDRED] = -// { -// .categoryName = _("BIG VOICE"), -// .height = 10, -// .weight = 405, -// .description = gLoudredPokedexText, -// .unusedDescription = gLoudredPokedexTextUnused, -// .pokemonScale = 356, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_EXPLOUD] = -// { -// .categoryName = _("LOUD NOISE"), -// .height = 15, -// .weight = 840, -// .description = gExploudPokedexText, -// .unusedDescription = gExploudPokedexTextUnused, -// .pokemonScale = 284, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAKUHITA] = -// { -// .categoryName = _("GUTS"), -// .height = 10, -// .weight = 864, -// .description = gMakuhitaPokedexText, -// .unusedDescription = gMakuhitaPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HARIYAMA] = -// { -// .categoryName = _("ARM THRUST"), -// .height = 23, -// .weight = 2538, -// .description = gHariyamaPokedexText, -// .unusedDescription = gHariyamaPokedexTextUnused, -// .pokemonScale = 268, -// .pokemonOffset = -1, -// .trainerScale = 375, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_AZURILL] = -// { -// .categoryName = _("POLKA DOT"), -// .height = 2, -// .weight = 20, -// .description = gAzurillPokedexText, -// .unusedDescription = gAzurillPokedexTextUnused, -// .pokemonScale = 603, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_NOSEPASS] = -// { -// .categoryName = _("COMPASS"), -// .height = 10, -// .weight = 970, -// .description = gNosepassPokedexText, -// .unusedDescription = gNosepassPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 9, -// .trainerScale = 289, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_SKITTY] = -// { -// .categoryName = _("KITTEN"), -// .height = 6, -// .weight = 110, -// .description = gSkittyPokedexText, -// .unusedDescription = gSkittyPokedexTextUnused, -// .pokemonScale = 492, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DELCATTY] = -// { -// .categoryName = _("PRIM"), -// .height = 11, -// .weight = 326, -// .description = gDelcattyPokedexText, -// .unusedDescription = gDelcattyPokedexTextUnused, -// .pokemonScale = 322, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SABLEYE] = -// { -// .categoryName = _("DARKNESS"), -// .height = 5, -// .weight = 110, -// .description = gSableyePokedexText, -// .unusedDescription = gSableyePokedexTextUnused, -// .pokemonScale = 451, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MAWILE] = -// { -// .categoryName = _("DECEIVER"), -// .height = 6, -// .weight = 115, -// .description = gMawilePokedexText, -// .unusedDescription = gMawilePokedexTextUnused, -// .pokemonScale = 466, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -3, -// }, - -// [NATIONAL_DEX_ARON] = -// { -// .categoryName = _("IRON ARMOR"), -// .height = 4, -// .weight = 600, -// .description = gAronPokedexText, -// .unusedDescription = gAronPokedexTextUnused, -// .pokemonScale = 419, -// .pokemonOffset = 21, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LAIRON] = -// { -// .categoryName = _("IRON ARMOR"), -// .height = 9, -// .weight = 1200, -// .description = gLaironPokedexText, -// .unusedDescription = gLaironPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 11, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_AGGRON] = -// { -// .categoryName = _("IRON ARMOR"), -// .height = 21, -// .weight = 3600, -// .description = gAggronPokedexText, -// .unusedDescription = gAggronPokedexTextUnused, -// .pokemonScale = 274, -// .pokemonOffset = -1, -// .trainerScale = 374, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_MEDITITE] = -// { -// .categoryName = _("MEDITATE"), -// .height = 6, -// .weight = 112, -// .description = gMedititePokedexText, -// .unusedDescription = gMedititePokedexTextUnused, -// .pokemonScale = 465, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MEDICHAM] = -// { -// .categoryName = _("MEDITATE"), -// .height = 13, -// .weight = 315, -// .description = gMedichamPokedexText, -// .unusedDescription = gMedichamPokedexTextUnused, -// .pokemonScale = 298, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ELECTRIKE] = -// { -// .categoryName = _("LIGHTNING"), -// .height = 6, -// .weight = 152, -// .description = gElectrikePokedexText, -// .unusedDescription = gElectrikePokedexTextUnused, -// .pokemonScale = 290, -// .pokemonOffset = 16, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MANECTRIC] = -// { -// .categoryName = _("DISCHARGE"), -// .height = 15, -// .weight = 402, -// .description = gManectricPokedexText, -// .unusedDescription = gManectricPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 257, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_PLUSLE] = -// { -// .categoryName = _("CHEERING"), -// .height = 4, -// .weight = 42, -// .description = gPluslePokedexText, -// .unusedDescription = gPluslePokedexTextUnused, -// .pokemonScale = 515, -// .pokemonOffset = -9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MINUN] = -// { -// .categoryName = _("CHEERING"), -// .height = 4, -// .weight = 42, -// .description = gMinunPokedexText, -// .unusedDescription = gMinunPokedexTextUnused, -// .pokemonScale = 512, -// .pokemonOffset = -7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VOLBEAT] = -// { -// .categoryName = _("FIREFLY"), -// .height = 7, -// .weight = 177, -// .description = gVolbeatPokedexText, -// .unusedDescription = gVolbeatPokedexTextUnused, -// .pokemonScale = 442, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ILLUMISE] = -// { -// .categoryName = _("FIREFLY"), -// .height = 6, -// .weight = 177, -// .description = gIllumisePokedexText, -// .unusedDescription = gIllumisePokedexTextUnused, -// .pokemonScale = 572, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ROSELIA] = -// { -// .categoryName = _("THORN"), -// .height = 3, -// .weight = 20, -// .description = gRoseliaPokedexText, -// .unusedDescription = gRoseliaPokedexTextUnused, -// .pokemonScale = 677, -// .pokemonOffset = 20, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GULPIN] = -// { -// .categoryName = _("STOMACH"), -// .height = 4, -// .weight = 103, -// .description = gGulpinPokedexText, -// .unusedDescription = gGulpinPokedexTextUnused, -// .pokemonScale = 593, -// .pokemonOffset = 22, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SWALOT] = -// { -// .categoryName = _("POISON BAG"), -// .height = 17, -// .weight = 800, -// .description = gSwalotPokedexText, -// .unusedDescription = gSwalotPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 5, -// .trainerScale = 345, -// .trainerOffset = 4, -// }, - -// [NATIONAL_DEX_CARVANHA] = -// { -// .categoryName = _("SAVAGE"), -// .height = 8, -// .weight = 208, -// .description = gCarvanhaPokedexText, -// .unusedDescription = gCarvanhaPokedexTextUnused, -// .pokemonScale = 362, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SHARPEDO] = -// { -// .categoryName = _("BRUTAL"), -// .height = 18, -// .weight = 888, -// .description = gSharpedoPokedexText, -// .unusedDescription = gSharpedoPokedexTextUnused, -// .pokemonScale = 265, -// .pokemonOffset = 0, -// .trainerScale = 342, -// .trainerOffset = 4, -// }, - -// [NATIONAL_DEX_WAILMER] = -// { -// .categoryName = _("BALL WHALE"), -// .height = 20, -// .weight = 1300, -// .description = gWailmerPokedexText, -// .unusedDescription = gWailmerPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 10, -// .trainerScale = 493, -// .trainerOffset = 10, -// }, - -// [NATIONAL_DEX_WAILORD] = -// { -// .categoryName = _("FLOAT WHALE"), -// .height = 145, -// .weight = 3980, -// .description = gWailordPokedexText, -// .unusedDescription = gWailordPokedexTextUnused, -// .pokemonScale = 276, -// .pokemonOffset = -1, -// .trainerScale = 1428, -// .trainerOffset = 20, -// }, - -// [NATIONAL_DEX_NUMEL] = -// { -// .categoryName = _("NUMB"), -// .height = 7, -// .weight = 240, -// .description = gNumelPokedexText, -// .unusedDescription = gNumelPokedexTextUnused, -// .pokemonScale = 310, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CAMERUPT] = -// { -// .categoryName = _("ERUPTION"), -// .height = 19, -// .weight = 2200, -// .description = gCameruptPokedexText, -// .unusedDescription = gCameruptPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 6, -// .trainerScale = 345, -// .trainerOffset = 4, -// }, - -// [NATIONAL_DEX_TORKOAL] = -// { -// .categoryName = _("COAL"), -// .height = 5, -// .weight = 804, -// .description = gTorkoalPokedexText, -// .unusedDescription = gTorkoalPokedexTextUnused, -// .pokemonScale = 392, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SPOINK] = -// { -// .categoryName = _("BOUNCE"), -// .height = 7, -// .weight = 306, -// .description = gSpoinkPokedexText, -// .unusedDescription = gSpoinkPokedexTextUnused, -// .pokemonScale = 423, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GRUMPIG] = -// { -// .categoryName = _("MANIPULATE"), -// .height = 9, -// .weight = 715, -// .description = gGrumpigPokedexText, -// .unusedDescription = gGrumpigPokedexTextUnused, -// .pokemonScale = 358, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SPINDA] = -// { -// .categoryName = _("SPOT PANDA"), -// .height = 11, -// .weight = 50, -// .description = gSpindaPokedexText, -// .unusedDescription = gSpindaPokedexTextUnused, -// .pokemonScale = 321, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_TRAPINCH] = -// { -// .categoryName = _("ANT PIT"), -// .height = 7, -// .weight = 150, -// .description = gTrapinchPokedexText, -// .unusedDescription = gTrapinchPokedexTextUnused, -// .pokemonScale = 298, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_VIBRAVA] = -// { -// .categoryName = _("VIBRATION"), -// .height = 11, -// .weight = 153, -// .description = gVibravaPokedexText, -// .unusedDescription = gVibravaPokedexTextUnused, -// .pokemonScale = 370, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_FLYGON] = -// { -// .categoryName = _("MYSTIC"), -// .height = 20, -// .weight = 820, -// .description = gFlygonPokedexText, -// .unusedDescription = gFlygonPokedexTextUnused, -// .pokemonScale = 280, -// .pokemonOffset = 0, -// .trainerScale = 299, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_CACNEA] = -// { -// .categoryName = _("CACTUS"), -// .height = 4, -// .weight = 513, -// .description = gCacneaPokedexText, -// .unusedDescription = gCacneaPokedexTextUnused, -// .pokemonScale = 455, -// .pokemonOffset = 19, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CACTURNE] = -// { -// .categoryName = _("SCARECROW"), -// .height = 13, -// .weight = 774, -// .description = gCacturnePokedexText, -// .unusedDescription = gCacturnePokedexTextUnused, -// .pokemonScale = 327, -// .pokemonOffset = 3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SWABLU] = -// { -// .categoryName = _("COTTON BIRD"), -// .height = 4, -// .weight = 12, -// .description = gSwabluPokedexText, -// .unusedDescription = gSwabluPokedexTextUnused, -// .pokemonScale = 422, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ALTARIA] = -// { -// .categoryName = _("HUMMING"), -// .height = 11, -// .weight = 206, -// .description = gAltariaPokedexText, -// .unusedDescription = gAltariaPokedexTextUnused, -// .pokemonScale = 327, -// .pokemonOffset = 0, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ZANGOOSE] = -// { -// .categoryName = _("CAT FERRET"), -// .height = 13, -// .weight = 403, -// .description = gZangoosePokedexText, -// .unusedDescription = gZangoosePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SEVIPER] = -// { -// .categoryName = _("FANG SNAKE"), -// .height = 27, -// .weight = 525, -// .description = gSeviperPokedexText, -// .unusedDescription = gSeviperPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = 6, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LUNATONE] = -// { -// .categoryName = _("METEORITE"), -// .height = 10, -// .weight = 1680, -// .description = gLunatonePokedexText, -// .unusedDescription = gLunatonePokedexTextUnused, -// .pokemonScale = 300, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SOLROCK] = -// { -// .categoryName = _("METEORITE"), -// .height = 12, -// .weight = 1540, -// .description = gSolrockPokedexText, -// .unusedDescription = gSolrockPokedexTextUnused, -// .pokemonScale = 328, -// .pokemonOffset = -3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BARBOACH] = -// { -// .categoryName = _("WHISKERS"), -// .height = 4, -// .weight = 19, -// .description = gBarboachPokedexText, -// .unusedDescription = gBarboachPokedexTextUnused, -// .pokemonScale = 581, -// .pokemonOffset = -2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WHISCASH] = -// { -// .categoryName = _("WHISKERS"), -// .height = 9, -// .weight = 236, -// .description = gWhiscashPokedexText, -// .unusedDescription = gWhiscashPokedexTextUnused, -// .pokemonScale = 317, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CORPHISH] = -// { -// .categoryName = _("RUFFIAN"), -// .height = 6, -// .weight = 115, -// .description = gCorphishPokedexText, -// .unusedDescription = gCorphishPokedexTextUnused, -// .pokemonScale = 484, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CRAWDAUNT] = -// { -// .categoryName = _("ROGUE"), -// .height = 11, -// .weight = 328, -// .description = gCrawdauntPokedexText, -// .unusedDescription = gCrawdauntPokedexTextUnused, -// .pokemonScale = 365, -// .pokemonOffset = 7, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BALTOY] = -// { -// .categoryName = _("CLAY DOLL"), -// .height = 5, -// .weight = 215, -// .description = gBaltoyPokedexText, -// .unusedDescription = gBaltoyPokedexTextUnused, -// .pokemonScale = 384, -// .pokemonOffset = 18, -// .trainerScale = 256, -// .trainerOffset = -3, -// }, - -// [NATIONAL_DEX_CLAYDOL] = -// { -// .categoryName = _("CLAY DOLL"), -// .height = 15, -// .weight = 1080, -// .description = gClaydolPokedexText, -// .unusedDescription = gClaydolPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 280, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_LILEEP] = -// { -// .categoryName = _("SEA LILY"), -// .height = 10, -// .weight = 238, -// .description = gLileepPokedexText, -// .unusedDescription = gLileepPokedexTextUnused, -// .pokemonScale = 305, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_CRADILY] = -// { -// .categoryName = _("BARNACLE"), -// .height = 15, -// .weight = 604, -// .description = gCradilyPokedexText, -// .unusedDescription = gCradilyPokedexTextUnused, -// .pokemonScale = 275, -// .pokemonOffset = -1, -// .trainerScale = 269, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_ANORITH] = -// { -// .categoryName = _("OLD SHRIMP"), -// .height = 7, -// .weight = 125, -// .description = gAnorithPokedexText, -// .unusedDescription = gAnorithPokedexTextUnused, -// .pokemonScale = 296, -// .pokemonOffset = 4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ARMALDO] = -// { -// .categoryName = _("PLATE"), -// .height = 15, -// .weight = 682, -// .description = gArmaldoPokedexText, -// .unusedDescription = gArmaldoPokedexTextUnused, -// .pokemonScale = 312, -// .pokemonOffset = 2, -// .trainerScale = 271, -// .trainerOffset = -1, -// }, - -// [NATIONAL_DEX_FEEBAS] = -// { -// .categoryName = _("FISH"), -// .height = 6, -// .weight = 74, -// .description = gFeebasPokedexText, -// .unusedDescription = gFeebasPokedexTextUnused, -// .pokemonScale = 423, -// .pokemonOffset = 3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_MILOTIC] = -// { -// .categoryName = _("TENDER"), -// .height = 62, -// .weight = 1620, -// .description = gMiloticPokedexText, -// .unusedDescription = gMiloticPokedexTextUnused, -// .pokemonScale = 282, -// .pokemonOffset = -1, -// .trainerScale = 382, -// .trainerOffset = 7, -// }, - -// [NATIONAL_DEX_CASTFORM] = -// { -// .categoryName = _("WEATHER"), -// .height = 3, -// .weight = 8, -// .description = gCastformPokedexText, -// .unusedDescription = gCastformPokedexTextUnused, -// .pokemonScale = 435, -// .pokemonOffset = -5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_KECLEON] = -// { -// .categoryName = _("COLOR SWAP"), -// .height = 10, -// .weight = 220, -// .description = gKecleonPokedexText, -// .unusedDescription = gKecleonPokedexTextUnused, -// .pokemonScale = 316, -// .pokemonOffset = 8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SHUPPET] = -// { -// .categoryName = _("PUPPET"), -// .height = 6, -// .weight = 23, -// .description = gShuppetPokedexText, -// .unusedDescription = gShuppetPokedexTextUnused, -// .pokemonScale = 440, -// .pokemonOffset = -3, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BANETTE] = -// { -// .categoryName = _("MARIONETTE"), -// .height = 11, -// .weight = 125, -// .description = gBanettePokedexText, -// .unusedDescription = gBanettePokedexTextUnused, -// .pokemonScale = 262, -// .pokemonOffset = 9, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DUSKULL] = -// { -// .categoryName = _("REQUIEM"), -// .height = 8, -// .weight = 150, -// .description = gDuskullPokedexText, -// .unusedDescription = gDuskullPokedexTextUnused, -// .pokemonScale = 376, -// .pokemonOffset = 13, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DUSCLOPS] = -// { -// .categoryName = _("BECKON"), -// .height = 16, -// .weight = 306, -// .description = gDusclopsPokedexText, -// .unusedDescription = gDusclopsPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 2, -// .trainerScale = 299, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_TROPIUS] = -// { -// .categoryName = _("FRUIT"), -// .height = 20, -// .weight = 1000, -// .description = gTropiusPokedexText, -// .unusedDescription = gTropiusPokedexTextUnused, -// .pokemonScale = 283, -// .pokemonOffset = -1, -// .trainerScale = 371, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_CHIMECHO] = -// { -// .categoryName = _("WIND CHIME"), -// .height = 6, -// .weight = 10, -// .description = gChimechoPokedexText, -// .unusedDescription = gChimechoPokedexTextUnused, -// .pokemonScale = 505, -// .pokemonOffset = -4, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_ABSOL] = -// { -// .categoryName = _("DISASTER"), -// .height = 12, -// .weight = 470, -// .description = gAbsolPokedexText, -// .unusedDescription = gAbsolPokedexTextUnused, -// .pokemonScale = 301, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WYNAUT] = -// { -// .categoryName = _("BRIGHT"), -// .height = 6, -// .weight = 140, -// .description = gWynautPokedexText, -// .unusedDescription = gWynautPokedexTextUnused, -// .pokemonScale = 453, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SNORUNT] = -// { -// .categoryName = _("SNOW HAT"), -// .height = 7, -// .weight = 168, -// .description = gSnoruntPokedexText, -// .unusedDescription = gSnoruntPokedexTextUnused, -// .pokemonScale = 380, -// .pokemonOffset = 14, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GLALIE] = -// { -// .categoryName = _("FACE"), -// .height = 15, -// .weight = 2565, -// .description = gGlaliePokedexText, -// .unusedDescription = gGlaliePokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 344, -// .trainerOffset = 2, -// }, - -// [NATIONAL_DEX_SPHEAL] = -// { -// .categoryName = _("CLAP"), -// .height = 8, -// .weight = 395, -// .description = gSphealPokedexText, -// .unusedDescription = gSphealPokedexTextUnused, -// .pokemonScale = 315, -// .pokemonOffset = 15, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SEALEO] = -// { -// .categoryName = _("BALL ROLL"), -// .height = 11, -// .weight = 876, -// .description = gSealeoPokedexText, -// .unusedDescription = gSealeoPokedexTextUnused, -// .pokemonScale = 338, -// .pokemonOffset = 12, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_WALREIN] = -// { -// .categoryName = _("ICE BREAK"), -// .height = 14, -// .weight = 1506, -// .description = gWalreinPokedexText, -// .unusedDescription = gWalreinPokedexTextUnused, -// .pokemonScale = 305, -// .pokemonOffset = 2, -// .trainerScale = 277, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_CLAMPERL] = -// { -// .categoryName = _("BIVALVE"), -// .height = 4, -// .weight = 525, -// .description = gClamperlPokedexText, -// .unusedDescription = gClamperlPokedexTextUnused, -// .pokemonScale = 691, -// .pokemonOffset = 22, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_HUNTAIL] = -// { -// .categoryName = _("DEEP SEA"), -// .height = 17, -// .weight = 270, -// .description = gHuntailPokedexText, -// .unusedDescription = gHuntailPokedexTextUnused, -// .pokemonScale = 307, -// .pokemonOffset = 1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_GOREBYSS] = -// { -// .categoryName = _("SOUTH SEA"), -// .height = 18, -// .weight = 226, -// .description = gGorebyssPokedexText, -// .unusedDescription = gGorebyssPokedexTextUnused, -// .pokemonScale = 278, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_RELICANTH] = -// { -// .categoryName = _("LONGEVITY"), -// .height = 10, -// .weight = 234, -// .description = gRelicanthPokedexText, -// .unusedDescription = gRelicanthPokedexTextUnused, -// .pokemonScale = 316, -// .pokemonOffset = 5, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LUVDISC] = -// { -// .categoryName = _("RENDEZVOUS"), -// .height = 6, -// .weight = 87, -// .description = gLuvdiscPokedexText, -// .unusedDescription = gLuvdiscPokedexTextUnused, -// .pokemonScale = 371, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_BAGON] = -// { -// .categoryName = _("ROCK HEAD"), -// .height = 6, -// .weight = 421, -// .description = gBagonPokedexText, -// .unusedDescription = gBagonPokedexTextUnused, -// .pokemonScale = 448, -// .pokemonOffset = 17, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SHELGON] = -// { -// .categoryName = _("ENDURANCE"), -// .height = 11, -// .weight = 1105, -// .description = gShelgonPokedexText, -// .unusedDescription = gShelgonPokedexTextUnused, -// .pokemonScale = 311, -// .pokemonOffset = 10, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_SALAMENCE] = -// { -// .categoryName = _("DRAGON"), -// .height = 15, -// .weight = 1026, -// .description = gSalamencePokedexText, -// .unusedDescription = gSalamencePokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 2, -// .trainerScale = 307, -// .trainerOffset = 0, -// }, - -// [NATIONAL_DEX_BELDUM] = -// { -// .categoryName = _("IRON BALL"), -// .height = 6, -// .weight = 952, -// .description = gBeldumPokedexText, -// .unusedDescription = gBeldumPokedexTextUnused, -// .pokemonScale = 414, -// .pokemonOffset = -1, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_METANG] = -// { -// .categoryName = _("IRON CLAW"), -// .height = 12, -// .weight = 2025, -// .description = gMetangPokedexText, -// .unusedDescription = gMetangPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 3, -// .trainerScale = 272, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_METAGROSS] = -// { -// .categoryName = _("IRON LEG"), -// .height = 16, -// .weight = 5500, -// .description = gMetagrossPokedexText, -// .unusedDescription = gMetagrossPokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 3, -// .trainerScale = 461, -// .trainerOffset = 4, -// }, - -// [NATIONAL_DEX_REGIROCK] = -// { -// .categoryName = _("ROCK PEAK"), -// .height = 17, -// .weight = 2300, -// .description = gRegirockPokedexText, -// .unusedDescription = gRegirockPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 1, -// .trainerScale = 309, -// .trainerOffset = 1, -// }, - -// [NATIONAL_DEX_REGICE] = -// { -// .categoryName = _("ICEBERG"), -// .height = 18, -// .weight = 1750, -// .description = gRegicePokedexText, -// .unusedDescription = gRegicePokedexTextUnused, -// .pokemonScale = 265, -// .pokemonOffset = 0, -// .trainerScale = 317, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_REGISTEEL] = -// { -// .categoryName = _("IRON"), -// .height = 19, -// .weight = 2050, -// .description = gRegisteelPokedexText, -// .unusedDescription = gRegisteelPokedexTextUnused, -// .pokemonScale = 256, -// .pokemonOffset = 0, -// .trainerScale = 359, -// .trainerOffset = 6, -// }, - -// [NATIONAL_DEX_LATIAS] = -// { -// .categoryName = _("EON"), -// .height = 14, -// .weight = 400, -// .description = gLatiasPokedexText, -// .unusedDescription = gLatiasPokedexTextUnused, -// .pokemonScale = 291, -// .pokemonOffset = 2, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_LATIOS] = -// { -// .categoryName = _("EON"), -// .height = 20, -// .weight = 600, -// .description = gLatiosPokedexText, -// .unusedDescription = gLatiosPokedexTextUnused, -// .pokemonScale = 273, -// .pokemonOffset = 0, -// .trainerScale = 313, -// .trainerOffset = 3, -// }, - -// [NATIONAL_DEX_KYOGRE] = -// { -// .categoryName = _("SEA BASIN"), -// .height = 45, -// .weight = 3520, -// .description = gKyogrePokedexText, -// .unusedDescription = gKyogrePokedexTextUnused, -// .pokemonScale = 272, -// .pokemonOffset = 1, -// .trainerScale = 639, -// .trainerOffset = 13, -// }, - -// [NATIONAL_DEX_GROUDON] = -// { -// .categoryName = _("CONTINENT"), -// .height = 35, -// .weight = 9500, -// .description = gGroudonPokedexText, -// .unusedDescription = gGroudonPokedexTextUnused, -// .pokemonScale = 276, -// .pokemonOffset = 0, -// .trainerScale = 530, -// .trainerOffset = 12, -// }, - -// [NATIONAL_DEX_RAYQUAZA] = -// { -// .categoryName = _("SKY HIGH"), -// .height = 70, -// .weight = 2065, -// .description = gRayquazaPokedexText, -// .unusedDescription = gRayquazaPokedexTextUnused, -// .pokemonScale = 286, -// .pokemonOffset = -1, -// .trainerScale = 483, -// .trainerOffset = 9, -// }, - -// [NATIONAL_DEX_JIRACHI] = -// { -// .categoryName = _("WISH"), -// .height = 3, -// .weight = 11, -// .description = gJirachiPokedexText, -// .unusedDescription = gJirachiPokedexTextUnused, -// .pokemonScale = 608, -// .pokemonOffset = -8, -// .trainerScale = 256, -// .trainerOffset = -2, -// }, - -// [NATIONAL_DEX_DEOXYS] = -// { -// .categoryName = _("DNA"), -// .height = 17, -// .weight = 608, -// .description = gDeoxysPokedexText, -// .unusedDescription = gDeoxysPokedexTextUnused, -// .pokemonScale = 293, -// .pokemonOffset = 0, -// .trainerScale = 337, -// .trainerOffset = 2, -// }, -// }; diff --git a/src/data/pokemon/species_info/gen_7.h b/src/data/pokemon/species_info/gen_7.h index f9496af08..e53c8b3dc 100644 --- a/src/data/pokemon/species_info/gen_7.h +++ b/src/data/pokemon/species_info/gen_7.h @@ -918,7 +918,7 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = ICON(Crabrawler, 2), .footprint = gMonFootprint_Crabrawler, LEARNSETS(Crabrawler), - .evolutions = EVOLUTION({EVO_SPECIFIC_MAP, MAP_SHOAL_CAVE_LOW_TIDE_ICE_ROOM, SPECIES_CRABOMINABLE}, + .evolutions = EVOLUTION({EVO_SPECIFIC_MAP, MAPSEC_SEAFOAM_ISLANDS, SPECIES_CRABOMINABLE}, {EVO_ITEM, ITEM_ICE_STONE, SPECIES_CRABOMINABLE}), }, diff --git a/src/data/pokemon_graphics/back_pic_coordinates.h b/src/data/pokemon_graphics/back_pic_coordinates.h deleted file mode 100644 index 1d71cc2fb..000000000 --- a/src/data/pokemon_graphics/back_pic_coordinates.h +++ /dev/null @@ -1,2204 +0,0 @@ -// const struct MonCoords gMonBackPicCoords[] = -// { -// [SPECIES_NONE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_BULBASAUR] = -// { -// .size = MON_COORDS_SIZE(48, 32), -// .y_offset = 16, -// }, -// [SPECIES_IVYSAUR] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_VENUSAUR] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_CHARMANDER] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_CHARMELEON] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_CHARIZARD] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_SQUIRTLE] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 15, -// }, -// [SPECIES_WARTORTLE] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_BLASTOISE] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_CATERPIE] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_METAPOD] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_BUTTERFREE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_WEEDLE] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_KAKUNA] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 10, -// }, -// [SPECIES_BEEDRILL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_PIDGEY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_PIDGEOTTO] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 12, -// }, -// [SPECIES_PIDGEOT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_RATTATA] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_RATICATE] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_SPEAROW] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_FEAROW] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_EKANS] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_ARBOK] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_PIKACHU] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_RAICHU] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_SANDSHREW] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_SANDSLASH] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_NIDORAN_F] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_NIDORINA] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_NIDOQUEEN] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_NIDORAN_M] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_NIDORINO] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_NIDOKING] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_CLEFAIRY] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_CLEFABLE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_VULPIX] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_NINETALES] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_JIGGLYPUFF] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_WIGGLYTUFF] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_ZUBAT] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_GOLBAT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_ODDISH] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_GLOOM] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_VILEPLUME] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_PARAS] = -// { -// .size = MON_COORDS_SIZE(48, 24), -// .y_offset = 20, -// }, -// [SPECIES_PARASECT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_VENONAT] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_VENOMOTH] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_DIGLETT] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_DUGTRIO] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_MEOWTH] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_PERSIAN] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_PSYDUCK] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_GOLDUCK] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_MANKEY] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_PRIMEAPE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_GROWLITHE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_ARCANINE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_POLIWAG] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 16, -// }, -// [SPECIES_POLIWHIRL] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_POLIWRATH] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_ABRA] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_KADABRA] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_ALAKAZAM] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_MACHOP] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_MACHOKE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_MACHAMP] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 4, -// }, -// [SPECIES_BELLSPROUT] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_WEEPINBELL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_VICTREEBEL] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_TENTACOOL] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_TENTACRUEL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_GEODUDE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_GRAVELER] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 12, -// }, -// [SPECIES_GOLEM] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 16, -// }, -// [SPECIES_PONYTA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_RAPIDASH] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_SLOWPOKE] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_SLOWBRO] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_MAGNEMITE] = -// { -// .size = MON_COORDS_SIZE(32, 24), -// .y_offset = 20, -// }, -// [SPECIES_MAGNETON] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_FARFETCHD] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_DODUO] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_DODRIO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_SEEL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_DEWGONG] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_GRIMER] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_MUK] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_SHELLDER] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_CLOYSTER] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_GASTLY] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_HAUNTER] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_GENGAR] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_ONIX] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_DROWZEE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_HYPNO] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_KRABBY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_KINGLER] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_VOLTORB] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_ELECTRODE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_EXEGGCUTE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_EXEGGUTOR] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_CUBONE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_MAROWAK] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_HITMONLEE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_HITMONCHAN] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_LICKITUNG] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_KOFFING] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_WEEZING] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 12, -// }, -// [SPECIES_RHYHORN] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 12, -// }, -// [SPECIES_RHYDON] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_CHANSEY] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_TANGELA] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_KANGASKHAN] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_HORSEA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_SEADRA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_GOLDEEN] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_SEAKING] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_STARYU] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_STARMIE] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_MR_MIME] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_SCYTHER] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_JYNX] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_ELECTABUZZ] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_MAGMAR] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_PINSIR] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_TAUROS] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_MAGIKARP] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_GYARADOS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_LAPRAS] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_DITTO] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 17, -// }, -// [SPECIES_EEVEE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_VAPOREON] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_JOLTEON] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_FLAREON] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 5, -// }, -// [SPECIES_PORYGON] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_OMANYTE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_OMASTAR] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_KABUTO] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_KABUTOPS] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_AERODACTYL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_SNORLAX] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_ARTICUNO] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_ZAPDOS] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_MOLTRES] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_DRATINI] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_DRAGONAIR] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_DRAGONITE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_MEWTWO] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 1, -// }, -// [SPECIES_MEW] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_CHIKORITA] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_BAYLEEF] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_MEGANIUM] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_CYNDAQUIL] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_QUILAVA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_TYPHLOSION] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_TOTODILE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_CROCONAW] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_FERALIGATR] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_SENTRET] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 5, -// }, -// [SPECIES_FURRET] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_HOOTHOOT] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_NOCTOWL] = -// { -// .size = MON_COORDS_SIZE(48, 64), -// .y_offset = 3, -// }, -// [SPECIES_LEDYBA] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_LEDIAN] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_SPINARAK] = -// { -// .size = MON_COORDS_SIZE(56, 24), -// .y_offset = 21, -// }, -// [SPECIES_ARIADOS] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_CROBAT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_CHINCHOU] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_LANTURN] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_PICHU] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_CLEFFA] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 15, -// }, -// [SPECIES_IGGLYBUFF] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_TOGEPI] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_TOGETIC] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_NATU] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 17, -// }, -// [SPECIES_XATU] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_MAREEP] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_FLAAFFY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_AMPHAROS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_BELLOSSOM] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_MARILL] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 12, -// }, -// [SPECIES_AZUMARILL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_SUDOWOODO] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_POLITOED] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_HOPPIP] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_SKIPLOOM] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_JUMPLUFF] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_AIPOM] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_SUNKERN] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_SUNFLORA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_YANMA] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_WOOPER] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 15, -// }, -// [SPECIES_QUAGSIRE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_ESPEON] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_UMBREON] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_MURKROW] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_SLOWKING] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_MISDREAVUS] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN] = -// { -// .size = MON_COORDS_SIZE(24, 48), -// .y_offset = 8, -// }, -// [SPECIES_WOBBUFFET] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 12, -// }, -// [SPECIES_GIRAFARIG] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_PINECO] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 15, -// }, -// [SPECIES_FORRETRESS] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 16, -// }, -// [SPECIES_DUNSPARCE] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 15, -// }, -// [SPECIES_GLIGAR] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_STEELIX] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SNUBBULL] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_GRANBULL] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_QWILFISH] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_SCIZOR] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_SHUCKLE] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_HERACROSS] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_SNEASEL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_TEDDIURSA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_URSARING] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_SLUGMA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_MAGCARGO] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_SWINUB] = -// { -// .size = MON_COORDS_SIZE(48, 24), -// .y_offset = 21, -// }, -// [SPECIES_PILOSWINE] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_CORSOLA] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_REMORAID] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_OCTILLERY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_DELIBIRD] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_MANTINE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_SKARMORY] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_HOUNDOUR] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_HOUNDOOM] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_KINGDRA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_PHANPY] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 14, -// }, -// [SPECIES_DONPHAN] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_PORYGON2] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_STANTLER] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_SMEARGLE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_TYROGUE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_HITMONTOP] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_SMOOCHUM] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 9, -// }, -// [SPECIES_ELEKID] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_MAGBY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_MILTANK] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_BLISSEY] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_RAIKOU] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_ENTEI] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_SUICUNE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_LARVITAR] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_PUPITAR] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 5, -// }, -// [SPECIES_TYRANITAR] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_LUGIA] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_HO_OH] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_CELEBI] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_OLD_UNOWN_B] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_C] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_D] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_E] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_F] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_G] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_H] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_I] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_J] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_K] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_L] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_M] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_N] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_O] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_P] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_Q] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_R] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_S] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_T] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_U] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_V] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_W] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_X] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_Y] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_OLD_UNOWN_Z] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_TREECKO] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_GROVYLE] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_SCEPTILE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_TORCHIC] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 5, -// }, -// [SPECIES_COMBUSKEN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_BLAZIKEN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_MUDKIP] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_MARSHTOMP] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_SWAMPERT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_POOCHYENA] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_MIGHTYENA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_ZIGZAGOON] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_LINOONE] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 15, -// }, -// [SPECIES_WURMPLE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_SILCOON] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 21, -// }, -// [SPECIES_BEAUTIFLY] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_CASCOON] = -// { -// .size = MON_COORDS_SIZE(56, 24), -// .y_offset = 20, -// }, -// [SPECIES_DUSTOX] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 20, -// }, -// [SPECIES_LOTAD] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 15, -// }, -// [SPECIES_LOMBRE] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_LUDICOLO] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_SEEDOT] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_NUZLEAF] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_SHIFTRY] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_NINCADA] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 20, -// }, -// [SPECIES_NINJASK] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_SHEDINJA] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_TAILLOW] = -// { -// .size = MON_COORDS_SIZE(48, 32), -// .y_offset = 17, -// }, -// [SPECIES_SWELLOW] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_SHROOMISH] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_BRELOOM] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_SPINDA] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_WINGULL] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_PELIPPER] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_SURSKIT] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_MASQUERAIN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_WAILMER] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 21, -// }, -// [SPECIES_WAILORD] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 22, -// }, -// [SPECIES_SKITTY] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_DELCATTY] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_KECLEON] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_BALTOY] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_CLAYDOL] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_NOSEPASS] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 12, -// }, -// [SPECIES_TORKOAL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_SABLEYE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_BARBOACH] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_WHISCASH] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_LUVDISC] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 10, -// }, -// [SPECIES_CORPHISH] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_CRAWDAUNT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_FEEBAS] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_MILOTIC] = -// { -// .size = MON_COORDS_SIZE(48, 64), -// .y_offset = 2, -// }, -// [SPECIES_CARVANHA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_SHARPEDO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_TRAPINCH] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 14, -// }, -// [SPECIES_VIBRAVA] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 17, -// }, -// [SPECIES_FLYGON] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_MAKUHITA] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_HARIYAMA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_ELECTRIKE] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 16, -// }, -// [SPECIES_MANECTRIC] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_NUMEL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_CAMERUPT] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 19, -// }, -// [SPECIES_SPHEAL] = -// { -// .size = MON_COORDS_SIZE(48, 32), -// .y_offset = 18, -// }, -// [SPECIES_SEALEO] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_WALREIN] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_CACNEA] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 15, -// }, -// [SPECIES_CACTURNE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_SNORUNT] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_GLALIE] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 12, -// }, -// [SPECIES_LUNATONE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_SOLROCK] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_AZURILL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_SPOINK] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_GRUMPIG] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_PLUSLE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_MINUN] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_MAWILE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_MEDITITE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_MEDICHAM] = -// { -// .size = MON_COORDS_SIZE(48, 64), -// .y_offset = 3, -// }, -// [SPECIES_SWABLU] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_ALTARIA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_WYNAUT] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_DUSKULL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_DUSCLOPS] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_ROSELIA] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_SLAKOTH] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 15, -// }, -// [SPECIES_VIGOROTH] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_SLAKING] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_GULPIN] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_SWALOT] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_TROPIUS] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_WHISMUR] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_LOUDRED] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_EXPLOUD] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_CLAMPERL] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_HUNTAIL] = -// { -// .size = MON_COORDS_SIZE(48, 64), -// .y_offset = 2, -// }, -// [SPECIES_GOREBYSS] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_ABSOL] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_SHUPPET] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_BANETTE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_SEVIPER] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_ZANGOOSE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_RELICANTH] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_ARON] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 17, -// }, -// [SPECIES_LAIRON] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 17, -// }, -// [SPECIES_AGGRON] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_CASTFORM] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 13, -// }, -// [SPECIES_VOLBEAT] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_ILLUMISE] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_LILEEP] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_CRADILY] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_ANORITH] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 23, -// }, -// [SPECIES_ARMALDO] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_RALTS] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 13, -// }, -// [SPECIES_KIRLIA] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 6, -// }, -// [SPECIES_GARDEVOIR] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_BAGON] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_SHELGON] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 13, -// }, -// [SPECIES_SALAMENCE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_BELDUM] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_METANG] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 16, -// }, -// [SPECIES_METAGROSS] = -// { -// .size = MON_COORDS_SIZE(64, 24), -// .y_offset = 20, -// }, -// [SPECIES_REGIROCK] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_REGICE] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_REGISTEEL] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 14, -// }, -// [SPECIES_KYOGRE] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 19, -// }, -// [SPECIES_GROUDON] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_RAYQUAZA] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_LATIAS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_LATIOS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_JIRACHI] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_DEOXYS] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_CHIMECHO] = -// { -// .size = MON_COORDS_SIZE(32, 56), -// .y_offset = 7, -// }, -// [SPECIES_EGG] = -// { -// .size = MON_COORDS_SIZE(24, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_B] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 9, -// }, -// [SPECIES_UNOWN_C] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_UNOWN_D] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_UNOWN_E] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_F] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_G] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 5, -// }, -// [SPECIES_UNOWN_H] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_UNOWN_I] = -// { -// .size = MON_COORDS_SIZE(24, 56), -// .y_offset = 7, -// }, -// [SPECIES_UNOWN_J] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 9, -// }, -// [SPECIES_UNOWN_K] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 7, -// }, -// [SPECIES_UNOWN_L] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_M] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_UNOWN_N] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_UNOWN_O] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_UNOWN_P] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_Q] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_UNOWN_R] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 12, -// }, -// [SPECIES_UNOWN_S] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 4, -// }, -// [SPECIES_UNOWN_T] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 13, -// }, -// [SPECIES_UNOWN_U] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_UNOWN_V] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_UNOWN_W] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 13, -// }, -// [SPECIES_UNOWN_X] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_UNOWN_Y] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_Z] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 10, -// }, -// [SPECIES_UNOWN_EMARK] = -// { -// .size = MON_COORDS_SIZE(24, 56), -// .y_offset = 6, -// }, -// [SPECIES_UNOWN_QMARK] = -// { -// .size = MON_COORDS_SIZE(32, 56), -// .y_offset = 6, -// }, -// }; - diff --git a/src/data/pokemon_graphics/back_pic_table.h b/src/data/pokemon_graphics/back_pic_table.h deleted file mode 100644 index 01573365b..000000000 --- a/src/data/pokemon_graphics/back_pic_table.h +++ /dev/null @@ -1,443 +0,0 @@ -// const struct CompressedSpriteSheet gMonBackPicTable[] = -// { -// SPECIES_SPRITE(NONE, gMonBackPic_CircledQuestionMark), -// SPECIES_SPRITE(BULBASAUR, gMonBackPic_Bulbasaur), -// SPECIES_SPRITE(IVYSAUR, gMonBackPic_Ivysaur), -// SPECIES_SPRITE(VENUSAUR, gMonBackPic_Venusaur), -// SPECIES_SPRITE(CHARMANDER, gMonBackPic_Charmander), -// SPECIES_SPRITE(CHARMELEON, gMonBackPic_Charmeleon), -// SPECIES_SPRITE(CHARIZARD, gMonBackPic_Charizard), -// SPECIES_SPRITE(SQUIRTLE, gMonBackPic_Squirtle), -// SPECIES_SPRITE(WARTORTLE, gMonBackPic_Wartortle), -// SPECIES_SPRITE(BLASTOISE, gMonBackPic_Blastoise), -// SPECIES_SPRITE(CATERPIE, gMonBackPic_Caterpie), -// SPECIES_SPRITE(METAPOD, gMonBackPic_Metapod), -// SPECIES_SPRITE(BUTTERFREE, gMonBackPic_Butterfree), -// SPECIES_SPRITE(WEEDLE, gMonBackPic_Weedle), -// SPECIES_SPRITE(KAKUNA, gMonBackPic_Kakuna), -// SPECIES_SPRITE(BEEDRILL, gMonBackPic_Beedrill), -// SPECIES_SPRITE(PIDGEY, gMonBackPic_Pidgey), -// SPECIES_SPRITE(PIDGEOTTO, gMonBackPic_Pidgeotto), -// SPECIES_SPRITE(PIDGEOT, gMonBackPic_Pidgeot), -// SPECIES_SPRITE(RATTATA, gMonBackPic_Rattata), -// SPECIES_SPRITE(RATICATE, gMonBackPic_Raticate), -// SPECIES_SPRITE(SPEAROW, gMonBackPic_Spearow), -// SPECIES_SPRITE(FEAROW, gMonBackPic_Fearow), -// SPECIES_SPRITE(EKANS, gMonBackPic_Ekans), -// SPECIES_SPRITE(ARBOK, gMonBackPic_Arbok), -// SPECIES_SPRITE(PIKACHU, gMonBackPic_Pikachu), -// SPECIES_SPRITE(RAICHU, gMonBackPic_Raichu), -// SPECIES_SPRITE(SANDSHREW, gMonBackPic_Sandshrew), -// SPECIES_SPRITE(SANDSLASH, gMonBackPic_Sandslash), -// SPECIES_SPRITE(NIDORAN_F, gMonBackPic_NidoranF), -// SPECIES_SPRITE(NIDORINA, gMonBackPic_Nidorina), -// SPECIES_SPRITE(NIDOQUEEN, gMonBackPic_Nidoqueen), -// SPECIES_SPRITE(NIDORAN_M, gMonBackPic_NidoranM), -// SPECIES_SPRITE(NIDORINO, gMonBackPic_Nidorino), -// SPECIES_SPRITE(NIDOKING, gMonBackPic_Nidoking), -// SPECIES_SPRITE(CLEFAIRY, gMonBackPic_Clefairy), -// SPECIES_SPRITE(CLEFABLE, gMonBackPic_Clefable), -// SPECIES_SPRITE(VULPIX, gMonBackPic_Vulpix), -// SPECIES_SPRITE(NINETALES, gMonBackPic_Ninetales), -// SPECIES_SPRITE(JIGGLYPUFF, gMonBackPic_Jigglypuff), -// SPECIES_SPRITE(WIGGLYTUFF, gMonBackPic_Wigglytuff), -// SPECIES_SPRITE(ZUBAT, gMonBackPic_Zubat), -// SPECIES_SPRITE(GOLBAT, gMonBackPic_Golbat), -// SPECIES_SPRITE(ODDISH, gMonBackPic_Oddish), -// SPECIES_SPRITE(GLOOM, gMonBackPic_Gloom), -// SPECIES_SPRITE(VILEPLUME, gMonBackPic_Vileplume), -// SPECIES_SPRITE(PARAS, gMonBackPic_Paras), -// SPECIES_SPRITE(PARASECT, gMonBackPic_Parasect), -// SPECIES_SPRITE(VENONAT, gMonBackPic_Venonat), -// SPECIES_SPRITE(VENOMOTH, gMonBackPic_Venomoth), -// SPECIES_SPRITE(DIGLETT, gMonBackPic_Diglett), -// SPECIES_SPRITE(DUGTRIO, gMonBackPic_Dugtrio), -// SPECIES_SPRITE(MEOWTH, gMonBackPic_Meowth), -// SPECIES_SPRITE(PERSIAN, gMonBackPic_Persian), -// SPECIES_SPRITE(PSYDUCK, gMonBackPic_Psyduck), -// SPECIES_SPRITE(GOLDUCK, gMonBackPic_Golduck), -// SPECIES_SPRITE(MANKEY, gMonBackPic_Mankey), -// SPECIES_SPRITE(PRIMEAPE, gMonBackPic_Primeape), -// SPECIES_SPRITE(GROWLITHE, gMonBackPic_Growlithe), -// SPECIES_SPRITE(ARCANINE, gMonBackPic_Arcanine), -// SPECIES_SPRITE(POLIWAG, gMonBackPic_Poliwag), -// SPECIES_SPRITE(POLIWHIRL, gMonBackPic_Poliwhirl), -// SPECIES_SPRITE(POLIWRATH, gMonBackPic_Poliwrath), -// SPECIES_SPRITE(ABRA, gMonBackPic_Abra), -// SPECIES_SPRITE(KADABRA, gMonBackPic_Kadabra), -// SPECIES_SPRITE(ALAKAZAM, gMonBackPic_Alakazam), -// SPECIES_SPRITE(MACHOP, gMonBackPic_Machop), -// SPECIES_SPRITE(MACHOKE, gMonBackPic_Machoke), -// SPECIES_SPRITE(MACHAMP, gMonBackPic_Machamp), -// SPECIES_SPRITE(BELLSPROUT, gMonBackPic_Bellsprout), -// SPECIES_SPRITE(WEEPINBELL, gMonBackPic_Weepinbell), -// SPECIES_SPRITE(VICTREEBEL, gMonBackPic_Victreebel), -// SPECIES_SPRITE(TENTACOOL, gMonBackPic_Tentacool), -// SPECIES_SPRITE(TENTACRUEL, gMonBackPic_Tentacruel), -// SPECIES_SPRITE(GEODUDE, gMonBackPic_Geodude), -// SPECIES_SPRITE(GRAVELER, gMonBackPic_Graveler), -// SPECIES_SPRITE(GOLEM, gMonBackPic_Golem), -// SPECIES_SPRITE(PONYTA, gMonBackPic_Ponyta), -// SPECIES_SPRITE(RAPIDASH, gMonBackPic_Rapidash), -// SPECIES_SPRITE(SLOWPOKE, gMonBackPic_Slowpoke), -// SPECIES_SPRITE(SLOWBRO, gMonBackPic_Slowbro), -// SPECIES_SPRITE(MAGNEMITE, gMonBackPic_Magnemite), -// SPECIES_SPRITE(MAGNETON, gMonBackPic_Magneton), -// SPECIES_SPRITE(FARFETCHD, gMonBackPic_Farfetchd), -// SPECIES_SPRITE(DODUO, gMonBackPic_Doduo), -// SPECIES_SPRITE(DODRIO, gMonBackPic_Dodrio), -// SPECIES_SPRITE(SEEL, gMonBackPic_Seel), -// SPECIES_SPRITE(DEWGONG, gMonBackPic_Dewgong), -// SPECIES_SPRITE(GRIMER, gMonBackPic_Grimer), -// SPECIES_SPRITE(MUK, gMonBackPic_Muk), -// SPECIES_SPRITE(SHELLDER, gMonBackPic_Shellder), -// SPECIES_SPRITE(CLOYSTER, gMonBackPic_Cloyster), -// SPECIES_SPRITE(GASTLY, gMonBackPic_Gastly), -// SPECIES_SPRITE(HAUNTER, gMonBackPic_Haunter), -// SPECIES_SPRITE(GENGAR, gMonBackPic_Gengar), -// SPECIES_SPRITE(ONIX, gMonBackPic_Onix), -// SPECIES_SPRITE(DROWZEE, gMonBackPic_Drowzee), -// SPECIES_SPRITE(HYPNO, gMonBackPic_Hypno), -// SPECIES_SPRITE(KRABBY, gMonBackPic_Krabby), -// SPECIES_SPRITE(KINGLER, gMonBackPic_Kingler), -// SPECIES_SPRITE(VOLTORB, gMonBackPic_Voltorb), -// SPECIES_SPRITE(ELECTRODE, gMonBackPic_Electrode), -// SPECIES_SPRITE(EXEGGCUTE, gMonBackPic_Exeggcute), -// SPECIES_SPRITE(EXEGGUTOR, gMonBackPic_Exeggutor), -// SPECIES_SPRITE(CUBONE, gMonBackPic_Cubone), -// SPECIES_SPRITE(MAROWAK, gMonBackPic_Marowak), -// SPECIES_SPRITE(HITMONLEE, gMonBackPic_Hitmonlee), -// SPECIES_SPRITE(HITMONCHAN, gMonBackPic_Hitmonchan), -// SPECIES_SPRITE(LICKITUNG, gMonBackPic_Lickitung), -// SPECIES_SPRITE(KOFFING, gMonBackPic_Koffing), -// SPECIES_SPRITE(WEEZING, gMonBackPic_Weezing), -// SPECIES_SPRITE(RHYHORN, gMonBackPic_Rhyhorn), -// SPECIES_SPRITE(RHYDON, gMonBackPic_Rhydon), -// SPECIES_SPRITE(CHANSEY, gMonBackPic_Chansey), -// SPECIES_SPRITE(TANGELA, gMonBackPic_Tangela), -// SPECIES_SPRITE(KANGASKHAN, gMonBackPic_Kangaskhan), -// SPECIES_SPRITE(HORSEA, gMonBackPic_Horsea), -// SPECIES_SPRITE(SEADRA, gMonBackPic_Seadra), -// SPECIES_SPRITE(GOLDEEN, gMonBackPic_Goldeen), -// SPECIES_SPRITE(SEAKING, gMonBackPic_Seaking), -// SPECIES_SPRITE(STARYU, gMonBackPic_Staryu), -// SPECIES_SPRITE(STARMIE, gMonBackPic_Starmie), -// SPECIES_SPRITE(MR_MIME, gMonBackPic_Mrmime), -// SPECIES_SPRITE(SCYTHER, gMonBackPic_Scyther), -// SPECIES_SPRITE(JYNX, gMonBackPic_Jynx), -// SPECIES_SPRITE(ELECTABUZZ, gMonBackPic_Electabuzz), -// SPECIES_SPRITE(MAGMAR, gMonBackPic_Magmar), -// SPECIES_SPRITE(PINSIR, gMonBackPic_Pinsir), -// SPECIES_SPRITE(TAUROS, gMonBackPic_Tauros), -// SPECIES_SPRITE(MAGIKARP, gMonBackPic_Magikarp), -// SPECIES_SPRITE(GYARADOS, gMonBackPic_Gyarados), -// SPECIES_SPRITE(LAPRAS, gMonBackPic_Lapras), -// SPECIES_SPRITE(DITTO, gMonBackPic_Ditto), -// SPECIES_SPRITE(EEVEE, gMonBackPic_Eevee), -// SPECIES_SPRITE(VAPOREON, gMonBackPic_Vaporeon), -// SPECIES_SPRITE(JOLTEON, gMonBackPic_Jolteon), -// SPECIES_SPRITE(FLAREON, gMonBackPic_Flareon), -// SPECIES_SPRITE(PORYGON, gMonBackPic_Porygon), -// SPECIES_SPRITE(OMANYTE, gMonBackPic_Omanyte), -// SPECIES_SPRITE(OMASTAR, gMonBackPic_Omastar), -// SPECIES_SPRITE(KABUTO, gMonBackPic_Kabuto), -// SPECIES_SPRITE(KABUTOPS, gMonBackPic_Kabutops), -// SPECIES_SPRITE(AERODACTYL, gMonBackPic_Aerodactyl), -// SPECIES_SPRITE(SNORLAX, gMonBackPic_Snorlax), -// SPECIES_SPRITE(ARTICUNO, gMonBackPic_Articuno), -// SPECIES_SPRITE(ZAPDOS, gMonBackPic_Zapdos), -// SPECIES_SPRITE(MOLTRES, gMonBackPic_Moltres), -// SPECIES_SPRITE(DRATINI, gMonBackPic_Dratini), -// SPECIES_SPRITE(DRAGONAIR, gMonBackPic_Dragonair), -// SPECIES_SPRITE(DRAGONITE, gMonBackPic_Dragonite), -// SPECIES_SPRITE(MEWTWO, gMonBackPic_Mewtwo), -// SPECIES_SPRITE(MEW, gMonBackPic_Mew), -// SPECIES_SPRITE(CHIKORITA, gMonBackPic_Chikorita), -// SPECIES_SPRITE(BAYLEEF, gMonBackPic_Bayleef), -// SPECIES_SPRITE(MEGANIUM, gMonBackPic_Meganium), -// SPECIES_SPRITE(CYNDAQUIL, gMonBackPic_Cyndaquil), -// SPECIES_SPRITE(QUILAVA, gMonBackPic_Quilava), -// SPECIES_SPRITE(TYPHLOSION, gMonBackPic_Typhlosion), -// SPECIES_SPRITE(TOTODILE, gMonBackPic_Totodile), -// SPECIES_SPRITE(CROCONAW, gMonBackPic_Croconaw), -// SPECIES_SPRITE(FERALIGATR, gMonBackPic_Feraligatr), -// SPECIES_SPRITE(SENTRET, gMonBackPic_Sentret), -// SPECIES_SPRITE(FURRET, gMonBackPic_Furret), -// SPECIES_SPRITE(HOOTHOOT, gMonBackPic_Hoothoot), -// SPECIES_SPRITE(NOCTOWL, gMonBackPic_Noctowl), -// SPECIES_SPRITE(LEDYBA, gMonBackPic_Ledyba), -// SPECIES_SPRITE(LEDIAN, gMonBackPic_Ledian), -// SPECIES_SPRITE(SPINARAK, gMonBackPic_Spinarak), -// SPECIES_SPRITE(ARIADOS, gMonBackPic_Ariados), -// SPECIES_SPRITE(CROBAT, gMonBackPic_Crobat), -// SPECIES_SPRITE(CHINCHOU, gMonBackPic_Chinchou), -// SPECIES_SPRITE(LANTURN, gMonBackPic_Lanturn), -// SPECIES_SPRITE(PICHU, gMonBackPic_Pichu), -// SPECIES_SPRITE(CLEFFA, gMonBackPic_Cleffa), -// SPECIES_SPRITE(IGGLYBUFF, gMonBackPic_Igglybuff), -// SPECIES_SPRITE(TOGEPI, gMonBackPic_Togepi), -// SPECIES_SPRITE(TOGETIC, gMonBackPic_Togetic), -// SPECIES_SPRITE(NATU, gMonBackPic_Natu), -// SPECIES_SPRITE(XATU, gMonBackPic_Xatu), -// SPECIES_SPRITE(MAREEP, gMonBackPic_Mareep), -// SPECIES_SPRITE(FLAAFFY, gMonBackPic_Flaaffy), -// SPECIES_SPRITE(AMPHAROS, gMonBackPic_Ampharos), -// SPECIES_SPRITE(BELLOSSOM, gMonBackPic_Bellossom), -// SPECIES_SPRITE(MARILL, gMonBackPic_Marill), -// SPECIES_SPRITE(AZUMARILL, gMonBackPic_Azumarill), -// SPECIES_SPRITE(SUDOWOODO, gMonBackPic_Sudowoodo), -// SPECIES_SPRITE(POLITOED, gMonBackPic_Politoed), -// SPECIES_SPRITE(HOPPIP, gMonBackPic_Hoppip), -// SPECIES_SPRITE(SKIPLOOM, gMonBackPic_Skiploom), -// SPECIES_SPRITE(JUMPLUFF, gMonBackPic_Jumpluff), -// SPECIES_SPRITE(AIPOM, gMonBackPic_Aipom), -// SPECIES_SPRITE(SUNKERN, gMonBackPic_Sunkern), -// SPECIES_SPRITE(SUNFLORA, gMonBackPic_Sunflora), -// SPECIES_SPRITE(YANMA, gMonBackPic_Yanma), -// SPECIES_SPRITE(WOOPER, gMonBackPic_Wooper), -// SPECIES_SPRITE(QUAGSIRE, gMonBackPic_Quagsire), -// SPECIES_SPRITE(ESPEON, gMonBackPic_Espeon), -// SPECIES_SPRITE(UMBREON, gMonBackPic_Umbreon), -// SPECIES_SPRITE(MURKROW, gMonBackPic_Murkrow), -// SPECIES_SPRITE(SLOWKING, gMonBackPic_Slowking), -// SPECIES_SPRITE(MISDREAVUS, gMonBackPic_Misdreavus), -// SPECIES_SPRITE(UNOWN, gMonBackPic_UnownA), -// SPECIES_SPRITE(WOBBUFFET, gMonBackPic_Wobbuffet), -// SPECIES_SPRITE(GIRAFARIG, gMonBackPic_Girafarig), -// SPECIES_SPRITE(PINECO, gMonBackPic_Pineco), -// SPECIES_SPRITE(FORRETRESS, gMonBackPic_Forretress), -// SPECIES_SPRITE(DUNSPARCE, gMonBackPic_Dunsparce), -// SPECIES_SPRITE(GLIGAR, gMonBackPic_Gligar), -// SPECIES_SPRITE(STEELIX, gMonBackPic_Steelix), -// SPECIES_SPRITE(SNUBBULL, gMonBackPic_Snubbull), -// SPECIES_SPRITE(GRANBULL, gMonBackPic_Granbull), -// SPECIES_SPRITE(QWILFISH, gMonBackPic_Qwilfish), -// SPECIES_SPRITE(SCIZOR, gMonBackPic_Scizor), -// SPECIES_SPRITE(SHUCKLE, gMonBackPic_Shuckle), -// SPECIES_SPRITE(HERACROSS, gMonBackPic_Heracross), -// SPECIES_SPRITE(SNEASEL, gMonBackPic_Sneasel), -// SPECIES_SPRITE(TEDDIURSA, gMonBackPic_Teddiursa), -// SPECIES_SPRITE(URSARING, gMonBackPic_Ursaring), -// SPECIES_SPRITE(SLUGMA, gMonBackPic_Slugma), -// SPECIES_SPRITE(MAGCARGO, gMonBackPic_Magcargo), -// SPECIES_SPRITE(SWINUB, gMonBackPic_Swinub), -// SPECIES_SPRITE(PILOSWINE, gMonBackPic_Piloswine), -// SPECIES_SPRITE(CORSOLA, gMonBackPic_Corsola), -// SPECIES_SPRITE(REMORAID, gMonBackPic_Remoraid), -// SPECIES_SPRITE(OCTILLERY, gMonBackPic_Octillery), -// SPECIES_SPRITE(DELIBIRD, gMonBackPic_Delibird), -// SPECIES_SPRITE(MANTINE, gMonBackPic_Mantine), -// SPECIES_SPRITE(SKARMORY, gMonBackPic_Skarmory), -// SPECIES_SPRITE(HOUNDOUR, gMonBackPic_Houndour), -// SPECIES_SPRITE(HOUNDOOM, gMonBackPic_Houndoom), -// SPECIES_SPRITE(KINGDRA, gMonBackPic_Kingdra), -// SPECIES_SPRITE(PHANPY, gMonBackPic_Phanpy), -// SPECIES_SPRITE(DONPHAN, gMonBackPic_Donphan), -// SPECIES_SPRITE(PORYGON2, gMonBackPic_Porygon2), -// SPECIES_SPRITE(STANTLER, gMonBackPic_Stantler), -// SPECIES_SPRITE(SMEARGLE, gMonBackPic_Smeargle), -// SPECIES_SPRITE(TYROGUE, gMonBackPic_Tyrogue), -// SPECIES_SPRITE(HITMONTOP, gMonBackPic_Hitmontop), -// SPECIES_SPRITE(SMOOCHUM, gMonBackPic_Smoochum), -// SPECIES_SPRITE(ELEKID, gMonBackPic_Elekid), -// SPECIES_SPRITE(MAGBY, gMonBackPic_Magby), -// SPECIES_SPRITE(MILTANK, gMonBackPic_Miltank), -// SPECIES_SPRITE(BLISSEY, gMonBackPic_Blissey), -// SPECIES_SPRITE(RAIKOU, gMonBackPic_Raikou), -// SPECIES_SPRITE(ENTEI, gMonBackPic_Entei), -// SPECIES_SPRITE(SUICUNE, gMonBackPic_Suicune), -// SPECIES_SPRITE(LARVITAR, gMonBackPic_Larvitar), -// SPECIES_SPRITE(PUPITAR, gMonBackPic_Pupitar), -// SPECIES_SPRITE(TYRANITAR, gMonBackPic_Tyranitar), -// SPECIES_SPRITE(LUGIA, gMonBackPic_Lugia), -// SPECIES_SPRITE(HO_OH, gMonBackPic_HoOh), -// SPECIES_SPRITE(CELEBI, gMonBackPic_Celebi), -// SPECIES_SPRITE(OLD_UNOWN_B, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_C, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_D, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_E, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_F, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_G, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_H, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_I, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_J, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_K, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_L, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_M, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_N, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_O, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_P, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_Q, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_R, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_S, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_T, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_U, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_V, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_W, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_X, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_Y, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_Z, gMonBackPic_DoubleQuestionMark), -// SPECIES_SPRITE(TREECKO, gMonBackPic_Treecko), -// SPECIES_SPRITE(GROVYLE, gMonBackPic_Grovyle), -// SPECIES_SPRITE(SCEPTILE, gMonBackPic_Sceptile), -// SPECIES_SPRITE(TORCHIC, gMonBackPic_Torchic), -// SPECIES_SPRITE(COMBUSKEN, gMonBackPic_Combusken), -// SPECIES_SPRITE(BLAZIKEN, gMonBackPic_Blaziken), -// SPECIES_SPRITE(MUDKIP, gMonBackPic_Mudkip), -// SPECIES_SPRITE(MARSHTOMP, gMonBackPic_Marshtomp), -// SPECIES_SPRITE(SWAMPERT, gMonBackPic_Swampert), -// SPECIES_SPRITE(POOCHYENA, gMonBackPic_Poochyena), -// SPECIES_SPRITE(MIGHTYENA, gMonBackPic_Mightyena), -// SPECIES_SPRITE(ZIGZAGOON, gMonBackPic_Zigzagoon), -// SPECIES_SPRITE(LINOONE, gMonBackPic_Linoone), -// SPECIES_SPRITE(WURMPLE, gMonBackPic_Wurmple), -// SPECIES_SPRITE(SILCOON, gMonBackPic_Silcoon), -// SPECIES_SPRITE(BEAUTIFLY, gMonBackPic_Beautifly), -// SPECIES_SPRITE(CASCOON, gMonBackPic_Cascoon), -// SPECIES_SPRITE(DUSTOX, gMonBackPic_Dustox), -// SPECIES_SPRITE(LOTAD, gMonBackPic_Lotad), -// SPECIES_SPRITE(LOMBRE, gMonBackPic_Lombre), -// SPECIES_SPRITE(LUDICOLO, gMonBackPic_Ludicolo), -// SPECIES_SPRITE(SEEDOT, gMonBackPic_Seedot), -// SPECIES_SPRITE(NUZLEAF, gMonBackPic_Nuzleaf), -// SPECIES_SPRITE(SHIFTRY, gMonBackPic_Shiftry), -// SPECIES_SPRITE(NINCADA, gMonBackPic_Nincada), -// SPECIES_SPRITE(NINJASK, gMonBackPic_Ninjask), -// SPECIES_SPRITE(SHEDINJA, gMonBackPic_Shedinja), -// SPECIES_SPRITE(TAILLOW, gMonBackPic_Taillow), -// SPECIES_SPRITE(SWELLOW, gMonBackPic_Swellow), -// SPECIES_SPRITE(SHROOMISH, gMonBackPic_Shroomish), -// SPECIES_SPRITE(BRELOOM, gMonBackPic_Breloom), -// SPECIES_SPRITE(SPINDA, gMonBackPic_Spinda), -// SPECIES_SPRITE(WINGULL, gMonBackPic_Wingull), -// SPECIES_SPRITE(PELIPPER, gMonBackPic_Pelipper), -// SPECIES_SPRITE(SURSKIT, gMonBackPic_Surskit), -// SPECIES_SPRITE(MASQUERAIN, gMonBackPic_Masquerain), -// SPECIES_SPRITE(WAILMER, gMonBackPic_Wailmer), -// SPECIES_SPRITE(WAILORD, gMonBackPic_Wailord), -// SPECIES_SPRITE(SKITTY, gMonBackPic_Skitty), -// SPECIES_SPRITE(DELCATTY, gMonBackPic_Delcatty), -// SPECIES_SPRITE(KECLEON, gMonBackPic_Kecleon), -// SPECIES_SPRITE(BALTOY, gMonBackPic_Baltoy), -// SPECIES_SPRITE(CLAYDOL, gMonBackPic_Claydol), -// SPECIES_SPRITE(NOSEPASS, gMonBackPic_Nosepass), -// SPECIES_SPRITE(TORKOAL, gMonBackPic_Torkoal), -// SPECIES_SPRITE(SABLEYE, gMonBackPic_Sableye), -// SPECIES_SPRITE(BARBOACH, gMonBackPic_Barboach), -// SPECIES_SPRITE(WHISCASH, gMonBackPic_Whiscash), -// SPECIES_SPRITE(LUVDISC, gMonBackPic_Luvdisc), -// SPECIES_SPRITE(CORPHISH, gMonBackPic_Corphish), -// SPECIES_SPRITE(CRAWDAUNT, gMonBackPic_Crawdaunt), -// SPECIES_SPRITE(FEEBAS, gMonBackPic_Feebas), -// SPECIES_SPRITE(MILOTIC, gMonBackPic_Milotic), -// SPECIES_SPRITE(CARVANHA, gMonBackPic_Carvanha), -// SPECIES_SPRITE(SHARPEDO, gMonBackPic_Sharpedo), -// SPECIES_SPRITE(TRAPINCH, gMonBackPic_Trapinch), -// SPECIES_SPRITE(VIBRAVA, gMonBackPic_Vibrava), -// SPECIES_SPRITE(FLYGON, gMonBackPic_Flygon), -// SPECIES_SPRITE(MAKUHITA, gMonBackPic_Makuhita), -// SPECIES_SPRITE(HARIYAMA, gMonBackPic_Hariyama), -// SPECIES_SPRITE(ELECTRIKE, gMonBackPic_Electrike), -// SPECIES_SPRITE(MANECTRIC, gMonBackPic_Manectric), -// SPECIES_SPRITE(NUMEL, gMonBackPic_Numel), -// SPECIES_SPRITE(CAMERUPT, gMonBackPic_Camerupt), -// SPECIES_SPRITE(SPHEAL, gMonBackPic_Spheal), -// SPECIES_SPRITE(SEALEO, gMonBackPic_Sealeo), -// SPECIES_SPRITE(WALREIN, gMonBackPic_Walrein), -// SPECIES_SPRITE(CACNEA, gMonBackPic_Cacnea), -// SPECIES_SPRITE(CACTURNE, gMonBackPic_Cacturne), -// SPECIES_SPRITE(SNORUNT, gMonBackPic_Snorunt), -// SPECIES_SPRITE(GLALIE, gMonBackPic_Glalie), -// SPECIES_SPRITE(LUNATONE, gMonBackPic_Lunatone), -// SPECIES_SPRITE(SOLROCK, gMonBackPic_Solrock), -// SPECIES_SPRITE(AZURILL, gMonBackPic_Azurill), -// SPECIES_SPRITE(SPOINK, gMonBackPic_Spoink), -// SPECIES_SPRITE(GRUMPIG, gMonBackPic_Grumpig), -// SPECIES_SPRITE(PLUSLE, gMonBackPic_Plusle), -// SPECIES_SPRITE(MINUN, gMonBackPic_Minun), -// SPECIES_SPRITE(MAWILE, gMonBackPic_Mawile), -// SPECIES_SPRITE(MEDITITE, gMonBackPic_Meditite), -// SPECIES_SPRITE(MEDICHAM, gMonBackPic_Medicham), -// SPECIES_SPRITE(SWABLU, gMonBackPic_Swablu), -// SPECIES_SPRITE(ALTARIA, gMonBackPic_Altaria), -// SPECIES_SPRITE(WYNAUT, gMonBackPic_Wynaut), -// SPECIES_SPRITE(DUSKULL, gMonBackPic_Duskull), -// SPECIES_SPRITE(DUSCLOPS, gMonBackPic_Dusclops), -// SPECIES_SPRITE(ROSELIA, gMonBackPic_Roselia), -// SPECIES_SPRITE(SLAKOTH, gMonBackPic_Slakoth), -// SPECIES_SPRITE(VIGOROTH, gMonBackPic_Vigoroth), -// SPECIES_SPRITE(SLAKING, gMonBackPic_Slaking), -// SPECIES_SPRITE(GULPIN, gMonBackPic_Gulpin), -// SPECIES_SPRITE(SWALOT, gMonBackPic_Swalot), -// SPECIES_SPRITE(TROPIUS, gMonBackPic_Tropius), -// SPECIES_SPRITE(WHISMUR, gMonBackPic_Whismur), -// SPECIES_SPRITE(LOUDRED, gMonBackPic_Loudred), -// SPECIES_SPRITE(EXPLOUD, gMonBackPic_Exploud), -// SPECIES_SPRITE(CLAMPERL, gMonBackPic_Clamperl), -// SPECIES_SPRITE(HUNTAIL, gMonBackPic_Huntail), -// SPECIES_SPRITE(GOREBYSS, gMonBackPic_Gorebyss), -// SPECIES_SPRITE(ABSOL, gMonBackPic_Absol), -// SPECIES_SPRITE(SHUPPET, gMonBackPic_Shuppet), -// SPECIES_SPRITE(BANETTE, gMonBackPic_Banette), -// SPECIES_SPRITE(SEVIPER, gMonBackPic_Seviper), -// SPECIES_SPRITE(ZANGOOSE, gMonBackPic_Zangoose), -// SPECIES_SPRITE(RELICANTH, gMonBackPic_Relicanth), -// SPECIES_SPRITE(ARON, gMonBackPic_Aron), -// SPECIES_SPRITE(LAIRON, gMonBackPic_Lairon), -// SPECIES_SPRITE(AGGRON, gMonBackPic_Aggron), -// SPECIES_SPRITE(CASTFORM, gMonBackPic_Castform), -// SPECIES_SPRITE(VOLBEAT, gMonBackPic_Volbeat), -// SPECIES_SPRITE(ILLUMISE, gMonBackPic_Illumise), -// SPECIES_SPRITE(LILEEP, gMonBackPic_Lileep), -// SPECIES_SPRITE(CRADILY, gMonBackPic_Cradily), -// SPECIES_SPRITE(ANORITH, gMonBackPic_Anorith), -// SPECIES_SPRITE(ARMALDO, gMonBackPic_Armaldo), -// SPECIES_SPRITE(RALTS, gMonBackPic_Ralts), -// SPECIES_SPRITE(KIRLIA, gMonBackPic_Kirlia), -// SPECIES_SPRITE(GARDEVOIR, gMonBackPic_Gardevoir), -// SPECIES_SPRITE(BAGON, gMonBackPic_Bagon), -// SPECIES_SPRITE(SHELGON, gMonBackPic_Shelgon), -// SPECIES_SPRITE(SALAMENCE, gMonBackPic_Salamence), -// SPECIES_SPRITE(BELDUM, gMonBackPic_Beldum), -// SPECIES_SPRITE(METANG, gMonBackPic_Metang), -// SPECIES_SPRITE(METAGROSS, gMonBackPic_Metagross), -// SPECIES_SPRITE(REGIROCK, gMonBackPic_Regirock), -// SPECIES_SPRITE(REGICE, gMonBackPic_Regice), -// SPECIES_SPRITE(REGISTEEL, gMonBackPic_Registeel), -// SPECIES_SPRITE(KYOGRE, gMonBackPic_Kyogre), -// SPECIES_SPRITE(GROUDON, gMonBackPic_Groudon), -// SPECIES_SPRITE(RAYQUAZA, gMonBackPic_Rayquaza), -// SPECIES_SPRITE(LATIAS, gMonBackPic_Latias), -// SPECIES_SPRITE(LATIOS, gMonBackPic_Latios), -// SPECIES_SPRITE(JIRACHI, gMonBackPic_Jirachi), -// SPECIES_SPRITE(DEOXYS, gMonBackPic_Deoxys), -// SPECIES_SPRITE(CHIMECHO, gMonBackPic_Chimecho), -// SPECIES_SPRITE(EGG, gMonFrontPic_Egg), -// SPECIES_SPRITE(UNOWN_B, gMonBackPic_UnownB), -// SPECIES_SPRITE(UNOWN_C, gMonBackPic_UnownC), -// SPECIES_SPRITE(UNOWN_D, gMonBackPic_UnownD), -// SPECIES_SPRITE(UNOWN_E, gMonBackPic_UnownE), -// SPECIES_SPRITE(UNOWN_F, gMonBackPic_UnownF), -// SPECIES_SPRITE(UNOWN_G, gMonBackPic_UnownG), -// SPECIES_SPRITE(UNOWN_H, gMonBackPic_UnownH), -// SPECIES_SPRITE(UNOWN_I, gMonBackPic_UnownI), -// SPECIES_SPRITE(UNOWN_J, gMonBackPic_UnownJ), -// SPECIES_SPRITE(UNOWN_K, gMonBackPic_UnownK), -// SPECIES_SPRITE(UNOWN_L, gMonBackPic_UnownL), -// SPECIES_SPRITE(UNOWN_M, gMonBackPic_UnownM), -// SPECIES_SPRITE(UNOWN_N, gMonBackPic_UnownN), -// SPECIES_SPRITE(UNOWN_O, gMonBackPic_UnownO), -// SPECIES_SPRITE(UNOWN_P, gMonBackPic_UnownP), -// SPECIES_SPRITE(UNOWN_Q, gMonBackPic_UnownQ), -// SPECIES_SPRITE(UNOWN_R, gMonBackPic_UnownR), -// SPECIES_SPRITE(UNOWN_S, gMonBackPic_UnownS), -// SPECIES_SPRITE(UNOWN_T, gMonBackPic_UnownT), -// SPECIES_SPRITE(UNOWN_U, gMonBackPic_UnownU), -// SPECIES_SPRITE(UNOWN_V, gMonBackPic_UnownV), -// SPECIES_SPRITE(UNOWN_W, gMonBackPic_UnownW), -// SPECIES_SPRITE(UNOWN_X, gMonBackPic_UnownX), -// SPECIES_SPRITE(UNOWN_Y, gMonBackPic_UnownY), -// SPECIES_SPRITE(UNOWN_Z, gMonBackPic_UnownZ), -// SPECIES_SPRITE(UNOWN_EMARK, gMonBackPic_UnownExclamationMark), -// SPECIES_SPRITE(UNOWN_QMARK, gMonBackPic_UnownQuestionMark), -// }; diff --git a/src/data/pokemon_graphics/enemy_mon_elevation.h b/src/data/pokemon_graphics/enemy_mon_elevation.h deleted file mode 100644 index dccd063da..000000000 --- a/src/data/pokemon_graphics/enemy_mon_elevation.h +++ /dev/null @@ -1,65 +0,0 @@ -// This determines how much higher above the usual position the enemy Pokémon -// is during battle. Species that float or fly have nonzero values. -const u8 gEnemyMonElevation[NUM_SPECIES] = -{ - [SPECIES_BUTTERFREE] = 8, - [SPECIES_BEEDRILL] = 8, - [SPECIES_PIDGEOT] = 4, - [SPECIES_FEAROW] = 6, - [SPECIES_ZUBAT] = 8, - [SPECIES_GOLBAT] = 8, - [SPECIES_VENOMOTH] = 8, - [SPECIES_GEODUDE] = 16, - [SPECIES_MAGNEMITE] = 16, - [SPECIES_MAGNETON] = 8, - [SPECIES_GASTLY] = 4, - [SPECIES_HAUNTER] = 4, - [SPECIES_VOLTORB] = 10, - [SPECIES_ELECTRODE] = 12, - [SPECIES_KOFFING] = 8, - [SPECIES_WEEZING] = 6, - [SPECIES_AERODACTYL] = 7, - [SPECIES_ARTICUNO] = 6, - [SPECIES_ZAPDOS] = 8, - [SPECIES_MOLTRES] = 5, - [SPECIES_DRAGONITE] = 6, - [SPECIES_MEW] = 8, - [SPECIES_LEDIAN] = 8, - [SPECIES_CROBAT] = 6, - [SPECIES_HOPPIP] = 11, - [SPECIES_SKIPLOOM] = 12, - [SPECIES_JUMPLUFF] = 9, - [SPECIES_YANMA] = 8, - [SPECIES_MISDREAVUS] = 8, - [SPECIES_UNOWN] = 8, - [SPECIES_GLIGAR] = 6, - [SPECIES_LUGIA] = 6, - [SPECIES_HO_OH] = 6, - [SPECIES_CELEBI] = 15, - [SPECIES_BEAUTIFLY] = 8, - [SPECIES_DUSTOX] = 10, - [SPECIES_NINJASK] = 10, - [SPECIES_SHEDINJA] = 8, - [SPECIES_WINGULL] = 16, - [SPECIES_PELIPPER] = 8, - [SPECIES_MASQUERAIN] = 10, - [SPECIES_BALTOY] = 4, - [SPECIES_CLAYDOL] = 10, - [SPECIES_FLYGON] = 7, - [SPECIES_GLALIE] = 12, - [SPECIES_LUNATONE] = 13, - [SPECIES_SOLROCK] = 4, - [SPECIES_SWABLU] = 12, - [SPECIES_ALTARIA] = 8, - [SPECIES_DUSKULL] = 9, - [SPECIES_SHUPPET] = 12, - [SPECIES_BANETTE] = 8, - [SPECIES_CASTFORM] = 16, - [SPECIES_BELDUM] = 8, - [SPECIES_RAYQUAZA] = 6, - [SPECIES_LATIAS] = 6, - [SPECIES_LATIOS] = 6, - [SPECIES_JIRACHI] = 12, - [SPECIES_DEOXYS] = 8, - [SPECIES_CHIMECHO] = 12, -}; diff --git a/src/data/pokemon_graphics/footprint_table.h b/src/data/pokemon_graphics/footprint_table.h deleted file mode 100644 index 5ccf7329b..000000000 --- a/src/data/pokemon_graphics/footprint_table.h +++ /dev/null @@ -1,416 +0,0 @@ -// const u8 *const gMonFootprintTable[] = -// { -// [SPECIES_NONE] = gMonFootprint_Bulbasaur, -// [SPECIES_BULBASAUR] = gMonFootprint_Bulbasaur, -// [SPECIES_IVYSAUR] = gMonFootprint_Ivysaur, -// [SPECIES_VENUSAUR] = gMonFootprint_Venusaur, -// [SPECIES_CHARMANDER] = gMonFootprint_Charmander, -// [SPECIES_CHARMELEON] = gMonFootprint_Charmeleon, -// [SPECIES_CHARIZARD] = gMonFootprint_Charizard, -// [SPECIES_SQUIRTLE] = gMonFootprint_Squirtle, -// [SPECIES_WARTORTLE] = gMonFootprint_Wartortle, -// [SPECIES_BLASTOISE] = gMonFootprint_Blastoise, -// [SPECIES_CATERPIE] = gMonFootprint_Caterpie, -// [SPECIES_METAPOD] = gMonFootprint_Metapod, -// [SPECIES_BUTTERFREE] = gMonFootprint_Butterfree, -// [SPECIES_WEEDLE] = gMonFootprint_Weedle, -// [SPECIES_KAKUNA] = gMonFootprint_Kakuna, -// [SPECIES_BEEDRILL] = gMonFootprint_Beedrill, -// [SPECIES_PIDGEY] = gMonFootprint_Pidgey, -// [SPECIES_PIDGEOTTO] = gMonFootprint_Pidgeotto, -// [SPECIES_PIDGEOT] = gMonFootprint_Pidgeot, -// [SPECIES_RATTATA] = gMonFootprint_Rattata, -// [SPECIES_RATICATE] = gMonFootprint_Raticate, -// [SPECIES_SPEAROW] = gMonFootprint_Spearow, -// [SPECIES_FEAROW] = gMonFootprint_Fearow, -// [SPECIES_EKANS] = gMonFootprint_Ekans, -// [SPECIES_ARBOK] = gMonFootprint_Arbok, -// [SPECIES_PIKACHU] = gMonFootprint_Pikachu, -// [SPECIES_RAICHU] = gMonFootprint_Raichu, -// [SPECIES_SANDSHREW] = gMonFootprint_Sandshrew, -// [SPECIES_SANDSLASH] = gMonFootprint_Sandslash, -// [SPECIES_NIDORAN_F] = gMonFootprint_NidoranF, -// [SPECIES_NIDORINA] = gMonFootprint_Nidorina, -// [SPECIES_NIDOQUEEN] = gMonFootprint_Nidoqueen, -// [SPECIES_NIDORAN_M] = gMonFootprint_NidoranM, -// [SPECIES_NIDORINO] = gMonFootprint_Nidorino, -// [SPECIES_NIDOKING] = gMonFootprint_Nidoking, -// [SPECIES_CLEFAIRY] = gMonFootprint_Clefairy, -// [SPECIES_CLEFABLE] = gMonFootprint_Clefable, -// [SPECIES_VULPIX] = gMonFootprint_Vulpix, -// [SPECIES_NINETALES] = gMonFootprint_Ninetales, -// [SPECIES_JIGGLYPUFF] = gMonFootprint_Jigglypuff, -// [SPECIES_WIGGLYTUFF] = gMonFootprint_Wigglytuff, -// [SPECIES_ZUBAT] = gMonFootprint_Zubat, -// [SPECIES_GOLBAT] = gMonFootprint_Golbat, -// [SPECIES_ODDISH] = gMonFootprint_Oddish, -// [SPECIES_GLOOM] = gMonFootprint_Gloom, -// [SPECIES_VILEPLUME] = gMonFootprint_Vileplume, -// [SPECIES_PARAS] = gMonFootprint_Paras, -// [SPECIES_PARASECT] = gMonFootprint_Parasect, -// [SPECIES_VENONAT] = gMonFootprint_Venonat, -// [SPECIES_VENOMOTH] = gMonFootprint_Venomoth, -// [SPECIES_DIGLETT] = gMonFootprint_Diglett, -// [SPECIES_DUGTRIO] = gMonFootprint_Dugtrio, -// [SPECIES_MEOWTH] = gMonFootprint_Meowth, -// [SPECIES_PERSIAN] = gMonFootprint_Persian, -// [SPECIES_PSYDUCK] = gMonFootprint_Psyduck, -// [SPECIES_GOLDUCK] = gMonFootprint_Golduck, -// [SPECIES_MANKEY] = gMonFootprint_Mankey, -// [SPECIES_PRIMEAPE] = gMonFootprint_Primeape, -// [SPECIES_GROWLITHE] = gMonFootprint_Growlithe, -// [SPECIES_ARCANINE] = gMonFootprint_Arcanine, -// [SPECIES_POLIWAG] = gMonFootprint_Poliwag, -// [SPECIES_POLIWHIRL] = gMonFootprint_Poliwhirl, -// [SPECIES_POLIWRATH] = gMonFootprint_Poliwrath, -// [SPECIES_ABRA] = gMonFootprint_Abra, -// [SPECIES_KADABRA] = gMonFootprint_Kadabra, -// [SPECIES_ALAKAZAM] = gMonFootprint_Alakazam, -// [SPECIES_MACHOP] = gMonFootprint_Machop, -// [SPECIES_MACHOKE] = gMonFootprint_Machoke, -// [SPECIES_MACHAMP] = gMonFootprint_Machamp, -// [SPECIES_BELLSPROUT] = gMonFootprint_Bellsprout, -// [SPECIES_WEEPINBELL] = gMonFootprint_Weepinbell, -// [SPECIES_VICTREEBEL] = gMonFootprint_Victreebel, -// [SPECIES_TENTACOOL] = gMonFootprint_Tentacool, -// [SPECIES_TENTACRUEL] = gMonFootprint_Tentacruel, -// [SPECIES_GEODUDE] = gMonFootprint_Geodude, -// [SPECIES_GRAVELER] = gMonFootprint_Graveler, -// [SPECIES_GOLEM] = gMonFootprint_Golem, -// [SPECIES_PONYTA] = gMonFootprint_Ponyta, -// [SPECIES_RAPIDASH] = gMonFootprint_Rapidash, -// [SPECIES_SLOWPOKE] = gMonFootprint_Slowpoke, -// [SPECIES_SLOWBRO] = gMonFootprint_Slowbro, -// [SPECIES_MAGNEMITE] = gMonFootprint_Magnemite, -// [SPECIES_MAGNETON] = gMonFootprint_Magneton, -// [SPECIES_FARFETCHD] = gMonFootprint_Farfetchd, -// [SPECIES_DODUO] = gMonFootprint_Doduo, -// [SPECIES_DODRIO] = gMonFootprint_Dodrio, -// [SPECIES_SEEL] = gMonFootprint_Seel, -// [SPECIES_DEWGONG] = gMonFootprint_Dewgong, -// [SPECIES_GRIMER] = gMonFootprint_Grimer, -// [SPECIES_MUK] = gMonFootprint_Muk, -// [SPECIES_SHELLDER] = gMonFootprint_Shellder, -// [SPECIES_CLOYSTER] = gMonFootprint_Cloyster, -// [SPECIES_GASTLY] = gMonFootprint_Gastly, -// [SPECIES_HAUNTER] = gMonFootprint_Haunter, -// [SPECIES_GENGAR] = gMonFootprint_Gengar, -// [SPECIES_ONIX] = gMonFootprint_Onix, -// [SPECIES_DROWZEE] = gMonFootprint_Drowzee, -// [SPECIES_HYPNO] = gMonFootprint_Hypno, -// [SPECIES_KRABBY] = gMonFootprint_Krabby, -// [SPECIES_KINGLER] = gMonFootprint_Kingler, -// [SPECIES_VOLTORB] = gMonFootprint_Voltorb, -// [SPECIES_ELECTRODE] = gMonFootprint_Electrode, -// [SPECIES_EXEGGCUTE] = gMonFootprint_Exeggcute, -// [SPECIES_EXEGGUTOR] = gMonFootprint_Exeggutor, -// [SPECIES_CUBONE] = gMonFootprint_Cubone, -// [SPECIES_MAROWAK] = gMonFootprint_Marowak, -// [SPECIES_HITMONLEE] = gMonFootprint_Hitmonlee, -// [SPECIES_HITMONCHAN] = gMonFootprint_Hitmonchan, -// [SPECIES_LICKITUNG] = gMonFootprint_Lickitung, -// [SPECIES_KOFFING] = gMonFootprint_Koffing, -// [SPECIES_WEEZING] = gMonFootprint_Weezing, -// [SPECIES_RHYHORN] = gMonFootprint_Rhyhorn, -// [SPECIES_RHYDON] = gMonFootprint_Rhydon, -// [SPECIES_CHANSEY] = gMonFootprint_Chansey, -// [SPECIES_TANGELA] = gMonFootprint_Tangela, -// [SPECIES_KANGASKHAN] = gMonFootprint_Kangaskhan, -// [SPECIES_HORSEA] = gMonFootprint_Horsea, -// [SPECIES_SEADRA] = gMonFootprint_Seadra, -// [SPECIES_GOLDEEN] = gMonFootprint_Goldeen, -// [SPECIES_SEAKING] = gMonFootprint_Seaking, -// [SPECIES_STARYU] = gMonFootprint_Staryu, -// [SPECIES_STARMIE] = gMonFootprint_Starmie, -// [SPECIES_MR_MIME] = gMonFootprint_Mrmime, -// [SPECIES_SCYTHER] = gMonFootprint_Scyther, -// [SPECIES_JYNX] = gMonFootprint_Jynx, -// [SPECIES_ELECTABUZZ] = gMonFootprint_Electabuzz, -// [SPECIES_MAGMAR] = gMonFootprint_Magmar, -// [SPECIES_PINSIR] = gMonFootprint_Pinsir, -// [SPECIES_TAUROS] = gMonFootprint_Tauros, -// [SPECIES_MAGIKARP] = gMonFootprint_Magikarp, -// [SPECIES_GYARADOS] = gMonFootprint_Gyarados, -// [SPECIES_LAPRAS] = gMonFootprint_Lapras, -// [SPECIES_DITTO] = gMonFootprint_Ditto, -// [SPECIES_EEVEE] = gMonFootprint_Eevee, -// [SPECIES_VAPOREON] = gMonFootprint_Vaporeon, -// [SPECIES_JOLTEON] = gMonFootprint_Jolteon, -// [SPECIES_FLAREON] = gMonFootprint_Flareon, -// [SPECIES_PORYGON] = gMonFootprint_Porygon, -// [SPECIES_OMANYTE] = gMonFootprint_Omanyte, -// [SPECIES_OMASTAR] = gMonFootprint_Omastar, -// [SPECIES_KABUTO] = gMonFootprint_Kabuto, -// [SPECIES_KABUTOPS] = gMonFootprint_Kabutops, -// [SPECIES_AERODACTYL] = gMonFootprint_Aerodactyl, -// [SPECIES_SNORLAX] = gMonFootprint_Snorlax, -// [SPECIES_ARTICUNO] = gMonFootprint_Articuno, -// [SPECIES_ZAPDOS] = gMonFootprint_Zapdos, -// [SPECIES_MOLTRES] = gMonFootprint_Moltres, -// [SPECIES_DRATINI] = gMonFootprint_Dratini, -// [SPECIES_DRAGONAIR] = gMonFootprint_Dragonair, -// [SPECIES_DRAGONITE] = gMonFootprint_Dragonite, -// [SPECIES_MEWTWO] = gMonFootprint_Mewtwo, -// [SPECIES_MEW] = gMonFootprint_Mew, -// [SPECIES_CHIKORITA] = gMonFootprint_Chikorita, -// [SPECIES_BAYLEEF] = gMonFootprint_Bayleef, -// [SPECIES_MEGANIUM] = gMonFootprint_Meganium, -// [SPECIES_CYNDAQUIL] = gMonFootprint_Cyndaquil, -// [SPECIES_QUILAVA] = gMonFootprint_Quilava, -// [SPECIES_TYPHLOSION] = gMonFootprint_Typhlosion, -// [SPECIES_TOTODILE] = gMonFootprint_Totodile, -// [SPECIES_CROCONAW] = gMonFootprint_Croconaw, -// [SPECIES_FERALIGATR] = gMonFootprint_Feraligatr, -// [SPECIES_SENTRET] = gMonFootprint_Sentret, -// [SPECIES_FURRET] = gMonFootprint_Furret, -// [SPECIES_HOOTHOOT] = gMonFootprint_Hoothoot, -// [SPECIES_NOCTOWL] = gMonFootprint_Noctowl, -// [SPECIES_LEDYBA] = gMonFootprint_Ledyba, -// [SPECIES_LEDIAN] = gMonFootprint_Ledian, -// [SPECIES_SPINARAK] = gMonFootprint_Spinarak, -// [SPECIES_ARIADOS] = gMonFootprint_Ariados, -// [SPECIES_CROBAT] = gMonFootprint_Crobat, -// [SPECIES_CHINCHOU] = gMonFootprint_Chinchou, -// [SPECIES_LANTURN] = gMonFootprint_Lanturn, -// [SPECIES_PICHU] = gMonFootprint_Pichu, -// [SPECIES_CLEFFA] = gMonFootprint_Cleffa, -// [SPECIES_IGGLYBUFF] = gMonFootprint_Igglybuff, -// [SPECIES_TOGEPI] = gMonFootprint_Togepi, -// [SPECIES_TOGETIC] = gMonFootprint_Togetic, -// [SPECIES_NATU] = gMonFootprint_Natu, -// [SPECIES_XATU] = gMonFootprint_Xatu, -// [SPECIES_MAREEP] = gMonFootprint_Mareep, -// [SPECIES_FLAAFFY] = gMonFootprint_Flaaffy, -// [SPECIES_AMPHAROS] = gMonFootprint_Ampharos, -// [SPECIES_BELLOSSOM] = gMonFootprint_Bellossom, -// [SPECIES_MARILL] = gMonFootprint_Marill, -// [SPECIES_AZUMARILL] = gMonFootprint_Azumarill, -// [SPECIES_SUDOWOODO] = gMonFootprint_Sudowoodo, -// [SPECIES_POLITOED] = gMonFootprint_Politoed, -// [SPECIES_HOPPIP] = gMonFootprint_Hoppip, -// [SPECIES_SKIPLOOM] = gMonFootprint_Skiploom, -// [SPECIES_JUMPLUFF] = gMonFootprint_Jumpluff, -// [SPECIES_AIPOM] = gMonFootprint_Aipom, -// [SPECIES_SUNKERN] = gMonFootprint_Sunkern, -// [SPECIES_SUNFLORA] = gMonFootprint_Sunflora, -// [SPECIES_YANMA] = gMonFootprint_Yanma, -// [SPECIES_WOOPER] = gMonFootprint_Wooper, -// [SPECIES_QUAGSIRE] = gMonFootprint_Quagsire, -// [SPECIES_ESPEON] = gMonFootprint_Espeon, -// [SPECIES_UMBREON] = gMonFootprint_Umbreon, -// [SPECIES_MURKROW] = gMonFootprint_Murkrow, -// [SPECIES_SLOWKING] = gMonFootprint_Slowking, -// [SPECIES_MISDREAVUS] = gMonFootprint_Misdreavus, -// [SPECIES_UNOWN] = gMonFootprint_Unown, -// [SPECIES_WOBBUFFET] = gMonFootprint_Wobbuffet, -// [SPECIES_GIRAFARIG] = gMonFootprint_Girafarig, -// [SPECIES_PINECO] = gMonFootprint_Pineco, -// [SPECIES_FORRETRESS] = gMonFootprint_Forretress, -// [SPECIES_DUNSPARCE] = gMonFootprint_Dunsparce, -// [SPECIES_GLIGAR] = gMonFootprint_Gligar, -// [SPECIES_STEELIX] = gMonFootprint_Steelix, -// [SPECIES_SNUBBULL] = gMonFootprint_Snubbull, -// [SPECIES_GRANBULL] = gMonFootprint_Granbull, -// [SPECIES_QWILFISH] = gMonFootprint_Qwilfish, -// [SPECIES_SCIZOR] = gMonFootprint_Scizor, -// [SPECIES_SHUCKLE] = gMonFootprint_Shuckle, -// [SPECIES_HERACROSS] = gMonFootprint_Heracross, -// [SPECIES_SNEASEL] = gMonFootprint_Sneasel, -// [SPECIES_TEDDIURSA] = gMonFootprint_Teddiursa, -// [SPECIES_URSARING] = gMonFootprint_Ursaring, -// [SPECIES_SLUGMA] = gMonFootprint_Slugma, -// [SPECIES_MAGCARGO] = gMonFootprint_Magcargo, -// [SPECIES_SWINUB] = gMonFootprint_Swinub, -// [SPECIES_PILOSWINE] = gMonFootprint_Piloswine, -// [SPECIES_CORSOLA] = gMonFootprint_Corsola, -// [SPECIES_REMORAID] = gMonFootprint_Remoraid, -// [SPECIES_OCTILLERY] = gMonFootprint_Octillery, -// [SPECIES_DELIBIRD] = gMonFootprint_Delibird, -// [SPECIES_MANTINE] = gMonFootprint_Mantine, -// [SPECIES_SKARMORY] = gMonFootprint_Skarmory, -// [SPECIES_HOUNDOUR] = gMonFootprint_Houndour, -// [SPECIES_HOUNDOOM] = gMonFootprint_Houndoom, -// [SPECIES_KINGDRA] = gMonFootprint_Kingdra, -// [SPECIES_PHANPY] = gMonFootprint_Phanpy, -// [SPECIES_DONPHAN] = gMonFootprint_Donphan, -// [SPECIES_PORYGON2] = gMonFootprint_Porygon2, -// [SPECIES_STANTLER] = gMonFootprint_Stantler, -// [SPECIES_SMEARGLE] = gMonFootprint_Smeargle, -// [SPECIES_TYROGUE] = gMonFootprint_Tyrogue, -// [SPECIES_HITMONTOP] = gMonFootprint_Hitmontop, -// [SPECIES_SMOOCHUM] = gMonFootprint_Smoochum, -// [SPECIES_ELEKID] = gMonFootprint_Elekid, -// [SPECIES_MAGBY] = gMonFootprint_Magby, -// [SPECIES_MILTANK] = gMonFootprint_Miltank, -// [SPECIES_BLISSEY] = gMonFootprint_Blissey, -// [SPECIES_RAIKOU] = gMonFootprint_Raikou, -// [SPECIES_ENTEI] = gMonFootprint_Entei, -// [SPECIES_SUICUNE] = gMonFootprint_Suicune, -// [SPECIES_LARVITAR] = gMonFootprint_Larvitar, -// [SPECIES_PUPITAR] = gMonFootprint_Pupitar, -// [SPECIES_TYRANITAR] = gMonFootprint_Tyranitar, -// [SPECIES_LUGIA] = gMonFootprint_Lugia, -// [SPECIES_HO_OH] = gMonFootprint_HoOh, -// [SPECIES_CELEBI] = gMonFootprint_Celebi, -// [SPECIES_OLD_UNOWN_B] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_C] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_D] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_E] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_F] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_G] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_H] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_I] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_J] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_K] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_L] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_M] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_N] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_O] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_P] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_Q] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_R] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_S] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_T] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_U] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_V] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_W] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_X] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_Y] = gMonFootprint_QuestionMark, -// [SPECIES_OLD_UNOWN_Z] = gMonFootprint_QuestionMark, -// [SPECIES_TREECKO] = gMonFootprint_Treecko, -// [SPECIES_GROVYLE] = gMonFootprint_Grovyle, -// [SPECIES_SCEPTILE] = gMonFootprint_Sceptile, -// [SPECIES_TORCHIC] = gMonFootprint_Torchic, -// [SPECIES_COMBUSKEN] = gMonFootprint_Combusken, -// [SPECIES_BLAZIKEN] = gMonFootprint_Blaziken, -// [SPECIES_MUDKIP] = gMonFootprint_Mudkip, -// [SPECIES_MARSHTOMP] = gMonFootprint_Marshtomp, -// [SPECIES_SWAMPERT] = gMonFootprint_Swampert, -// [SPECIES_POOCHYENA] = gMonFootprint_Poochyena, -// [SPECIES_MIGHTYENA] = gMonFootprint_Mightyena, -// [SPECIES_ZIGZAGOON] = gMonFootprint_Zigzagoon, -// [SPECIES_LINOONE] = gMonFootprint_Linoone, -// [SPECIES_WURMPLE] = gMonFootprint_Wurmple, -// [SPECIES_SILCOON] = gMonFootprint_Silcoon, -// [SPECIES_BEAUTIFLY] = gMonFootprint_Beautifly, -// [SPECIES_CASCOON] = gMonFootprint_Cascoon, -// [SPECIES_DUSTOX] = gMonFootprint_Dustox, -// [SPECIES_LOTAD] = gMonFootprint_Lotad, -// [SPECIES_LOMBRE] = gMonFootprint_Lombre, -// [SPECIES_LUDICOLO] = gMonFootprint_Ludicolo, -// [SPECIES_SEEDOT] = gMonFootprint_Seedot, -// [SPECIES_NUZLEAF] = gMonFootprint_Nuzleaf, -// [SPECIES_SHIFTRY] = gMonFootprint_Shiftry, -// [SPECIES_NINCADA] = gMonFootprint_Nincada, -// [SPECIES_NINJASK] = gMonFootprint_Ninjask, -// [SPECIES_SHEDINJA] = gMonFootprint_Shedinja, -// [SPECIES_TAILLOW] = gMonFootprint_Taillow, -// [SPECIES_SWELLOW] = gMonFootprint_Swellow, -// [SPECIES_SHROOMISH] = gMonFootprint_Shroomish, -// [SPECIES_BRELOOM] = gMonFootprint_Breloom, -// [SPECIES_SPINDA] = gMonFootprint_Spinda, -// [SPECIES_WINGULL] = gMonFootprint_Wingull, -// [SPECIES_PELIPPER] = gMonFootprint_Pelipper, -// [SPECIES_SURSKIT] = gMonFootprint_Surskit, -// [SPECIES_MASQUERAIN] = gMonFootprint_Masquerain, -// [SPECIES_WAILMER] = gMonFootprint_Wailmer, -// [SPECIES_WAILORD] = gMonFootprint_Wailord, -// [SPECIES_SKITTY] = gMonFootprint_Skitty, -// [SPECIES_DELCATTY] = gMonFootprint_Delcatty, -// [SPECIES_KECLEON] = gMonFootprint_Kecleon, -// [SPECIES_BALTOY] = gMonFootprint_Baltoy, -// [SPECIES_CLAYDOL] = gMonFootprint_Claydol, -// [SPECIES_NOSEPASS] = gMonFootprint_Nosepass, -// [SPECIES_TORKOAL] = gMonFootprint_Torkoal, -// [SPECIES_SABLEYE] = gMonFootprint_Sableye, -// [SPECIES_BARBOACH] = gMonFootprint_Barboach, -// [SPECIES_WHISCASH] = gMonFootprint_Whiscash, -// [SPECIES_LUVDISC] = gMonFootprint_Luvdisc, -// [SPECIES_CORPHISH] = gMonFootprint_Corphish, -// [SPECIES_CRAWDAUNT] = gMonFootprint_Crawdaunt, -// [SPECIES_FEEBAS] = gMonFootprint_Feebas, -// [SPECIES_MILOTIC] = gMonFootprint_Milotic, -// [SPECIES_CARVANHA] = gMonFootprint_Carvanha, -// [SPECIES_SHARPEDO] = gMonFootprint_Sharpedo, -// [SPECIES_TRAPINCH] = gMonFootprint_Trapinch, -// [SPECIES_VIBRAVA] = gMonFootprint_Vibrava, -// [SPECIES_FLYGON] = gMonFootprint_Flygon, -// [SPECIES_MAKUHITA] = gMonFootprint_Makuhita, -// [SPECIES_HARIYAMA] = gMonFootprint_Hariyama, -// [SPECIES_ELECTRIKE] = gMonFootprint_Electrike, -// [SPECIES_MANECTRIC] = gMonFootprint_Manectric, -// [SPECIES_NUMEL] = gMonFootprint_Numel, -// [SPECIES_CAMERUPT] = gMonFootprint_Camerupt, -// [SPECIES_SPHEAL] = gMonFootprint_Spheal, -// [SPECIES_SEALEO] = gMonFootprint_Sealeo, -// [SPECIES_WALREIN] = gMonFootprint_Walrein, -// [SPECIES_CACNEA] = gMonFootprint_Cacnea, -// [SPECIES_CACTURNE] = gMonFootprint_Cacturne, -// [SPECIES_SNORUNT] = gMonFootprint_Snorunt, -// [SPECIES_GLALIE] = gMonFootprint_Glalie, -// [SPECIES_LUNATONE] = gMonFootprint_Lunatone, -// [SPECIES_SOLROCK] = gMonFootprint_Solrock, -// [SPECIES_AZURILL] = gMonFootprint_Azurill, -// [SPECIES_SPOINK] = gMonFootprint_Spoink, -// [SPECIES_GRUMPIG] = gMonFootprint_Grumpig, -// [SPECIES_PLUSLE] = gMonFootprint_Plusle, -// [SPECIES_MINUN] = gMonFootprint_Minun, -// [SPECIES_MAWILE] = gMonFootprint_Mawile, -// [SPECIES_MEDITITE] = gMonFootprint_Meditite, -// [SPECIES_MEDICHAM] = gMonFootprint_Medicham, -// [SPECIES_SWABLU] = gMonFootprint_Swablu, -// [SPECIES_ALTARIA] = gMonFootprint_Altaria, -// [SPECIES_WYNAUT] = gMonFootprint_Wynaut, -// [SPECIES_DUSKULL] = gMonFootprint_Duskull, -// [SPECIES_DUSCLOPS] = gMonFootprint_Dusclops, -// [SPECIES_ROSELIA] = gMonFootprint_Roselia, -// [SPECIES_SLAKOTH] = gMonFootprint_Slakoth, -// [SPECIES_VIGOROTH] = gMonFootprint_Vigoroth, -// [SPECIES_SLAKING] = gMonFootprint_Slaking, -// [SPECIES_GULPIN] = gMonFootprint_Gulpin, -// [SPECIES_SWALOT] = gMonFootprint_Swalot, -// [SPECIES_TROPIUS] = gMonFootprint_Tropius, -// [SPECIES_WHISMUR] = gMonFootprint_Whismur, -// [SPECIES_LOUDRED] = gMonFootprint_Loudred, -// [SPECIES_EXPLOUD] = gMonFootprint_Exploud, -// [SPECIES_CLAMPERL] = gMonFootprint_Clamperl, -// [SPECIES_HUNTAIL] = gMonFootprint_Huntail, -// [SPECIES_GOREBYSS] = gMonFootprint_Gorebyss, -// [SPECIES_ABSOL] = gMonFootprint_Absol, -// [SPECIES_SHUPPET] = gMonFootprint_Shuppet, -// [SPECIES_BANETTE] = gMonFootprint_Banette, -// [SPECIES_SEVIPER] = gMonFootprint_Seviper, -// [SPECIES_ZANGOOSE] = gMonFootprint_Zangoose, -// [SPECIES_RELICANTH] = gMonFootprint_Relicanth, -// [SPECIES_ARON] = gMonFootprint_Aron, -// [SPECIES_LAIRON] = gMonFootprint_Lairon, -// [SPECIES_AGGRON] = gMonFootprint_Aggron, -// [SPECIES_CASTFORM] = gMonFootprint_Castform, -// [SPECIES_VOLBEAT] = gMonFootprint_Volbeat, -// [SPECIES_ILLUMISE] = gMonFootprint_Illumise, -// [SPECIES_LILEEP] = gMonFootprint_Lileep, -// [SPECIES_CRADILY] = gMonFootprint_Cradily, -// [SPECIES_ANORITH] = gMonFootprint_Anorith, -// [SPECIES_ARMALDO] = gMonFootprint_Armaldo, -// [SPECIES_RALTS] = gMonFootprint_Ralts, -// [SPECIES_KIRLIA] = gMonFootprint_Kirlia, -// [SPECIES_GARDEVOIR] = gMonFootprint_Gardevoir, -// [SPECIES_BAGON] = gMonFootprint_Bagon, -// [SPECIES_SHELGON] = gMonFootprint_Shelgon, -// [SPECIES_SALAMENCE] = gMonFootprint_Salamence, -// [SPECIES_BELDUM] = gMonFootprint_Beldum, -// [SPECIES_METANG] = gMonFootprint_Metang, -// [SPECIES_METAGROSS] = gMonFootprint_Metagross, -// [SPECIES_REGIROCK] = gMonFootprint_Regirock, -// [SPECIES_REGICE] = gMonFootprint_Regice, -// [SPECIES_REGISTEEL] = gMonFootprint_Registeel, -// [SPECIES_KYOGRE] = gMonFootprint_Kyogre, -// [SPECIES_GROUDON] = gMonFootprint_Groudon, -// [SPECIES_RAYQUAZA] = gMonFootprint_Rayquaza, -// [SPECIES_LATIAS] = gMonFootprint_Latias, -// [SPECIES_LATIOS] = gMonFootprint_Latios, -// [SPECIES_JIRACHI] = gMonFootprint_Jirachi, -// [SPECIES_DEOXYS] = gMonFootprint_Deoxys, -// [SPECIES_CHIMECHO] = gMonFootprint_Chimecho, -// [SPECIES_EGG] = gMonFootprint_Bulbasaur, -// }; diff --git a/src/data/pokemon_graphics/front_pic_coordinates.h b/src/data/pokemon_graphics/front_pic_coordinates.h deleted file mode 100644 index aba30940f..000000000 --- a/src/data/pokemon_graphics/front_pic_coordinates.h +++ /dev/null @@ -1,2203 +0,0 @@ -// const struct MonCoords gMonFrontPicCoords[] = -// { -// [SPECIES_NONE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_BULBASAUR] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 16, -// }, -// [SPECIES_IVYSAUR] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_VENUSAUR] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_CHARMANDER] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 13, -// }, -// [SPECIES_CHARMELEON] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_CHARIZARD] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_SQUIRTLE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_WARTORTLE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_BLASTOISE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_CATERPIE] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_METAPOD] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 20, -// }, -// [SPECIES_BUTTERFREE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_WEEDLE] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 17, -// }, -// [SPECIES_KAKUNA] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 14, -// }, -// [SPECIES_BEEDRILL] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_PIDGEY] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 13, -// }, -// [SPECIES_PIDGEOTTO] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_PIDGEOT] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_RATTATA] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 14, -// }, -// [SPECIES_RATICATE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_SPEAROW] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_FEAROW] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_EKANS] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 15, -// }, -// [SPECIES_ARBOK] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_PIKACHU] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 9, -// }, -// [SPECIES_RAICHU] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SANDSHREW] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_SANDSLASH] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_NIDORAN_F] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_NIDORINA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_NIDOQUEEN] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 2, -// }, -// [SPECIES_NIDORAN_M] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_NIDORINO] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_NIDOKING] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_CLEFAIRY] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 16, -// }, -// [SPECIES_CLEFABLE] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_VULPIX] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_NINETALES] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_JIGGLYPUFF] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 16, -// }, -// [SPECIES_WIGGLYTUFF] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 8, -// }, -// [SPECIES_ZUBAT] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 13, -// }, -// [SPECIES_GOLBAT] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_ODDISH] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 12, -// }, -// [SPECIES_GLOOM] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_VILEPLUME] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_PARAS] = -// { -// .size = MON_COORDS_SIZE(48, 32), -// .y_offset = 18, -// }, -// [SPECIES_PARASECT] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_VENONAT] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 11, -// }, -// [SPECIES_VENOMOTH] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 8, -// }, -// [SPECIES_DIGLETT] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 17, -// }, -// [SPECIES_DUGTRIO] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 12, -// }, -// [SPECIES_MEOWTH] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_PERSIAN] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_PSYDUCK] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 9, -// }, -// [SPECIES_GOLDUCK] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_MANKEY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 14, -// }, -// [SPECIES_PRIMEAPE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_GROWLITHE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_ARCANINE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_POLIWAG] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 16, -// }, -// [SPECIES_POLIWHIRL] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_POLIWRATH] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_ABRA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_KADABRA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_ALAKAZAM] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_MACHOP] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 11, -// }, -// [SPECIES_MACHOKE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_MACHAMP] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_BELLSPROUT] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 15, -// }, -// [SPECIES_WEEPINBELL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_VICTREEBEL] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_TENTACOOL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_TENTACRUEL] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 1, -// }, -// [SPECIES_GEODUDE] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 18, -// }, -// [SPECIES_GRAVELER] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_GOLEM] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_PONYTA] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_RAPIDASH] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SLOWPOKE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_SLOWBRO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_MAGNEMITE] = -// { -// .size = MON_COORDS_SIZE(40, 24), -// .y_offset = 22, -// }, -// [SPECIES_MAGNETON] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 16, -// }, -// [SPECIES_FARFETCHD] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_DODUO] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_DODRIO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_SEEL] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_DEWGONG] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_GRIMER] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_MUK] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_SHELLDER] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 16, -// }, -// [SPECIES_CLOYSTER] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_GASTLY] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_HAUNTER] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_GENGAR] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_ONIX] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_DROWZEE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_HYPNO] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_KRABBY] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 14, -// }, -// [SPECIES_KINGLER] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_VOLTORB] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 19, -// }, -// [SPECIES_ELECTRODE] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_EXEGGCUTE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_EXEGGUTOR] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_CUBONE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 13, -// }, -// [SPECIES_MAROWAK] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 13, -// }, -// [SPECIES_HITMONLEE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_HITMONCHAN] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 4, -// }, -// [SPECIES_LICKITUNG] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_KOFFING] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_WEEZING] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 7, -// }, -// [SPECIES_RHYHORN] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_RHYDON] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_CHANSEY] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_TANGELA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_KANGASKHAN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_HORSEA] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 16, -// }, -// [SPECIES_SEADRA] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_GOLDEEN] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_SEAKING] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_STARYU] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 13, -// }, -// [SPECIES_STARMIE] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 10, -// }, -// [SPECIES_MR_MIME] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_SCYTHER] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 2, -// }, -// [SPECIES_JYNX] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_ELECTABUZZ] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 4, -// }, -// [SPECIES_MAGMAR] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_PINSIR] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_TAUROS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 5, -// }, -// [SPECIES_MAGIKARP] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 11, -// }, -// [SPECIES_GYARADOS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_LAPRAS] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_DITTO] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 17, -// }, -// [SPECIES_EEVEE] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 13, -// }, -// [SPECIES_VAPOREON] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_JOLTEON] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_FLAREON] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 11, -// }, -// [SPECIES_PORYGON] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_OMANYTE] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 15, -// }, -// [SPECIES_OMASTAR] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_KABUTO] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 20, -// }, -// [SPECIES_KABUTOPS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_AERODACTYL] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_SNORLAX] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_ARTICUNO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_ZAPDOS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 4, -// }, -// [SPECIES_MOLTRES] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_DRATINI] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 15, -// }, -// [SPECIES_DRAGONAIR] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_DRAGONITE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_MEWTWO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_MEW] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 13, -// }, -// [SPECIES_CHIKORITA] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_BAYLEEF] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_MEGANIUM] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_CYNDAQUIL] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_QUILAVA] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_TYPHLOSION] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_TOTODILE] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_CROCONAW] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_FERALIGATR] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SENTRET] = -// { -// .size = MON_COORDS_SIZE(32, 56), -// .y_offset = 4, -// }, -// [SPECIES_FURRET] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_HOOTHOOT] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 13, -// }, -// [SPECIES_NOCTOWL] = -// { -// .size = MON_COORDS_SIZE(40, 64), -// .y_offset = 3, -// }, -// [SPECIES_LEDYBA] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 12, -// }, -// [SPECIES_LEDIAN] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 4, -// }, -// [SPECIES_SPINARAK] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 19, -// }, -// [SPECIES_ARIADOS] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_CROBAT] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_CHINCHOU] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 16, -// }, -// [SPECIES_LANTURN] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 11, -// }, -// [SPECIES_PICHU] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 12, -// }, -// [SPECIES_CLEFFA] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 20, -// }, -// [SPECIES_IGGLYBUFF] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 18, -// }, -// [SPECIES_TOGEPI] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 20, -// }, -// [SPECIES_TOGETIC] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 9, -// }, -// [SPECIES_NATU] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 20, -// }, -// [SPECIES_XATU] = -// { -// .size = MON_COORDS_SIZE(32, 56), -// .y_offset = 7, -// }, -// [SPECIES_MAREEP] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 16, -// }, -// [SPECIES_FLAAFFY] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_AMPHAROS] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_BELLOSSOM] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 14, -// }, -// [SPECIES_MARILL] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 14, -// }, -// [SPECIES_AZUMARILL] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_SUDOWOODO] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_POLITOED] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_HOPPIP] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_SKIPLOOM] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_JUMPLUFF] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_AIPOM] = -// { -// .size = MON_COORDS_SIZE(40, 64), -// .y_offset = 3, -// }, -// [SPECIES_SUNKERN] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 16, -// }, -// [SPECIES_SUNFLORA] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_YANMA] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_WOOPER] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_QUAGSIRE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 7, -// }, -// [SPECIES_ESPEON] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_UMBREON] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 8, -// }, -// [SPECIES_MURKROW] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_SLOWKING] = -// { -// .size = MON_COORDS_SIZE(40, 64), -// .y_offset = 1, -// }, -// [SPECIES_MISDREAVUS] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_UNOWN] = -// { -// .size = MON_COORDS_SIZE(24, 40), -// .y_offset = 15, -// }, -// [SPECIES_WOBBUFFET] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_GIRAFARIG] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_PINECO] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_FORRETRESS] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_DUNSPARCE] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 17, -// }, -// [SPECIES_GLIGAR] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_STEELIX] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SNUBBULL] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 13, -// }, -// [SPECIES_GRANBULL] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 6, -// }, -// [SPECIES_QWILFISH] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 10, -// }, -// [SPECIES_SCIZOR] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SHUCKLE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_HERACROSS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_SNEASEL] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 5, -// }, -// [SPECIES_TEDDIURSA] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 11, -// }, -// [SPECIES_URSARING] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 1, -// }, -// [SPECIES_SLUGMA] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 13, -// }, -// [SPECIES_MAGCARGO] = -// { -// .size = MON_COORDS_SIZE(40, 56), -// .y_offset = 13, -// }, -// [SPECIES_SWINUB] = -// { -// .size = MON_COORDS_SIZE(32, 24), -// .y_offset = 20, -// }, -// [SPECIES_PILOSWINE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_CORSOLA] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_REMORAID] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_OCTILLERY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_DELIBIRD] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_MANTINE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_SKARMORY] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_HOUNDOUR] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_HOUNDOOM] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_KINGDRA] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 4, -// }, -// [SPECIES_PHANPY] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_DONPHAN] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_PORYGON2] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_STANTLER] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SMEARGLE] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_TYROGUE] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 9, -// }, -// [SPECIES_HITMONTOP] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 5, -// }, -// [SPECIES_SMOOCHUM] = -// { -// .size = MON_COORDS_SIZE(24, 40), -// .y_offset = 15, -// }, -// [SPECIES_ELEKID] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_MAGBY] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 13, -// }, -// [SPECIES_MILTANK] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_BLISSEY] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 6, -// }, -// [SPECIES_RAIKOU] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_ENTEI] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SUICUNE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_LARVITAR] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 9, -// }, -// [SPECIES_PUPITAR] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 9, -// }, -// [SPECIES_TYRANITAR] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_LUGIA] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_HO_OH] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_CELEBI] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_OLD_UNOWN_B] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_C] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_D] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_E] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_F] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_G] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_H] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_I] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_J] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_K] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_L] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_M] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_N] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_O] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_P] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_Q] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_R] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_S] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_T] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_U] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_V] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_W] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_X] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_Y] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_OLD_UNOWN_Z] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 6, -// }, -// [SPECIES_TREECKO] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_GROVYLE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_SCEPTILE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_TORCHIC] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_COMBUSKEN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_BLAZIKEN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_MUDKIP] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 12, -// }, -// [SPECIES_MARSHTOMP] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_SWAMPERT] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_POOCHYENA] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_MIGHTYENA] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_ZIGZAGOON] = -// { -// .size = MON_COORDS_SIZE(64, 40), -// .y_offset = 15, -// }, -// [SPECIES_LINOONE] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_WURMPLE] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 14, -// }, -// [SPECIES_SILCOON] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 17, -// }, -// [SPECIES_BEAUTIFLY] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 9, -// }, -// [SPECIES_CASCOON] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 16, -// }, -// [SPECIES_DUSTOX] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 15, -// }, -// [SPECIES_LOTAD] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 14, -// }, -// [SPECIES_LOMBRE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_LUDICOLO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SEEDOT] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 16, -// }, -// [SPECIES_NUZLEAF] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_SHIFTRY] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_NINCADA] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 18, -// }, -// [SPECIES_NINJASK] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_SHEDINJA] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_TAILLOW] = -// { -// .size = MON_COORDS_SIZE(48, 32), -// .y_offset = 16, -// }, -// [SPECIES_SWELLOW] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_SHROOMISH] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_BRELOOM] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_SPINDA] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 8, -// }, -// [SPECIES_WINGULL] = -// { -// .size = MON_COORDS_SIZE(64, 32), -// .y_offset = 24, -// }, -// [SPECIES_PELIPPER] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 4, -// }, -// [SPECIES_SURSKIT] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 15, -// }, -// [SPECIES_MASQUERAIN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_WAILMER] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 15, -// }, -// [SPECIES_WAILORD] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 10, -// }, -// [SPECIES_SKITTY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 11, -// }, -// [SPECIES_DELCATTY] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_KECLEON] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_BALTOY] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 16, -// }, -// [SPECIES_CLAYDOL] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 6, -// }, -// [SPECIES_NOSEPASS] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 12, -// }, -// [SPECIES_TORKOAL] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_SABLEYE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_BARBOACH] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 11, -// }, -// [SPECIES_WHISCASH] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 9, -// }, -// [SPECIES_LUVDISC] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 24, -// }, -// [SPECIES_CORPHISH] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 12, -// }, -// [SPECIES_CRAWDAUNT] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_FEEBAS] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 13, -// }, -// [SPECIES_MILOTIC] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_CARVANHA] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 6, -// }, -// [SPECIES_SHARPEDO] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_TRAPINCH] = -// { -// .size = MON_COORDS_SIZE(40, 32), -// .y_offset = 16, -// }, -// [SPECIES_VIBRAVA] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 12, -// }, -// [SPECIES_FLYGON] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_MAKUHITA] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_HARIYAMA] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_ELECTRIKE] = -// { -// .size = MON_COORDS_SIZE(48, 32), -// .y_offset = 18, -// }, -// [SPECIES_MANECTRIC] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 4, -// }, -// [SPECIES_NUMEL] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 15, -// }, -// [SPECIES_CAMERUPT] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 9, -// }, -// [SPECIES_SPHEAL] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 16, -// }, -// [SPECIES_SEALEO] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 10, -// }, -// [SPECIES_WALREIN] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_CACNEA] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 16, -// }, -// [SPECIES_CACTURNE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_SNORUNT] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_GLALIE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 10, -// }, -// [SPECIES_LUNATONE] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_SOLROCK] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_AZURILL] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_SPOINK] = -// { -// .size = MON_COORDS_SIZE(32, 48), -// .y_offset = 9, -// }, -// [SPECIES_GRUMPIG] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_PLUSLE] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 14, -// }, -// [SPECIES_MINUN] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 12, -// }, -// [SPECIES_MAWILE] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_MEDITITE] = -// { -// .size = MON_COORDS_SIZE(48, 40), -// .y_offset = 12, -// }, -// [SPECIES_MEDICHAM] = -// { -// .size = MON_COORDS_SIZE(48, 64), -// .y_offset = 1, -// }, -// [SPECIES_SWABLU] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 17, -// }, -// [SPECIES_ALTARIA] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_WYNAUT] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_DUSKULL] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 10, -// }, -// [SPECIES_DUSCLOPS] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 5, -// }, -// [SPECIES_ROSELIA] = -// { -// .size = MON_COORDS_SIZE(56, 48), -// .y_offset = 8, -// }, -// [SPECIES_SLAKOTH] = -// { -// .size = MON_COORDS_SIZE(56, 32), -// .y_offset = 18, -// }, -// [SPECIES_VIGOROTH] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_SLAKING] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 8, -// }, -// [SPECIES_GULPIN] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 18, -// }, -// [SPECIES_SWALOT] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_TROPIUS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_WHISMUR] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_LOUDRED] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_EXPLOUD] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_CLAMPERL] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 14, -// }, -// [SPECIES_HUNTAIL] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 3, -// }, -// [SPECIES_GOREBYSS] = -// { -// .size = MON_COORDS_SIZE(64, 48), -// .y_offset = 11, -// }, -// [SPECIES_ABSOL] = -// { -// .size = MON_COORDS_SIZE(48, 64), -// .y_offset = 0, -// }, -// [SPECIES_SHUPPET] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 14, -// }, -// [SPECIES_BANETTE] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 12, -// }, -// [SPECIES_SEVIPER] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 8, -// }, -// [SPECIES_ZANGOOSE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 5, -// }, -// [SPECIES_RELICANTH] = -// { -// .size = MON_COORDS_SIZE(56, 56), -// .y_offset = 11, -// }, -// [SPECIES_ARON] = -// { -// .size = MON_COORDS_SIZE(32, 24), -// .y_offset = 20, -// }, -// [SPECIES_LAIRON] = -// { -// .size = MON_COORDS_SIZE(56, 40), -// .y_offset = 13, -// }, -// [SPECIES_AGGRON] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_CASTFORM] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 17, -// }, -// [SPECIES_VOLBEAT] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_ILLUMISE] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 8, -// }, -// [SPECIES_LILEEP] = -// { -// .size = MON_COORDS_SIZE(48, 56), -// .y_offset = 7, -// }, -// [SPECIES_CRADILY] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 0, -// }, -// [SPECIES_ANORITH] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 8, -// }, -// [SPECIES_ARMALDO] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_RALTS] = -// { -// .size = MON_COORDS_SIZE(24, 40), -// .y_offset = 15, -// }, -// [SPECIES_KIRLIA] = -// { -// .size = MON_COORDS_SIZE(32, 56), -// .y_offset = 6, -// }, -// [SPECIES_GARDEVOIR] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 1, -// }, -// [SPECIES_BAGON] = -// { -// .size = MON_COORDS_SIZE(40, 48), -// .y_offset = 11, -// }, -// [SPECIES_SHELGON] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 9, -// }, -// [SPECIES_SALAMENCE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_BELDUM] = -// { -// .size = MON_COORDS_SIZE(40, 40), -// .y_offset = 15, -// }, -// [SPECIES_METANG] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 7, -// }, -// [SPECIES_METAGROSS] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 6, -// }, -// [SPECIES_REGIROCK] = -// { -// .size = MON_COORDS_SIZE(56, 64), -// .y_offset = 4, -// }, -// [SPECIES_REGICE] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_REGISTEEL] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 3, -// }, -// [SPECIES_KYOGRE] = -// { -// .size = MON_COORDS_SIZE(64, 56), -// .y_offset = 4, -// }, -// [SPECIES_GROUDON] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_RAYQUAZA] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 0, -// }, -// [SPECIES_LATIAS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_LATIOS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 2, -// }, -// [SPECIES_JIRACHI] = -// { -// .size = MON_COORDS_SIZE(48, 48), -// .y_offset = 13, -// }, -// [SPECIES_DEOXYS] = -// { -// .size = MON_COORDS_SIZE(64, 64), -// .y_offset = 1, -// }, -// [SPECIES_CHIMECHO] = -// { -// .size = MON_COORDS_SIZE(24, 56), -// .y_offset = 6, -// }, -// [SPECIES_EGG] = -// { -// .size = MON_COORDS_SIZE(24, 24), -// .y_offset = 20, -// }, -// [SPECIES_UNOWN_B] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_C] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_D] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_E] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 17, -// }, -// [SPECIES_UNOWN_F] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 17, -// }, -// [SPECIES_UNOWN_G] = -// { -// .size = MON_COORDS_SIZE(24, 40), -// .y_offset = 14, -// }, -// [SPECIES_UNOWN_H] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_I] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_J] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 17, -// }, -// [SPECIES_UNOWN_K] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 17, -// }, -// [SPECIES_UNOWN_L] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 19, -// }, -// [SPECIES_UNOWN_M] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 19, -// }, -// [SPECIES_UNOWN_N] = -// { -// .size = MON_COORDS_SIZE(32, 24), -// .y_offset = 20, -// }, -// [SPECIES_UNOWN_O] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_P] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 19, -// }, -// [SPECIES_UNOWN_Q] = -// { -// .size = MON_COORDS_SIZE(32, 24), -// .y_offset = 21, -// }, -// [SPECIES_UNOWN_R] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 19, -// }, -// [SPECIES_UNOWN_S] = -// { -// .size = MON_COORDS_SIZE(32, 40), -// .y_offset = 12, -// }, -// [SPECIES_UNOWN_T] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 18, -// }, -// [SPECIES_UNOWN_U] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 18, -// }, -// [SPECIES_UNOWN_V] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 18, -// }, -// [SPECIES_UNOWN_W] = -// { -// .size = MON_COORDS_SIZE(32, 32), -// .y_offset = 19, -// }, -// [SPECIES_UNOWN_X] = -// { -// .size = MON_COORDS_SIZE(24, 24), -// .y_offset = 21, -// }, -// [SPECIES_UNOWN_Y] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 17, -// }, -// [SPECIES_UNOWN_Z] = -// { -// .size = MON_COORDS_SIZE(24, 32), -// .y_offset = 16, -// }, -// [SPECIES_UNOWN_EMARK] = -// { -// .size = MON_COORDS_SIZE(24, 40), -// .y_offset = 15, -// }, -// [SPECIES_UNOWN_QMARK] = -// { -// .size = MON_COORDS_SIZE(24, 40), -// .y_offset = 13, -// }, -// }; diff --git a/src/data/pokemon_graphics/front_pic_table.h b/src/data/pokemon_graphics/front_pic_table.h deleted file mode 100644 index fb06649ae..000000000 --- a/src/data/pokemon_graphics/front_pic_table.h +++ /dev/null @@ -1,443 +0,0 @@ -// const struct CompressedSpriteSheet gMonFrontPicTable[] = -// { -// SPECIES_SPRITE(NONE, gMonFrontPic_CircledQuestionMark), -// SPECIES_SPRITE(BULBASAUR, gMonFrontPic_Bulbasaur), -// SPECIES_SPRITE(IVYSAUR, gMonFrontPic_Ivysaur), -// SPECIES_SPRITE(VENUSAUR, gMonFrontPic_Venusaur), -// SPECIES_SPRITE(CHARMANDER, gMonFrontPic_Charmander), -// SPECIES_SPRITE(CHARMELEON, gMonFrontPic_Charmeleon), -// SPECIES_SPRITE(CHARIZARD, gMonFrontPic_Charizard), -// SPECIES_SPRITE(SQUIRTLE, gMonFrontPic_Squirtle), -// SPECIES_SPRITE(WARTORTLE, gMonFrontPic_Wartortle), -// SPECIES_SPRITE(BLASTOISE, gMonFrontPic_Blastoise), -// SPECIES_SPRITE(CATERPIE, gMonFrontPic_Caterpie), -// SPECIES_SPRITE(METAPOD, gMonFrontPic_Metapod), -// SPECIES_SPRITE(BUTTERFREE, gMonFrontPic_Butterfree), -// SPECIES_SPRITE(WEEDLE, gMonFrontPic_Weedle), -// SPECIES_SPRITE(KAKUNA, gMonFrontPic_Kakuna), -// SPECIES_SPRITE(BEEDRILL, gMonFrontPic_Beedrill), -// SPECIES_SPRITE(PIDGEY, gMonFrontPic_Pidgey), -// SPECIES_SPRITE(PIDGEOTTO, gMonFrontPic_Pidgeotto), -// SPECIES_SPRITE(PIDGEOT, gMonFrontPic_Pidgeot), -// SPECIES_SPRITE(RATTATA, gMonFrontPic_Rattata), -// SPECIES_SPRITE(RATICATE, gMonFrontPic_Raticate), -// SPECIES_SPRITE(SPEAROW, gMonFrontPic_Spearow), -// SPECIES_SPRITE(FEAROW, gMonFrontPic_Fearow), -// SPECIES_SPRITE(EKANS, gMonFrontPic_Ekans), -// SPECIES_SPRITE(ARBOK, gMonFrontPic_Arbok), -// SPECIES_SPRITE(PIKACHU, gMonFrontPic_Pikachu), -// SPECIES_SPRITE(RAICHU, gMonFrontPic_Raichu), -// SPECIES_SPRITE(SANDSHREW, gMonFrontPic_Sandshrew), -// SPECIES_SPRITE(SANDSLASH, gMonFrontPic_Sandslash), -// SPECIES_SPRITE(NIDORAN_F, gMonFrontPic_NidoranF), -// SPECIES_SPRITE(NIDORINA, gMonFrontPic_Nidorina), -// SPECIES_SPRITE(NIDOQUEEN, gMonFrontPic_Nidoqueen), -// SPECIES_SPRITE(NIDORAN_M, gMonFrontPic_NidoranM), -// SPECIES_SPRITE(NIDORINO, gMonFrontPic_Nidorino), -// SPECIES_SPRITE(NIDOKING, gMonFrontPic_Nidoking), -// SPECIES_SPRITE(CLEFAIRY, gMonFrontPic_Clefairy), -// SPECIES_SPRITE(CLEFABLE, gMonFrontPic_Clefable), -// SPECIES_SPRITE(VULPIX, gMonFrontPic_Vulpix), -// SPECIES_SPRITE(NINETALES, gMonFrontPic_Ninetales), -// SPECIES_SPRITE(JIGGLYPUFF, gMonFrontPic_Jigglypuff), -// SPECIES_SPRITE(WIGGLYTUFF, gMonFrontPic_Wigglytuff), -// SPECIES_SPRITE(ZUBAT, gMonFrontPic_Zubat), -// SPECIES_SPRITE(GOLBAT, gMonFrontPic_Golbat), -// SPECIES_SPRITE(ODDISH, gMonFrontPic_Oddish), -// SPECIES_SPRITE(GLOOM, gMonFrontPic_Gloom), -// SPECIES_SPRITE(VILEPLUME, gMonFrontPic_Vileplume), -// SPECIES_SPRITE(PARAS, gMonFrontPic_Paras), -// SPECIES_SPRITE(PARASECT, gMonFrontPic_Parasect), -// SPECIES_SPRITE(VENONAT, gMonFrontPic_Venonat), -// SPECIES_SPRITE(VENOMOTH, gMonFrontPic_Venomoth), -// SPECIES_SPRITE(DIGLETT, gMonFrontPic_Diglett), -// SPECIES_SPRITE(DUGTRIO, gMonFrontPic_Dugtrio), -// SPECIES_SPRITE(MEOWTH, gMonFrontPic_Meowth), -// SPECIES_SPRITE(PERSIAN, gMonFrontPic_Persian), -// SPECIES_SPRITE(PSYDUCK, gMonFrontPic_Psyduck), -// SPECIES_SPRITE(GOLDUCK, gMonFrontPic_Golduck), -// SPECIES_SPRITE(MANKEY, gMonFrontPic_Mankey), -// SPECIES_SPRITE(PRIMEAPE, gMonFrontPic_Primeape), -// SPECIES_SPRITE(GROWLITHE, gMonFrontPic_Growlithe), -// SPECIES_SPRITE(ARCANINE, gMonFrontPic_Arcanine), -// SPECIES_SPRITE(POLIWAG, gMonFrontPic_Poliwag), -// SPECIES_SPRITE(POLIWHIRL, gMonFrontPic_Poliwhirl), -// SPECIES_SPRITE(POLIWRATH, gMonFrontPic_Poliwrath), -// SPECIES_SPRITE(ABRA, gMonFrontPic_Abra), -// SPECIES_SPRITE(KADABRA, gMonFrontPic_Kadabra), -// SPECIES_SPRITE(ALAKAZAM, gMonFrontPic_Alakazam), -// SPECIES_SPRITE(MACHOP, gMonFrontPic_Machop), -// SPECIES_SPRITE(MACHOKE, gMonFrontPic_Machoke), -// SPECIES_SPRITE(MACHAMP, gMonFrontPic_Machamp), -// SPECIES_SPRITE(BELLSPROUT, gMonFrontPic_Bellsprout), -// SPECIES_SPRITE(WEEPINBELL, gMonFrontPic_Weepinbell), -// SPECIES_SPRITE(VICTREEBEL, gMonFrontPic_Victreebel), -// SPECIES_SPRITE(TENTACOOL, gMonFrontPic_Tentacool), -// SPECIES_SPRITE(TENTACRUEL, gMonFrontPic_Tentacruel), -// SPECIES_SPRITE(GEODUDE, gMonFrontPic_Geodude), -// SPECIES_SPRITE(GRAVELER, gMonFrontPic_Graveler), -// SPECIES_SPRITE(GOLEM, gMonFrontPic_Golem), -// SPECIES_SPRITE(PONYTA, gMonFrontPic_Ponyta), -// SPECIES_SPRITE(RAPIDASH, gMonFrontPic_Rapidash), -// SPECIES_SPRITE(SLOWPOKE, gMonFrontPic_Slowpoke), -// SPECIES_SPRITE(SLOWBRO, gMonFrontPic_Slowbro), -// SPECIES_SPRITE(MAGNEMITE, gMonFrontPic_Magnemite), -// SPECIES_SPRITE(MAGNETON, gMonFrontPic_Magneton), -// SPECIES_SPRITE(FARFETCHD, gMonFrontPic_Farfetchd), -// SPECIES_SPRITE(DODUO, gMonFrontPic_Doduo), -// SPECIES_SPRITE(DODRIO, gMonFrontPic_Dodrio), -// SPECIES_SPRITE(SEEL, gMonFrontPic_Seel), -// SPECIES_SPRITE(DEWGONG, gMonFrontPic_Dewgong), -// SPECIES_SPRITE(GRIMER, gMonFrontPic_Grimer), -// SPECIES_SPRITE(MUK, gMonFrontPic_Muk), -// SPECIES_SPRITE(SHELLDER, gMonFrontPic_Shellder), -// SPECIES_SPRITE(CLOYSTER, gMonFrontPic_Cloyster), -// SPECIES_SPRITE(GASTLY, gMonFrontPic_Gastly), -// SPECIES_SPRITE(HAUNTER, gMonFrontPic_Haunter), -// SPECIES_SPRITE(GENGAR, gMonFrontPic_Gengar), -// SPECIES_SPRITE(ONIX, gMonFrontPic_Onix), -// SPECIES_SPRITE(DROWZEE, gMonFrontPic_Drowzee), -// SPECIES_SPRITE(HYPNO, gMonFrontPic_Hypno), -// SPECIES_SPRITE(KRABBY, gMonFrontPic_Krabby), -// SPECIES_SPRITE(KINGLER, gMonFrontPic_Kingler), -// SPECIES_SPRITE(VOLTORB, gMonFrontPic_Voltorb), -// SPECIES_SPRITE(ELECTRODE, gMonFrontPic_Electrode), -// SPECIES_SPRITE(EXEGGCUTE, gMonFrontPic_Exeggcute), -// SPECIES_SPRITE(EXEGGUTOR, gMonFrontPic_Exeggutor), -// SPECIES_SPRITE(CUBONE, gMonFrontPic_Cubone), -// SPECIES_SPRITE(MAROWAK, gMonFrontPic_Marowak), -// SPECIES_SPRITE(HITMONLEE, gMonFrontPic_Hitmonlee), -// SPECIES_SPRITE(HITMONCHAN, gMonFrontPic_Hitmonchan), -// SPECIES_SPRITE(LICKITUNG, gMonFrontPic_Lickitung), -// SPECIES_SPRITE(KOFFING, gMonFrontPic_Koffing), -// SPECIES_SPRITE(WEEZING, gMonFrontPic_Weezing), -// SPECIES_SPRITE(RHYHORN, gMonFrontPic_Rhyhorn), -// SPECIES_SPRITE(RHYDON, gMonFrontPic_Rhydon), -// SPECIES_SPRITE(CHANSEY, gMonFrontPic_Chansey), -// SPECIES_SPRITE(TANGELA, gMonFrontPic_Tangela), -// SPECIES_SPRITE(KANGASKHAN, gMonFrontPic_Kangaskhan), -// SPECIES_SPRITE(HORSEA, gMonFrontPic_Horsea), -// SPECIES_SPRITE(SEADRA, gMonFrontPic_Seadra), -// SPECIES_SPRITE(GOLDEEN, gMonFrontPic_Goldeen), -// SPECIES_SPRITE(SEAKING, gMonFrontPic_Seaking), -// SPECIES_SPRITE(STARYU, gMonFrontPic_Staryu), -// SPECIES_SPRITE(STARMIE, gMonFrontPic_Starmie), -// SPECIES_SPRITE(MR_MIME, gMonFrontPic_Mrmime), -// SPECIES_SPRITE(SCYTHER, gMonFrontPic_Scyther), -// SPECIES_SPRITE(JYNX, gMonFrontPic_Jynx), -// SPECIES_SPRITE(ELECTABUZZ, gMonFrontPic_Electabuzz), -// SPECIES_SPRITE(MAGMAR, gMonFrontPic_Magmar), -// SPECIES_SPRITE(PINSIR, gMonFrontPic_Pinsir), -// SPECIES_SPRITE(TAUROS, gMonFrontPic_Tauros), -// SPECIES_SPRITE(MAGIKARP, gMonFrontPic_Magikarp), -// SPECIES_SPRITE(GYARADOS, gMonFrontPic_Gyarados), -// SPECIES_SPRITE(LAPRAS, gMonFrontPic_Lapras), -// SPECIES_SPRITE(DITTO, gMonFrontPic_Ditto), -// SPECIES_SPRITE(EEVEE, gMonFrontPic_Eevee), -// SPECIES_SPRITE(VAPOREON, gMonFrontPic_Vaporeon), -// SPECIES_SPRITE(JOLTEON, gMonFrontPic_Jolteon), -// SPECIES_SPRITE(FLAREON, gMonFrontPic_Flareon), -// SPECIES_SPRITE(PORYGON, gMonFrontPic_Porygon), -// SPECIES_SPRITE(OMANYTE, gMonFrontPic_Omanyte), -// SPECIES_SPRITE(OMASTAR, gMonFrontPic_Omastar), -// SPECIES_SPRITE(KABUTO, gMonFrontPic_Kabuto), -// SPECIES_SPRITE(KABUTOPS, gMonFrontPic_Kabutops), -// SPECIES_SPRITE(AERODACTYL, gMonFrontPic_Aerodactyl), -// SPECIES_SPRITE(SNORLAX, gMonFrontPic_Snorlax), -// SPECIES_SPRITE(ARTICUNO, gMonFrontPic_Articuno), -// SPECIES_SPRITE(ZAPDOS, gMonFrontPic_Zapdos), -// SPECIES_SPRITE(MOLTRES, gMonFrontPic_Moltres), -// SPECIES_SPRITE(DRATINI, gMonFrontPic_Dratini), -// SPECIES_SPRITE(DRAGONAIR, gMonFrontPic_Dragonair), -// SPECIES_SPRITE(DRAGONITE, gMonFrontPic_Dragonite), -// SPECIES_SPRITE(MEWTWO, gMonFrontPic_Mewtwo), -// SPECIES_SPRITE(MEW, gMonFrontPic_Mew), -// SPECIES_SPRITE(CHIKORITA, gMonFrontPic_Chikorita), -// SPECIES_SPRITE(BAYLEEF, gMonFrontPic_Bayleef), -// SPECIES_SPRITE(MEGANIUM, gMonFrontPic_Meganium), -// SPECIES_SPRITE(CYNDAQUIL, gMonFrontPic_Cyndaquil), -// SPECIES_SPRITE(QUILAVA, gMonFrontPic_Quilava), -// SPECIES_SPRITE(TYPHLOSION, gMonFrontPic_Typhlosion), -// SPECIES_SPRITE(TOTODILE, gMonFrontPic_Totodile), -// SPECIES_SPRITE(CROCONAW, gMonFrontPic_Croconaw), -// SPECIES_SPRITE(FERALIGATR, gMonFrontPic_Feraligatr), -// SPECIES_SPRITE(SENTRET, gMonFrontPic_Sentret), -// SPECIES_SPRITE(FURRET, gMonFrontPic_Furret), -// SPECIES_SPRITE(HOOTHOOT, gMonFrontPic_Hoothoot), -// SPECIES_SPRITE(NOCTOWL, gMonFrontPic_Noctowl), -// SPECIES_SPRITE(LEDYBA, gMonFrontPic_Ledyba), -// SPECIES_SPRITE(LEDIAN, gMonFrontPic_Ledian), -// SPECIES_SPRITE(SPINARAK, gMonFrontPic_Spinarak), -// SPECIES_SPRITE(ARIADOS, gMonFrontPic_Ariados), -// SPECIES_SPRITE(CROBAT, gMonFrontPic_Crobat), -// SPECIES_SPRITE(CHINCHOU, gMonFrontPic_Chinchou), -// SPECIES_SPRITE(LANTURN, gMonFrontPic_Lanturn), -// SPECIES_SPRITE(PICHU, gMonFrontPic_Pichu), -// SPECIES_SPRITE(CLEFFA, gMonFrontPic_Cleffa), -// SPECIES_SPRITE(IGGLYBUFF, gMonFrontPic_Igglybuff), -// SPECIES_SPRITE(TOGEPI, gMonFrontPic_Togepi), -// SPECIES_SPRITE(TOGETIC, gMonFrontPic_Togetic), -// SPECIES_SPRITE(NATU, gMonFrontPic_Natu), -// SPECIES_SPRITE(XATU, gMonFrontPic_Xatu), -// SPECIES_SPRITE(MAREEP, gMonFrontPic_Mareep), -// SPECIES_SPRITE(FLAAFFY, gMonFrontPic_Flaaffy), -// SPECIES_SPRITE(AMPHAROS, gMonFrontPic_Ampharos), -// SPECIES_SPRITE(BELLOSSOM, gMonFrontPic_Bellossom), -// SPECIES_SPRITE(MARILL, gMonFrontPic_Marill), -// SPECIES_SPRITE(AZUMARILL, gMonFrontPic_Azumarill), -// SPECIES_SPRITE(SUDOWOODO, gMonFrontPic_Sudowoodo), -// SPECIES_SPRITE(POLITOED, gMonFrontPic_Politoed), -// SPECIES_SPRITE(HOPPIP, gMonFrontPic_Hoppip), -// SPECIES_SPRITE(SKIPLOOM, gMonFrontPic_Skiploom), -// SPECIES_SPRITE(JUMPLUFF, gMonFrontPic_Jumpluff), -// SPECIES_SPRITE(AIPOM, gMonFrontPic_Aipom), -// SPECIES_SPRITE(SUNKERN, gMonFrontPic_Sunkern), -// SPECIES_SPRITE(SUNFLORA, gMonFrontPic_Sunflora), -// SPECIES_SPRITE(YANMA, gMonFrontPic_Yanma), -// SPECIES_SPRITE(WOOPER, gMonFrontPic_Wooper), -// SPECIES_SPRITE(QUAGSIRE, gMonFrontPic_Quagsire), -// SPECIES_SPRITE(ESPEON, gMonFrontPic_Espeon), -// SPECIES_SPRITE(UMBREON, gMonFrontPic_Umbreon), -// SPECIES_SPRITE(MURKROW, gMonFrontPic_Murkrow), -// SPECIES_SPRITE(SLOWKING, gMonFrontPic_Slowking), -// SPECIES_SPRITE(MISDREAVUS, gMonFrontPic_Misdreavus), -// SPECIES_SPRITE(UNOWN, gMonFrontPic_UnownA), -// SPECIES_SPRITE(WOBBUFFET, gMonFrontPic_Wobbuffet), -// SPECIES_SPRITE(GIRAFARIG, gMonFrontPic_Girafarig), -// SPECIES_SPRITE(PINECO, gMonFrontPic_Pineco), -// SPECIES_SPRITE(FORRETRESS, gMonFrontPic_Forretress), -// SPECIES_SPRITE(DUNSPARCE, gMonFrontPic_Dunsparce), -// SPECIES_SPRITE(GLIGAR, gMonFrontPic_Gligar), -// SPECIES_SPRITE(STEELIX, gMonFrontPic_Steelix), -// SPECIES_SPRITE(SNUBBULL, gMonFrontPic_Snubbull), -// SPECIES_SPRITE(GRANBULL, gMonFrontPic_Granbull), -// SPECIES_SPRITE(QWILFISH, gMonFrontPic_Qwilfish), -// SPECIES_SPRITE(SCIZOR, gMonFrontPic_Scizor), -// SPECIES_SPRITE(SHUCKLE, gMonFrontPic_Shuckle), -// SPECIES_SPRITE(HERACROSS, gMonFrontPic_Heracross), -// SPECIES_SPRITE(SNEASEL, gMonFrontPic_Sneasel), -// SPECIES_SPRITE(TEDDIURSA, gMonFrontPic_Teddiursa), -// SPECIES_SPRITE(URSARING, gMonFrontPic_Ursaring), -// SPECIES_SPRITE(SLUGMA, gMonFrontPic_Slugma), -// SPECIES_SPRITE(MAGCARGO, gMonFrontPic_Magcargo), -// SPECIES_SPRITE(SWINUB, gMonFrontPic_Swinub), -// SPECIES_SPRITE(PILOSWINE, gMonFrontPic_Piloswine), -// SPECIES_SPRITE(CORSOLA, gMonFrontPic_Corsola), -// SPECIES_SPRITE(REMORAID, gMonFrontPic_Remoraid), -// SPECIES_SPRITE(OCTILLERY, gMonFrontPic_Octillery), -// SPECIES_SPRITE(DELIBIRD, gMonFrontPic_Delibird), -// SPECIES_SPRITE(MANTINE, gMonFrontPic_Mantine), -// SPECIES_SPRITE(SKARMORY, gMonFrontPic_Skarmory), -// SPECIES_SPRITE(HOUNDOUR, gMonFrontPic_Houndour), -// SPECIES_SPRITE(HOUNDOOM, gMonFrontPic_Houndoom), -// SPECIES_SPRITE(KINGDRA, gMonFrontPic_Kingdra), -// SPECIES_SPRITE(PHANPY, gMonFrontPic_Phanpy), -// SPECIES_SPRITE(DONPHAN, gMonFrontPic_Donphan), -// SPECIES_SPRITE(PORYGON2, gMonFrontPic_Porygon2), -// SPECIES_SPRITE(STANTLER, gMonFrontPic_Stantler), -// SPECIES_SPRITE(SMEARGLE, gMonFrontPic_Smeargle), -// SPECIES_SPRITE(TYROGUE, gMonFrontPic_Tyrogue), -// SPECIES_SPRITE(HITMONTOP, gMonFrontPic_Hitmontop), -// SPECIES_SPRITE(SMOOCHUM, gMonFrontPic_Smoochum), -// SPECIES_SPRITE(ELEKID, gMonFrontPic_Elekid), -// SPECIES_SPRITE(MAGBY, gMonFrontPic_Magby), -// SPECIES_SPRITE(MILTANK, gMonFrontPic_Miltank), -// SPECIES_SPRITE(BLISSEY, gMonFrontPic_Blissey), -// SPECIES_SPRITE(RAIKOU, gMonFrontPic_Raikou), -// SPECIES_SPRITE(ENTEI, gMonFrontPic_Entei), -// SPECIES_SPRITE(SUICUNE, gMonFrontPic_Suicune), -// SPECIES_SPRITE(LARVITAR, gMonFrontPic_Larvitar), -// SPECIES_SPRITE(PUPITAR, gMonFrontPic_Pupitar), -// SPECIES_SPRITE(TYRANITAR, gMonFrontPic_Tyranitar), -// SPECIES_SPRITE(LUGIA, gMonFrontPic_Lugia), -// SPECIES_SPRITE(HO_OH, gMonFrontPic_HoOh), -// SPECIES_SPRITE(CELEBI, gMonFrontPic_Celebi), -// SPECIES_SPRITE(OLD_UNOWN_B, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_C, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_D, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_E, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_F, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_G, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_H, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_I, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_J, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_K, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_L, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_M, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_N, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_O, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_P, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_Q, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_R, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_S, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_T, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_U, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_V, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_W, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_X, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_Y, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(OLD_UNOWN_Z, gMonFrontPic_DoubleQuestionMark), -// SPECIES_SPRITE(TREECKO, gMonFrontPic_Treecko), -// SPECIES_SPRITE(GROVYLE, gMonFrontPic_Grovyle), -// SPECIES_SPRITE(SCEPTILE, gMonFrontPic_Sceptile), -// SPECIES_SPRITE(TORCHIC, gMonFrontPic_Torchic), -// SPECIES_SPRITE(COMBUSKEN, gMonFrontPic_Combusken), -// SPECIES_SPRITE(BLAZIKEN, gMonFrontPic_Blaziken), -// SPECIES_SPRITE(MUDKIP, gMonFrontPic_Mudkip), -// SPECIES_SPRITE(MARSHTOMP, gMonFrontPic_Marshtomp), -// SPECIES_SPRITE(SWAMPERT, gMonFrontPic_Swampert), -// SPECIES_SPRITE(POOCHYENA, gMonFrontPic_Poochyena), -// SPECIES_SPRITE(MIGHTYENA, gMonFrontPic_Mightyena), -// SPECIES_SPRITE(ZIGZAGOON, gMonFrontPic_Zigzagoon), -// SPECIES_SPRITE(LINOONE, gMonFrontPic_Linoone), -// SPECIES_SPRITE(WURMPLE, gMonFrontPic_Wurmple), -// SPECIES_SPRITE(SILCOON, gMonFrontPic_Silcoon), -// SPECIES_SPRITE(BEAUTIFLY, gMonFrontPic_Beautifly), -// SPECIES_SPRITE(CASCOON, gMonFrontPic_Cascoon), -// SPECIES_SPRITE(DUSTOX, gMonFrontPic_Dustox), -// SPECIES_SPRITE(LOTAD, gMonFrontPic_Lotad), -// SPECIES_SPRITE(LOMBRE, gMonFrontPic_Lombre), -// SPECIES_SPRITE(LUDICOLO, gMonFrontPic_Ludicolo), -// SPECIES_SPRITE(SEEDOT, gMonFrontPic_Seedot), -// SPECIES_SPRITE(NUZLEAF, gMonFrontPic_Nuzleaf), -// SPECIES_SPRITE(SHIFTRY, gMonFrontPic_Shiftry), -// SPECIES_SPRITE(NINCADA, gMonFrontPic_Nincada), -// SPECIES_SPRITE(NINJASK, gMonFrontPic_Ninjask), -// SPECIES_SPRITE(SHEDINJA, gMonFrontPic_Shedinja), -// SPECIES_SPRITE(TAILLOW, gMonFrontPic_Taillow), -// SPECIES_SPRITE(SWELLOW, gMonFrontPic_Swellow), -// SPECIES_SPRITE(SHROOMISH, gMonFrontPic_Shroomish), -// SPECIES_SPRITE(BRELOOM, gMonFrontPic_Breloom), -// SPECIES_SPRITE(SPINDA, gMonFrontPic_Spinda), -// SPECIES_SPRITE(WINGULL, gMonFrontPic_Wingull), -// SPECIES_SPRITE(PELIPPER, gMonFrontPic_Pelipper), -// SPECIES_SPRITE(SURSKIT, gMonFrontPic_Surskit), -// SPECIES_SPRITE(MASQUERAIN, gMonFrontPic_Masquerain), -// SPECIES_SPRITE(WAILMER, gMonFrontPic_Wailmer), -// SPECIES_SPRITE(WAILORD, gMonFrontPic_Wailord), -// SPECIES_SPRITE(SKITTY, gMonFrontPic_Skitty), -// SPECIES_SPRITE(DELCATTY, gMonFrontPic_Delcatty), -// SPECIES_SPRITE(KECLEON, gMonFrontPic_Kecleon), -// SPECIES_SPRITE(BALTOY, gMonFrontPic_Baltoy), -// SPECIES_SPRITE(CLAYDOL, gMonFrontPic_Claydol), -// SPECIES_SPRITE(NOSEPASS, gMonFrontPic_Nosepass), -// SPECIES_SPRITE(TORKOAL, gMonFrontPic_Torkoal), -// SPECIES_SPRITE(SABLEYE, gMonFrontPic_Sableye), -// SPECIES_SPRITE(BARBOACH, gMonFrontPic_Barboach), -// SPECIES_SPRITE(WHISCASH, gMonFrontPic_Whiscash), -// SPECIES_SPRITE(LUVDISC, gMonFrontPic_Luvdisc), -// SPECIES_SPRITE(CORPHISH, gMonFrontPic_Corphish), -// SPECIES_SPRITE(CRAWDAUNT, gMonFrontPic_Crawdaunt), -// SPECIES_SPRITE(FEEBAS, gMonFrontPic_Feebas), -// SPECIES_SPRITE(MILOTIC, gMonFrontPic_Milotic), -// SPECIES_SPRITE(CARVANHA, gMonFrontPic_Carvanha), -// SPECIES_SPRITE(SHARPEDO, gMonFrontPic_Sharpedo), -// SPECIES_SPRITE(TRAPINCH, gMonFrontPic_Trapinch), -// SPECIES_SPRITE(VIBRAVA, gMonFrontPic_Vibrava), -// SPECIES_SPRITE(FLYGON, gMonFrontPic_Flygon), -// SPECIES_SPRITE(MAKUHITA, gMonFrontPic_Makuhita), -// SPECIES_SPRITE(HARIYAMA, gMonFrontPic_Hariyama), -// SPECIES_SPRITE(ELECTRIKE, gMonFrontPic_Electrike), -// SPECIES_SPRITE(MANECTRIC, gMonFrontPic_Manectric), -// SPECIES_SPRITE(NUMEL, gMonFrontPic_Numel), -// SPECIES_SPRITE(CAMERUPT, gMonFrontPic_Camerupt), -// SPECIES_SPRITE(SPHEAL, gMonFrontPic_Spheal), -// SPECIES_SPRITE(SEALEO, gMonFrontPic_Sealeo), -// SPECIES_SPRITE(WALREIN, gMonFrontPic_Walrein), -// SPECIES_SPRITE(CACNEA, gMonFrontPic_Cacnea), -// SPECIES_SPRITE(CACTURNE, gMonFrontPic_Cacturne), -// SPECIES_SPRITE(SNORUNT, gMonFrontPic_Snorunt), -// SPECIES_SPRITE(GLALIE, gMonFrontPic_Glalie), -// SPECIES_SPRITE(LUNATONE, gMonFrontPic_Lunatone), -// SPECIES_SPRITE(SOLROCK, gMonFrontPic_Solrock), -// SPECIES_SPRITE(AZURILL, gMonFrontPic_Azurill), -// SPECIES_SPRITE(SPOINK, gMonFrontPic_Spoink), -// SPECIES_SPRITE(GRUMPIG, gMonFrontPic_Grumpig), -// SPECIES_SPRITE(PLUSLE, gMonFrontPic_Plusle), -// SPECIES_SPRITE(MINUN, gMonFrontPic_Minun), -// SPECIES_SPRITE(MAWILE, gMonFrontPic_Mawile), -// SPECIES_SPRITE(MEDITITE, gMonFrontPic_Meditite), -// SPECIES_SPRITE(MEDICHAM, gMonFrontPic_Medicham), -// SPECIES_SPRITE(SWABLU, gMonFrontPic_Swablu), -// SPECIES_SPRITE(ALTARIA, gMonFrontPic_Altaria), -// SPECIES_SPRITE(WYNAUT, gMonFrontPic_Wynaut), -// SPECIES_SPRITE(DUSKULL, gMonFrontPic_Duskull), -// SPECIES_SPRITE(DUSCLOPS, gMonFrontPic_Dusclops), -// SPECIES_SPRITE(ROSELIA, gMonFrontPic_Roselia), -// SPECIES_SPRITE(SLAKOTH, gMonFrontPic_Slakoth), -// SPECIES_SPRITE(VIGOROTH, gMonFrontPic_Vigoroth), -// SPECIES_SPRITE(SLAKING, gMonFrontPic_Slaking), -// SPECIES_SPRITE(GULPIN, gMonFrontPic_Gulpin), -// SPECIES_SPRITE(SWALOT, gMonFrontPic_Swalot), -// SPECIES_SPRITE(TROPIUS, gMonFrontPic_Tropius), -// SPECIES_SPRITE(WHISMUR, gMonFrontPic_Whismur), -// SPECIES_SPRITE(LOUDRED, gMonFrontPic_Loudred), -// SPECIES_SPRITE(EXPLOUD, gMonFrontPic_Exploud), -// SPECIES_SPRITE(CLAMPERL, gMonFrontPic_Clamperl), -// SPECIES_SPRITE(HUNTAIL, gMonFrontPic_Huntail), -// SPECIES_SPRITE(GOREBYSS, gMonFrontPic_Gorebyss), -// SPECIES_SPRITE(ABSOL, gMonFrontPic_Absol), -// SPECIES_SPRITE(SHUPPET, gMonFrontPic_Shuppet), -// SPECIES_SPRITE(BANETTE, gMonFrontPic_Banette), -// SPECIES_SPRITE(SEVIPER, gMonFrontPic_Seviper), -// SPECIES_SPRITE(ZANGOOSE, gMonFrontPic_Zangoose), -// SPECIES_SPRITE(RELICANTH, gMonFrontPic_Relicanth), -// SPECIES_SPRITE(ARON, gMonFrontPic_Aron), -// SPECIES_SPRITE(LAIRON, gMonFrontPic_Lairon), -// SPECIES_SPRITE(AGGRON, gMonFrontPic_Aggron), -// SPECIES_SPRITE(CASTFORM, gMonFrontPic_Castform), -// SPECIES_SPRITE(VOLBEAT, gMonFrontPic_Volbeat), -// SPECIES_SPRITE(ILLUMISE, gMonFrontPic_Illumise), -// SPECIES_SPRITE(LILEEP, gMonFrontPic_Lileep), -// SPECIES_SPRITE(CRADILY, gMonFrontPic_Cradily), -// SPECIES_SPRITE(ANORITH, gMonFrontPic_Anorith), -// SPECIES_SPRITE(ARMALDO, gMonFrontPic_Armaldo), -// SPECIES_SPRITE(RALTS, gMonFrontPic_Ralts), -// SPECIES_SPRITE(KIRLIA, gMonFrontPic_Kirlia), -// SPECIES_SPRITE(GARDEVOIR, gMonFrontPic_Gardevoir), -// SPECIES_SPRITE(BAGON, gMonFrontPic_Bagon), -// SPECIES_SPRITE(SHELGON, gMonFrontPic_Shelgon), -// SPECIES_SPRITE(SALAMENCE, gMonFrontPic_Salamence), -// SPECIES_SPRITE(BELDUM, gMonFrontPic_Beldum), -// SPECIES_SPRITE(METANG, gMonFrontPic_Metang), -// SPECIES_SPRITE(METAGROSS, gMonFrontPic_Metagross), -// SPECIES_SPRITE(REGIROCK, gMonFrontPic_Regirock), -// SPECIES_SPRITE(REGICE, gMonFrontPic_Regice), -// SPECIES_SPRITE(REGISTEEL, gMonFrontPic_Registeel), -// SPECIES_SPRITE(KYOGRE, gMonFrontPic_Kyogre), -// SPECIES_SPRITE(GROUDON, gMonFrontPic_Groudon), -// SPECIES_SPRITE(RAYQUAZA, gMonFrontPic_Rayquaza), -// SPECIES_SPRITE(LATIAS, gMonFrontPic_Latias), -// SPECIES_SPRITE(LATIOS, gMonFrontPic_Latios), -// SPECIES_SPRITE(JIRACHI, gMonFrontPic_Jirachi), -// SPECIES_SPRITE(DEOXYS, gMonFrontPic_Deoxys), -// SPECIES_SPRITE(CHIMECHO, gMonFrontPic_Chimecho), -// SPECIES_SPRITE(EGG, gMonFrontPic_Egg), -// SPECIES_SPRITE(UNOWN_B, gMonFrontPic_UnownB), -// SPECIES_SPRITE(UNOWN_C, gMonFrontPic_UnownC), -// SPECIES_SPRITE(UNOWN_D, gMonFrontPic_UnownD), -// SPECIES_SPRITE(UNOWN_E, gMonFrontPic_UnownE), -// SPECIES_SPRITE(UNOWN_F, gMonFrontPic_UnownF), -// SPECIES_SPRITE(UNOWN_G, gMonFrontPic_UnownG), -// SPECIES_SPRITE(UNOWN_H, gMonFrontPic_UnownH), -// SPECIES_SPRITE(UNOWN_I, gMonFrontPic_UnownI), -// SPECIES_SPRITE(UNOWN_J, gMonFrontPic_UnownJ), -// SPECIES_SPRITE(UNOWN_K, gMonFrontPic_UnownK), -// SPECIES_SPRITE(UNOWN_L, gMonFrontPic_UnownL), -// SPECIES_SPRITE(UNOWN_M, gMonFrontPic_UnownM), -// SPECIES_SPRITE(UNOWN_N, gMonFrontPic_UnownN), -// SPECIES_SPRITE(UNOWN_O, gMonFrontPic_UnownO), -// SPECIES_SPRITE(UNOWN_P, gMonFrontPic_UnownP), -// SPECIES_SPRITE(UNOWN_Q, gMonFrontPic_UnownQ), -// SPECIES_SPRITE(UNOWN_R, gMonFrontPic_UnownR), -// SPECIES_SPRITE(UNOWN_S, gMonFrontPic_UnownS), -// SPECIES_SPRITE(UNOWN_T, gMonFrontPic_UnownT), -// SPECIES_SPRITE(UNOWN_U, gMonFrontPic_UnownU), -// SPECIES_SPRITE(UNOWN_V, gMonFrontPic_UnownV), -// SPECIES_SPRITE(UNOWN_W, gMonFrontPic_UnownW), -// SPECIES_SPRITE(UNOWN_X, gMonFrontPic_UnownX), -// SPECIES_SPRITE(UNOWN_Y, gMonFrontPic_UnownY), -// SPECIES_SPRITE(UNOWN_Z, gMonFrontPic_UnownZ), -// SPECIES_SPRITE(UNOWN_EMARK, gMonFrontPic_UnownExclamationMark), -// SPECIES_SPRITE(UNOWN_QMARK, gMonFrontPic_UnownQuestionMark), -// }; diff --git a/src/data/pokemon_graphics/palette_table.h b/src/data/pokemon_graphics/palette_table.h deleted file mode 100644 index 01375bf25..000000000 --- a/src/data/pokemon_graphics/palette_table.h +++ /dev/null @@ -1,443 +0,0 @@ -// const struct CompressedSpritePalette gMonPaletteTable[] = -// { -// SPECIES_PAL(NONE, gMonPalette_CircledQuestionMark), -// SPECIES_PAL(BULBASAUR, gMonPalette_Bulbasaur), -// SPECIES_PAL(IVYSAUR, gMonPalette_Ivysaur), -// SPECIES_PAL(VENUSAUR, gMonPalette_Venusaur), -// SPECIES_PAL(CHARMANDER, gMonPalette_Charmander), -// SPECIES_PAL(CHARMELEON, gMonPalette_Charmeleon), -// SPECIES_PAL(CHARIZARD, gMonPalette_Charizard), -// SPECIES_PAL(SQUIRTLE, gMonPalette_Squirtle), -// SPECIES_PAL(WARTORTLE, gMonPalette_Wartortle), -// SPECIES_PAL(BLASTOISE, gMonPalette_Blastoise), -// SPECIES_PAL(CATERPIE, gMonPalette_Caterpie), -// SPECIES_PAL(METAPOD, gMonPalette_Metapod), -// SPECIES_PAL(BUTTERFREE, gMonPalette_Butterfree), -// SPECIES_PAL(WEEDLE, gMonPalette_Weedle), -// SPECIES_PAL(KAKUNA, gMonPalette_Kakuna), -// SPECIES_PAL(BEEDRILL, gMonPalette_Beedrill), -// SPECIES_PAL(PIDGEY, gMonPalette_Pidgey), -// SPECIES_PAL(PIDGEOTTO, gMonPalette_Pidgeotto), -// SPECIES_PAL(PIDGEOT, gMonPalette_Pidgeot), -// SPECIES_PAL(RATTATA, gMonPalette_Rattata), -// SPECIES_PAL(RATICATE, gMonPalette_Raticate), -// SPECIES_PAL(SPEAROW, gMonPalette_Spearow), -// SPECIES_PAL(FEAROW, gMonPalette_Fearow), -// SPECIES_PAL(EKANS, gMonPalette_Ekans), -// SPECIES_PAL(ARBOK, gMonPalette_Arbok), -// SPECIES_PAL(PIKACHU, gMonPalette_Pikachu), -// SPECIES_PAL(RAICHU, gMonPalette_Raichu), -// SPECIES_PAL(SANDSHREW, gMonPalette_Sandshrew), -// SPECIES_PAL(SANDSLASH, gMonPalette_Sandslash), -// SPECIES_PAL(NIDORAN_F, gMonPalette_NidoranF), -// SPECIES_PAL(NIDORINA, gMonPalette_Nidorina), -// SPECIES_PAL(NIDOQUEEN, gMonPalette_Nidoqueen), -// SPECIES_PAL(NIDORAN_M, gMonPalette_NidoranM), -// SPECIES_PAL(NIDORINO, gMonPalette_Nidorino), -// SPECIES_PAL(NIDOKING, gMonPalette_Nidoking), -// SPECIES_PAL(CLEFAIRY, gMonPalette_Clefairy), -// SPECIES_PAL(CLEFABLE, gMonPalette_Clefable), -// SPECIES_PAL(VULPIX, gMonPalette_Vulpix), -// SPECIES_PAL(NINETALES, gMonPalette_Ninetales), -// SPECIES_PAL(JIGGLYPUFF, gMonPalette_Jigglypuff), -// SPECIES_PAL(WIGGLYTUFF, gMonPalette_Wigglytuff), -// SPECIES_PAL(ZUBAT, gMonPalette_Zubat), -// SPECIES_PAL(GOLBAT, gMonPalette_Golbat), -// SPECIES_PAL(ODDISH, gMonPalette_Oddish), -// SPECIES_PAL(GLOOM, gMonPalette_Gloom), -// SPECIES_PAL(VILEPLUME, gMonPalette_Vileplume), -// SPECIES_PAL(PARAS, gMonPalette_Paras), -// SPECIES_PAL(PARASECT, gMonPalette_Parasect), -// SPECIES_PAL(VENONAT, gMonPalette_Venonat), -// SPECIES_PAL(VENOMOTH, gMonPalette_Venomoth), -// SPECIES_PAL(DIGLETT, gMonPalette_Diglett), -// SPECIES_PAL(DUGTRIO, gMonPalette_Dugtrio), -// SPECIES_PAL(MEOWTH, gMonPalette_Meowth), -// SPECIES_PAL(PERSIAN, gMonPalette_Persian), -// SPECIES_PAL(PSYDUCK, gMonPalette_Psyduck), -// SPECIES_PAL(GOLDUCK, gMonPalette_Golduck), -// SPECIES_PAL(MANKEY, gMonPalette_Mankey), -// SPECIES_PAL(PRIMEAPE, gMonPalette_Primeape), -// SPECIES_PAL(GROWLITHE, gMonPalette_Growlithe), -// SPECIES_PAL(ARCANINE, gMonPalette_Arcanine), -// SPECIES_PAL(POLIWAG, gMonPalette_Poliwag), -// SPECIES_PAL(POLIWHIRL, gMonPalette_Poliwhirl), -// SPECIES_PAL(POLIWRATH, gMonPalette_Poliwrath), -// SPECIES_PAL(ABRA, gMonPalette_Abra), -// SPECIES_PAL(KADABRA, gMonPalette_Kadabra), -// SPECIES_PAL(ALAKAZAM, gMonPalette_Alakazam), -// SPECIES_PAL(MACHOP, gMonPalette_Machop), -// SPECIES_PAL(MACHOKE, gMonPalette_Machoke), -// SPECIES_PAL(MACHAMP, gMonPalette_Machamp), -// SPECIES_PAL(BELLSPROUT, gMonPalette_Bellsprout), -// SPECIES_PAL(WEEPINBELL, gMonPalette_Weepinbell), -// SPECIES_PAL(VICTREEBEL, gMonPalette_Victreebel), -// SPECIES_PAL(TENTACOOL, gMonPalette_Tentacool), -// SPECIES_PAL(TENTACRUEL, gMonPalette_Tentacruel), -// SPECIES_PAL(GEODUDE, gMonPalette_Geodude), -// SPECIES_PAL(GRAVELER, gMonPalette_Graveler), -// SPECIES_PAL(GOLEM, gMonPalette_Golem), -// SPECIES_PAL(PONYTA, gMonPalette_Ponyta), -// SPECIES_PAL(RAPIDASH, gMonPalette_Rapidash), -// SPECIES_PAL(SLOWPOKE, gMonPalette_Slowpoke), -// SPECIES_PAL(SLOWBRO, gMonPalette_Slowbro), -// SPECIES_PAL(MAGNEMITE, gMonPalette_Magnemite), -// SPECIES_PAL(MAGNETON, gMonPalette_Magneton), -// SPECIES_PAL(FARFETCHD, gMonPalette_Farfetchd), -// SPECIES_PAL(DODUO, gMonPalette_Doduo), -// SPECIES_PAL(DODRIO, gMonPalette_Dodrio), -// SPECIES_PAL(SEEL, gMonPalette_Seel), -// SPECIES_PAL(DEWGONG, gMonPalette_Dewgong), -// SPECIES_PAL(GRIMER, gMonPalette_Grimer), -// SPECIES_PAL(MUK, gMonPalette_Muk), -// SPECIES_PAL(SHELLDER, gMonPalette_Shellder), -// SPECIES_PAL(CLOYSTER, gMonPalette_Cloyster), -// SPECIES_PAL(GASTLY, gMonPalette_Gastly), -// SPECIES_PAL(HAUNTER, gMonPalette_Haunter), -// SPECIES_PAL(GENGAR, gMonPalette_Gengar), -// SPECIES_PAL(ONIX, gMonPalette_Onix), -// SPECIES_PAL(DROWZEE, gMonPalette_Drowzee), -// SPECIES_PAL(HYPNO, gMonPalette_Hypno), -// SPECIES_PAL(KRABBY, gMonPalette_Krabby), -// SPECIES_PAL(KINGLER, gMonPalette_Kingler), -// SPECIES_PAL(VOLTORB, gMonPalette_Voltorb), -// SPECIES_PAL(ELECTRODE, gMonPalette_Electrode), -// SPECIES_PAL(EXEGGCUTE, gMonPalette_Exeggcute), -// SPECIES_PAL(EXEGGUTOR, gMonPalette_Exeggutor), -// SPECIES_PAL(CUBONE, gMonPalette_Cubone), -// SPECIES_PAL(MAROWAK, gMonPalette_Marowak), -// SPECIES_PAL(HITMONLEE, gMonPalette_Hitmonlee), -// SPECIES_PAL(HITMONCHAN, gMonPalette_Hitmonchan), -// SPECIES_PAL(LICKITUNG, gMonPalette_Lickitung), -// SPECIES_PAL(KOFFING, gMonPalette_Koffing), -// SPECIES_PAL(WEEZING, gMonPalette_Weezing), -// SPECIES_PAL(RHYHORN, gMonPalette_Rhyhorn), -// SPECIES_PAL(RHYDON, gMonPalette_Rhydon), -// SPECIES_PAL(CHANSEY, gMonPalette_Chansey), -// SPECIES_PAL(TANGELA, gMonPalette_Tangela), -// SPECIES_PAL(KANGASKHAN, gMonPalette_Kangaskhan), -// SPECIES_PAL(HORSEA, gMonPalette_Horsea), -// SPECIES_PAL(SEADRA, gMonPalette_Seadra), -// SPECIES_PAL(GOLDEEN, gMonPalette_Goldeen), -// SPECIES_PAL(SEAKING, gMonPalette_Seaking), -// SPECIES_PAL(STARYU, gMonPalette_Staryu), -// SPECIES_PAL(STARMIE, gMonPalette_Starmie), -// SPECIES_PAL(MR_MIME, gMonPalette_Mrmime), -// SPECIES_PAL(SCYTHER, gMonPalette_Scyther), -// SPECIES_PAL(JYNX, gMonPalette_Jynx), -// SPECIES_PAL(ELECTABUZZ, gMonPalette_Electabuzz), -// SPECIES_PAL(MAGMAR, gMonPalette_Magmar), -// SPECIES_PAL(PINSIR, gMonPalette_Pinsir), -// SPECIES_PAL(TAUROS, gMonPalette_Tauros), -// SPECIES_PAL(MAGIKARP, gMonPalette_Magikarp), -// SPECIES_PAL(GYARADOS, gMonPalette_Gyarados), -// SPECIES_PAL(LAPRAS, gMonPalette_Lapras), -// SPECIES_PAL(DITTO, gMonPalette_Ditto), -// SPECIES_PAL(EEVEE, gMonPalette_Eevee), -// SPECIES_PAL(VAPOREON, gMonPalette_Vaporeon), -// SPECIES_PAL(JOLTEON, gMonPalette_Jolteon), -// SPECIES_PAL(FLAREON, gMonPalette_Flareon), -// SPECIES_PAL(PORYGON, gMonPalette_Porygon), -// SPECIES_PAL(OMANYTE, gMonPalette_Omanyte), -// SPECIES_PAL(OMASTAR, gMonPalette_Omastar), -// SPECIES_PAL(KABUTO, gMonPalette_Kabuto), -// SPECIES_PAL(KABUTOPS, gMonPalette_Kabutops), -// SPECIES_PAL(AERODACTYL, gMonPalette_Aerodactyl), -// SPECIES_PAL(SNORLAX, gMonPalette_Snorlax), -// SPECIES_PAL(ARTICUNO, gMonPalette_Articuno), -// SPECIES_PAL(ZAPDOS, gMonPalette_Zapdos), -// SPECIES_PAL(MOLTRES, gMonPalette_Moltres), -// SPECIES_PAL(DRATINI, gMonPalette_Dratini), -// SPECIES_PAL(DRAGONAIR, gMonPalette_Dragonair), -// SPECIES_PAL(DRAGONITE, gMonPalette_Dragonite), -// SPECIES_PAL(MEWTWO, gMonPalette_Mewtwo), -// SPECIES_PAL(MEW, gMonPalette_Mew), -// SPECIES_PAL(CHIKORITA, gMonPalette_Chikorita), -// SPECIES_PAL(BAYLEEF, gMonPalette_Bayleef), -// SPECIES_PAL(MEGANIUM, gMonPalette_Meganium), -// SPECIES_PAL(CYNDAQUIL, gMonPalette_Cyndaquil), -// SPECIES_PAL(QUILAVA, gMonPalette_Quilava), -// SPECIES_PAL(TYPHLOSION, gMonPalette_Typhlosion), -// SPECIES_PAL(TOTODILE, gMonPalette_Totodile), -// SPECIES_PAL(CROCONAW, gMonPalette_Croconaw), -// SPECIES_PAL(FERALIGATR, gMonPalette_Feraligatr), -// SPECIES_PAL(SENTRET, gMonPalette_Sentret), -// SPECIES_PAL(FURRET, gMonPalette_Furret), -// SPECIES_PAL(HOOTHOOT, gMonPalette_Hoothoot), -// SPECIES_PAL(NOCTOWL, gMonPalette_Noctowl), -// SPECIES_PAL(LEDYBA, gMonPalette_Ledyba), -// SPECIES_PAL(LEDIAN, gMonPalette_Ledian), -// SPECIES_PAL(SPINARAK, gMonPalette_Spinarak), -// SPECIES_PAL(ARIADOS, gMonPalette_Ariados), -// SPECIES_PAL(CROBAT, gMonPalette_Crobat), -// SPECIES_PAL(CHINCHOU, gMonPalette_Chinchou), -// SPECIES_PAL(LANTURN, gMonPalette_Lanturn), -// SPECIES_PAL(PICHU, gMonPalette_Pichu), -// SPECIES_PAL(CLEFFA, gMonPalette_Cleffa), -// SPECIES_PAL(IGGLYBUFF, gMonPalette_Igglybuff), -// SPECIES_PAL(TOGEPI, gMonPalette_Togepi), -// SPECIES_PAL(TOGETIC, gMonPalette_Togetic), -// SPECIES_PAL(NATU, gMonPalette_Natu), -// SPECIES_PAL(XATU, gMonPalette_Xatu), -// SPECIES_PAL(MAREEP, gMonPalette_Mareep), -// SPECIES_PAL(FLAAFFY, gMonPalette_Flaaffy), -// SPECIES_PAL(AMPHAROS, gMonPalette_Ampharos), -// SPECIES_PAL(BELLOSSOM, gMonPalette_Bellossom), -// SPECIES_PAL(MARILL, gMonPalette_Marill), -// SPECIES_PAL(AZUMARILL, gMonPalette_Azumarill), -// SPECIES_PAL(SUDOWOODO, gMonPalette_Sudowoodo), -// SPECIES_PAL(POLITOED, gMonPalette_Politoed), -// SPECIES_PAL(HOPPIP, gMonPalette_Hoppip), -// SPECIES_PAL(SKIPLOOM, gMonPalette_Skiploom), -// SPECIES_PAL(JUMPLUFF, gMonPalette_Jumpluff), -// SPECIES_PAL(AIPOM, gMonPalette_Aipom), -// SPECIES_PAL(SUNKERN, gMonPalette_Sunkern), -// SPECIES_PAL(SUNFLORA, gMonPalette_Sunflora), -// SPECIES_PAL(YANMA, gMonPalette_Yanma), -// SPECIES_PAL(WOOPER, gMonPalette_Wooper), -// SPECIES_PAL(QUAGSIRE, gMonPalette_Quagsire), -// SPECIES_PAL(ESPEON, gMonPalette_Espeon), -// SPECIES_PAL(UMBREON, gMonPalette_Umbreon), -// SPECIES_PAL(MURKROW, gMonPalette_Murkrow), -// SPECIES_PAL(SLOWKING, gMonPalette_Slowking), -// SPECIES_PAL(MISDREAVUS, gMonPalette_Misdreavus), -// SPECIES_PAL(UNOWN, gMonPalette_Unown), -// SPECIES_PAL(WOBBUFFET, gMonPalette_Wobbuffet), -// SPECIES_PAL(GIRAFARIG, gMonPalette_Girafarig), -// SPECIES_PAL(PINECO, gMonPalette_Pineco), -// SPECIES_PAL(FORRETRESS, gMonPalette_Forretress), -// SPECIES_PAL(DUNSPARCE, gMonPalette_Dunsparce), -// SPECIES_PAL(GLIGAR, gMonPalette_Gligar), -// SPECIES_PAL(STEELIX, gMonPalette_Steelix), -// SPECIES_PAL(SNUBBULL, gMonPalette_Snubbull), -// SPECIES_PAL(GRANBULL, gMonPalette_Granbull), -// SPECIES_PAL(QWILFISH, gMonPalette_Qwilfish), -// SPECIES_PAL(SCIZOR, gMonPalette_Scizor), -// SPECIES_PAL(SHUCKLE, gMonPalette_Shuckle), -// SPECIES_PAL(HERACROSS, gMonPalette_Heracross), -// SPECIES_PAL(SNEASEL, gMonPalette_Sneasel), -// SPECIES_PAL(TEDDIURSA, gMonPalette_Teddiursa), -// SPECIES_PAL(URSARING, gMonPalette_Ursaring), -// SPECIES_PAL(SLUGMA, gMonPalette_Slugma), -// SPECIES_PAL(MAGCARGO, gMonPalette_Magcargo), -// SPECIES_PAL(SWINUB, gMonPalette_Swinub), -// SPECIES_PAL(PILOSWINE, gMonPalette_Piloswine), -// SPECIES_PAL(CORSOLA, gMonPalette_Corsola), -// SPECIES_PAL(REMORAID, gMonPalette_Remoraid), -// SPECIES_PAL(OCTILLERY, gMonPalette_Octillery), -// SPECIES_PAL(DELIBIRD, gMonPalette_Delibird), -// SPECIES_PAL(MANTINE, gMonPalette_Mantine), -// SPECIES_PAL(SKARMORY, gMonPalette_Skarmory), -// SPECIES_PAL(HOUNDOUR, gMonPalette_Houndour), -// SPECIES_PAL(HOUNDOOM, gMonPalette_Houndoom), -// SPECIES_PAL(KINGDRA, gMonPalette_Kingdra), -// SPECIES_PAL(PHANPY, gMonPalette_Phanpy), -// SPECIES_PAL(DONPHAN, gMonPalette_Donphan), -// SPECIES_PAL(PORYGON2, gMonPalette_Porygon2), -// SPECIES_PAL(STANTLER, gMonPalette_Stantler), -// SPECIES_PAL(SMEARGLE, gMonPalette_Smeargle), -// SPECIES_PAL(TYROGUE, gMonPalette_Tyrogue), -// SPECIES_PAL(HITMONTOP, gMonPalette_Hitmontop), -// SPECIES_PAL(SMOOCHUM, gMonPalette_Smoochum), -// SPECIES_PAL(ELEKID, gMonPalette_Elekid), -// SPECIES_PAL(MAGBY, gMonPalette_Magby), -// SPECIES_PAL(MILTANK, gMonPalette_Miltank), -// SPECIES_PAL(BLISSEY, gMonPalette_Blissey), -// SPECIES_PAL(RAIKOU, gMonPalette_Raikou), -// SPECIES_PAL(ENTEI, gMonPalette_Entei), -// SPECIES_PAL(SUICUNE, gMonPalette_Suicune), -// SPECIES_PAL(LARVITAR, gMonPalette_Larvitar), -// SPECIES_PAL(PUPITAR, gMonPalette_Pupitar), -// SPECIES_PAL(TYRANITAR, gMonPalette_Tyranitar), -// SPECIES_PAL(LUGIA, gMonPalette_Lugia), -// SPECIES_PAL(HO_OH, gMonPalette_HoOh), -// SPECIES_PAL(CELEBI, gMonPalette_Celebi), -// SPECIES_PAL(OLD_UNOWN_B, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_C, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_D, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_E, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_F, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_G, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_H, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_I, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_J, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_K, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_L, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_M, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_N, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_O, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_P, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_Q, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_R, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_S, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_T, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_U, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_V, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_W, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_X, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_Y, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(OLD_UNOWN_Z, gMonPalette_DoubleQuestionMark), -// SPECIES_PAL(TREECKO, gMonPalette_Treecko), -// SPECIES_PAL(GROVYLE, gMonPalette_Grovyle), -// SPECIES_PAL(SCEPTILE, gMonPalette_Sceptile), -// SPECIES_PAL(TORCHIC, gMonPalette_Torchic), -// SPECIES_PAL(COMBUSKEN, gMonPalette_Combusken), -// SPECIES_PAL(BLAZIKEN, gMonPalette_Blaziken), -// SPECIES_PAL(MUDKIP, gMonPalette_Mudkip), -// SPECIES_PAL(MARSHTOMP, gMonPalette_Marshtomp), -// SPECIES_PAL(SWAMPERT, gMonPalette_Swampert), -// SPECIES_PAL(POOCHYENA, gMonPalette_Poochyena), -// SPECIES_PAL(MIGHTYENA, gMonPalette_Mightyena), -// SPECIES_PAL(ZIGZAGOON, gMonPalette_Zigzagoon), -// SPECIES_PAL(LINOONE, gMonPalette_Linoone), -// SPECIES_PAL(WURMPLE, gMonPalette_Wurmple), -// SPECIES_PAL(SILCOON, gMonPalette_Silcoon), -// SPECIES_PAL(BEAUTIFLY, gMonPalette_Beautifly), -// SPECIES_PAL(CASCOON, gMonPalette_Cascoon), -// SPECIES_PAL(DUSTOX, gMonPalette_Dustox), -// SPECIES_PAL(LOTAD, gMonPalette_Lotad), -// SPECIES_PAL(LOMBRE, gMonPalette_Lombre), -// SPECIES_PAL(LUDICOLO, gMonPalette_Ludicolo), -// SPECIES_PAL(SEEDOT, gMonPalette_Seedot), -// SPECIES_PAL(NUZLEAF, gMonPalette_Nuzleaf), -// SPECIES_PAL(SHIFTRY, gMonPalette_Shiftry), -// SPECIES_PAL(NINCADA, gMonPalette_Nincada), -// SPECIES_PAL(NINJASK, gMonPalette_Ninjask), -// SPECIES_PAL(SHEDINJA, gMonPalette_Shedinja), -// SPECIES_PAL(TAILLOW, gMonPalette_Taillow), -// SPECIES_PAL(SWELLOW, gMonPalette_Swellow), -// SPECIES_PAL(SHROOMISH, gMonPalette_Shroomish), -// SPECIES_PAL(BRELOOM, gMonPalette_Breloom), -// SPECIES_PAL(SPINDA, gMonPalette_Spinda), -// SPECIES_PAL(WINGULL, gMonPalette_Wingull), -// SPECIES_PAL(PELIPPER, gMonPalette_Pelipper), -// SPECIES_PAL(SURSKIT, gMonPalette_Surskit), -// SPECIES_PAL(MASQUERAIN, gMonPalette_Masquerain), -// SPECIES_PAL(WAILMER, gMonPalette_Wailmer), -// SPECIES_PAL(WAILORD, gMonPalette_Wailord), -// SPECIES_PAL(SKITTY, gMonPalette_Skitty), -// SPECIES_PAL(DELCATTY, gMonPalette_Delcatty), -// SPECIES_PAL(KECLEON, gMonPalette_Kecleon), -// SPECIES_PAL(BALTOY, gMonPalette_Baltoy), -// SPECIES_PAL(CLAYDOL, gMonPalette_Claydol), -// SPECIES_PAL(NOSEPASS, gMonPalette_Nosepass), -// SPECIES_PAL(TORKOAL, gMonPalette_Torkoal), -// SPECIES_PAL(SABLEYE, gMonPalette_Sableye), -// SPECIES_PAL(BARBOACH, gMonPalette_Barboach), -// SPECIES_PAL(WHISCASH, gMonPalette_Whiscash), -// SPECIES_PAL(LUVDISC, gMonPalette_Luvdisc), -// SPECIES_PAL(CORPHISH, gMonPalette_Corphish), -// SPECIES_PAL(CRAWDAUNT, gMonPalette_Crawdaunt), -// SPECIES_PAL(FEEBAS, gMonPalette_Feebas), -// SPECIES_PAL(MILOTIC, gMonPalette_Milotic), -// SPECIES_PAL(CARVANHA, gMonPalette_Carvanha), -// SPECIES_PAL(SHARPEDO, gMonPalette_Sharpedo), -// SPECIES_PAL(TRAPINCH, gMonPalette_Trapinch), -// SPECIES_PAL(VIBRAVA, gMonPalette_Vibrava), -// SPECIES_PAL(FLYGON, gMonPalette_Flygon), -// SPECIES_PAL(MAKUHITA, gMonPalette_Makuhita), -// SPECIES_PAL(HARIYAMA, gMonPalette_Hariyama), -// SPECIES_PAL(ELECTRIKE, gMonPalette_Electrike), -// SPECIES_PAL(MANECTRIC, gMonPalette_Manectric), -// SPECIES_PAL(NUMEL, gMonPalette_Numel), -// SPECIES_PAL(CAMERUPT, gMonPalette_Camerupt), -// SPECIES_PAL(SPHEAL, gMonPalette_Spheal), -// SPECIES_PAL(SEALEO, gMonPalette_Sealeo), -// SPECIES_PAL(WALREIN, gMonPalette_Walrein), -// SPECIES_PAL(CACNEA, gMonPalette_Cacnea), -// SPECIES_PAL(CACTURNE, gMonPalette_Cacturne), -// SPECIES_PAL(SNORUNT, gMonPalette_Snorunt), -// SPECIES_PAL(GLALIE, gMonPalette_Glalie), -// SPECIES_PAL(LUNATONE, gMonPalette_Lunatone), -// SPECIES_PAL(SOLROCK, gMonPalette_Solrock), -// SPECIES_PAL(AZURILL, gMonPalette_Azurill), -// SPECIES_PAL(SPOINK, gMonPalette_Spoink), -// SPECIES_PAL(GRUMPIG, gMonPalette_Grumpig), -// SPECIES_PAL(PLUSLE, gMonPalette_Plusle), -// SPECIES_PAL(MINUN, gMonPalette_Minun), -// SPECIES_PAL(MAWILE, gMonPalette_Mawile), -// SPECIES_PAL(MEDITITE, gMonPalette_Meditite), -// SPECIES_PAL(MEDICHAM, gMonPalette_Medicham), -// SPECIES_PAL(SWABLU, gMonPalette_Swablu), -// SPECIES_PAL(ALTARIA, gMonPalette_Altaria), -// SPECIES_PAL(WYNAUT, gMonPalette_Wynaut), -// SPECIES_PAL(DUSKULL, gMonPalette_Duskull), -// SPECIES_PAL(DUSCLOPS, gMonPalette_Dusclops), -// SPECIES_PAL(ROSELIA, gMonPalette_Roselia), -// SPECIES_PAL(SLAKOTH, gMonPalette_Slakoth), -// SPECIES_PAL(VIGOROTH, gMonPalette_Vigoroth), -// SPECIES_PAL(SLAKING, gMonPalette_Slaking), -// SPECIES_PAL(GULPIN, gMonPalette_Gulpin), -// SPECIES_PAL(SWALOT, gMonPalette_Swalot), -// SPECIES_PAL(TROPIUS, gMonPalette_Tropius), -// SPECIES_PAL(WHISMUR, gMonPalette_Whismur), -// SPECIES_PAL(LOUDRED, gMonPalette_Loudred), -// SPECIES_PAL(EXPLOUD, gMonPalette_Exploud), -// SPECIES_PAL(CLAMPERL, gMonPalette_Clamperl), -// SPECIES_PAL(HUNTAIL, gMonPalette_Huntail), -// SPECIES_PAL(GOREBYSS, gMonPalette_Gorebyss), -// SPECIES_PAL(ABSOL, gMonPalette_Absol), -// SPECIES_PAL(SHUPPET, gMonPalette_Shuppet), -// SPECIES_PAL(BANETTE, gMonPalette_Banette), -// SPECIES_PAL(SEVIPER, gMonPalette_Seviper), -// SPECIES_PAL(ZANGOOSE, gMonPalette_Zangoose), -// SPECIES_PAL(RELICANTH, gMonPalette_Relicanth), -// SPECIES_PAL(ARON, gMonPalette_Aron), -// SPECIES_PAL(LAIRON, gMonPalette_Lairon), -// SPECIES_PAL(AGGRON, gMonPalette_Aggron), -// SPECIES_PAL(CASTFORM, gMonPalette_Castform), -// SPECIES_PAL(VOLBEAT, gMonPalette_Volbeat), -// SPECIES_PAL(ILLUMISE, gMonPalette_Illumise), -// SPECIES_PAL(LILEEP, gMonPalette_Lileep), -// SPECIES_PAL(CRADILY, gMonPalette_Cradily), -// SPECIES_PAL(ANORITH, gMonPalette_Anorith), -// SPECIES_PAL(ARMALDO, gMonPalette_Armaldo), -// SPECIES_PAL(RALTS, gMonPalette_Ralts), -// SPECIES_PAL(KIRLIA, gMonPalette_Kirlia), -// SPECIES_PAL(GARDEVOIR, gMonPalette_Gardevoir), -// SPECIES_PAL(BAGON, gMonPalette_Bagon), -// SPECIES_PAL(SHELGON, gMonPalette_Shelgon), -// SPECIES_PAL(SALAMENCE, gMonPalette_Salamence), -// SPECIES_PAL(BELDUM, gMonPalette_Beldum), -// SPECIES_PAL(METANG, gMonPalette_Metang), -// SPECIES_PAL(METAGROSS, gMonPalette_Metagross), -// SPECIES_PAL(REGIROCK, gMonPalette_Regirock), -// SPECIES_PAL(REGICE, gMonPalette_Regice), -// SPECIES_PAL(REGISTEEL, gMonPalette_Registeel), -// SPECIES_PAL(KYOGRE, gMonPalette_Kyogre), -// SPECIES_PAL(GROUDON, gMonPalette_Groudon), -// SPECIES_PAL(RAYQUAZA, gMonPalette_Rayquaza), -// SPECIES_PAL(LATIAS, gMonPalette_Latias), -// SPECIES_PAL(LATIOS, gMonPalette_Latios), -// SPECIES_PAL(JIRACHI, gMonPalette_Jirachi), -// SPECIES_PAL(DEOXYS, gMonPalette_Deoxys), -// SPECIES_PAL(CHIMECHO, gMonPalette_Chimecho), -// SPECIES_PAL(EGG, gMonPalette_Egg), -// SPECIES_PAL(UNOWN_B, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_C, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_D, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_E, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_F, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_G, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_H, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_I, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_J, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_K, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_L, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_M, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_N, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_O, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_P, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_Q, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_R, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_S, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_T, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_U, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_V, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_W, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_X, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_Y, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_Z, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_EMARK, gMonPalette_Unown), -// SPECIES_PAL(UNOWN_QMARK, gMonPalette_Unown), -// }; diff --git a/src/data/pokemon_graphics/shiny_palette_table.h b/src/data/pokemon_graphics/shiny_palette_table.h deleted file mode 100644 index d8b48743a..000000000 --- a/src/data/pokemon_graphics/shiny_palette_table.h +++ /dev/null @@ -1,443 +0,0 @@ -// const struct CompressedSpritePalette gMonShinyPaletteTable[] = -// { -// SPECIES_SHINY_PAL(NONE, gMonShinyPalette_CircledQuestionMark), -// SPECIES_SHINY_PAL(BULBASAUR, gMonShinyPalette_Bulbasaur), -// SPECIES_SHINY_PAL(IVYSAUR, gMonShinyPalette_Ivysaur), -// SPECIES_SHINY_PAL(VENUSAUR, gMonShinyPalette_Venusaur), -// SPECIES_SHINY_PAL(CHARMANDER, gMonShinyPalette_Charmander), -// SPECIES_SHINY_PAL(CHARMELEON, gMonShinyPalette_Charmeleon), -// SPECIES_SHINY_PAL(CHARIZARD, gMonShinyPalette_Charizard), -// SPECIES_SHINY_PAL(SQUIRTLE, gMonShinyPalette_Squirtle), -// SPECIES_SHINY_PAL(WARTORTLE, gMonShinyPalette_Wartortle), -// SPECIES_SHINY_PAL(BLASTOISE, gMonShinyPalette_Blastoise), -// SPECIES_SHINY_PAL(CATERPIE, gMonShinyPalette_Caterpie), -// SPECIES_SHINY_PAL(METAPOD, gMonShinyPalette_Metapod), -// SPECIES_SHINY_PAL(BUTTERFREE, gMonShinyPalette_Butterfree), -// SPECIES_SHINY_PAL(WEEDLE, gMonShinyPalette_Weedle), -// SPECIES_SHINY_PAL(KAKUNA, gMonShinyPalette_Kakuna), -// SPECIES_SHINY_PAL(BEEDRILL, gMonShinyPalette_Beedrill), -// SPECIES_SHINY_PAL(PIDGEY, gMonShinyPalette_Pidgey), -// SPECIES_SHINY_PAL(PIDGEOTTO, gMonShinyPalette_Pidgeotto), -// SPECIES_SHINY_PAL(PIDGEOT, gMonShinyPalette_Pidgeot), -// SPECIES_SHINY_PAL(RATTATA, gMonShinyPalette_Rattata), -// SPECIES_SHINY_PAL(RATICATE, gMonShinyPalette_Raticate), -// SPECIES_SHINY_PAL(SPEAROW, gMonShinyPalette_Spearow), -// SPECIES_SHINY_PAL(FEAROW, gMonShinyPalette_Fearow), -// SPECIES_SHINY_PAL(EKANS, gMonShinyPalette_Ekans), -// SPECIES_SHINY_PAL(ARBOK, gMonShinyPalette_Arbok), -// SPECIES_SHINY_PAL(PIKACHU, gMonShinyPalette_Pikachu), -// SPECIES_SHINY_PAL(RAICHU, gMonShinyPalette_Raichu), -// SPECIES_SHINY_PAL(SANDSHREW, gMonShinyPalette_Sandshrew), -// SPECIES_SHINY_PAL(SANDSLASH, gMonShinyPalette_Sandslash), -// SPECIES_SHINY_PAL(NIDORAN_F, gMonShinyPalette_NidoranF), -// SPECIES_SHINY_PAL(NIDORINA, gMonShinyPalette_Nidorina), -// SPECIES_SHINY_PAL(NIDOQUEEN, gMonShinyPalette_Nidoqueen), -// SPECIES_SHINY_PAL(NIDORAN_M, gMonShinyPalette_NidoranM), -// SPECIES_SHINY_PAL(NIDORINO, gMonShinyPalette_Nidorino), -// SPECIES_SHINY_PAL(NIDOKING, gMonShinyPalette_Nidoking), -// SPECIES_SHINY_PAL(CLEFAIRY, gMonShinyPalette_Clefairy), -// SPECIES_SHINY_PAL(CLEFABLE, gMonShinyPalette_Clefable), -// SPECIES_SHINY_PAL(VULPIX, gMonShinyPalette_Vulpix), -// SPECIES_SHINY_PAL(NINETALES, gMonShinyPalette_Ninetales), -// SPECIES_SHINY_PAL(JIGGLYPUFF, gMonShinyPalette_Jigglypuff), -// SPECIES_SHINY_PAL(WIGGLYTUFF, gMonShinyPalette_Wigglytuff), -// SPECIES_SHINY_PAL(ZUBAT, gMonShinyPalette_Zubat), -// SPECIES_SHINY_PAL(GOLBAT, gMonShinyPalette_Golbat), -// SPECIES_SHINY_PAL(ODDISH, gMonShinyPalette_Oddish), -// SPECIES_SHINY_PAL(GLOOM, gMonShinyPalette_Gloom), -// SPECIES_SHINY_PAL(VILEPLUME, gMonShinyPalette_Vileplume), -// SPECIES_SHINY_PAL(PARAS, gMonShinyPalette_Paras), -// SPECIES_SHINY_PAL(PARASECT, gMonShinyPalette_Parasect), -// SPECIES_SHINY_PAL(VENONAT, gMonShinyPalette_Venonat), -// SPECIES_SHINY_PAL(VENOMOTH, gMonShinyPalette_Venomoth), -// SPECIES_SHINY_PAL(DIGLETT, gMonShinyPalette_Diglett), -// SPECIES_SHINY_PAL(DUGTRIO, gMonShinyPalette_Dugtrio), -// SPECIES_SHINY_PAL(MEOWTH, gMonShinyPalette_Meowth), -// SPECIES_SHINY_PAL(PERSIAN, gMonShinyPalette_Persian), -// SPECIES_SHINY_PAL(PSYDUCK, gMonShinyPalette_Psyduck), -// SPECIES_SHINY_PAL(GOLDUCK, gMonShinyPalette_Golduck), -// SPECIES_SHINY_PAL(MANKEY, gMonShinyPalette_Mankey), -// SPECIES_SHINY_PAL(PRIMEAPE, gMonShinyPalette_Primeape), -// SPECIES_SHINY_PAL(GROWLITHE, gMonShinyPalette_Growlithe), -// SPECIES_SHINY_PAL(ARCANINE, gMonShinyPalette_Arcanine), -// SPECIES_SHINY_PAL(POLIWAG, gMonShinyPalette_Poliwag), -// SPECIES_SHINY_PAL(POLIWHIRL, gMonShinyPalette_Poliwhirl), -// SPECIES_SHINY_PAL(POLIWRATH, gMonShinyPalette_Poliwrath), -// SPECIES_SHINY_PAL(ABRA, gMonShinyPalette_Abra), -// SPECIES_SHINY_PAL(KADABRA, gMonShinyPalette_Kadabra), -// SPECIES_SHINY_PAL(ALAKAZAM, gMonShinyPalette_Alakazam), -// SPECIES_SHINY_PAL(MACHOP, gMonShinyPalette_Machop), -// SPECIES_SHINY_PAL(MACHOKE, gMonShinyPalette_Machoke), -// SPECIES_SHINY_PAL(MACHAMP, gMonShinyPalette_Machamp), -// SPECIES_SHINY_PAL(BELLSPROUT, gMonShinyPalette_Bellsprout), -// SPECIES_SHINY_PAL(WEEPINBELL, gMonShinyPalette_Weepinbell), -// SPECIES_SHINY_PAL(VICTREEBEL, gMonShinyPalette_Victreebel), -// SPECIES_SHINY_PAL(TENTACOOL, gMonShinyPalette_Tentacool), -// SPECIES_SHINY_PAL(TENTACRUEL, gMonShinyPalette_Tentacruel), -// SPECIES_SHINY_PAL(GEODUDE, gMonShinyPalette_Geodude), -// SPECIES_SHINY_PAL(GRAVELER, gMonShinyPalette_Graveler), -// SPECIES_SHINY_PAL(GOLEM, gMonShinyPalette_Golem), -// SPECIES_SHINY_PAL(PONYTA, gMonShinyPalette_Ponyta), -// SPECIES_SHINY_PAL(RAPIDASH, gMonShinyPalette_Rapidash), -// SPECIES_SHINY_PAL(SLOWPOKE, gMonShinyPalette_Slowpoke), -// SPECIES_SHINY_PAL(SLOWBRO, gMonShinyPalette_Slowbro), -// SPECIES_SHINY_PAL(MAGNEMITE, gMonShinyPalette_Magnemite), -// SPECIES_SHINY_PAL(MAGNETON, gMonShinyPalette_Magneton), -// SPECIES_SHINY_PAL(FARFETCHD, gMonShinyPalette_Farfetchd), -// SPECIES_SHINY_PAL(DODUO, gMonShinyPalette_Doduo), -// SPECIES_SHINY_PAL(DODRIO, gMonShinyPalette_Dodrio), -// SPECIES_SHINY_PAL(SEEL, gMonShinyPalette_Seel), -// SPECIES_SHINY_PAL(DEWGONG, gMonShinyPalette_Dewgong), -// SPECIES_SHINY_PAL(GRIMER, gMonShinyPalette_Grimer), -// SPECIES_SHINY_PAL(MUK, gMonShinyPalette_Muk), -// SPECIES_SHINY_PAL(SHELLDER, gMonShinyPalette_Shellder), -// SPECIES_SHINY_PAL(CLOYSTER, gMonShinyPalette_Cloyster), -// SPECIES_SHINY_PAL(GASTLY, gMonShinyPalette_Gastly), -// SPECIES_SHINY_PAL(HAUNTER, gMonShinyPalette_Haunter), -// SPECIES_SHINY_PAL(GENGAR, gMonShinyPalette_Gengar), -// SPECIES_SHINY_PAL(ONIX, gMonShinyPalette_Onix), -// SPECIES_SHINY_PAL(DROWZEE, gMonShinyPalette_Drowzee), -// SPECIES_SHINY_PAL(HYPNO, gMonShinyPalette_Hypno), -// SPECIES_SHINY_PAL(KRABBY, gMonShinyPalette_Krabby), -// SPECIES_SHINY_PAL(KINGLER, gMonShinyPalette_Kingler), -// SPECIES_SHINY_PAL(VOLTORB, gMonShinyPalette_Voltorb), -// SPECIES_SHINY_PAL(ELECTRODE, gMonShinyPalette_Electrode), -// SPECIES_SHINY_PAL(EXEGGCUTE, gMonShinyPalette_Exeggcute), -// SPECIES_SHINY_PAL(EXEGGUTOR, gMonShinyPalette_Exeggutor), -// SPECIES_SHINY_PAL(CUBONE, gMonShinyPalette_Cubone), -// SPECIES_SHINY_PAL(MAROWAK, gMonShinyPalette_Marowak), -// SPECIES_SHINY_PAL(HITMONLEE, gMonShinyPalette_Hitmonlee), -// SPECIES_SHINY_PAL(HITMONCHAN, gMonShinyPalette_Hitmonchan), -// SPECIES_SHINY_PAL(LICKITUNG, gMonShinyPalette_Lickitung), -// SPECIES_SHINY_PAL(KOFFING, gMonShinyPalette_Koffing), -// SPECIES_SHINY_PAL(WEEZING, gMonShinyPalette_Weezing), -// SPECIES_SHINY_PAL(RHYHORN, gMonShinyPalette_Rhyhorn), -// SPECIES_SHINY_PAL(RHYDON, gMonShinyPalette_Rhydon), -// SPECIES_SHINY_PAL(CHANSEY, gMonShinyPalette_Chansey), -// SPECIES_SHINY_PAL(TANGELA, gMonShinyPalette_Tangela), -// SPECIES_SHINY_PAL(KANGASKHAN, gMonShinyPalette_Kangaskhan), -// SPECIES_SHINY_PAL(HORSEA, gMonShinyPalette_Horsea), -// SPECIES_SHINY_PAL(SEADRA, gMonShinyPalette_Seadra), -// SPECIES_SHINY_PAL(GOLDEEN, gMonShinyPalette_Goldeen), -// SPECIES_SHINY_PAL(SEAKING, gMonShinyPalette_Seaking), -// SPECIES_SHINY_PAL(STARYU, gMonShinyPalette_Staryu), -// SPECIES_SHINY_PAL(STARMIE, gMonShinyPalette_Starmie), -// SPECIES_SHINY_PAL(MR_MIME, gMonShinyPalette_Mrmime), -// SPECIES_SHINY_PAL(SCYTHER, gMonShinyPalette_Scyther), -// SPECIES_SHINY_PAL(JYNX, gMonShinyPalette_Jynx), -// SPECIES_SHINY_PAL(ELECTABUZZ, gMonShinyPalette_Electabuzz), -// SPECIES_SHINY_PAL(MAGMAR, gMonShinyPalette_Magmar), -// SPECIES_SHINY_PAL(PINSIR, gMonShinyPalette_Pinsir), -// SPECIES_SHINY_PAL(TAUROS, gMonShinyPalette_Tauros), -// SPECIES_SHINY_PAL(MAGIKARP, gMonShinyPalette_Magikarp), -// SPECIES_SHINY_PAL(GYARADOS, gMonShinyPalette_Gyarados), -// SPECIES_SHINY_PAL(LAPRAS, gMonShinyPalette_Lapras), -// SPECIES_SHINY_PAL(DITTO, gMonShinyPalette_Ditto), -// SPECIES_SHINY_PAL(EEVEE, gMonShinyPalette_Eevee), -// SPECIES_SHINY_PAL(VAPOREON, gMonShinyPalette_Vaporeon), -// SPECIES_SHINY_PAL(JOLTEON, gMonShinyPalette_Jolteon), -// SPECIES_SHINY_PAL(FLAREON, gMonShinyPalette_Flareon), -// SPECIES_SHINY_PAL(PORYGON, gMonShinyPalette_Porygon), -// SPECIES_SHINY_PAL(OMANYTE, gMonShinyPalette_Omanyte), -// SPECIES_SHINY_PAL(OMASTAR, gMonShinyPalette_Omastar), -// SPECIES_SHINY_PAL(KABUTO, gMonShinyPalette_Kabuto), -// SPECIES_SHINY_PAL(KABUTOPS, gMonShinyPalette_Kabutops), -// SPECIES_SHINY_PAL(AERODACTYL, gMonShinyPalette_Aerodactyl), -// SPECIES_SHINY_PAL(SNORLAX, gMonShinyPalette_Snorlax), -// SPECIES_SHINY_PAL(ARTICUNO, gMonShinyPalette_Articuno), -// SPECIES_SHINY_PAL(ZAPDOS, gMonShinyPalette_Zapdos), -// SPECIES_SHINY_PAL(MOLTRES, gMonShinyPalette_Moltres), -// SPECIES_SHINY_PAL(DRATINI, gMonShinyPalette_Dratini), -// SPECIES_SHINY_PAL(DRAGONAIR, gMonShinyPalette_Dragonair), -// SPECIES_SHINY_PAL(DRAGONITE, gMonShinyPalette_Dragonite), -// SPECIES_SHINY_PAL(MEWTWO, gMonShinyPalette_Mewtwo), -// SPECIES_SHINY_PAL(MEW, gMonShinyPalette_Mew), -// SPECIES_SHINY_PAL(CHIKORITA, gMonShinyPalette_Chikorita), -// SPECIES_SHINY_PAL(BAYLEEF, gMonShinyPalette_Bayleef), -// SPECIES_SHINY_PAL(MEGANIUM, gMonShinyPalette_Meganium), -// SPECIES_SHINY_PAL(CYNDAQUIL, gMonShinyPalette_Cyndaquil), -// SPECIES_SHINY_PAL(QUILAVA, gMonShinyPalette_Quilava), -// SPECIES_SHINY_PAL(TYPHLOSION, gMonShinyPalette_Typhlosion), -// SPECIES_SHINY_PAL(TOTODILE, gMonShinyPalette_Totodile), -// SPECIES_SHINY_PAL(CROCONAW, gMonShinyPalette_Croconaw), -// SPECIES_SHINY_PAL(FERALIGATR, gMonShinyPalette_Feraligatr), -// SPECIES_SHINY_PAL(SENTRET, gMonShinyPalette_Sentret), -// SPECIES_SHINY_PAL(FURRET, gMonShinyPalette_Furret), -// SPECIES_SHINY_PAL(HOOTHOOT, gMonShinyPalette_Hoothoot), -// SPECIES_SHINY_PAL(NOCTOWL, gMonShinyPalette_Noctowl), -// SPECIES_SHINY_PAL(LEDYBA, gMonShinyPalette_Ledyba), -// SPECIES_SHINY_PAL(LEDIAN, gMonShinyPalette_Ledian), -// SPECIES_SHINY_PAL(SPINARAK, gMonShinyPalette_Spinarak), -// SPECIES_SHINY_PAL(ARIADOS, gMonShinyPalette_Ariados), -// SPECIES_SHINY_PAL(CROBAT, gMonShinyPalette_Crobat), -// SPECIES_SHINY_PAL(CHINCHOU, gMonShinyPalette_Chinchou), -// SPECIES_SHINY_PAL(LANTURN, gMonShinyPalette_Lanturn), -// SPECIES_SHINY_PAL(PICHU, gMonShinyPalette_Pichu), -// SPECIES_SHINY_PAL(CLEFFA, gMonShinyPalette_Cleffa), -// SPECIES_SHINY_PAL(IGGLYBUFF, gMonShinyPalette_Igglybuff), -// SPECIES_SHINY_PAL(TOGEPI, gMonShinyPalette_Togepi), -// SPECIES_SHINY_PAL(TOGETIC, gMonShinyPalette_Togetic), -// SPECIES_SHINY_PAL(NATU, gMonShinyPalette_Natu), -// SPECIES_SHINY_PAL(XATU, gMonShinyPalette_Xatu), -// SPECIES_SHINY_PAL(MAREEP, gMonShinyPalette_Mareep), -// SPECIES_SHINY_PAL(FLAAFFY, gMonShinyPalette_Flaaffy), -// SPECIES_SHINY_PAL(AMPHAROS, gMonShinyPalette_Ampharos), -// SPECIES_SHINY_PAL(BELLOSSOM, gMonShinyPalette_Bellossom), -// SPECIES_SHINY_PAL(MARILL, gMonShinyPalette_Marill), -// SPECIES_SHINY_PAL(AZUMARILL, gMonShinyPalette_Azumarill), -// SPECIES_SHINY_PAL(SUDOWOODO, gMonShinyPalette_Sudowoodo), -// SPECIES_SHINY_PAL(POLITOED, gMonShinyPalette_Politoed), -// SPECIES_SHINY_PAL(HOPPIP, gMonShinyPalette_Hoppip), -// SPECIES_SHINY_PAL(SKIPLOOM, gMonShinyPalette_Skiploom), -// SPECIES_SHINY_PAL(JUMPLUFF, gMonShinyPalette_Jumpluff), -// SPECIES_SHINY_PAL(AIPOM, gMonShinyPalette_Aipom), -// SPECIES_SHINY_PAL(SUNKERN, gMonShinyPalette_Sunkern), -// SPECIES_SHINY_PAL(SUNFLORA, gMonShinyPalette_Sunflora), -// SPECIES_SHINY_PAL(YANMA, gMonShinyPalette_Yanma), -// SPECIES_SHINY_PAL(WOOPER, gMonShinyPalette_Wooper), -// SPECIES_SHINY_PAL(QUAGSIRE, gMonShinyPalette_Quagsire), -// SPECIES_SHINY_PAL(ESPEON, gMonShinyPalette_Espeon), -// SPECIES_SHINY_PAL(UMBREON, gMonShinyPalette_Umbreon), -// SPECIES_SHINY_PAL(MURKROW, gMonShinyPalette_Murkrow), -// SPECIES_SHINY_PAL(SLOWKING, gMonShinyPalette_Slowking), -// SPECIES_SHINY_PAL(MISDREAVUS, gMonShinyPalette_Misdreavus), -// SPECIES_SHINY_PAL(UNOWN, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(WOBBUFFET, gMonShinyPalette_Wobbuffet), -// SPECIES_SHINY_PAL(GIRAFARIG, gMonShinyPalette_Girafarig), -// SPECIES_SHINY_PAL(PINECO, gMonShinyPalette_Pineco), -// SPECIES_SHINY_PAL(FORRETRESS, gMonShinyPalette_Forretress), -// SPECIES_SHINY_PAL(DUNSPARCE, gMonShinyPalette_Dunsparce), -// SPECIES_SHINY_PAL(GLIGAR, gMonShinyPalette_Gligar), -// SPECIES_SHINY_PAL(STEELIX, gMonShinyPalette_Steelix), -// SPECIES_SHINY_PAL(SNUBBULL, gMonShinyPalette_Snubbull), -// SPECIES_SHINY_PAL(GRANBULL, gMonShinyPalette_Granbull), -// SPECIES_SHINY_PAL(QWILFISH, gMonShinyPalette_Qwilfish), -// SPECIES_SHINY_PAL(SCIZOR, gMonShinyPalette_Scizor), -// SPECIES_SHINY_PAL(SHUCKLE, gMonShinyPalette_Shuckle), -// SPECIES_SHINY_PAL(HERACROSS, gMonShinyPalette_Heracross), -// SPECIES_SHINY_PAL(SNEASEL, gMonShinyPalette_Sneasel), -// SPECIES_SHINY_PAL(TEDDIURSA, gMonShinyPalette_Teddiursa), -// SPECIES_SHINY_PAL(URSARING, gMonShinyPalette_Ursaring), -// SPECIES_SHINY_PAL(SLUGMA, gMonShinyPalette_Slugma), -// SPECIES_SHINY_PAL(MAGCARGO, gMonShinyPalette_Magcargo), -// SPECIES_SHINY_PAL(SWINUB, gMonShinyPalette_Swinub), -// SPECIES_SHINY_PAL(PILOSWINE, gMonShinyPalette_Piloswine), -// SPECIES_SHINY_PAL(CORSOLA, gMonShinyPalette_Corsola), -// SPECIES_SHINY_PAL(REMORAID, gMonShinyPalette_Remoraid), -// SPECIES_SHINY_PAL(OCTILLERY, gMonShinyPalette_Octillery), -// SPECIES_SHINY_PAL(DELIBIRD, gMonShinyPalette_Delibird), -// SPECIES_SHINY_PAL(MANTINE, gMonShinyPalette_Mantine), -// SPECIES_SHINY_PAL(SKARMORY, gMonShinyPalette_Skarmory), -// SPECIES_SHINY_PAL(HOUNDOUR, gMonShinyPalette_Houndour), -// SPECIES_SHINY_PAL(HOUNDOOM, gMonShinyPalette_Houndoom), -// SPECIES_SHINY_PAL(KINGDRA, gMonShinyPalette_Kingdra), -// SPECIES_SHINY_PAL(PHANPY, gMonShinyPalette_Phanpy), -// SPECIES_SHINY_PAL(DONPHAN, gMonShinyPalette_Donphan), -// SPECIES_SHINY_PAL(PORYGON2, gMonShinyPalette_Porygon2), -// SPECIES_SHINY_PAL(STANTLER, gMonShinyPalette_Stantler), -// SPECIES_SHINY_PAL(SMEARGLE, gMonShinyPalette_Smeargle), -// SPECIES_SHINY_PAL(TYROGUE, gMonShinyPalette_Tyrogue), -// SPECIES_SHINY_PAL(HITMONTOP, gMonShinyPalette_Hitmontop), -// SPECIES_SHINY_PAL(SMOOCHUM, gMonShinyPalette_Smoochum), -// SPECIES_SHINY_PAL(ELEKID, gMonShinyPalette_Elekid), -// SPECIES_SHINY_PAL(MAGBY, gMonShinyPalette_Magby), -// SPECIES_SHINY_PAL(MILTANK, gMonShinyPalette_Miltank), -// SPECIES_SHINY_PAL(BLISSEY, gMonShinyPalette_Blissey), -// SPECIES_SHINY_PAL(RAIKOU, gMonShinyPalette_Raikou), -// SPECIES_SHINY_PAL(ENTEI, gMonShinyPalette_Entei), -// SPECIES_SHINY_PAL(SUICUNE, gMonShinyPalette_Suicune), -// SPECIES_SHINY_PAL(LARVITAR, gMonShinyPalette_Larvitar), -// SPECIES_SHINY_PAL(PUPITAR, gMonShinyPalette_Pupitar), -// SPECIES_SHINY_PAL(TYRANITAR, gMonShinyPalette_Tyranitar), -// SPECIES_SHINY_PAL(LUGIA, gMonShinyPalette_Lugia), -// SPECIES_SHINY_PAL(HO_OH, gMonShinyPalette_HoOh), -// SPECIES_SHINY_PAL(CELEBI, gMonShinyPalette_Celebi), -// SPECIES_SHINY_PAL(OLD_UNOWN_B, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_C, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_D, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_E, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_F, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_G, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_H, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_I, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_J, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_K, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_L, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_M, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_N, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_O, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_P, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_Q, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_R, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_S, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_T, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_U, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_V, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_W, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_X, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_Y, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(OLD_UNOWN_Z, gMonShinyPalette_DoubleQuestionMark), -// SPECIES_SHINY_PAL(TREECKO, gMonShinyPalette_Treecko), -// SPECIES_SHINY_PAL(GROVYLE, gMonShinyPalette_Grovyle), -// SPECIES_SHINY_PAL(SCEPTILE, gMonShinyPalette_Sceptile), -// SPECIES_SHINY_PAL(TORCHIC, gMonShinyPalette_Torchic), -// SPECIES_SHINY_PAL(COMBUSKEN, gMonShinyPalette_Combusken), -// SPECIES_SHINY_PAL(BLAZIKEN, gMonShinyPalette_Blaziken), -// SPECIES_SHINY_PAL(MUDKIP, gMonShinyPalette_Mudkip), -// SPECIES_SHINY_PAL(MARSHTOMP, gMonShinyPalette_Marshtomp), -// SPECIES_SHINY_PAL(SWAMPERT, gMonShinyPalette_Swampert), -// SPECIES_SHINY_PAL(POOCHYENA, gMonShinyPalette_Poochyena), -// SPECIES_SHINY_PAL(MIGHTYENA, gMonShinyPalette_Mightyena), -// SPECIES_SHINY_PAL(ZIGZAGOON, gMonShinyPalette_Zigzagoon), -// SPECIES_SHINY_PAL(LINOONE, gMonShinyPalette_Linoone), -// SPECIES_SHINY_PAL(WURMPLE, gMonShinyPalette_Wurmple), -// SPECIES_SHINY_PAL(SILCOON, gMonShinyPalette_Silcoon), -// SPECIES_SHINY_PAL(BEAUTIFLY, gMonShinyPalette_Beautifly), -// SPECIES_SHINY_PAL(CASCOON, gMonShinyPalette_Cascoon), -// SPECIES_SHINY_PAL(DUSTOX, gMonShinyPalette_Dustox), -// SPECIES_SHINY_PAL(LOTAD, gMonShinyPalette_Lotad), -// SPECIES_SHINY_PAL(LOMBRE, gMonShinyPalette_Lombre), -// SPECIES_SHINY_PAL(LUDICOLO, gMonShinyPalette_Ludicolo), -// SPECIES_SHINY_PAL(SEEDOT, gMonShinyPalette_Seedot), -// SPECIES_SHINY_PAL(NUZLEAF, gMonShinyPalette_Nuzleaf), -// SPECIES_SHINY_PAL(SHIFTRY, gMonShinyPalette_Shiftry), -// SPECIES_SHINY_PAL(NINCADA, gMonShinyPalette_Nincada), -// SPECIES_SHINY_PAL(NINJASK, gMonShinyPalette_Ninjask), -// SPECIES_SHINY_PAL(SHEDINJA, gMonShinyPalette_Shedinja), -// SPECIES_SHINY_PAL(TAILLOW, gMonShinyPalette_Taillow), -// SPECIES_SHINY_PAL(SWELLOW, gMonShinyPalette_Swellow), -// SPECIES_SHINY_PAL(SHROOMISH, gMonShinyPalette_Shroomish), -// SPECIES_SHINY_PAL(BRELOOM, gMonShinyPalette_Breloom), -// SPECIES_SHINY_PAL(SPINDA, gMonShinyPalette_Spinda), -// SPECIES_SHINY_PAL(WINGULL, gMonShinyPalette_Wingull), -// SPECIES_SHINY_PAL(PELIPPER, gMonShinyPalette_Pelipper), -// SPECIES_SHINY_PAL(SURSKIT, gMonShinyPalette_Surskit), -// SPECIES_SHINY_PAL(MASQUERAIN, gMonShinyPalette_Masquerain), -// SPECIES_SHINY_PAL(WAILMER, gMonShinyPalette_Wailmer), -// SPECIES_SHINY_PAL(WAILORD, gMonShinyPalette_Wailord), -// SPECIES_SHINY_PAL(SKITTY, gMonShinyPalette_Skitty), -// SPECIES_SHINY_PAL(DELCATTY, gMonShinyPalette_Delcatty), -// SPECIES_SHINY_PAL(KECLEON, gMonShinyPalette_Kecleon), -// SPECIES_SHINY_PAL(BALTOY, gMonShinyPalette_Baltoy), -// SPECIES_SHINY_PAL(CLAYDOL, gMonShinyPalette_Claydol), -// SPECIES_SHINY_PAL(NOSEPASS, gMonShinyPalette_Nosepass), -// SPECIES_SHINY_PAL(TORKOAL, gMonShinyPalette_Torkoal), -// SPECIES_SHINY_PAL(SABLEYE, gMonShinyPalette_Sableye), -// SPECIES_SHINY_PAL(BARBOACH, gMonShinyPalette_Barboach), -// SPECIES_SHINY_PAL(WHISCASH, gMonShinyPalette_Whiscash), -// SPECIES_SHINY_PAL(LUVDISC, gMonShinyPalette_Luvdisc), -// SPECIES_SHINY_PAL(CORPHISH, gMonShinyPalette_Corphish), -// SPECIES_SHINY_PAL(CRAWDAUNT, gMonShinyPalette_Crawdaunt), -// SPECIES_SHINY_PAL(FEEBAS, gMonShinyPalette_Feebas), -// SPECIES_SHINY_PAL(MILOTIC, gMonShinyPalette_Milotic), -// SPECIES_SHINY_PAL(CARVANHA, gMonShinyPalette_Carvanha), -// SPECIES_SHINY_PAL(SHARPEDO, gMonShinyPalette_Sharpedo), -// SPECIES_SHINY_PAL(TRAPINCH, gMonShinyPalette_Trapinch), -// SPECIES_SHINY_PAL(VIBRAVA, gMonShinyPalette_Vibrava), -// SPECIES_SHINY_PAL(FLYGON, gMonShinyPalette_Flygon), -// SPECIES_SHINY_PAL(MAKUHITA, gMonShinyPalette_Makuhita), -// SPECIES_SHINY_PAL(HARIYAMA, gMonShinyPalette_Hariyama), -// SPECIES_SHINY_PAL(ELECTRIKE, gMonShinyPalette_Electrike), -// SPECIES_SHINY_PAL(MANECTRIC, gMonShinyPalette_Manectric), -// SPECIES_SHINY_PAL(NUMEL, gMonShinyPalette_Numel), -// SPECIES_SHINY_PAL(CAMERUPT, gMonShinyPalette_Camerupt), -// SPECIES_SHINY_PAL(SPHEAL, gMonShinyPalette_Spheal), -// SPECIES_SHINY_PAL(SEALEO, gMonShinyPalette_Sealeo), -// SPECIES_SHINY_PAL(WALREIN, gMonShinyPalette_Walrein), -// SPECIES_SHINY_PAL(CACNEA, gMonShinyPalette_Cacnea), -// SPECIES_SHINY_PAL(CACTURNE, gMonShinyPalette_Cacturne), -// SPECIES_SHINY_PAL(SNORUNT, gMonShinyPalette_Snorunt), -// SPECIES_SHINY_PAL(GLALIE, gMonShinyPalette_Glalie), -// SPECIES_SHINY_PAL(LUNATONE, gMonShinyPalette_Lunatone), -// SPECIES_SHINY_PAL(SOLROCK, gMonShinyPalette_Solrock), -// SPECIES_SHINY_PAL(AZURILL, gMonShinyPalette_Azurill), -// SPECIES_SHINY_PAL(SPOINK, gMonShinyPalette_Spoink), -// SPECIES_SHINY_PAL(GRUMPIG, gMonShinyPalette_Grumpig), -// SPECIES_SHINY_PAL(PLUSLE, gMonShinyPalette_Plusle), -// SPECIES_SHINY_PAL(MINUN, gMonShinyPalette_Minun), -// SPECIES_SHINY_PAL(MAWILE, gMonShinyPalette_Mawile), -// SPECIES_SHINY_PAL(MEDITITE, gMonShinyPalette_Meditite), -// SPECIES_SHINY_PAL(MEDICHAM, gMonShinyPalette_Medicham), -// SPECIES_SHINY_PAL(SWABLU, gMonShinyPalette_Swablu), -// SPECIES_SHINY_PAL(ALTARIA, gMonShinyPalette_Altaria), -// SPECIES_SHINY_PAL(WYNAUT, gMonShinyPalette_Wynaut), -// SPECIES_SHINY_PAL(DUSKULL, gMonShinyPalette_Duskull), -// SPECIES_SHINY_PAL(DUSCLOPS, gMonShinyPalette_Dusclops), -// SPECIES_SHINY_PAL(ROSELIA, gMonShinyPalette_Roselia), -// SPECIES_SHINY_PAL(SLAKOTH, gMonShinyPalette_Slakoth), -// SPECIES_SHINY_PAL(VIGOROTH, gMonShinyPalette_Vigoroth), -// SPECIES_SHINY_PAL(SLAKING, gMonShinyPalette_Slaking), -// SPECIES_SHINY_PAL(GULPIN, gMonShinyPalette_Gulpin), -// SPECIES_SHINY_PAL(SWALOT, gMonShinyPalette_Swalot), -// SPECIES_SHINY_PAL(TROPIUS, gMonShinyPalette_Tropius), -// SPECIES_SHINY_PAL(WHISMUR, gMonShinyPalette_Whismur), -// SPECIES_SHINY_PAL(LOUDRED, gMonShinyPalette_Loudred), -// SPECIES_SHINY_PAL(EXPLOUD, gMonShinyPalette_Exploud), -// SPECIES_SHINY_PAL(CLAMPERL, gMonShinyPalette_Clamperl), -// SPECIES_SHINY_PAL(HUNTAIL, gMonShinyPalette_Huntail), -// SPECIES_SHINY_PAL(GOREBYSS, gMonShinyPalette_Gorebyss), -// SPECIES_SHINY_PAL(ABSOL, gMonShinyPalette_Absol), -// SPECIES_SHINY_PAL(SHUPPET, gMonShinyPalette_Shuppet), -// SPECIES_SHINY_PAL(BANETTE, gMonShinyPalette_Banette), -// SPECIES_SHINY_PAL(SEVIPER, gMonShinyPalette_Seviper), -// SPECIES_SHINY_PAL(ZANGOOSE, gMonShinyPalette_Zangoose), -// SPECIES_SHINY_PAL(RELICANTH, gMonShinyPalette_Relicanth), -// SPECIES_SHINY_PAL(ARON, gMonShinyPalette_Aron), -// SPECIES_SHINY_PAL(LAIRON, gMonShinyPalette_Lairon), -// SPECIES_SHINY_PAL(AGGRON, gMonShinyPalette_Aggron), -// SPECIES_SHINY_PAL(CASTFORM, gMonShinyPalette_Castform), -// SPECIES_SHINY_PAL(VOLBEAT, gMonShinyPalette_Volbeat), -// SPECIES_SHINY_PAL(ILLUMISE, gMonShinyPalette_Illumise), -// SPECIES_SHINY_PAL(LILEEP, gMonShinyPalette_Lileep), -// SPECIES_SHINY_PAL(CRADILY, gMonShinyPalette_Cradily), -// SPECIES_SHINY_PAL(ANORITH, gMonShinyPalette_Anorith), -// SPECIES_SHINY_PAL(ARMALDO, gMonShinyPalette_Armaldo), -// SPECIES_SHINY_PAL(RALTS, gMonShinyPalette_Ralts), -// SPECIES_SHINY_PAL(KIRLIA, gMonShinyPalette_Kirlia), -// SPECIES_SHINY_PAL(GARDEVOIR, gMonShinyPalette_Gardevoir), -// SPECIES_SHINY_PAL(BAGON, gMonShinyPalette_Bagon), -// SPECIES_SHINY_PAL(SHELGON, gMonShinyPalette_Shelgon), -// SPECIES_SHINY_PAL(SALAMENCE, gMonShinyPalette_Salamence), -// SPECIES_SHINY_PAL(BELDUM, gMonShinyPalette_Beldum), -// SPECIES_SHINY_PAL(METANG, gMonShinyPalette_Metang), -// SPECIES_SHINY_PAL(METAGROSS, gMonShinyPalette_Metagross), -// SPECIES_SHINY_PAL(REGIROCK, gMonShinyPalette_Regirock), -// SPECIES_SHINY_PAL(REGICE, gMonShinyPalette_Regice), -// SPECIES_SHINY_PAL(REGISTEEL, gMonShinyPalette_Registeel), -// SPECIES_SHINY_PAL(KYOGRE, gMonShinyPalette_Kyogre), -// SPECIES_SHINY_PAL(GROUDON, gMonShinyPalette_Groudon), -// SPECIES_SHINY_PAL(RAYQUAZA, gMonShinyPalette_Rayquaza), -// SPECIES_SHINY_PAL(LATIAS, gMonShinyPalette_Latias), -// SPECIES_SHINY_PAL(LATIOS, gMonShinyPalette_Latios), -// SPECIES_SHINY_PAL(JIRACHI, gMonShinyPalette_Jirachi), -// SPECIES_SHINY_PAL(DEOXYS, gMonShinyPalette_Deoxys), -// SPECIES_SHINY_PAL(CHIMECHO, gMonShinyPalette_Chimecho), -// SPECIES_SHINY_PAL(EGG, gMonPalette_Egg), -// SPECIES_SHINY_PAL(UNOWN_B, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_C, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_D, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_E, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_F, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_G, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_H, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_I, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_J, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_K, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_L, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_M, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_N, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_O, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_P, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_Q, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_R, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_S, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_T, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_U, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_V, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_W, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_X, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_Y, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_Z, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_EMARK, gMonShinyPalette_Unown), -// SPECIES_SHINY_PAL(UNOWN_QMARK, gMonShinyPalette_Unown), -// }; diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h deleted file mode 100644 index 4c2919487..000000000 --- a/src/data/text/move_descriptions.h +++ /dev/null @@ -1,4193 +0,0 @@ - -#if B_BINDING_TURNS >= GEN_5 -#define BINDING_TURNS "4 or 5" -#else -#define BINDING_TURNS "2 to 5" -#endif - -const u8 sNullDescription[] = _( - ""); - -const u8 sPoundDescription[] = _( - "Pounds the foe with\n" - "forelegs or tail."); - -const u8 sKarateChopDescription[] = _( - "A chopping attack with a\n" - "high critical-hit ratio."); - -const u8 sDoubleSlapDescription[] = _( - "Repeatedly slaps the foe\n" - "2 to 5 times."); - -const u8 sCometPunchDescription[] = _( - "Repeatedly punches the foe\n" - "2 to 5 times."); - -const u8 sMegaPunchDescription[] = _( - "A strong punch thrown with\n" - "incredible power."); - -const u8 sPayDayDescription[] = _( - "Throws coins at the foe.\n" - "Money is recovered after."); - -const u8 sFirePunchDescription[] = _( - "A fiery punch that may burn\n" - "the foe."); - -const u8 sIcePunchDescription[] = _( - "An icy punch that may\n" -#if B_USE_FROSTBITE == TRUE - "leave the foe with frostbite."); -#else - "freeze the foe."); -#endif - -const u8 sThunderPunchDescription[] = _( - "An electrified punch that\n" - "may paralyze the foe."); - -const u8 sScratchDescription[] = _( - "Scratches the foe with\n" - "sharp claws."); - -const u8 sViseGripDescription[] = _( - "Grips the foe with large and\n" - "powerful pincers."); - -const u8 sGuillotineDescription[] = _( - "A powerful pincer attack\n" - "that may cause fainting."); - -const u8 sRazorWindDescription[] = _( - "A 2-turn move that strikes\n" - "the foe on the 2nd turn."); - -const u8 sSwordsDanceDescription[] = _( - "A fighting dance that\n" - "sharply raises Attack."); - -const u8 sCutDescription[] = _( - "Cuts the foe with sharp\n" - "scythes, claws, etc."); - -const u8 sGustDescription[] = _( - "Strikes the foe with a gust\n" - "of wind whipped up by wings."); - -const u8 sWingAttackDescription[] = _( - "Strikes the foe with wings\n" - "spread wide."); - -const u8 sWhirlwindDescription[] = _( - "Blows away the foe with\n" - "wind and ends the battle."); - -const u8 sFlyDescription[] = _( - "Flies up on the first turn,\n" - "then strikes the next turn."); - -const u8 sBindDescription[] = _( - "Binds and squeezes the foe\n" - "for "BINDING_TURNS" turns."); - -const u8 sSlamDescription[] = _( - "Slams the foe with a long\n" - "tail, vine, etc."); - -const u8 sVineWhipDescription[] = _( - "Strikes the foe with\n" - "slender, whiplike vines."); - -const u8 sStompDescription[] = _( - "Stomps the enemy with a big\n" - "foot. May cause flinching."); - -const u8 sDoubleKickDescription[] = _( - "A double-kicking attack\n" - "that strikes the foe twice."); - -const u8 sMegaKickDescription[] = _( - "An extremely powerful kick\n" - "with intense force."); - -const u8 sJumpKickDescription[] = _( - "A strong jumping kick. May\n" - "miss and hurt the kicker."); - -const u8 sRollingKickDescription[] = _( - "A fast kick delivered from\n" - "a rapid spin."); - -const u8 sSandAttackDescription[] = _( - "Reduces the foe's accuracy\n" - "by hurling sand in its face."); - -const u8 sHeadbuttDescription[] = _( - "A ramming attack that may\n" - "cause flinching."); - -const u8 sHornAttackDescription[] = _( - "Jabs the foe with sharp\n" - "horns."); - -const u8 sFuryAttackDescription[] = _( - "Jabs the foe 2 to 5 times\n" - "with sharp horns, etc."); - -const u8 sHornDrillDescription[] = _( - "A one-hit KO attack that\n" - "uses a horn like a drill."); - -const u8 sTackleDescription[] = _( - "Charges the foe with a full-\n" - "body tackle."); - -const u8 sBodySlamDescription[] = _( - "A full-body slam that may\n" - "cause paralysis."); - -const u8 sWrapDescription[] = _( - "Wraps and squeezes the foe\n" - BINDING_TURNS" times with vines, etc."); - -const u8 sTakeDownDescription[] = _( - "A reckless charge attack\n" - "that also hurts the user."); - -const u8 sThrashDescription[] = _( - "A rampage of 2 to 3 turns\n" - "that confuses the user."); - -const u8 sDoubleEdgeDescription[] = _( - "A life-risking tackle that\n" - "also hurts the user."); - -const u8 sTailWhipDescription[] = _( - "Wags the tail to lower the\n" - "foe's Defense."); - -const u8 sPoisonStingDescription[] = _( - "A toxic attack with barbs,\n" - "etc., that may poison."); - -const u8 sTwineedleDescription[] = _( - "Stingers on the forelegs\n" - "jab the foe twice."); - -const u8 sPinMissileDescription[] = _( - "Sharp pins are fired to\n" - "strike 2 to 5 times."); - -const u8 sLeerDescription[] = _( - "Frightens the foe with a\n" - "leer to lower Defense."); - -const u8 sBiteDescription[] = _( - "Bites with vicious fangs.\n" - "May cause flinching."); - -const u8 sGrowlDescription[] = _( - "Growls cutely to reduce the\n" - "foe's Attack."); - -const u8 sRoarDescription[] = _( - "Makes the foe flee to end\n" - "the battle."); - -const u8 sSingDescription[] = _( - "A soothing song lulls the\n" - "foe into a deep slumber."); - -const u8 sSupersonicDescription[] = _( - "Emits bizarre sound waves\n" - "that may confuse the foe."); - -const u8 sSonicBoomDescription[] = _( - "Launches shock waves that\n" - "always inflict 20 HP damage."); - -const u8 sDisableDescription[] = _( - "Psychically disables one of\n" - "the foe's moves."); - -const u8 sAcidDescription[] = _( - "Sprays a hide-melting acid.\n" -#if B_UPDATED_MOVE_DATA >= GEN_4 - "May lower Sp. Def."); -#else - "May lower Defense."); -#endif - -const u8 sEmberDescription[] = _( - "A weak fire attack that may\n" - "inflict a burn."); - -const u8 sFlamethrowerDescription[] = _( - "A powerful fire attack that\n" - "may inflict a burn."); - -const u8 sMistDescription[] = _( - "Creates a mist that stops\n" - "reduction of abilities."); - -const u8 sWaterGunDescription[] = _( - "Squirts water to attack\n" - "the foe."); - -const u8 sHydroPumpDescription[] = _( - "Blasts water at high power\n" - "to strike the foe."); - -const u8 sSurfDescription[] = _( - "Creates a huge wave, then\n" - "crashes it down on the foe."); - -const u8 sIceBeamDescription[] = _( - "Blasts the foe with an icy\n" -#if B_USE_FROSTBITE == TRUE - "beam. May cause frostbite."); -#else - "beam that may freeze it."); -#endif - -const u8 sBlizzardDescription[] = _( - "Hits the foe with an icy\n" -#if B_USE_FROSTBITE == TRUE - "storm. May cause frostbite."); -#else - "storm that may freeze it."); -#endif - -const u8 sPsybeamDescription[] = _( - "Fires a peculiar ray that\n" - "may confuse the foe."); - -const u8 sBubbleBeamDescription[] = _( - "Forcefully sprays bubbles\n" - "that may lower Speed."); - -const u8 sAuroraBeamDescription[] = _( - "Fires a rainbow-colored\n" - "beam that may lower Attack."); - -const u8 sHyperBeamDescription[] = _( - "Powerful, but leaves the\n" - "user immobile the next turn."); - -const u8 sPeckDescription[] = _( - "Attacks the foe with a\n" - "jabbing beak, etc."); - -const u8 sDrillPeckDescription[] = _( - "A corkscrewing attack with\n" - "the beak acting as a drill."); - -const u8 sSubmissionDescription[] = _( - "A reckless body slam that\n" - "also hurts the user."); - -const u8 sLowKickDescription[] = _( - "A kick that inflicts more\n" - "damage on heavier foes."); - -const u8 sCounterDescription[] = _( - "Retaliates any physical hit\n" - "with double the power."); - -const u8 sSeismicTossDescription[] = _( - "Inflicts damage identical\n" - "to the user's level."); - -const u8 sStrengthDescription[] = _( - "Builds enormous power,\n" - "then slams the foe."); - -const u8 sAbsorbDescription[] = _( - "An attack that absorbs\n" - "half the damage inflicted."); - -const u8 sMegaDrainDescription[] = _( - "An attack that absorbs\n" - "half the damage inflicted."); - -const u8 sLeechSeedDescription[] = _( - "Plants a seed on the foe to\n" - "steal HP on every turn."); - -const u8 sGrowthDescription[] = _( - "Forces the body to grow\n" - "and heightens Sp. Atk."); - -const u8 sRazorLeafDescription[] = _( - "Cuts the enemy with leaves.\n" - "High critical-hit ratio."); - -const u8 sSolarBeamDescription[] = _( - "Absorbs light in one turn,\n" - "then attacks next turn."); - -const u8 sPoisonPowderDescription[] = _( - "Scatters a toxic powder\n" - "that may poison the foe."); - -const u8 sStunSporeDescription[] = _( - "Scatters a powder that may\n" - "paralyze the foe."); - -const u8 sSleepPowderDescription[] = _( - "Scatters a powder that may\n" - "cause the foe to sleep."); - -const u8 sPetalDanceDescription[] = _( - "A rampage of 2 to 3 turns\n" - "that confuses the user."); - -const u8 sStringShotDescription[] = _( - "Binds the foe with string\n" - "to reduce its Speed."); - -const u8 sDragonRageDescription[] = _( - "Launches shock waves that\n" - "always inflict 40 HP damage."); - -const u8 sFireSpinDescription[] = _( - "Traps the foe in a ring of\n" - "fire for "BINDING_TURNS" turns."); - -const u8 sThunderShockDescription[] = _( - "An electrical attack that\n" - "may paralyze the foe."); - -const u8 sThunderboltDescription[] = _( - "A strong electrical attack\n" - "that may paralyze the foe."); - -const u8 sThunderWaveDescription[] = _( - "A weak jolt of electricity\n" - "that paralyzes the foe."); - -const u8 sThunderDescription[] = _( - "A lightning attack that may\n" - "cause paralysis."); - -const u8 sRockThrowDescription[] = _( - "Throws small rocks to\n" - "strike the foe."); - -const u8 sEarthquakeDescription[] = _( - "A powerful quake, but has\n" - "no effect on flying foes."); - -const u8 sFissureDescription[] = _( - "A one-hit KO move that\n" - "drops the foe in a fissure."); - -const u8 sDigDescription[] = _( - "Digs underground the first\n" - "turn and strikes next turn."); - -const u8 sToxicDescription[] = _( - "Poisons the foe with an\n" - "intensifying toxin."); - -const u8 sConfusionDescription[] = _( - "A psychic attack that may\n" - "cause confusion."); - -const u8 sPsychicDescription[] = _( - "A powerful psychic attack\n" - "that may lower Sp. Def."); - -const u8 sHypnosisDescription[] = _( - "A hypnotizing move that\n" - "may induce sleep."); - -const u8 sMeditateDescription[] = _( - "Meditates in a peaceful\n" - "fashion to raise Attack."); - -const u8 sAgilityDescription[] = _( - "Relaxes the body to sharply\n" - "boost Speed."); - -const u8 sQuickAttackDescription[] = _( - "An extremely fast attack\n" - "that always strikes first."); - -const u8 sRageDescription[] = _( - "Raises the user's Attack\n" - "every time it is hit."); - -const u8 sTeleportDescription[] = _( - "A psychic move for fleeing\n" - "from battle instantly."); - -const u8 sNightShadeDescription[] = _( - "Inflicts damage identical\n" - "to the user's level."); - -const u8 sMimicDescription[] = _( - "Copies a move used by the\n" - "foe during one battle."); - -const u8 sScreechDescription[] = _( - "Emits a screech to sharply\n" - "reduce the foe's Defense."); - -const u8 sDoubleTeamDescription[] = _( - "Creates illusory copies to\n" - "raise evasiveness."); - -const u8 sRecoverDescription[] = _( - "Recovers up to half the\n" - "user's maximum HP."); - -const u8 sHardenDescription[] = _( - "Stiffens the body's \n" - "muscles to raise Defense."); - -const u8 sMinimizeDescription[] = _( - "Minimizes the user's size\n" - "to raise evasiveness."); - -const u8 sSmokescreenDescription[] = _( - "Lowers the foe's accuracy\n" - "using smoke, ink, etc."); - -const u8 sConfuseRayDescription[] = _( - "A sinister ray that\n" - "confuses the foe."); - -const u8 sWithdrawDescription[] = _( - "Withdraws the body into its\n" - "hard shell to raise Defense."); - -const u8 sDefenseCurlDescription[] = _( - "Curls up to conceal weak\n" - "spots and raise Defense."); - -const u8 sBarrierDescription[] = _( - "Creates a barrier that\n" - "sharply raises Defense."); - -const u8 sLightScreenDescription[] = _( - "Creates a wall of light that\n" - "lowers Sp. Atk damage."); - -const u8 sHazeDescription[] = _( - "Creates a black haze that\n" - "eliminates all stat changes."); - -const u8 sReflectDescription[] = _( - "Creates a wall of light that\n" - "weakens physical attacks."); - -const u8 sFocusEnergyDescription[] = _( - "Focuses power to raise the\n" - "critical-hit ratio."); - -const u8 sBideDescription[] = _( - "Endures attack for 2\n" - "turns to retaliate double."); - -const u8 sMetronomeDescription[] = _( - "Waggles a finger to use any\n" - "Pokémon move at random."); - -const u8 sMirrorMoveDescription[] = _( - "Counters the foe's attack\n" - "with the same move."); - -const u8 sSelfDestructDescription[] = _( - "Inflicts severe damage but\n" - "makes the user faint."); - -const u8 sEggBombDescription[] = _( - "An egg is forcibly hurled at\n" - "the foe."); - -const u8 sLickDescription[] = _( - "Licks with a long tongue to\n" - "injure. May also paralyze."); - -const u8 sSmogDescription[] = _( - "An exhaust-gas attack\n" - "that may also poison."); - -const u8 sSludgeDescription[] = _( - "Sludge is hurled to inflict\n" - "damage. May also poison."); - -const u8 sBoneClubDescription[] = _( - "Clubs the foe with a bone.\n" - "May cause flinching."); - -const u8 sFireBlastDescription[] = _( - "Incinerates everything it\n" - "strikes. May cause a burn."); - -const u8 sWaterfallDescription[] = _( - "Charges the foe with speed\n" - "to climb waterfalls."); - -const u8 sClampDescription[] = _( - "Traps and squeezes the\n" - "foe for "BINDING_TURNS" turns."); - -const u8 sSwiftDescription[] = _( - "Sprays star-shaped rays\n" - "that never miss."); - -const u8 sSkullBashDescription[] = _( - "Tucks in the head, then\n" - "attacks on the next turn."); - -const u8 sSpikeCannonDescription[] = _( - "Launches sharp spikes that\n" - "strike 2 to 5 times."); - -const u8 sConstrictDescription[] = _( - "constricts to inflict pain.\n" - "May lower Speed."); - -const u8 sAmnesiaDescription[] = _( - "Forgets about something\n" - "and sharply raises Sp. Def."); - -const u8 sKinesisDescription[] = _( - "Distracts the foe.\n" - "May lower accuracy."); - -const u8 sSoftBoiledDescription[] = _( - "Recovers up to half the\n" - "user's maximum HP."); - -const u8 sHighJumpKickDescription[] = _( - "A jumping knee kick. If it\n" - "misses, the user is hurt."); - -const u8 sGlareDescription[] = _( - "Intimidates and frightens\n" - "the foe into paralysis."); - -const u8 sDreamEaterDescription[] = _( - "Takes one half the damage\n" - "inflicted on a sleeping foe."); - -const u8 sPoisonGasDescription[] = _( - "Envelops the foe in a toxic\n" - "gas that may poison."); - -const u8 sBarrageDescription[] = _( - "Hurls round objects at the\n" - "foe 2 to 5 times."); - -const u8 sLeechLifeDescription[] = _( - "An attack that steals half\n" - "the damage inflicted."); - -const u8 sLovelyKissDescription[] = _( - "Demands a kiss with a scary\n" - "face that induces sleep."); - -const u8 sSkyAttackDescription[] = _( - "Searches out weak spots,\n" - "then strikes the next turn."); - -const u8 sTransformDescription[] = _( - "Alters the user's cells to\n" - "become a copy of the foe."); - -const u8 sBubbleDescription[] = _( - "An attack using bubbles.\n" - "May lower the foe's Speed."); - -const u8 sDizzyPunchDescription[] = _( - "A rhythmic punch that may\n" - "confuse the foe."); - -const u8 sSporeDescription[] = _( - "Scatters a cloud of spores\n" - "that always induce sleep."); - -const u8 sFlashDescription[] = _( - "Looses a powerful blast of\n" - "light that cuts accuracy."); - -const u8 sPsywaveDescription[] = _( - "Attacks with a psychic\n" - "wave of varying intensity."); - -const u8 sSplashDescription[] = _( - "It's just a splash...\n" - "Has no effect whatsoever."); - -const u8 sAcidArmorDescription[] = _( - "Liquifies the user's body\n" - "to sharply raise Defense."); - -const u8 sCrabhammerDescription[] = _( - "Hammers with a pincer. Has a\n" - "high critical-hit ratio."); - -const u8 sExplosionDescription[] = _( - "Inflicts severe damage but\n" - "makes the user faint."); - -const u8 sFurySwipesDescription[] = _( - "Rakes the foe with sharp\n" - "claws, etc., 2 to 5 times."); - -const u8 sBonemerangDescription[] = _( - "Throws a bone boomerang\n" - "that strikes twice."); - -const u8 sRestDescription[] = _( - "The user sleeps for 2 turns,\n" - "restoring HP and status."); - -const u8 sRockSlideDescription[] = _( - "Large boulders are hurled.\n" - "May cause flinching."); - -const u8 sHyperFangDescription[] = _( - "Attacks with sharp fangs.\n" - "May cause flinching."); - -const u8 sSharpenDescription[] = _( - "Reduces the polygon count\n" - "and raises Attack."); - -const u8 sConversionDescription[] = _( - "Changes the user's type\n" - "into a known move's type."); - -const u8 sTriAttackDescription[] = _( - "Fires three types of beams\n" - "at the same time."); - -const u8 sSuperFangDescription[] = _( - "Attacks with sharp fangs\n" - "and cuts half the foe's HP."); - -const u8 sSlashDescription[] = _( - "Slashes with claws, etc. Has\n" - "a high critical-hit ratio."); - -const u8 sSubstituteDescription[] = _( - "Creates a decoy using 1/4\n" - "of the user's maximum HP."); - -const u8 sStruggleDescription[] = _( - "Used only if all PP are gone.\n" - "Also hurts the user a little."); - -const u8 sSketchDescription[] = _( - "Copies the foe's last move\n" - "permanently."); - -const u8 sTripleKickDescription[] = _( - "Kicks the foe 3 times in a\n" - "row with rising intensity."); - -const u8 sThiefDescription[] = _( - "While attacking, it may\n" - "steal the foe's held item."); - -const u8 sSpiderWebDescription[] = _( - "Ensnares the foe to stop it\n" - "from fleeing or switching."); - -const u8 sMindReaderDescription[] = _( - "Senses the foe's action to\n" - "ensure the next move's hit."); - -const u8 sNightmareDescription[] = _( - "Inflicts 1/4 damage on a\n" - "sleeping foe every turn."); - -const u8 sFlameWheelDescription[] = _( - "A fiery charge attack that\n" - "may inflict a burn."); - -const u8 sSnoreDescription[] = _( - "A loud attack that can be\n" - "used only while asleep."); - -const u8 sCurseDescription[] = _( - "A move that functions\n" - "differently for GHOSTS."); - -const u8 sFlailDescription[] = _( - "Inflicts more damage when\n" - "the user's HP is down."); - -const u8 sConversion2Description[] = _( - "Makes the user resistant\n" - "to the last attack's type."); - -const u8 sAeroblastDescription[] = _( - "Launches a vacuumed blast.\n" - "High critical-hit ratio."); - -const u8 sCottonSporeDescription[] = _( - "Spores cling to the foe,\n" - "sharply reducing Speed."); - -const u8 sReversalDescription[] = _( - "Inflicts more damage when\n" - "the user's HP is down."); - -const u8 sSpiteDescription[] = _( - "Spitefully cuts the PP\n" - "of the foe's last move."); - -const u8 sPowderSnowDescription[] = _( - "Blasts the foe with a snowy\n" - "gust. May cause freezing."); - -const u8 sProtectDescription[] = _( - "Evades attack, but may fail\n" - "if used in succession."); - -const u8 sMachPunchDescription[] = _( - "A punch is thrown at wicked\n" - "speed to strike first."); - -const u8 sScaryFaceDescription[] = _( - "Frightens with a scary face\n" - "to sharply reduce Speed."); - -const u8 sFeintAttackDescription[] = _( - "Draws the foe close, then\n" - "strikes without fail."); - -const u8 sSweetKissDescription[] = _( - "Demands a kiss with a cute\n" - "look. May cause confusion."); - -const u8 sBellyDrumDescription[] = _( - "Maximizes Attack while\n" - "sacrificing HP."); - -const u8 sSludgeBombDescription[] = _( - "Sludge is hurled to inflict\n" - "damage. May also poison."); - -const u8 sMudSlapDescription[] = _( - "Hurls mud in the foe's face\n" - "to reduce its accuracy."); - -const u8 sOctazookaDescription[] = _( - "Fires a lump of ink to\n" - "damage and cut accuracy."); - -const u8 sSpikesDescription[] = _( - "Sets spikes that hurt a \n" - "foe switching in."); - -const u8 sZapCannonDescription[] = _( - "Powerful and sure to cause\n" - "paralysis, but inaccurate."); - -const u8 sForesightDescription[] = _( - "Negates the foe's efforts\n" - "to heighten evasiveness."); - -const u8 sDestinyBondDescription[] = _( - "If the user faints, the foe\n" - "is also made to faint."); - -const u8 sPerishSongDescription[] = _( - "Any Pokémon hearing this\n" - "song faints in 3 turns."); - -const u8 sIcyWindDescription[] = _( - "A chilling attack that\n" - "lowers the foe's Speed."); - -const u8 sDetectDescription[] = _( - "Evades attack, but may fail\n" - "if used in succession."); - -const u8 sBoneRushDescription[] = _( - "Strikes the foe with a bone\n" - "in hand 2 to 5 times."); - -const u8 sLockOnDescription[] = _( - "Locks on to the foe to\n" - "ensure the next move hits."); - -const u8 sOutrageDescription[] = _( - "A rampage of 2 to 3 turns\n" - "that confuses the user."); - -const u8 sSandstormDescription[] = _( - "Causes a sandstorm that\n" - "rages for several turns."); - -const u8 sGigaDrainDescription[] = _( - "An attack that steals half\n" - "the damage inflicted."); - -const u8 sEndureDescription[] = _( - "Endures any attack for\n" - "1 turn, leaving at least 1HP."); - -const u8 sCharmDescription[] = _( - "Charms the foe and sharply\n" - "reduces its Attack."); - -const u8 sRolloutDescription[] = _( - "An attack lasting 5 turns\n" - "with rising intensity."); - -const u8 sFalseSwipeDescription[] = _( - "An attack that leaves the\n" - "foe with at least 1 HP."); - -const u8 sSwaggerDescription[] = _( - "Confuses the foe, but also\n" - "sharply raises Attack."); - -const u8 sMilkDrinkDescription[] = _( - "Recovers up to half the\n" - "user's maximum HP."); - -const u8 sSparkDescription[] = _( - "An electrified tackle that\n" - "may paralyze the foe."); - -const u8 sFuryCutterDescription[] = _( - "An attack that intensifies\n" - "on each successive hit."); - -const u8 sSteelWingDescription[] = _( - "Strikes the foe with hard\n" - "wings spread wide."); - -const u8 sMeanLookDescription[] = _( - "Fixes the foe with a mean\n" - "look that prevents escape."); - -const u8 sAttractDescription[] = _( - "Makes the opposite gender\n" - "less likely to attack."); - -const u8 sSleepTalkDescription[] = _( - "Uses an available move\n" - "randomly while asleep."); - -const u8 sHealBellDescription[] = _( - "Chimes soothingly to heal\n" - "all status abnormalities."); - -const u8 sReturnDescription[] = _( - "An attack that increases\n" - "in power with friendship."); - -const u8 sPresentDescription[] = _( - "A gift in the form of a\n" - "bomb. May restore HP."); - -const u8 sFrustrationDescription[] = _( - "An attack that is stronger\n" - "if the Trainer is disliked."); - -const u8 sSafeguardDescription[] = _( - "A mystical force prevents\n" - "all status problems."); - -const u8 sPainSplitDescription[] = _( - "Adds the user and foe's HP,\n" - "then shares them equally."); - -const u8 sSacredFireDescription[] = _( - "A mystical fire attack that\n" - "may inflict a burn."); - -const u8 sMagnitudeDescription[] = _( - "A ground-shaking attack\n" - "of random intensity."); - -const u8 sDynamicPunchDescription[] = _( - "Powerful and sure to cause\n" - "confusion, but inaccurate."); - -const u8 sMegahornDescription[] = _( - "A brutal ramming attack\n" - "using out-thrust horns."); - -const u8 sDragonBreathDescription[] = _( - "Strikes the foe with an\n" - "incredible blast of breath."); - -const u8 sBatonPassDescription[] = _( - "Switches out the user while\n" - "keeping effects in play."); - -const u8 sEncoreDescription[] = _( - "Makes the foe repeat its\n" - "last move over 2 to 6 turns."); - -const u8 sPursuitDescription[] = _( - "Inflicts bad damage if used\n" - "on a foe switching out."); - -const u8 sRapidSpinDescription[] = _( - "Spins the body at high\n" - "speed to strike the foe."); - -const u8 sSweetScentDescription[] = _( - "Allures the foe to reduce\n" - "evasiveness."); - -const u8 sIronTailDescription[] = _( - "Attacks with a rock-hard\n" - "tail. May lower Defense."); - -const u8 sMetalClawDescription[] = _( - "A claw attack that may\n" - "raise the user's Attack."); - -const u8 sVitalThrowDescription[] = _( - "Makes the user's move last,\n" - "but it never misses."); - -const u8 sMorningSunDescription[] = _( - "Restores HP. The amount\n" - "varies with the weather."); - -const u8 sSynthesisDescription[] = _( - "Restores HP. The amount\n" - "varies with the weather."); - -const u8 sMoonlightDescription[] = _( - "Restores HP. The amount\n" - "varies with the weather."); - -const u8 sHiddenPowerDescription[] = _( - "The effectiveness varies\n" - "with the user."); - -const u8 sCrossChopDescription[] = _( - "A double-chopping attack.\n" - "High critical-hit ratio."); - -const u8 sTwisterDescription[] = _( - "Whips up a vicious twister\n" - "to tear at the foe."); - -const u8 sRainDanceDescription[] = _( - "Boosts the power of Water-\n" - "type moves for 5 turns."); - -const u8 sSunnyDayDescription[] = _( - "Boosts the power of Fire-\n" - "type moves for 5 turns."); - -const u8 sCrunchDescription[] = _( - "Crunches with sharp fangs.\n" -#if B_UPDATED_MOVE_DATA >= GEN_4 - "May lower Defense."); -#else - "May lower Sp. Def."); -#endif - -const u8 sMirrorCoatDescription[] = _( - "Counters the foe's special\n" - "attack at double the power."); - -const u8 sPsychUpDescription[] = _( - "Copies the foe's effect(s)\n" - "and gives to the user."); - -const u8 sExtremeSpeedDescription[] = _( - "An extremely fast and\n" - "powerful attack."); - -const u8 sAncientPowerDescription[] = _( - "An attack that may raise\n" - "all stats."); - -const u8 sShadowBallDescription[] = _( - "Hurls a black blob that may\n" - "lower the foe's Sp. Def."); - -const u8 sFutureSightDescription[] = _( - "Heightens inner power to\n" - "strike 2 turns later."); - -const u8 sRockSmashDescription[] = _( - "A rock-crushing attack\n" - "that may lower Defense."); - -const u8 sWhirlpoolDescription[] = _( - "Traps and hurts the foe in\n" - "a whirlpool for "BINDING_TURNS" turns."); - -const u8 sBeatUpDescription[] = _( - "Summons party Pokémon to\n" - "join in the attack."); - -const u8 sFakeOutDescription[] = _( - "A 1st-turn, 1st-strike move\n" - "that causes flinching."); - -const u8 sUproarDescription[] = _( -#if B_UPROAR_TURNS >= GEN_5 - "Causes an uproar for 2 to 5\n" -#else - "Causes an uproar for 3\n" -#endif - "turns and prevents sleep."); - -const u8 sStockpileDescription[] = _( - "Charges up power for up to\n" - "3 turns."); - -const u8 sSpitUpDescription[] = _( - "Releases stockpiled power\n" - "(the more the better)."); - -const u8 sSwallowDescription[] = _( - "Absorbs stockpiled power\n" - "and restores HP."); - -const u8 sHeatWaveDescription[] = _( - "Exhales a hot breath on the\n" - "foe. May inflict a burn."); - -const u8 sHailDescription[] = _( - "Summons a hailstorm that\n" - "strikes every turn."); - -const u8 sTormentDescription[] = _( - "Torments the foe and stops\n" - "successive use of a move."); - -const u8 sFlatterDescription[] = _( - "Confuses the foe, but\n" - "raises its Sp. Atk."); - -const u8 sWillOWispDescription[] = _( - "Inflicts a burn on the foe\n" - "with intense fire."); - -const u8 sMementoDescription[] = _( - "The user faints and lowers\n" - "the foe's abilities."); - -const u8 sFacadeDescription[] = _( - "Boosts Attack when burned,\n" - "paralyzed, or poisoned."); - -const u8 sFocusPunchDescription[] = _( - "A powerful loyalty attack.\n" - "The user flinches if hit."); - -const u8 sSmellingSaltsDescription[] = _( - "Powerful against paralyzed\n" - "foes, but also heals them."); - -const u8 sFollowMeDescription[] = _( - "Draws attention to make\n" - "foes attack only the user."); - -const u8 sNaturePowerDescription[] = _( - "The type of attack varies\n" - "depending on the location."); - -const u8 sChargeDescription[] = _( - "Charges power to boost the\n" - "electric move used next."); - -const u8 sTauntDescription[] = _( - "Taunts the foe into only\n" - "using attack moves."); - -const u8 sHelpingHandDescription[] = _( - "Boosts the power of the\n" - "recipient's moves."); - -const u8 sTrickDescription[] = _( - "Tricks the foe into trading\n" - "held items."); - -const u8 sRolePlayDescription[] = _( - "Mimics the target and\n" - "copies its special ability."); - -const u8 sWishDescription[] = _( - "A wish that restores HP.\n" - "It takes time to work."); - -const u8 sAssistDescription[] = _( - "Attacks randomly with one\n" - "of the partner's moves."); - -const u8 sIngrainDescription[] = _( - "Lays roots that restore HP.\n" - "The user can't switch out."); - -const u8 sSuperpowerDescription[] = _( - "Boosts strength sharply,\n" - "but lowers abilities."); - -const u8 sMagicCoatDescription[] = _( - "Reflects special effects\n" - "back to the attacker."); - -const u8 sRecycleDescription[] = _( - "Recycles a used item for\n" - "one more use."); - -const u8 sRevengeDescription[] = _( - "An attack that gains power\n" - "if injured by the foe."); - -const u8 sBrickBreakDescription[] = _( - "Destroys barriers such as\n" - "REFLECT and causes damage."); - -const u8 sYawnDescription[] = _( - "Lulls the foe into yawning,\n" - "then sleeping next turn."); - -const u8 sKnockOffDescription[] = _( - "Knocks down the foe's held\n" - "item to prevent its use."); - -const u8 sEndeavorDescription[] = _( - "Gains power if the user's HP\n" - "is lower than the foe's HP."); - -const u8 sEruptionDescription[] = _( - "The higher the user's HP,\n" - "the more damage caused."); - -const u8 sSkillSwapDescription[] = _( - "The user swaps special\n" - "abilities with the target."); - -const u8 sImprisonDescription[] = _( - "Prevents foes from using\n" - "moves known by the user."); - -const u8 sRefreshDescription[] = _( - "Heals poisoning, paralysis,\n" - "or a burn."); - -const u8 sGrudgeDescription[] = _( - "If the user faints, deletes\n" - "all PP of foe's last move."); - -const u8 sSnatchDescription[] = _( - "Steals the effects of the\n" - "move the target uses next."); - -const u8 sSecretPowerDescription[] = _( - "An attack with effects\n" - "that vary by location."); - -const u8 sDiveDescription[] = _( - "Dives underwater the first\n" - "turn and strikes next turn."); - -const u8 sArmThrustDescription[] = _( - "Straight-arm punches that\n" - "strike the foe 2 to 5 times."); - -const u8 sCamouflageDescription[] = _( - "Alters the Pokémon's type\n" - "depending on the location."); - -const u8 sTailGlowDescription[] = _( - "Flashes a light that sharply\n" - "raises Sp. Atk."); - -const u8 sLusterPurgeDescription[] = _( - "Attacks with a burst of\n" - "light. May lower Sp. Def."); - -const u8 sMistBallDescription[] = _( - "Attacks with a flurry of\n" - "down. May lower Sp. Atk."); - -const u8 sFeatherDanceDescription[] = _( - "Envelops the foe with down\n" - "to sharply reduce Attack."); - -const u8 sTeeterDanceDescription[] = _( - "Confuses all Pokémon on\n" - "the scene."); - -const u8 sBlazeKickDescription[] = _( - "A kick with a high critical-\n" - "hit ratio. May cause a burn."); - -const u8 sMudSportDescription[] = _( - "Covers the user in mud to\n" - "raise electrical resistance."); - -const u8 sIceBallDescription[] = _( - "A 5-turn attack that gains\n" - "power on successive hits."); - -const u8 sNeedleArmDescription[] = _( - "Attacks with thorny arms.\n" - "May cause flinching."); - -const u8 sSlackOffDescription[] = _( - "Slacks off and restores\n" - "half the maximum HP."); - -const u8 sHyperVoiceDescription[] = _( - "A loud attack that uses\n" - "sound waves to injure."); - -const u8 sPoisonFangDescription[] = _( - "A sharp-fanged attack.\n" - "May badly poison the foe."); - -const u8 sCrushClawDescription[] = _( - "Tears at the foe with sharp\n" - "claws. May lower Defense."); - -const u8 sBlastBurnDescription[] = _( - "Powerful, but leaves the\n" - "user immobile the next turn."); - -const u8 sHydroCannonDescription[] = _( - "Powerful, but leaves the\n" - "user immobile the next turn."); - -const u8 sMeteorMashDescription[] = _( - "Fires a meteor-like punch.\n" - "May raise Attack."); - -const u8 sAstonishDescription[] = _( - "An attack that may shock\n" - "the foe into flinching."); - -const u8 sWeatherBallDescription[] = _( - "The move's type and power\n" - "change with the weather."); - -const u8 sAromatherapyDescription[] = _( - "Heals all status problems\n" - "with a soothing scent."); - -const u8 sFakeTearsDescription[] = _( - "Feigns crying to sharply\n" - "lower the foe's Sp. Def."); - -const u8 sAirCutterDescription[] = _( - "Hacks with razorlike wind.\n" - "High critical-hit ratio."); - -const u8 sOverheatDescription[] = _( - "Allows a full-power attack,\n" - "but sharply lowers Sp. Atk."); - -const u8 sOdorSleuthDescription[] = _( - "Negates the foe's efforts\n" - "to heighten evasiveness."); - -const u8 sRockTombDescription[] = _( - "Stops the foe from moving\n" - "with rocks and cuts Speed."); - -const u8 sSilverWindDescription[] = _( - "A powdery attack that may\n" - "raise abilities."); - -const u8 sMetalSoundDescription[] = _( - "Emits a horrible screech\n" - "that sharply lowers Sp. Def."); - -const u8 sGrassWhistleDescription[] = _( - "Lulls the foe into sleep\n" - "with a pleasant melody."); - -const u8 sTickleDescription[] = _( - "Makes the foe laugh to\n" - "lower Attack and Defense."); - -const u8 sCosmicPowerDescription[] = _( - "Raises Defense and Sp. Def\n" - "with a mystic power."); - -const u8 sWaterSpoutDescription[] = _( - "Inflicts more damage if the\n" - "user's HP is high."); - -const u8 sSignalBeamDescription[] = _( - "A strange beam attack that\n" - "may confuse the foe."); - -const u8 sShadowPunchDescription[] = _( - "An unavoidable punch that\n" - "is thrown from shadows."); - -const u8 sExtrasensoryDescription[] = _( - "Attacks with a peculiar\n" - "power. May cause flinching."); - -const u8 sSkyUppercutDescription[] = _( - "An uppercut thrown as if\n" - "leaping into the sky."); - -const u8 sSandTombDescription[] = _( - "Traps and hurts the foe in\n" - "quicksand for "BINDING_TURNS" turns."); - -const u8 sSheerColdDescription[] = _( - "A chilling attack that\n" - "causes fainting if it hits."); - -const u8 sMuddyWaterDescription[] = _( - "Attacks with muddy water.\n" - "May lower accuracy."); - -const u8 sBulletSeedDescription[] = _( - "Shoots 2 to 5 seeds in a row\n" - "to strike the foe."); - -const u8 sAerialAceDescription[] = _( - "An extremely speedy and\n" - "unavoidable attack."); - -const u8 sIcicleSpearDescription[] = _( - "Attacks the foe by firing\n" - "2 to 5 icicles in a row."); - -const u8 sIronDefenseDescription[] = _( - "Hardens the body's surface\n" - "to sharply raise Defense."); - -const u8 sBlockDescription[] = _( - "Blocks the foe's way to\n" - "prevent escape."); - -const u8 sHowlDescription[] = _( - "Howls to raise the spirit\n" - "and boosts Attack."); - -const u8 sDragonClawDescription[] = _( - "Slashes the foe with sharp\n" - "claws."); - -const u8 sFrenzyPlantDescription[] = _( - "Powerful, but leaves the\n" - "user immobile the next turn."); - -const u8 sBulkUpDescription[] = _( - "Bulks up the body to boost\n" - "both Attack and Defense."); - -const u8 sBounceDescription[] = _( - "Bounces up, then down the\n" - "next turn. May paralyze."); - -const u8 sMudShotDescription[] = _( - "Hurls mud at the foe and\n" - "reduces Speed."); - -const u8 sPoisonTailDescription[] = _( - "Has a high critical-hit\n" - "ratio. May also poison."); - -const u8 sCovetDescription[] = _( - "Cutely begs to obtain an\n" - "item held by the foe."); - -const u8 sVoltTackleDescription[] = _( - "A life-risking tackle that\n" - "slightly hurts the user."); - -const u8 sMagicalLeafDescription[] = _( - "Attacks with a strange leaf\n" - "that cannot be evaded."); - -const u8 sWaterSportDescription[] = _( - "The user becomes soaked to\n" - "raise resistance to fire."); - -const u8 sCalmMindDescription[] = _( - "Raises Sp. Atk and Sp. Def\n" - "by focusing the mind."); - -const u8 sLeafBladeDescription[] = _( - "Slashes with a sharp leaf.\n" - "High critical-hit ratio."); - -const u8 sDragonDanceDescription[] = _( - "A mystical dance that ups\n" - "Attack and Speed."); - -const u8 sRockBlastDescription[] = _( - "Hurls boulders at the foe\n" - "2 to 5 times in a row."); - -const u8 sShockWaveDescription[] = _( - "A fast and unavoidable\n" - "electric attack."); - -const u8 sWaterPulseDescription[] = _( - "Attacks with ultrasonic\n" - "waves. May confuse the foe."); - -const u8 sDoomDesireDescription[] = _( - "Summons strong sunlight to\n" - "attack 2 turns later."); - -const u8 sPsychoBoostDescription[] = _( - "Allows a full-power attack,\n" - "but sharply lowers Sp. Atk."); - -const u8 sRoostDescription[] = _( - "Restores the user's HP by\n" - "half of its max HP."); - -const u8 sGravityDescription[] = _( - "Gravity is intensified\n" - "negating levitation."); - -const u8 sMiracleEyeDescription[] = _( - "Negate evasiveness and\n" - "Dark-type's immunities."); - -const u8 sWakeUpSlapDescription[] = _( - "Powerful against sleeping\n" - "foes, but also heals them."); - -const u8 sHammerArmDescription[] = _( - "A swinging fist attack\n" - "that also lowers Speed."); - -const u8 sGyroBallDescription[] = _( - "A high-speed spin that does\n" - "more damage to faster foes."); - -const u8 sHealingWishDescription[] = _( - "The user faints to heal up\n" - "the recipient."); - -const u8 sBrineDescription[] = _( - "Does double damage to foes\n" - "with half HP."); - -const u8 sNaturalGiftDescription[] = _( - "The effectiveness varies\n" - "with the held Berry."); - -const u8 sFeintDescription[] = _( - "An attack that hits foes\n" - "using moves like Protect."); - -const u8 sPluckDescription[] = _( - "Eats the foe's held Berry\n" - "gaining its effect."); - -const u8 sTailwindDescription[] = _( - "Whips up a turbulent breeze\n" - "that raises Speed."); - -const u8 sAcupressureDescription[] = _( - "The user sharply raises\n" - "one of its stats."); - -const u8 sMetalBurstDescription[] = _( - "Retaliates any hit with\n" - "greater power."); - -const u8 sUTurnDescription[] = _( - "Does damage then switches\n" - "out the user."); - -const u8 sCloseCombatDescription[] = _( - "A strong attack but lowers\n" - "the defensive stats."); - -const u8 sPaybackDescription[] = _( - "An attack that gains power\n" - "if the user moves last."); - -const u8 sAssuranceDescription[] = _( - "An attack that gains power\n" - "if the foe has been hurt."); - -const u8 sEmbargoDescription[] = _( - "Prevents the foe from\n" - "using any items."); - -const u8 sFlingDescription[] = _( - "The effectiveness varies\n" - "with the held item."); - -const u8 sPsychoShiftDescription[] = _( - "Transfers status problems\n" - "to the foe."); - -const u8 sTrumpCardDescription[] = _( - "The less PP the move has\n" - "the more damage it does."); - -const u8 sHealBlockDescription[] = _( - "Prevents the foe from\n" - "recovering any HP."); - -const u8 sWringOutDescription[] = _( - "The higher the foe's HP\n" - "the more damage caused."); - -const u8 sPowerTrickDescription[] = _( - "The user swaps its Attack\n" - "and Defense stats."); - -const u8 sGastroAcidDescription[] = _( - "Stomach acid suppresses\n" - "the foe's ability."); - -const u8 sLuckyChantDescription[] = _( - "Prevents the foe from\n" - "landing critical hits."); - -const u8 sMeFirstDescription[] = _( - "Executes the foe's attack\n" - "with greater power."); - -const u8 sCopycatDescription[] = _( - "The user mimics the last\n" - "move used by a foe."); - -const u8 sPowerSwapDescription[] = _( - "Swaps changes to Attack\n" - "and Sp. Atk with the foe."); - -const u8 sGuardSwapDescription[] = _( - "Swaps changes to Defense\n" - "and Sp. Def with the foe."); - -const u8 sPunishmentDescription[] = _( - "Does more damage if the\n" - "foe has powered up."); - -const u8 sLastResortDescription[] = _( - "Can only be used if every\n" - "other move has been used."); - -const u8 sWorrySeedDescription[] = _( - "Plants a seed on the foe\n" - "giving it Insomnia."); - -const u8 sSuckerPunchDescription[] = _( - "Strikes first if the foe\n" - "is preparing an attack."); - -const u8 sToxicSpikesDescription[] = _( - "Sets spikes that poison a\n" - "foe switching in."); - -const u8 sHeartSwapDescription[] = _( - "Swaps any stat changes\n" - "with the foe."); - -const u8 sAquaRingDescription[] = _( - "Forms a veil of water\n" - "that restores HP."); - -const u8 sMagnetRiseDescription[] = _( - "The user levitates with\n" - "electromagnetism."); - -const u8 sFlareBlitzDescription[] = _( - "A charge that may burn the\n" - "foe. Also hurts the user."); - -const u8 sForcePalmDescription[] = _( - "A shock wave attack that\n" - "may paralyze the foe."); - -const u8 sAuraSphereDescription[] = _( - "Attacks with an aura blast\n" - "that cannot be evaded."); - -const u8 sRockPolishDescription[] = _( - "Polishes the body to\n" - "sharply raise Speed."); - -const u8 sPoisonJabDescription[] = _( - "A stabbing attack that\n" - "may poison the foe."); - -const u8 sDarkPulseDescription[] = _( - "Attacks with a horrible\n" - "aura. May cause flinching."); - -const u8 sNightSlashDescription[] = _( - "Hits as soon as possible.\n" - "High critical-hit ratio."); - -const u8 sAquaTailDescription[] = _( - "The user swings its tail\n" - "like a wave to attack."); - -const u8 sSeedBombDescription[] = _( - "A barrage of hard seeds\n" - "is fired at the foe."); - -const u8 sAirSlashDescription[] = _( - "Attacks with a blade of\n" - "air. May cause flinching."); - -const u8 sXScissorDescription[] = _( - "Slashes the foe with crossed\n" - "scythes, claws, etc."); - -const u8 sBugBuzzDescription[] = _( - "A damaging sound wave that\n" - "may lower Sp. Def."); - -const u8 sDragonPulseDescription[] = _( - "Generates a shock wave to\n" - "damage the foe."); - -const u8 sDragonRushDescription[] = _( - "Tackles the foe with menace.\n" - "May cause flinching."); - -const u8 sPowerGemDescription[] = _( - "Attacks with rays of light\n" - "that sparkle like diamonds."); - -const u8 sVacuumWaveDescription[] = _( - "Whirls its fists to send\n" - "a wave that strikes first."); - -const u8 sFocusBlastDescription[] = _( - "Attacks at full power.\n" - "May lower Sp. Def."); - -const u8 sEnergyBallDescription[] = _( - "Draws power from nature to\n" - "attack. May lower Sp. Def."); - -const u8 sBraveBirdDescription[] = _( - "A low altitude charge that\n" - "also hurts the user."); - -const u8 sEarthPowerDescription[] = _( - "Makes the ground erupt with\n" - "power. May lower Sp. Def."); - -const u8 sSwitcherooDescription[] = _( - "Swaps items with the foe\n" - "faster than the eye can see."); - -const u8 sNastyPlotDescription[] = _( - "Thinks bad thoughts to\n" - "sharply boost Sp. Atk."); - -const u8 sBulletPunchDescription[] = _( - "Punches as fast as a bul-\n" - "let. It always hits first."); - -const u8 sIceShardDescription[] = _( - "Hurls a chunk of ice that\n" - "always strike first."); - -const u8 sShadowClawDescription[] = _( - "Strikes with a shadow claw.\n" - "High critical-hit ratio."); - -const u8 sThunderFangDescription[] = _( - "May cause flinching or\n" - "leave the foe paralyzed."); - -const u8 sIceFangDescription[] = _( - "May cause flinching or\n" - "leave the foe frozen."); - -const u8 sFireFangDescription[] = _( - "May cause flinching or\n" - "leave the foe with a burn."); - -const u8 sShadowSneakDescription[] = _( - "Extends the user's shadow\n" - "to strike first."); - -const u8 sMudBombDescription[] = _( - "Throws a blob of mud to\n" - "damage and cut accuracy."); - -const u8 sPsychoCutDescription[] = _( - "Tears with psychic blades.\n" - "High critical-hit ratio."); - -const u8 sZenHeadbuttDescription[] = _( - "Hits with a strong head-\n" - "butt. May cause flinching."); - -const u8 sMirrorShotDescription[] = _( - "Emits a flash of energy to\n" - "damage and cut accuracy."); - -const u8 sFlashCannonDescription[] = _( - "Releases a blast of light\n" - "that may lower Sp. Def."); - -const u8 sRockClimbDescription[] = _( - "A charging attack that may\n" - "confuse the foe."); - -const u8 sDefogDescription[] = _( - "Removes obstacles and\n" - "lowers evasion."); - -const u8 sTrickRoomDescription[] = _( - "Slower Pokémon get to move\n" - "first for 5 turns."); - -const u8 sDracoMeteorDescription[] = _( - "Casts comets onto the foe.\n" - "Harshly lowers the Sp. Atk."); - -const u8 sDischargeDescription[] = _( - "Zaps the foes with electri-\n" - "city. May paralyze them."); - -const u8 sPowerWhipDescription[] = _( - "Violently lashes the foe\n" - "with vines or tentacles."); - -const u8 sCrossPoisonDescription[] = _( - "A slash that may poison a\n" - "foe and do critical damage."); - -const u8 sGunkShotDescription[] = _( - "Shoots filthy garbage at\n" - "the foe. May also poison."); - -const u8 sIronHeadDescription[] = _( - "Slams the foe with a hard\n" - "head. May cause flinching."); - -const u8 sMagnetBombDescription[] = _( - "Launches a magnet that\n" - "strikes without fail."); - -const u8 sStoneEdgeDescription[] = _( - "Stabs the foe with stones.\n" - "High critical-hit ratio."); - -const u8 sCaptivateDescription[] = _( - "Makes the opposite gender\n" - "sharply reduce its Sp. Atk."); - -const u8 sStealthRockDescription[] = _( - "Sets floating stones that\n" - "hurt a foe switching in."); - -const u8 sGrassKnotDescription[] = _( - "A snare attack that does\n" - "more damage to heavier foes."); - -const u8 sChatterDescription[] = _( - "Attacks with a sound wave\n" - "that causes confusion."); - -const u8 sJudgmentDescription[] = _( - "The type varies with the\n" - "kind of Plate held."); - -const u8 sChargeBeamDescription[] = _( - "Fires a beam of electricity.\n" - "May raise Sp. Atk."); - -const u8 sWoodHammerDescription[] = _( - "Slams the body into a foe.\n" - "The user gets hurt too."); - -const u8 sAquaJetDescription[] = _( - "Strikes first by dashing\n" - "at the foe at a high speed."); - -const u8 sAttackOrderDescription[] = _( - "Underlings pummel the foe.\n" - "High critical-hit ratio."); - -const u8 sDefendOrderDescription[] = _( - "Raises Defense and Sp. Def\n" - "with a living shield."); - -const u8 sHealOrderDescription[] = _( - "The user's underlings show\n" - "up to heal half its max HP."); - -const u8 sHeadSmashDescription[] = _( - "A life-risking headbutt that\n" - "seriously hurts the user."); - -const u8 sDoubleHitDescription[] = _( - "Slams the foe with a tail\n" - "etc. Strikes twice."); - -const u8 sRoarOfTimeDescription[] = _( - "Powerful, but leaves the\n" - "user immobile the next turn."); - -const u8 sSpacialRendDescription[] = _( - "Tears the foe, and space.\n" - "High critical-hit ratio."); - -const u8 sMagmaStormDescription[] = _( - "Traps the foe in a vortex\n" - "of fire for "BINDING_TURNS" turns."); - -const u8 sDarkVoidDescription[] = _( - "Drags the foe into total\n" - "darkness, inducing Sleep."); - -const u8 sSeedFlareDescription[] = _( - "Generates a shock wave that\n" - "sharply reduces Sp. Def."); - -const u8 sOminousWindDescription[] = _( - "A repulsive attack that may\n" - "raise all stats."); - -const u8 sShadowForceDescription[] = _( - "Vanishes on the first turn\n" - "then strikes the next turn."); - -const u8 sHoneClawsDescription[] = _( - "Sharpens its claws to raise\n" - "Attack and Accuracy."); - -const u8 sWideGuardDescription[] = _( - "Evades wide-ranging attacks\n" - "for one turn."); - -const u8 sGuardSplitDescription[] = _( - "Averages changes to Defense\n" - "and Sp. Def with the foe."); - -const u8 sPowerSplitDescription[] = _( - "Averages changes to Attack\n" - "and Sp. Atk with the foe."); - -const u8 sWonderRoomDescription[] = _( - "Defense and Sp. Def stats\n" - "are swapped for 5 turns."); - -const u8 sPsyshockDescription[] = _( - "Attacks with a psychic wave\n" - "that does physical damage."); - -const u8 sTailSlapDescription[] = _( - "Strikes the foe with its\n" - "tail 2 to 5 times."); - -const u8 sVenoshockDescription[] = _( - "Does double damage if the\n" - "foe is poisoned."); - -const u8 sAutotomizeDescription[] = _( - "Sheds additional weight to\n" - "sharply boost Speed."); - -const u8 sRagePowderDescription[] = _( - "Scatters powder to make\n" - "foes attack only the user."); - -const u8 sTelekinesisDescription[] = _( - "Makes the foe float. It is\n" - "easier to hit for 3 turns."); - -const u8 sMagicRoomDescription[] = _( - "Hold items lose their\n" - "effects for 5 turns."); - -const u8 sSmackDownDescription[] = _( - "Throws a rock to knock the\n" - "foe down to the ground."); - -const u8 sStormThrowDescription[] = _( - "This attack always results\n" - "in a critical hit."); - -const u8 sFlameBurstDescription[] = _( - "A bursting flame that does\n" - "damage to all foes."); - -const u8 sSludgeWaveDescription[] = _( - "Swamps the foe with a wave\n" - "of sludge. May also poison."); - -const u8 sQuiverDanceDescription[] = _( - "Dances to raise Sp. Atk\n" - "Sp. Def and Speed."); - -const u8 sHeavySlamDescription[] = _( - "Does more damage if the\n" - "user outweighs the foe."); - -const u8 sSynchronoiseDescription[] = _( - "An odd shock wave that only\n" - "damages same-type foes."); - -const u8 sElectroBallDescription[] = _( - "Hurls an orb that does more\n" - "damage to slower foes."); - -const u8 sSoakDescription[] = _( - "Sprays water at the foe\n" - "making it Water-type."); - -const u8 sFlameChargeDescription[] = _( - "Attacks in a cloak of\n" - "flames. Raises Speed."); - -const u8 sCoilDescription[] = _( - "Coils up to raise Attack\n" - "Defense and Accuracy."); - -const u8 sLowSweepDescription[] = _( - "Attacks the foe's legs\n" - "lowering its Speed."); - -const u8 sAcidSprayDescription[] = _( - "Sprays a hide-melting acid.\n" - "Sharply reduces Sp. Def."); - -const u8 sFoulPlayDescription[] = _( - "The higher the foe's Attack\n" - "the more damage caused."); - -const u8 sSimpleBeamDescription[] = _( - "A beam that changes the\n" - "foe's ability to Simple."); - -const u8 sEntrainmentDescription[] = _( - "Makes the foe mimic the\n" - "user, gaining its ability."); - -const u8 sAfterYouDescription[] = _( - "Helps out the foe, letting\n" - "it move next."); - -const u8 sRoundDescription[] = _( - "A song that inflicts damage.\n" - "Others can join in too."); - -const u8 sEchoedVoiceDescription[] = _( - "Does more damage every turn\n" - "it is used."); - -const u8 sChipAwayDescription[] = _( - "Strikes through the foe's\n" - "stat changes."); - -const u8 sClearSmogDescription[] = _( - "Attacks with white haze that\n" - "eliminates all stat changes."); - -const u8 sStoredPowerDescription[] = _( - "The higher the user's stats\n" - "the more damage caused."); - -const u8 sQuickGuardDescription[] = _( - "Evades priority attacks\n" - "for one turn."); - -const u8 sAllySwitchDescription[] = _( - "The user switches places\n" - "with its partner."); - -const u8 sScaldDescription[] = _( - "Shoots boiling water at the\n" - "foe. May inflict a burn."); - -const u8 sShellSmashDescription[] = _( - "Raises offensive stats, but\n" - "lowers defensive stats."); - -const u8 sHealPulseDescription[] = _( - "Recovers up to half the\n" - "target's maximum HP."); - -const u8 sHexDescription[] = _( - "Does double damage if the\n" - "foe has a status problem."); - -const u8 sSkyDropDescription[] = _( - "Takes the foe into the sky\n" - "then drops it the next turn."); - -const u8 sShiftGearDescription[] = _( - "Rotates its gears to raise\n" - "Attack and Speed."); - -const u8 sCircleThrowDescription[] = _( - "Knocks the foe away to end\n" - "the battle."); - -const u8 sIncinerateDescription[] = _( - "Burns up Berries and Gems\n" - "preventing their use."); - -const u8 sQuashDescription[] = _( - "Suppresses the foe, making\n" - "it move last."); - -const u8 sAcrobaticsDescription[] = _( - "Does double damage if the\n" - "user has no item."); - -const u8 sReflectTypeDescription[] = _( - "The user reflects the foe's\n" - "type, copying it."); - -const u8 sRetaliateDescription[] = _( - "An attack that does more\n" - "damage if an ally fainted."); - -const u8 sFinalGambitDescription[] = _( - "The user faints to damage\n" - "the foe equal to its HP."); - -const u8 sBestowDescription[] = _( - "The user gives its held\n" - "item to the foe."); - -const u8 sInfernoDescription[] = _( - "Powerful and sure to inflict\n" - "a burn, but inaccurate."); - -const u8 sWaterPledgeDescription[] = _( - "Attacks with a column of\n" - "water. May make a rainbow."); - -const u8 sFirePledgeDescription[] = _( - "Attacks with a column of\n" - "fire. May burn the grass."); - -const u8 sGrassPledgeDescription[] = _( - "Attacks with a column of\n" - "grass. May create a swamp."); - -const u8 sStruggleBugDescription[] = _( - "Resisting, the user attacks\n" - "the foe. Lowers Sp. Atk."); - -const u8 sBulldozeDescription[] = _( - "Stomps down on the ground.\n" - "Lowers Speed."); - -const u8 sWorkUpDescription[] = _( - "The user is roused.\n" - "Ups Attack and Sp. Atk."); - -const u8 sElectrowebDescription[] = _( - "Snares the foe with an\n" - "electric net. Lowers Speed."); - -const u8 sWildChargeDescription[] = _( - "An electrical tackle that\n" - "also hurts the user."); - -const u8 sDrillRunDescription[] = _( - "Spins its body like a drill.\n" - "High critical-hit ratio."); - -const u8 sDualChopDescription[] = _( - "Attacks with brutal hits\n" - "that strike twice."); - -const u8 sHeartStampDescription[] = _( - "A sudden blow after a cute\n" - "act. May cause flinching."); - -const u8 sRazorShellDescription[] = _( - "Tears at the foe with sharp\n" - "shells. May lower Defense."); - -const u8 sLeafTornadoDescription[] = _( - "Circles the foe with leaves\n" - "to damage and cut accuracy."); - -const u8 sSteamrollerDescription[] = _( - "Crushes the foe with its\n" - "body. May cause flinching."); - -const u8 sCottonGuardDescription[] = _( - "Wraps its body in cotton.\n" - "Drastically raises Defense."); - -const u8 sNightDazeDescription[] = _( - "Looses a pitch-black shock\n" - "wave. May lower accuracy."); - -const u8 sHurricaneDescription[] = _( - "Traps the foe in a fierce\n" - "wind. May cause confusion."); - -const u8 sHeadChargeDescription[] = _( - "A charge using guard hair.\n" - "It hurts the user a little."); - -const u8 sGearGrindDescription[] = _( - "Throws two steel gears\n" - "that strike twice."); - -const u8 sTechnoBlastDescription[] = _( - "The type varies with the\n" - "kind of Drive held."); - -const u8 sRelicSongDescription[] = _( - "Attacks with an ancient\n" - "song. May induce sleep."); - -const u8 sSecretSwordDescription[] = _( - "Cuts with a long horn that\n" - "does physical damage."); - -const u8 sGlaciateDescription[] = _( - "Blows very cold air at the\n" - "foe. It lowers their Speed."); - -const u8 sBoltStrikeDescription[] = _( - "Strikes with a great amount\n" - "of lightning. May paralyze."); - -const u8 sBlueFlareDescription[] = _( - "Engulfs the foe in a blue\n" - "flame. May inflict a burn."); - -const u8 sFieryDanceDescription[] = _( - "Dances cloaked in flames.\n" - "May raise Sp. Atk."); - -const u8 sFreezeShockDescription[] = _( - "A powerful 2-turn move that\n" - "may paralyze the foe."); - -const u8 sIceBurnDescription[] = _( - "A powerful 2-turn move that\n" - "may inflict a burn."); - -const u8 sSnarlDescription[] = _( - "Yells and rants at the foe\n" - "lowering its Sp. Atk."); - -const u8 sIcicleCrashDescription[] = _( - "Drops large icicles on the\n" - "foe. May cause flinching."); - -const u8 sVCreateDescription[] = _( - "Very powerful, but lowers\n" - "Defense, Sp. Def and Speed."); - -const u8 sFusionFlareDescription[] = _( - "Summons a fireball. Works\n" - "well with a thunderbolt."); - -const u8 sFusionBoltDescription[] = _( - "Summons a thunderbolt.\n" - "Works well with a fireball."); - -const u8 sFlyingPressDescription[] = _( - "This attack does Fighting\n" - "and Flying-type damage."); - -const u8 sMatBlockDescription[] = _( - "Evades damaging moves\n" - "for one turn."); - -const u8 sBelchDescription[] = _( - "Lets out a loud belch.\n" - "Must eat a Berry to use it."); - -const u8 sRototillerDescription[] = _( - "Ups the Attack and Sp. Atk\n" - "of Grass-type Pokémon."); - -const u8 sStickyWebDescription[] = _( - "Weaves a sticky net that\n" - "slows foes switching in."); - -const u8 sFellStingerDescription[] = _( - "If it knocks out a foe\n" - "the Attack stat is raised."); - -const u8 sTrickOrTreatDescription[] = _( - "Goes trick-or-treating\n" - "making the foe Ghost-type."); - -const u8 sNobleRoarDescription[] = _( - "Intimidates the foe, to cut\n" - "Attack and Sp. Atk."); - -const u8 sIonDelugeDescription[] = _( - "Electrifies Normal-type\n" - "moves with charged atoms."); - -const u8 sParabolicChargeDescription[] = _( - "Damages adjacent Pokémon and\n" - "heals up by half of it."); - -const u8 sForestsCurseDescription[] = _( - "Puts a curse on the foe\n" - "making the foe Grass-type."); - -const u8 sPetalBlizzardDescription[] = _( - "Stirs up a violent storm\n" - "of petals to attack."); - -const u8 sFreezeDryDescription[] = _( - "Super effective on Water-\n" - "types. May cause freezing."); - -const u8 sDisarmingVoiceDescription[] = _( - "Lets out a charming cry\n" - "that cannot be evaded."); - -const u8 sPartingShotDescription[] = _( - "Lowers the foe's Attack and\n" - "Sp. Atk, then switches out."); - -const u8 sTopsyTurvyDescription[] = _( - "Swaps all stat changes that\n" - "affect the target."); - -const u8 sDrainingKissDescription[] = _( - "An attack that absorbs over\n" - "half the damage inflicted."); - -const u8 sCraftyShieldDescription[] = _( - "Evades status moves for\n" - "one turn."); - -const u8 sFlowerShieldDescription[] = _( - "Raises the Defense of\n" - "Grass-type Pokémon."); - -const u8 sGrassyTerrainDescription[] = _( - "The ground turns to grass\n" - "for 5 turns. Restores HP."); - -const u8 sMistyTerrainDescription[] = _( - "Covers the ground with mist\n" - "for 5 turns. Blocks status."); - -const u8 sElectrifyDescription[] = _( - "Electrifies the foe, making\n" - "its next move Electric-type."); - -const u8 sPlayRoughDescription[] = _( - "Plays rough with the foe.\n" - "May lower Attack."); - -const u8 sFairyWindDescription[] = _( - "Stirs up a fairy wind to\n" - "strike the foe."); - -const u8 sMoonblastDescription[] = _( - "Attacks with the power of\n" - "the moon. May lower Sp. Atk."); - -const u8 sBoomburstDescription[] = _( - "Attacks everything with a\n" - "destructive sound wave."); - -const u8 sFairyLockDescription[] = _( - "Locks down the battlefield\n" - "preventing escape next turn."); - -const u8 sKingsShieldDescription[] = _( - "Evades damage, and sharply\n" - "reduces Attack if struck."); - -const u8 sPlayNiceDescription[] = _( - "Befriend the foe, lowering\n" - "its Attack without fail."); - -const u8 sConfideDescription[] = _( - "Shares a secret with the\n" - "foe, lowering Sp. Atk."); - -const u8 sDiamondStormDescription[] = _( - "Whips up a storm of\n" - "diamonds. May up Defense."); - -const u8 sSteamEruptionDescription[] = _( - "Immerses the foe in heated\n" - "steam. May inflict a burn."); - -const u8 sHyperspaceHoleDescription[] = _( - "Uses a warp hole to attack.\n" - "Can't be evaded."); - -const u8 sWaterShurikenDescription[] = _( - "Throws 2 to 5 stars that\n" - "are sure to strike first."); - -const u8 sMysticalFireDescription[] = _( - "Breathes a special, hot\n" - "fire. Lowers Sp. Atk."); - -const u8 sSpikyShieldDescription[] = _( - "Evades attack, and damages\n" - "the foe if struck."); - -const u8 sAromaticMistDescription[] = _( - "Raises the Sp. Def of a\n" - "partner Pokémon."); - -const u8 sEerieImpulseDescription[] = _( - "Exposes the foe to a pulse\n" - "that sharply cuts Sp. Atk."); - -const u8 sVenomDrenchDescription[] = _( - "Lowers the Attack, Sp. Atk\n" - "and Speed of a poisoned foe."); - -const u8 sPowderDescription[] = _( - "Damages the foe if it uses\n" - "a Fire-type move."); - -const u8 sGeomancyDescription[] = _( - "Raises Sp. Atk, Sp. Def and\n" - "Speed on the 2nd turn."); - -const u8 sMagneticFluxDescription[] = _( - "Boosts the defenses of\n" - "those with Plus or Minus."); - -const u8 sHappyHourDescription[] = _( - "Doubles the amount of\n" - "Prize Money received."); - -const u8 sElectricTerrainDescription[] = _( - "Electrifies the ground for\n" - "5 turns. Prevents sleep."); - -const u8 sDazzlingGleamDescription[] = _( - "Damages foes by emitting\n" - "a bright flash."); - -const u8 sCelebrateDescription[] = _( - "Congratulates you on your\n" - "special day."); - -const u8 sHoldHandsDescription[] = _( - "The user and ally hold hands\n" - "making them happy."); - -const u8 sBabyDollEyesDescription[] = _( - "Lowers the foe's Attack\n" - "before it can move."); - -const u8 sNuzzleDescription[] = _( - "Rubs its cheecks against\n" - "the foe, paralyzing it."); - -const u8 sInfestationDescription[] = _( - "The foe is infested and\n" - "attacked for "BINDING_TURNS" turns."); - -const u8 sPowerUpPunchDescription[] = _( - "A hard punch that raises\n" - "the user's Attack."); - -const u8 sThousandArrowsDescription[] = _( - "Can hit Flying foes, then\n" - "knocks them to the ground."); - -const u8 sThousandWavesDescription[] = _( - "Those hit by the wave can\n" - "no longer escape."); - -const u8 sLandsWrathDescription[] = _( - "Gathers the energy of the\n" - "land to attack every foe."); - -const u8 sLightOfRuinDescription[] = _( - "Fires a great beam of light\n" - "that also hurts the user."); - -const u8 sOriginPulseDescription[] = _( - "Beams of glowing blue light\n" - "blast both foes."); - -const u8 sPrecipiceBladesDescription[] = _( - "Fearsome blades of stone\n" - "attack both foes."); - -const u8 sLavaPlumeDescription[] = _( - "Scarlet flames torch\n" - "everything around the user."); - -const u8 sLeafStormDescription[] = _( - "Whips up a storm of leaves.\n" - "Harshly lowers the Sp. Atk."); - -const u8 sShoreUpDescription[] = _( - "Restores the user's HP.\n" - "More HP in a sandstorm."); - -const u8 sFirstImpressionDescription[] = _( - "Hits hard and first.\n" - "Only works first turn."); - -const u8 sBanefulBunkerDescription[] = _( - "Protects user and poisons\n" - "foes on contact."); - -const u8 sSpiritShackleDescription[] = _( - "After being hit, foes can\n" - "no longer escape."); - -const u8 sDarkestLariatDescription[] = _( - "Swings the arms to strike\n" - "It ignores stat changes."); - -const u8 sSparklingAriaDescription[] = _( - "Sings with bubbles. Cures\n" - "burns on contact."); - -const u8 sIceHammerDescription[] = _( - "Swings the fist to strike.\n" - "Lowers the user's Speed."); - -const u8 sFloralHealingDescription[] = _( - "Restores an ally's HP.\n" - "Heals more on grass."); - -const u8 sHighHorsepowerDescription[] = _( - "Slams hard into the foe with\n" - "its entire body."); - -const u8 sStrengthSapDescription[] = _( - "Saps the foe's Attack to\n" - "heal HP, then drops Attack."); - -const u8 sSolarBladeDescription[] = _( - "Charges first turn, then\n" - "chops with a blade of light."); - -const u8 sLeafageDescription[] = _( - "Attacks with a flurry of\n" - "small leaves."); - -const u8 sSpotlightDescription[] = _( - "Makes the foe attack the\n" - "spotlighted Pokémon."); - -const u8 sToxicThreadDescription[] = _( - "Attacks with a thread that\n" - "poisons and drops Speed."); - -const u8 sLaserFocusDescription[] = _( - "Guarantees the next move\n" - "will be a critical hit."); - -const u8 sGearUpDescription[] = _( - "Boosts the attacks of\n" - "those with Plus or Minus."); - -const u8 sThroatChopDescription[] = _( - "Chops the throat to disable\n" - "sound moves for a while."); - -const u8 sPollenPuffDescription[] = _( - "Explodes on foes, but\n" - "restores ally's HP."); - -const u8 sAnchorShotDescription[] = _( - "Strangles the foe with a\n" - "chain. The foe can't escape."); - -const u8 sPsychicTerrainDescription[] = _( - "The ground turns weird for\n" - "5 turns. Blocks priority."); - -const u8 sLungeDescription[] = _( - "Lunges at the foe to lower\n" - "its Attack stat."); - -const u8 sFireLashDescription[] = _( - "Whips the foe with fire\n" - "lowering its Defense."); - -const u8 sPowerTripDescription[] = _( - "It hits harder the more\n" - "stat boosts the user has."); - -const u8 sBurnUpDescription[] = _( - "Burns out the user fully\n" - "removing the Fire type."); - -const u8 sSpeedSwapDescription[] = _( - "Swaps user's Speed with\n" - "the target's."); - -const u8 sSmartStrikeDescription[] = _( - "Hits with an accurate\n" - "horn that never misses."); - -const u8 sPurifyDescription[] = _( - "Cures the foe's status\n" - "to restore HP."); - -const u8 sRevelationDanceDescription[] = _( - "Dances with mystical power.\n" - "Matches user's first type."); - -const u8 sCoreEnforcerDescription[] = _( - "Hits with a ray that\n" - "nullifies the foe's ability."); - -const u8 sTropKickDescription[] = _( - "An intense kick from the\n" - "tropics. Lowers Attack."); - -const u8 sInstructDescription[] = _( - "Orders the target to use\n" - "its last move again."); - -const u8 sBeakBlastDescription[] = _( - "Heats up beak to attack.\n" - "Burns foe on contact."); - -const u8 sClangingScalesDescription[] = _( - "Makes a big noise with\n" - "its scales. Drops Defense."); - -const u8 sDragonHammerDescription[] = _( - "Swings its whole body\n" - "like a hammer to damage."); - -const u8 sBrutalSwingDescription[] = _( - "Violently swings around\n" - "to hurt everyone nearby."); - -const u8 sAuroraVeilDescription[] = _( - "Weakens all attacks, but\n" - "only usable with hail."); - -const u8 sShellTrapDescription[] = _( - "Sets a shell trap that\n" - "damages on contact."); - -const u8 sFleurCannonDescription[] = _( - "A strong ray that harshly\n" - "lowers Sp. Attack."); - -const u8 sPsychicFangsDescription[] = _( - "Chomps with psychic fangs.\n" - "Destroys any barriers."); - -const u8 sStompingTantrumDescription[] = _( - "Stomps around angrily.\n" - "Stronger after a failure."); - -const u8 sShadowBoneDescription[] = _( - "Strikes with a haunted\n" - "bone. Might drop Defense."); - -const u8 sAccelerockDescription[] = _( - "Hits with a high-speed\n" - "rock that always goes first."); - -const u8 sLiquidationDescription[] = _( - "Slams the foe with water.\n" - "Can lower Defense."); - -const u8 sPrismaticLaserDescription[] = _( - "A high power laser that\n" - "forces recharge next turn."); - -const u8 sSpectralThiefDescription[] = _( - "Steals the target's stat\n" - "boosts, then attacks."); - -const u8 sSunsteelStrikeDescription[] = _( - "A sun-fueled strike that\n" - "ignores abilities."); - -const u8 sMoongeistBeamDescription[] = _( - "A moon-powered beam that\n" - "ignores abilities."); - -const u8 sTearfulLookDescription[] = _( - "The user tears up, dropping\n" - "Attack and Sp. Attack."); - -const u8 sZingZapDescription[] = _( - "An electrified impact that\n" - "can cause flinching."); - -const u8 sNaturesMadnessDescription[] = _( - "Halves the foe's HP with\n" - "the power of nature."); - -const u8 sMultiAttackDescription[] = _( - "An attack that changes\n" - "with Memories."); - -const u8 sMindBlownDescription[] = _( - "It explodes the user's head\n" - "to damage everything around."); - -const u8 sPlasmaFistsDescription[] = _( - "Hits with electrical fists.\n" - "Normal moves become Electric."); - -const u8 sPhotonGeyserDescription[] = _( - "User's highest attack stat\n" - "determines its category."); - -const u8 sZippyZapDescription[] = _( - "Electric bursts always go\n" - "first and land a critical hit."); - -const u8 sSplishySplashDescription[] = _( - "A huge electrified wave that\n" - "may paralyze the foe."); - -const u8 sFloatyFallDescription[] = _( - "Floats in air and dives at\n" - "angle. May cause flinching."); - -const u8 sPikaPapowDescription[] = _( - "Pikachu's love increases its\n" - "power. It never misses."); - -const u8 sBouncyBubbleDescription[] = _( - "An attack that absorbs\n" -#if B_UPDATED_MOVE_DATA >= GEN_8 - "all the damage inflicted."); -#else - "half the damage inflicted."); -#endif - -const u8 sBuzzyBuzzDescription[] = _( - "Shoots a jolt of electricity\n" - "that always paralyzes."); - -const u8 sSizzlySlideDescription[] = _( - "User cloaked in fire charges.\n" - "Leaves the foe with a burn."); - -const u8 sGlitzyGlowDescription[] = _( - "Telekinetic force that sets\n" - "wall, lowering Sp. Atk damage."); - -const u8 sBaddyBadDescription[] = _( - "Acting badly, attacks. Sets\n" - "wall, lowering Attack damage."); - -const u8 sSappySeedDescription[] = _( - "Giant stalk scatters seeds\n" - "that drain HP every turn."); - -const u8 sFreezyFrostDescription[] = _( - "Crystal from cold haze hits.\n" - "Eliminates all stat changes."); - -const u8 sSparklySwirlDescription[] = _( - "Wrap foe with whirlwind of\n" - "scent. Heals party's status."); - -const u8 sVeeveeVolleyDescription[] = _( - "Eevee's love increases its\n" - "power. It never misses."); - -const u8 sDoubleIronBashDescription[] = _( - "The user spins and hits with\n" - "its arms. May cause flinch."); - -// GEN 8 -const u8 sDynamaxCannonDescription[] = _( - "Fires a strong beam. Deals\n" - "2x damage to Dynamaxed foes."); - -const u8 sSnipeShotDescription[] = _( - "The user ignores effects\n" - "that draw in moves."); - -const u8 sJawLockDescription[] = _( - "Prevents the user and\n" - "the target from escaping."); - -const u8 sStuffCheeksDescription[] = _( - "Consumes the user's Berry,\n" - "then sharply raises Def."); - -const u8 sNoRetreatDescription[] = _( - "Raises all of the user's\n" - "stats but prevents escape."); - -const u8 sTarShotDescription[] = _( - "Lowers the foe's Speed and\n" - "makes it weak to Fire."); - -const u8 sMagicPowderDescription[] = _( - "Magic powder changes the\n" - "target into a Psychic-type."); - -const u8 sDragonDartsDescription[] = _( - "The user attacks twice. Two\n" - "targets are hit once each."); - -const u8 sTeatimeDescription[] = _( - "All Pokémon have teatime\n" - "and eat their Berries."); - -const u8 sOctolockDescription[] = _( - "Traps the foe to lower Def\n" - "and Sp. Def fall each turn."); - -const u8 sBoltBeakDescription[] = _( - "Double power if the user\n" - "moves before the target."); - -const u8 sFishiousRendDescription[] = _( - "Double power if the user\n" - "moves before the target."); - -const u8 sCourtChangeDescription[] = _( - "The user swaps effects on\n" - "either side of the field."); - -const u8 sClangorousSoulDescription[] = _( - "The user uses some of its\n" - "HP to raise all its stats."); - -const u8 sBodyPressDescription[] = _( - "Does more damage the\n" - "higher the user's Def."); - -const u8 sDecorateDescription[] = _( - "The user sharply raises\n" - "the target's Atk and Sp.Atk"); - -const u8 sDrumBeatingDescription[] = _( - "Plays a drum to attack.\n" - "The foe's Speed is lowered."); - -const u8 sSnapTrapDescription[] = _( - "Snares the target in a snap\n" - "trap for four to five turns."); - -const u8 sPyroBallDescription[] = _( - "Launches a fiery ball at the\n" - "target. It may cause a burn."); - -const u8 sBehemothBladeDescription[] = _( - "Strikes as a sword. Deals 2x\n" - "damage to Dynamaxed foes."); - -const u8 sBehemothBashDescription[] = _( - "Attacks as a shield. Deals 2x\n" - "damage to Dynamaxed foes."); - -const u8 sAuraWheelDescription[] = _( - "Raises Speed to attack. The\n" - "Type is based on its form."); - -const u8 sBreakingSwipeDescription[] = _( - "Swings its tail to attack.\n" - "Lowers the Atk of those hit."); - -const u8 sBranchPokeDescription[] = _( - "The user pokes the target\n" - "with a pointed branch."); - -const u8 sOverdriveDescription[] = _( - "The user twangs its guitar,\n" - "causing strong vibrations."); - -const u8 sAppleAcidDescription[] = _( - "Attacks with tart apple acid\n" - "to lower the foe's Sp. Def."); - -const u8 sGravAppleDescription[] = _( - "Drops an apple from above.\n" - "Lowers the foe's Defense."); - -const u8 sSpiritBreakDescription[] = _( - "Attacks with spirit-breaking\n" - "force. Lowers Sp. Atk."); - -const u8 sStrangeSteamDescription[] = _( - "Emits a strange steam to\n" - "potentially confuse the foe."); - -const u8 sLifeDewDescription[] = _( - "Scatters water to restore\n" - "the HP of itself and allies."); - -const u8 sObstructDescription[] = _( - "Protects itself, harshly\n" - "lowering Def on contact."); - -const u8 sFalseSurrenderDescription[] = _( - "Bows to stab the foe\n" - "with hair. It never misses."); - -const u8 sMeteorAssaultDescription[] = _( - "Attacks with a thick leek.\n" - "The user must then rest."); - -const u8 sEternabeamDescription[] = _( - "Eternatus' strongest move.\n" - "The user rests next turn."); - -const u8 sSteelBeamDescription[] = _( - "Fires a beam of steel from\n" - "its body. It hurts the user."); - -const u8 sExpandingForceDescription[] = _( - "Power goes up and damages\n" - "all foes on Psychic Terrain."); - -const u8 sSteelRollerDescription[] = _( - "Destroys terrain. Fails if\n" - "ground isn't terrain."); - -const u8 sScaleShotDescription[] = _( - "Shoots scales 2 to 5 times.\n" - "Ups Speed, lowers defense."); - -const u8 sMeteorBeamDescription[] = _( - "A 2-turn move that raises\n" - "Sp. Attack before attacking."); - -const u8 sShellSideArmDescription[] = _( - "Deals better of physical and\n" - "special damage. May poison."); - -const u8 sMistyExplosionDescription[] = _( - "Hit everything and faint.\n" - "Powers up on Misty Terrain."); - -const u8 sGrassyGlideDescription[] = _( - "Gliding on ground, hits. Goes\n" - "first on Grassy Terrain."); - -const u8 sRisingVoltageDescription[] = _( - "This move's power doubles\n" - "when on Electric Terrain."); - -const u8 sTerrainPulseDescription[] = _( - "Type and power changes\n" - "depending on the terrain."); - -const u8 sSkitterSmackDescription[] = _( - "User skitters behind foe to\n" - "attack. Lowers foe's Sp. Atk."); - -const u8 sBurningJealousyDescription[] = _( - "Foes that have stats upped\n" - "during the turn get burned."); - -const u8 sLashOutDescription[] = _( - "If stats lowered during this\n" - "turn, power is doubled."); - -const u8 sPoltergeistDescription[] = _( - "Control foe's item to attack.\n" - "Fails if foe has no item."); - -const u8 sCorrosiveGasDescription[] = _( - "Highly acidic gas melts items\n" - "held by surrounding Pokémon."); - -const u8 sCoachingDescription[] = _( - "Properly coaches allies to\n" - "up their Attack and Defense."); - -const u8 sFlipTurnDescription[] = _( - "Attacks and rushes back to\n" - "switch with a party Pokémon."); - -const u8 sTripleAxelDescription[] = _( - "A 3-kick attack that gets\n" - "more powerful with each hit."); - -const u8 sDualWingbeatDescription[] = _( - "User slams the target with\n" - "wings and hits twice in a row."); - -const u8 sScorchingSandsDescription[] = _( - "Throws scorching sand at\n" - "the target. May leave a burn."); - -const u8 sJungleHealingDescription[] = _( - "Heals HP and status of\n" - "itself and allies in battle."); - -const u8 sWickedBlowDescription[] = _( - "Mastering the Dark style,\n" - "strikes with a critical hit."); - -const u8 sSurgingStrikesDescription[] = _( - "Mastering the Water style,\n" - "strikes with 3 critical hits."); - -const u8 sThunderCageDescription[] = _( - "Traps the foe in a cage of\n" - "electricity for "BINDING_TURNS" turns."); - -const u8 sDragonEnergyDescription[] = _( - "The higher the user's HP\n" - "the more damage caused."); - -const u8 sFreezingGlareDescription[] = _( - "Shoots psychic power from\n" -#if B_USE_FROSTBITE == TRUE - "the eyes. May frostbite."); -#else - "the eyes. May freeze the foe."); -#endif - -const u8 sFieryWrathDescription[] = _( - "An attack fueled by your\n" - "wrath. May cause flinching."); - -const u8 sThunderousKickDescription[] = _( - "Uses a lightning-like kick\n" - "to hit. Lowers foe's Defense."); - -const u8 sGlacialLanceDescription[] = _( - "Strikes by hurling a blizzard-\n" - "cloaked icicle lance at foes."); - -const u8 sAstralBarrageDescription[] = _( - "Strikes by sending a frightful\n" - "amount of ghosts at foes."); - -const u8 sEerieSpellDescription[] = _( - "Attacks with psychic power.\n" - "Foe's last move has 3 PP cut."); - -const u8 sDireClawDescription[] = _( - "High critical hit chance. May\n" - "paralyze, poison or drowse."); - -const u8 sPsyshieldBashDescription[] = _( - "Hits a foe with psychic\n" - "energy. May raise Defense."); - -const u8 sPowerShiftDescription[] = _( - "The user swaps its Attack\n" - "and Defense stats."); - -const u8 sStoneAxeDescription[] = _( - "High critical hit ratio. Sets\n" - "Splinters that hurt the foe."); - -const u8 sSpringtideStormDescription[] = _( - "Wraps a foe in fierce winds.\n" - "Varies with the user's form."); - -const u8 sMysticalPowerDescription[] = _( - "A mysterious power strikes,\n" - "raising the user's Sp. Atk."); - -const u8 sRagingFuryDescription[] = _( - "A rampage of 2 to 3 turns\n" - "that confuses the user."); - -const u8 sWaveCrashDescription[] = _( - "A slam shrouded in water.\n" - "It also hurts the user."); - -const u8 sChloroblastDescription[] = _( - "A user-hurting blast of\n" - "amassed chlorophyll."); - -const u8 sMountainGaleDescription[] = _( - "Giant chunks of ice damage\n" - "the foe. It may flinch."); - -const u8 sVictoryDanceDescription[] = _( - "Dances to raise Attack,\n" - "Defense and Speed."); - -const u8 sHeadlongRushDescription[] = _( - "Hits with a full-body tackle.\n" - "Lowers the users's defenses."); - -const u8 sBarbBarrageDescription[] = _( - "Can poison on impact. Powers\n" - "up against poisoned foes."); - -const u8 sEsperWingDescription[] = _( - "High critical hit ratio.\n" - "Ups the user's Speed."); - -const u8 sBitterMaliceDescription[] = _( - "A spine-chilling resentment.\n" - "May lower the foe's Attack."); - -const u8 sShelterDescription[] = _( - "The user hardens their skin,\n" - "sharply raising its Defense."); - -const u8 sTripleArrowsDescription[] = _( - "High critical hit ratio.\n" - "May lower Defense or flinch."); - -const u8 sInfernalParadeDescription[] = _( - "Hurts a foe harder if it has\n" - "an ailment. May leave a burn."); - -const u8 sCeaselessEdgeDescription[] = _( - "High critical hit ratio. Sets\n" - "Splinters that hurt the foe."); - -const u8 sBleakwindStormDescription[] = _( - "Hits with brutal, cold winds.\n" - "May lower the foe's Speed."); - -const u8 sWildboltStormDescription[] = _( - "Hits with a brutal tempest.\n" - "May inflict paralysis."); - -const u8 sSandsearStormDescription[] = _( - "Hits with brutally hot sand.\n" - "May inflict a burn."); - -const u8 sLunarBlessingDescription[] = _( - "The user heals and cures\n" - "itself and its ally."); - -const u8 sTakeHeartDescription[] = _( - "The user lifts its spirits to\n" - "heal and strengthen itself."); - -const u8 sTeraBlastDescription[] = _( - "If the user's Terastallized,\n" - "it hits with its Tera-type."); - -const u8 sSilkTrapDescription[] =_( - "Protects itself, lowering\n" - "Speed on contact."); - -const u8 sAxeKickDescription[] = _( - "May miss and hurt the kicker.\n" - "May cause confusion."); - -const u8 sLastRespectsDescription[] = _( - "This move deals more damage\n" - "for each defeated ally."); - -const u8 sLuminaCrashDescription[] = _( - "A mind-affecting light\n" - "harshly lowers Sp. Def."); - -const u8 sOrderUpDescription[] = _( - "Boosts a user's stats\n" - "depending on Tatsugiri."); - -const u8 sJetPunchDescription[] = _( - "A punch is thrown at blinding\n" - "speed to strike first."); - -const u8 sSpicyExtractDescription[] = _( - "Sharply ups target's Attack,\n" - "harshly lowers its Defense."); - -const u8 sSpinOutDescription[] = _( - "Furiously strains its legs.\n" - "Harshly lowers user's Speed."); - -const u8 sPopulationBombDescription[] = _( - "The user's fellows hit one\n" - "to ten times in a row."); - -const u8 sIceSpinnerDescription[] = _( - "Ice-covered feet hit a foe\n" - "and destroy the terrain."); - -const u8 sGlaiveRushDescription[] = _( - "Foe attacks next turn can't\n" - "miss and do double damage."); - -const u8 sRevivalBlessingDescription[] = _( - "Revives a fainted party {PKMN}\n" - "and restores half of its HP."); - -const u8 sSaltCureDescription[] = _( - "Hurts foe every turn. Double\n" - "damage to Steel and Water."); - -const u8 sTripleDiveDescription[] = _( - "Hits target with splashes\n" - "of water 3 times in a row."); - -const u8 sMortalSpinDescription[] = _( - "Erases trap moves and Leech\n" - "Seed. Poisons adjecent foes."); - -const u8 sDoodleDescription[] = _( - "Changes user's and ally's\n" - "Ability into the target's."); - -const u8 sFilletAwayDescription[] = _( - "Sharply boosts offenses and\n" - "Speed by using its own HP."); - -const u8 sKowtowCleaveDescription[] = _( - "User slashes the foe after\n" - "kowtowing. It never misses."); - -const u8 sFlowerTrickDescription[] = _( - "Rigged bouquet. Always gets\n" - "a critical hit, never missing."); - -const u8 sTorchSongDescription[] = _( - "Flames scorch the target.\n" - "Boosts the user's Sp. Atk."); - -const u8 sAquaStepDescription[] = _( - "Hits with light, fluid dance\n" - "steps. Ups the user's Speed."); - -const u8 sRagingBullDescription[] = _( - "Tackle that breaks barriers.\n" - "User's form determines type."); - -const u8 sMakeItRainDescription[] = _( - "Lowers the user's Sp. Atk.\n" - "Money is recovered after."); - -const u8 sRuinationDescription[] = _( - "Summons a ruinous disaster\n" - "and cuts half the foe's HP."); - -const u8 sCollisionCourseDescription[] = _( - "Prehistoric explosion that's\n" - "stronger if supereffective."); - -const u8 sElectroDriftDescription[] = _( - "Futuristic electricity. It's\n" - "stronger if supereffective."); - -const u8 sShedTailDescription[] = _( - "Creates a Substitute for\n" - "itself before switching out."); - -const u8 sChillyReceptionDescription[] =_( - "Bad joke summons snowstorm.\n" - "The user also switches out."); - -const u8 sTidyUpDescription[] = _( - "User tidies up hazards and\n" - "raises its Attack and Speed."); - -const u8 sSnowscapeDescription[] = _( - "Summons a snowstorm that\n" - "lasts for five turns."); - -const u8 sPounceDescription[] = _( - "The user pounces on the foe,\n" - "lowering its Speed."); - -const u8 sTrailblazeDescription[] = _( - "The user attacks suddenly,\n" - "raising its Speed."); - -const u8 sChillingWaterDescription[] = _( - "A shower with ice-cold water\n" - "lowers the target's Attack."); - -const u8 sHyperDrillDescription[] = _( - "A spinning pointed part\n" - "bypasses a foe's Protect."); - -const u8 sTwinBeamDescription[] = _( - "Mystical eye-beams that hit\n" - "the target twice in a row."); - -const u8 sRageFistDescription[] = _( - "The more the user has been\n" - "hit, the stronger the move."); - -const u8 sArmorCannonDescription[] = _( - "A strong attack but lowers\n" - "the defensive stats."); - -const u8 sBitterBladeDescription[] = _( - "An attack that absorbs\n" - "half the damage inflicted."); - -const u8 sDoubleShockDescription[] = _( - "Discharges all electricity,\n" - "losing the Electric type."); - -const u8 sGigatonHammerDescription[] = _( - "Swings a huge hammer. Can't\n" - "be used twice in a row."); - -const u8 sComeuppanceDescription[] = _( - "Retaliates strongly against\n" - "who last hurt the user."); - -const u8 sAquaCutterDescription[] = _( - "Pressurized water cut with a\n" - "high critical-hit ratio."); - -const u8 sBlazingTorqueDescription[] = _( - "---"); - -const u8 sWickedTorqueDescription[] = _( - "---"); - -const u8 sNoxiousTorqueDescription[] = _( - "---"); - -const u8 sCombatTorqueDescription[] = _( - "---"); - -const u8 sMagicalTorqueDescription[] = _( - "---"); - -const u8 sPsybladeDescription[] = _( - "This move's power increases\n" - "when on Electric Terrain."); - -const u8 sHydroSteamDescription[] = _( - "This move's power increases\n" - "under harsh sunlight."); - -const u8 sBloodMoonDescription[] = _( - "Unleashes the blood moon.\n" - "Can't be used twice in a row."); - -const u8 sMatchaGotchaDescription[] = _( - "Absorbs half the damage\n" - "inflicted. May cause a burn."); - -const u8 sSyrupBombDescription[] = _( - "Lowers the foe's speed\n" - "each turn for 3 turns."); - -const u8 sIvyCudgelDescription[] = _( - "Type changes with held mask.\n" - "High critical-hit ratio."); - -const u8 sElectroShotDescription[] = _( - "Absorbs electricity in one turn,\n" - "then attacks next turn."); - -const u8 sTeraStarstormDescription[] = _( - "Damages all opponents if user is\n" - "Stellar form Terapagos."); - -const u8 sFickleBeamDescription[] = _( - "Shoots a beam of light. Sometimes\n" - "twice as strong."); - -const u8 sBurningBulwarkDescription[] = _( - "Evades attack, and burns\n" - "the foe if struck."); - -const u8 sTachyonCutterDescription[] = _( - "Launches particle blades at\n" - "the target. Strikes twice."); - -const u8 sDragonCheerDescription[] = _( - "Increases allies' critical hit\n" - "ration, especially if Dragons."); - -const u8 sAlluringVoiceDescription[] = _( - "Confuses the target if their\n" - "stats were boosted this turn."); - -const u8 sTemperFlareDescription[] = _( - "A desperation attack. Power\n" - "doubles if last move failed."); - -const u8 sSupercellSlamDescription[] = _( - "An electrified slam. If it\n" - "misses, the user is hurt."); - -const u8 sPsychicNoiseDescription[] = _( - "Unpleasant sound waves that\n" - "damage and prevent healing."); - -const u8 sUpperHandDescription[] = _( - "Makes the target flinch if\n" - "readying a priority move."); - -const u8 sMalignantChainDescription[] = _( - "A corrosive chain attack\n" - "that may badly poison."); - -const u8 gNotDoneYetDescription[] = _( - "This move can't be used. Its\n" - "effect is in development."); - -#undef BINDING_TURNS - -// MOVE_NONE is ignored in this table. Make sure to always subtract 1 before getting the right pointer. -const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] = -{ - [MOVE_POUND - 1] = sPoundDescription, - [MOVE_KARATE_CHOP - 1] = sKarateChopDescription, - [MOVE_DOUBLE_SLAP - 1] = sDoubleSlapDescription, - [MOVE_COMET_PUNCH - 1] = sCometPunchDescription, - [MOVE_MEGA_PUNCH - 1] = sMegaPunchDescription, - [MOVE_PAY_DAY - 1] = sPayDayDescription, - [MOVE_FIRE_PUNCH - 1] = sFirePunchDescription, - [MOVE_ICE_PUNCH - 1] = sIcePunchDescription, - [MOVE_THUNDER_PUNCH - 1] = sThunderPunchDescription, - [MOVE_SCRATCH - 1] = sScratchDescription, - [MOVE_VISE_GRIP - 1] = sViseGripDescription, - [MOVE_GUILLOTINE - 1] = sGuillotineDescription, - [MOVE_RAZOR_WIND - 1] = sRazorWindDescription, - [MOVE_SWORDS_DANCE - 1] = sSwordsDanceDescription, - [MOVE_CUT - 1] = sCutDescription, - [MOVE_GUST - 1] = sGustDescription, - [MOVE_WING_ATTACK - 1] = sWingAttackDescription, - [MOVE_WHIRLWIND - 1] = sWhirlwindDescription, - [MOVE_FLY - 1] = sFlyDescription, - [MOVE_BIND - 1] = sBindDescription, - [MOVE_SLAM - 1] = sSlamDescription, - [MOVE_VINE_WHIP - 1] = sVineWhipDescription, - [MOVE_STOMP - 1] = sStompDescription, - [MOVE_DOUBLE_KICK - 1] = sDoubleKickDescription, - [MOVE_MEGA_KICK - 1] = sMegaKickDescription, - [MOVE_JUMP_KICK - 1] = sJumpKickDescription, - [MOVE_ROLLING_KICK - 1] = sRollingKickDescription, - [MOVE_SAND_ATTACK - 1] = sSandAttackDescription, - [MOVE_HEADBUTT - 1] = sHeadbuttDescription, - [MOVE_HORN_ATTACK - 1] = sHornAttackDescription, - [MOVE_FURY_ATTACK - 1] = sFuryAttackDescription, - [MOVE_HORN_DRILL - 1] = sHornDrillDescription, - [MOVE_TACKLE - 1] = sTackleDescription, - [MOVE_BODY_SLAM - 1] = sBodySlamDescription, - [MOVE_WRAP - 1] = sWrapDescription, - [MOVE_TAKE_DOWN - 1] = sTakeDownDescription, - [MOVE_THRASH - 1] = sThrashDescription, - [MOVE_DOUBLE_EDGE - 1] = sDoubleEdgeDescription, - [MOVE_TAIL_WHIP - 1] = sTailWhipDescription, - [MOVE_POISON_STING - 1] = sPoisonStingDescription, - [MOVE_TWINEEDLE - 1] = sTwineedleDescription, - [MOVE_PIN_MISSILE - 1] = sPinMissileDescription, - [MOVE_LEER - 1] = sLeerDescription, - [MOVE_BITE - 1] = sBiteDescription, - [MOVE_GROWL - 1] = sGrowlDescription, - [MOVE_ROAR - 1] = sRoarDescription, - [MOVE_SING - 1] = sSingDescription, - [MOVE_SUPERSONIC - 1] = sSupersonicDescription, - [MOVE_SONIC_BOOM - 1] = sSonicBoomDescription, - [MOVE_DISABLE - 1] = sDisableDescription, - [MOVE_ACID - 1] = sAcidDescription, - [MOVE_EMBER - 1] = sEmberDescription, - [MOVE_FLAMETHROWER - 1] = sFlamethrowerDescription, - [MOVE_MIST - 1] = sMistDescription, - [MOVE_WATER_GUN - 1] = sWaterGunDescription, - [MOVE_HYDRO_PUMP - 1] = sHydroPumpDescription, - [MOVE_SURF - 1] = sSurfDescription, - [MOVE_ICE_BEAM - 1] = sIceBeamDescription, - [MOVE_BLIZZARD - 1] = sBlizzardDescription, - [MOVE_PSYBEAM - 1] = sPsybeamDescription, - [MOVE_BUBBLE_BEAM - 1] = sBubbleBeamDescription, - [MOVE_AURORA_BEAM - 1] = sAuroraBeamDescription, - [MOVE_HYPER_BEAM - 1] = sHyperBeamDescription, - [MOVE_PECK - 1] = sPeckDescription, - [MOVE_DRILL_PECK - 1] = sDrillPeckDescription, - [MOVE_SUBMISSION - 1] = sSubmissionDescription, - [MOVE_LOW_KICK - 1] = sLowKickDescription, - [MOVE_COUNTER - 1] = sCounterDescription, - [MOVE_SEISMIC_TOSS - 1] = sSeismicTossDescription, - [MOVE_STRENGTH - 1] = sStrengthDescription, - [MOVE_ABSORB - 1] = sAbsorbDescription, - [MOVE_MEGA_DRAIN - 1] = sMegaDrainDescription, - [MOVE_LEECH_SEED - 1] = sLeechSeedDescription, - [MOVE_GROWTH - 1] = sGrowthDescription, - [MOVE_RAZOR_LEAF - 1] = sRazorLeafDescription, - [MOVE_SOLAR_BEAM - 1] = sSolarBeamDescription, - [MOVE_POISON_POWDER - 1] = sPoisonPowderDescription, - [MOVE_STUN_SPORE - 1] = sStunSporeDescription, - [MOVE_SLEEP_POWDER - 1] = sSleepPowderDescription, - [MOVE_PETAL_DANCE - 1] = sPetalDanceDescription, - [MOVE_STRING_SHOT - 1] = sStringShotDescription, - [MOVE_DRAGON_RAGE - 1] = sDragonRageDescription, - [MOVE_FIRE_SPIN - 1] = sFireSpinDescription, - [MOVE_THUNDER_SHOCK - 1] = sThunderShockDescription, - [MOVE_THUNDERBOLT - 1] = sThunderboltDescription, - [MOVE_THUNDER_WAVE - 1] = sThunderWaveDescription, - [MOVE_THUNDER - 1] = sThunderDescription, - [MOVE_ROCK_THROW - 1] = sRockThrowDescription, - [MOVE_EARTHQUAKE - 1] = sEarthquakeDescription, - [MOVE_FISSURE - 1] = sFissureDescription, - [MOVE_DIG - 1] = sDigDescription, - [MOVE_TOXIC - 1] = sToxicDescription, - [MOVE_CONFUSION - 1] = sConfusionDescription, - [MOVE_PSYCHIC - 1] = sPsychicDescription, - [MOVE_HYPNOSIS - 1] = sHypnosisDescription, - [MOVE_MEDITATE - 1] = sMeditateDescription, - [MOVE_AGILITY - 1] = sAgilityDescription, - [MOVE_QUICK_ATTACK - 1] = sQuickAttackDescription, - [MOVE_RAGE - 1] = sRageDescription, - [MOVE_TELEPORT - 1] = sTeleportDescription, - [MOVE_NIGHT_SHADE - 1] = sNightShadeDescription, - [MOVE_MIMIC - 1] = sMimicDescription, - [MOVE_SCREECH - 1] = sScreechDescription, - [MOVE_DOUBLE_TEAM - 1] = sDoubleTeamDescription, - [MOVE_RECOVER - 1] = sRecoverDescription, - [MOVE_HARDEN - 1] = sHardenDescription, - [MOVE_MINIMIZE - 1] = sMinimizeDescription, - [MOVE_SMOKESCREEN - 1] = sSmokescreenDescription, - [MOVE_CONFUSE_RAY - 1] = sConfuseRayDescription, - [MOVE_WITHDRAW - 1] = sWithdrawDescription, - [MOVE_DEFENSE_CURL - 1] = sDefenseCurlDescription, - [MOVE_BARRIER - 1] = sBarrierDescription, - [MOVE_LIGHT_SCREEN - 1] = sLightScreenDescription, - [MOVE_HAZE - 1] = sHazeDescription, - [MOVE_REFLECT - 1] = sReflectDescription, - [MOVE_FOCUS_ENERGY - 1] = sFocusEnergyDescription, - [MOVE_BIDE - 1] = sBideDescription, - [MOVE_METRONOME - 1] = sMetronomeDescription, - [MOVE_MIRROR_MOVE - 1] = sMirrorMoveDescription, - [MOVE_SELF_DESTRUCT - 1] = sSelfDestructDescription, - [MOVE_EGG_BOMB - 1] = sEggBombDescription, - [MOVE_LICK - 1] = sLickDescription, - [MOVE_SMOG - 1] = sSmogDescription, - [MOVE_SLUDGE - 1] = sSludgeDescription, - [MOVE_BONE_CLUB - 1] = sBoneClubDescription, - [MOVE_FIRE_BLAST - 1] = sFireBlastDescription, - [MOVE_WATERFALL - 1] = sWaterfallDescription, - [MOVE_CLAMP - 1] = sClampDescription, - [MOVE_SWIFT - 1] = sSwiftDescription, - [MOVE_SKULL_BASH - 1] = sSkullBashDescription, - [MOVE_SPIKE_CANNON - 1] = sSpikeCannonDescription, - [MOVE_CONSTRICT - 1] = sConstrictDescription, - [MOVE_AMNESIA - 1] = sAmnesiaDescription, - [MOVE_KINESIS - 1] = sKinesisDescription, - [MOVE_SOFT_BOILED - 1] = sSoftBoiledDescription, - [MOVE_HIGH_JUMP_KICK - 1] = sHighJumpKickDescription, - [MOVE_GLARE - 1] = sGlareDescription, - [MOVE_DREAM_EATER - 1] = sDreamEaterDescription, - [MOVE_POISON_GAS - 1] = sPoisonGasDescription, - [MOVE_BARRAGE - 1] = sBarrageDescription, - [MOVE_LEECH_LIFE - 1] = sLeechLifeDescription, - [MOVE_LOVELY_KISS - 1] = sLovelyKissDescription, - [MOVE_SKY_ATTACK - 1] = sSkyAttackDescription, - [MOVE_TRANSFORM - 1] = sTransformDescription, - [MOVE_BUBBLE - 1] = sBubbleDescription, - [MOVE_DIZZY_PUNCH - 1] = sDizzyPunchDescription, - [MOVE_SPORE - 1] = sSporeDescription, - [MOVE_FLASH - 1] = sFlashDescription, - [MOVE_PSYWAVE - 1] = sPsywaveDescription, - [MOVE_SPLASH - 1] = sSplashDescription, - [MOVE_ACID_ARMOR - 1] = sAcidArmorDescription, - [MOVE_CRABHAMMER - 1] = sCrabhammerDescription, - [MOVE_EXPLOSION - 1] = sExplosionDescription, - [MOVE_FURY_SWIPES - 1] = sFurySwipesDescription, - [MOVE_BONEMERANG - 1] = sBonemerangDescription, - [MOVE_REST - 1] = sRestDescription, - [MOVE_ROCK_SLIDE - 1] = sRockSlideDescription, - [MOVE_HYPER_FANG - 1] = sHyperFangDescription, - [MOVE_SHARPEN - 1] = sSharpenDescription, - [MOVE_CONVERSION - 1] = sConversionDescription, - [MOVE_TRI_ATTACK - 1] = sTriAttackDescription, - [MOVE_SUPER_FANG - 1] = sSuperFangDescription, - [MOVE_SLASH - 1] = sSlashDescription, - [MOVE_SUBSTITUTE - 1] = sSubstituteDescription, - [MOVE_STRUGGLE - 1] = sStruggleDescription, - [MOVE_SKETCH - 1] = sSketchDescription, - [MOVE_TRIPLE_KICK - 1] = sTripleKickDescription, - [MOVE_THIEF - 1] = sThiefDescription, - [MOVE_SPIDER_WEB - 1] = sSpiderWebDescription, - [MOVE_MIND_READER - 1] = sMindReaderDescription, - [MOVE_NIGHTMARE - 1] = sNightmareDescription, - [MOVE_FLAME_WHEEL - 1] = sFlameWheelDescription, - [MOVE_SNORE - 1] = sSnoreDescription, - [MOVE_CURSE - 1] = sCurseDescription, - [MOVE_FLAIL - 1] = sFlailDescription, - [MOVE_CONVERSION_2 - 1] = sConversion2Description, - [MOVE_AEROBLAST - 1] = sAeroblastDescription, - [MOVE_COTTON_SPORE - 1] = sCottonSporeDescription, - [MOVE_REVERSAL - 1] = sReversalDescription, - [MOVE_SPITE - 1] = sSpiteDescription, - [MOVE_POWDER_SNOW - 1] = sPowderSnowDescription, - [MOVE_PROTECT - 1] = sProtectDescription, - [MOVE_MACH_PUNCH - 1] = sMachPunchDescription, - [MOVE_SCARY_FACE - 1] = sScaryFaceDescription, - [MOVE_FEINT_ATTACK - 1] = sFeintAttackDescription, - [MOVE_SWEET_KISS - 1] = sSweetKissDescription, - [MOVE_BELLY_DRUM - 1] = sBellyDrumDescription, - [MOVE_SLUDGE_BOMB - 1] = sSludgeBombDescription, - [MOVE_MUD_SLAP - 1] = sMudSlapDescription, - [MOVE_OCTAZOOKA - 1] = sOctazookaDescription, - [MOVE_SPIKES - 1] = sSpikesDescription, - [MOVE_ZAP_CANNON - 1] = sZapCannonDescription, - [MOVE_FORESIGHT - 1] = sForesightDescription, - [MOVE_DESTINY_BOND - 1] = sDestinyBondDescription, - [MOVE_PERISH_SONG - 1] = sPerishSongDescription, - [MOVE_ICY_WIND - 1] = sIcyWindDescription, - [MOVE_DETECT - 1] = sDetectDescription, - [MOVE_BONE_RUSH - 1] = sBoneRushDescription, - [MOVE_LOCK_ON - 1] = sLockOnDescription, - [MOVE_OUTRAGE - 1] = sOutrageDescription, - [MOVE_SANDSTORM - 1] = sSandstormDescription, - [MOVE_GIGA_DRAIN - 1] = sGigaDrainDescription, - [MOVE_ENDURE - 1] = sEndureDescription, - [MOVE_CHARM - 1] = sCharmDescription, - [MOVE_ROLLOUT - 1] = sRolloutDescription, - [MOVE_FALSE_SWIPE - 1] = sFalseSwipeDescription, - [MOVE_SWAGGER - 1] = sSwaggerDescription, - [MOVE_MILK_DRINK - 1] = sMilkDrinkDescription, - [MOVE_SPARK - 1] = sSparkDescription, - [MOVE_FURY_CUTTER - 1] = sFuryCutterDescription, - [MOVE_STEEL_WING - 1] = sSteelWingDescription, - [MOVE_MEAN_LOOK - 1] = sMeanLookDescription, - [MOVE_ATTRACT - 1] = sAttractDescription, - [MOVE_SLEEP_TALK - 1] = sSleepTalkDescription, - [MOVE_HEAL_BELL - 1] = sHealBellDescription, - [MOVE_RETURN - 1] = sReturnDescription, - [MOVE_PRESENT - 1] = sPresentDescription, - [MOVE_FRUSTRATION - 1] = sFrustrationDescription, - [MOVE_SAFEGUARD - 1] = sSafeguardDescription, - [MOVE_PAIN_SPLIT - 1] = sPainSplitDescription, - [MOVE_SACRED_FIRE - 1] = sSacredFireDescription, - [MOVE_MAGNITUDE - 1] = sMagnitudeDescription, - [MOVE_DYNAMIC_PUNCH - 1] = sDynamicPunchDescription, - [MOVE_MEGAHORN - 1] = sMegahornDescription, - [MOVE_DRAGON_BREATH - 1] = sDragonBreathDescription, - [MOVE_BATON_PASS - 1] = sBatonPassDescription, - [MOVE_ENCORE - 1] = sEncoreDescription, - [MOVE_PURSUIT - 1] = sPursuitDescription, - [MOVE_RAPID_SPIN - 1] = sRapidSpinDescription, - [MOVE_SWEET_SCENT - 1] = sSweetScentDescription, - [MOVE_IRON_TAIL - 1] = sIronTailDescription, - [MOVE_METAL_CLAW - 1] = sMetalClawDescription, - [MOVE_VITAL_THROW - 1] = sVitalThrowDescription, - [MOVE_MORNING_SUN - 1] = sMorningSunDescription, - [MOVE_SYNTHESIS - 1] = sSynthesisDescription, - [MOVE_MOONLIGHT - 1] = sMoonlightDescription, - [MOVE_HIDDEN_POWER - 1] = sHiddenPowerDescription, - [MOVE_CROSS_CHOP - 1] = sCrossChopDescription, - [MOVE_TWISTER - 1] = sTwisterDescription, - [MOVE_RAIN_DANCE - 1] = sRainDanceDescription, - [MOVE_SUNNY_DAY - 1] = sSunnyDayDescription, - [MOVE_CRUNCH - 1] = sCrunchDescription, - [MOVE_MIRROR_COAT - 1] = sMirrorCoatDescription, - [MOVE_PSYCH_UP - 1] = sPsychUpDescription, - [MOVE_EXTREME_SPEED - 1] = sExtremeSpeedDescription, - [MOVE_ANCIENT_POWER - 1] = sAncientPowerDescription, - [MOVE_SHADOW_BALL - 1] = sShadowBallDescription, - [MOVE_FUTURE_SIGHT - 1] = sFutureSightDescription, - [MOVE_ROCK_SMASH - 1] = sRockSmashDescription, - [MOVE_WHIRLPOOL - 1] = sWhirlpoolDescription, - [MOVE_BEAT_UP - 1] = sBeatUpDescription, - [MOVE_FAKE_OUT - 1] = sFakeOutDescription, - [MOVE_UPROAR - 1] = sUproarDescription, - [MOVE_STOCKPILE - 1] = sStockpileDescription, - [MOVE_SPIT_UP - 1] = sSpitUpDescription, - [MOVE_SWALLOW - 1] = sSwallowDescription, - [MOVE_HEAT_WAVE - 1] = sHeatWaveDescription, - [MOVE_HAIL - 1] = sHailDescription, - [MOVE_TORMENT - 1] = sTormentDescription, - [MOVE_FLATTER - 1] = sFlatterDescription, - [MOVE_WILL_O_WISP - 1] = sWillOWispDescription, - [MOVE_MEMENTO - 1] = sMementoDescription, - [MOVE_FACADE - 1] = sFacadeDescription, - [MOVE_FOCUS_PUNCH - 1] = sFocusPunchDescription, - [MOVE_SMELLING_SALTS - 1] = sSmellingSaltsDescription, - [MOVE_FOLLOW_ME - 1] = sFollowMeDescription, - [MOVE_NATURE_POWER - 1] = sNaturePowerDescription, - [MOVE_CHARGE - 1] = sChargeDescription, - [MOVE_TAUNT - 1] = sTauntDescription, - [MOVE_HELPING_HAND - 1] = sHelpingHandDescription, - [MOVE_TRICK - 1] = sTrickDescription, - [MOVE_ROLE_PLAY - 1] = sRolePlayDescription, - [MOVE_WISH - 1] = sWishDescription, - [MOVE_ASSIST - 1] = sAssistDescription, - [MOVE_INGRAIN - 1] = sIngrainDescription, - [MOVE_SUPERPOWER - 1] = sSuperpowerDescription, - [MOVE_MAGIC_COAT - 1] = sMagicCoatDescription, - [MOVE_RECYCLE - 1] = sRecycleDescription, - [MOVE_REVENGE - 1] = sRevengeDescription, - [MOVE_BRICK_BREAK - 1] = sBrickBreakDescription, - [MOVE_YAWN - 1] = sYawnDescription, - [MOVE_KNOCK_OFF - 1] = sKnockOffDescription, - [MOVE_ENDEAVOR - 1] = sEndeavorDescription, - [MOVE_ERUPTION - 1] = sEruptionDescription, - [MOVE_SKILL_SWAP - 1] = sSkillSwapDescription, - [MOVE_IMPRISON - 1] = sImprisonDescription, - [MOVE_REFRESH - 1] = sRefreshDescription, - [MOVE_GRUDGE - 1] = sGrudgeDescription, - [MOVE_SNATCH - 1] = sSnatchDescription, - [MOVE_SECRET_POWER - 1] = sSecretPowerDescription, - [MOVE_DIVE - 1] = sDiveDescription, - [MOVE_ARM_THRUST - 1] = sArmThrustDescription, - [MOVE_CAMOUFLAGE - 1] = sCamouflageDescription, - [MOVE_TAIL_GLOW - 1] = sTailGlowDescription, - [MOVE_LUSTER_PURGE - 1] = sLusterPurgeDescription, - [MOVE_MIST_BALL - 1] = sMistBallDescription, - [MOVE_FEATHER_DANCE - 1] = sFeatherDanceDescription, - [MOVE_TEETER_DANCE - 1] = sTeeterDanceDescription, - [MOVE_BLAZE_KICK - 1] = sBlazeKickDescription, - [MOVE_MUD_SPORT - 1] = sMudSportDescription, - [MOVE_ICE_BALL - 1] = sIceBallDescription, - [MOVE_NEEDLE_ARM - 1] = sNeedleArmDescription, - [MOVE_SLACK_OFF - 1] = sSlackOffDescription, - [MOVE_HYPER_VOICE - 1] = sHyperVoiceDescription, - [MOVE_POISON_FANG - 1] = sPoisonFangDescription, - [MOVE_CRUSH_CLAW - 1] = sCrushClawDescription, - [MOVE_BLAST_BURN - 1] = sBlastBurnDescription, - [MOVE_HYDRO_CANNON - 1] = sHydroCannonDescription, - [MOVE_METEOR_MASH - 1] = sMeteorMashDescription, - [MOVE_ASTONISH - 1] = sAstonishDescription, - [MOVE_WEATHER_BALL - 1] = sWeatherBallDescription, - [MOVE_AROMATHERAPY - 1] = sAromatherapyDescription, - [MOVE_FAKE_TEARS - 1] = sFakeTearsDescription, - [MOVE_AIR_CUTTER - 1] = sAirCutterDescription, - [MOVE_OVERHEAT - 1] = sOverheatDescription, - [MOVE_ODOR_SLEUTH - 1] = sOdorSleuthDescription, - [MOVE_ROCK_TOMB - 1] = sRockTombDescription, - [MOVE_SILVER_WIND - 1] = sSilverWindDescription, - [MOVE_METAL_SOUND - 1] = sMetalSoundDescription, - [MOVE_GRASS_WHISTLE - 1] = sGrassWhistleDescription, - [MOVE_TICKLE - 1] = sTickleDescription, - [MOVE_COSMIC_POWER - 1] = sCosmicPowerDescription, - [MOVE_WATER_SPOUT - 1] = sWaterSpoutDescription, - [MOVE_SIGNAL_BEAM - 1] = sSignalBeamDescription, - [MOVE_SHADOW_PUNCH - 1] = sShadowPunchDescription, - [MOVE_EXTRASENSORY - 1] = sExtrasensoryDescription, - [MOVE_SKY_UPPERCUT - 1] = sSkyUppercutDescription, - [MOVE_SAND_TOMB - 1] = sSandTombDescription, - [MOVE_SHEER_COLD - 1] = sSheerColdDescription, - [MOVE_MUDDY_WATER - 1] = sMuddyWaterDescription, - [MOVE_BULLET_SEED - 1] = sBulletSeedDescription, - [MOVE_AERIAL_ACE - 1] = sAerialAceDescription, - [MOVE_ICICLE_SPEAR - 1] = sIcicleSpearDescription, - [MOVE_IRON_DEFENSE - 1] = sIronDefenseDescription, - [MOVE_BLOCK - 1] = sBlockDescription, - [MOVE_HOWL - 1] = sHowlDescription, - [MOVE_DRAGON_CLAW - 1] = sDragonClawDescription, - [MOVE_FRENZY_PLANT - 1] = sFrenzyPlantDescription, - [MOVE_BULK_UP - 1] = sBulkUpDescription, - [MOVE_BOUNCE - 1] = sBounceDescription, - [MOVE_MUD_SHOT - 1] = sMudShotDescription, - [MOVE_POISON_TAIL - 1] = sPoisonTailDescription, - [MOVE_COVET - 1] = sCovetDescription, - [MOVE_VOLT_TACKLE - 1] = sVoltTackleDescription, - [MOVE_MAGICAL_LEAF - 1] = sMagicalLeafDescription, - [MOVE_WATER_SPORT - 1] = sWaterSportDescription, - [MOVE_CALM_MIND - 1] = sCalmMindDescription, - [MOVE_LEAF_BLADE - 1] = sLeafBladeDescription, - [MOVE_DRAGON_DANCE - 1] = sDragonDanceDescription, - [MOVE_ROCK_BLAST - 1] = sRockBlastDescription, - [MOVE_SHOCK_WAVE - 1] = sShockWaveDescription, - [MOVE_WATER_PULSE - 1] = sWaterPulseDescription, - [MOVE_DOOM_DESIRE - 1] = sDoomDesireDescription, - [MOVE_PSYCHO_BOOST - 1] = sPsychoBoostDescription, - [MOVE_ROOST - 1] = sRoostDescription, - [MOVE_GRAVITY - 1] = sGravityDescription, - [MOVE_MIRACLE_EYE - 1] = sMiracleEyeDescription, - [MOVE_WAKE_UP_SLAP - 1] = sWakeUpSlapDescription, - [MOVE_HAMMER_ARM - 1] = sHammerArmDescription, - [MOVE_GYRO_BALL - 1] = sGyroBallDescription, - [MOVE_HEALING_WISH - 1] = sHealingWishDescription, - [MOVE_BRINE - 1] = sBrineDescription, - [MOVE_NATURAL_GIFT - 1] = sNaturalGiftDescription, - [MOVE_FEINT - 1] = sFeintDescription, - [MOVE_PLUCK - 1] = sPluckDescription, - [MOVE_TAILWIND - 1] = sTailwindDescription, - [MOVE_ACUPRESSURE - 1] = sAcupressureDescription, - [MOVE_METAL_BURST - 1] = sMetalBurstDescription, - [MOVE_U_TURN - 1] = sUTurnDescription, - [MOVE_CLOSE_COMBAT - 1] = sCloseCombatDescription, - [MOVE_PAYBACK - 1] = sPaybackDescription, - [MOVE_ASSURANCE - 1] = sAssuranceDescription, - [MOVE_EMBARGO - 1] = sEmbargoDescription, - [MOVE_FLING - 1] = sFlingDescription, - [MOVE_PSYCHO_SHIFT - 1] = sPsychoShiftDescription, - [MOVE_TRUMP_CARD - 1] = sTrumpCardDescription, - [MOVE_HEAL_BLOCK - 1] = sHealBlockDescription, - [MOVE_WRING_OUT - 1] = sWringOutDescription, - [MOVE_POWER_TRICK - 1] = sPowerTrickDescription, - [MOVE_GASTRO_ACID - 1] = sGastroAcidDescription, - [MOVE_LUCKY_CHANT - 1] = sLuckyChantDescription, - [MOVE_ME_FIRST - 1] = sMeFirstDescription, - [MOVE_COPYCAT - 1] = sCopycatDescription, - [MOVE_POWER_SWAP - 1] = sPowerSwapDescription, - [MOVE_GUARD_SWAP - 1] = sGuardSwapDescription, - [MOVE_PUNISHMENT - 1] = sPunishmentDescription, - [MOVE_LAST_RESORT - 1] = sLastResortDescription, - [MOVE_WORRY_SEED - 1] = sWorrySeedDescription, - [MOVE_SUCKER_PUNCH - 1] = sSuckerPunchDescription, - [MOVE_TOXIC_SPIKES - 1] = sToxicSpikesDescription, - [MOVE_HEART_SWAP - 1] = sHeartSwapDescription, - [MOVE_AQUA_RING - 1] = sAquaRingDescription, - [MOVE_MAGNET_RISE - 1] = sMagnetRiseDescription, - [MOVE_FLARE_BLITZ - 1] = sFlareBlitzDescription, - [MOVE_FORCE_PALM - 1] = sForcePalmDescription, - [MOVE_AURA_SPHERE - 1] = sAuraSphereDescription, - [MOVE_ROCK_POLISH - 1] = sRockPolishDescription, - [MOVE_POISON_JAB - 1] = sPoisonJabDescription, - [MOVE_DARK_PULSE - 1] = sDarkPulseDescription, - [MOVE_NIGHT_SLASH - 1] = sNightSlashDescription, - [MOVE_AQUA_TAIL - 1] = sAquaTailDescription, - [MOVE_SEED_BOMB - 1] = sSeedBombDescription, - [MOVE_AIR_SLASH - 1] = sAirSlashDescription, - [MOVE_X_SCISSOR - 1] = sXScissorDescription, - [MOVE_BUG_BUZZ - 1] = sBugBuzzDescription, - [MOVE_DRAGON_PULSE - 1] = sDragonPulseDescription, - [MOVE_DRAGON_RUSH - 1] = sDragonRushDescription, - [MOVE_POWER_GEM - 1] = sPowerGemDescription, - [MOVE_DRAIN_PUNCH - 1] = sMegaDrainDescription, - [MOVE_VACUUM_WAVE - 1] = sVacuumWaveDescription, - [MOVE_FOCUS_BLAST - 1] = sFocusBlastDescription, - [MOVE_ENERGY_BALL - 1] = sEnergyBallDescription, - [MOVE_BRAVE_BIRD - 1] = sBraveBirdDescription, - [MOVE_EARTH_POWER - 1] = sEarthPowerDescription, - [MOVE_SWITCHEROO - 1] = sSwitcherooDescription, - [MOVE_GIGA_IMPACT - 1] = sHyperBeamDescription, - [MOVE_NASTY_PLOT - 1] = sNastyPlotDescription, - [MOVE_BULLET_PUNCH - 1] = sBulletPunchDescription, - [MOVE_AVALANCHE - 1] = sRevengeDescription, - [MOVE_ICE_SHARD - 1] = sIceShardDescription, - [MOVE_SHADOW_CLAW - 1] = sShadowClawDescription, - [MOVE_THUNDER_FANG - 1] = sThunderFangDescription, - [MOVE_ICE_FANG - 1] = sIceFangDescription, - [MOVE_FIRE_FANG - 1] = sFireFangDescription, - [MOVE_SHADOW_SNEAK - 1] = sShadowSneakDescription, - [MOVE_MUD_BOMB - 1] = sMudBombDescription, - [MOVE_PSYCHO_CUT - 1] = sPsychoCutDescription, - [MOVE_ZEN_HEADBUTT - 1] = sZenHeadbuttDescription, - [MOVE_MIRROR_SHOT - 1] = sMirrorShotDescription, - [MOVE_FLASH_CANNON - 1] = sFlashCannonDescription, - [MOVE_ROCK_CLIMB - 1] = sRockClimbDescription, - [MOVE_DEFOG - 1] = sDefogDescription, - [MOVE_TRICK_ROOM - 1] = sTrickRoomDescription, - [MOVE_DRACO_METEOR - 1] = sDracoMeteorDescription, - [MOVE_DISCHARGE - 1] = sDischargeDescription, - [MOVE_LAVA_PLUME - 1] = sLavaPlumeDescription, - [MOVE_LEAF_STORM - 1] = sLeafStormDescription, - [MOVE_POWER_WHIP - 1] = sPowerWhipDescription, - [MOVE_ROCK_WRECKER - 1] = sHyperBeamDescription, - [MOVE_CROSS_POISON - 1] = sCrossPoisonDescription, - [MOVE_GUNK_SHOT - 1] = sGunkShotDescription, - [MOVE_IRON_HEAD - 1] = sIronHeadDescription, - [MOVE_MAGNET_BOMB - 1] = sMagnetBombDescription, - [MOVE_STONE_EDGE - 1] = sStoneEdgeDescription, - [MOVE_CAPTIVATE - 1] = sCaptivateDescription, - [MOVE_STEALTH_ROCK - 1] = sStealthRockDescription, - [MOVE_GRASS_KNOT - 1] = sGrassKnotDescription, - [MOVE_CHATTER - 1] = sChatterDescription, - [MOVE_JUDGMENT - 1] = sJudgmentDescription, - [MOVE_BUG_BITE - 1] = sPluckDescription, - [MOVE_CHARGE_BEAM - 1] = sChargeBeamDescription, - [MOVE_WOOD_HAMMER - 1] = sWoodHammerDescription, - [MOVE_AQUA_JET - 1] = sAquaJetDescription, - [MOVE_ATTACK_ORDER - 1] = sAttackOrderDescription, - [MOVE_DEFEND_ORDER - 1] = sDefendOrderDescription, - [MOVE_HEAL_ORDER - 1] = sHealOrderDescription, - [MOVE_HEAD_SMASH - 1] = sHeadSmashDescription, - [MOVE_DOUBLE_HIT - 1] = sDoubleHitDescription, - [MOVE_ROAR_OF_TIME - 1] = sRoarOfTimeDescription, - [MOVE_SPACIAL_REND - 1] = sSpacialRendDescription, - [MOVE_LUNAR_DANCE - 1] = sHealingWishDescription, - [MOVE_CRUSH_GRIP - 1] = sWringOutDescription, - [MOVE_MAGMA_STORM - 1] = sMagmaStormDescription, - [MOVE_DARK_VOID - 1] = sDarkVoidDescription, - [MOVE_SEED_FLARE - 1] = sSeedFlareDescription, - [MOVE_OMINOUS_WIND - 1] = sOminousWindDescription, - [MOVE_SHADOW_FORCE - 1] = sShadowForceDescription, - [MOVE_HONE_CLAWS - 1] = sHoneClawsDescription, - [MOVE_WIDE_GUARD - 1] = sWideGuardDescription, - [MOVE_GUARD_SPLIT - 1] = sGuardSplitDescription, - [MOVE_POWER_SPLIT - 1] = sPowerSplitDescription, - [MOVE_WONDER_ROOM - 1] = sWonderRoomDescription, - [MOVE_PSYSHOCK - 1] = sPsyshockDescription, - [MOVE_VENOSHOCK - 1] = sVenoshockDescription, - [MOVE_AUTOTOMIZE - 1] = sAutotomizeDescription, - [MOVE_RAGE_POWDER - 1] = sRagePowderDescription, - [MOVE_TELEKINESIS - 1] = sTelekinesisDescription, - [MOVE_MAGIC_ROOM - 1] = sMagicRoomDescription, - [MOVE_SMACK_DOWN - 1] = sSmackDownDescription, - [MOVE_STORM_THROW - 1] = sStormThrowDescription, - [MOVE_FLAME_BURST - 1] = sFlameBurstDescription, - [MOVE_SLUDGE_WAVE - 1] = sSludgeWaveDescription, - [MOVE_QUIVER_DANCE - 1] = sQuiverDanceDescription, - [MOVE_HEAVY_SLAM - 1] = sHeavySlamDescription, - [MOVE_SYNCHRONOISE - 1] = sSynchronoiseDescription, - [MOVE_ELECTRO_BALL - 1] = sElectroBallDescription, - [MOVE_SOAK - 1] = sSoakDescription, - [MOVE_FLAME_CHARGE - 1] = sFlameChargeDescription, - [MOVE_COIL - 1] = sCoilDescription, - [MOVE_LOW_SWEEP - 1] = sLowSweepDescription, - [MOVE_ACID_SPRAY - 1] = sAcidSprayDescription, - [MOVE_FOUL_PLAY - 1] = sFoulPlayDescription, - [MOVE_SIMPLE_BEAM - 1] = sSimpleBeamDescription, - [MOVE_ENTRAINMENT - 1] = sEntrainmentDescription, - [MOVE_AFTER_YOU - 1] = sAfterYouDescription, - [MOVE_ROUND - 1] = sRoundDescription, - [MOVE_ECHOED_VOICE - 1] = sEchoedVoiceDescription, - [MOVE_CHIP_AWAY - 1] = sChipAwayDescription, - [MOVE_CLEAR_SMOG - 1] = sClearSmogDescription, - [MOVE_STORED_POWER - 1] = sStoredPowerDescription, - [MOVE_QUICK_GUARD - 1] = sQuickGuardDescription, - [MOVE_ALLY_SWITCH - 1] = sAllySwitchDescription, - [MOVE_SCALD - 1] = sScaldDescription, - [MOVE_SHELL_SMASH - 1] = sShellSmashDescription, - [MOVE_HEAL_PULSE - 1] = sHealPulseDescription, - [MOVE_HEX - 1] = sHexDescription, - [MOVE_SKY_DROP - 1] = sSkyDropDescription, - [MOVE_SHIFT_GEAR - 1] = sShiftGearDescription, - [MOVE_CIRCLE_THROW - 1] = sCircleThrowDescription, - [MOVE_INCINERATE - 1] = sIncinerateDescription, - [MOVE_QUASH - 1] = sQuashDescription, - [MOVE_ACROBATICS - 1] = sAcrobaticsDescription, - [MOVE_REFLECT_TYPE - 1] = sReflectTypeDescription, - [MOVE_RETALIATE - 1] = sRetaliateDescription, - [MOVE_FINAL_GAMBIT - 1] = sFinalGambitDescription, - [MOVE_BESTOW - 1] = sBestowDescription, - [MOVE_INFERNO - 1] = sInfernoDescription, - [MOVE_WATER_PLEDGE - 1] = sWaterPledgeDescription, - [MOVE_FIRE_PLEDGE - 1] = sFirePledgeDescription, - [MOVE_GRASS_PLEDGE - 1] = sGrassPledgeDescription, - [MOVE_VOLT_SWITCH - 1] = sUTurnDescription, - [MOVE_STRUGGLE_BUG - 1] = sStruggleBugDescription, - [MOVE_BULLDOZE - 1] = sBulldozeDescription, - [MOVE_FROST_BREATH - 1] = sStormThrowDescription, - [MOVE_DRAGON_TAIL - 1] = sCircleThrowDescription, - [MOVE_WORK_UP - 1] = sWorkUpDescription, - [MOVE_ELECTROWEB - 1] = sElectrowebDescription, - [MOVE_WILD_CHARGE - 1] = sWildChargeDescription, - [MOVE_DRILL_RUN - 1] = sDrillRunDescription, - [MOVE_DUAL_CHOP - 1] = sDualChopDescription, - [MOVE_HEART_STAMP - 1] = sHeartStampDescription, - [MOVE_HORN_LEECH - 1] = sMegaDrainDescription, - [MOVE_SACRED_SWORD - 1] = sChipAwayDescription, - [MOVE_RAZOR_SHELL - 1] = sRazorShellDescription, - [MOVE_HEAT_CRASH - 1] = sHeavySlamDescription, - [MOVE_LEAF_TORNADO - 1] = sLeafTornadoDescription, - [MOVE_STEAMROLLER - 1] = sSteamrollerDescription, - [MOVE_COTTON_GUARD - 1] = sCottonGuardDescription, - [MOVE_NIGHT_DAZE - 1] = sNightDazeDescription, - [MOVE_PSYSTRIKE - 1] = sPsyshockDescription, - [MOVE_TAIL_SLAP - 1] = sTailSlapDescription, - [MOVE_HURRICANE - 1] = sHurricaneDescription, - [MOVE_HEAD_CHARGE - 1] = sHeadChargeDescription, - [MOVE_GEAR_GRIND - 1] = sGearGrindDescription, - [MOVE_SEARING_SHOT - 1] = sLavaPlumeDescription, - [MOVE_TECHNO_BLAST - 1] = sTechnoBlastDescription, - [MOVE_RELIC_SONG - 1] = sRelicSongDescription, - [MOVE_SECRET_SWORD - 1] = sSecretSwordDescription, - [MOVE_GLACIATE - 1] = sGlaciateDescription, - [MOVE_BOLT_STRIKE - 1] = sBoltStrikeDescription, - [MOVE_BLUE_FLARE - 1] = sBlueFlareDescription, - [MOVE_FIERY_DANCE - 1] = sFieryDanceDescription, - [MOVE_FREEZE_SHOCK - 1] = sFreezeShockDescription, - [MOVE_ICE_BURN - 1] = sIceBurnDescription, - [MOVE_SNARL - 1] = sSnarlDescription, - [MOVE_ICICLE_CRASH - 1] = sIcicleCrashDescription, - [MOVE_V_CREATE - 1] = sVCreateDescription, - [MOVE_FUSION_FLARE - 1] = sFusionFlareDescription, - [MOVE_FUSION_BOLT - 1] = sFusionBoltDescription, - [MOVE_FLYING_PRESS - 1] = sFlyingPressDescription, - [MOVE_MAT_BLOCK - 1] = sMatBlockDescription, - [MOVE_BELCH - 1] = sBelchDescription, - [MOVE_ROTOTILLER - 1] = sRototillerDescription, - [MOVE_STICKY_WEB - 1] = sStickyWebDescription, - [MOVE_FELL_STINGER - 1] = sFellStingerDescription, - [MOVE_PHANTOM_FORCE - 1] = sShadowForceDescription, - [MOVE_TRICK_OR_TREAT - 1] = sTrickOrTreatDescription, - [MOVE_NOBLE_ROAR - 1] = sNobleRoarDescription, - [MOVE_ION_DELUGE - 1] = sIonDelugeDescription, - [MOVE_PARABOLIC_CHARGE - 1] = sParabolicChargeDescription, - [MOVE_FORESTS_CURSE - 1] = sForestsCurseDescription, - [MOVE_PETAL_BLIZZARD - 1] = sPetalBlizzardDescription, - [MOVE_FREEZE_DRY - 1] = sFreezeDryDescription, - [MOVE_DISARMING_VOICE - 1] = sDisarmingVoiceDescription, - [MOVE_PARTING_SHOT - 1] = sPartingShotDescription, - [MOVE_TOPSY_TURVY - 1] = sTopsyTurvyDescription, - [MOVE_DRAINING_KISS - 1] = sDrainingKissDescription, - [MOVE_CRAFTY_SHIELD - 1] = sCraftyShieldDescription, - [MOVE_FLOWER_SHIELD - 1] = sFlowerShieldDescription, - [MOVE_GRASSY_TERRAIN - 1] = sGrassyTerrainDescription, - [MOVE_MISTY_TERRAIN - 1] = sMistyTerrainDescription, - [MOVE_ELECTRIFY - 1] = sElectrifyDescription, - [MOVE_PLAY_ROUGH - 1] = sPlayRoughDescription, - [MOVE_FAIRY_WIND - 1] = sFairyWindDescription, - [MOVE_MOONBLAST - 1] = sMoonblastDescription, - [MOVE_BOOMBURST - 1] = sBoomburstDescription, - [MOVE_FAIRY_LOCK - 1] = sFairyLockDescription, - [MOVE_KINGS_SHIELD - 1] = sKingsShieldDescription, - [MOVE_PLAY_NICE - 1] = sPlayNiceDescription, - [MOVE_CONFIDE - 1] = sConfideDescription, - [MOVE_DIAMOND_STORM - 1] = sDiamondStormDescription, - [MOVE_STEAM_ERUPTION - 1] = sSteamEruptionDescription, - [MOVE_HYPERSPACE_HOLE - 1] = sHyperspaceHoleDescription, - [MOVE_WATER_SHURIKEN - 1] = sWaterShurikenDescription, - [MOVE_MYSTICAL_FIRE - 1] = sMysticalFireDescription, - [MOVE_SPIKY_SHIELD - 1] = sSpikyShieldDescription, - [MOVE_AROMATIC_MIST - 1] = sAromaticMistDescription, - [MOVE_EERIE_IMPULSE - 1] = sEerieImpulseDescription, - [MOVE_VENOM_DRENCH - 1] = sVenomDrenchDescription, - [MOVE_POWDER - 1] = sPowderDescription, - [MOVE_GEOMANCY - 1] = sGeomancyDescription, - [MOVE_MAGNETIC_FLUX - 1] = sMagneticFluxDescription, - [MOVE_HAPPY_HOUR - 1] = sHappyHourDescription, - [MOVE_ELECTRIC_TERRAIN - 1] = sElectricTerrainDescription, - [MOVE_DAZZLING_GLEAM - 1] = sDazzlingGleamDescription, - [MOVE_CELEBRATE - 1] = sCelebrateDescription, - [MOVE_HOLD_HANDS - 1] = sHoldHandsDescription, - [MOVE_BABY_DOLL_EYES - 1] = sBabyDollEyesDescription, - [MOVE_NUZZLE - 1] = sNuzzleDescription, - [MOVE_HOLD_BACK - 1] = sFalseSwipeDescription, - [MOVE_INFESTATION - 1] = sInfestationDescription, - [MOVE_POWER_UP_PUNCH - 1] = sPowerUpPunchDescription, - [MOVE_OBLIVION_WING - 1] = sDrainingKissDescription, - [MOVE_THOUSAND_ARROWS - 1] = sThousandArrowsDescription, - [MOVE_THOUSAND_WAVES - 1] = sThousandWavesDescription, - [MOVE_LANDS_WRATH - 1] = sLandsWrathDescription, - [MOVE_LIGHT_OF_RUIN - 1] = sLightOfRuinDescription, - [MOVE_ORIGIN_PULSE - 1] = sOriginPulseDescription, - [MOVE_PRECIPICE_BLADES - 1] = sPrecipiceBladesDescription, - [MOVE_DRAGON_ASCENT - 1] = sCloseCombatDescription, - [MOVE_HYPERSPACE_FURY - 1] = sHyperspaceHoleDescription, - [MOVE_SHORE_UP - 1] = sShoreUpDescription, - [MOVE_FIRST_IMPRESSION - 1] = sFirstImpressionDescription, - [MOVE_BANEFUL_BUNKER - 1] = sBanefulBunkerDescription, - [MOVE_SPIRIT_SHACKLE - 1] = sSpiritShackleDescription, - [MOVE_DARKEST_LARIAT - 1] = sDarkestLariatDescription, - [MOVE_SPARKLING_ARIA - 1] = sSparklingAriaDescription, - [MOVE_ICE_HAMMER - 1] = sIceHammerDescription, - [MOVE_FLORAL_HEALING - 1] = sFloralHealingDescription, - [MOVE_HIGH_HORSEPOWER - 1] = sHighHorsepowerDescription, - [MOVE_STRENGTH_SAP - 1] = sStrengthSapDescription, - [MOVE_SOLAR_BLADE - 1] = sSolarBladeDescription, - [MOVE_LEAFAGE - 1] = sLeafageDescription, - [MOVE_SPOTLIGHT - 1] = sSpotlightDescription, - [MOVE_TOXIC_THREAD - 1] = sToxicThreadDescription, - [MOVE_LASER_FOCUS - 1] = sLaserFocusDescription, - [MOVE_GEAR_UP - 1] = sGearUpDescription, - [MOVE_THROAT_CHOP - 1] = sThroatChopDescription, - [MOVE_POLLEN_PUFF - 1] = sPollenPuffDescription, - [MOVE_ANCHOR_SHOT - 1] = sAnchorShotDescription, - [MOVE_PSYCHIC_TERRAIN - 1] = sPsychicTerrainDescription, - [MOVE_LUNGE - 1] = sLungeDescription, - [MOVE_FIRE_LASH - 1] = sFireLashDescription, - [MOVE_POWER_TRIP - 1] = sPowerTripDescription, - [MOVE_BURN_UP - 1] = sBurnUpDescription, - [MOVE_SPEED_SWAP - 1] = sSpeedSwapDescription, - [MOVE_SMART_STRIKE - 1] = sSmartStrikeDescription, - [MOVE_PURIFY - 1] = sPurifyDescription, - [MOVE_REVELATION_DANCE - 1] = sRevelationDanceDescription, - [MOVE_CORE_ENFORCER - 1] = sCoreEnforcerDescription, - [MOVE_TROP_KICK - 1] = sTropKickDescription, - [MOVE_INSTRUCT - 1] = sInstructDescription, - [MOVE_BEAK_BLAST - 1] = sBeakBlastDescription, - [MOVE_CLANGING_SCALES - 1] = sClangingScalesDescription, - [MOVE_DRAGON_HAMMER - 1] = sDragonHammerDescription, - [MOVE_BRUTAL_SWING - 1] = sBrutalSwingDescription, - [MOVE_AURORA_VEIL - 1] = sAuroraVeilDescription, - [MOVE_SHELL_TRAP - 1] = sShellTrapDescription, - [MOVE_FLEUR_CANNON - 1] = sFleurCannonDescription, - [MOVE_PSYCHIC_FANGS - 1] = sPsychicFangsDescription, - [MOVE_STOMPING_TANTRUM - 1] = sStompingTantrumDescription, - [MOVE_SHADOW_BONE - 1] = sShadowBoneDescription, - [MOVE_ACCELEROCK - 1] = sAccelerockDescription, - [MOVE_LIQUIDATION - 1] = sLiquidationDescription, - [MOVE_PRISMATIC_LASER - 1] = sPrismaticLaserDescription, - [MOVE_SPECTRAL_THIEF - 1] = sSpectralThiefDescription, - [MOVE_SUNSTEEL_STRIKE - 1] = sSunsteelStrikeDescription, - [MOVE_MOONGEIST_BEAM - 1] = sMoongeistBeamDescription, - [MOVE_TEARFUL_LOOK - 1] = sTearfulLookDescription, - [MOVE_ZING_ZAP - 1] = sZingZapDescription, - [MOVE_NATURES_MADNESS - 1] = sNaturesMadnessDescription, - [MOVE_MULTI_ATTACK - 1] = sMultiAttackDescription, - [MOVE_MIND_BLOWN - 1] = sMindBlownDescription, - [MOVE_PLASMA_FISTS - 1] = sPlasmaFistsDescription, - [MOVE_PHOTON_GEYSER - 1] = sPhotonGeyserDescription, - [MOVE_ZIPPY_ZAP - 1] = sZippyZapDescription, - [MOVE_SPLISHY_SPLASH - 1] = sSplishySplashDescription, - [MOVE_FLOATY_FALL - 1] = sFloatyFallDescription, - [MOVE_PIKA_PAPOW - 1] = sPikaPapowDescription, - [MOVE_BOUNCY_BUBBLE - 1] = sBouncyBubbleDescription, - [MOVE_BUZZY_BUZZ - 1] = sBuzzyBuzzDescription, - [MOVE_SIZZLY_SLIDE - 1] = sSizzlySlideDescription, - [MOVE_GLITZY_GLOW - 1] = sGlitzyGlowDescription, - [MOVE_BADDY_BAD - 1] = sBaddyBadDescription, - [MOVE_SAPPY_SEED - 1] = sSappySeedDescription, - [MOVE_FREEZY_FROST - 1] = sFreezyFrostDescription, - [MOVE_SPARKLY_SWIRL - 1] = sSparklySwirlDescription, - [MOVE_VEEVEE_VOLLEY - 1] = sVeeveeVolleyDescription, - [MOVE_DOUBLE_IRON_BASH - 1] = sDoubleIronBashDescription, - - //GEN 8 - [MOVE_DYNAMAX_CANNON - 1] = sDynamaxCannonDescription, - [MOVE_SNIPE_SHOT - 1] = sSnipeShotDescription, - [MOVE_JAW_LOCK - 1] = sJawLockDescription, - [MOVE_STUFF_CHEEKS - 1] = sStuffCheeksDescription, - [MOVE_NO_RETREAT - 1] = sNoRetreatDescription, - [MOVE_TAR_SHOT - 1] = sTarShotDescription, - [MOVE_MAGIC_POWDER - 1] = sMagicPowderDescription, - [MOVE_DRAGON_DARTS - 1] = sDragonDartsDescription, - [MOVE_TEATIME - 1] = sTeatimeDescription, - [MOVE_OCTOLOCK - 1] = sOctolockDescription, - [MOVE_BOLT_BEAK - 1] = sBoltBeakDescription, - [MOVE_FISHIOUS_REND - 1] = sFishiousRendDescription, - [MOVE_COURT_CHANGE - 1] = sCourtChangeDescription, - [MOVE_CLANGOROUS_SOUL - 1] = sClangorousSoulDescription, - [MOVE_BODY_PRESS - 1] = sBodyPressDescription, - [MOVE_DECORATE - 1] = sDecorateDescription, - [MOVE_DRUM_BEATING - 1] = sDrumBeatingDescription, - [MOVE_SNAP_TRAP - 1] = sSnapTrapDescription, - [MOVE_PYRO_BALL - 1] = sPyroBallDescription, - [MOVE_BEHEMOTH_BLADE - 1] = sBehemothBladeDescription, - [MOVE_BEHEMOTH_BASH - 1] = sBehemothBashDescription, - [MOVE_AURA_WHEEL - 1] = sAuraWheelDescription, - [MOVE_BREAKING_SWIPE - 1] = sBreakingSwipeDescription, - [MOVE_BRANCH_POKE - 1] = sBranchPokeDescription, - [MOVE_OVERDRIVE - 1] = sOverdriveDescription, - [MOVE_APPLE_ACID - 1] = sAppleAcidDescription, - [MOVE_GRAV_APPLE - 1] = sGravAppleDescription, - [MOVE_SPIRIT_BREAK - 1] = sSpiritBreakDescription, - [MOVE_STRANGE_STEAM - 1] = sStrangeSteamDescription, - [MOVE_LIFE_DEW - 1] = sLifeDewDescription, - [MOVE_OBSTRUCT - 1] = sObstructDescription, - [MOVE_FALSE_SURRENDER - 1] = sFalseSurrenderDescription, - [MOVE_METEOR_ASSAULT - 1] = sMeteorAssaultDescription, - [MOVE_ETERNABEAM - 1] = sEternabeamDescription, - [MOVE_STEEL_BEAM - 1] = sSteelBeamDescription, - [MOVE_EXPANDING_FORCE - 1] = sExpandingForceDescription, - [MOVE_STEEL_ROLLER - 1] = sSteelRollerDescription, - [MOVE_SCALE_SHOT - 1] = sScaleShotDescription, - [MOVE_METEOR_BEAM - 1] = sMeteorBeamDescription, - [MOVE_SHELL_SIDE_ARM - 1] = sShellSideArmDescription, - [MOVE_MISTY_EXPLOSION - 1] = sMistyExplosionDescription, - [MOVE_GRASSY_GLIDE - 1] = sGrassyGlideDescription, - [MOVE_RISING_VOLTAGE - 1] = sRisingVoltageDescription, - [MOVE_TERRAIN_PULSE - 1] = sTerrainPulseDescription, - [MOVE_SKITTER_SMACK - 1] = sSkitterSmackDescription, - [MOVE_BURNING_JEALOUSY - 1] = sBurningJealousyDescription, - [MOVE_LASH_OUT - 1] = sLashOutDescription, - [MOVE_POLTERGEIST - 1] = sPoltergeistDescription, - [MOVE_CORROSIVE_GAS - 1] = sCorrosiveGasDescription, - [MOVE_COACHING - 1] = sCoachingDescription, - [MOVE_FLIP_TURN - 1] = sFlipTurnDescription, - [MOVE_TRIPLE_AXEL - 1] = sTripleAxelDescription, - [MOVE_DUAL_WINGBEAT - 1] = sDualWingbeatDescription, - [MOVE_SCORCHING_SANDS - 1] = sScorchingSandsDescription, - [MOVE_JUNGLE_HEALING - 1] = sJungleHealingDescription, - [MOVE_WICKED_BLOW - 1] = sWickedBlowDescription, - [MOVE_SURGING_STRIKES - 1] = sSurgingStrikesDescription, - [MOVE_THUNDER_CAGE - 1] = sThunderCageDescription, - [MOVE_DRAGON_ENERGY - 1] = sDragonEnergyDescription, - [MOVE_FREEZING_GLARE - 1] = sFreezingGlareDescription, - [MOVE_FIERY_WRATH - 1] = sFieryWrathDescription, - [MOVE_THUNDEROUS_KICK - 1] = sThunderousKickDescription, - [MOVE_GLACIAL_LANCE - 1] = sGlacialLanceDescription, - [MOVE_ASTRAL_BARRAGE - 1] = sAstralBarrageDescription, - [MOVE_EERIE_SPELL - 1] = sEerieSpellDescription, - [MOVE_DIRE_CLAW - 1] = sDireClawDescription, - [MOVE_PSYSHIELD_BASH - 1] = sPsyshieldBashDescription, - [MOVE_POWER_SHIFT - 1] = sPowerShiftDescription, - [MOVE_STONE_AXE - 1] = sStoneAxeDescription, - [MOVE_SPRINGTIDE_STORM - 1] = sSpringtideStormDescription, - [MOVE_MYSTICAL_POWER - 1] = sMysticalPowerDescription, - [MOVE_RAGING_FURY - 1] = sRagingFuryDescription, - [MOVE_WAVE_CRASH - 1] = sWaveCrashDescription, - [MOVE_CHLOROBLAST - 1] = sChloroblastDescription, - [MOVE_MOUNTAIN_GALE - 1] = sMountainGaleDescription, - [MOVE_VICTORY_DANCE - 1] = sVictoryDanceDescription, - [MOVE_HEADLONG_RUSH - 1] = sHeadlongRushDescription, - [MOVE_BARB_BARRAGE - 1] = sBarbBarrageDescription, - [MOVE_ESPER_WING - 1] = sEsperWingDescription, - [MOVE_BITTER_MALICE - 1] = sBitterMaliceDescription, - [MOVE_SHELTER - 1] = sShelterDescription, - [MOVE_TRIPLE_ARROWS - 1] = sTripleArrowsDescription, - [MOVE_INFERNAL_PARADE - 1] = sInfernalParadeDescription, - [MOVE_CEASELESS_EDGE - 1] = sCeaselessEdgeDescription, - [MOVE_BLEAKWIND_STORM - 1] = sBleakwindStormDescription, - [MOVE_WILDBOLT_STORM - 1] = sWildboltStormDescription, - [MOVE_SANDSEAR_STORM - 1] = sSandsearStormDescription, - [MOVE_LUNAR_BLESSING - 1] = sLunarBlessingDescription, - [MOVE_TAKE_HEART - 1] = sTakeHeartDescription, - [MOVE_TERA_BLAST - 1] = sTeraBlastDescription, - [MOVE_SILK_TRAP - 1] = sSilkTrapDescription, - [MOVE_AXE_KICK - 1] = sAxeKickDescription, - [MOVE_LAST_RESPECTS - 1] = sLastRespectsDescription, - [MOVE_LUMINA_CRASH - 1] = sLuminaCrashDescription, - [MOVE_ORDER_UP - 1] = sOrderUpDescription, - [MOVE_JET_PUNCH - 1] = sJetPunchDescription, - [MOVE_SPICY_EXTRACT - 1] = sSpicyExtractDescription, - [MOVE_SPIN_OUT - 1] = sSpinOutDescription, - [MOVE_POPULATION_BOMB - 1] = sPopulationBombDescription, - [MOVE_ICE_SPINNER - 1] = sIceSpinnerDescription, - [MOVE_GLAIVE_RUSH - 1] = sGlaiveRushDescription, - [MOVE_REVIVAL_BLESSING - 1] = sRevivalBlessingDescription, - [MOVE_SALT_CURE - 1] = sSaltCureDescription, - [MOVE_TRIPLE_DIVE - 1] = sTripleDiveDescription, - [MOVE_MORTAL_SPIN - 1] = sMortalSpinDescription, - [MOVE_DOODLE - 1] = sDoodleDescription, - [MOVE_FILLET_AWAY - 1] = sFilletAwayDescription, - [MOVE_KOWTOW_CLEAVE - 1] = sKowtowCleaveDescription, - [MOVE_FLOWER_TRICK - 1] = sFlowerTrickDescription, - [MOVE_TORCH_SONG - 1] = sTorchSongDescription, - [MOVE_AQUA_STEP - 1] = sAquaStepDescription, - [MOVE_RAGING_BULL - 1] = sRagingBullDescription, - [MOVE_MAKE_IT_RAIN - 1] = sMakeItRainDescription, - [MOVE_RUINATION - 1] = sRuinationDescription, - [MOVE_COLLISION_COURSE - 1] = sCollisionCourseDescription, - [MOVE_ELECTRO_DRIFT - 1] = sElectroDriftDescription, - [MOVE_SHED_TAIL - 1] = sShedTailDescription, - [MOVE_CHILLY_RECEPTION - 1] = sChillyReceptionDescription, - [MOVE_TIDY_UP - 1] = sTidyUpDescription, - [MOVE_SNOWSCAPE - 1] = sSnowscapeDescription, - [MOVE_POUNCE - 1] = sPounceDescription, - [MOVE_TRAILBLAZE - 1] = sTrailblazeDescription, - [MOVE_CHILLING_WATER - 1] = sChillingWaterDescription, - [MOVE_HYPER_DRILL - 1] = sHyperDrillDescription, - [MOVE_TWIN_BEAM - 1] = sTwinBeamDescription, - [MOVE_RAGE_FIST - 1] = sRageFistDescription, - [MOVE_ARMOR_CANNON - 1] = sArmorCannonDescription, - [MOVE_BITTER_BLADE - 1] = sBitterBladeDescription, - [MOVE_DOUBLE_SHOCK - 1] = sDoubleShockDescription, - [MOVE_GIGATON_HAMMER - 1] = sGigatonHammerDescription, - [MOVE_COMEUPPANCE - 1] = sComeuppanceDescription, - [MOVE_AQUA_CUTTER - 1] = sAquaCutterDescription, - [MOVE_BLAZING_TORQUE - 1] = sBlazingTorqueDescription, - [MOVE_WICKED_TORQUE - 1] = sWickedTorqueDescription, - [MOVE_NOXIOUS_TORQUE - 1] = sNoxiousTorqueDescription, - [MOVE_COMBAT_TORQUE - 1] = sCombatTorqueDescription, - [MOVE_MAGICAL_TORQUE - 1] = sMagicalTorqueDescription, - [MOVE_PSYBLADE - 1] = sPsybladeDescription, - [MOVE_HYDRO_STEAM - 1] = sHydroSteamDescription, - [MOVE_BLOOD_MOON - 1] = sBloodMoonDescription, - [MOVE_MATCHA_GOTCHA - 1] = sMatchaGotchaDescription, - [MOVE_SYRUP_BOMB - 1] = sSyrupBombDescription, - [MOVE_IVY_CUDGEL - 1] = sIvyCudgelDescription, - [MOVE_ELECTRO_SHOT - 1] = sElectroShotDescription, - [MOVE_TERA_STARSTORM - 1] = sTeraStarstormDescription, - [MOVE_FICKLE_BEAM - 1] = sFickleBeamDescription, - [MOVE_BURNING_BULWARK - 1] = sBurningBulwarkDescription, - [MOVE_THUNDERCLAP - 1] = sSuckerPunchDescription, - [MOVE_MIGHTY_CLEAVE - 1] = sFeintDescription, - [MOVE_TACHYON_CUTTER - 1] = sTachyonCutterDescription, - [MOVE_HARD_PRESS - 1] = sWringOutDescription, - [MOVE_DRAGON_CHEER - 1] = sDragonCheerDescription, - [MOVE_ALLURING_VOICE - 1] = sAlluringVoiceDescription, - [MOVE_TEMPER_FLARE - 1] = sTemperFlareDescription, - [MOVE_SUPERCELL_SLAM - 1] = sSupercellSlamDescription, - [MOVE_PSYCHIC_NOISE - 1] = sPsychicNoiseDescription, - [MOVE_UPPER_HAND - 1] = sUpperHandDescription, - [MOVE_MALIGNANT_CHAIN - 1] = sMalignantChainDescription, -}; diff --git a/src/data/text/species_names.h b/src/data/text/species_names.h deleted file mode 100644 index 07bf8f997..000000000 --- a/src/data/text/species_names.h +++ /dev/null @@ -1,414 +0,0 @@ -// const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1] = { -// [SPECIES_NONE] = _("??????????"), -// [SPECIES_BULBASAUR] = _("BULBASAUR"), -// [SPECIES_IVYSAUR] = _("IVYSAUR"), -// [SPECIES_VENUSAUR] = _("VENUSAUR"), -// [SPECIES_CHARMANDER] = _("CHARMANDER"), -// [SPECIES_CHARMELEON] = _("CHARMELEON"), -// [SPECIES_CHARIZARD] = _("CHARIZARD"), -// [SPECIES_SQUIRTLE] = _("SQUIRTLE"), -// [SPECIES_WARTORTLE] = _("WARTORTLE"), -// [SPECIES_BLASTOISE] = _("BLASTOISE"), -// [SPECIES_CATERPIE] = _("CATERPIE"), -// [SPECIES_METAPOD] = _("METAPOD"), -// [SPECIES_BUTTERFREE] = _("BUTTERFREE"), -// [SPECIES_WEEDLE] = _("WEEDLE"), -// [SPECIES_KAKUNA] = _("KAKUNA"), -// [SPECIES_BEEDRILL] = _("BEEDRILL"), -// [SPECIES_PIDGEY] = _("PIDGEY"), -// [SPECIES_PIDGEOTTO] = _("PIDGEOTTO"), -// [SPECIES_PIDGEOT] = _("PIDGEOT"), -// [SPECIES_RATTATA] = _("RATTATA"), -// [SPECIES_RATICATE] = _("RATICATE"), -// [SPECIES_SPEAROW] = _("SPEAROW"), -// [SPECIES_FEAROW] = _("FEAROW"), -// [SPECIES_EKANS] = _("EKANS"), -// [SPECIES_ARBOK] = _("ARBOK"), -// [SPECIES_PIKACHU] = _("PIKACHU"), -// [SPECIES_RAICHU] = _("RAICHU"), -// [SPECIES_SANDSHREW] = _("SANDSHREW"), -// [SPECIES_SANDSLASH] = _("SANDSLASH"), -// [SPECIES_NIDORAN_F] = _("NIDORAN♀"), -// [SPECIES_NIDORINA] = _("NIDORINA"), -// [SPECIES_NIDOQUEEN] = _("NIDOQUEEN"), -// [SPECIES_NIDORAN_M] = _("NIDORAN♂"), -// [SPECIES_NIDORINO] = _("NIDORINO"), -// [SPECIES_NIDOKING] = _("NIDOKING"), -// [SPECIES_CLEFAIRY] = _("CLEFAIRY"), -// [SPECIES_CLEFABLE] = _("CLEFABLE"), -// [SPECIES_VULPIX] = _("VULPIX"), -// [SPECIES_NINETALES] = _("NINETALES"), -// [SPECIES_JIGGLYPUFF] = _("JIGGLYPUFF"), -// [SPECIES_WIGGLYTUFF] = _("WIGGLYTUFF"), -// [SPECIES_ZUBAT] = _("ZUBAT"), -// [SPECIES_GOLBAT] = _("GOLBAT"), -// [SPECIES_ODDISH] = _("ODDISH"), -// [SPECIES_GLOOM] = _("GLOOM"), -// [SPECIES_VILEPLUME] = _("VILEPLUME"), -// [SPECIES_PARAS] = _("PARAS"), -// [SPECIES_PARASECT] = _("PARASECT"), -// [SPECIES_VENONAT] = _("VENONAT"), -// [SPECIES_VENOMOTH] = _("VENOMOTH"), -// [SPECIES_DIGLETT] = _("DIGLETT"), -// [SPECIES_DUGTRIO] = _("DUGTRIO"), -// [SPECIES_MEOWTH] = _("MEOWTH"), -// [SPECIES_PERSIAN] = _("PERSIAN"), -// [SPECIES_PSYDUCK] = _("PSYDUCK"), -// [SPECIES_GOLDUCK] = _("GOLDUCK"), -// [SPECIES_MANKEY] = _("MANKEY"), -// [SPECIES_PRIMEAPE] = _("PRIMEAPE"), -// [SPECIES_GROWLITHE] = _("GROWLITHE"), -// [SPECIES_ARCANINE] = _("ARCANINE"), -// [SPECIES_POLIWAG] = _("POLIWAG"), -// [SPECIES_POLIWHIRL] = _("POLIWHIRL"), -// [SPECIES_POLIWRATH] = _("POLIWRATH"), -// [SPECIES_ABRA] = _("ABRA"), -// [SPECIES_KADABRA] = _("KADABRA"), -// [SPECIES_ALAKAZAM] = _("ALAKAZAM"), -// [SPECIES_MACHOP] = _("MACHOP"), -// [SPECIES_MACHOKE] = _("MACHOKE"), -// [SPECIES_MACHAMP] = _("MACHAMP"), -// [SPECIES_BELLSPROUT] = _("BELLSPROUT"), -// [SPECIES_WEEPINBELL] = _("WEEPINBELL"), -// [SPECIES_VICTREEBEL] = _("VICTREEBEL"), -// [SPECIES_TENTACOOL] = _("TENTACOOL"), -// [SPECIES_TENTACRUEL] = _("TENTACRUEL"), -// [SPECIES_GEODUDE] = _("GEODUDE"), -// [SPECIES_GRAVELER] = _("GRAVELER"), -// [SPECIES_GOLEM] = _("GOLEM"), -// [SPECIES_PONYTA] = _("PONYTA"), -// [SPECIES_RAPIDASH] = _("RAPIDASH"), -// [SPECIES_SLOWPOKE] = _("SLOWPOKE"), -// [SPECIES_SLOWBRO] = _("SLOWBRO"), -// [SPECIES_MAGNEMITE] = _("MAGNEMITE"), -// [SPECIES_MAGNETON] = _("MAGNETON"), -// [SPECIES_FARFETCHD] = _("FARFETCH'D"), -// [SPECIES_DODUO] = _("DODUO"), -// [SPECIES_DODRIO] = _("DODRIO"), -// [SPECIES_SEEL] = _("SEEL"), -// [SPECIES_DEWGONG] = _("DEWGONG"), -// [SPECIES_GRIMER] = _("GRIMER"), -// [SPECIES_MUK] = _("MUK"), -// [SPECIES_SHELLDER] = _("SHELLDER"), -// [SPECIES_CLOYSTER] = _("CLOYSTER"), -// [SPECIES_GASTLY] = _("GASTLY"), -// [SPECIES_HAUNTER] = _("HAUNTER"), -// [SPECIES_GENGAR] = _("GENGAR"), -// [SPECIES_ONIX] = _("ONIX"), -// [SPECIES_DROWZEE] = _("DROWZEE"), -// [SPECIES_HYPNO] = _("HYPNO"), -// [SPECIES_KRABBY] = _("KRABBY"), -// [SPECIES_KINGLER] = _("KINGLER"), -// [SPECIES_VOLTORB] = _("VOLTORB"), -// [SPECIES_ELECTRODE] = _("ELECTRODE"), -// [SPECIES_EXEGGCUTE] = _("EXEGGCUTE"), -// [SPECIES_EXEGGUTOR] = _("EXEGGUTOR"), -// [SPECIES_CUBONE] = _("CUBONE"), -// [SPECIES_MAROWAK] = _("MAROWAK"), -// [SPECIES_HITMONLEE] = _("HITMONLEE"), -// [SPECIES_HITMONCHAN] = _("HITMONCHAN"), -// [SPECIES_LICKITUNG] = _("LICKITUNG"), -// [SPECIES_KOFFING] = _("KOFFING"), -// [SPECIES_WEEZING] = _("WEEZING"), -// [SPECIES_RHYHORN] = _("RHYHORN"), -// [SPECIES_RHYDON] = _("RHYDON"), -// [SPECIES_CHANSEY] = _("CHANSEY"), -// [SPECIES_TANGELA] = _("TANGELA"), -// [SPECIES_KANGASKHAN] = _("KANGASKHAN"), -// [SPECIES_HORSEA] = _("HORSEA"), -// [SPECIES_SEADRA] = _("SEADRA"), -// [SPECIES_GOLDEEN] = _("GOLDEEN"), -// [SPECIES_SEAKING] = _("SEAKING"), -// [SPECIES_STARYU] = _("STARYU"), -// [SPECIES_STARMIE] = _("STARMIE"), -// [SPECIES_MR_MIME] = _("MR. MIME"), -// [SPECIES_SCYTHER] = _("SCYTHER"), -// [SPECIES_JYNX] = _("JYNX"), -// [SPECIES_ELECTABUZZ] = _("ELECTABUZZ"), -// [SPECIES_MAGMAR] = _("MAGMAR"), -// [SPECIES_PINSIR] = _("PINSIR"), -// [SPECIES_TAUROS] = _("TAUROS"), -// [SPECIES_MAGIKARP] = _("MAGIKARP"), -// [SPECIES_GYARADOS] = _("GYARADOS"), -// [SPECIES_LAPRAS] = _("LAPRAS"), -// [SPECIES_DITTO] = _("DITTO"), -// [SPECIES_EEVEE] = _("EEVEE"), -// [SPECIES_VAPOREON] = _("VAPOREON"), -// [SPECIES_JOLTEON] = _("JOLTEON"), -// [SPECIES_FLAREON] = _("FLAREON"), -// [SPECIES_PORYGON] = _("PORYGON"), -// [SPECIES_OMANYTE] = _("OMANYTE"), -// [SPECIES_OMASTAR] = _("OMASTAR"), -// [SPECIES_KABUTO] = _("KABUTO"), -// [SPECIES_KABUTOPS] = _("KABUTOPS"), -// [SPECIES_AERODACTYL] = _("AERODACTYL"), -// [SPECIES_SNORLAX] = _("SNORLAX"), -// [SPECIES_ARTICUNO] = _("ARTICUNO"), -// [SPECIES_ZAPDOS] = _("ZAPDOS"), -// [SPECIES_MOLTRES] = _("MOLTRES"), -// [SPECIES_DRATINI] = _("DRATINI"), -// [SPECIES_DRAGONAIR] = _("DRAGONAIR"), -// [SPECIES_DRAGONITE] = _("DRAGONITE"), -// [SPECIES_MEWTWO] = _("MEWTWO"), -// [SPECIES_MEW] = _("MEW"), -// [SPECIES_CHIKORITA] = _("CHIKORITA"), -// [SPECIES_BAYLEEF] = _("BAYLEEF"), -// [SPECIES_MEGANIUM] = _("MEGANIUM"), -// [SPECIES_CYNDAQUIL] = _("CYNDAQUIL"), -// [SPECIES_QUILAVA] = _("QUILAVA"), -// [SPECIES_TYPHLOSION] = _("TYPHLOSION"), -// [SPECIES_TOTODILE] = _("TOTODILE"), -// [SPECIES_CROCONAW] = _("CROCONAW"), -// [SPECIES_FERALIGATR] = _("FERALIGATR"), -// [SPECIES_SENTRET] = _("SENTRET"), -// [SPECIES_FURRET] = _("FURRET"), -// [SPECIES_HOOTHOOT] = _("HOOTHOOT"), -// [SPECIES_NOCTOWL] = _("NOCTOWL"), -// [SPECIES_LEDYBA] = _("LEDYBA"), -// [SPECIES_LEDIAN] = _("LEDIAN"), -// [SPECIES_SPINARAK] = _("SPINARAK"), -// [SPECIES_ARIADOS] = _("ARIADOS"), -// [SPECIES_CROBAT] = _("CROBAT"), -// [SPECIES_CHINCHOU] = _("CHINCHOU"), -// [SPECIES_LANTURN] = _("LANTURN"), -// [SPECIES_PICHU] = _("PICHU"), -// [SPECIES_CLEFFA] = _("CLEFFA"), -// [SPECIES_IGGLYBUFF] = _("IGGLYBUFF"), -// [SPECIES_TOGEPI] = _("TOGEPI"), -// [SPECIES_TOGETIC] = _("TOGETIC"), -// [SPECIES_NATU] = _("NATU"), -// [SPECIES_XATU] = _("XATU"), -// [SPECIES_MAREEP] = _("MAREEP"), -// [SPECIES_FLAAFFY] = _("FLAAFFY"), -// [SPECIES_AMPHAROS] = _("AMPHAROS"), -// [SPECIES_BELLOSSOM] = _("BELLOSSOM"), -// [SPECIES_MARILL] = _("MARILL"), -// [SPECIES_AZUMARILL] = _("AZUMARILL"), -// [SPECIES_SUDOWOODO] = _("SUDOWOODO"), -// [SPECIES_POLITOED] = _("POLITOED"), -// [SPECIES_HOPPIP] = _("HOPPIP"), -// [SPECIES_SKIPLOOM] = _("SKIPLOOM"), -// [SPECIES_JUMPLUFF] = _("JUMPLUFF"), -// [SPECIES_AIPOM] = _("AIPOM"), -// [SPECIES_SUNKERN] = _("SUNKERN"), -// [SPECIES_SUNFLORA] = _("SUNFLORA"), -// [SPECIES_YANMA] = _("YANMA"), -// [SPECIES_WOOPER] = _("WOOPER"), -// [SPECIES_QUAGSIRE] = _("QUAGSIRE"), -// [SPECIES_ESPEON] = _("ESPEON"), -// [SPECIES_UMBREON] = _("UMBREON"), -// [SPECIES_MURKROW] = _("MURKROW"), -// [SPECIES_SLOWKING] = _("SLOWKING"), -// [SPECIES_MISDREAVUS] = _("MISDREAVUS"), -// [SPECIES_UNOWN] = _("UNOWN"), -// [SPECIES_WOBBUFFET] = _("WOBBUFFET"), -// [SPECIES_GIRAFARIG] = _("GIRAFARIG"), -// [SPECIES_PINECO] = _("PINECO"), -// [SPECIES_FORRETRESS] = _("FORRETRESS"), -// [SPECIES_DUNSPARCE] = _("DUNSPARCE"), -// [SPECIES_GLIGAR] = _("GLIGAR"), -// [SPECIES_STEELIX] = _("STEELIX"), -// [SPECIES_SNUBBULL] = _("SNUBBULL"), -// [SPECIES_GRANBULL] = _("GRANBULL"), -// [SPECIES_QWILFISH] = _("QWILFISH"), -// [SPECIES_SCIZOR] = _("SCIZOR"), -// [SPECIES_SHUCKLE] = _("SHUCKLE"), -// [SPECIES_HERACROSS] = _("HERACROSS"), -// [SPECIES_SNEASEL] = _("SNEASEL"), -// [SPECIES_TEDDIURSA] = _("TEDDIURSA"), -// [SPECIES_URSARING] = _("URSARING"), -// [SPECIES_SLUGMA] = _("SLUGMA"), -// [SPECIES_MAGCARGO] = _("MAGCARGO"), -// [SPECIES_SWINUB] = _("SWINUB"), -// [SPECIES_PILOSWINE] = _("PILOSWINE"), -// [SPECIES_CORSOLA] = _("CORSOLA"), -// [SPECIES_REMORAID] = _("REMORAID"), -// [SPECIES_OCTILLERY] = _("OCTILLERY"), -// [SPECIES_DELIBIRD] = _("DELIBIRD"), -// [SPECIES_MANTINE] = _("MANTINE"), -// [SPECIES_SKARMORY] = _("SKARMORY"), -// [SPECIES_HOUNDOUR] = _("HOUNDOUR"), -// [SPECIES_HOUNDOOM] = _("HOUNDOOM"), -// [SPECIES_KINGDRA] = _("KINGDRA"), -// [SPECIES_PHANPY] = _("PHANPY"), -// [SPECIES_DONPHAN] = _("DONPHAN"), -// [SPECIES_PORYGON2] = _("PORYGON2"), -// [SPECIES_STANTLER] = _("STANTLER"), -// [SPECIES_SMEARGLE] = _("SMEARGLE"), -// [SPECIES_TYROGUE] = _("TYROGUE"), -// [SPECIES_HITMONTOP] = _("HITMONTOP"), -// [SPECIES_SMOOCHUM] = _("SMOOCHUM"), -// [SPECIES_ELEKID] = _("ELEKID"), -// [SPECIES_MAGBY] = _("MAGBY"), -// [SPECIES_MILTANK] = _("MILTANK"), -// [SPECIES_BLISSEY] = _("BLISSEY"), -// [SPECIES_RAIKOU] = _("RAIKOU"), -// [SPECIES_ENTEI] = _("ENTEI"), -// [SPECIES_SUICUNE] = _("SUICUNE"), -// [SPECIES_LARVITAR] = _("LARVITAR"), -// [SPECIES_PUPITAR] = _("PUPITAR"), -// [SPECIES_TYRANITAR] = _("TYRANITAR"), -// [SPECIES_LUGIA] = _("LUGIA"), -// [SPECIES_HO_OH] = _("HO-OH"), -// [SPECIES_CELEBI] = _("CELEBI"), -// [SPECIES_OLD_UNOWN_B] = _("?"), -// [SPECIES_OLD_UNOWN_C] = _("?"), -// [SPECIES_OLD_UNOWN_D] = _("?"), -// [SPECIES_OLD_UNOWN_E] = _("?"), -// [SPECIES_OLD_UNOWN_F] = _("?"), -// [SPECIES_OLD_UNOWN_G] = _("?"), -// [SPECIES_OLD_UNOWN_H] = _("?"), -// [SPECIES_OLD_UNOWN_I] = _("?"), -// [SPECIES_OLD_UNOWN_J] = _("?"), -// [SPECIES_OLD_UNOWN_K] = _("?"), -// [SPECIES_OLD_UNOWN_L] = _("?"), -// [SPECIES_OLD_UNOWN_M] = _("?"), -// [SPECIES_OLD_UNOWN_N] = _("?"), -// [SPECIES_OLD_UNOWN_O] = _("?"), -// [SPECIES_OLD_UNOWN_P] = _("?"), -// [SPECIES_OLD_UNOWN_Q] = _("?"), -// [SPECIES_OLD_UNOWN_R] = _("?"), -// [SPECIES_OLD_UNOWN_S] = _("?"), -// [SPECIES_OLD_UNOWN_T] = _("?"), -// [SPECIES_OLD_UNOWN_U] = _("?"), -// [SPECIES_OLD_UNOWN_V] = _("?"), -// [SPECIES_OLD_UNOWN_W] = _("?"), -// [SPECIES_OLD_UNOWN_X] = _("?"), -// [SPECIES_OLD_UNOWN_Y] = _("?"), -// [SPECIES_OLD_UNOWN_Z] = _("?"), -// [SPECIES_TREECKO] = _("TREECKO"), -// [SPECIES_GROVYLE] = _("GROVYLE"), -// [SPECIES_SCEPTILE] = _("SCEPTILE"), -// [SPECIES_TORCHIC] = _("TORCHIC"), -// [SPECIES_COMBUSKEN] = _("COMBUSKEN"), -// [SPECIES_BLAZIKEN] = _("BLAZIKEN"), -// [SPECIES_MUDKIP] = _("MUDKIP"), -// [SPECIES_MARSHTOMP] = _("MARSHTOMP"), -// [SPECIES_SWAMPERT] = _("SWAMPERT"), -// [SPECIES_POOCHYENA] = _("POOCHYENA"), -// [SPECIES_MIGHTYENA] = _("MIGHTYENA"), -// [SPECIES_ZIGZAGOON] = _("ZIGZAGOON"), -// [SPECIES_LINOONE] = _("LINOONE"), -// [SPECIES_WURMPLE] = _("WURMPLE"), -// [SPECIES_SILCOON] = _("SILCOON"), -// [SPECIES_BEAUTIFLY] = _("BEAUTIFLY"), -// [SPECIES_CASCOON] = _("CASCOON"), -// [SPECIES_DUSTOX] = _("DUSTOX"), -// [SPECIES_LOTAD] = _("LOTAD"), -// [SPECIES_LOMBRE] = _("LOMBRE"), -// [SPECIES_LUDICOLO] = _("LUDICOLO"), -// [SPECIES_SEEDOT] = _("SEEDOT"), -// [SPECIES_NUZLEAF] = _("NUZLEAF"), -// [SPECIES_SHIFTRY] = _("SHIFTRY"), -// [SPECIES_NINCADA] = _("NINCADA"), -// [SPECIES_NINJASK] = _("NINJASK"), -// [SPECIES_SHEDINJA] = _("SHEDINJA"), -// [SPECIES_TAILLOW] = _("TAILLOW"), -// [SPECIES_SWELLOW] = _("SWELLOW"), -// [SPECIES_SHROOMISH] = _("SHROOMISH"), -// [SPECIES_BRELOOM] = _("BRELOOM"), -// [SPECIES_SPINDA] = _("SPINDA"), -// [SPECIES_WINGULL] = _("WINGULL"), -// [SPECIES_PELIPPER] = _("PELIPPER"), -// [SPECIES_SURSKIT] = _("SURSKIT"), -// [SPECIES_MASQUERAIN] = _("MASQUERAIN"), -// [SPECIES_WAILMER] = _("WAILMER"), -// [SPECIES_WAILORD] = _("WAILORD"), -// [SPECIES_SKITTY] = _("SKITTY"), -// [SPECIES_DELCATTY] = _("DELCATTY"), -// [SPECIES_KECLEON] = _("KECLEON"), -// [SPECIES_BALTOY] = _("BALTOY"), -// [SPECIES_CLAYDOL] = _("CLAYDOL"), -// [SPECIES_NOSEPASS] = _("NOSEPASS"), -// [SPECIES_TORKOAL] = _("TORKOAL"), -// [SPECIES_SABLEYE] = _("SABLEYE"), -// [SPECIES_BARBOACH] = _("BARBOACH"), -// [SPECIES_WHISCASH] = _("WHISCASH"), -// [SPECIES_LUVDISC] = _("LUVDISC"), -// [SPECIES_CORPHISH] = _("CORPHISH"), -// [SPECIES_CRAWDAUNT] = _("CRAWDAUNT"), -// [SPECIES_FEEBAS] = _("FEEBAS"), -// [SPECIES_MILOTIC] = _("MILOTIC"), -// [SPECIES_CARVANHA] = _("CARVANHA"), -// [SPECIES_SHARPEDO] = _("SHARPEDO"), -// [SPECIES_TRAPINCH] = _("TRAPINCH"), -// [SPECIES_VIBRAVA] = _("VIBRAVA"), -// [SPECIES_FLYGON] = _("FLYGON"), -// [SPECIES_MAKUHITA] = _("MAKUHITA"), -// [SPECIES_HARIYAMA] = _("HARIYAMA"), -// [SPECIES_ELECTRIKE] = _("ELECTRIKE"), -// [SPECIES_MANECTRIC] = _("MANECTRIC"), -// [SPECIES_NUMEL] = _("NUMEL"), -// [SPECIES_CAMERUPT] = _("CAMERUPT"), -// [SPECIES_SPHEAL] = _("SPHEAL"), -// [SPECIES_SEALEO] = _("SEALEO"), -// [SPECIES_WALREIN] = _("WALREIN"), -// [SPECIES_CACNEA] = _("CACNEA"), -// [SPECIES_CACTURNE] = _("CACTURNE"), -// [SPECIES_SNORUNT] = _("SNORUNT"), -// [SPECIES_GLALIE] = _("GLALIE"), -// [SPECIES_LUNATONE] = _("LUNATONE"), -// [SPECIES_SOLROCK] = _("SOLROCK"), -// [SPECIES_AZURILL] = _("AZURILL"), -// [SPECIES_SPOINK] = _("SPOINK"), -// [SPECIES_GRUMPIG] = _("GRUMPIG"), -// [SPECIES_PLUSLE] = _("PLUSLE"), -// [SPECIES_MINUN] = _("MINUN"), -// [SPECIES_MAWILE] = _("MAWILE"), -// [SPECIES_MEDITITE] = _("MEDITITE"), -// [SPECIES_MEDICHAM] = _("MEDICHAM"), -// [SPECIES_SWABLU] = _("SWABLU"), -// [SPECIES_ALTARIA] = _("ALTARIA"), -// [SPECIES_WYNAUT] = _("WYNAUT"), -// [SPECIES_DUSKULL] = _("DUSKULL"), -// [SPECIES_DUSCLOPS] = _("DUSCLOPS"), -// [SPECIES_ROSELIA] = _("ROSELIA"), -// [SPECIES_SLAKOTH] = _("SLAKOTH"), -// [SPECIES_VIGOROTH] = _("VIGOROTH"), -// [SPECIES_SLAKING] = _("SLAKING"), -// [SPECIES_GULPIN] = _("GULPIN"), -// [SPECIES_SWALOT] = _("SWALOT"), -// [SPECIES_TROPIUS] = _("TROPIUS"), -// [SPECIES_WHISMUR] = _("WHISMUR"), -// [SPECIES_LOUDRED] = _("LOUDRED"), -// [SPECIES_EXPLOUD] = _("EXPLOUD"), -// [SPECIES_CLAMPERL] = _("CLAMPERL"), -// [SPECIES_HUNTAIL] = _("HUNTAIL"), -// [SPECIES_GOREBYSS] = _("GOREBYSS"), -// [SPECIES_ABSOL] = _("ABSOL"), -// [SPECIES_SHUPPET] = _("SHUPPET"), -// [SPECIES_BANETTE] = _("BANETTE"), -// [SPECIES_SEVIPER] = _("SEVIPER"), -// [SPECIES_ZANGOOSE] = _("ZANGOOSE"), -// [SPECIES_RELICANTH] = _("RELICANTH"), -// [SPECIES_ARON] = _("ARON"), -// [SPECIES_LAIRON] = _("LAIRON"), -// [SPECIES_AGGRON] = _("AGGRON"), -// [SPECIES_CASTFORM] = _("CASTFORM"), -// [SPECIES_VOLBEAT] = _("VOLBEAT"), -// [SPECIES_ILLUMISE] = _("ILLUMISE"), -// [SPECIES_LILEEP] = _("LILEEP"), -// [SPECIES_CRADILY] = _("CRADILY"), -// [SPECIES_ANORITH] = _("ANORITH"), -// [SPECIES_ARMALDO] = _("ARMALDO"), -// [SPECIES_RALTS] = _("RALTS"), -// [SPECIES_KIRLIA] = _("KIRLIA"), -// [SPECIES_GARDEVOIR] = _("GARDEVOIR"), -// [SPECIES_BAGON] = _("BAGON"), -// [SPECIES_SHELGON] = _("SHELGON"), -// [SPECIES_SALAMENCE] = _("SALAMENCE"), -// [SPECIES_BELDUM] = _("BELDUM"), -// [SPECIES_METANG] = _("METANG"), -// [SPECIES_METAGROSS] = _("METAGROSS"), -// [SPECIES_REGIROCK] = _("REGIROCK"), -// [SPECIES_REGICE] = _("REGICE"), -// [SPECIES_REGISTEEL] = _("REGISTEEL"), -// [SPECIES_KYOGRE] = _("KYOGRE"), -// [SPECIES_GROUDON] = _("GROUDON"), -// [SPECIES_RAYQUAZA] = _("RAYQUAZA"), -// [SPECIES_LATIAS] = _("LATIAS"), -// [SPECIES_LATIOS] = _("LATIOS"), -// [SPECIES_JIRACHI] = _("JIRACHI"), -// [SPECIES_DEOXYS] = _("DEOXYS"), -// [SPECIES_CHIMECHO] = _("CHIMECHO"), -// }; diff --git a/src/data/wild_encounters.json b/src/data/wild_encounters.json index f12663402..6d2eb0e7f 100644 --- a/src/data/wild_encounters.json +++ b/src/data/wild_encounters.json @@ -8263,62 +8263,62 @@ { "min_level": 3, "max_level": 3, - "species": "SPECIES_SQUIRTLE" + "species": "SPECIES_CLEFAIRY" }, { "min_level": 3, "max_level": 3, - "species": "SPECIES_SQUIRTLE" + "species": "SPECIES_CLEFAIRY" }, { "min_level": 3, "max_level": 3, - "species": "SPECIES_SQUIRTLE" + "species": "SPECIES_CLEFAIRY" }, { "min_level": 3, "max_level": 3, - "species": "SPECIES_SQUIRTLE" + "species": "SPECIES_CLEFAIRY" }, { "min_level": 2, "max_level": 2, - "species": "SPECIES_SQUIRTLE" + "species": "SPECIES_MIMIKYU" }, { "min_level": 2, "max_level": 2, - "species": "SPECIES_SQUIRTLE" + "species": "SPECIES_MIMIKYU" }, { "min_level": 3, "max_level": 3, - "species": "SPECIES_SCYTHER" + "species": "SPECIES_MIMIKYU" }, { "min_level": 3, "max_level": 3, - "species": "SPECIES_SCYTHER" + "species": "SPECIES_MIMIKYU" }, { "min_level": 4, "max_level": 4, - "species": "SPECIES_SCYTHER" + "species": "SPECIES_MIMIKYU" }, { "min_level": 4, "max_level": 4, - "species": "SPECIES_SCYTHER" + "species": "SPECIES_MIMIKYU" }, { "min_level": 5, "max_level": 5, - "species": "SPECIES_SCYTHER" + "species": "SPECIES_MIMIKYU" }, { "min_level": 4, "max_level": 4, - "species": "SPECIES_SCYTHER" + "species": "SPECIES_MIMIKYU" } ] } diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 93d4c8d0b..4ddb5b69f 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -987,7 +987,7 @@ static void Task_EvolutionScene(u8 taskId) { // Selected move to forget u16 move = GetMonData(mon, var + MON_DATA_MOVE1); - if (IsHMMove2(move)) + if (IsMoveHM(move)) { // Can't forget HMs BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_HMMOVESCANTBEFORGOTTEN - BATTLESTRINGS_TABLE_START]); @@ -1388,7 +1388,7 @@ static void Task_TradeEvolutionScene(u8 taskId) { // Selected move to forget u16 move = GetMonData(mon, var + MON_DATA_MOVE1); - if (IsHMMove2(move)) + if (IsMoveHM(move)) { // Can't forget HMs BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_HMMOVESCANTBEFORGOTTEN - BATTLESTRINGS_TABLE_START]); diff --git a/src/item.c b/src/item.c index 7c2caf69b..2f86d4a53 100644 --- a/src/item.c +++ b/src/item.c @@ -693,6 +693,11 @@ u8 ItemId_GetSecondaryId(u16 itemId) return gItems[SanitizeItemId(itemId)].secondaryId; } +u32 ItemId_GetFlingPower(u32 itemId) +{ + return gItems[SanitizeItemId(itemId)].flingPower; +} + const u8 *ItemId_GetEffect(u32 itemId) { if (itemId == ITEM_ENIGMA_BERRY) diff --git a/src/learn_move.c b/src/learn_move.c index 2f7f04b01..65d0b294d 100644 --- a/src/learn_move.c +++ b/src/learn_move.c @@ -816,30 +816,30 @@ static void MoveLearnerInitListMenu(void) static void PrintMoveInfo(u16 move) { u8 buffer[50]; - BlitMenuInfoIcon(2, gBattleMoves[move].type + 1, 1, 4); + BlitMenuInfoIcon(2, gMovesInfo[move].type + 1, 1, 4); - if (gBattleMoves[move].power < 2) + if (gMovesInfo[move].power < 2) { PrintTextOnWindow(3, gText_ThreeHyphens, 1, 4, 0, 0); } else { - ConvertIntToDecimalStringN(buffer, gBattleMoves[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(buffer, gMovesInfo[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3); PrintTextOnWindow(3, buffer, 1, 4, 0, 0); } - if (gBattleMoves[move].accuracy == 0) + if (gMovesInfo[move].accuracy == 0) { PrintTextOnWindow(3, gText_ThreeHyphens, 1, 18, 0, 1); } else { - ConvertIntToDecimalStringN(buffer, gBattleMoves[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(buffer, gMovesInfo[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); PrintTextOnWindow(3, buffer, 1, 18, 0, 1); } - ConvertIntToDecimalStringN(buffer, gBattleMoves[move].pp, STR_CONV_MODE_LEFT_ALIGN, 2); + ConvertIntToDecimalStringN(buffer, gMovesInfo[move].pp, STR_CONV_MODE_LEFT_ALIGN, 2); PrintTextOnWindow(4, buffer, 2, 2, 0, 0); - PrintTextOnWindow(5, gMoveDescriptionPointers[move - 1], 1, 0, 0, 0); + PrintTextOnWindow(5, gMovesInfo[move].description, 1, 0, 0, 0); } static void LoadMoveInfoUI(void) diff --git a/src/list_menu.c b/src/list_menu.c index e31b7c223..0628a2c14 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -733,7 +733,7 @@ void ListMenu_LoadMonIconPalette(u8 palOffset, u16 speciesId) void ListMenu_DrawMonIconGraphics(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y) { - BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality, 1), x, y, 32, 32); + BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality), x, y, 32, 32); } void ListMenuLoadStdPalAt(u8 palOffset, u8 palId) diff --git a/src/party_menu.c b/src/party_menu.c index 990148cde..5c76ab32d 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5111,26 +5111,14 @@ void ItemUseCB_PPUp(u8 taskId, TaskFunc func) u16 ItemIdToBattleMoveId(u16 item) { - u16 tmNumber = item - ITEM_TM01; - - return gTMHMMoves[tmNumber]; -} - -bool8 IsMoveHm(u16 move) -{ - u8 i; - - for (i = 0; i < NUM_HIDDEN_MACHINES - 1; ++i) // no dive - if (gTMHMMoves[i + NUM_TECHNICAL_MACHINES] == move) - return TRUE; - return FALSE; + return (ItemId_GetPocket(item) == POCKET_TM_CASE) ? gItems[item].secondaryId : MOVE_NONE; } bool8 MonKnowsMove(struct Pokemon *mon, u16 move) { u8 i; - for (i = 0; i < MAX_MON_MOVES; ++i) + for (i = 0; i < MAX_MON_MOVES; i++) { if (GetMonData(mon, MON_DATA_MOVE1 + i) == move) return TRUE; @@ -5138,6 +5126,18 @@ bool8 MonKnowsMove(struct Pokemon *mon, u16 move) return FALSE; } +bool8 BoxMonKnowsMove(struct BoxPokemon *boxMon, u16 move) +{ + u8 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (GetBoxMonData(boxMon, MON_DATA_MOVE1 + i) == move) + return TRUE; + } + return FALSE; +} + static void DisplayLearnMoveMessage(const u8 *str) { StringExpandPlaceholders(gStringVar4, str); diff --git a/src/pokedex_screen.c b/src/pokedex_screen.c index 7e40b3579..b3294407e 100644 --- a/src/pokedex_screen.c +++ b/src/pokedex_screen.c @@ -138,8 +138,6 @@ static void ItemPrintFunc_OrderedListMenu(u8 windowId, u32 itemId, u8 y); static void Task_DexScreen_RegisterNonKantoMonBeforeNationalDex(u8 taskId); static void Task_DexScreen_RegisterMonToPokedex(u8 taskId); -#include "data/pokemon_graphics/footprint_table.h" - const u32 sCategoryMonInfoBgTiles[] = INCBIN_U32("graphics/pokedex/mini_page.4bpp.lz"); const u32 sKantoDexTiles[] = INCBIN_U32("graphics/pokedex/kanto_dex_bgtiles.4bpp.lz"); const u32 sNatDexTiles[] = INCBIN_U32("graphics/pokedex/national_dex_bgtiles.4bpp.lz"); @@ -201,7 +199,6 @@ const u16 sBlitTiles_WideEllipse[] = INCBIN_U16("graphics/pokedex/blit_wide_elli static const u8 gExpandedPlaceholder_PokedexDescription[] = _(""); #include "data/pokemon/pokedex_text.h" -#include "data/pokemon/pokedex_entries.h" static const struct BgTemplate sBgTemplates[] = { { diff --git a/src/pokemon.c b/src/pokemon.c index 6709f2b8a..dca47934f 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -30,6 +30,7 @@ #include "constants/items.h" #include "constants/item_effects.h" #include "constants/cries.h" +#include "constants/form_change_types.h" #include "constants/pokemon.h" #include "constants/abilities.h" #include "constants/moves.h" @@ -72,7 +73,7 @@ static u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex); static u8 GetNatureFromPersonality(u32 personality); static bool8 PartyMonHasStatus(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId); static bool8 IsPokemonStorageFull(void); -static u8 SendMonToPC(struct Pokemon* mon); +static u8 CopyMonToPC(struct Pokemon *mon); static void EncryptBoxMon(struct BoxPokemon *boxMon); static void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); static void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon); @@ -83,7 +84,7 @@ static u16 SpeciesToHoennPokedexNum(u16 species); static bool8 ShouldSkipFriendshipChange(void); static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv); -#include "data/battle_moves.h" +#include "data/moves_info.h" #include "data/abilities.h" // Used in an unreferenced function in RS. @@ -667,7 +668,6 @@ static const s8 sNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] = #include "data/pokemon/experience_tables.h" #include "data/pokemon/teachable_learnsets.h" #include "data/pokemon/level_up_learnsets.h" -#include "data/pokemon/level_up_learnset_pointers.h" #include "data/pokemon/form_species_tables.h" #include "data/pokemon/form_change_tables.h" #include "data/pokemon/species_info.h" @@ -1520,22 +1520,25 @@ void CalculateMonStats(struct Pokemon *mon) { s32 oldMaxHP = GetMonData(mon, MON_DATA_MAX_HP, NULL); s32 currentHP = GetMonData(mon, MON_DATA_HP, NULL); - s32 hpIV = GetMonData(mon, MON_DATA_HP_IV, NULL); + s32 hpIV = GetMonData(mon, MON_DATA_HYPER_TRAINED_HP) ? MAX_PER_STAT_IVS : GetMonData(mon, MON_DATA_HP_IV, NULL); s32 hpEV = GetMonData(mon, MON_DATA_HP_EV, NULL); - s32 attackIV = GetMonData(mon, MON_DATA_ATK_IV, NULL); + s32 attackIV = GetMonData(mon, MON_DATA_HYPER_TRAINED_ATK) ? MAX_PER_STAT_IVS : GetMonData(mon, MON_DATA_ATK_IV, NULL); s32 attackEV = GetMonData(mon, MON_DATA_ATK_EV, NULL); - s32 defenseIV = GetMonData(mon, MON_DATA_DEF_IV, NULL); + s32 defenseIV = GetMonData(mon, MON_DATA_HYPER_TRAINED_DEF) ? MAX_PER_STAT_IVS : GetMonData(mon, MON_DATA_DEF_IV, NULL); s32 defenseEV = GetMonData(mon, MON_DATA_DEF_EV, NULL); - s32 speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL); + s32 speedIV = GetMonData(mon, MON_DATA_HYPER_TRAINED_SPEED) ? MAX_PER_STAT_IVS : GetMonData(mon, MON_DATA_SPEED_IV, NULL); s32 speedEV = GetMonData(mon, MON_DATA_SPEED_EV, NULL); - s32 spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL); + s32 spAttackIV = GetMonData(mon, MON_DATA_HYPER_TRAINED_SPATK) ? MAX_PER_STAT_IVS : GetMonData(mon, MON_DATA_SPATK_IV, NULL); s32 spAttackEV = GetMonData(mon, MON_DATA_SPATK_EV, NULL); - s32 spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL); + s32 spDefenseIV = GetMonData(mon, MON_DATA_HYPER_TRAINED_SPDEF) ? MAX_PER_STAT_IVS : GetMonData(mon, MON_DATA_SPDEF_IV, NULL); s32 spDefenseEV = GetMonData(mon, MON_DATA_SPDEF_EV, NULL); u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + u8 friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, NULL); s32 level = GetLevelFromMonExp(mon); s32 newMaxHP; + u8 nature = GetMonData(mon, MON_DATA_HIDDEN_NATURE, NULL); + SetMonData(mon, MON_DATA_LEVEL, &level); if (species == SPECIES_SHEDINJA) @@ -1571,13 +1574,14 @@ void CalculateMonStats(struct Pokemon *mon) { if (currentHP == 0 && oldMaxHP == 0) currentHP = newMaxHP; - else if (currentHP != 0) { - // BUG: currentHP is unintentionally able to become <= 0 after the instruction below. - currentHP += newMaxHP - oldMaxHP; - #ifdef BUGFIX + else if (currentHP != 0) + { + if (newMaxHP > oldMaxHP) + currentHP += newMaxHP - oldMaxHP; if (currentHP <= 0) currentHP = 1; - #endif + if (currentHP > newMaxHP) + currentHP = newMaxHP; } else return; @@ -1636,7 +1640,7 @@ static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move) if (!existingMove) { SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &move); - SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gBattleMoves[move].pp); + SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gMovesInfo[move].pp); return move; } if (existingMove == move) @@ -1654,7 +1658,7 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move) if (!mon->moves[i]) { mon->moves[i] = move; - mon->pp[i] = gBattleMoves[move].pp; + mon->pp[i] = gMovesInfo[move].pp; return move; } } @@ -1665,13 +1669,24 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move) void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot) { SetMonData(mon, MON_DATA_MOVE1 + slot, &move); - SetMonData(mon, MON_DATA_PP1 + slot, &gBattleMoves[move].pp); + SetMonData(mon, MON_DATA_PP1 + slot, &gMovesInfo[move].pp); +} + +static void SetMonMoveSlot_KeepPP(struct Pokemon *mon, u16 move, u8 slot) +{ + u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL); + u8 currPP = GetMonData(mon, MON_DATA_PP1 + slot, NULL); + u8 newPP = CalculatePPWithBonus(move, ppBonuses, slot); + u16 finalPP = min(currPP, newPP); + + SetMonData(mon, MON_DATA_MOVE1 + slot, &move); + SetMonData(mon, MON_DATA_PP1 + slot, &finalPP); } void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot) { mon->moves[slot] = move; - mon->pp[slot] = gBattleMoves[move].pp; + mon->pp[slot] = gMovesInfo[move].pp; } static void GiveMonInitialMoveset(struct Pokemon *mon) @@ -1750,7 +1765,7 @@ void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move) ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL); ppBonuses >>= 2; moves[MAX_MON_MOVES - 1] = move; - pp[MAX_MON_MOVES - 1] = gBattleMoves[move].pp; + pp[MAX_MON_MOVES - 1] = gMovesInfo[move].pp; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -1777,7 +1792,7 @@ static void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 mo ppBonuses = GetBoxMonData(boxMon, MON_DATA_PP_BONUSES, NULL); ppBonuses >>= 2; moves[MAX_MON_MOVES - 1] = move; - pp[MAX_MON_MOVES - 1] = gBattleMoves[move].pp; + pp[MAX_MON_MOVES - 1] = gMovesInfo[move].pp; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -1799,7 +1814,7 @@ static void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 mo (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER)) && FlagGet(flag) && GetBattlerSide(battler) == B_SIDE_PLAYER) -s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef) +s32 CalculateBaseDamageOld(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u32 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef) { u32 i; s32 damage = 0; @@ -1813,12 +1828,12 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de u8 attackerHoldEffectParam; if (!powerOverride) - gBattleMovePower = gBattleMoves[move].power; + gBattleMovePower = gMovesInfo[move].power; else gBattleMovePower = powerOverride; if (!typeOverride) - type = gBattleMoves[move].type; + type = gMovesInfo[move].type; else type = typeOverride & DYNAMIC_TYPE_MASK; @@ -1920,7 +1935,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de gBattleMovePower = (150 * gBattleMovePower) / 100; // Self-destruct / Explosion cut defense in half - if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION) + if (gMovesInfo[gCurrentMove].effect == EFFECT_EXPLOSION) defense /= 2; if (IS_TYPE_PHYSICAL(type)) @@ -1960,14 +1975,14 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de // Apply Reflect if ((sideStatus & SIDE_STATUS_REFLECT) && gCritMultiplier == 1) { - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerTarget) == 2) damage = 2 * (damage / 3); else damage /= 2; } // Moves hitting both targets do half damage in double battles - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == MOVE_TARGET_BOTH && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gMovesInfo[move].target == MOVE_TARGET_BOTH && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerTarget) == 2) damage /= 2; // Moves always do at least 1 damage. @@ -2011,14 +2026,14 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de // Apply Lightscreen if ((sideStatus & SIDE_STATUS_LIGHTSCREEN) && gCritMultiplier == 1) { - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerTarget) == 2) damage = 2 * (damage / 3); else damage /= 2; } // Moves hitting both targets do half damage in double battles - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == MOVE_TARGET_BOTH && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gMovesInfo[move].target == MOVE_TARGET_BOTH && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerTarget) == 2) damage /= 2; // Are effects of weather negated with cloud nine or air lock @@ -2065,36 +2080,28 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de return damage + 2; } -u8 CountAliveMonsInBattle(u8 caseId) +u8 CountAliveMonsInBattle(u8 caseId, u32 battler) { s32 i; u8 retVal = 0; switch (caseId) { - case BATTLE_ALIVE_EXCEPT_ACTIVE: + case BATTLE_ALIVE_EXCEPT_BATTLER: for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - if (i != gActiveBattler && !(gAbsentBattlerFlags & gBitTable[i])) + if (i != battler && !(gAbsentBattlerFlags & gBitTable[i])) retVal++; } break; - case BATTLE_ALIVE_ATK_SIDE: + case BATTLE_ALIVE_SIDE: for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - if (GetBattlerSide(i) == GetBattlerSide(gBattlerAttacker) && !(gAbsentBattlerFlags & gBitTable[i])) - retVal++; - } - break; - case BATTLE_ALIVE_DEF_SIDE: - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - { - if (GetBattlerSide(i) == GetBattlerSide(gBattlerTarget) && !(gAbsentBattlerFlags & gBitTable[i])) + if (GetBattlerSide(i) == GetBattlerSide(battler) && !(gAbsentBattlerFlags & gBitTable[i])) retVal++; } break; } - return retVal; } @@ -2104,7 +2111,7 @@ u8 GetDefaultMoveTarget(u8 battlerId) if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) return GetBattlerAtPosition(opposing); - if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) > 1) + if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_BATTLER, gActiveBattler) > 1) { u8 position; @@ -3312,14 +3319,14 @@ u8 GiveMonToPlayer(struct Pokemon *mon) } if (i >= PARTY_SIZE) - return SendMonToPC(mon); + return CopyMonToPC(mon); CopyMon(&gPlayerParty[i], mon, sizeof(*mon)); gPlayerPartyCount = i + 1; return MON_GIVEN_TO_PARTY; } -static u8 SendMonToPC(struct Pokemon* mon) +static u8 CopyMonToPC(struct Pokemon *mon) { s32 boxNo, boxPos; @@ -3402,7 +3409,7 @@ u8 GetMonsStateToDoubles(void) return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON; } -u16 GetAbilityBySpecies(u16 species, bool8 abilityNum) +u16 GetAbilityBySpecies(u16 species, u8 abilityNum) { int i; @@ -3462,7 +3469,7 @@ static void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord for (j = 0; j < MAX_MON_MOVES; j++) { SetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j, &gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]); - SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &gBattleMoves[gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]].pp); + SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &gMovesInfo[gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]].pp); } } } @@ -3581,7 +3588,7 @@ const struct FormChange *GetSpeciesFormChanges(u16 species) u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex) { - u8 basePP = gBattleMoves[move].pp; + u8 basePP = gMovesInfo[move].pp; return basePP + ((basePP * 20 * ((gPPUpGetMask[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100); } @@ -3631,7 +3638,7 @@ static void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex) gBattleMons[battlerId].speed = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED, NULL); gBattleMons[battlerId].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL); gBattleMons[battlerId].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, NULL); - gBattleMons[battlerId].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL); + // gBattleMons[battlerId].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL); gBattleMons[battlerId].abilityNum = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ABILITY_NUM, NULL); gBattleMons[battlerId].otId = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_ID, NULL); gBattleMons[battlerId].type1 = gSpeciesInfo[gBattleMons[battlerId].species].types[0]; @@ -4491,7 +4498,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s { for (j = 0; j < MAX_MON_MOVES; j++) { - if (gBattleMoves[GetMonData(mon, MON_DATA_MOVE1 + j, NULL)].type == evolutions[i].param) + if (gMovesInfo[GetMonData(mon, MON_DATA_MOVE1 + j, NULL)].type == evolutions[i].param) { targetSpecies = evolutions[i].targetSpecies; break; @@ -5598,7 +5605,7 @@ const u32 *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 } } -bool32 IsHMMove2(u16 move) +bool32 IsMoveHM(u16 move) { int i = 0; while (sHMMoves[i] != HM_MOVES_END) @@ -5607,6 +5614,12 @@ bool32 IsHMMove2(u16 move) return TRUE; } return FALSE; + // u8 i; + + // for (i = 0; i < NUM_HIDDEN_MACHINES - 1; ++i) // no dive + // if (gTMHMMoves[i + NUM_TECHNICAL_MACHINES] == move) + // return TRUE; + // return FALSE; } bool8 IsMonSpriteNotFlipped(u16 species) @@ -6165,3 +6178,226 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) ivs[j++] = temp[i]; } } + +u16 GetFormSpeciesId(u16 speciesId, u8 formId) +{ + if (GetSpeciesFormTable(speciesId) != NULL) + return GetSpeciesFormTable(speciesId)[formId]; + else + return speciesId; +} + +u8 GetFormIdFromFormSpeciesId(u16 formSpeciesId) +{ + u8 targetFormId = 0; + + if (GetSpeciesFormTable(formSpeciesId) != NULL) + { + for (targetFormId = 0; GetSpeciesFormTable(formSpeciesId)[targetFormId] != FORM_SPECIES_END; targetFormId++) + { + if (formSpeciesId == GetSpeciesFormTable(formSpeciesId)[targetFormId]) + break; + } + } + return targetFormId; +} + +u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg) +{ + return GetFormChangeTargetSpeciesBoxMon(&mon->box, method, arg); +} + +// Returns SPECIES_NONE if no form change is possible +u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg) +{ + u32 i; + u16 targetSpecies = SPECIES_NONE; + u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL); + const struct FormChange *formChanges = GetSpeciesFormChanges(species); + u16 heldItem; + u32 ability; + + if (formChanges != NULL) + { + heldItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM, NULL); + ability = GetAbilityBySpecies(species, GetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, NULL)); + + for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++) + { + if (method == formChanges[i].method && species != formChanges[i].targetSpecies) + { + switch (method) + { + case FORM_CHANGE_ITEM_HOLD: + if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) + && (ability == formChanges[i].param2 || formChanges[i].param2 == ABILITY_NONE)) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_ITEM_USE: + if (arg == formChanges[i].param1) + { + // TODO: time + switch (formChanges[i].param2) + { + case DAY: + // if (GetTimeOfDay() != TIME_NIGHT) + // targetSpecies = formChanges[i].targetSpecies; + targetSpecies = SPECIES_NONE; + break; + case NIGHT: + // if (GetTimeOfDay() == TIME_NIGHT) + // targetSpecies = formChanges[i].targetSpecies; + targetSpecies = SPECIES_NONE; + break; + default: + targetSpecies = formChanges[i].targetSpecies; + break; + } + } + break; + case FORM_CHANGE_ITEM_USE_MULTICHOICE: + if (arg == formChanges[i].param1) + { + if (formChanges[i].param2 == gSpecialVar_Result) + targetSpecies = formChanges[i].targetSpecies; + } + break; + case FORM_CHANGE_MOVE: + if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_BEGIN_BATTLE: + case FORM_CHANGE_END_BATTLE: + if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_END_BATTLE_TERRAIN: + if (gBattleTerrain == formChanges[i].param1) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_WITHDRAW: + case FORM_CHANGE_FAINT: + case FORM_CHANGE_STATUS: + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_TIME_OF_DAY: + // TODO: time + // switch (formChanges[i].param1) + // { + // case DAY: + // if (GetTimeOfDay() != TIME_NIGHT) + // targetSpecies = formChanges[i].targetSpecies; + // break; + // case NIGHT: + // if (GetTimeOfDay() == TIME_NIGHT) + // targetSpecies = formChanges[i].targetSpecies; + // break; + // } + // break; + targetSpecies = SPECIES_NONE; + break; + } + } + } + } + + return targetSpecies; +} + +bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method) +{ + u32 i; + const struct FormChange *formChanges = GetSpeciesFormChanges(species); + + if (formChanges != NULL) + { + for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++) + { + if (method == formChanges[i].method && species != formChanges[i].targetSpecies) + return TRUE; + } + } + + return FALSE; +} + +u32 GetMonAffectionHearts(struct Pokemon *pokemon) +{ + u32 friendship = GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL); + + if (friendship == MAX_FRIENDSHIP) + return AFFECTION_FIVE_HEARTS; + if (friendship >= 220) + return AFFECTION_FOUR_HEARTS; + if (friendship >= 180) + return AFFECTION_THREE_HEARTS; + if (friendship >= 130) + return AFFECTION_TWO_HEARTS; + if (friendship >= 80) + return AFFECTION_ONE_HEART; + + return AFFECTION_NO_HEARTS; +} + +void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method) +{ + int i, j; + u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + const struct FormChange *formChanges = GetSpeciesFormChanges(species); + + if (formChanges == NULL + || (method != FORM_CHANGE_BEGIN_BATTLE && method != FORM_CHANGE_END_BATTLE)) + return; + + for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++) + { + if (formChanges[i].method == method + && formChanges[i].param2 + && formChanges[i].param3 + && formChanges[i].targetSpecies != species) + { + u16 originalMove = formChanges[i].param2; + u16 newMove = formChanges[i].param3; + + for (j = 0; j < MAX_MON_MOVES; j++) + { + u16 currMove = GetMonData(mon, MON_DATA_MOVE1 + j, NULL); + if (currMove == originalMove) + SetMonMoveSlot_KeepPP(mon, newMove, j); + } + break; + } + } +} + +bool8 IsMonPastEvolutionLevel(struct Pokemon *mon) +{ + int i; + u16 species = GetMonData(mon, MON_DATA_SPECIES, 0); + u8 level = GetMonData(mon, MON_DATA_LEVEL, 0); + const struct Evolution *evolutions = GetSpeciesEvolutions(species); + + if (evolutions == NULL) + return FALSE; + + for (i = 0; evolutions[i].method != EVOLUTIONS_END; i++) + { + if (SanitizeSpeciesId(evolutions[i].targetSpecies) == SPECIES_NONE) + continue; + + switch (evolutions[i].method) + { + case EVO_LEVEL: + if (evolutions[i].param <= level) + return TRUE; + break; + } + } + + return FALSE; +} + +bool32 IsPersonalityFemale(u16 species, u32 personality) +{ + return GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; +} diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index 1b3ec58d2..07796a6ab 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -28,892 +28,6 @@ const u16 gMonIconPalettes[][16] = { INCBIN_U16("graphics/pokemon/icon_palettes/pal5.gbapal") }; -// const u8 *const gMonIconTable[] = { -// [SPECIES_NONE] = gMonIcon_QuestionMark, -// [SPECIES_BULBASAUR] = gMonIcon_Bulbasaur, -// [SPECIES_IVYSAUR] = gMonIcon_Ivysaur, -// [SPECIES_VENUSAUR] = gMonIcon_Venusaur, -// [SPECIES_CHARMANDER] = gMonIcon_Charmander, -// [SPECIES_CHARMELEON] = gMonIcon_Charmeleon, -// [SPECIES_CHARIZARD] = gMonIcon_Charizard, -// [SPECIES_SQUIRTLE] = gMonIcon_Squirtle, -// [SPECIES_WARTORTLE] = gMonIcon_Wartortle, -// [SPECIES_BLASTOISE] = gMonIcon_Blastoise, -// [SPECIES_CATERPIE] = gMonIcon_Caterpie, -// [SPECIES_METAPOD] = gMonIcon_Metapod, -// [SPECIES_BUTTERFREE] = gMonIcon_Butterfree, -// [SPECIES_WEEDLE] = gMonIcon_Weedle, -// [SPECIES_KAKUNA] = gMonIcon_Kakuna, -// [SPECIES_BEEDRILL] = gMonIcon_Beedrill, -// [SPECIES_PIDGEY] = gMonIcon_Pidgey, -// [SPECIES_PIDGEOTTO] = gMonIcon_Pidgeotto, -// [SPECIES_PIDGEOT] = gMonIcon_Pidgeot, -// [SPECIES_RATTATA] = gMonIcon_Rattata, -// [SPECIES_RATICATE] = gMonIcon_Raticate, -// [SPECIES_SPEAROW] = gMonIcon_Spearow, -// [SPECIES_FEAROW] = gMonIcon_Fearow, -// [SPECIES_EKANS] = gMonIcon_Ekans, -// [SPECIES_ARBOK] = gMonIcon_Arbok, -// [SPECIES_PIKACHU] = gMonIcon_Pikachu, -// [SPECIES_RAICHU] = gMonIcon_Raichu, -// [SPECIES_SANDSHREW] = gMonIcon_Sandshrew, -// [SPECIES_SANDSLASH] = gMonIcon_Sandslash, -// [SPECIES_NIDORAN_F] = gMonIcon_NidoranF, -// [SPECIES_NIDORINA] = gMonIcon_Nidorina, -// [SPECIES_NIDOQUEEN] = gMonIcon_Nidoqueen, -// [SPECIES_NIDORAN_M] = gMonIcon_NidoranM, -// [SPECIES_NIDORINO] = gMonIcon_Nidorino, -// [SPECIES_NIDOKING] = gMonIcon_Nidoking, -// [SPECIES_CLEFAIRY] = gMonIcon_Clefairy, -// [SPECIES_CLEFABLE] = gMonIcon_Clefable, -// [SPECIES_VULPIX] = gMonIcon_Vulpix, -// [SPECIES_NINETALES] = gMonIcon_Ninetales, -// [SPECIES_JIGGLYPUFF] = gMonIcon_Jigglypuff, -// [SPECIES_WIGGLYTUFF] = gMonIcon_Wigglytuff, -// [SPECIES_ZUBAT] = gMonIcon_Zubat, -// [SPECIES_GOLBAT] = gMonIcon_Golbat, -// [SPECIES_ODDISH] = gMonIcon_Oddish, -// [SPECIES_GLOOM] = gMonIcon_Gloom, -// [SPECIES_VILEPLUME] = gMonIcon_Vileplume, -// [SPECIES_PARAS] = gMonIcon_Paras, -// [SPECIES_PARASECT] = gMonIcon_Parasect, -// [SPECIES_VENONAT] = gMonIcon_Venonat, -// [SPECIES_VENOMOTH] = gMonIcon_Venomoth, -// [SPECIES_DIGLETT] = gMonIcon_Diglett, -// [SPECIES_DUGTRIO] = gMonIcon_Dugtrio, -// [SPECIES_MEOWTH] = gMonIcon_Meowth, -// [SPECIES_PERSIAN] = gMonIcon_Persian, -// [SPECIES_PSYDUCK] = gMonIcon_Psyduck, -// [SPECIES_GOLDUCK] = gMonIcon_Golduck, -// [SPECIES_MANKEY] = gMonIcon_Mankey, -// [SPECIES_PRIMEAPE] = gMonIcon_Primeape, -// [SPECIES_GROWLITHE] = gMonIcon_Growlithe, -// [SPECIES_ARCANINE] = gMonIcon_Arcanine, -// [SPECIES_POLIWAG] = gMonIcon_Poliwag, -// [SPECIES_POLIWHIRL] = gMonIcon_Poliwhirl, -// [SPECIES_POLIWRATH] = gMonIcon_Poliwrath, -// [SPECIES_ABRA] = gMonIcon_Abra, -// [SPECIES_KADABRA] = gMonIcon_Kadabra, -// [SPECIES_ALAKAZAM] = gMonIcon_Alakazam, -// [SPECIES_MACHOP] = gMonIcon_Machop, -// [SPECIES_MACHOKE] = gMonIcon_Machoke, -// [SPECIES_MACHAMP] = gMonIcon_Machamp, -// [SPECIES_BELLSPROUT] = gMonIcon_Bellsprout, -// [SPECIES_WEEPINBELL] = gMonIcon_Weepinbell, -// [SPECIES_VICTREEBEL] = gMonIcon_Victreebel, -// [SPECIES_TENTACOOL] = gMonIcon_Tentacool, -// [SPECIES_TENTACRUEL] = gMonIcon_Tentacruel, -// [SPECIES_GEODUDE] = gMonIcon_Geodude, -// [SPECIES_GRAVELER] = gMonIcon_Graveler, -// [SPECIES_GOLEM] = gMonIcon_Golem, -// [SPECIES_PONYTA] = gMonIcon_Ponyta, -// [SPECIES_RAPIDASH] = gMonIcon_Rapidash, -// [SPECIES_SLOWPOKE] = gMonIcon_Slowpoke, -// [SPECIES_SLOWBRO] = gMonIcon_Slowbro, -// [SPECIES_MAGNEMITE] = gMonIcon_Magnemite, -// [SPECIES_MAGNETON] = gMonIcon_Magneton, -// [SPECIES_FARFETCHD] = gMonIcon_Farfetchd, -// [SPECIES_DODUO] = gMonIcon_Doduo, -// [SPECIES_DODRIO] = gMonIcon_Dodrio, -// [SPECIES_SEEL] = gMonIcon_Seel, -// [SPECIES_DEWGONG] = gMonIcon_Dewgong, -// [SPECIES_GRIMER] = gMonIcon_Grimer, -// [SPECIES_MUK] = gMonIcon_Muk, -// [SPECIES_SHELLDER] = gMonIcon_Shellder, -// [SPECIES_CLOYSTER] = gMonIcon_Cloyster, -// [SPECIES_GASTLY] = gMonIcon_Gastly, -// [SPECIES_HAUNTER] = gMonIcon_Haunter, -// [SPECIES_GENGAR] = gMonIcon_Gengar, -// [SPECIES_ONIX] = gMonIcon_Onix, -// [SPECIES_DROWZEE] = gMonIcon_Drowzee, -// [SPECIES_HYPNO] = gMonIcon_Hypno, -// [SPECIES_KRABBY] = gMonIcon_Krabby, -// [SPECIES_KINGLER] = gMonIcon_Kingler, -// [SPECIES_VOLTORB] = gMonIcon_Voltorb, -// [SPECIES_ELECTRODE] = gMonIcon_Electrode, -// [SPECIES_EXEGGCUTE] = gMonIcon_Exeggcute, -// [SPECIES_EXEGGUTOR] = gMonIcon_Exeggutor, -// [SPECIES_CUBONE] = gMonIcon_Cubone, -// [SPECIES_MAROWAK] = gMonIcon_Marowak, -// [SPECIES_HITMONLEE] = gMonIcon_Hitmonlee, -// [SPECIES_HITMONCHAN] = gMonIcon_Hitmonchan, -// [SPECIES_LICKITUNG] = gMonIcon_Lickitung, -// [SPECIES_KOFFING] = gMonIcon_Koffing, -// [SPECIES_WEEZING] = gMonIcon_Weezing, -// [SPECIES_RHYHORN] = gMonIcon_Rhyhorn, -// [SPECIES_RHYDON] = gMonIcon_Rhydon, -// [SPECIES_CHANSEY] = gMonIcon_Chansey, -// [SPECIES_TANGELA] = gMonIcon_Tangela, -// [SPECIES_KANGASKHAN] = gMonIcon_Kangaskhan, -// [SPECIES_HORSEA] = gMonIcon_Horsea, -// [SPECIES_SEADRA] = gMonIcon_Seadra, -// [SPECIES_GOLDEEN] = gMonIcon_Goldeen, -// [SPECIES_SEAKING] = gMonIcon_Seaking, -// [SPECIES_STARYU] = gMonIcon_Staryu, -// [SPECIES_STARMIE] = gMonIcon_Starmie, -// [SPECIES_MR_MIME] = gMonIcon_Mrmime, -// [SPECIES_SCYTHER] = gMonIcon_Scyther, -// [SPECIES_JYNX] = gMonIcon_Jynx, -// [SPECIES_ELECTABUZZ] = gMonIcon_Electabuzz, -// [SPECIES_MAGMAR] = gMonIcon_Magmar, -// [SPECIES_PINSIR] = gMonIcon_Pinsir, -// [SPECIES_TAUROS] = gMonIcon_Tauros, -// [SPECIES_MAGIKARP] = gMonIcon_Magikarp, -// [SPECIES_GYARADOS] = gMonIcon_Gyarados, -// [SPECIES_LAPRAS] = gMonIcon_Lapras, -// [SPECIES_DITTO] = gMonIcon_Ditto, -// [SPECIES_EEVEE] = gMonIcon_Eevee, -// [SPECIES_VAPOREON] = gMonIcon_Vaporeon, -// [SPECIES_JOLTEON] = gMonIcon_Jolteon, -// [SPECIES_FLAREON] = gMonIcon_Flareon, -// [SPECIES_PORYGON] = gMonIcon_Porygon, -// [SPECIES_OMANYTE] = gMonIcon_Omanyte, -// [SPECIES_OMASTAR] = gMonIcon_Omastar, -// [SPECIES_KABUTO] = gMonIcon_Kabuto, -// [SPECIES_KABUTOPS] = gMonIcon_Kabutops, -// [SPECIES_AERODACTYL] = gMonIcon_Aerodactyl, -// [SPECIES_SNORLAX] = gMonIcon_Snorlax, -// [SPECIES_ARTICUNO] = gMonIcon_Articuno, -// [SPECIES_ZAPDOS] = gMonIcon_Zapdos, -// [SPECIES_MOLTRES] = gMonIcon_Moltres, -// [SPECIES_DRATINI] = gMonIcon_Dratini, -// [SPECIES_DRAGONAIR] = gMonIcon_Dragonair, -// [SPECIES_DRAGONITE] = gMonIcon_Dragonite, -// [SPECIES_MEWTWO] = gMonIcon_Mewtwo, -// [SPECIES_MEW] = gMonIcon_Mew, -// [SPECIES_CHIKORITA] = gMonIcon_Chikorita, -// [SPECIES_BAYLEEF] = gMonIcon_Bayleef, -// [SPECIES_MEGANIUM] = gMonIcon_Meganium, -// [SPECIES_CYNDAQUIL] = gMonIcon_Cyndaquil, -// [SPECIES_QUILAVA] = gMonIcon_Quilava, -// [SPECIES_TYPHLOSION] = gMonIcon_Typhlosion, -// [SPECIES_TOTODILE] = gMonIcon_Totodile, -// [SPECIES_CROCONAW] = gMonIcon_Croconaw, -// [SPECIES_FERALIGATR] = gMonIcon_Feraligatr, -// [SPECIES_SENTRET] = gMonIcon_Sentret, -// [SPECIES_FURRET] = gMonIcon_Furret, -// [SPECIES_HOOTHOOT] = gMonIcon_Hoothoot, -// [SPECIES_NOCTOWL] = gMonIcon_Noctowl, -// [SPECIES_LEDYBA] = gMonIcon_Ledyba, -// [SPECIES_LEDIAN] = gMonIcon_Ledian, -// [SPECIES_SPINARAK] = gMonIcon_Spinarak, -// [SPECIES_ARIADOS] = gMonIcon_Ariados, -// [SPECIES_CROBAT] = gMonIcon_Crobat, -// [SPECIES_CHINCHOU] = gMonIcon_Chinchou, -// [SPECIES_LANTURN] = gMonIcon_Lanturn, -// [SPECIES_PICHU] = gMonIcon_Pichu, -// [SPECIES_CLEFFA] = gMonIcon_Cleffa, -// [SPECIES_IGGLYBUFF] = gMonIcon_Igglybuff, -// [SPECIES_TOGEPI] = gMonIcon_Togepi, -// [SPECIES_TOGETIC] = gMonIcon_Togetic, -// [SPECIES_NATU] = gMonIcon_Natu, -// [SPECIES_XATU] = gMonIcon_Xatu, -// [SPECIES_MAREEP] = gMonIcon_Mareep, -// [SPECIES_FLAAFFY] = gMonIcon_Flaaffy, -// [SPECIES_AMPHAROS] = gMonIcon_Ampharos, -// [SPECIES_BELLOSSOM] = gMonIcon_Bellossom, -// [SPECIES_MARILL] = gMonIcon_Marill, -// [SPECIES_AZUMARILL] = gMonIcon_Azumarill, -// [SPECIES_SUDOWOODO] = gMonIcon_Sudowoodo, -// [SPECIES_POLITOED] = gMonIcon_Politoed, -// [SPECIES_HOPPIP] = gMonIcon_Hoppip, -// [SPECIES_SKIPLOOM] = gMonIcon_Skiploom, -// [SPECIES_JUMPLUFF] = gMonIcon_Jumpluff, -// [SPECIES_AIPOM] = gMonIcon_Aipom, -// [SPECIES_SUNKERN] = gMonIcon_Sunkern, -// [SPECIES_SUNFLORA] = gMonIcon_Sunflora, -// [SPECIES_YANMA] = gMonIcon_Yanma, -// [SPECIES_WOOPER] = gMonIcon_Wooper, -// [SPECIES_QUAGSIRE] = gMonIcon_Quagsire, -// [SPECIES_ESPEON] = gMonIcon_Espeon, -// [SPECIES_UMBREON] = gMonIcon_Umbreon, -// [SPECIES_MURKROW] = gMonIcon_Murkrow, -// [SPECIES_SLOWKING] = gMonIcon_Slowking, -// [SPECIES_MISDREAVUS] = gMonIcon_Misdreavus, -// [SPECIES_UNOWN] = gMonIcon_UnownA, -// [SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet, -// [SPECIES_GIRAFARIG] = gMonIcon_Girafarig, -// [SPECIES_PINECO] = gMonIcon_Pineco, -// [SPECIES_FORRETRESS] = gMonIcon_Forretress, -// [SPECIES_DUNSPARCE] = gMonIcon_Dunsparce, -// [SPECIES_GLIGAR] = gMonIcon_Gligar, -// [SPECIES_STEELIX] = gMonIcon_Steelix, -// [SPECIES_SNUBBULL] = gMonIcon_Snubbull, -// [SPECIES_GRANBULL] = gMonIcon_Granbull, -// [SPECIES_QWILFISH] = gMonIcon_Qwilfish, -// [SPECIES_SCIZOR] = gMonIcon_Scizor, -// [SPECIES_SHUCKLE] = gMonIcon_Shuckle, -// [SPECIES_HERACROSS] = gMonIcon_Heracross, -// [SPECIES_SNEASEL] = gMonIcon_Sneasel, -// [SPECIES_TEDDIURSA] = gMonIcon_Teddiursa, -// [SPECIES_URSARING] = gMonIcon_Ursaring, -// [SPECIES_SLUGMA] = gMonIcon_Slugma, -// [SPECIES_MAGCARGO] = gMonIcon_Magcargo, -// [SPECIES_SWINUB] = gMonIcon_Swinub, -// [SPECIES_PILOSWINE] = gMonIcon_Piloswine, -// [SPECIES_CORSOLA] = gMonIcon_Corsola, -// [SPECIES_REMORAID] = gMonIcon_Remoraid, -// [SPECIES_OCTILLERY] = gMonIcon_Octillery, -// [SPECIES_DELIBIRD] = gMonIcon_Delibird, -// [SPECIES_MANTINE] = gMonIcon_Mantine, -// [SPECIES_SKARMORY] = gMonIcon_Skarmory, -// [SPECIES_HOUNDOUR] = gMonIcon_Houndour, -// [SPECIES_HOUNDOOM] = gMonIcon_Houndoom, -// [SPECIES_KINGDRA] = gMonIcon_Kingdra, -// [SPECIES_PHANPY] = gMonIcon_Phanpy, -// [SPECIES_DONPHAN] = gMonIcon_Donphan, -// [SPECIES_PORYGON2] = gMonIcon_Porygon2, -// [SPECIES_STANTLER] = gMonIcon_Stantler, -// [SPECIES_SMEARGLE] = gMonIcon_Smeargle, -// [SPECIES_TYROGUE] = gMonIcon_Tyrogue, -// [SPECIES_HITMONTOP] = gMonIcon_Hitmontop, -// [SPECIES_SMOOCHUM] = gMonIcon_Smoochum, -// [SPECIES_ELEKID] = gMonIcon_Elekid, -// [SPECIES_MAGBY] = gMonIcon_Magby, -// [SPECIES_MILTANK] = gMonIcon_Miltank, -// [SPECIES_BLISSEY] = gMonIcon_Blissey, -// [SPECIES_RAIKOU] = gMonIcon_Raikou, -// [SPECIES_ENTEI] = gMonIcon_Entei, -// [SPECIES_SUICUNE] = gMonIcon_Suicune, -// [SPECIES_LARVITAR] = gMonIcon_Larvitar, -// [SPECIES_PUPITAR] = gMonIcon_Pupitar, -// [SPECIES_TYRANITAR] = gMonIcon_Tyranitar, -// [SPECIES_LUGIA] = gMonIcon_Lugia, -// [SPECIES_HO_OH] = gMonIcon_HoOh, -// [SPECIES_CELEBI] = gMonIcon_Celebi, -// [SPECIES_OLD_UNOWN_B] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_C] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_D] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_E] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_F] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_G] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_H] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_I] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_J] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_K] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_L] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_M] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_N] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_O] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_P] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_Q] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_R] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_S] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_T] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_U] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_V] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_W] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_X] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_Y] = gMonIcon_QuestionMark, -// [SPECIES_OLD_UNOWN_Z] = gMonIcon_QuestionMark, -// [SPECIES_TREECKO] = gMonIcon_Treecko, -// [SPECIES_GROVYLE] = gMonIcon_Grovyle, -// [SPECIES_SCEPTILE] = gMonIcon_Sceptile, -// [SPECIES_TORCHIC] = gMonIcon_Torchic, -// [SPECIES_COMBUSKEN] = gMonIcon_Combusken, -// [SPECIES_BLAZIKEN] = gMonIcon_Blaziken, -// [SPECIES_MUDKIP] = gMonIcon_Mudkip, -// [SPECIES_MARSHTOMP] = gMonIcon_Marshtomp, -// [SPECIES_SWAMPERT] = gMonIcon_Swampert, -// [SPECIES_POOCHYENA] = gMonIcon_Poochyena, -// [SPECIES_MIGHTYENA] = gMonIcon_Mightyena, -// [SPECIES_ZIGZAGOON] = gMonIcon_Zigzagoon, -// [SPECIES_LINOONE] = gMonIcon_Linoone, -// [SPECIES_WURMPLE] = gMonIcon_Wurmple, -// [SPECIES_SILCOON] = gMonIcon_Silcoon, -// [SPECIES_BEAUTIFLY] = gMonIcon_Beautifly, -// [SPECIES_CASCOON] = gMonIcon_Cascoon, -// [SPECIES_DUSTOX] = gMonIcon_Dustox, -// [SPECIES_LOTAD] = gMonIcon_Lotad, -// [SPECIES_LOMBRE] = gMonIcon_Lombre, -// [SPECIES_LUDICOLO] = gMonIcon_Ludicolo, -// [SPECIES_SEEDOT] = gMonIcon_Seedot, -// [SPECIES_NUZLEAF] = gMonIcon_Nuzleaf, -// [SPECIES_SHIFTRY] = gMonIcon_Shiftry, -// [SPECIES_NINCADA] = gMonIcon_Nincada, -// [SPECIES_NINJASK] = gMonIcon_Ninjask, -// [SPECIES_SHEDINJA] = gMonIcon_Shedinja, -// [SPECIES_TAILLOW] = gMonIcon_Taillow, -// [SPECIES_SWELLOW] = gMonIcon_Swellow, -// [SPECIES_SHROOMISH] = gMonIcon_Shroomish, -// [SPECIES_BRELOOM] = gMonIcon_Breloom, -// [SPECIES_SPINDA] = gMonIcon_Spinda, -// [SPECIES_WINGULL] = gMonIcon_Wingull, -// [SPECIES_PELIPPER] = gMonIcon_Pelipper, -// [SPECIES_SURSKIT] = gMonIcon_Surskit, -// [SPECIES_MASQUERAIN] = gMonIcon_Masquerain, -// [SPECIES_WAILMER] = gMonIcon_Wailmer, -// [SPECIES_WAILORD] = gMonIcon_Wailord, -// [SPECIES_SKITTY] = gMonIcon_Skitty, -// [SPECIES_DELCATTY] = gMonIcon_Delcatty, -// [SPECIES_KECLEON] = gMonIcon_Kecleon, -// [SPECIES_BALTOY] = gMonIcon_Baltoy, -// [SPECIES_CLAYDOL] = gMonIcon_Claydol, -// [SPECIES_NOSEPASS] = gMonIcon_Nosepass, -// [SPECIES_TORKOAL] = gMonIcon_Torkoal, -// [SPECIES_SABLEYE] = gMonIcon_Sableye, -// [SPECIES_BARBOACH] = gMonIcon_Barboach, -// [SPECIES_WHISCASH] = gMonIcon_Whiscash, -// [SPECIES_LUVDISC] = gMonIcon_Luvdisc, -// [SPECIES_CORPHISH] = gMonIcon_Corphish, -// [SPECIES_CRAWDAUNT] = gMonIcon_Crawdaunt, -// [SPECIES_FEEBAS] = gMonIcon_Feebas, -// [SPECIES_MILOTIC] = gMonIcon_Milotic, -// [SPECIES_CARVANHA] = gMonIcon_Carvanha, -// [SPECIES_SHARPEDO] = gMonIcon_Sharpedo, -// [SPECIES_TRAPINCH] = gMonIcon_Trapinch, -// [SPECIES_VIBRAVA] = gMonIcon_Vibrava, -// [SPECIES_FLYGON] = gMonIcon_Flygon, -// [SPECIES_MAKUHITA] = gMonIcon_Makuhita, -// [SPECIES_HARIYAMA] = gMonIcon_Hariyama, -// [SPECIES_ELECTRIKE] = gMonIcon_Electrike, -// [SPECIES_MANECTRIC] = gMonIcon_Manectric, -// [SPECIES_NUMEL] = gMonIcon_Numel, -// [SPECIES_CAMERUPT] = gMonIcon_Camerupt, -// [SPECIES_SPHEAL] = gMonIcon_Spheal, -// [SPECIES_SEALEO] = gMonIcon_Sealeo, -// [SPECIES_WALREIN] = gMonIcon_Walrein, -// [SPECIES_CACNEA] = gMonIcon_Cacnea, -// [SPECIES_CACTURNE] = gMonIcon_Cacturne, -// [SPECIES_SNORUNT] = gMonIcon_Snorunt, -// [SPECIES_GLALIE] = gMonIcon_Glalie, -// [SPECIES_LUNATONE] = gMonIcon_Lunatone, -// [SPECIES_SOLROCK] = gMonIcon_Solrock, -// [SPECIES_AZURILL] = gMonIcon_Azurill, -// [SPECIES_SPOINK] = gMonIcon_Spoink, -// [SPECIES_GRUMPIG] = gMonIcon_Grumpig, -// [SPECIES_PLUSLE] = gMonIcon_Plusle, -// [SPECIES_MINUN] = gMonIcon_Minun, -// [SPECIES_MAWILE] = gMonIcon_Mawile, -// [SPECIES_MEDITITE] = gMonIcon_Meditite, -// [SPECIES_MEDICHAM] = gMonIcon_Medicham, -// [SPECIES_SWABLU] = gMonIcon_Swablu, -// [SPECIES_ALTARIA] = gMonIcon_Altaria, -// [SPECIES_WYNAUT] = gMonIcon_Wynaut, -// [SPECIES_DUSKULL] = gMonIcon_Duskull, -// [SPECIES_DUSCLOPS] = gMonIcon_Dusclops, -// [SPECIES_ROSELIA] = gMonIcon_Roselia, -// [SPECIES_SLAKOTH] = gMonIcon_Slakoth, -// [SPECIES_VIGOROTH] = gMonIcon_Vigoroth, -// [SPECIES_SLAKING] = gMonIcon_Slaking, -// [SPECIES_GULPIN] = gMonIcon_Gulpin, -// [SPECIES_SWALOT] = gMonIcon_Swalot, -// [SPECIES_TROPIUS] = gMonIcon_Tropius, -// [SPECIES_WHISMUR] = gMonIcon_Whismur, -// [SPECIES_LOUDRED] = gMonIcon_Loudred, -// [SPECIES_EXPLOUD] = gMonIcon_Exploud, -// [SPECIES_CLAMPERL] = gMonIcon_Clamperl, -// [SPECIES_HUNTAIL] = gMonIcon_Huntail, -// [SPECIES_GOREBYSS] = gMonIcon_Gorebyss, -// [SPECIES_ABSOL] = gMonIcon_Absol, -// [SPECIES_SHUPPET] = gMonIcon_Shuppet, -// [SPECIES_BANETTE] = gMonIcon_Banette, -// [SPECIES_SEVIPER] = gMonIcon_Seviper, -// [SPECIES_ZANGOOSE] = gMonIcon_Zangoose, -// [SPECIES_RELICANTH] = gMonIcon_Relicanth, -// [SPECIES_ARON] = gMonIcon_Aron, -// [SPECIES_LAIRON] = gMonIcon_Lairon, -// [SPECIES_AGGRON] = gMonIcon_Aggron, -// [SPECIES_CASTFORM] = gMonIcon_Castform, -// [SPECIES_VOLBEAT] = gMonIcon_Volbeat, -// [SPECIES_ILLUMISE] = gMonIcon_Illumise, -// [SPECIES_LILEEP] = gMonIcon_Lileep, -// [SPECIES_CRADILY] = gMonIcon_Cradily, -// [SPECIES_ANORITH] = gMonIcon_Anorith, -// [SPECIES_ARMALDO] = gMonIcon_Armaldo, -// [SPECIES_RALTS] = gMonIcon_Ralts, -// [SPECIES_KIRLIA] = gMonIcon_Kirlia, -// [SPECIES_GARDEVOIR] = gMonIcon_Gardevoir, -// [SPECIES_BAGON] = gMonIcon_Bagon, -// [SPECIES_SHELGON] = gMonIcon_Shelgon, -// [SPECIES_SALAMENCE] = gMonIcon_Salamence, -// [SPECIES_BELDUM] = gMonIcon_Beldum, -// [SPECIES_METANG] = gMonIcon_Metang, -// [SPECIES_METAGROSS] = gMonIcon_Metagross, -// [SPECIES_REGIROCK] = gMonIcon_Regirock, -// [SPECIES_REGICE] = gMonIcon_Regice, -// [SPECIES_REGISTEEL] = gMonIcon_Registeel, -// [SPECIES_KYOGRE] = gMonIcon_Kyogre, -// [SPECIES_GROUDON] = gMonIcon_Groudon, -// [SPECIES_RAYQUAZA] = gMonIcon_Rayquaza, -// [SPECIES_LATIAS] = gMonIcon_Latias, -// [SPECIES_LATIOS] = gMonIcon_Latios, -// [SPECIES_JIRACHI] = gMonIcon_Jirachi, -// [SPECIES_DEOXYS] = gMonIcon_Deoxys, -// [SPECIES_CHIMECHO] = gMonIcon_Chimecho, -// [SPECIES_EGG] = gMonIcon_Egg, -// [SPECIES_UNOWN_B] = gMonIcon_UnownB, -// [SPECIES_UNOWN_C] = gMonIcon_UnownC, -// [SPECIES_UNOWN_D] = gMonIcon_UnownD, -// [SPECIES_UNOWN_E] = gMonIcon_UnownE, -// [SPECIES_UNOWN_F] = gMonIcon_UnownF, -// [SPECIES_UNOWN_G] = gMonIcon_UnownG, -// [SPECIES_UNOWN_H] = gMonIcon_UnownH, -// [SPECIES_UNOWN_I] = gMonIcon_UnownI, -// [SPECIES_UNOWN_J] = gMonIcon_UnownJ, -// [SPECIES_UNOWN_K] = gMonIcon_UnownK, -// [SPECIES_UNOWN_L] = gMonIcon_UnownL, -// [SPECIES_UNOWN_M] = gMonIcon_UnownM, -// [SPECIES_UNOWN_N] = gMonIcon_UnownN, -// [SPECIES_UNOWN_O] = gMonIcon_UnownO, -// [SPECIES_UNOWN_P] = gMonIcon_UnownP, -// [SPECIES_UNOWN_Q] = gMonIcon_UnownQ, -// [SPECIES_UNOWN_R] = gMonIcon_UnownR, -// [SPECIES_UNOWN_S] = gMonIcon_UnownS, -// [SPECIES_UNOWN_T] = gMonIcon_UnownT, -// [SPECIES_UNOWN_U] = gMonIcon_UnownU, -// [SPECIES_UNOWN_V] = gMonIcon_UnownV, -// [SPECIES_UNOWN_W] = gMonIcon_UnownW, -// [SPECIES_UNOWN_X] = gMonIcon_UnownX, -// [SPECIES_UNOWN_Y] = gMonIcon_UnownY, -// [SPECIES_UNOWN_Z] = gMonIcon_UnownZ, -// [SPECIES_UNOWN_EMARK] = gMonIcon_UnownExclamationMark, -// [SPECIES_UNOWN_QMARK] = gMonIcon_UnownQuestionMark -// }; - -// const u8 gMonIconPaletteIndices[] = { -// [SPECIES_NONE] = 0, -// [SPECIES_BULBASAUR] = 1, -// [SPECIES_IVYSAUR] = 1, -// [SPECIES_VENUSAUR] = 1, -// [SPECIES_CHARMANDER] = 0, -// [SPECIES_CHARMELEON] = 0, -// [SPECIES_CHARIZARD] = 0, -// [SPECIES_SQUIRTLE] = 0, -// [SPECIES_WARTORTLE] = 2, -// [SPECIES_BLASTOISE] = 2, -// [SPECIES_CATERPIE] = 1, -// [SPECIES_METAPOD] = 1, -// [SPECIES_BUTTERFREE] = 0, -// [SPECIES_WEEDLE] = 1, -// [SPECIES_KAKUNA] = 2, -// [SPECIES_BEEDRILL] = 2, -// [SPECIES_PIDGEY] = 0, -// [SPECIES_PIDGEOTTO] = 0, -// [SPECIES_PIDGEOT] = 0, -// [SPECIES_RATTATA] = 2, -// [SPECIES_RATICATE] = 1, -// [SPECIES_SPEAROW] = 0, -// [SPECIES_FEAROW] = 0, -// [SPECIES_EKANS] = 2, -// [SPECIES_ARBOK] = 2, -// [SPECIES_PIKACHU] = 2, -// [SPECIES_RAICHU] = 0, -// [SPECIES_SANDSHREW] = 2, -// [SPECIES_SANDSLASH] = 2, -// [SPECIES_NIDORAN_F] = 2, -// [SPECIES_NIDORINA] = 2, -// [SPECIES_NIDOQUEEN] = 2, -// [SPECIES_NIDORAN_M] = 2, -// [SPECIES_NIDORINO] = 2, -// [SPECIES_NIDOKING] = 2, -// [SPECIES_CLEFAIRY] = 0, -// [SPECIES_CLEFABLE] = 0, -// [SPECIES_VULPIX] = 2, -// [SPECIES_NINETALES] = 1, -// [SPECIES_JIGGLYPUFF] = 0, -// [SPECIES_WIGGLYTUFF] = 0, -// [SPECIES_ZUBAT] = 2, -// [SPECIES_GOLBAT] = 2, -// [SPECIES_ODDISH] = 1, -// [SPECIES_GLOOM] = 0, -// [SPECIES_VILEPLUME] = 0, -// [SPECIES_PARAS] = 0, -// [SPECIES_PARASECT] = 0, -// [SPECIES_VENONAT] = 0, -// [SPECIES_VENOMOTH] = 2, -// [SPECIES_DIGLETT] = 2, -// [SPECIES_DUGTRIO] = 2, -// [SPECIES_MEOWTH] = 1, -// [SPECIES_PERSIAN] = 1, -// [SPECIES_PSYDUCK] = 1, -// [SPECIES_GOLDUCK] = 2, -// [SPECIES_MANKEY] = 1, -// [SPECIES_PRIMEAPE] = 2, -// [SPECIES_GROWLITHE] = 0, -// [SPECIES_ARCANINE] = 0, -// [SPECIES_POLIWAG] = 0, -// [SPECIES_POLIWHIRL] = 0, -// [SPECIES_POLIWRATH] = 0, -// [SPECIES_ABRA] = 2, -// [SPECIES_KADABRA] = 2, -// [SPECIES_ALAKAZAM] = 2, -// [SPECIES_MACHOP] = 0, -// [SPECIES_MACHOKE] = 2, -// [SPECIES_MACHAMP] = 0, -// [SPECIES_BELLSPROUT] = 1, -// [SPECIES_WEEPINBELL] = 1, -// [SPECIES_VICTREEBEL] = 1, -// [SPECIES_TENTACOOL] = 2, -// [SPECIES_TENTACRUEL] = 2, -// [SPECIES_GEODUDE] = 1, -// [SPECIES_GRAVELER] = 1, -// [SPECIES_GOLEM] = 1, -// [SPECIES_PONYTA] = 0, -// [SPECIES_RAPIDASH] = 0, -// [SPECIES_SLOWPOKE] = 0, -// [SPECIES_SLOWBRO] = 0, -// [SPECIES_MAGNEMITE] = 0, -// [SPECIES_MAGNETON] = 0, -// [SPECIES_FARFETCHD] = 1, -// [SPECIES_DODUO] = 2, -// [SPECIES_DODRIO] = 2, -// [SPECIES_SEEL] = 2, -// [SPECIES_DEWGONG] = 2, -// [SPECIES_GRIMER] = 2, -// [SPECIES_MUK] = 2, -// [SPECIES_SHELLDER] = 2, -// [SPECIES_CLOYSTER] = 2, -// [SPECIES_GASTLY] = 2, -// [SPECIES_HAUNTER] = 2, -// [SPECIES_GENGAR] = 2, -// [SPECIES_ONIX] = 2, -// [SPECIES_DROWZEE] = 2, -// [SPECIES_HYPNO] = 1, -// [SPECIES_KRABBY] = 2, -// [SPECIES_KINGLER] = 2, -// [SPECIES_VOLTORB] = 0, -// [SPECIES_ELECTRODE] = 0, -// [SPECIES_EXEGGCUTE] = 0, -// [SPECIES_EXEGGUTOR] = 1, -// [SPECIES_CUBONE] = 1, -// [SPECIES_MAROWAK] = 1, -// [SPECIES_HITMONLEE] = 2, -// [SPECIES_HITMONCHAN] = 2, -// [SPECIES_LICKITUNG] = 1, -// [SPECIES_KOFFING] = 2, -// [SPECIES_WEEZING] = 2, -// [SPECIES_RHYHORN] = 1, -// [SPECIES_RHYDON] = 1, -// [SPECIES_CHANSEY] = 0, -// [SPECIES_TANGELA] = 0, -// [SPECIES_KANGASKHAN] = 1, -// [SPECIES_HORSEA] = 0, -// [SPECIES_SEADRA] = 0, -// [SPECIES_GOLDEEN] = 0, -// [SPECIES_SEAKING] = 0, -// [SPECIES_STARYU] = 2, -// [SPECIES_STARMIE] = 2, -// [SPECIES_MR_MIME] = 0, -// [SPECIES_SCYTHER] = 1, -// [SPECIES_JYNX] = 2, -// [SPECIES_ELECTABUZZ] = 1, -// [SPECIES_MAGMAR] = 0, -// [SPECIES_PINSIR] = 2, -// [SPECIES_TAUROS] = 2, -// [SPECIES_MAGIKARP] = 0, -// [SPECIES_GYARADOS] = 0, -// [SPECIES_LAPRAS] = 2, -// [SPECIES_DITTO] = 2, -// [SPECIES_EEVEE] = 2, -// [SPECIES_VAPOREON] = 0, -// [SPECIES_JOLTEON] = 0, -// [SPECIES_FLAREON] = 0, -// [SPECIES_PORYGON] = 0, -// [SPECIES_OMANYTE] = 0, -// [SPECIES_OMASTAR] = 0, -// [SPECIES_KABUTO] = 2, -// [SPECIES_KABUTOPS] = 2, -// [SPECIES_AERODACTYL] = 0, -// [SPECIES_SNORLAX] = 1, -// [SPECIES_ARTICUNO] = 0, -// [SPECIES_ZAPDOS] = 0, -// [SPECIES_MOLTRES] = 0, -// [SPECIES_DRATINI] = 0, -// [SPECIES_DRAGONAIR] = 0, -// [SPECIES_DRAGONITE] = 2, -// [SPECIES_MEWTWO] = 2, -// [SPECIES_MEW] = 0, -// [SPECIES_CHIKORITA] = 1, -// [SPECIES_BAYLEEF] = 1, -// [SPECIES_MEGANIUM] = 1, -// [SPECIES_CYNDAQUIL] = 1, -// [SPECIES_QUILAVA] = 1, -// [SPECIES_TYPHLOSION] = 1, -// [SPECIES_TOTODILE] = 2, -// [SPECIES_CROCONAW] = 2, -// [SPECIES_FERALIGATR] = 2, -// [SPECIES_SENTRET] = 2, -// [SPECIES_FURRET] = 2, -// [SPECIES_HOOTHOOT] = 2, -// [SPECIES_NOCTOWL] = 2, -// [SPECIES_LEDYBA] = 0, -// [SPECIES_LEDIAN] = 0, -// [SPECIES_SPINARAK] = 1, -// [SPECIES_ARIADOS] = 0, -// [SPECIES_CROBAT] = 2, -// [SPECIES_CHINCHOU] = 2, -// [SPECIES_LANTURN] = 0, -// [SPECIES_PICHU] = 0, -// [SPECIES_CLEFFA] = 0, -// [SPECIES_IGGLYBUFF] = 1, -// [SPECIES_TOGEPI] = 2, -// [SPECIES_TOGETIC] = 2, -// [SPECIES_NATU] = 0, -// [SPECIES_XATU] = 0, -// [SPECIES_MAREEP] = 2, -// [SPECIES_FLAAFFY] = 0, -// [SPECIES_AMPHAROS] = 0, -// [SPECIES_BELLOSSOM] = 1, -// [SPECIES_MARILL] = 2, -// [SPECIES_AZUMARILL] = 2, -// [SPECIES_SUDOWOODO] = 1, -// [SPECIES_POLITOED] = 1, -// [SPECIES_HOPPIP] = 1, -// [SPECIES_SKIPLOOM] = 1, -// [SPECIES_JUMPLUFF] = 2, -// [SPECIES_AIPOM] = 2, -// [SPECIES_SUNKERN] = 1, -// [SPECIES_SUNFLORA] = 1, -// [SPECIES_YANMA] = 1, -// [SPECIES_WOOPER] = 0, -// [SPECIES_QUAGSIRE] = 0, -// [SPECIES_ESPEON] = 2, -// [SPECIES_UMBREON] = 2, -// [SPECIES_MURKROW] = 2, -// [SPECIES_SLOWKING] = 0, -// [SPECIES_MISDREAVUS] = 0, -// [SPECIES_UNOWN] = 0, -// [SPECIES_WOBBUFFET] = 0, -// [SPECIES_GIRAFARIG] = 1, -// [SPECIES_PINECO] = 0, -// [SPECIES_FORRETRESS] = 2, -// [SPECIES_DUNSPARCE] = 2, -// [SPECIES_GLIGAR] = 2, -// [SPECIES_STEELIX] = 0, -// [SPECIES_SNUBBULL] = 0, -// [SPECIES_GRANBULL] = 2, -// [SPECIES_QWILFISH] = 0, -// [SPECIES_SCIZOR] = 0, -// [SPECIES_SHUCKLE] = 1, -// [SPECIES_HERACROSS] = 2, -// [SPECIES_SNEASEL] = 0, -// [SPECIES_TEDDIURSA] = 0, -// [SPECIES_URSARING] = 2, -// [SPECIES_SLUGMA] = 0, -// [SPECIES_MAGCARGO] = 0, -// [SPECIES_SWINUB] = 2, -// [SPECIES_PILOSWINE] = 2, -// [SPECIES_CORSOLA] = 0, -// [SPECIES_REMORAID] = 0, -// [SPECIES_OCTILLERY] = 0, -// [SPECIES_DELIBIRD] = 0, -// [SPECIES_MANTINE] = 2, -// [SPECIES_SKARMORY] = 0, -// [SPECIES_HOUNDOUR] = 0, -// [SPECIES_HOUNDOOM] = 0, -// [SPECIES_KINGDRA] = 0, -// [SPECIES_PHANPY] = 0, -// [SPECIES_DONPHAN] = 0, -// [SPECIES_PORYGON2] = 0, -// [SPECIES_STANTLER] = 2, -// [SPECIES_SMEARGLE] = 1, -// [SPECIES_TYROGUE] = 2, -// [SPECIES_HITMONTOP] = 2, -// [SPECIES_SMOOCHUM] = 1, -// [SPECIES_ELEKID] = 1, -// [SPECIES_MAGBY] = 1, -// [SPECIES_MILTANK] = 1, -// [SPECIES_BLISSEY] = 1, -// [SPECIES_RAIKOU] = 0, -// [SPECIES_ENTEI] = 2, -// [SPECIES_SUICUNE] = 0, -// [SPECIES_LARVITAR] = 1, -// [SPECIES_PUPITAR] = 0, -// [SPECIES_TYRANITAR] = 1, -// [SPECIES_LUGIA] = 0, -// [SPECIES_HO_OH] = 1, -// [SPECIES_CELEBI] = 1, -// [SPECIES_OLD_UNOWN_B] = 0, -// [SPECIES_OLD_UNOWN_C] = 0, -// [SPECIES_OLD_UNOWN_D] = 0, -// [SPECIES_OLD_UNOWN_E] = 0, -// [SPECIES_OLD_UNOWN_F] = 0, -// [SPECIES_OLD_UNOWN_G] = 0, -// [SPECIES_OLD_UNOWN_H] = 0, -// [SPECIES_OLD_UNOWN_I] = 0, -// [SPECIES_OLD_UNOWN_J] = 0, -// [SPECIES_OLD_UNOWN_K] = 0, -// [SPECIES_OLD_UNOWN_L] = 0, -// [SPECIES_OLD_UNOWN_M] = 0, -// [SPECIES_OLD_UNOWN_N] = 0, -// [SPECIES_OLD_UNOWN_O] = 0, -// [SPECIES_OLD_UNOWN_P] = 0, -// [SPECIES_OLD_UNOWN_Q] = 0, -// [SPECIES_OLD_UNOWN_R] = 0, -// [SPECIES_OLD_UNOWN_S] = 0, -// [SPECIES_OLD_UNOWN_T] = 0, -// [SPECIES_OLD_UNOWN_U] = 0, -// [SPECIES_OLD_UNOWN_V] = 0, -// [SPECIES_OLD_UNOWN_W] = 0, -// [SPECIES_OLD_UNOWN_X] = 0, -// [SPECIES_OLD_UNOWN_Y] = 0, -// [SPECIES_OLD_UNOWN_Z] = 0, -// [SPECIES_TREECKO] = 1, -// [SPECIES_GROVYLE] = 0, -// [SPECIES_SCEPTILE] = 1, -// [SPECIES_TORCHIC] = 0, -// [SPECIES_COMBUSKEN] = 0, -// [SPECIES_BLAZIKEN] = 0, -// [SPECIES_MUDKIP] = 0, -// [SPECIES_MARSHTOMP] = 0, -// [SPECIES_SWAMPERT] = 0, -// [SPECIES_POOCHYENA] = 2, -// [SPECIES_MIGHTYENA] = 2, -// [SPECIES_ZIGZAGOON] = 2, -// [SPECIES_LINOONE] = 2, -// [SPECIES_WURMPLE] = 0, -// [SPECIES_SILCOON] = 2, -// [SPECIES_BEAUTIFLY] = 0, -// [SPECIES_CASCOON] = 2, -// [SPECIES_DUSTOX] = 1, -// [SPECIES_LOTAD] = 1, -// [SPECIES_LOMBRE] = 1, -// [SPECIES_LUDICOLO] = 1, -// [SPECIES_SEEDOT] = 1, -// [SPECIES_NUZLEAF] = 1, -// [SPECIES_SHIFTRY] = 0, -// [SPECIES_NINCADA] = 1, -// [SPECIES_NINJASK] = 1, -// [SPECIES_SHEDINJA] = 1, -// [SPECIES_TAILLOW] = 2, -// [SPECIES_SWELLOW] = 2, -// [SPECIES_SHROOMISH] = 1, -// [SPECIES_BRELOOM] = 1, -// [SPECIES_SPINDA] = 1, -// [SPECIES_WINGULL] = 0, -// [SPECIES_PELIPPER] = 0, -// [SPECIES_SURSKIT] = 2, -// [SPECIES_MASQUERAIN] = 0, -// [SPECIES_WAILMER] = 2, -// [SPECIES_WAILORD] = 0, -// [SPECIES_SKITTY] = 0, -// [SPECIES_DELCATTY] = 2, -// [SPECIES_KECLEON] = 1, -// [SPECIES_BALTOY] = 1, -// [SPECIES_CLAYDOL] = 0, -// [SPECIES_NOSEPASS] = 0, -// [SPECIES_TORKOAL] = 1, -// [SPECIES_SABLEYE] = 2, -// [SPECIES_BARBOACH] = 0, -// [SPECIES_WHISCASH] = 0, -// [SPECIES_LUVDISC] = 0, -// [SPECIES_CORPHISH] = 0, -// [SPECIES_CRAWDAUNT] = 0, -// [SPECIES_FEEBAS] = 2, -// [SPECIES_MILOTIC] = 0, -// [SPECIES_CARVANHA] = 0, -// [SPECIES_SHARPEDO] = 0, -// [SPECIES_TRAPINCH] = 1, -// [SPECIES_VIBRAVA] = 1, -// [SPECIES_FLYGON] = 1, -// [SPECIES_MAKUHITA] = 2, -// [SPECIES_HARIYAMA] = 1, -// [SPECIES_ELECTRIKE] = 1, -// [SPECIES_MANECTRIC] = 0, -// [SPECIES_NUMEL] = 1, -// [SPECIES_CAMERUPT] = 0, -// [SPECIES_SPHEAL] = 2, -// [SPECIES_SEALEO] = 2, -// [SPECIES_WALREIN] = 0, -// [SPECIES_CACNEA] = 1, -// [SPECIES_CACTURNE] = 1, -// [SPECIES_SNORUNT] = 2, -// [SPECIES_GLALIE] = 0, -// [SPECIES_LUNATONE] = 1, -// [SPECIES_SOLROCK] = 0, -// [SPECIES_AZURILL] = 2, -// [SPECIES_SPOINK] = 0, -// [SPECIES_GRUMPIG] = 2, -// [SPECIES_PLUSLE] = 0, -// [SPECIES_MINUN] = 0, -// [SPECIES_MAWILE] = 2, -// [SPECIES_MEDITITE] = 0, -// [SPECIES_MEDICHAM] = 0, -// [SPECIES_SWABLU] = 0, -// [SPECIES_ALTARIA] = 0, -// [SPECIES_WYNAUT] = 0, -// [SPECIES_DUSKULL] = 0, -// [SPECIES_DUSCLOPS] = 0, -// [SPECIES_ROSELIA] = 0, -// [SPECIES_SLAKOTH] = 2, -// [SPECIES_VIGOROTH] = 2, -// [SPECIES_SLAKING] = 1, -// [SPECIES_GULPIN] = 1, -// [SPECIES_SWALOT] = 2, -// [SPECIES_TROPIUS] = 1, -// [SPECIES_WHISMUR] = 0, -// [SPECIES_LOUDRED] = 2, -// [SPECIES_EXPLOUD] = 2, -// [SPECIES_CLAMPERL] = 0, -// [SPECIES_HUNTAIL] = 0, -// [SPECIES_GOREBYSS] = 0, -// [SPECIES_ABSOL] = 0, -// [SPECIES_SHUPPET] = 0, -// [SPECIES_BANETTE] = 0, -// [SPECIES_SEVIPER] = 2, -// [SPECIES_ZANGOOSE] = 0, -// [SPECIES_RELICANTH] = 1, -// [SPECIES_ARON] = 2, -// [SPECIES_LAIRON] = 2, -// [SPECIES_AGGRON] = 2, -// [SPECIES_CASTFORM] = 0, -// [SPECIES_VOLBEAT] = 0, -// [SPECIES_ILLUMISE] = 2, -// [SPECIES_LILEEP] = 2, -// [SPECIES_CRADILY] = 0, -// [SPECIES_ANORITH] = 0, -// [SPECIES_ARMALDO] = 0, -// [SPECIES_RALTS] = 1, -// [SPECIES_KIRLIA] = 1, -// [SPECIES_GARDEVOIR] = 1, -// [SPECIES_BAGON] = 2, -// [SPECIES_SHELGON] = 2, -// [SPECIES_SALAMENCE] = 0, -// [SPECIES_BELDUM] = 0, -// [SPECIES_METANG] = 0, -// [SPECIES_METAGROSS] = 0, -// [SPECIES_REGIROCK] = 2, -// [SPECIES_REGICE] = 2, -// [SPECIES_REGISTEEL] = 2, -// [SPECIES_KYOGRE] = 2, -// [SPECIES_GROUDON] = 0, -// [SPECIES_RAYQUAZA] = 1, -// [SPECIES_LATIAS] = 0, -// [SPECIES_LATIOS] = 2, -// [SPECIES_JIRACHI] = 0, -// [SPECIES_DEOXYS] = 0, -// [SPECIES_CHIMECHO] = 0, -// [SPECIES_EGG] = 1, -// [SPECIES_UNOWN_B] = 0, -// [SPECIES_UNOWN_C] = 0, -// [SPECIES_UNOWN_D] = 0, -// [SPECIES_UNOWN_E] = 0, -// [SPECIES_UNOWN_F] = 0, -// [SPECIES_UNOWN_G] = 0, -// [SPECIES_UNOWN_H] = 0, -// [SPECIES_UNOWN_I] = 0, -// [SPECIES_UNOWN_J] = 0, -// [SPECIES_UNOWN_K] = 0, -// [SPECIES_UNOWN_L] = 0, -// [SPECIES_UNOWN_M] = 0, -// [SPECIES_UNOWN_N] = 0, -// [SPECIES_UNOWN_O] = 0, -// [SPECIES_UNOWN_P] = 0, -// [SPECIES_UNOWN_Q] = 0, -// [SPECIES_UNOWN_R] = 0, -// [SPECIES_UNOWN_S] = 0, -// [SPECIES_UNOWN_T] = 0, -// [SPECIES_UNOWN_U] = 0, -// [SPECIES_UNOWN_V] = 0, -// [SPECIES_UNOWN_W] = 0, -// [SPECIES_UNOWN_X] = 0, -// [SPECIES_UNOWN_Y] = 0, -// [SPECIES_UNOWN_Z] = 0, -// [SPECIES_UNOWN_EMARK] = 0, -// [SPECIES_UNOWN_QMARK] = 0 -// }; - const struct SpritePalette gMonIconPaletteTable[] = { { gMonIconPalettes[0], POKE_ICON_BASE_PAL_TAG + 0 }, { gMonIconPalettes[1], POKE_ICON_BASE_PAL_TAG + 1 }, @@ -1018,7 +132,7 @@ u8 CreateMonIcon(u16 species, SpriteCallback callback, s16 x, s16 y, u8 subprior struct MonIconSpriteTemplate iconTemplate = { .oam = &sMonIconOamData, - .image = GetMonIconPtr(species, personality, extra), + .image = GetMonIconPtr(species, personality), .anims = sMonIconAnims, .affineAnims = sMonIconAffineAnims, .callback = callback, @@ -1048,7 +162,7 @@ u8 CreateMonIcon_HandleDeoxys(u16 species, SpriteCallback callback, s16 x, s16 y .paletteTag = POKE_ICON_BASE_PAL_TAG + gSpeciesInfo[species].iconPalIndex, }; - iconTemplate.image = GetMonIconTiles(species, extra); + iconTemplate.image = GetMonIconTiles(species, 0); spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority); UpdateMonIconFrame(&gSprites[spriteId]); @@ -1108,17 +222,26 @@ u16 MailSpeciesToIconSpecies(u16 species) } } -const u8 *GetMonIconTiles(u16 species, bool32 extra) +const u8 *GetMonIconTiles(u16 species, u32 personality) { - const u8 *iconSprite = gSpeciesInfo[species].iconSprite; - if (species == SPECIES_DEOXYS && extra == TRUE) - iconSprite += 0x400; + const u8 *iconSprite; + + if (species > NUM_SPECIES) + species = SPECIES_NONE; + + if (gSpeciesInfo[species].iconSpriteFemale != NULL && IsPersonalityFemale(species, personality)) + iconSprite = gSpeciesInfo[species].iconSpriteFemale; + else if (gSpeciesInfo[species].iconSprite != NULL) + iconSprite = gSpeciesInfo[species].iconSprite; + else + iconSprite = gSpeciesInfo[SPECIES_NONE].iconSprite; + return iconSprite; } -const u8 *GetMonIconPtr(u16 species, u32 personality, bool32 extra) +const u8 *GetMonIconPtr(u16 species, u32 personality) { - return GetMonIconTiles(GetIconSpecies(species, personality), extra); + return GetMonIconTiles(GetIconSpecies(species, personality), personality); } void DestroyMonIcon(struct Sprite *sprite) diff --git a/src/pokemon_storage_system_graphics.c b/src/pokemon_storage_system_graphics.c index bbe1b4915..fc5f99d8a 100644 --- a/src/pokemon_storage_system_graphics.c +++ b/src/pokemon_storage_system_graphics.c @@ -938,7 +938,7 @@ static void SpriteCB_HeldMon(struct Sprite *sprite) sprite->y = gStorage->cursorSprite->y + gStorage->cursorSprite->y2 + 4; } -static u16 TryLoadMonIconTiles(u16 species) +static u16 TryLoadMonIconTiles(u16 species, u32 personality) { u16 i, offset; @@ -964,7 +964,7 @@ static u16 TryLoadMonIconTiles(u16 species) gStorage->iconSpeciesList[i] = species; gStorage->numIconsPerSpecies[i]++; offset = 16 * i; - CpuCopy32(GetMonIconTiles(species, TRUE), (void *)(OBJ_VRAM0) + offset * 32, 0x200); + CpuCopy32(GetMonIconTiles(species, personality), (void *)(OBJ_VRAM0) + offset * 32, 0x200); return offset; } @@ -992,7 +992,7 @@ struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u species = GetIconSpecies(species, personality); template.paletteTag = PALTAG_MON_ICON_0 + gSpeciesInfo[species].iconPalIndex; - tileNum = TryLoadMonIconTiles(species); + tileNum = TryLoadMonIconTiles(species, personality); if (tileNum == 0xFFFF) return NULL; diff --git a/src/pokemon_storage_system_misc.c b/src/pokemon_storage_system_misc.c index c75359421..f7813c86f 100644 --- a/src/pokemon_storage_system_misc.c +++ b/src/pokemon_storage_system_misc.c @@ -405,7 +405,7 @@ static void MultiMove_SetIconToBg(u8 x, u8 y) if (species != SPECIES_NONE) { - const u8 *iconGfx = GetMonIconPtr(species, personality, 1); + const u8 *iconGfx = GetMonIconPtr(species, personality); u8 palNum = GetValidMonIconPalIndex(species) + 8; BlitBitmapRectToWindow4BitTo8Bit(gStorage->multiMoveWindowId, iconGfx, 0, 0, 32, 32, 24 * x, 24 * y, 32, 32, palNum); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 06ff7c9eb..1c860821f 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -623,7 +623,6 @@ static const u32 sStarObjTiles[] = INCBIN_U32( "graphics/summary_screen/shiny_st static const u32 sBgTilemap_MovesInfoPage[] = INCBIN_U32( "graphics/summary_screen/moves_info_page.bin.lz"); static const u32 sBgTilemap_MovesPage[] = INCBIN_U32( "graphics/summary_screen/moves_page.bin.lz"); -#include "data/text/move_descriptions.h" #include "data/text/nature_names.h" static const u8 *const sEggHatchTimeTexts[] = { @@ -2270,15 +2269,15 @@ static void BufferMonMoveI(u8 i) } sMonSummaryScreen->numMoves++; - sMonSummaryScreen->moveTypes[i] = gBattleMoves[sMonSummaryScreen->moveIds[i]].type; + sMonSummaryScreen->moveTypes[i] = gMovesInfo[sMonSummaryScreen->moveIds[i]].type; StringCopy(sMonSummaryScreen->summary.moveNameStrBufs[i], gMoveNames[sMonSummaryScreen->moveIds[i]]); if (i >= 4 && sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) { ConvertIntToDecimalStringN(sMonSummaryScreen->summary.moveCurPpStrBufs[i], - gBattleMoves[sMonSummaryScreen->moveIds[i]].pp, STR_CONV_MODE_LEFT_ALIGN, 3); + gMovesInfo[sMonSummaryScreen->moveIds[i]].pp, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(sMonSummaryScreen->summary.moveMaxPpStrBufs[i], - gBattleMoves[sMonSummaryScreen->moveIds[i]].pp, STR_CONV_MODE_LEFT_ALIGN, 3); + gMovesInfo[sMonSummaryScreen->moveIds[i]].pp, STR_CONV_MODE_LEFT_ALIGN, 3); } else { @@ -2292,15 +2291,15 @@ static void BufferMonMoveI(u8 i) sMonSkillsPrinterXpos->curPp[i] = GetRightAlignXpos_NDigits(2, sMonSummaryScreen->summary.moveCurPpStrBufs[i]); sMonSkillsPrinterXpos->maxPp[i] = GetRightAlignXpos_NDigits(2, sMonSummaryScreen->summary.moveMaxPpStrBufs[i]); - if (gBattleMoves[sMonSummaryScreen->moveIds[i]].power <= 1) + if (gMovesInfo[sMonSummaryScreen->moveIds[i]].power <= 1) StringCopy(sMonSummaryScreen->summary.movePowerStrBufs[i], gText_ThreeHyphens); else - ConvertIntToDecimalStringN(sMonSummaryScreen->summary.movePowerStrBufs[i], gBattleMoves[sMonSummaryScreen->moveIds[i]].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(sMonSummaryScreen->summary.movePowerStrBufs[i], gMovesInfo[sMonSummaryScreen->moveIds[i]].power, STR_CONV_MODE_RIGHT_ALIGN, 3); - if (gBattleMoves[sMonSummaryScreen->moveIds[i]].accuracy == 0) + if (gMovesInfo[sMonSummaryScreen->moveIds[i]].accuracy == 0) StringCopy(sMonSummaryScreen->summary.moveAccuracyStrBufs[i], gText_ThreeHyphens); else - ConvertIntToDecimalStringN(sMonSummaryScreen->summary.moveAccuracyStrBufs[i], gBattleMoves[sMonSummaryScreen->moveIds[i]].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(sMonSummaryScreen->summary.moveAccuracyStrBufs[i], gMovesInfo[sMonSummaryScreen->moveIds[i]].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); } static u8 PokeSum_HandleCreateSprites(void) @@ -2874,7 +2873,7 @@ static void PokeSum_PrintSelectedMoveStats(void) 7, 42, 0, 0, sLevelNickTextColors[0], TEXT_SKIP_DRAW, - gMoveDescriptionPointers[sMonSummaryScreen->moveIds[sMoveSelectionCursorPos] - 1]); + gMovesInfo[sMonSummaryScreen->moveIds[sMoveSelectionCursorPos]].description); } } @@ -3770,7 +3769,7 @@ static u8 PokeSum_CanForgetSelectedMove(void) move = GetMonMoveBySlotId(&sMonSummaryScreen->currentMon, sMoveSelectionCursorPos); - if (IsMoveHm(move) == TRUE && sMonSummaryScreen->mode != PSS_MODE_FORGET_MOVE) + if (IsMoveHM(move) == TRUE && sMonSummaryScreen->mode != PSS_MODE_FORGET_MOVE) return FALSE; return TRUE; diff --git a/src/random.c b/src/random.c index 413a3e60d..fec48055a 100644 --- a/src/random.c +++ b/src/random.c @@ -1,14 +1,124 @@ #include "global.h" #include "random.h" +#if MODERN +#include +#endif -// The number 1103515245 comes from the example implementation -// of rand and srand in the ISO C standard. +// IWRAM common +rng_value_t gRngValue; +rng_value_t gRng2Value; -u32 gRngValue; +#if HQ_RANDOM == TRUE + +EWRAM_DATA static volatile bool8 sRngLoopUnlocked; + +// Streams allow generators seeded the same to have separate outputs. +#define STREAM1 1 +#define STREAM2 29 + +// A variant of SFC32 that lets you change the stream. +// stream can be any odd number. +static inline u32 _SFC32_Next_Stream(struct Sfc32State *state, const u8 stream) +{ + const u32 result = state->a + state->b + state->ctr; + state->ctr += stream; + state->a = state->b ^ (state->b >> 9); + state->b = state->c * 9; + state->c = result + ((state->c << 21) | (state->c >> 11)); + return result; +} + +static void SFC32_Seed(struct Sfc32State *state, u32 seed, u8 stream) +{ + u32 i; + state->a = state->b = 0; + state->c = seed; + state->ctr = stream; + for(i = 0; i < 16; i++) + { + _SFC32_Next_Stream(state, stream); + } +} + +/*This ASM implementation uses some shortcuts and is generally faster on the GBA. +* It's not necessarily faster if inlined, or on other platforms. +* In addition, it's extremely non-portable. */ +u32 NAKED Random32(void) +{ + asm(".thumb\n\ + push {r4, r5, r6}\n\ + mov r6, #11\n\ + ldr r5, =gRngValue\n\ + ldmia r5!, {r1, r2, r3, r4}\n\ + @ result = a + b + (d+=STREAM1)\n\ + add r1, r1, r2\n\ + add r0, r1, r4\n\ + add r4, r4, #" STR(STREAM1) "\n\ + @ a = b ^ (b >> 9)\n\ + lsr r1, r2, #9\n\ + eor r1, r1, r2\n\ + @ b = c + (c << 3) [c * 9]\n\ + lsl r2, r3, #3\n\ + add r2, r2, r3\n\ + @ c = rol(c, 21) + result\n\ + ror r3, r3, r6\n\ + add r3, r3, r0\n\ + sub r5, r5, #16\n\ + stmia r5!, {r1, r2, r3, r4}\n\ + pop {r4, r5, r6}\n\ + bx lr\n\ + .ltorg" + ); +} + +u32 Random2_32(void) +{ + return _SFC32_Next_Stream(&gRng2Value, STREAM2); +} + +void SeedRng(u32 seed) +{ + struct Sfc32State state; + SFC32_Seed(&state, seed, STREAM1); + + sRngLoopUnlocked = FALSE; + gRngValue = state; + sRngLoopUnlocked = TRUE; +} + +void SeedRng2(u32 seed) +{ + SFC32_Seed(&gRng2Value, seed, STREAM2); +} + +rng_value_t LocalRandomSeed(u32 seed) +{ + rng_value_t result; + SFC32_Seed(&result, seed, STREAM1); + return result; +} + +void AdvanceRandom(void) +{ + if (sRngLoopUnlocked == TRUE) + Random32(); +} + +#define LOOP_RANDOM_START \ + struct Sfc32State *const state = &gRngValue; \ + sRngLoopUnlocked = FALSE; + +#define LOOP_RANDOM_END sRngLoopUnlocked = TRUE; + +#define LOOP_RANDOM ((u16)(_SFC32_Next(state) >> 16)) + +#else +EWRAM_DATA static u32 sRandCount = 0; u16 Random(void) { gRngValue = ISO_RANDOMIZE1(gRngValue); + sRandCount++; return gRngValue >> 16; } @@ -16,3 +126,139 @@ void SeedRng(u16 seed) { gRngValue = seed; } + +void SeedRng2(u16 seed) +{ + gRng2Value = seed; +} + +u16 Random2(void) +{ + gRng2Value = ISO_RANDOMIZE1(gRng2Value); + return gRng2Value >> 16; +} + +#define LOOP_RANDOM_START +#define LOOP_RANDOM_END + +#define LOOP_RANDOM (Random()) + +#endif + +#define SHUFFLE_IMPL \ + u32 tmp; \ + LOOP_RANDOM_START; \ + --n; \ + while (n > 1) \ + { \ + int j = (LOOP_RANDOM * (n+1)) >> 16; \ + SWAP(data[n], data[j], tmp); \ + --n; \ + } \ + LOOP_RANDOM_END + +void Shuffle8(void *data_, size_t n) +{ + u8 *data = data_; + SHUFFLE_IMPL; +} + +void Shuffle16(void *data_, size_t n) +{ + u16 *data = data_; + SHUFFLE_IMPL; +} + +void Shuffle32(void *data_, size_t n) +{ + u32 *data = data_; + SHUFFLE_IMPL; +} + +void ShuffleN(void *data, size_t n, size_t size) +{ + void *tmp = alloca(size); + LOOP_RANDOM_START; + --n; + + while (n > 1) + { + int j = (LOOP_RANDOM * (n+1)) >> 16; + memcpy(tmp, (u8 *)data + n*size, size); // tmp = data[n]; + memcpy((u8 *)data + n*size, (u8 *)data + j*size, size); // data[n] = data[j]; + memcpy((u8 *)data + j*size, tmp, size); // data[j] = tmp; + --n; + } + + LOOP_RANDOM_END; +} + +__attribute__((weak, alias("RandomUniformDefault"))) +u32 RandomUniform(enum RandomTag tag, u32 lo, u32 hi); + +__attribute__((weak, alias("RandomUniformExceptDefault"))) +u32 RandomUniformExcept(enum RandomTag, u32 lo, u32 hi, bool32 (*reject)(u32)); + +__attribute__((weak, alias("RandomWeightedArrayDefault"))) +u32 RandomWeightedArray(enum RandomTag tag, u32 sum, u32 n, const u8 *weights); + +__attribute__((weak, alias("RandomElementArrayDefault"))) +const void *RandomElementArray(enum RandomTag tag, const void *array, size_t size, size_t count); + +u32 RandomUniformDefault(enum RandomTag tag, u32 lo, u32 hi) +{ + return lo + (((hi - lo + 1) * Random()) >> 16); +} + +u32 RandomUniformExceptDefault(enum RandomTag tag, u32 lo, u32 hi, bool32 (*reject)(u32)) +{ + LOOP_RANDOM_START; + while (TRUE) + { + u32 n = lo + (((hi - lo + 1) * LOOP_RANDOM) >> 16); + if (!reject(n)) + return n; + } + LOOP_RANDOM_END; +} + +u32 RandomWeightedArrayDefault(enum RandomTag tag, u32 sum, u32 n, const u8 *weights) +{ + s32 i, targetSum; + targetSum = (sum * Random()) >> 16; + for (i = 0; i < n - 1; i++) + { + targetSum -= weights[i]; + if (targetSum < 0) + return i; + } + return n - 1; +} + +const void *RandomElementArrayDefault(enum RandomTag tag, const void *array, size_t size, size_t count) +{ + return (const u8 *)array + size * RandomUniformDefault(tag, 0, count - 1); +} + + + + + + + +// OLD +// The number 1103515245 comes from the example implementation +// of rand and srand in the ISO C standard. + +// u32 gRngValue; + +// u16 Random(void) +// { +// gRngValue = ISO_RANDOMIZE1(gRngValue); +// return gRngValue >> 16; +// } + +// void SeedRng(u16 seed) +// { +// gRngValue = seed; +// } diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index e051c49a8..e77eba97a 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -150,7 +150,7 @@ static const struct GFRomHeader sGFRomHeader = { // .abilityNames = gAbilityNames, // .abilityDescriptions = gAbilityDescriptionPointers, .items = gItems, - .moves = gBattleMoves, + // .moves = gBattleMoves, .ballGfx = gBallSpriteSheets, .ballPalettes = gBallSpritePalettes, .gcnLinkFlagsOffset = offsetof(struct SaveBlock2, gcnLinkFlags), diff --git a/src/tm_case.c b/src/tm_case.c index b40513d71..94100ea9a 100644 --- a/src/tm_case.c +++ b/src/tm_case.c @@ -1555,30 +1555,30 @@ static void PrintMoveInfo(u16 itemId) { // Draw type icon move = ItemIdToBattleMoveId(itemId); - BlitMenuInfoIcon(WIN_MOVE_INFO, gBattleMoves[move].type + 1, 0, 0); + BlitMenuInfoIcon(WIN_MOVE_INFO, gMovesInfo[move].type + 1, 0, 0); // Print power - if (gBattleMoves[move].power < 2) + if (gMovesInfo[move].power < 2) str = gText_ThreeHyphens; else { - ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3); str = gStringVar1; } TMCase_Print(WIN_MOVE_INFO, FONT_NORMAL_COPY_2, str, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLOR_MOVE_INFO); // Print accuracy - if (gBattleMoves[move].accuracy == 0) + if (gMovesInfo[move].accuracy == 0) str = gText_ThreeHyphens; else { - ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); str = gStringVar1; } TMCase_Print(WIN_MOVE_INFO, FONT_NORMAL_COPY_2, str, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLOR_MOVE_INFO); // Print PP - ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); TMCase_Print(WIN_MOVE_INFO, FONT_NORMAL_COPY_2, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLOR_MOVE_INFO); CopyWindowToVram(WIN_MOVE_INFO, COPYWIN_GFX); @@ -1633,7 +1633,7 @@ static u8 CreateDiscSprite(u16 itemId) { tmIdx = itemId - ITEM_TM01; SetDiscSpriteAnim(&gSprites[spriteId], tmIdx); - TintDiscpriteByType(gBattleMoves[ItemIdToBattleMoveId(itemId)].type); + TintDiscpriteByType(gMovesInfo[ItemIdToBattleMoveId(itemId)].type); SetDiscSpritePosition(&gSprites[spriteId], tmIdx); return spriteId; } @@ -1700,7 +1700,7 @@ static void SpriteCB_SwapDisc(struct Sprite *sprite) if (sprite->sItemId != ITEM_NONE) { sprite->sState++; - TintDiscpriteByType(gBattleMoves[ItemIdToBattleMoveId(sprite->sItemId)].type); + TintDiscpriteByType(gMovesInfo[ItemIdToBattleMoveId(sprite->sItemId)].type); sprite->sItemId -= ITEM_TM01; SetDiscSpriteAnim(sprite, sprite->sItemId); SetDiscSpritePosition(sprite, sprite->sItemId);