diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 7d7812c3b4..d8a8be7612 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1,44 +1,44 @@ @ commands .macro attackcanceler - .byte 0x0 + .byte B_SCR_OP_ATTACKCANCELER .endm .macro accuracycheck failInstr:req, move:req - .byte 0x1 + .byte B_SCR_OP_ACCURACYCHECK .4byte \failInstr .2byte \move .endm .macro printattackstring - .byte 0x2 + .byte B_SCR_OP_PRINTATTACKSTRING .endm .macro unused_0x3 - .byte 0x3 + .byte B_SCR_OP_UNUSED_0x3 .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 adjustdamage - .byte 0x7 + .byte B_SCR_OP_ADJUSTDAMAGE .endm .macro multihitresultmessage - .byte 0x8 + .byte B_SCR_OP_MULTIHITRESULTMESSAGE .endm .macro attackanimation - .byte 0x9 + .byte B_SCR_OP_ATTACKANIMATION .endm .macro waitanimation @@ -70,7 +70,7 @@ .endm .macro printstring id:req - .byte 0x10 + .byte B_SCR_OP_PRINTSTRING .2byte \id .endm @@ -79,28 +79,28 @@ .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 setadditionaleffects 1: - .byte 0x15 + .byte B_SCR_OP_SETADDITIONALEFFECTS jumpifhalfword CMP_EQUAL, sMOVE_EFFECT, MOVE_EFFECT_CONTINUE, 1b .endm @@ -108,7 +108,7 @@ .if \moveEffect != 0 setmoveeffect \moveEffect .endif - .byte 0x16 + .byte B_SCR_OP_SETEFFECTPRIMARY .byte \battler .byte \effectBattler .endm @@ -117,26 +117,26 @@ .if \moveEffect != 0 setmoveeffect \moveEffect .endif - .byte 0x17 + .byte B_SCR_OP_SETEFFECTSECONDARY .byte \battler .byte \effectBattler .endm .macro clearvolatile battler:req, volatile:req - .byte 0x18 + .byte B_SCR_OP_CLEARVOLATILE .byte \battler .byte \volatile .endm .macro tryfaintmon battler:req - .byte 0x19 + .byte B_SCR_OP_TRYFAINTMON .byte \battler .byte FALSE .4byte NULL .endm .macro tryfaintmon_spikes battler:req, instr:req - .byte 0x19 + .byte B_SCR_OP_TRYFAINTMON .byte \battler .byte TRUE .4byte \instr @@ -181,7 +181,7 @@ .endm .macro jumpifstat battler:req, comparison:req, stat:req, value:req, jumpInstr:req - .byte 0x20 + .byte B_SCR_OP_JUMPIFSTAT .byte \battler .byte \comparison .byte \stat @@ -190,7 +190,7 @@ .endm .macro jumpifstatignorecontrary battler:req, comparison:req, stat:req, value:req, jumpInstr:req - .byte 0x21 + .byte B_SCR_OP_JUMPIFSTATIGNORECONTRARY .byte \battler .byte \comparison .byte \stat @@ -199,7 +199,7 @@ .endm .macro jumpbasedontype battler:req, type:req, jumpIfType:req, jumpInstr:req - .byte 0x22 + .byte B_SCR_OP_JUMPBASEDONTYPE .byte \battler .byte \type .byte \jumpIfType @@ -215,36 +215,36 @@ .endm .macro getexp battler:req - .byte 0x23 + .byte B_SCR_OP_GETEXP .byte \battler .endm .macro checkteamslost jumpInstr:req - .byte 0x24 + .byte B_SCR_OP_CHECKTEAMSLOST .4byte \jumpInstr .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 loopInstr:req - .byte 0x27 + .byte B_SCR_OP_DECREMENTMULTIHIT .4byte \loopInstr .endm .macro goto instr:req - .byte 0x28 + .byte B_SCR_OP_GOTO .4byte \instr .endm .macro jumpifbyte comparison:req, bytePtr:req, value:req, jumpInstr:req - .byte 0x29 + .byte B_SCR_OP_JUMPIFBYTE .byte \comparison .4byte \bytePtr .byte \value @@ -296,20 +296,20 @@ .endm .macro subbyte bytePtr:req, value:req - .byte 0x30 + .byte B_SCR_OP_SUBBYTE .4byte \bytePtr .byte \value .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, indexPtr:req, size:req - .byte 0x32 + .byte B_SCR_OP_COPYARRAYWITHINDEX .4byte \dest .4byte \src .4byte \indexPtr @@ -317,48 +317,48 @@ .endm .macro orbyte bytePtr:req, value:req - .byte 0x33 + .byte B_SCR_OP_ORBYTE .4byte \bytePtr .byte \value .endm .macro orhalfword halfwordPtr:req, value:req - .byte 0x34 + .byte B_SCR_OP_ORHALFWORD .4byte \halfwordPtr .2byte \value .endm .macro orword wordPtr:req, value:req - .byte 0x35 + .byte B_SCR_OP_ORWORD .4byte \wordPtr .4byte \value .endm .macro bicbyte bytePtr:req, value:req - .byte 0x36 + .byte B_SCR_OP_BICBYTE .4byte \bytePtr .byte \value .endm .macro bichalfword halfwordPtr:req, value:req - .byte 0x37 + .byte B_SCR_OP_BICHALFWORD .4byte \halfwordPtr .2byte \value .endm .macro bicword wordPtr:req, value:req - .byte 0x38 + .byte B_SCR_OP_BICWORD .4byte \wordPtr .4byte \value .endm .macro pause frames:req - .byte 0x39 + .byte B_SCR_OP_PAUSE .2byte \frames .endm .macro setchargingturn - .byte 0x40 + .byte B_SCR_OP_SETCHARGINGTURN .endm .macro waitstate @@ -386,51 +386,51 @@ .endm .macro call instr:req - .byte 0x41 + .byte B_SCR_OP_CALL .4byte \instr .endm .macro setroost - .byte 0x42 + .byte B_SCR_OP_SETROOST .endm .macro jumpifabilitypresent ability:req, jumpInstr:req - .byte 0x43 + .byte B_SCR_OP_JUMPIFABILITYPRESENT .2byte \ability .4byte \jumpInstr .endm .macro endselectionscript - .byte 0x44 + .byte B_SCR_OP_ENDSELECTIONSCRIPT .endm .macro playanimation battler:req, animId:req, argPtr=NULL - .byte 0x45 + .byte B_SCR_OP_PLAYANIMATION .byte \battler .byte \animId .4byte \argPtr .endm .macro playanimation_var battler:req, animIdPtr:req, argPtr=NULL - .byte 0x46 + .byte B_SCR_OP_PLAYANIMATION_VAR .byte \battler .4byte \animIdPtr .4byte \argPtr .endm .macro jumpfifsemiinvulnerable battler:req, state:req, jumpInstr:req - .byte 0x47 + .byte B_SCR_OP_JUMPFIFSEMIINVULNERABLE .byte \battler .byte \state .4byte \jumpInstr .endm .macro unused_0x48 - .byte 0x48 + .byte B_SCR_OP_UNUSED_0x48 .endm .macro moveend endMode:req, endState:req - .byte 0x49 + .byte B_SCR_OP_MOVEEND .byte \endMode .byte \endState .endm @@ -500,54 +500,54 @@ .endm .macro openpartyscreen battler:req, failInstr:req - .byte 0x50 + .byte B_SCR_OP_OPENPARTYSCREEN .byte \battler .4byte \failInstr .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 position:req - .byte 0x53 + .byte B_SCR_OP_TRAINERSLIDEIN .byte \position .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, changingForm:req - .byte 0x58 + .byte B_SCR_OP_RETURNTOBALL .byte \battler .byte \changingForm .endm .macro handlelearnnewmove learnedMoveInstr:req, nothingToLearnInstr:req, isFirstMove:req - .byte 0x59 + .byte B_SCR_OP_HANDLELEARNNEWMOVE .4byte \learnedMoveInstr .4byte \nothingToLearnInstr .byte \isFirstMove @@ -582,27 +582,27 @@ .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, status=0, isVolatile=FALSE - .byte 0x64 + .byte B_SCR_OP_STATUSANIMATION .byte \battler .4byte \status .byte \isVolatile @@ -613,15 +613,15 @@ .endm .macro yesnobox - .byte 0x67 + .byte B_SCR_OP_YESNOBOX .endm .macro cancelallactions - .byte 0x68 + .byte B_SCR_OP_CANCELALLACTIONS .endm .macro setgravity failInstr:req - .byte 0x69 + .byte B_SCR_OP_SETGRAVITY .4byte \failInstr .endm @@ -652,47 +652,47 @@ .endm .macro recordability battler:req - .byte 0x70 + .byte B_SCR_OP_RECORDABILITY .byte \battler .endm .macro buffermovetolearn - .byte 0x71 + .byte B_SCR_OP_BUFFERMOVETOLEARN .endm .macro jumpifplayerran jumpInstr:req - .byte 0x72 + .byte B_SCR_OP_JUMPIFPLAYERRAN .4byte \jumpInstr .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 unused_0x78 - .byte 0x76 + .byte B_SCR_OP_UNUSED_0x78 .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 jumpInstr:req @@ -724,38 +724,38 @@ .endm .macro manipulatedamage mode:req - .byte 0x80 + .byte B_SCR_OP_MANIPULATEDAMAGE .byte \mode .endm .macro trysetrest - .byte 0x81 + .byte B_SCR_OP_TRYSETREST .endm .macro unused_0x82 - .byte 0x82 + .byte B_SCR_OP_UNUSED_0x82 .endm .macro unused_0x83 - .byte 0x83 + .byte B_SCR_OP_UNUSED_0x83 .endm .macro jumpifuproarwakes jumpInstr:req - .byte 0x84 + .byte B_SCR_OP_JUMPIFUPROARWAKES .4byte \jumpInstr .endm .macro stockpile id:req - .byte 0x85 + .byte B_SCR_OP_STOCKPILE .byte \id .endm .macro stockpiletobasedamage - .byte 0x86 + .byte B_SCR_OP_STOCKPILETOBASEDAMAGE .endm .macro stockpiletohpheal failInstr:req - .byte 0x87 + .byte B_SCR_OP_STOCKPILETOHPHEAL .4byte \failInstr .endm @@ -764,11 +764,11 @@ .endm .macro unused_0x88 - .byte 0x88 + .byte B_SCR_OP_UNUSED_0x88 .endm .macro statbuffchange battler:req, flags:req, failInstr:req, stats=0 - .byte 0x89 + .byte B_SCR_OP_STATBUFFCHANGE .byte \battler .2byte \flags .4byte \failInstr @@ -814,50 +814,50 @@ .endm .macro tryconversiontypechange failInstr:req - .byte 0x90 + .byte B_SCR_OP_TRYCONVERSIONTYPECHANGE .4byte \failInstr .endm .macro givepaydaymoney - .byte 0x91 + .byte B_SCR_OP_GIVEPAYDAYMONEY .endm .macro setlightscreen - .byte 0x92 + .byte B_SCR_OP_SETLIGHTSCREEN .endm .macro tryKO failInstr:req - .byte 0x93 + .byte B_SCR_OP_TRYKO .4byte \failInstr .endm .macro checknonvolatiletrigger nonVolatile:req, failInstr:req - .byte 0x94 + .byte B_SCR_OP_CHECKNONVOLATILETRIGGER .2byte \nonVolatile .4byte \failInstr .endm .macro copybidedmg - .byte 0x95 + .byte B_SCR_OP_COPYBIDEDMG .endm .macro animatewildpokemonafterfailedpokeball battler:req - .byte 0x96 + .byte B_SCR_OP_ANIMATEWILDPOKEMONAFTERFAILEDPOKEBALL .byte \battler .endm .macro tryinfatuating failInstr:req - .byte 0x97 + .byte B_SCR_OP_TRYINFATUATING .4byte \failInstr .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 battler:req diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 234ebad0b2..78745aad8f 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -1,6 +1,266 @@ #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_PRINTATTACKSTRING, + B_SCR_OP_UNUSED_0x3, + B_SCR_OP_CRITCALC, + B_SCR_OP_DAMAGECALC, + B_SCR_OP_TYPECALC, + B_SCR_OP_ADJUSTDAMAGE, + B_SCR_OP_MULTIHITRESULTMESSAGE, + 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_SETADDITIONALEFFECTS, + B_SCR_OP_SETEFFECTPRIMARY, + B_SCR_OP_SETEFFECTSECONDARY, + B_SCR_OP_CLEARVOLATILE, + B_SCR_OP_TRYFAINTMON, + B_SCR_OP_DOFAINTANIMATION, + B_SCR_OP_CLEAREFFECTSONFAINT, + B_SCR_OP_JUMPIFSTATUS, + B_SCR_OP_JUMPIFVOLATILE, + B_SCR_OP_JUMPIFABILITY, + B_SCR_OP_JUMPIFSIDEAFFECTING, + B_SCR_OP_JUMPIFSTAT, + B_SCR_OP_JUMPIFSTATIGNORECONTRARY, + B_SCR_OP_JUMPBASEDONTYPE, + 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_ISDMGBLOCKEDBYDISGUISE, + B_SCR_OP_RETURN, + B_SCR_OP_END, + B_SCR_OP_END2, + B_SCR_OP_END3, + B_SCR_OP_SETCHARGINGTURN, + B_SCR_OP_CALL, + B_SCR_OP_SETROOST, + B_SCR_OP_JUMPIFABILITYPRESENT, + B_SCR_OP_ENDSELECTIONSCRIPT, + B_SCR_OP_PLAYANIMATION, + B_SCR_OP_PLAYANIMATION_VAR, + B_SCR_OP_JUMPFIFSEMIINVULNERABLE, + B_SCR_OP_UNUSED_0x48, + B_SCR_OP_MOVEEND, + B_SCR_OP_SETHEALBLOCK, + 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_UNUSED_0x65, + B_SCR_OP_UNUSED_0x66, + B_SCR_OP_YESNOBOX, + B_SCR_OP_CANCELALLACTIONS, + B_SCR_OP_SETGRAVITY, + 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_RECORDABILITY, + B_SCR_OP_BUFFERMOVETOLEARN, + B_SCR_OP_JUMPIFPLAYERRAN, + B_SCR_OP_HPTHRESHOLDS, + B_SCR_OP_HPTHRESHOLDS2, + B_SCR_OP_USEITEMONOPPONENT, + B_SCR_OP_UNUSED_0x78, + B_SCR_OP_SETPROTECTLIKE, + B_SCR_OP_TRYEXPLOSION, + B_SCR_OP_SETATKHPTOZERO, + B_SCR_OP_JUMPIFNEXTTARGETVALID, + B_SCR_OP_TRYHEALHALFHEALTH, + B_SCR_OP_UNUSED_0x7E, + B_SCR_OP_SETFIELDWEATHER, + B_SCR_OP_SETREFLECT, + B_SCR_OP_SETSEEDED, + B_SCR_OP_MANIPULATEDAMAGE, + B_SCR_OP_TRYSETREST, + B_SCR_OP_UNUSED_0x82, + B_SCR_OP_UNUSED_0x83, + B_SCR_OP_JUMPIFUPROARWAKES, + B_SCR_OP_STOCKPILE, + B_SCR_OP_STOCKPILETOBASEDAMAGE, + B_SCR_OP_STOCKPILETOHPHEAL, + B_SCR_OP_UNUSED_0x88, + B_SCR_OP_STATBUFFCHANGE, + B_SCR_OP_NORMALISEBUFFS, + B_SCR_OP_SETBIDE, + B_SCR_OP_TWOTURNMOVESCHARGESTRINGANDANIMATION, + B_SCR_OP_TRYNONVOLATILESTATUS, + 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_CHECKNONVOLATILETRIGGER, + B_SCR_OP_COPYBIDEDMG, + B_SCR_OP_ANIMATEWILDPOKEMONAFTERFAILEDPOKEBALL, + 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_SETCALLEDMOVE, + B_SCR_OP_UNUSED_0x9F, + B_SCR_OP_UNUSED_0xA0, + 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_UNUSED_0xA9, + B_SCR_OP_UNUSED_AA, + B_SCR_OP_UNUSED_0xAB, + B_SCR_OP_SETTAILWIND, + B_SCR_OP_TRYSPITEPPREDUCE, + B_SCR_OP_HEALPARTYSTATUS, + B_SCR_OP_CURSETARGET, + B_SCR_OP_TRYSETSPIKES, + B_SCR_OP_SETVOLATILE, + B_SCR_OP_TRYSETPERISHSONG, + B_SCR_OP_HANDLEROLLOUT, + B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED, + B_SCR_OP_HANDLEFURYCUTTER, + B_SCR_OP_SETEMBARGO, + B_SCR_OP_PRESENTDAMAGECALCULATION, + B_SCR_OP_SETSAFEGUARD, + B_SCR_OP_MAGNITUDEDAMAGECALCULATION, + B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG, + B_SCR_OP_TRYACTIVATEITEM, + B_SCR_OP_HALVEHP, + B_SCR_OP_COPYFOESTATS, + B_SCR_OP_RAPIDSPINFREE, + B_SCR_OP_UNUSED_0xBF, + B_SCR_OP_RECOVERBASEDONSUNLIGHT, + B_SCR_OP_SETSTICKYWEB, + B_SCR_OP_SELECTFIRSTVALIDTARGET, + B_SCR_OP_SETFUTUREATTACK, + B_SCR_OP_TRYDOBEATUP, + B_SCR_OP_SETSEMIINVULNERABLEBIT, + B_SCR_OP_TRYFIRETWOTURNMOVENOWBYEFFECT, + B_SCR_OP_UNUSED_0xC7, + B_SCR_OP_UNUSED_C8, + B_SCR_OP_TRYMEMENTO, + B_SCR_OP_SETFORCEDTARGET, + B_SCR_OP_UNUSED_0xCB, + B_SCR_OP_UNUSED_0xCC, + B_SCR_OP_CURESTATUSWITHMOVE, + 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_SETTOXICSPIKES, + B_SCR_OP_SETGASTROACID, + B_SCR_OP_SETYAWN, + B_SCR_OP_SETDAMAGETOHEALTHDIFFERENCE, + B_SCR_OP_SETROOM, + B_SCR_OP_TRYSWAPABILITIES, + B_SCR_OP_TRYIMPRISON, + B_SCR_OP_SETSTEALTHROCK, + B_SCR_OP_TRYSETVOLATILE, + B_SCR_OP_UNUSED_0xDE, + B_SCR_OP_TRYSETMAGICCOAT, + B_SCR_OP_TRYSETSNATCH, + B_SCR_OP_UNUSED2, + B_SCR_OP_SWITCHOUTABILITIES, + B_SCR_OP_JUMPIFHASNOHP, + B_SCR_OP_UNUSED_0xE4, + B_SCR_OP_PICKUP, + B_SCR_OP_UNUSED_0xE6, + B_SCR_OP_UNUSED_0xE7, + B_SCR_OP_SETTYPEBASEDHALVERS, + B_SCR_OP_JUMPIFSUBSTITUTEBLOCKS, + B_SCR_OP_TRYRECYCLEITEM, + B_SCR_OP_SETTYPETOENVIRONMENT, + B_SCR_OP_PURSUITDOUBLES, + B_SCR_OP_SNATCHSETBATTLERS, + B_SCR_OP_REMOVESCREENS, + B_SCR_OP_HANDLEBALLTHROW, + B_SCR_OP_GIVECAUGHTMON, + B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS, + B_SCR_OP_DISPLAYDEXINFO, + B_SCR_OP_TRYGIVECAUGHTMONNICK, + B_SCR_OP_UNUSED_0xF4, + B_SCR_OP_REMOVEATTACKERSTATUS1, + B_SCR_OP_FINISHACTION, + B_SCR_OP_FINISHTURN, + B_SCR_OP_TRAINERSLIDEOUT, + B_SCR_OP_SETTELEKINESIS, + B_SCR_OP_SWAPSTATSTAGES, + B_SCR_OP_AVERAGESTATS, + B_SCR_OP_JUMPIFCAPTIVATEAFFECTED, + B_SCR_OP_SETNONVOLATILESTATUS, + B_SCR_OP_TRYOVERWRITEABILITY, + B_SCR_OP_CALLNATIVE, +}; + // The following correspond to the struct members of BattleScripting by adding their offset #define sUNUSED_0x00 (gBattleScripting + 0x00) // unused_0x00 #define sUNUSED_0x04 (gBattleScripting + 0x04) // unused_0x04 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index edbe3f89ea..9dd71d4733 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -598,262 +598,262 @@ static void Cmd_callnative(void); void (*const gBattleScriptingCommandsTable[])(void) = { - Cmd_attackcanceler, //0x0 - Cmd_accuracycheck, //0x1 - Cmd_printattackstring, //0x2 - Cmd_unused_0x3, //0x3 - Cmd_critcalc, //0x4 - Cmd_damagecalc, //0x5 - Cmd_typecalc, //0x6 - Cmd_adjustdamage, //0x7 - Cmd_multihitresultmessage, //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_setadditionaleffects, //0x15 - Cmd_seteffectprimary, //0x16 - Cmd_seteffectsecondary, //0x17 - Cmd_clearvolatile, //0x18 - Cmd_tryfaintmon, //0x19 - Cmd_dofaintanimation, //0x1A - Cmd_cleareffectsonfaint, //0x1B - Cmd_jumpifstatus, //0x1C - Cmd_jumpifvolatile, //0x1D - Cmd_jumpifability, //0x1E - Cmd_jumpifsideaffecting, //0x1F - Cmd_jumpifstat, //0x20 - Cmd_jumpifstatignorecontrary, //0x21 - Cmd_jumpbasedontype, //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_isdmgblockedbydisguise, //0x3B - Cmd_return, //0x3C - Cmd_end, //0x3D - Cmd_end2, //0x3E - Cmd_end3, //0x3F - Cmd_setchargingturn, //0x40 - Cmd_call, //0x41 - Cmd_setroost, //0x42 - Cmd_jumpifabilitypresent, //0x43 - Cmd_endselectionscript, //0x44 - Cmd_playanimation, //0x45 - Cmd_playanimation_var, //0x46 - Cmd_jumpfifsemiinvulnerable, //0x47 - Cmd_unused_0x48, //0x48 - Cmd_moveend, //0x49 - Cmd_sethealblock, //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_unused_0x65, //0x65 - Cmd_unused_0x66, //0x66 - Cmd_yesnobox, //0x67 - Cmd_cancelallactions, //0x68 - Cmd_setgravity, //0x69 - Cmd_removeitem, //0x6A - Cmd_atknameinbuff1, //0x6B - Cmd_drawlvlupbox, //0x6C - Cmd_resetsentmonsvalue, //0x6D - Cmd_setatktoplayer0, //0x6E - Cmd_makevisible, //0x6F - Cmd_recordability, //0x70 - Cmd_buffermovetolearn, //0x71 - Cmd_jumpifplayerran, //0x72 - Cmd_hpthresholds, //0x73 - Cmd_hpthresholds2, //0x74 - Cmd_useitemonopponent, //0x75 - Cmd_unused_0x78, //0x76 - Cmd_setprotectlike, //0x77 - Cmd_tryexplosion, //0x78 - Cmd_setatkhptozero, //0x79 - Cmd_jumpifnexttargetvalid, //0x7A - Cmd_tryhealhalfhealth, //0x7B - Cmd_unused_0x7e, //0x7C - Cmd_setfieldweather, //0x7D - Cmd_setreflect, //0x7E - Cmd_setseeded, //0x7F - Cmd_manipulatedamage, //0x80 - Cmd_trysetrest, //0x81 - Cmd_unused_0x82, //0x82 - Cmd_unused_0x83, //0x83 - Cmd_jumpifuproarwakes, //0x84 - Cmd_stockpile, //0x85 - Cmd_stockpiletobasedamage, //0x86 - Cmd_stockpiletohpheal, //0x87 - Cmd_unused_0x88, //0x88 - Cmd_statbuffchange, //0x89 - Cmd_normalisebuffs, //0x8A - Cmd_setbide, //0x8B - Cmd_twoturnmoveschargestringandanimation, //0x8C - Cmd_trynonvolatilestatus, //0x8D - Cmd_initmultihitstring, //0x8E - Cmd_forcerandomswitch, //0x8F - Cmd_tryconversiontypechange, //0x90 - Cmd_givepaydaymoney, //0x91 - Cmd_setlightscreen, //0x92 - Cmd_tryKO, //0x93 - Cmd_checknonvolatiletrigger, //0x94 - Cmd_copybidedmg, //0x95 - Cmd_animatewildpokemonafterfailedpokeball, //0x96 - Cmd_tryinfatuating, //0x97 - Cmd_updatestatusicon, //0x98 - Cmd_setmist, //0x99 - Cmd_setfocusenergy, //0x9A - Cmd_transformdataexecution, //0x9B - Cmd_setsubstitute, //0x9C - Cmd_mimicattackcopy, //0x9D - Cmd_setcalledmove, //0x9E - Cmd_unused_0x9f, //0x9F - Cmd_unused_0xA0, //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_unused_0xA9, //0xA9 - Cmd_unused_AA, //0xAA - Cmd_unused_0xab, //0xAB - Cmd_settailwind, //0xAC - Cmd_tryspiteppreduce, //0xAD - Cmd_healpartystatus, //0xAE - Cmd_cursetarget, //0xAF - Cmd_trysetspikes, //0xB0 - Cmd_setvolatile, //0xB1 - Cmd_trysetperishsong, //0xB2 - Cmd_handlerollout, //0xB3 - Cmd_jumpifconfusedandstatmaxed, //0xB4 - Cmd_handlefurycutter, //0xB5 - Cmd_setembargo, //0xB6 - Cmd_presentdamagecalculation, //0xB7 - Cmd_setsafeguard, //0xB8 - Cmd_magnitudedamagecalculation, //0xB9 - Cmd_jumpifnopursuitswitchdmg, //0xBA - Cmd_tryactivateitem, //0xBB - Cmd_halvehp, //0xBC - Cmd_copyfoestats, //0xBD - Cmd_rapidspinfree, //0xBE - Cmd_unused_0xBF, //0xBF - Cmd_recoverbasedonsunlight, //0xC0 - Cmd_setstickyweb, //0xC1 - Cmd_selectfirstvalidtarget, //0xC2 - Cmd_setfutureattack, //0xC3 - Cmd_trydobeatup, //0xC4 - Cmd_setsemiinvulnerablebit, //0xC5 - Cmd_tryfiretwoturnmovenowbyeffect, //0xC6 - Cmd_unused_0xC7, //0xC7 - Cmd_unused_c8, //0xC8 - Cmd_trymemento, //0xC9 - Cmd_setforcedtarget, //0xCA - Cmd_unused_0xcb, //0xCB - Cmd_unused_0xCC, //0xCC - Cmd_curestatuswithmove, //0xCD - Cmd_settorment, //0xCE - Cmd_jumpifnodamage, //0xCF - Cmd_settaunt, //0xD0 - Cmd_trysethelpinghand, //0xD1 - Cmd_tryswapitems, //0xD2 - Cmd_trycopyability, //0xD3 - Cmd_trywish, //0xD4 - Cmd_settoxicspikes, //0xD5 - Cmd_setgastroacid, //0xD6 - Cmd_setyawn, //0xD7 - Cmd_setdamagetohealthdifference, //0xD8 - Cmd_setroom, //0xD9 - Cmd_tryswapabilities, //0xDA - Cmd_tryimprison, //0xDB - Cmd_setstealthrock, //0xDC - Cmd_trysetvolatile, //0xDD - Cmd_unused_0xde, //0xDE - Cmd_trysetmagiccoat, //0xDF - Cmd_trysetsnatch, //0xE0 - Cmd_unused2, //0xE1 - Cmd_switchoutabilities, //0xE2 - Cmd_jumpifhasnohp, //0xE3 - Cmd_unused_0xE4, //0xE4 - Cmd_pickup, //0xE5 - Cmd_unused_0xE6, //0xE6 - Cmd_unused_0xE7, //0xE7 - Cmd_settypebasedhalvers, //0xE8 - Cmd_jumpifsubstituteblocks, //0xE9 - Cmd_tryrecycleitem, //0xEA - Cmd_settypetoenvironment, //0xEB - Cmd_pursuitdoubles, //0xEC - Cmd_snatchsetbattlers, //0xED - Cmd_removescreens, //0xEE - Cmd_handleballthrow, //0xEF - Cmd_givecaughtmon, //0xF0 - Cmd_trysetcaughtmondexflags, //0xF1 - Cmd_displaydexinfo, //0xF2 - Cmd_trygivecaughtmonnick, //0xF3 - Cmd_unused_0xf4, //0xF4 - Cmd_removeattackerstatus1, //0xF5 - Cmd_finishaction, //0xF6 - Cmd_finishturn, //0xF7 - Cmd_trainerslideout, //0xF8 - Cmd_settelekinesis, //0xF9 - Cmd_swapstatstages, //0xFA - Cmd_averagestats, //0xFB - Cmd_jumpifcaptivateaffected, //0xFC - Cmd_setnonvolatilestatus, //0xFD - Cmd_tryoverwriteability, //0xFE - Cmd_callnative, //0xFF + [B_SCR_OP_ATTACKCANCELER] = Cmd_attackcanceler, + [B_SCR_OP_ACCURACYCHECK] = Cmd_accuracycheck, + [B_SCR_OP_PRINTATTACKSTRING] = Cmd_printattackstring, + [B_SCR_OP_UNUSED_0x3] = Cmd_unused_0x3, + [B_SCR_OP_CRITCALC] = Cmd_critcalc, + [B_SCR_OP_DAMAGECALC] = Cmd_damagecalc, + [B_SCR_OP_TYPECALC] = Cmd_typecalc, + [B_SCR_OP_ADJUSTDAMAGE] = Cmd_adjustdamage, + [B_SCR_OP_MULTIHITRESULTMESSAGE] = Cmd_multihitresultmessage, + [B_SCR_OP_ATTACKANIMATION] = Cmd_attackanimation, + [B_SCR_OP_WAITANIMATION] = Cmd_waitanimation, + [B_SCR_OP_HEALTHBARUPDATE] = Cmd_healthbarupdate, + [B_SCR_OP_DATAHPUPDATE] = Cmd_datahpupdate, + [B_SCR_OP_CRITMESSAGE] = Cmd_critmessage, + [B_SCR_OP_EFFECTIVENESSSOUND] = Cmd_effectivenesssound, + [B_SCR_OP_RESULTMESSAGE] = Cmd_resultmessage, + [B_SCR_OP_PRINTSTRING] = Cmd_printstring, + [B_SCR_OP_PRINTSELECTIONSTRING] = Cmd_printselectionstring, + [B_SCR_OP_WAITMESSAGE] = Cmd_waitmessage, + [B_SCR_OP_PRINTFROMTABLE] = Cmd_printfromtable, + [B_SCR_OP_PRINTSELECTIONSTRINGFROMTABLE] = Cmd_printselectionstringfromtable, + [B_SCR_OP_SETADDITIONALEFFECTS] = Cmd_setadditionaleffects, + [B_SCR_OP_SETEFFECTPRIMARY] = Cmd_seteffectprimary, + [B_SCR_OP_SETEFFECTSECONDARY] = Cmd_seteffectsecondary, + [B_SCR_OP_CLEARVOLATILE] = Cmd_clearvolatile, + [B_SCR_OP_TRYFAINTMON] = Cmd_tryfaintmon, + [B_SCR_OP_DOFAINTANIMATION] = Cmd_dofaintanimation, + [B_SCR_OP_CLEAREFFECTSONFAINT] = Cmd_cleareffectsonfaint, + [B_SCR_OP_JUMPIFSTATUS] = Cmd_jumpifstatus, + [B_SCR_OP_JUMPIFVOLATILE] = Cmd_jumpifvolatile, + [B_SCR_OP_JUMPIFABILITY] = Cmd_jumpifability, + [B_SCR_OP_JUMPIFSIDEAFFECTING] = Cmd_jumpifsideaffecting, + [B_SCR_OP_JUMPIFSTAT] = Cmd_jumpifstat, + [B_SCR_OP_JUMPIFSTATIGNORECONTRARY] = Cmd_jumpifstatignorecontrary, + [B_SCR_OP_JUMPBASEDONTYPE] = Cmd_jumpbasedontype, + [B_SCR_OP_GETEXP] = Cmd_getexp, + [B_SCR_OP_CHECKTEAMSLOST] = Cmd_checkteamslost, + [B_SCR_OP_MOVEVALUESCLEANUP] = Cmd_movevaluescleanup, + [B_SCR_OP_SETMULTIHIT] = Cmd_setmultihit, + [B_SCR_OP_DECREMENTMULTIHIT] = Cmd_decrementmultihit, + [B_SCR_OP_GOTO] = Cmd_goto, + [B_SCR_OP_JUMPIFBYTE] = Cmd_jumpifbyte, + [B_SCR_OP_JUMPIFHALFWORD] = Cmd_jumpifhalfword, + [B_SCR_OP_JUMPIFWORD] = Cmd_jumpifword, + [B_SCR_OP_JUMPIFARRAYEQUAL] = Cmd_jumpifarrayequal, + [B_SCR_OP_JUMPIFARRAYNOTEQUAL] = Cmd_jumpifarraynotequal, + [B_SCR_OP_SETBYTE] = Cmd_setbyte, + [B_SCR_OP_ADDBYTE] = Cmd_addbyte, + [B_SCR_OP_SUBBYTE] = Cmd_subbyte, + [B_SCR_OP_COPYARRAY] = Cmd_copyarray, + [B_SCR_OP_COPYARRAYWITHINDEX] = Cmd_copyarraywithindex, + [B_SCR_OP_ORBYTE] = Cmd_orbyte, + [B_SCR_OP_ORHALFWORD] = Cmd_orhalfword, + [B_SCR_OP_ORWORD] = Cmd_orword, + [B_SCR_OP_BICBYTE] = Cmd_bicbyte, + [B_SCR_OP_BICHALFWORD] = Cmd_bichalfword, + [B_SCR_OP_BICWORD] = Cmd_bicword, + [B_SCR_OP_PAUSE] = Cmd_pause, + [B_SCR_OP_WAITSTATE] = Cmd_waitstate, + [B_SCR_OP_ISDMGBLOCKEDBYDISGUISE] = Cmd_isdmgblockedbydisguise, + [B_SCR_OP_RETURN] = Cmd_return, + [B_SCR_OP_END] = Cmd_end, + [B_SCR_OP_END2] = Cmd_end2, + [B_SCR_OP_END3] = Cmd_end3, + [B_SCR_OP_SETCHARGINGTURN] = Cmd_setchargingturn, + [B_SCR_OP_CALL] = Cmd_call, + [B_SCR_OP_SETROOST] = Cmd_setroost, + [B_SCR_OP_JUMPIFABILITYPRESENT] = Cmd_jumpifabilitypresent, + [B_SCR_OP_ENDSELECTIONSCRIPT] = Cmd_endselectionscript, + [B_SCR_OP_PLAYANIMATION] = Cmd_playanimation, + [B_SCR_OP_PLAYANIMATION_VAR] = Cmd_playanimation_var, + [B_SCR_OP_JUMPFIFSEMIINVULNERABLE] = Cmd_jumpfifsemiinvulnerable, + [B_SCR_OP_UNUSED_0x48] = Cmd_unused_0x48, + [B_SCR_OP_MOVEEND] = Cmd_moveend, + [B_SCR_OP_SETHEALBLOCK] = Cmd_sethealblock, + [B_SCR_OP_RETURNATKTOBALL] = Cmd_returnatktoball, + [B_SCR_OP_GETSWITCHEDMONDATA] = Cmd_getswitchedmondata, + [B_SCR_OP_SWITCHINDATAUPDATE] = Cmd_switchindataupdate, + [B_SCR_OP_SWITCHINANIM] = Cmd_switchinanim, + [B_SCR_OP_JUMPIFCANTSWITCH] = Cmd_jumpifcantswitch, + [B_SCR_OP_OPENPARTYSCREEN] = Cmd_openpartyscreen, + [B_SCR_OP_SWITCHHANDLEORDER] = Cmd_switchhandleorder, + [B_SCR_OP_SWITCHINEFFECTS] = Cmd_switchineffects, + [B_SCR_OP_TRAINERSLIDEIN] = Cmd_trainerslidein, + [B_SCR_OP_PLAYSE] = Cmd_playse, + [B_SCR_OP_FANFARE] = Cmd_fanfare, + [B_SCR_OP_PLAYFAINTCRY] = Cmd_playfaintcry, + [B_SCR_OP_ENDLINKBATTLE] = Cmd_endlinkbattle, + [B_SCR_OP_RETURNTOBALL] = Cmd_returntoball, + [B_SCR_OP_HANDLELEARNNEWMOVE] = Cmd_handlelearnnewmove, + [B_SCR_OP_YESNOBOXLEARNMOVE] = Cmd_yesnoboxlearnmove, + [B_SCR_OP_YESNOBOXSTOPLEARNINGMOVE] = Cmd_yesnoboxstoplearningmove, + [B_SCR_OP_HITANIMATION] = Cmd_hitanimation, + [B_SCR_OP_GETMONEYREWARD] = Cmd_getmoneyreward, + [B_SCR_OP_UPDATEBATTLERMOVES] = Cmd_updatebattlermoves, + [B_SCR_OP_SWAPATTACKERWITHTARGET] = Cmd_swapattackerwithtarget, + [B_SCR_OP_INCREMENTGAMESTAT] = Cmd_incrementgamestat, + [B_SCR_OP_DRAWPARTYSTATUSSUMMARY] = Cmd_drawpartystatussummary, + [B_SCR_OP_HIDEPARTYSTATUSSUMMARY] = Cmd_hidepartystatussummary, + [B_SCR_OP_JUMPTOCALLEDMOVE] = Cmd_jumptocalledmove, + [B_SCR_OP_STATUSANIMATION] = Cmd_statusanimation, + [B_SCR_OP_UNUSED_0x65] = Cmd_unused_0x65, + [B_SCR_OP_UNUSED_0x66] = Cmd_unused_0x66, + [B_SCR_OP_YESNOBOX] = Cmd_yesnobox, + [B_SCR_OP_CANCELALLACTIONS] = Cmd_cancelallactions, + [B_SCR_OP_SETGRAVITY] = Cmd_setgravity, + [B_SCR_OP_REMOVEITEM] = Cmd_removeitem, + [B_SCR_OP_ATKNAMEINBUFF1] = Cmd_atknameinbuff1, + [B_SCR_OP_DRAWLVLUPBOX] = Cmd_drawlvlupbox, + [B_SCR_OP_RESETSENTMONSVALUE] = Cmd_resetsentmonsvalue, + [B_SCR_OP_SETATKTOPLAYER0] = Cmd_setatktoplayer0, + [B_SCR_OP_MAKEVISIBLE] = Cmd_makevisible, + [B_SCR_OP_RECORDABILITY] = Cmd_recordability, + [B_SCR_OP_BUFFERMOVETOLEARN] = Cmd_buffermovetolearn, + [B_SCR_OP_JUMPIFPLAYERRAN] = Cmd_jumpifplayerran, + [B_SCR_OP_HPTHRESHOLDS] = Cmd_hpthresholds, + [B_SCR_OP_HPTHRESHOLDS2] = Cmd_hpthresholds2, + [B_SCR_OP_USEITEMONOPPONENT] = Cmd_useitemonopponent, + [B_SCR_OP_UNUSED_0x78] = Cmd_unused_0x78, + [B_SCR_OP_SETPROTECTLIKE] = Cmd_setprotectlike, + [B_SCR_OP_TRYEXPLOSION] = Cmd_tryexplosion, + [B_SCR_OP_SETATKHPTOZERO] = Cmd_setatkhptozero, + [B_SCR_OP_JUMPIFNEXTTARGETVALID] = Cmd_jumpifnexttargetvalid, + [B_SCR_OP_TRYHEALHALFHEALTH] = Cmd_tryhealhalfhealth, + [B_SCR_OP_UNUSED_0x7E] = Cmd_unused_0x7e, + [B_SCR_OP_SETFIELDWEATHER] = Cmd_setfieldweather, + [B_SCR_OP_SETREFLECT] = Cmd_setreflect, + [B_SCR_OP_SETSEEDED] = Cmd_setseeded, + [B_SCR_OP_MANIPULATEDAMAGE] = Cmd_manipulatedamage, + [B_SCR_OP_TRYSETREST] = Cmd_trysetrest, + [B_SCR_OP_UNUSED_0x82] = Cmd_unused_0x82, + [B_SCR_OP_UNUSED_0x83] = Cmd_unused_0x83, + [B_SCR_OP_JUMPIFUPROARWAKES] = Cmd_jumpifuproarwakes, + [B_SCR_OP_STOCKPILE] = Cmd_stockpile, + [B_SCR_OP_STOCKPILETOBASEDAMAGE] = Cmd_stockpiletobasedamage, + [B_SCR_OP_STOCKPILETOHPHEAL] = Cmd_stockpiletohpheal, + [B_SCR_OP_UNUSED_0x88] = Cmd_unused_0x88, + [B_SCR_OP_STATBUFFCHANGE] = Cmd_statbuffchange, + [B_SCR_OP_NORMALISEBUFFS] = Cmd_normalisebuffs, + [B_SCR_OP_SETBIDE] = Cmd_setbide, + [B_SCR_OP_TWOTURNMOVESCHARGESTRINGANDANIMATION] = Cmd_twoturnmoveschargestringandanimation, + [B_SCR_OP_TRYNONVOLATILESTATUS] = Cmd_trynonvolatilestatus, + [B_SCR_OP_INITMULTIHITSTRING] = Cmd_initmultihitstring, + [B_SCR_OP_FORCERANDOMSWITCH] = Cmd_forcerandomswitch, + [B_SCR_OP_TRYCONVERSIONTYPECHANGE] = Cmd_tryconversiontypechange, + [B_SCR_OP_GIVEPAYDAYMONEY] = Cmd_givepaydaymoney, + [B_SCR_OP_SETLIGHTSCREEN] = Cmd_setlightscreen, + [B_SCR_OP_TRYKO] = Cmd_tryKO, + [B_SCR_OP_CHECKNONVOLATILETRIGGER] = Cmd_checknonvolatiletrigger, + [B_SCR_OP_COPYBIDEDMG] = Cmd_copybidedmg, + [B_SCR_OP_ANIMATEWILDPOKEMONAFTERFAILEDPOKEBALL] = Cmd_animatewildpokemonafterfailedpokeball, + [B_SCR_OP_TRYINFATUATING] = Cmd_tryinfatuating, + [B_SCR_OP_UPDATESTATUSICON] = Cmd_updatestatusicon, + [B_SCR_OP_SETMIST] = Cmd_setmist, + [B_SCR_OP_SETFOCUSENERGY] = Cmd_setfocusenergy, + [B_SCR_OP_TRANSFORMDATAEXECUTION] = Cmd_transformdataexecution, + [B_SCR_OP_SETSUBSTITUTE] = Cmd_setsubstitute, + [B_SCR_OP_MIMICATTACKCOPY] = Cmd_mimicattackcopy, + [B_SCR_OP_SETCALLEDMOVE] = Cmd_setcalledmove, + [B_SCR_OP_UNUSED_0x9F] = Cmd_unused_0x9f, + [B_SCR_OP_UNUSED_0xA0] = Cmd_unused_0xA0, + [B_SCR_OP_COUNTERDAMAGECALCULATOR] = Cmd_counterdamagecalculator, + [B_SCR_OP_MIRRORCOATDAMAGECALCULATOR] = Cmd_mirrorcoatdamagecalculator, + [B_SCR_OP_DISABLELASTUSEDATTACK] = Cmd_disablelastusedattack, + [B_SCR_OP_TRYSETENCORE] = Cmd_trysetencore, + [B_SCR_OP_PAINSPLITDMGCALC] = Cmd_painsplitdmgcalc, + [B_SCR_OP_SETTYPETORANDOMRESISTANCE] = Cmd_settypetorandomresistance, + [B_SCR_OP_SETALWAYSHITFLAG] = Cmd_setalwayshitflag, + [B_SCR_OP_COPYMOVEPERMANENTLY] = Cmd_copymovepermanently, + [B_SCR_OP_UNUSED_0xA9] = Cmd_unused_0xA9, + [B_SCR_OP_UNUSED_AA] = Cmd_unused_AA, + [B_SCR_OP_UNUSED_0xAB] = Cmd_unused_0xab, + [B_SCR_OP_SETTAILWIND] = Cmd_settailwind, + [B_SCR_OP_TRYSPITEPPREDUCE] = Cmd_tryspiteppreduce, + [B_SCR_OP_HEALPARTYSTATUS] = Cmd_healpartystatus, + [B_SCR_OP_CURSETARGET] = Cmd_cursetarget, + [B_SCR_OP_TRYSETSPIKES] = Cmd_trysetspikes, + [B_SCR_OP_SETVOLATILE] = Cmd_setvolatile, + [B_SCR_OP_TRYSETPERISHSONG] = Cmd_trysetperishsong, + [B_SCR_OP_HANDLEROLLOUT] = Cmd_handlerollout, + [B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED] = Cmd_jumpifconfusedandstatmaxed, + [B_SCR_OP_HANDLEFURYCUTTER] = Cmd_handlefurycutter, + [B_SCR_OP_SETEMBARGO] = Cmd_setembargo, + [B_SCR_OP_PRESENTDAMAGECALCULATION] = Cmd_presentdamagecalculation, + [B_SCR_OP_SETSAFEGUARD] = Cmd_setsafeguard, + [B_SCR_OP_MAGNITUDEDAMAGECALCULATION] = Cmd_magnitudedamagecalculation, + [B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG] = Cmd_jumpifnopursuitswitchdmg, + [B_SCR_OP_TRYACTIVATEITEM] = Cmd_tryactivateitem, + [B_SCR_OP_HALVEHP] = Cmd_halvehp, + [B_SCR_OP_COPYFOESTATS] = Cmd_copyfoestats, + [B_SCR_OP_RAPIDSPINFREE] = Cmd_rapidspinfree, + [B_SCR_OP_UNUSED_0xBF] = Cmd_unused_0xBF, + [B_SCR_OP_RECOVERBASEDONSUNLIGHT] = Cmd_recoverbasedonsunlight, + [B_SCR_OP_SETSTICKYWEB] = Cmd_setstickyweb, + [B_SCR_OP_SELECTFIRSTVALIDTARGET] = Cmd_selectfirstvalidtarget, + [B_SCR_OP_SETFUTUREATTACK] = Cmd_setfutureattack, + [B_SCR_OP_TRYDOBEATUP] = Cmd_trydobeatup, + [B_SCR_OP_SETSEMIINVULNERABLEBIT] = Cmd_setsemiinvulnerablebit, + [B_SCR_OP_TRYFIRETWOTURNMOVENOWBYEFFECT] = Cmd_tryfiretwoturnmovenowbyeffect, + [B_SCR_OP_UNUSED_0xC7] = Cmd_unused_0xC7, + [B_SCR_OP_UNUSED_C8] = Cmd_unused_c8, + [B_SCR_OP_TRYMEMENTO] = Cmd_trymemento, + [B_SCR_OP_SETFORCEDTARGET] = Cmd_setforcedtarget, + [B_SCR_OP_UNUSED_0xCB] = Cmd_unused_0xcb, + [B_SCR_OP_UNUSED_0xCC] = Cmd_unused_0xCC, + [B_SCR_OP_CURESTATUSWITHMOVE] = Cmd_curestatuswithmove, + [B_SCR_OP_SETTORMENT] = Cmd_settorment, + [B_SCR_OP_JUMPIFNODAMAGE] = Cmd_jumpifnodamage, + [B_SCR_OP_SETTAUNT] = Cmd_settaunt, + [B_SCR_OP_TRYSETHELPINGHAND] = Cmd_trysethelpinghand, + [B_SCR_OP_TRYSWAPITEMS] = Cmd_tryswapitems, + [B_SCR_OP_TRYCOPYABILITY] = Cmd_trycopyability, + [B_SCR_OP_TRYWISH] = Cmd_trywish, + [B_SCR_OP_SETTOXICSPIKES] = Cmd_settoxicspikes, + [B_SCR_OP_SETGASTROACID] = Cmd_setgastroacid, + [B_SCR_OP_SETYAWN] = Cmd_setyawn, + [B_SCR_OP_SETDAMAGETOHEALTHDIFFERENCE] = Cmd_setdamagetohealthdifference, + [B_SCR_OP_SETROOM] = Cmd_setroom, + [B_SCR_OP_TRYSWAPABILITIES] = Cmd_tryswapabilities, + [B_SCR_OP_TRYIMPRISON] = Cmd_tryimprison, + [B_SCR_OP_SETSTEALTHROCK] = Cmd_setstealthrock, + [B_SCR_OP_TRYSETVOLATILE] = Cmd_trysetvolatile, + [B_SCR_OP_UNUSED_0xDE] = Cmd_unused_0xde, + [B_SCR_OP_TRYSETMAGICCOAT] = Cmd_trysetmagiccoat, + [B_SCR_OP_TRYSETSNATCH] = Cmd_trysetsnatch, + [B_SCR_OP_UNUSED2] = Cmd_unused2, + [B_SCR_OP_SWITCHOUTABILITIES] = Cmd_switchoutabilities, + [B_SCR_OP_JUMPIFHASNOHP] = Cmd_jumpifhasnohp, + [B_SCR_OP_UNUSED_0xE4] = Cmd_unused_0xE4, + [B_SCR_OP_PICKUP] = Cmd_pickup, + [B_SCR_OP_UNUSED_0xE6] = Cmd_unused_0xE6, + [B_SCR_OP_UNUSED_0xE7] = Cmd_unused_0xE7, + [B_SCR_OP_SETTYPEBASEDHALVERS] = Cmd_settypebasedhalvers, + [B_SCR_OP_JUMPIFSUBSTITUTEBLOCKS] = Cmd_jumpifsubstituteblocks, + [B_SCR_OP_TRYRECYCLEITEM] = Cmd_tryrecycleitem, + [B_SCR_OP_SETTYPETOENVIRONMENT] = Cmd_settypetoenvironment, + [B_SCR_OP_PURSUITDOUBLES] = Cmd_pursuitdoubles, + [B_SCR_OP_SNATCHSETBATTLERS] = Cmd_snatchsetbattlers, + [B_SCR_OP_REMOVESCREENS] = Cmd_removescreens, + [B_SCR_OP_HANDLEBALLTHROW] = Cmd_handleballthrow, + [B_SCR_OP_GIVECAUGHTMON] = Cmd_givecaughtmon, + [B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS] = Cmd_trysetcaughtmondexflags, + [B_SCR_OP_DISPLAYDEXINFO] = Cmd_displaydexinfo, + [B_SCR_OP_TRYGIVECAUGHTMONNICK] = Cmd_trygivecaughtmonnick, + [B_SCR_OP_UNUSED_0xF4] = Cmd_unused_0xf4, + [B_SCR_OP_REMOVEATTACKERSTATUS1] = Cmd_removeattackerstatus1, + [B_SCR_OP_FINISHACTION] = Cmd_finishaction, + [B_SCR_OP_FINISHTURN] = Cmd_finishturn, + [B_SCR_OP_TRAINERSLIDEOUT] = Cmd_trainerslideout, + [B_SCR_OP_SETTELEKINESIS] = Cmd_settelekinesis, + [B_SCR_OP_SWAPSTATSTAGES] = Cmd_swapstatstages, + [B_SCR_OP_AVERAGESTATS] = Cmd_averagestats, + [B_SCR_OP_JUMPIFCAPTIVATEAFFECTED] = Cmd_jumpifcaptivateaffected, + [B_SCR_OP_SETNONVOLATILESTATUS] = Cmd_setnonvolatilestatus, + [B_SCR_OP_TRYOVERWRITEABILITY] = Cmd_tryoverwriteability, + [B_SCR_OP_CALLNATIVE] = Cmd_callnative, }; const struct StatFractions gAccuracyStageRatios[] =