From b11741855dbbf1d1589d0eb68abbfa887e72b260 Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:19:01 +0100 Subject: [PATCH] Add enum for battle script opcodes (#2222) --- asm/macros/battle_script.inc | 500 ++++++++++----------- include/constants/battle_script_commands.h | 253 +++++++++++ src/battle_script_commands.c | 498 ++++++++++---------- 3 files changed, 752 insertions(+), 499 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 7209310fca..5b82e79196 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1,168 +1,168 @@ @ commands .macro attackcanceler - .byte 0x0 + .byte B_SCR_OP_ATTACKCANCELER .endm .macro accuracycheck failPtr:req, move:req - .byte 0x1 + .byte B_SCR_OP_ACCURACYCHECK .4byte \failPtr .2byte \move .endm .macro attackstring - .byte 0x2 + .byte B_SCR_OP_ATTACKSTRING .endm .macro ppreduce - .byte 0x3 + .byte B_SCR_OP_PPREDUCE .endm .macro critcalc - .byte 0x4 + .byte B_SCR_OP_CRITCALC .endm .macro damagecalc - .byte 0x5 + .byte B_SCR_OP_DAMAGECALC .endm .macro typecalc - .byte 0x6 + .byte B_SCR_OP_TYPECALC .endm .macro adjustnormaldamage - .byte 0x7 + .byte B_SCR_OP_ADJUSTNORMALDAMAGE .endm .macro adjustnormaldamage2 - .byte 0x8 + .byte B_SCR_OP_ADJUSTNORMALDAMAGE2 .endm .macro attackanimation - .byte 0x9 + .byte B_SCR_OP_ATTACKANIMATION .endm .macro waitanimation - .byte 0xa + .byte B_SCR_OP_WAITANIMATION .endm .macro healthbarupdate battler:req - .byte 0xb + .byte B_SCR_OP_HEALTHBARUPDATE .byte \battler .endm .macro datahpupdate battler:req - .byte 0xc + .byte B_SCR_OP_DATAHPUPDATE .byte \battler .endm .macro critmessage - .byte 0xd + .byte B_SCR_OP_CRITMESSAGE .endm .macro effectivenesssound - .byte 0xe + .byte B_SCR_OP_EFFECTIVENESSSOUND .endm .macro resultmessage - .byte 0xf + .byte B_SCR_OP_RESULTMESSAGE .endm .macro printstring id:req - .byte 0x10 + .byte B_SCR_OP_PRINTSTRING .2byte \id .endm .macro printselectionstring id:req - .byte 0x11 + .byte B_SCR_OP_PRINTSELECTIONSTRING .2byte \id .endm .macro waitmessage time:req - .byte 0x12 + .byte B_SCR_OP_WAITMESSAGE .2byte \time .endm .macro printfromtable ptr:req - .byte 0x13 + .byte B_SCR_OP_PRINTFROMTABLE .4byte \ptr .endm .macro printselectionstringfromtable ptr:req - .byte 0x14 + .byte B_SCR_OP_PRINTSELECTIONSTRINGFROMTABLE .4byte \ptr .endm .macro seteffectwithchance - .byte 0x15 + .byte B_SCR_OP_SETEFFECTWITHCHANCE .endm .macro seteffectprimary - .byte 0x16 + .byte B_SCR_OP_SETEFFECTPRIMARY .endm .macro seteffectsecondary - .byte 0x17 + .byte B_SCR_OP_SETEFFECTSECONDARY .endm .macro clearstatusfromeffect battler:req - .byte 0x18 + .byte B_SCR_OP_CLEARSTATUSFROMEFFECT .byte \battler .endm .macro tryfaintmon battler:req - .byte 0x19 + .byte B_SCR_OP_TRYFAINTMON .byte \battler .byte FALSE .4byte NULL .endm .macro tryfaintmon_spikes battler:req, ptr:req - .byte 0x19 + .byte B_SCR_OP_TRYFAINTMON .byte \battler .byte TRUE .4byte \ptr .endm .macro dofaintanimation battler:req - .byte 0x1a + .byte B_SCR_OP_DOFAINTANIMATION .byte \battler .endm .macro cleareffectsonfaint battler:req - .byte 0x1b + .byte B_SCR_OP_CLEAREFFECTSONFAINT .byte \battler .endm .macro jumpifstatus battler:req, status1:req, ptr:req - .byte 0x1c + .byte B_SCR_OP_JUMPIFSTATUS .byte \battler .4byte \status1 .4byte \ptr .endm .macro jumpifstatus2 battler:req, status2:req, ptr:req - .byte 0x1d + .byte B_SCR_OP_JUMPIFSTATUS2 .byte \battler .4byte \status2 .4byte \ptr .endm .macro jumpifability battler:req, ability:req, ptr:req - .byte 0x1e + .byte B_SCR_OP_JUMPIFABILITY .byte \battler .byte \ability .4byte \ptr .endm .macro jumpifsideaffecting battler:req, sidestatus:req, ptr:req - .byte 0x1f + .byte B_SCR_OP_JUMPIFSIDEAFFECTING .byte \battler .2byte \sidestatus .4byte \ptr .endm .macro jumpifstat battler:req, ifflag:req, stat:req, value:req, ptr - .byte 0x20 + .byte B_SCR_OP_JUMPIFSTAT .byte \battler .byte \ifflag .byte \stat @@ -171,7 +171,7 @@ .endm .macro jumpifstatus3condition battler:req, status3:req, condition:req, ptr:req - .byte 0x21 + .byte B_SCR_OP_JUMPIFSTATUS3CONDITION .byte \battler .4byte \status3 .byte \condition @@ -179,43 +179,43 @@ .endm .macro jumpiftype battler:req, type:req, ptr:req - .byte 0x22 + .byte B_SCR_OP_JUMPIFTYPE .byte \battler .byte \type .4byte \ptr .endm .macro getexp battler:req - .byte 0x23 + .byte B_SCR_OP_GETEXP .byte \battler .endm .macro checkteamslost ptr:req - .byte 0x24 + .byte B_SCR_OP_CHECKTEAMSLOST .4byte \ptr .endm .macro movevaluescleanup - .byte 0x25 + .byte B_SCR_OP_MOVEVALUESCLEANUP .endm .macro setmultihit value:req - .byte 0x26 + .byte B_SCR_OP_SETMULTIHIT .byte \value .endm .macro decrementmultihit value:req - .byte 0x27 + .byte B_SCR_OP_DECREMENTMULTIHIT .4byte \value .endm .macro goto ptr:req - .byte 0x28 + .byte B_SCR_OP_GOTO .4byte \ptr .endm .macro jumpifbyte ifflag:req, val:req, byte:req, ptr:req - .byte 0x29 + .byte B_SCR_OP_JUMPIFBYTE .byte \ifflag .4byte \val .byte \byte @@ -223,7 +223,7 @@ .endm .macro jumpifhalfword ifflag:req, val:req, hword:req, ptr:req - .byte 0x2a + .byte B_SCR_OP_JUMPIFHALFWORD .byte \ifflag .4byte \val .2byte \hword @@ -231,7 +231,7 @@ .endm .macro jumpifword ifflag:req, val:req, word:req, ptr:req - .byte 0x2b + .byte B_SCR_OP_JUMPIFWORD .byte \ifflag .4byte \val .4byte \word @@ -239,7 +239,7 @@ .endm .macro jumpifarrayequal val1:req, val2:req, size:req, ptr:req - .byte 0x2c + .byte B_SCR_OP_JUMPIFARRAYEQUAL .4byte \val1 .4byte \val2 .byte \size @@ -247,7 +247,7 @@ .endm .macro jumpifarraynotequal val1:req, val2:req, size:req, ptr:req - .byte 0x2d + .byte B_SCR_OP_JUMPIFARRAYNOTEQUAL .4byte \val1 .4byte \val2 .byte \size @@ -255,32 +255,32 @@ .endm .macro setbyte ptr:req, byte:req - .byte 0x2e + .byte B_SCR_OP_SETBYTE .4byte \ptr .byte \byte .endm .macro addbyte ptr:req, byte:req - .byte 0x2f + .byte B_SCR_OP_ADDBYTE .4byte \ptr .byte \byte .endm .macro subbyte ptr:req, byte:req - .byte 0x30 + .byte B_SCR_OP_SUBBYTE .4byte \ptr .byte \byte .endm .macro copyarray dest:req, src:req, size:req - .byte 0x31 + .byte B_SCR_OP_COPYARRAY .4byte \dest .4byte \src .byte \size .endm .macro copyarraywithindex dest:req, src:req, index:req, size:req - .byte 0x32 + .byte B_SCR_OP_COPYARRAYWITHINDEX .4byte \dest .4byte \src .4byte \index @@ -288,125 +288,125 @@ .endm .macro orbyte ptr:req, byte:req - .byte 0x33 + .byte B_SCR_OP_ORBYTE .4byte \ptr .byte \byte .endm .macro orhalfword ptr:req, hword:req - .byte 0x34 + .byte B_SCR_OP_ORHALFWORD .4byte \ptr .2byte \hword .endm .macro orword ptr:req, word:req - .byte 0x35 + .byte B_SCR_OP_ORWORD .4byte \ptr .4byte \word .endm .macro bicbyte ptr:req, byte:req - .byte 0x36 + .byte B_SCR_OP_BICBYTE .4byte \ptr .byte \byte .endm .macro bichalfword ptr:req, hword:req - .byte 0x37 + .byte B_SCR_OP_BICHALFWORD .4byte \ptr .2byte \hword .endm .macro bicword ptr:req, word:req - .byte 0x38 + .byte B_SCR_OP_BICWORD .4byte \ptr .4byte \word .endm .macro pause time:req - .byte 0x39 + .byte B_SCR_OP_PAUSE .2byte \time .endm .macro waitstate - .byte 0x3a + .byte B_SCR_OP_WAITSTATE .endm .macro healthbar_update battler:req - .byte 0x3b + .byte B_SCR_OP_HEALTHBAR_UPDATE .byte \battler .endm .macro return - .byte 0x3c + .byte B_SCR_OP_RETURN .endm .macro end - .byte 0x3d + .byte B_SCR_OP_END .endm .macro end2 - .byte 0x3e + .byte B_SCR_OP_END2 .endm .macro end3 - .byte 0x3f + .byte B_SCR_OP_END3 .endm .macro jumpifaffectedbyprotect ptr:req - .byte 0x40 + .byte B_SCR_OP_JUMPIFAFFECTEDBYPROTECT .4byte \ptr .endm .macro call ptr:req - .byte 0x41 + .byte B_SCR_OP_CALL .4byte \ptr .endm .macro jumpiftype2 battler:req, type:req, ptr:req - .byte 0x42 + .byte B_SCR_OP_JUMPIFTYPE2 .byte \battler .byte \type .4byte \ptr .endm .macro jumpifabilitypresent ability:req, ptr:req - .byte 0x43 + .byte B_SCR_OP_JUMPIFABILITYPRESENT .byte \ability .4byte \ptr .endm .macro endselectionscript - .byte 0x44 + .byte B_SCR_OP_ENDSELECTIONSCRIPT .endm .macro playanimation battler:req, animType:req, arg=NULL - .byte 0x45 + .byte B_SCR_OP_PLAYANIMATION .byte \battler .byte \animType .4byte \arg .endm .macro playanimation_var battler:req, animType:req, arg=NULL - .byte 0x46 + .byte B_SCR_OP_PLAYANIMATION_VAR .byte \battler .4byte \animType .4byte \arg .endm .macro setgraphicalstatchangevalues - .byte 0x47 + .byte B_SCR_OP_SETGRAPHICALSTATCHANGEVALUES .endm .macro playstatchangeanimation battler:req, stats:req, statchange:req - .byte 0x48 + .byte B_SCR_OP_PLAYSTATCHANGEANIMATION .byte \battler .byte \stats .byte \statchange .endm .macro moveend endMode:req, endState:req - .byte 0x49 + .byte B_SCR_OP_MOVEEND .byte \endMode .byte \endState .endm @@ -444,812 +444,812 @@ .endm .macro typecalc2 - .byte 0x4a + .byte B_SCR_OP_TYPECALC2 .endm .macro returnatktoball - .byte 0x4b + .byte B_SCR_OP_RETURNATKTOBALL .endm .macro getswitchedmondata battler:req - .byte 0x4c + .byte B_SCR_OP_GETSWITCHEDMONDATA .byte \battler .endm .macro switchindataupdate battler:req - .byte 0x4d + .byte B_SCR_OP_SWITCHINDATAUPDATE .byte \battler .endm .macro switchinanim battler:req, dontclearsubstitutebit:req - .byte 0x4e + .byte B_SCR_OP_SWITCHINANIM .byte \battler .byte \dontclearsubstitutebit .endm .macro jumpifcantswitch battler:req, ptr:req - .byte 0x4f + .byte B_SCR_OP_JUMPIFCANTSWITCH .byte \battler .4byte \ptr .endm .macro openpartyscreen battler:req, ptr:req - .byte 0x50 + .byte B_SCR_OP_OPENPARTYSCREEN .byte \battler .4byte \ptr .endm .macro switchhandleorder battler:req, state:req - .byte 0x51 + .byte B_SCR_OP_SWITCHHANDLEORDER .byte \battler .byte \state .endm .macro switchineffects battler:req - .byte 0x52 + .byte B_SCR_OP_SWITCHINEFFECTS .byte \battler .endm .macro trainerslidein battler:req - .byte 0x53 + .byte B_SCR_OP_TRAINERSLIDEIN .byte \battler .endm .macro playse song:req - .byte 0x54 + .byte B_SCR_OP_PLAYSE .2byte \song .endm .macro fanfare song:req - .byte 0x55 + .byte B_SCR_OP_FANFARE .2byte \song .endm .macro playfaintcry battler:req - .byte 0x56 + .byte B_SCR_OP_PLAYFAINTCRY .byte \battler .endm .macro endlinkbattle - .byte 0x57 + .byte B_SCR_OP_ENDLINKBATTLE .endm .macro returntoball battler:req - .byte 0x58 + .byte B_SCR_OP_RETURNTOBALL .byte \battler .endm .macro handlelearnnewmove learnedMovePtr:req, nothingToLearnPtr:req, isFirstMove:req - .byte 0x59 + .byte B_SCR_OP_HANDLELEARNNEWMOVE .4byte \learnedMovePtr .4byte \nothingToLearnPtr .byte \isFirstMove .endm .macro yesnoboxlearnmove forgotMovePtr:req - .byte 0x5a + .byte B_SCR_OP_YESNOBOXLEARNMOVE .4byte \forgotMovePtr .endm .macro yesnoboxstoplearningmove noPtr:req - .byte 0x5b + .byte B_SCR_OP_YESNOBOXSTOPLEARNINGMOVE .4byte \noPtr .endm .macro hitanimation battler:req - .byte 0x5c + .byte B_SCR_OP_HITANIMATION .byte \battler .endm .macro getmoneyreward - .byte 0x5d + .byte B_SCR_OP_GETMONEYREWARD .endm .macro updatebattlermoves battler:req - .byte 0x5e + .byte B_SCR_OP_UPDATEBATTLERMOVES .byte \battler .endm .macro swapattackerwithtarget - .byte 0x5f + .byte B_SCR_OP_SWAPATTACKERWITHTARGET .endm .macro incrementgamestat stat:req - .byte 0x60 + .byte B_SCR_OP_INCREMENTGAMESTAT .byte \stat .endm .macro drawpartystatussummary battler:req - .byte 0x61 + .byte B_SCR_OP_DRAWPARTYSTATUSSUMMARY .byte \battler .endm .macro hidepartystatussummary battler:req - .byte 0x62 + .byte B_SCR_OP_HIDEPARTYSTATUSSUMMARY .byte \battler .endm .macro jumptocalledmove notChosenMove:req - .byte 0x63 + .byte B_SCR_OP_JUMPTOCALLEDMOVE .byte \notChosenMove .endm .macro statusanimation battler:req - .byte 0x64 + .byte B_SCR_OP_STATUSANIMATION .byte \battler .endm .macro status2animation battler:req, status2:req - .byte 0x65 + .byte B_SCR_OP_STATUS2ANIMATION .byte \battler .4byte \status2 .endm .macro chosenstatusanimation battler:req, isStatus2:req, status:req - .byte 0x66 + .byte B_SCR_OP_CHOSENSTATUSANIMATION .byte \battler .byte \isStatus2 .4byte \status .endm .macro yesnobox - .byte 0x67 + .byte B_SCR_OP_YESNOBOX .endm .macro cancelallactions - .byte 0x68 + .byte B_SCR_OP_CANCELALLACTIONS .endm .macro adjustsetdamage - .byte 0x69 + .byte B_SCR_OP_ADJUSTSETDAMAGE .endm .macro removeitem battler:req - .byte 0x6a + .byte B_SCR_OP_REMOVEITEM .byte \battler .endm .macro atknameinbuff1 - .byte 0x6b + .byte B_SCR_OP_ATKNAMEINBUFF1 .endm .macro drawlvlupbox - .byte 0x6c + .byte B_SCR_OP_DRAWLVLUPBOX .endm .macro resetsentmonsvalue - .byte 0x6d + .byte B_SCR_OP_RESETSENTMONSVALUE .endm .macro setatktoplayer0 - .byte 0x6e + .byte B_SCR_OP_SETATKTOPLAYER0 .endm .macro makevisible battler:req - .byte 0x6f + .byte B_SCR_OP_MAKEVISIBLE .byte \battler .endm .macro recordlastability battler:req - .byte 0x70 + .byte B_SCR_OP_RECORDLASTABILITY .byte \battler .endm .macro buffermovetolearn - .byte 0x71 + .byte B_SCR_OP_BUFFERMOVETOLEARN .endm .macro jumpifplayerran ptr:req - .byte 0x72 + .byte B_SCR_OP_JUMPIFPLAYERRAN .4byte \ptr .endm .macro hpthresholds battler:req - .byte 0x73 + .byte B_SCR_OP_HPTHRESHOLDS .byte \battler .endm .macro hpthresholds2 battler:req - .byte 0x74 + .byte B_SCR_OP_HPTHRESHOLDS2 .byte \battler .endm .macro useitemonopponent - .byte 0x75 + .byte B_SCR_OP_USEITEMONOPPONENT .endm .macro various battler:req, id:req - .byte 0x76 + .byte B_SCR_OP_VARIOUS .byte \battler .byte \id .endm .macro setprotectlike - .byte 0x77 + .byte B_SCR_OP_SETPROTECTLIKE .endm .macro tryexplosion - .byte 0x78 + .byte B_SCR_OP_TRYEXPLOSION .endm .macro setatkhptozero - .byte 0x79 + .byte B_SCR_OP_SETATKHPTOZERO .endm .macro jumpifnexttargetvalid ptr:req - .byte 0x7a + .byte B_SCR_OP_JUMPIFNEXTTARGETVALID .4byte \ptr .endm .macro tryhealhalfhealth ptr:req, battler:req - .byte 0x7b + .byte B_SCR_OP_TRYHEALHALFHEALTH .4byte \ptr .byte \battler .endm .macro trymirrormove - .byte 0x7c + .byte B_SCR_OP_TRYMIRRORMOVE .endm .macro setrain - .byte 0x7d + .byte B_SCR_OP_SETRAIN .endm .macro setreflect - .byte 0x7e + .byte B_SCR_OP_SETREFLECT .endm .macro setseeded - .byte 0x7f + .byte B_SCR_OP_SETSEEDED .endm .macro manipulatedamage mode:req - .byte 0x80 + .byte B_SCR_OP_MANIPULATEDAMAGE .byte \mode .endm .macro trysetrest ptr:req - .byte 0x81 + .byte B_SCR_OP_TRYSETREST .4byte \ptr .endm .macro jumpifnotfirstturn ptr:req - .byte 0x82 + .byte B_SCR_OP_JUMPIFNOTFIRSTTURN .4byte \ptr .endm .macro nop - .byte 0x83 + .byte B_SCR_OP_NOP .endm .macro jumpifcantmakeasleep ptr:req - .byte 0x84 + .byte B_SCR_OP_JUMPIFCANTMAKEASLEEP .4byte \ptr .endm .macro stockpile - .byte 0x85 + .byte B_SCR_OP_STOCKPILE .endm .macro stockpiletobasedamage ptr:req - .byte 0x86 + .byte B_SCR_OP_STOCKPILETOBASEDAMAGE .4byte \ptr .endm .macro stockpiletohpheal ptr:req - .byte 0x87 + .byte B_SCR_OP_STOCKPILETOHPHEAL .4byte \ptr .endm .macro negativedamage - .byte 0x88 + .byte B_SCR_OP_NEGATIVEDAMAGE .endm .macro statbuffchange flags:req, jumpptr:req - .byte 0x89 + .byte B_SCR_OP_STATBUFFCHANGE .byte \flags .4byte \jumpptr .endm .macro normalisebuffs - .byte 0x8a + .byte B_SCR_OP_NORMALISEBUFFS .endm .macro setbide - .byte 0x8b + .byte B_SCR_OP_SETBIDE .endm .macro confuseifrepeatingattackends - .byte 0x8c + .byte B_SCR_OP_CONFUSEIFREPEATINGATTACKENDS .endm .macro setmultihitcounter val:req - .byte 0x8d + .byte B_SCR_OP_SETMULTIHITCOUNTER .byte \val .endm .macro initmultihitstring - .byte 0x8e + .byte B_SCR_OP_INITMULTIHITSTRING .endm .macro forcerandomswitch ptr:req - .byte 0x8f + .byte B_SCR_OP_FORCERANDOMSWITCH .4byte \ptr .endm .macro tryconversiontypechange ptr:req - .byte 0x90 + .byte B_SCR_OP_TRYCONVERSIONTYPECHANGE .4byte \ptr .endm .macro givepaydaymoney - .byte 0x91 + .byte B_SCR_OP_GIVEPAYDAYMONEY .endm .macro setlightscreen - .byte 0x92 + .byte B_SCR_OP_SETLIGHTSCREEN .endm .macro tryKO ptr:req - .byte 0x93 + .byte B_SCR_OP_TRYKO .4byte \ptr .endm .macro damagetohalftargethp - .byte 0x94 + .byte B_SCR_OP_DAMAGETOHALFTARGETHP .endm .macro setsandstorm - .byte 0x95 + .byte B_SCR_OP_SETSANDSTORM .endm .macro weatherdamage - .byte 0x96 + .byte B_SCR_OP_WEATHERDAMAGE .endm .macro tryinfatuating ptr:req - .byte 0x97 + .byte B_SCR_OP_TRYINFATUATING .4byte \ptr .endm .macro updatestatusicon battler:req - .byte 0x98 + .byte B_SCR_OP_UPDATESTATUSICON .byte \battler .endm .macro setmist - .byte 0x99 + .byte B_SCR_OP_SETMIST .endm .macro setfocusenergy - .byte 0x9a + .byte B_SCR_OP_SETFOCUSENERGY .endm .macro transformdataexecution - .byte 0x9b + .byte B_SCR_OP_TRANSFORMDATAEXECUTION .endm .macro setsubstitute - .byte 0x9c + .byte B_SCR_OP_SETSUBSTITUTE .endm .macro mimicattackcopy ptr:req - .byte 0x9d + .byte B_SCR_OP_MIMICATTACKCOPY .4byte \ptr .endm .macro metronome - .byte 0x9e + .byte B_SCR_OP_METRONOME .endm .macro dmgtolevel - .byte 0x9f + .byte B_SCR_OP_DMGTOLEVEL .endm .macro psywavedamageeffect - .byte 0xa0 + .byte B_SCR_OP_PSYWAVEDAMAGEEFFECT .endm .macro counterdamagecalculator ptr:req - .byte 0xa1 + .byte B_SCR_OP_COUNTERDAMAGECALCULATOR .4byte \ptr .endm .macro mirrorcoatdamagecalculator ptr:req - .byte 0xa2 + .byte B_SCR_OP_MIRRORCOATDAMAGECALCULATOR .4byte \ptr .endm .macro disablelastusedattack ptr:req - .byte 0xa3 + .byte B_SCR_OP_DISABLELASTUSEDATTACK .4byte \ptr .endm .macro trysetencore ptr:req - .byte 0xa4 + .byte B_SCR_OP_TRYSETENCORE .4byte \ptr .endm .macro painsplitdmgcalc ptr:req - .byte 0xa5 + .byte B_SCR_OP_PAINSPLITDMGCALC .4byte \ptr .endm .macro settypetorandomresistance ptr:req - .byte 0xa6 + .byte B_SCR_OP_SETTYPETORANDOMRESISTANCE .4byte \ptr .endm .macro setalwayshitflag - .byte 0xa7 + .byte B_SCR_OP_SETALWAYSHITFLAG .endm .macro copymovepermanently ptr:req - .byte 0xa8 + .byte B_SCR_OP_COPYMOVEPERMANENTLY .4byte \ptr .endm .macro trychoosesleeptalkmove ptr:req - .byte 0xa9 + .byte B_SCR_OP_TRYCHOOSESLEEPTALKMOVE .4byte \ptr .endm .macro setdestinybond - .byte 0xaa + .byte B_SCR_OP_SETDESTINYBOND .endm .macro trysetdestinybondtohappen - .byte 0xab + .byte B_SCR_OP_TRYSETDESTINYBONDTOHAPPEN .endm .macro remaininghptopower - .byte 0xac + .byte B_SCR_OP_REMAININGHPTOPOWER .endm .macro tryspiteppreduce ptr:req - .byte 0xad + .byte B_SCR_OP_TRYSPITEPPREDUCE .4byte \ptr .endm .macro healpartystatus - .byte 0xae + .byte B_SCR_OP_HEALPARTYSTATUS .endm .macro cursetarget ptr:req - .byte 0xaf + .byte B_SCR_OP_CURSETARGET .4byte \ptr .endm .macro trysetspikes ptr:req - .byte 0xb0 + .byte B_SCR_OP_TRYSETSPIKES .4byte \ptr .endm .macro setforesight - .byte 0xb1 + .byte B_SCR_OP_SETFORESIGHT .endm .macro trysetperishsong ptr:req - .byte 0xb2 + .byte B_SCR_OP_TRYSETPERISHSONG .4byte \ptr .endm .macro rolloutdamagecalculation - .byte 0xb3 + .byte B_SCR_OP_ROLLOUTDAMAGECALCULATION .endm .macro jumpifconfusedandstatmaxed stat:req, ptr:req - .byte 0xb4 + .byte B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED .byte \stat .4byte \ptr .endm .macro furycuttercalc - .byte 0xb5 + .byte B_SCR_OP_FURYCUTTERCALC .endm .macro friendshiptodamagecalculation - .byte 0xb6 + .byte B_SCR_OP_FRIENDSHIPTODAMAGECALCULATION .endm .macro presentdamagecalculation - .byte 0xb7 + .byte B_SCR_OP_PRESENTDAMAGECALCULATION .endm .macro setsafeguard - .byte 0xb8 + .byte B_SCR_OP_SETSAFEGUARD .endm .macro magnitudedamagecalculation - .byte 0xb9 + .byte B_SCR_OP_MAGNITUDEDAMAGECALCULATION .endm .macro jumpifnopursuitswitchdmg ptr:req - .byte 0xba + .byte B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG .4byte \ptr .endm .macro setsunny - .byte 0xbb + .byte B_SCR_OP_SETSUNNY .endm .macro maxattackhalvehp ptr:req - .byte 0xbc + .byte B_SCR_OP_MAXATTACKHALVEHP .4byte \ptr .endm .macro copyfoestats ptr:req - .byte 0xbd + .byte B_SCR_OP_COPYFOESTATS .4byte \ptr .endm .macro rapidspinfree - .byte 0xbe + .byte B_SCR_OP_RAPIDSPINFREE .endm .macro setdefensecurlbit - .byte 0xbf + .byte B_SCR_OP_SETDEFENSECURLBIT .endm .macro recoverbasedonsunlight ptr:req - .byte 0xc0 + .byte B_SCR_OP_RECOVERBASEDONSUNLIGHT .4byte \ptr .endm .macro hiddenpowercalc - .byte 0xc1 + .byte B_SCR_OP_HIDDENPOWERCALC .endm .macro selectfirstvalidtarget - .byte 0xc2 + .byte B_SCR_OP_SELECTFIRSTVALIDTARGET .endm .macro trysetfutureattack ptr:req - .byte 0xc3 + .byte B_SCR_OP_TRYSETFUTUREATTACK .4byte \ptr .endm .macro trydobeatup endPtr:req, failPtr:req - .byte 0xc4 + .byte B_SCR_OP_TRYDOBEATUP .4byte \endPtr .4byte \failPtr .endm .macro setsemiinvulnerablebit - .byte 0xc5 + .byte B_SCR_OP_SETSEMIINVULNERABLEBIT .endm .macro clearsemiinvulnerablebit - .byte 0xc6 + .byte B_SCR_OP_CLEARSEMIINVULNERABLEBIT .endm .macro setminimize - .byte 0xc7 + .byte B_SCR_OP_SETMINIMIZE .endm .macro sethail - .byte 0xc8 + .byte B_SCR_OP_SETHAIL .endm .macro trymemento ptr:req - .byte 0xc9 + .byte B_SCR_OP_TRYMEMENTO .4byte \ptr .endm .macro setforcedtarget - .byte 0xca + .byte B_SCR_OP_SETFORCEDTARGET .endm .macro setcharge - .byte 0xcb + .byte B_SCR_OP_SETCHARGE .endm .macro callenvironmentattack - .byte 0xcc + .byte B_SCR_OP_CALLENVIRONMENTATTACK .endm .macro cureifburnedparalyzedorpoisoned ptr:req - .byte 0xcd + .byte B_SCR_OP_CUREIFBURNEDPARALYZEDORPOISONED .4byte \ptr .endm .macro settorment ptr:req - .byte 0xce + .byte B_SCR_OP_SETTORMENT .4byte \ptr .endm .macro jumpifnodamage ptr:req - .byte 0xcf + .byte B_SCR_OP_JUMPIFNODAMAGE .4byte \ptr .endm .macro settaunt ptr:req - .byte 0xd0 + .byte B_SCR_OP_SETTAUNT .4byte \ptr .endm .macro trysethelpinghand ptr:req - .byte 0xd1 + .byte B_SCR_OP_TRYSETHELPINGHAND .4byte \ptr .endm .macro tryswapitems ptr:req - .byte 0xd2 + .byte B_SCR_OP_TRYSWAPITEMS .4byte \ptr .endm .macro trycopyability ptr:req - .byte 0xd3 + .byte B_SCR_OP_TRYCOPYABILITY .4byte \ptr .endm .macro trywish turnNumber:req, ptr:req - .byte 0xd4 + .byte B_SCR_OP_TRYWISH .byte \turnNumber .4byte \ptr .endm .macro trysetroots ptr:req - .byte 0xd5 + .byte B_SCR_OP_TRYSETROOTS .4byte \ptr .endm .macro doubledamagedealtifdamaged - .byte 0xd6 + .byte B_SCR_OP_DOUBLEDAMAGEDEALTIFDAMAGED .endm .macro setyawn ptr:req - .byte 0xd7 + .byte B_SCR_OP_SETYAWN .4byte \ptr .endm .macro setdamagetohealthdifference ptr:req - .byte 0xd8 + .byte B_SCR_OP_SETDAMAGETOHEALTHDIFFERENCE .4byte \ptr .endm .macro scaledamagebyhealthratio - .byte 0xd9 + .byte B_SCR_OP_SCALEDAMAGEBYHEALTHRATIO .endm .macro tryswapabilities ptr:req - .byte 0xda + .byte B_SCR_OP_TRYSWAPABILITIES .4byte \ptr .endm .macro tryimprison ptr:req - .byte 0xdb + .byte B_SCR_OP_TRYIMPRISON .4byte \ptr .endm .macro trysetgrudge ptr:req - .byte 0xdc + .byte B_SCR_OP_TRYSETGRUDGE .4byte \ptr .endm .macro weightdamagecalculation - .byte 0xdd + .byte B_SCR_OP_WEIGHTDAMAGECALCULATION .endm .macro assistattackselect ptr:req - .byte 0xde + .byte B_SCR_OP_ASSISTATTACKSELECT .4byte \ptr .endm .macro trysetmagiccoat ptr:req - .byte 0xdf + .byte B_SCR_OP_TRYSETMAGICCOAT .4byte \ptr .endm .macro trysetsnatch ptr:req - .byte 0xe0 + .byte B_SCR_OP_TRYSETSNATCH .4byte \ptr .endm .macro trygetintimidatetarget ptr:req - .byte 0xe1 + .byte B_SCR_OP_TRYGETINTIMIDATETARGET .4byte \ptr .endm .macro switchoutabilities battler:req - .byte 0xe2 + .byte B_SCR_OP_SWITCHOUTABILITIES .byte \battler .endm .macro jumpifhasnohp battler:req, ptr:req - .byte 0xe3 + .byte B_SCR_OP_JUMPIFHASNOHP .byte \battler .4byte \ptr .endm .macro getsecretpowereffect - .byte 0xe4 + .byte B_SCR_OP_GETSECRETPOWEREFFECT .endm .macro pickup - .byte 0xe5 + .byte B_SCR_OP_PICKUP .endm .macro docastformchangeanimation - .byte 0xe6 + .byte B_SCR_OP_DOCASTFORMCHANGEANIMATION .endm .macro trycastformdatachange - .byte 0xe7 + .byte B_SCR_OP_TRYCASTFORMDATACHANGE .endm .macro settypebasedhalvers ptr:req - .byte 0xe8 + .byte B_SCR_OP_SETTYPEBASEDHALVERS .4byte \ptr .endm .macro setweatherballtype - .byte 0xe9 + .byte B_SCR_OP_SETWEATHERBALLTYPE .endm .macro tryrecycleitem ptr:req - .byte 0xea + .byte B_SCR_OP_TRYRECYCLEITEM .4byte \ptr .endm .macro settypetoenvironment ptr:req - .byte 0xeb + .byte B_SCR_OP_SETTYPETOENVIRONMENT .4byte \ptr .endm .macro pursuitdoubles ptr:req - .byte 0xec + .byte B_SCR_OP_PURSUITDOUBLES .4byte \ptr .endm .macro snatchsetbattlers - .byte 0xed + .byte B_SCR_OP_SNATCHSETBATTLERS .endm .macro removelightscreenreflect - .byte 0xee + .byte B_SCR_OP_REMOVELIGHTSCREENREFLECT .endm .macro handleballthrow - .byte 0xef + .byte B_SCR_OP_HANDLEBALLTHROW .endm .macro givecaughtmon - .byte 0xf0 + .byte B_SCR_OP_GIVECAUGHTMON .endm .macro trysetcaughtmondexflags ptr:req - .byte 0xf1 + .byte B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS .4byte \ptr .endm .macro displaydexinfo - .byte 0xf2 + .byte B_SCR_OP_DISPLAYDEXINFO .endm .macro trygivecaughtmonnick ptr:req - .byte 0xf3 + .byte B_SCR_OP_TRYGIVECAUGHTMONNICK .4byte \ptr .endm .macro subattackerhpbydmg - .byte 0xf4 + .byte B_SCR_OP_SUBATTACKERHPBYDMG .endm .macro removeattackerstatus1 - .byte 0xf5 + .byte B_SCR_OP_REMOVEATTACKERSTATUS1 .endm .macro finishaction - .byte 0xf6 + .byte B_SCR_OP_FINISHACTION .endm .macro finishturn - .byte 0xf7 + .byte B_SCR_OP_FINISHTURN .endm .macro trainerslideout position:req - .byte 0xf8 + .byte B_SCR_OP_TRAINERSLIDEOUT .byte \position .endm diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index c21276a4ef..ebdc9c0137 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -1,6 +1,259 @@ #ifndef GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H #define GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H +enum BattleScriptOpcode +{ + B_SCR_OP_ATTACKCANCELER, + B_SCR_OP_ACCURACYCHECK, + B_SCR_OP_ATTACKSTRING, + B_SCR_OP_PPREDUCE, + B_SCR_OP_CRITCALC, + B_SCR_OP_DAMAGECALC, + B_SCR_OP_TYPECALC, + B_SCR_OP_ADJUSTNORMALDAMAGE, + B_SCR_OP_ADJUSTNORMALDAMAGE2, + B_SCR_OP_ATTACKANIMATION, + B_SCR_OP_WAITANIMATION, + B_SCR_OP_HEALTHBARUPDATE, + B_SCR_OP_DATAHPUPDATE, + B_SCR_OP_CRITMESSAGE, + B_SCR_OP_EFFECTIVENESSSOUND, + B_SCR_OP_RESULTMESSAGE, + B_SCR_OP_PRINTSTRING, + B_SCR_OP_PRINTSELECTIONSTRING, + B_SCR_OP_WAITMESSAGE, + B_SCR_OP_PRINTFROMTABLE, + B_SCR_OP_PRINTSELECTIONSTRINGFROMTABLE, + B_SCR_OP_SETEFFECTWITHCHANCE, + B_SCR_OP_SETEFFECTPRIMARY, + B_SCR_OP_SETEFFECTSECONDARY, + B_SCR_OP_CLEARSTATUSFROMEFFECT, + B_SCR_OP_TRYFAINTMON, + B_SCR_OP_DOFAINTANIMATION, + B_SCR_OP_CLEAREFFECTSONFAINT, + B_SCR_OP_JUMPIFSTATUS, + B_SCR_OP_JUMPIFSTATUS2, + B_SCR_OP_JUMPIFABILITY, + B_SCR_OP_JUMPIFSIDEAFFECTING, + B_SCR_OP_JUMPIFSTAT, + B_SCR_OP_JUMPIFSTATUS3CONDITION, + B_SCR_OP_JUMPIFTYPE, + B_SCR_OP_GETEXP, + B_SCR_OP_CHECKTEAMSLOST, + B_SCR_OP_MOVEVALUESCLEANUP, + B_SCR_OP_SETMULTIHIT, + B_SCR_OP_DECREMENTMULTIHIT, + B_SCR_OP_GOTO, + B_SCR_OP_JUMPIFBYTE, + B_SCR_OP_JUMPIFHALFWORD, + B_SCR_OP_JUMPIFWORD, + B_SCR_OP_JUMPIFARRAYEQUAL, + B_SCR_OP_JUMPIFARRAYNOTEQUAL, + B_SCR_OP_SETBYTE, + B_SCR_OP_ADDBYTE, + B_SCR_OP_SUBBYTE, + B_SCR_OP_COPYARRAY, + B_SCR_OP_COPYARRAYWITHINDEX, + B_SCR_OP_ORBYTE, + B_SCR_OP_ORHALFWORD, + B_SCR_OP_ORWORD, + B_SCR_OP_BICBYTE, + B_SCR_OP_BICHALFWORD, + B_SCR_OP_BICWORD, + B_SCR_OP_PAUSE, + B_SCR_OP_WAITSTATE, + B_SCR_OP_HEALTHBAR_UPDATE, + B_SCR_OP_RETURN, + B_SCR_OP_END, + B_SCR_OP_END2, + B_SCR_OP_END3, + B_SCR_OP_JUMPIFAFFECTEDBYPROTECT, + B_SCR_OP_CALL, + B_SCR_OP_JUMPIFTYPE2, + B_SCR_OP_JUMPIFABILITYPRESENT, + B_SCR_OP_ENDSELECTIONSCRIPT, + B_SCR_OP_PLAYANIMATION, + B_SCR_OP_PLAYANIMATION_VAR, + B_SCR_OP_SETGRAPHICALSTATCHANGEVALUES, + B_SCR_OP_PLAYSTATCHANGEANIMATION, + B_SCR_OP_MOVEEND, + B_SCR_OP_TYPECALC2, + B_SCR_OP_RETURNATKTOBALL, + B_SCR_OP_GETSWITCHEDMONDATA, + B_SCR_OP_SWITCHINDATAUPDATE, + B_SCR_OP_SWITCHINANIM, + B_SCR_OP_JUMPIFCANTSWITCH, + B_SCR_OP_OPENPARTYSCREEN, + B_SCR_OP_SWITCHHANDLEORDER, + B_SCR_OP_SWITCHINEFFECTS, + B_SCR_OP_TRAINERSLIDEIN, + B_SCR_OP_PLAYSE, + B_SCR_OP_FANFARE, + B_SCR_OP_PLAYFAINTCRY, + B_SCR_OP_ENDLINKBATTLE, + B_SCR_OP_RETURNTOBALL, + B_SCR_OP_HANDLELEARNNEWMOVE, + B_SCR_OP_YESNOBOXLEARNMOVE, + B_SCR_OP_YESNOBOXSTOPLEARNINGMOVE, + B_SCR_OP_HITANIMATION, + B_SCR_OP_GETMONEYREWARD, + B_SCR_OP_UPDATEBATTLERMOVES, + B_SCR_OP_SWAPATTACKERWITHTARGET, + B_SCR_OP_INCREMENTGAMESTAT, + B_SCR_OP_DRAWPARTYSTATUSSUMMARY, + B_SCR_OP_HIDEPARTYSTATUSSUMMARY, + B_SCR_OP_JUMPTOCALLEDMOVE, + B_SCR_OP_STATUSANIMATION, + B_SCR_OP_STATUS2ANIMATION, + B_SCR_OP_CHOSENSTATUSANIMATION, + B_SCR_OP_YESNOBOX, + B_SCR_OP_CANCELALLACTIONS, + B_SCR_OP_ADJUSTSETDAMAGE, + B_SCR_OP_REMOVEITEM, + B_SCR_OP_ATKNAMEINBUFF1, + B_SCR_OP_DRAWLVLUPBOX, + B_SCR_OP_RESETSENTMONSVALUE, + B_SCR_OP_SETATKTOPLAYER0, + B_SCR_OP_MAKEVISIBLE, + B_SCR_OP_RECORDLASTABILITY, + B_SCR_OP_BUFFERMOVETOLEARN, + B_SCR_OP_JUMPIFPLAYERRAN, + B_SCR_OP_HPTHRESHOLDS, + B_SCR_OP_HPTHRESHOLDS2, + B_SCR_OP_USEITEMONOPPONENT, + B_SCR_OP_VARIOUS, + B_SCR_OP_SETPROTECTLIKE, + B_SCR_OP_TRYEXPLOSION, + B_SCR_OP_SETATKHPTOZERO, + B_SCR_OP_JUMPIFNEXTTARGETVALID, + B_SCR_OP_TRYHEALHALFHEALTH, + B_SCR_OP_TRYMIRRORMOVE, + B_SCR_OP_SETRAIN, + B_SCR_OP_SETREFLECT, + B_SCR_OP_SETSEEDED, + B_SCR_OP_MANIPULATEDAMAGE, + B_SCR_OP_TRYSETREST, + B_SCR_OP_JUMPIFNOTFIRSTTURN, + B_SCR_OP_NOP, + B_SCR_OP_JUMPIFCANTMAKEASLEEP, + B_SCR_OP_STOCKPILE, + B_SCR_OP_STOCKPILETOBASEDAMAGE, + B_SCR_OP_STOCKPILETOHPHEAL, + B_SCR_OP_NEGATIVEDAMAGE, + B_SCR_OP_STATBUFFCHANGE, + B_SCR_OP_NORMALISEBUFFS, + B_SCR_OP_SETBIDE, + B_SCR_OP_CONFUSEIFREPEATINGATTACKENDS, + B_SCR_OP_SETMULTIHITCOUNTER, + B_SCR_OP_INITMULTIHITSTRING, + B_SCR_OP_FORCERANDOMSWITCH, + B_SCR_OP_TRYCONVERSIONTYPECHANGE, + B_SCR_OP_GIVEPAYDAYMONEY, + B_SCR_OP_SETLIGHTSCREEN, + B_SCR_OP_TRYKO, + B_SCR_OP_DAMAGETOHALFTARGETHP, + B_SCR_OP_SETSANDSTORM, + B_SCR_OP_WEATHERDAMAGE, + B_SCR_OP_TRYINFATUATING, + B_SCR_OP_UPDATESTATUSICON, + B_SCR_OP_SETMIST, + B_SCR_OP_SETFOCUSENERGY, + B_SCR_OP_TRANSFORMDATAEXECUTION, + B_SCR_OP_SETSUBSTITUTE, + B_SCR_OP_MIMICATTACKCOPY, + B_SCR_OP_METRONOME, + B_SCR_OP_DMGTOLEVEL, + B_SCR_OP_PSYWAVEDAMAGEEFFECT, + B_SCR_OP_COUNTERDAMAGECALCULATOR, + B_SCR_OP_MIRRORCOATDAMAGECALCULATOR, + B_SCR_OP_DISABLELASTUSEDATTACK, + B_SCR_OP_TRYSETENCORE, + B_SCR_OP_PAINSPLITDMGCALC, + B_SCR_OP_SETTYPETORANDOMRESISTANCE, + B_SCR_OP_SETALWAYSHITFLAG, + B_SCR_OP_COPYMOVEPERMANENTLY, + B_SCR_OP_TRYCHOOSESLEEPTALKMOVE, + B_SCR_OP_SETDESTINYBOND, + B_SCR_OP_TRYSETDESTINYBONDTOHAPPEN, + B_SCR_OP_REMAININGHPTOPOWER, + B_SCR_OP_TRYSPITEPPREDUCE, + B_SCR_OP_HEALPARTYSTATUS, + B_SCR_OP_CURSETARGET, + B_SCR_OP_TRYSETSPIKES, + B_SCR_OP_SETFORESIGHT, + B_SCR_OP_TRYSETPERISHSONG, + B_SCR_OP_ROLLOUTDAMAGECALCULATION, + B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED, + B_SCR_OP_FURYCUTTERCALC, + B_SCR_OP_FRIENDSHIPTODAMAGECALCULATION, + B_SCR_OP_PRESENTDAMAGECALCULATION, + B_SCR_OP_SETSAFEGUARD, + B_SCR_OP_MAGNITUDEDAMAGECALCULATION, + B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG, + B_SCR_OP_SETSUNNY, + B_SCR_OP_MAXATTACKHALVEHP, + B_SCR_OP_COPYFOESTATS, + B_SCR_OP_RAPIDSPINFREE, + B_SCR_OP_SETDEFENSECURLBIT, + B_SCR_OP_RECOVERBASEDONSUNLIGHT, + B_SCR_OP_HIDDENPOWERCALC, + B_SCR_OP_SELECTFIRSTVALIDTARGET, + B_SCR_OP_TRYSETFUTUREATTACK, + B_SCR_OP_TRYDOBEATUP, + B_SCR_OP_SETSEMIINVULNERABLEBIT, + B_SCR_OP_CLEARSEMIINVULNERABLEBIT, + B_SCR_OP_SETMINIMIZE, + B_SCR_OP_SETHAIL, + B_SCR_OP_TRYMEMENTO, + B_SCR_OP_SETFORCEDTARGET, + B_SCR_OP_SETCHARGE, + B_SCR_OP_CALLENVIRONMENTATTACK, + B_SCR_OP_CUREIFBURNEDPARALYZEDORPOISONED, + B_SCR_OP_SETTORMENT, + B_SCR_OP_JUMPIFNODAMAGE, + B_SCR_OP_SETTAUNT, + B_SCR_OP_TRYSETHELPINGHAND, + B_SCR_OP_TRYSWAPITEMS, + B_SCR_OP_TRYCOPYABILITY, + B_SCR_OP_TRYWISH, + B_SCR_OP_TRYSETROOTS, + B_SCR_OP_DOUBLEDAMAGEDEALTIFDAMAGED, + B_SCR_OP_SETYAWN, + B_SCR_OP_SETDAMAGETOHEALTHDIFFERENCE, + B_SCR_OP_SCALEDAMAGEBYHEALTHRATIO, + B_SCR_OP_TRYSWAPABILITIES, + B_SCR_OP_TRYIMPRISON, + B_SCR_OP_TRYSETGRUDGE, + B_SCR_OP_WEIGHTDAMAGECALCULATION, + B_SCR_OP_ASSISTATTACKSELECT, + B_SCR_OP_TRYSETMAGICCOAT, + B_SCR_OP_TRYSETSNATCH, + B_SCR_OP_TRYGETINTIMIDATETARGET, + B_SCR_OP_SWITCHOUTABILITIES, + B_SCR_OP_JUMPIFHASNOHP, + B_SCR_OP_GETSECRETPOWEREFFECT, + B_SCR_OP_PICKUP, + B_SCR_OP_DOCASTFORMCHANGEANIMATION, + B_SCR_OP_TRYCASTFORMDATACHANGE, + B_SCR_OP_SETTYPEBASEDHALVERS, + B_SCR_OP_SETWEATHERBALLTYPE, + B_SCR_OP_TRYRECYCLEITEM, + B_SCR_OP_SETTYPETOENVIRONMENT, + B_SCR_OP_PURSUITDOUBLES, + B_SCR_OP_SNATCHSETBATTLERS, + B_SCR_OP_REMOVELIGHTSCREENREFLECT, + B_SCR_OP_HANDLEBALLTHROW, + B_SCR_OP_GIVECAUGHTMON, + B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS, + B_SCR_OP_DISPLAYDEXINFO, + B_SCR_OP_TRYGIVECAUGHTMONNICK, + B_SCR_OP_SUBATTACKERHPBYDMG, + B_SCR_OP_REMOVEATTACKERSTATUS1, + B_SCR_OP_FINISHACTION, + B_SCR_OP_FINISHTURN, + B_SCR_OP_TRAINERSLIDEOUT, +}; + // 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 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d5013b0239..bcaca27056 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -328,255 +328,255 @@ static void Cmd_trainerslideout(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_callenvironmentattack, //0xCC - Cmd_cureifburnedparalyzedorpoisoned, //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_settypetoenvironment, //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 - Cmd_trainerslideout //0xF8 + [B_SCR_OP_ATTACKCANCELER] = Cmd_attackcanceler, //0x0 + [B_SCR_OP_ACCURACYCHECK] = Cmd_accuracycheck, //0x1 + [B_SCR_OP_ATTACKSTRING] = Cmd_attackstring, //0x2 + [B_SCR_OP_PPREDUCE] = Cmd_ppreduce, //0x3 + [B_SCR_OP_CRITCALC] = Cmd_critcalc, //0x4 + [B_SCR_OP_DAMAGECALC] = Cmd_damagecalc, //0x5 + [B_SCR_OP_TYPECALC] = Cmd_typecalc, //0x6 + [B_SCR_OP_ADJUSTNORMALDAMAGE] = Cmd_adjustnormaldamage, //0x7 + [B_SCR_OP_ADJUSTNORMALDAMAGE2] = Cmd_adjustnormaldamage2, //0x8 + [B_SCR_OP_ATTACKANIMATION] = Cmd_attackanimation, //0x9 + [B_SCR_OP_WAITANIMATION] = Cmd_waitanimation, //0xA + [B_SCR_OP_HEALTHBARUPDATE] = Cmd_healthbarupdate, //0xB + [B_SCR_OP_DATAHPUPDATE] = Cmd_datahpupdate, //0xC + [B_SCR_OP_CRITMESSAGE] = Cmd_critmessage, //0xD + [B_SCR_OP_EFFECTIVENESSSOUND] = Cmd_effectivenesssound, //0xE + [B_SCR_OP_RESULTMESSAGE] = Cmd_resultmessage, //0xF + [B_SCR_OP_PRINTSTRING] = Cmd_printstring, //0x10 + [B_SCR_OP_PRINTSELECTIONSTRING] = Cmd_printselectionstring, //0x11 + [B_SCR_OP_WAITMESSAGE] = Cmd_waitmessage, //0x12 + [B_SCR_OP_PRINTFROMTABLE] = Cmd_printfromtable, //0x13 + [B_SCR_OP_PRINTSELECTIONSTRINGFROMTABLE] = Cmd_printselectionstringfromtable, //0x14 + [B_SCR_OP_SETEFFECTWITHCHANCE] = Cmd_seteffectwithchance, //0x15 + [B_SCR_OP_SETEFFECTPRIMARY] = Cmd_seteffectprimary, //0x16 + [B_SCR_OP_SETEFFECTSECONDARY] = Cmd_seteffectsecondary, //0x17 + [B_SCR_OP_CLEARSTATUSFROMEFFECT] = Cmd_clearstatusfromeffect, //0x18 + [B_SCR_OP_TRYFAINTMON] = Cmd_tryfaintmon, //0x19 + [B_SCR_OP_DOFAINTANIMATION] = Cmd_dofaintanimation, //0x1A + [B_SCR_OP_CLEAREFFECTSONFAINT] = Cmd_cleareffectsonfaint, //0x1B + [B_SCR_OP_JUMPIFSTATUS] = Cmd_jumpifstatus, //0x1C + [B_SCR_OP_JUMPIFSTATUS2] = Cmd_jumpifstatus2, //0x1D + [B_SCR_OP_JUMPIFABILITY] = Cmd_jumpifability, //0x1E + [B_SCR_OP_JUMPIFSIDEAFFECTING] = Cmd_jumpifsideaffecting, //0x1F + [B_SCR_OP_JUMPIFSTAT] = Cmd_jumpifstat, //0x20 + [B_SCR_OP_JUMPIFSTATUS3CONDITION] = Cmd_jumpifstatus3condition, //0x21 + [B_SCR_OP_JUMPIFTYPE] = Cmd_jumpiftype, //0x22 + [B_SCR_OP_GETEXP] = Cmd_getexp, //0x23 + [B_SCR_OP_CHECKTEAMSLOST] = Cmd_checkteamslost, //0x24 + [B_SCR_OP_MOVEVALUESCLEANUP] = Cmd_movevaluescleanup, //0x25 + [B_SCR_OP_SETMULTIHIT] = Cmd_setmultihit, //0x26 + [B_SCR_OP_DECREMENTMULTIHIT] = Cmd_decrementmultihit, //0x27 + [B_SCR_OP_GOTO] = Cmd_goto, //0x28 + [B_SCR_OP_JUMPIFBYTE] = Cmd_jumpifbyte, //0x29 + [B_SCR_OP_JUMPIFHALFWORD] = Cmd_jumpifhalfword, //0x2A + [B_SCR_OP_JUMPIFWORD] = Cmd_jumpifword, //0x2B + [B_SCR_OP_JUMPIFARRAYEQUAL] = Cmd_jumpifarrayequal, //0x2C + [B_SCR_OP_JUMPIFARRAYNOTEQUAL] = Cmd_jumpifarraynotequal, //0x2D + [B_SCR_OP_SETBYTE] = Cmd_setbyte, //0x2E + [B_SCR_OP_ADDBYTE] = Cmd_addbyte, //0x2F + [B_SCR_OP_SUBBYTE] = Cmd_subbyte, //0x30 + [B_SCR_OP_COPYARRAY] = Cmd_copyarray, //0x31 + [B_SCR_OP_COPYARRAYWITHINDEX] = Cmd_copyarraywithindex, //0x32 + [B_SCR_OP_ORBYTE] = Cmd_orbyte, //0x33 + [B_SCR_OP_ORHALFWORD] = Cmd_orhalfword, //0x34 + [B_SCR_OP_ORWORD] = Cmd_orword, //0x35 + [B_SCR_OP_BICBYTE] = Cmd_bicbyte, //0x36 + [B_SCR_OP_BICHALFWORD] = Cmd_bichalfword, //0x37 + [B_SCR_OP_BICWORD] = Cmd_bicword, //0x38 + [B_SCR_OP_PAUSE] = Cmd_pause, //0x39 + [B_SCR_OP_WAITSTATE] = Cmd_waitstate, //0x3A + [B_SCR_OP_HEALTHBAR_UPDATE] = Cmd_healthbar_update, //0x3B + [B_SCR_OP_RETURN] = Cmd_return, //0x3C + [B_SCR_OP_END] = Cmd_end, //0x3D + [B_SCR_OP_END2] = Cmd_end2, //0x3E + [B_SCR_OP_END3] = Cmd_end3, //0x3F + [B_SCR_OP_JUMPIFAFFECTEDBYPROTECT] = Cmd_jumpifaffectedbyprotect, //0x40 + [B_SCR_OP_CALL] = Cmd_call, //0x41 + [B_SCR_OP_JUMPIFTYPE2] = Cmd_jumpiftype2, //0x42 + [B_SCR_OP_JUMPIFABILITYPRESENT] = Cmd_jumpifabilitypresent, //0x43 + [B_SCR_OP_ENDSELECTIONSCRIPT] = Cmd_endselectionscript, //0x44 + [B_SCR_OP_PLAYANIMATION] = Cmd_playanimation, //0x45 + [B_SCR_OP_PLAYANIMATION_VAR] = Cmd_playanimation_var, //0x46 + [B_SCR_OP_SETGRAPHICALSTATCHANGEVALUES] = Cmd_setgraphicalstatchangevalues, //0x47 + [B_SCR_OP_PLAYSTATCHANGEANIMATION] = Cmd_playstatchangeanimation, //0x48 + [B_SCR_OP_MOVEEND] = Cmd_moveend, //0x49 + [B_SCR_OP_TYPECALC2] = Cmd_typecalc2, //0x4A + [B_SCR_OP_RETURNATKTOBALL] = Cmd_returnatktoball, //0x4B + [B_SCR_OP_GETSWITCHEDMONDATA] = Cmd_getswitchedmondata, //0x4C + [B_SCR_OP_SWITCHINDATAUPDATE] = Cmd_switchindataupdate, //0x4D + [B_SCR_OP_SWITCHINANIM] = Cmd_switchinanim, //0x4E + [B_SCR_OP_JUMPIFCANTSWITCH] = Cmd_jumpifcantswitch, //0x4F + [B_SCR_OP_OPENPARTYSCREEN] = Cmd_openpartyscreen, //0x50 + [B_SCR_OP_SWITCHHANDLEORDER] = Cmd_switchhandleorder, //0x51 + [B_SCR_OP_SWITCHINEFFECTS] = Cmd_switchineffects, //0x52 + [B_SCR_OP_TRAINERSLIDEIN] = Cmd_trainerslidein, //0x53 + [B_SCR_OP_PLAYSE] = Cmd_playse, //0x54 + [B_SCR_OP_FANFARE] = Cmd_fanfare, //0x55 + [B_SCR_OP_PLAYFAINTCRY] = Cmd_playfaintcry, //0x56 + [B_SCR_OP_ENDLINKBATTLE] = Cmd_endlinkbattle, //0x57 + [B_SCR_OP_RETURNTOBALL] = Cmd_returntoball, //0x58 + [B_SCR_OP_HANDLELEARNNEWMOVE] = Cmd_handlelearnnewmove, //0x59 + [B_SCR_OP_YESNOBOXLEARNMOVE] = Cmd_yesnoboxlearnmove, //0x5A + [B_SCR_OP_YESNOBOXSTOPLEARNINGMOVE] = Cmd_yesnoboxstoplearningmove, //0x5B + [B_SCR_OP_HITANIMATION] = Cmd_hitanimation, //0x5C + [B_SCR_OP_GETMONEYREWARD] = Cmd_getmoneyreward, //0x5D + [B_SCR_OP_UPDATEBATTLERMOVES] = Cmd_updatebattlermoves, //0x5E + [B_SCR_OP_SWAPATTACKERWITHTARGET] = Cmd_swapattackerwithtarget, //0x5F + [B_SCR_OP_INCREMENTGAMESTAT] = Cmd_incrementgamestat, //0x60 + [B_SCR_OP_DRAWPARTYSTATUSSUMMARY] = Cmd_drawpartystatussummary, //0x61 + [B_SCR_OP_HIDEPARTYSTATUSSUMMARY] = Cmd_hidepartystatussummary, //0x62 + [B_SCR_OP_JUMPTOCALLEDMOVE] = Cmd_jumptocalledmove, //0x63 + [B_SCR_OP_STATUSANIMATION] = Cmd_statusanimation, //0x64 + [B_SCR_OP_STATUS2ANIMATION] = Cmd_status2animation, //0x65 + [B_SCR_OP_CHOSENSTATUSANIMATION] = Cmd_chosenstatusanimation, //0x66 + [B_SCR_OP_YESNOBOX] = Cmd_yesnobox, //0x67 + [B_SCR_OP_CANCELALLACTIONS] = Cmd_cancelallactions, //0x68 + [B_SCR_OP_ADJUSTSETDAMAGE] = Cmd_adjustsetdamage, //0x69 + [B_SCR_OP_REMOVEITEM] = Cmd_removeitem, //0x6A + [B_SCR_OP_ATKNAMEINBUFF1] = Cmd_atknameinbuff1, //0x6B + [B_SCR_OP_DRAWLVLUPBOX] = Cmd_drawlvlupbox, //0x6C + [B_SCR_OP_RESETSENTMONSVALUE] = Cmd_resetsentmonsvalue, //0x6D + [B_SCR_OP_SETATKTOPLAYER0] = Cmd_setatktoplayer0, //0x6E + [B_SCR_OP_MAKEVISIBLE] = Cmd_makevisible, //0x6F + [B_SCR_OP_RECORDLASTABILITY] = Cmd_recordlastability, //0x70 + [B_SCR_OP_BUFFERMOVETOLEARN] = Cmd_buffermovetolearn, //0x71 + [B_SCR_OP_JUMPIFPLAYERRAN] = Cmd_jumpifplayerran, //0x72 + [B_SCR_OP_HPTHRESHOLDS] = Cmd_hpthresholds, //0x73 + [B_SCR_OP_HPTHRESHOLDS2] = Cmd_hpthresholds2, //0x74 + [B_SCR_OP_USEITEMONOPPONENT] = Cmd_useitemonopponent, //0x75 + [B_SCR_OP_VARIOUS] = Cmd_various, //0x76 + [B_SCR_OP_SETPROTECTLIKE] = Cmd_setprotectlike, //0x77 + [B_SCR_OP_TRYEXPLOSION] = Cmd_tryexplosion, //0x78 + [B_SCR_OP_SETATKHPTOZERO] = Cmd_setatkhptozero, //0x79 + [B_SCR_OP_JUMPIFNEXTTARGETVALID] = Cmd_jumpifnexttargetvalid, //0x7A + [B_SCR_OP_TRYHEALHALFHEALTH] = Cmd_tryhealhalfhealth, //0x7B + [B_SCR_OP_TRYMIRRORMOVE] = Cmd_trymirrormove, //0x7C + [B_SCR_OP_SETRAIN] = Cmd_setrain, //0x7D + [B_SCR_OP_SETREFLECT] = Cmd_setreflect, //0x7E + [B_SCR_OP_SETSEEDED] = Cmd_setseeded, //0x7F + [B_SCR_OP_MANIPULATEDAMAGE] = Cmd_manipulatedamage, //0x80 + [B_SCR_OP_TRYSETREST] = Cmd_trysetrest, //0x81 + [B_SCR_OP_JUMPIFNOTFIRSTTURN] = Cmd_jumpifnotfirstturn, //0x82 + [B_SCR_OP_NOP] = Cmd_nop, //0x83 + [B_SCR_OP_JUMPIFCANTMAKEASLEEP] = Cmd_jumpifcantmakeasleep, //0x84 + [B_SCR_OP_STOCKPILE] = Cmd_stockpile, //0x85 + [B_SCR_OP_STOCKPILETOBASEDAMAGE] = Cmd_stockpiletobasedamage, //0x86 + [B_SCR_OP_STOCKPILETOHPHEAL] = Cmd_stockpiletohpheal, //0x87 + [B_SCR_OP_NEGATIVEDAMAGE] = Cmd_negativedamage, //0x88 + [B_SCR_OP_STATBUFFCHANGE] = Cmd_statbuffchange, //0x89 + [B_SCR_OP_NORMALISEBUFFS] = Cmd_normalisebuffs, //0x8A + [B_SCR_OP_SETBIDE] = Cmd_setbide, //0x8B + [B_SCR_OP_CONFUSEIFREPEATINGATTACKENDS] = Cmd_confuseifrepeatingattackends, //0x8C + [B_SCR_OP_SETMULTIHITCOUNTER] = Cmd_setmultihitcounter, //0x8D + [B_SCR_OP_INITMULTIHITSTRING] = Cmd_initmultihitstring, //0x8E + [B_SCR_OP_FORCERANDOMSWITCH] = Cmd_forcerandomswitch, //0x8F + [B_SCR_OP_TRYCONVERSIONTYPECHANGE] = Cmd_tryconversiontypechange, //0x90 + [B_SCR_OP_GIVEPAYDAYMONEY] = Cmd_givepaydaymoney, //0x91 + [B_SCR_OP_SETLIGHTSCREEN] = Cmd_setlightscreen, //0x92 + [B_SCR_OP_TRYKO] = Cmd_tryKO, //0x93 + [B_SCR_OP_DAMAGETOHALFTARGETHP] = Cmd_damagetohalftargethp, //0x94 + [B_SCR_OP_SETSANDSTORM] = Cmd_setsandstorm, //0x95 + [B_SCR_OP_WEATHERDAMAGE] = Cmd_weatherdamage, //0x96 + [B_SCR_OP_TRYINFATUATING] = Cmd_tryinfatuating, //0x97 + [B_SCR_OP_UPDATESTATUSICON] = Cmd_updatestatusicon, //0x98 + [B_SCR_OP_SETMIST] = Cmd_setmist, //0x99 + [B_SCR_OP_SETFOCUSENERGY] = Cmd_setfocusenergy, //0x9A + [B_SCR_OP_TRANSFORMDATAEXECUTION] = Cmd_transformdataexecution, //0x9B + [B_SCR_OP_SETSUBSTITUTE] = Cmd_setsubstitute, //0x9C + [B_SCR_OP_MIMICATTACKCOPY] = Cmd_mimicattackcopy, //0x9D + [B_SCR_OP_METRONOME] = Cmd_metronome, //0x9E + [B_SCR_OP_DMGTOLEVEL] = Cmd_dmgtolevel, //0x9F + [B_SCR_OP_PSYWAVEDAMAGEEFFECT] = Cmd_psywavedamageeffect, //0xA0 + [B_SCR_OP_COUNTERDAMAGECALCULATOR] = Cmd_counterdamagecalculator, //0xA1 + [B_SCR_OP_MIRRORCOATDAMAGECALCULATOR] = Cmd_mirrorcoatdamagecalculator, //0xA2 + [B_SCR_OP_DISABLELASTUSEDATTACK] = Cmd_disablelastusedattack, //0xA3 + [B_SCR_OP_TRYSETENCORE] = Cmd_trysetencore, //0xA4 + [B_SCR_OP_PAINSPLITDMGCALC] = Cmd_painsplitdmgcalc, //0xA5 + [B_SCR_OP_SETTYPETORANDOMRESISTANCE] = Cmd_settypetorandomresistance, //0xA6 + [B_SCR_OP_SETALWAYSHITFLAG] = Cmd_setalwayshitflag, //0xA7 + [B_SCR_OP_COPYMOVEPERMANENTLY] = Cmd_copymovepermanently, //0xA8 + [B_SCR_OP_TRYCHOOSESLEEPTALKMOVE] = Cmd_trychoosesleeptalkmove, //0xA9 + [B_SCR_OP_SETDESTINYBOND] = Cmd_setdestinybond, //0xAA + [B_SCR_OP_TRYSETDESTINYBONDTOHAPPEN] = Cmd_trysetdestinybondtohappen, //0xAB + [B_SCR_OP_REMAININGHPTOPOWER] = Cmd_remaininghptopower, //0xAC + [B_SCR_OP_TRYSPITEPPREDUCE] = Cmd_tryspiteppreduce, //0xAD + [B_SCR_OP_HEALPARTYSTATUS] = Cmd_healpartystatus, //0xAE + [B_SCR_OP_CURSETARGET] = Cmd_cursetarget, //0xAF + [B_SCR_OP_TRYSETSPIKES] = Cmd_trysetspikes, //0xB0 + [B_SCR_OP_SETFORESIGHT] = Cmd_setforesight, //0xB1 + [B_SCR_OP_TRYSETPERISHSONG] = Cmd_trysetperishsong, //0xB2 + [B_SCR_OP_ROLLOUTDAMAGECALCULATION] = Cmd_rolloutdamagecalculation, //0xB3 + [B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED] = Cmd_jumpifconfusedandstatmaxed, //0xB4 + [B_SCR_OP_FURYCUTTERCALC] = Cmd_furycuttercalc, //0xB5 + [B_SCR_OP_FRIENDSHIPTODAMAGECALCULATION] = Cmd_friendshiptodamagecalculation, //0xB6 + [B_SCR_OP_PRESENTDAMAGECALCULATION] = Cmd_presentdamagecalculation, //0xB7 + [B_SCR_OP_SETSAFEGUARD] = Cmd_setsafeguard, //0xB8 + [B_SCR_OP_MAGNITUDEDAMAGECALCULATION] = Cmd_magnitudedamagecalculation, //0xB9 + [B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG] = Cmd_jumpifnopursuitswitchdmg, //0xBA + [B_SCR_OP_SETSUNNY] = Cmd_setsunny, //0xBB + [B_SCR_OP_MAXATTACKHALVEHP] = Cmd_maxattackhalvehp, //0xBC + [B_SCR_OP_COPYFOESTATS] = Cmd_copyfoestats, //0xBD + [B_SCR_OP_RAPIDSPINFREE] = Cmd_rapidspinfree, //0xBE + [B_SCR_OP_SETDEFENSECURLBIT] = Cmd_setdefensecurlbit, //0xBF + [B_SCR_OP_RECOVERBASEDONSUNLIGHT] = Cmd_recoverbasedonsunlight, //0xC0 + [B_SCR_OP_HIDDENPOWERCALC] = Cmd_hiddenpowercalc, //0xC1 + [B_SCR_OP_SELECTFIRSTVALIDTARGET] = Cmd_selectfirstvalidtarget, //0xC2 + [B_SCR_OP_TRYSETFUTUREATTACK] = Cmd_trysetfutureattack, //0xC3 + [B_SCR_OP_TRYDOBEATUP] = Cmd_trydobeatup, //0xC4 + [B_SCR_OP_SETSEMIINVULNERABLEBIT] = Cmd_setsemiinvulnerablebit, //0xC5 + [B_SCR_OP_CLEARSEMIINVULNERABLEBIT] = Cmd_clearsemiinvulnerablebit, //0xC6 + [B_SCR_OP_SETMINIMIZE] = Cmd_setminimize, //0xC7 + [B_SCR_OP_SETHAIL] = Cmd_sethail, //0xC8 + [B_SCR_OP_TRYMEMENTO] = Cmd_trymemento, //0xC9 + [B_SCR_OP_SETFORCEDTARGET] = Cmd_setforcedtarget, //0xCA + [B_SCR_OP_SETCHARGE] = Cmd_setcharge, //0xCB + [B_SCR_OP_CALLENVIRONMENTATTACK] = Cmd_callenvironmentattack, //0xCC + [B_SCR_OP_CUREIFBURNEDPARALYZEDORPOISONED] = Cmd_cureifburnedparalyzedorpoisoned, //0xCD + [B_SCR_OP_SETTORMENT] = Cmd_settorment, //0xCE + [B_SCR_OP_JUMPIFNODAMAGE] = Cmd_jumpifnodamage, //0xCF + [B_SCR_OP_SETTAUNT] = Cmd_settaunt, //0xD0 + [B_SCR_OP_TRYSETHELPINGHAND] = Cmd_trysethelpinghand, //0xD1 + [B_SCR_OP_TRYSWAPITEMS] = Cmd_tryswapitems, //0xD2 + [B_SCR_OP_TRYCOPYABILITY] = Cmd_trycopyability, //0xD3 + [B_SCR_OP_TRYWISH] = Cmd_trywish, //0xD4 + [B_SCR_OP_TRYSETROOTS] = Cmd_trysetroots, //0xD5 + [B_SCR_OP_DOUBLEDAMAGEDEALTIFDAMAGED] = Cmd_doubledamagedealtifdamaged, //0xD6 + [B_SCR_OP_SETYAWN] = Cmd_setyawn, //0xD7 + [B_SCR_OP_SETDAMAGETOHEALTHDIFFERENCE] = Cmd_setdamagetohealthdifference, //0xD8 + [B_SCR_OP_SCALEDAMAGEBYHEALTHRATIO] = Cmd_scaledamagebyhealthratio, //0xD9 + [B_SCR_OP_TRYSWAPABILITIES] = Cmd_tryswapabilities, //0xDA + [B_SCR_OP_TRYIMPRISON] = Cmd_tryimprison, //0xDB + [B_SCR_OP_TRYSETGRUDGE] = Cmd_trysetgrudge, //0xDC + [B_SCR_OP_WEIGHTDAMAGECALCULATION] = Cmd_weightdamagecalculation, //0xDD + [B_SCR_OP_ASSISTATTACKSELECT] = Cmd_assistattackselect, //0xDE + [B_SCR_OP_TRYSETMAGICCOAT] = Cmd_trysetmagiccoat, //0xDF + [B_SCR_OP_TRYSETSNATCH] = Cmd_trysetsnatch, //0xE0 + [B_SCR_OP_TRYGETINTIMIDATETARGET] = Cmd_trygetintimidatetarget, //0xE1 + [B_SCR_OP_SWITCHOUTABILITIES] = Cmd_switchoutabilities, //0xE2 + [B_SCR_OP_JUMPIFHASNOHP] = Cmd_jumpifhasnohp, //0xE3 + [B_SCR_OP_GETSECRETPOWEREFFECT] = Cmd_getsecretpowereffect, //0xE4 + [B_SCR_OP_PICKUP] = Cmd_pickup, //0xE5 + [B_SCR_OP_DOCASTFORMCHANGEANIMATION] = Cmd_docastformchangeanimation, //0xE6 + [B_SCR_OP_TRYCASTFORMDATACHANGE] = Cmd_trycastformdatachange, //0xE7 + [B_SCR_OP_SETTYPEBASEDHALVERS] = Cmd_settypebasedhalvers, //0xE8 + [B_SCR_OP_SETWEATHERBALLTYPE] = Cmd_setweatherballtype, //0xE9 + [B_SCR_OP_TRYRECYCLEITEM] = Cmd_tryrecycleitem, //0xEA + [B_SCR_OP_SETTYPETOENVIRONMENT] = Cmd_settypetoenvironment, //0xEB + [B_SCR_OP_PURSUITDOUBLES] = Cmd_pursuitdoubles, //0xEC + [B_SCR_OP_SNATCHSETBATTLERS] = Cmd_snatchsetbattlers, //0xED + [B_SCR_OP_REMOVELIGHTSCREENREFLECT] = Cmd_removelightscreenreflect, //0xEE + [B_SCR_OP_HANDLEBALLTHROW] = Cmd_handleballthrow, //0xEF + [B_SCR_OP_GIVECAUGHTMON] = Cmd_givecaughtmon, //0xF0 + [B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS] = Cmd_trysetcaughtmondexflags, //0xF1 + [B_SCR_OP_DISPLAYDEXINFO] = Cmd_displaydexinfo, //0xF2 + [B_SCR_OP_TRYGIVECAUGHTMONNICK] = Cmd_trygivecaughtmonnick, //0xF3 + [B_SCR_OP_SUBATTACKERHPBYDMG] = Cmd_subattackerhpbydmg, //0xF4 + [B_SCR_OP_REMOVEATTACKERSTATUS1] = Cmd_removeattackerstatus1, //0xF5 + [B_SCR_OP_FINISHACTION] = Cmd_finishaction, //0xF6 + [B_SCR_OP_FINISHTURN] = Cmd_finishturn, //0xF7 + [B_SCR_OP_TRAINERSLIDEOUT] = Cmd_trainerslideout //0xF8 }; struct StatFractions