diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index c605099e1..eda410c5b 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -391,11 +391,11 @@ .byte 0x47 .endm - .macro playstatchangeanimation battler:req, param1:req, param2:req + .macro playstatchangeanimation battler:req, stats:req, statchange:req .byte 0x48 .byte \battler - .byte \param1 - .byte \param2 + .byte \stats + .byte \statchange .endm .macro moveend param0:req, param1:req @@ -738,10 +738,10 @@ .byte 0x88 .endm - .macro statbuffchange param0:req, param1:req + .macro statbuffchange flags:req, jumpptr:req .byte 0x89 - .byte \param0 - .4byte \param1 + .byte \flags + .4byte \jumpptr .endm .macro normalisebuffs diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 027db364c..24a266de6 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -366,7 +366,7 @@ BattleScript_EffectAbsorb:: setbyte cMULTISTRING_CHOOSER, 0x0 goto BattleScript_AbsorbUpdateHp BattleScript_AbsorbLiquidOoze:: - manipulatedamage ATK80_DMG_CHANGE_SIGN + manipulatedamage DMG_CHANGE_SIGN setbyte cMULTISTRING_CHOOSER, 0x1 BattleScript_AbsorbUpdateHp:: healthbarupdate BS_ATTACKER @@ -422,7 +422,7 @@ BattleScript_ExplosionLoop: resultmessage waitmessage 0x40 tryfaintmon BS_TARGET, FALSE, NULL - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_ExplosionLoop tryfaintmon BS_ATTACKER, FALSE, NULL end @@ -430,7 +430,7 @@ BattleScript_ExplosionMissed: effectivenesssound resultmessage waitmessage 0x40 - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_ExplosionLoop tryfaintmon BS_ATTACKER, FALSE, NULL end @@ -511,7 +511,7 @@ BattleScript_EffectStatUp:: BattleScript_EffectStatUpAfterAtkCanceler:: attackstring ppreduce - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_StatUpEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpEnd jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpAttackAnim pause 0x20 goto BattleScript_StatUpPrintString @@ -557,7 +557,7 @@ BattleScript_EffectStatDown:: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_StatDownEnd + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatDownEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatDownDoAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatDownEnd pause 0x20 @@ -654,7 +654,7 @@ BattleScript_DoMultiHit:: printstring STRINGID_EMPTYSTRING3 waitmessage 0x1 addbyte sMULTIHIT_STRING + 4, 0x1 - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings decrementmultihit BattleScript_MultiHitLoop goto BattleScript_MultiHitPrintStrings @@ -670,8 +670,8 @@ BattleScript_MultiHitPrintStrings:: BattleScript_MultiHitEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL - moveendcase ATK49_SYNCHRONIZE_TARGET - moveendfrom ATK49_STATUS_IMMUNITY_ABILITIES + moveendcase MOVEEND_SYNCHRONIZE_TARGET + moveendfrom MOVEEND_IMMUNITY_ABILITIES end BattleScript_EffectConversion:: @@ -882,7 +882,7 @@ BattleScript_MoveMissedDoDamage:: damagecalc typecalc adjustnormaldamage - manipulatedamage ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP + manipulatedamage DMG_RECOIL_FROM_MISS bicbyte gMoveResultFlags, MOVE_RESULT_MISSED orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER @@ -1435,7 +1435,7 @@ BattleScript_DoTripleKickAttack:: waitmessage 0x40 printstring STRINGID_EMPTYSTRING3 waitmessage 0x1 - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_TripleKickPrintStrings decrementmultihit BattleScript_TripleKickLoop goto BattleScript_TripleKickPrintStrings @@ -1454,7 +1454,7 @@ BattleScript_TripleKickPrintStrings:: BattleScript_TripleKickEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL - moveendfrom ATK49_UPDATE_LAST_MOVES + moveendfrom MOVEEND_UPDATE_LAST_MOVES end BattleScript_EffectThief:: @@ -1513,17 +1513,17 @@ BattleScript_CurseTrySpeed:: attackanimation waitanimation setstatchanger STAT_SPEED, 1, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CurseTryAttack + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryAttack printfromtable gStatDownStringIds waitmessage 0x40 BattleScript_CurseTryAttack:: setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CurseTryDefence + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefence printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_CurseTryDefence:: setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CurseEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseEnd printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_CurseEnd:: @@ -1635,7 +1635,7 @@ BattleScript_EffectSwagger:: attackanimation waitanimation setstatchanger STAT_ATK, 2, FALSE - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_SwaggerTryConfuse + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_SwaggerTryConfuse jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SwaggerTryConfuse setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -1716,7 +1716,7 @@ BattleScript_EffectBatonPass:: attackstring ppreduce jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_ButItFailed - jumpifcantswitch ATK4F_DONT_CHECK_STATUSES | BS_ATTACKER, BattleScript_ButItFailed + jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_ButItFailed attackanimation waitanimation openpartyscreen 0x1, BattleScript_ButItFailed @@ -1834,7 +1834,7 @@ BattleScript_EffectSkullBash:: setbyte sTWOTURN_STRINGID, 0x2 call BattleScriptFirstChargingTurn setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_SkullBashEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_SkullBashEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SkullBashEnd setgraphicalstatchangevalues playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -1885,7 +1885,7 @@ BattleScript_DoHitAllWithUndergroundBonus:: printstring STRINGID_EMPTYSTRING3 waitmessage 0x1 tryfaintmon BS_TARGET, FALSE, NULL - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop end BattleScript_HitAllWithUndergroundBonusMissed:: @@ -1894,7 +1894,7 @@ BattleScript_HitAllWithUndergroundBonusMissed:: effectivenesssound resultmessage waitmessage 0x40 - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop end @@ -1970,7 +1970,7 @@ BattleScript_BeatUpLoop:: printstring STRINGID_PKMNATTACK critcalc jumpifbyte CMP_NOT_EQUAL, gCritMultiplier, 0x2, BattleScript_BeatUpAttack - manipulatedamage ATK80_DMG_DOUBLED + manipulatedamage DMG_DOUBLED BattleScript_BeatUpAttack:: adjustnormaldamage attackanimation @@ -1985,7 +1985,7 @@ BattleScript_BeatUpAttack:: resultmessage waitmessage 0x40 tryfaintmon BS_TARGET, FALSE, NULL - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET goto BattleScript_BeatUpLoop BattleScript_BeatUpEnd:: end @@ -2037,7 +2037,7 @@ BattleScript_EffectDefenseCurl:: ppreduce setdefensecurlbit setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_DefenseCurlDoStatUpAnim + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DefenseCurlDoStatUpAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpPrintString attackanimation waitanimation @@ -2178,7 +2178,7 @@ BattleScript_EffectFlatter:: attackanimation waitanimation setstatchanger STAT_SPATK, 1, FALSE - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_FlatterTryConfuse + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_FlatterTryConfuse jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_FlatterTryConfuse setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -2232,17 +2232,17 @@ BattleScript_EffectMemento:: waitanimation jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_EffectMementoPrintNoEffect setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO | ATK48_ONLY_MULTIPLE - playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO | STAT_CHANGE_MULTIPLE_STATS + playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_ATK, 2, TRUE - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_EffectMementoTrySpAtk + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTrySpAtk printfromtable gStatDownStringIds waitmessage 0x40 BattleScript_EffectMementoTrySpAtk: - playstatchangeanimation BS_TARGET, BIT_SPATK, ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO + playstatchangeanimation BS_TARGET, BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_EffectMementoTryFaint + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTryFaint jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTryFaint printfromtable gStatDownStringIds waitmessage 0x40 @@ -2606,7 +2606,7 @@ BattleScript_TeeterDanceLoop:: resultmessage waitmessage 0x40 BattleScript_TeeterDanceDoMoveEndIncrement:: - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET BattleScript_TeeterDanceLoopIncrement:: addbyte gBattlerTarget, 0x1 jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TeeterDanceLoop @@ -2677,17 +2677,17 @@ BattleScript_TickleDoMoveAnim:: attackanimation waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE - playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_MULTIPLE_STATS + playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE setstatchanger STAT_ATK, 1, TRUE - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_TickleTryLowerDef + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleTryLowerDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleTryLowerDef printfromtable gStatDownStringIds waitmessage 0x40 BattleScript_TickleTryLowerDef:: - playstatchangeanimation BS_TARGET, BIT_DEF, ATK48_STAT_NEGATIVE + playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE - statbuffchange STAT_CHANGE_BS_PTR, BattleScript_TickleEnd + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleEnd printfromtable gStatDownStringIds waitmessage 0x40 @@ -2713,13 +2713,13 @@ BattleScript_CosmicPowerDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0x0 setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CosmicPowerTrySpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerTrySpDef printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_CosmicPowerTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CosmicPowerEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerEnd printfromtable gStatUpStringIds waitmessage 0x40 @@ -2742,13 +2742,13 @@ BattleScript_BulkUpDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0x0 setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_BulkUpTryDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpTryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpTryDef printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_BulkUpTryDef:: setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_BulkUpEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpEnd printfromtable gStatUpStringIds waitmessage 0x40 @@ -2767,13 +2767,13 @@ BattleScript_CalmMindDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0x0 setstatchanger STAT_SPATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CalmMindTrySpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindTrySpDef printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_CalmMindTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_CalmMindEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindEnd printfromtable gStatUpStringIds waitmessage 0x40 @@ -2799,13 +2799,13 @@ BattleScript_DragonDanceDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0x0 setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_DragonDanceTrySpeed + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceTrySpeed jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceTrySpeed printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_DragonDanceTrySpeed:: setstatchanger STAT_SPEED, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_DragonDanceEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceEnd printfromtable gStatUpStringIds waitmessage 0x40 @@ -2865,7 +2865,7 @@ BattleScript_FaintedMonTryChooseAnother:: jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother jumpifbyte CMP_EQUAL, sBATTLE_STYLE, 0x1, BattleScript_FaintedMonChooseAnother - jumpifcantswitch 11, BattleScript_FaintedMonChooseAnother + jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother printstring STRINGID_ENEMYABOUTTOSWITCHPKMN setbyte gBattleCommunication, 0x0 yesnobox @@ -3128,8 +3128,8 @@ BattleScript_DoSwitchOut:: switchinanim BS_ATTACKER, FALSE waitstate switchineffects BS_ATTACKER - moveendcase ATK49_STATUS_IMMUNITY_ABILITIES - moveendcase ATK49_MIRROR_MOVE + moveendcase MOVEEND_IMMUNITY_ABILITIES + moveendcase MOVEEND_MIRROR_MOVE end2 BattleScript_PursuitDmgOnSwitchOut:: @@ -3152,7 +3152,7 @@ BattleScript_PursuitDmgOnSwitchOut:: resultmessage waitmessage 0x40 tryfaintmon BS_TARGET, FALSE, NULL - moveendfromto ATK49_MOVE_END_ABILITIES, ATK49_CHOICE_MOVE + moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE various4 BS_TARGET jumpifbyte CMP_EQUAL, gBattleCommunication, 0x0, BattleScript_PursuitDmgOnSwitchOutRet setbyte sGIVEEXP_STATE, 0x0 @@ -3281,7 +3281,7 @@ BattleScript_LeechSeedTurnDrain:: datahpupdate BS_ATTACKER copyword gBattleMoveDamage, gHpDealt jumpifability BS_ATTACKER, ABILITY_LIQUID_OOZE, BattleScript_LeechSeedTurnPrintLiquidOoze - manipulatedamage ATK80_DMG_CHANGE_SIGN + manipulatedamage DMG_CHANGE_SIGN setbyte cMULTISTRING_CHOOSER, 0x3 goto BattleScript_LeechSeedTurnPrintAndUpdateHp BattleScript_LeechSeedTurnPrintLiquidOoze:: @@ -3380,7 +3380,7 @@ BattleScript_DisabledNoMore:: BattleScript_SelectingDisabledMoveInPalace:: printstring STRINGID_PKMNMOVEISDISABLED BattleScript_SelectingUnusableMoveInPalace:: - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET end BattleScript_EncoredNoMore:: @@ -3471,27 +3471,27 @@ BattleScript_AllStatsUpAtk:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0 setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_AllStatsUpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpDef printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_AllStatsUpDef:: setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_AllStatsUpSpeed + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpeed printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_AllStatsUpSpeed:: setstatchanger STAT_SPEED, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_AllStatsUpSpAtk + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpAtk printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_AllStatsUpSpAtk:: setstatchanger STAT_SPATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_AllStatsUpSpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpDef printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_AllStatsUpSpDef:: setstatchanger STAT_SPDEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_AllStatsUpRet + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpRet printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_AllStatsUpRet:: @@ -3543,8 +3543,8 @@ BattleScript_DoFutureAttackHit:: tryfaintmon BS_TARGET, FALSE, NULL atk24 BattleScript_FutureAttackEnd BattleScript_FutureAttackEnd:: - moveendcase ATK49_RAGE - moveendfromto ATK49_ITEM_EFFECTS_ALL, ATK49_UPDATE_LAST_MOVES + moveendcase MOVEEND_RAGE + moveendfromto MOVEEND_ITEM_EFFECTS_ALL, MOVEEND_UPDATE_LAST_MOVES setbyte gMoveResultFlags, 0 end2 @@ -3635,17 +3635,17 @@ BattleScript_PrintMonIsRooted:: BattleScript_AtkDefDown:: setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_ATK, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE - playstatchangeanimation BS_ATTACKER, BIT_ATK, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE + playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_ATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_MULTIPLE_STATS + playstatchangeanimation BS_ATTACKER, BIT_ATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_ATK, 1, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_BS_PTR, BattleScript_82DB144 + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_82DB144 jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB144 printfromtable gStatDownStringIds waitmessage 0x40 BattleScript_82DB144:: - playstatchangeanimation BS_ATTACKER, BIT_DEF, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE + playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_BS_PTR, BattleScript_82DB167 + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_82DB167 jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB167 printfromtable gStatDownStringIds waitmessage 0x40 @@ -3709,9 +3709,9 @@ BattleScript_OneHitKOMsg:: BattleScript_SAtkDown2:: setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_SPATK, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO + playstatchangeanimation BS_ATTACKER, BIT_SPATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_BS_PTR, BattleScript_SAtkDown2End + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_SAtkDown2End jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SAtkDown2End printfromtable gStatDownStringIds waitmessage 0x40 @@ -4042,7 +4042,7 @@ BattleScript_IntimidateActivatesLoop: jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_IntimidatePrevented jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidatePrevented jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_IntimidatePrevented - statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_BS_PTR, BattleScript_IntimidateActivatesLoopIncrement + statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_IntimidateActivatesLoopIncrement jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_IntimidateActivatesLoopIncrement setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -4233,7 +4233,7 @@ BattleScript_AbilityCuredStatus:: BattleScript_IgnoresWhileAsleep:: printstring STRINGID_PKMNIGNORESASLEEP waitmessage 0x40 - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndUsesRandomMove:: @@ -4249,7 +4249,7 @@ BattleScript_MoveUsedLoafingAround:: BattleScript_82DB6C7:: printfromtable gInobedientStringIds waitmessage 0x40 - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndFallsAsleep:: @@ -4257,7 +4257,7 @@ BattleScript_IgnoresAndFallsAsleep:: waitmessage 0x40 setmoveeffect MOVE_EFFECT_SLEEP | MOVE_EFFECT_AFFECTS_USER seteffectprimary - moveendto ATK49_NEXT_TARGET + moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndHitsItself:: @@ -4420,7 +4420,7 @@ BattleScript_BerryConfuseHealEnd2:: BattleScript_BerryStatRaiseEnd2:: playanimation BS_ATTACKER, B_ANIM_ITEM_EFFECT, NULL - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_BS_PTR, BattleScript_82DB85B + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_82DB85B BattleScript_82DB85B:: setbyte cMULTISTRING_CHOOSER, 0x4 call BattleScript_StatUp diff --git a/include/battle.h b/include/battle.h index 32eabc6de..f8c685fb0 100644 --- a/include/battle.h +++ b/include/battle.h @@ -478,7 +478,7 @@ struct BattleScripting u8 animArg1; u8 animArg2; u16 tripleKickPower; - u8 atk49_state; + u8 moveendState; u8 battlerWithAbility; u8 multihitMoveEffect; u8 battler; @@ -486,9 +486,9 @@ struct BattleScripting u8 animTargetsHit; u8 statChanger; bool8 statAnimPlayed; - u8 atk23_state; + u8 getexpState; u8 battleStyle; - u8 atk6C_state; + u8 drawlvlupboxState; u8 learnMoveState; u8 field_20; u8 reshowMainState; diff --git a/include/battle_util.h b/include/battle_util.h index 0756a387a..b77fa10ad 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -12,7 +12,7 @@ #define ABILITYEFFECT_ENDTURN 0x1 #define ABILITYEFFECT_MOVES_BLOCK 0x2 #define ABILITYEFFECT_ABSORBING 0x3 -#define ABILITYEFFECT_MOVE_END 0x4 +#define ABILITYEFFECT_ON_DAMAGE 0x4 #define ABILITYEFFECT_IMMUNITY 0x5 #define ABILITYEFFECT_FORECAST 0x6 #define ABILITYEFFECT_SYNCHRONIZE 0x7 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 894bd13b6..dfcf79128 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,16 +39,16 @@ #define BS_EFFECT_BATTLER 2 #define BS_FAINTED 3 #define BS_BATTLER_0 7 -#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update -#define BS_ATTACKER_SIDE 8 // for atk1E_jumpifability -#define BS_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability +#define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon +#define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability +#define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability #define BS_SCRIPTING 10 #define BS_PLAYER1 11 #define BS_OPPONENT1 12 #define BS_PLAYER2 13 #define BS_OPPONENT2 14 -// atk 01, accuracy calc +// Cmd_accuracycheck #define NO_ACC_CALC 0xFFFE #define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF #define ACC_CURR_MOVE 0 @@ -61,7 +61,7 @@ #define CMP_COMMON_BITS 0x4 #define CMP_NO_COMMON_BITS 0x5 -// atk76, various +// Cmd_various #define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 #define VARIOUS_SET_MAGIC_COAT_TARGET 1 #define VARIOUS_IS_RUNNING_IMPOSSIBLE 2 @@ -84,44 +84,25 @@ #define VARIOUS_SET_TELEPORT_OUTCOME 25 #define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26 -// atk80, dmg manipulation -#define ATK80_DMG_CHANGE_SIGN 0 -#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1 -#define ATK80_DMG_DOUBLED 2 +// Cmd_manipulatedmg +#define DMG_CHANGE_SIGN 0 +#define DMG_RECOIL_FROM_MISS 1 +#define DMG_DOUBLED 2 -// atk4F, a flag used for the jumpifcantswitch command -#define ATK4F_DONT_CHECK_STATUSES 0x80 +// Cmd_jumpifcantswitch +#define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80 -// statchange defines -#define STAT_CHANGE_BS_PTR 0x1 -#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20 +// Cmd_statbuffchange +#define STAT_BUFF_ALLOW_PTR 0x1 // If set, allow use of jumpptr. Set in every use of statbuffchange +#define STAT_BUFF_NOT_PROTECT_AFFECTED 0x20 -// atk48 -#define ATK48_STAT_NEGATIVE 0x1 -#define ATK48_STAT_BY_TWO 0x2 -#define ATK48_ONLY_MULTIPLE 0x4 -#define ATK48_DONT_CHECK_LOWER 0x8 - -// atk49, moveend cases -#define ATK49_RAGE 0 -#define ATK49_DEFROST 1 -#define ATK49_SYNCHRONIZE_TARGET 2 -#define ATK49_MOVE_END_ABILITIES 3 -#define ATK49_STATUS_IMMUNITY_ABILITIES 4 -#define ATK49_SYNCHRONIZE_ATTACKER 5 -#define ATK49_CHOICE_MOVE 6 -#define ATK49_CHANGED_ITEMS 7 -#define ATK49_ATTACKER_INVISIBLE 8 -#define ATK49_ATTACKER_VISIBLE 9 -#define ATK49_TARGET_VISIBLE 10 -#define ATK49_ITEM_EFFECTS_ALL 11 -#define ATK49_KINGSROCK_SHELLBELL 12 -#define ATK49_SUBSTITUTE 13 -#define ATK49_UPDATE_LAST_MOVES 14 -#define ATK49_MIRROR_MOVE 15 -#define ATK49_NEXT_TARGET 16 -#define ATK49_COUNT 17 +// stat change flags for Cmd_playstatchangeanimation +#define STAT_CHANGE_NEGATIVE 0x1 +#define STAT_CHANGE_BY_TWO 0x2 +#define STAT_CHANGE_MULTIPLE_STATS 0x4 +#define STAT_CHANGE_CANT_PREVENT 0x8 +// stat flags for Cmd_playstatchangeanimation #define BIT_HP 0x1 #define BIT_ATK 0x2 #define BIT_DEF 0x4 @@ -131,4 +112,24 @@ #define BIT_ACC 0x40 #define BIT_EVASION 0x80 +// cases for Cmd_moveend +#define MOVEEND_RAGE 0 +#define MOVEEND_DEFROST 1 +#define MOVEEND_SYNCHRONIZE_TARGET 2 +#define MOVEEND_ON_DAMAGE_ABILITIES 3 +#define MOVEEND_IMMUNITY_ABILITIES 4 +#define MOVEEND_SYNCHRONIZE_ATTACKER 5 +#define MOVEEND_CHOICE_MOVE 6 +#define MOVEEND_CHANGED_ITEMS 7 +#define MOVEEND_ATTACKER_INVISIBLE 8 +#define MOVEEND_ATTACKER_VISIBLE 9 +#define MOVEEND_TARGET_VISIBLE 10 +#define MOVEEND_ITEM_EFFECTS_ALL 11 +#define MOVEEND_KINGSROCK_SHELLBELL 12 +#define MOVEEND_SUBSTITUTE 13 +#define MOVEEND_UPDATE_LAST_MOVES 14 +#define MOVEEND_MIRROR_MOVE 15 +#define MOVEEND_NEXT_TARGET 16 +#define MOVEEND_COUNT 17 + #endif // GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index b581a8bbc..c9a6a6606 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -54,105 +54,105 @@ static void BattleAI_DoAIProcessing(void); static void AIStackPushVar(const u8 *); static bool8 AIStackPop(void); -static void BattleAICmd_if_random_less_than(void); -static void BattleAICmd_if_random_greater_than(void); -static void BattleAICmd_if_random_equal(void); -static void BattleAICmd_if_random_not_equal(void); -static void BattleAICmd_score(void); -static void BattleAICmd_if_hp_less_than(void); -static void BattleAICmd_if_hp_more_than(void); -static void BattleAICmd_if_hp_equal(void); -static void BattleAICmd_if_hp_not_equal(void); -static void BattleAICmd_if_status(void); -static void BattleAICmd_if_not_status(void); -static void BattleAICmd_if_status2(void); -static void BattleAICmd_if_not_status2(void); -static void BattleAICmd_if_status3(void); -static void BattleAICmd_if_not_status3(void); -static void BattleAICmd_if_side_affecting(void); -static void BattleAICmd_if_not_side_affecting(void); -static void BattleAICmd_if_less_than(void); -static void BattleAICmd_if_more_than(void); -static void BattleAICmd_if_equal(void); -static void BattleAICmd_if_not_equal(void); -static void BattleAICmd_if_less_than_ptr(void); -static void BattleAICmd_if_more_than_ptr(void); -static void BattleAICmd_if_equal_ptr(void); -static void BattleAICmd_if_not_equal_ptr(void); -static void BattleAICmd_if_move(void); -static void BattleAICmd_if_not_move(void); -static void BattleAICmd_if_in_bytes(void); -static void BattleAICmd_if_not_in_bytes(void); -static void BattleAICmd_if_in_hwords(void); -static void BattleAICmd_if_not_in_hwords(void); -static void BattleAICmd_if_user_has_attacking_move(void); -static void BattleAICmd_if_user_has_no_attacking_moves(void); -static void BattleAICmd_get_turn_count(void); -static void BattleAICmd_get_type(void); -static void BattleAICmd_get_considered_move_power(void); -static void BattleAICmd_get_how_powerful_move_is(void); -static void BattleAICmd_get_last_used_battler_move(void); -static void BattleAICmd_if_equal_(void); -static void BattleAICmd_if_not_equal_(void); -static void BattleAICmd_if_user_goes(void); -static void BattleAICmd_if_user_doesnt_go(void); -static void BattleAICmd_nullsub_2A(void); -static void BattleAICmd_nullsub_2B(void); -static void BattleAICmd_count_usable_party_mons(void); -static void BattleAICmd_get_considered_move(void); -static void BattleAICmd_get_considered_move_effect(void); -static void BattleAICmd_get_ability(void); -static void BattleAICmd_get_highest_type_effectiveness(void); -static void BattleAICmd_if_type_effectiveness(void); -static void BattleAICmd_nullsub_32(void); -static void BattleAICmd_nullsub_33(void); -static void BattleAICmd_if_status_in_party(void); -static void BattleAICmd_if_status_not_in_party(void); -static void BattleAICmd_get_weather(void); -static void BattleAICmd_if_effect(void); -static void BattleAICmd_if_not_effect(void); -static void BattleAICmd_if_stat_level_less_than(void); -static void BattleAICmd_if_stat_level_more_than(void); -static void BattleAICmd_if_stat_level_equal(void); -static void BattleAICmd_if_stat_level_not_equal(void); -static void BattleAICmd_if_can_faint(void); -static void BattleAICmd_if_cant_faint(void); -static void BattleAICmd_if_has_move(void); -static void BattleAICmd_if_doesnt_have_move(void); -static void BattleAICmd_if_has_move_with_effect(void); -static void BattleAICmd_if_doesnt_have_move_with_effect(void); -static void BattleAICmd_if_any_move_disabled_or_encored(void); -static void BattleAICmd_if_curr_move_disabled_or_encored(void); -static void BattleAICmd_flee(void); -static void BattleAICmd_if_random_safari_flee(void); -static void BattleAICmd_watch(void); -static void BattleAICmd_get_hold_effect(void); -static void BattleAICmd_get_gender(void); -static void BattleAICmd_is_first_turn_for(void); -static void BattleAICmd_get_stockpile_count(void); -static void BattleAICmd_is_double_battle(void); -static void BattleAICmd_get_used_held_item(void); -static void BattleAICmd_get_move_type_from_result(void); -static void BattleAICmd_get_move_power_from_result(void); -static void BattleAICmd_get_move_effect_from_result(void); -static void BattleAICmd_get_protect_count(void); -static void BattleAICmd_nullsub_52(void); -static void BattleAICmd_nullsub_53(void); -static void BattleAICmd_nullsub_54(void); -static void BattleAICmd_nullsub_55(void); -static void BattleAICmd_nullsub_56(void); -static void BattleAICmd_nullsub_57(void); -static void BattleAICmd_call(void); -static void BattleAICmd_goto(void); -static void BattleAICmd_end(void); -static void BattleAICmd_if_level_cond(void); -static void BattleAICmd_if_target_taunted(void); -static void BattleAICmd_if_target_not_taunted(void); -static void BattleAICmd_check_ability(void); -static void BattleAICmd_is_of_type(void); -static void BattleAICmd_if_target_is_ally(void); -static void BattleAICmd_if_flash_fired(void); -static void BattleAICmd_if_holds_item(void); +static void Cmd_if_random_less_than(void); +static void Cmd_if_random_greater_than(void); +static void Cmd_if_random_equal(void); +static void Cmd_if_random_not_equal(void); +static void Cmd_score(void); +static void Cmd_if_hp_less_than(void); +static void Cmd_if_hp_more_than(void); +static void Cmd_if_hp_equal(void); +static void Cmd_if_hp_not_equal(void); +static void Cmd_if_status(void); +static void Cmd_if_not_status(void); +static void Cmd_if_status2(void); +static void Cmd_if_not_status2(void); +static void Cmd_if_status3(void); +static void Cmd_if_not_status3(void); +static void Cmd_if_side_affecting(void); +static void Cmd_if_not_side_affecting(void); +static void Cmd_if_less_than(void); +static void Cmd_if_more_than(void); +static void Cmd_if_equal(void); +static void Cmd_if_not_equal(void); +static void Cmd_if_less_than_ptr(void); +static void Cmd_if_more_than_ptr(void); +static void Cmd_if_equal_ptr(void); +static void Cmd_if_not_equal_ptr(void); +static void Cmd_if_move(void); +static void Cmd_if_not_move(void); +static void Cmd_if_in_bytes(void); +static void Cmd_if_not_in_bytes(void); +static void Cmd_if_in_hwords(void); +static void Cmd_if_not_in_hwords(void); +static void Cmd_if_user_has_attacking_move(void); +static void Cmd_if_user_has_no_attacking_moves(void); +static void Cmd_get_turn_count(void); +static void Cmd_get_type(void); +static void Cmd_get_considered_move_power(void); +static void Cmd_get_how_powerful_move_is(void); +static void Cmd_get_last_used_battler_move(void); +static void Cmd_if_equal_(void); +static void Cmd_if_not_equal_(void); +static void Cmd_if_user_goes(void); +static void Cmd_if_user_doesnt_go(void); +static void Cmd_nullsub_2A(void); +static void Cmd_nullsub_2B(void); +static void Cmd_count_usable_party_mons(void); +static void Cmd_get_considered_move(void); +static void Cmd_get_considered_move_effect(void); +static void Cmd_get_ability(void); +static void Cmd_get_highest_type_effectiveness(void); +static void Cmd_if_type_effectiveness(void); +static void Cmd_nullsub_32(void); +static void Cmd_nullsub_33(void); +static void Cmd_if_status_in_party(void); +static void Cmd_if_status_not_in_party(void); +static void Cmd_get_weather(void); +static void Cmd_if_effect(void); +static void Cmd_if_not_effect(void); +static void Cmd_if_stat_level_less_than(void); +static void Cmd_if_stat_level_more_than(void); +static void Cmd_if_stat_level_equal(void); +static void Cmd_if_stat_level_not_equal(void); +static void Cmd_if_can_faint(void); +static void Cmd_if_cant_faint(void); +static void Cmd_if_has_move(void); +static void Cmd_if_doesnt_have_move(void); +static void Cmd_if_has_move_with_effect(void); +static void Cmd_if_doesnt_have_move_with_effect(void); +static void Cmd_if_any_move_disabled_or_encored(void); +static void Cmd_if_curr_move_disabled_or_encored(void); +static void Cmd_flee(void); +static void Cmd_if_random_safari_flee(void); +static void Cmd_watch(void); +static void Cmd_get_hold_effect(void); +static void Cmd_get_gender(void); +static void Cmd_is_first_turn_for(void); +static void Cmd_get_stockpile_count(void); +static void Cmd_is_double_battle(void); +static void Cmd_get_used_held_item(void); +static void Cmd_get_move_type_from_result(void); +static void Cmd_get_move_power_from_result(void); +static void Cmd_get_move_effect_from_result(void); +static void Cmd_get_protect_count(void); +static void Cmd_nullsub_52(void); +static void Cmd_nullsub_53(void); +static void Cmd_nullsub_54(void); +static void Cmd_nullsub_55(void); +static void Cmd_nullsub_56(void); +static void Cmd_nullsub_57(void); +static void Cmd_call(void); +static void Cmd_goto(void); +static void Cmd_end(void); +static void Cmd_if_level_cond(void); +static void Cmd_if_target_taunted(void); +static void Cmd_if_target_not_taunted(void); +static void Cmd_check_ability(void); +static void Cmd_is_of_type(void); +static void Cmd_if_target_is_ally(void); +static void Cmd_if_flash_fired(void); +static void Cmd_if_holds_item(void); // ewram EWRAM_DATA const u8 *gAIScriptPtr = NULL; @@ -163,105 +163,105 @@ typedef void (*BattleAICmdFunc)(void); static const BattleAICmdFunc sBattleAICmdTable[] = { - BattleAICmd_if_random_less_than, // 0x0 - BattleAICmd_if_random_greater_than, // 0x1 - BattleAICmd_if_random_equal, // 0x2 - BattleAICmd_if_random_not_equal, // 0x3 - BattleAICmd_score, // 0x4 - BattleAICmd_if_hp_less_than, // 0x5 - BattleAICmd_if_hp_more_than, // 0x6 - BattleAICmd_if_hp_equal, // 0x7 - BattleAICmd_if_hp_not_equal, // 0x8 - BattleAICmd_if_status, // 0x9 - BattleAICmd_if_not_status, // 0xA - BattleAICmd_if_status2, // 0xB - BattleAICmd_if_not_status2, // 0xC - BattleAICmd_if_status3, // 0xD - BattleAICmd_if_not_status3, // 0xE - BattleAICmd_if_side_affecting, // 0xF - BattleAICmd_if_not_side_affecting, // 0x10 - BattleAICmd_if_less_than, // 0x11 - BattleAICmd_if_more_than, // 0x12 - BattleAICmd_if_equal, // 0x13 - BattleAICmd_if_not_equal, // 0x14 - BattleAICmd_if_less_than_ptr, // 0x15 - BattleAICmd_if_more_than_ptr, // 0x16 - BattleAICmd_if_equal_ptr, // 0x17 - BattleAICmd_if_not_equal_ptr, // 0x18 - BattleAICmd_if_move, // 0x19 - BattleAICmd_if_not_move, // 0x1A - BattleAICmd_if_in_bytes, // 0x1B - BattleAICmd_if_not_in_bytes, // 0x1C - BattleAICmd_if_in_hwords, // 0x1D - BattleAICmd_if_not_in_hwords, // 0x1E - BattleAICmd_if_user_has_attacking_move, // 0x1F - BattleAICmd_if_user_has_no_attacking_moves, // 0x20 - BattleAICmd_get_turn_count, // 0x21 - BattleAICmd_get_type, // 0x22 - BattleAICmd_get_considered_move_power, // 0x23 - BattleAICmd_get_how_powerful_move_is, // 0x24 - BattleAICmd_get_last_used_battler_move, // 0x25 - BattleAICmd_if_equal_, // 0x26 - BattleAICmd_if_not_equal_, // 0x27 - BattleAICmd_if_user_goes, // 0x28 - BattleAICmd_if_user_doesnt_go, // 0x29 - BattleAICmd_nullsub_2A, // 0x2A - BattleAICmd_nullsub_2B, // 0x2B - BattleAICmd_count_usable_party_mons, // 0x2C - BattleAICmd_get_considered_move, // 0x2D - BattleAICmd_get_considered_move_effect, // 0x2E - BattleAICmd_get_ability, // 0x2F - BattleAICmd_get_highest_type_effectiveness, // 0x30 - BattleAICmd_if_type_effectiveness, // 0x31 - BattleAICmd_nullsub_32, // 0x32 - BattleAICmd_nullsub_33, // 0x33 - BattleAICmd_if_status_in_party, // 0x34 - BattleAICmd_if_status_not_in_party, // 0x35 - BattleAICmd_get_weather, // 0x36 - BattleAICmd_if_effect, // 0x37 - BattleAICmd_if_not_effect, // 0x38 - BattleAICmd_if_stat_level_less_than, // 0x39 - BattleAICmd_if_stat_level_more_than, // 0x3A - BattleAICmd_if_stat_level_equal, // 0x3B - BattleAICmd_if_stat_level_not_equal, // 0x3C - BattleAICmd_if_can_faint, // 0x3D - BattleAICmd_if_cant_faint, // 0x3E - BattleAICmd_if_has_move, // 0x3F - BattleAICmd_if_doesnt_have_move, // 0x40 - BattleAICmd_if_has_move_with_effect, // 0x41 - BattleAICmd_if_doesnt_have_move_with_effect, // 0x42 - BattleAICmd_if_any_move_disabled_or_encored, // 0x43 - BattleAICmd_if_curr_move_disabled_or_encored, // 0x44 - BattleAICmd_flee, // 0x45 - BattleAICmd_if_random_safari_flee, // 0x46 - BattleAICmd_watch, // 0x47 - BattleAICmd_get_hold_effect, // 0x48 - BattleAICmd_get_gender, // 0x49 - BattleAICmd_is_first_turn_for, // 0x4A - BattleAICmd_get_stockpile_count, // 0x4B - BattleAICmd_is_double_battle, // 0x4C - BattleAICmd_get_used_held_item, // 0x4D - BattleAICmd_get_move_type_from_result, // 0x4E - BattleAICmd_get_move_power_from_result, // 0x4F - BattleAICmd_get_move_effect_from_result, // 0x50 - BattleAICmd_get_protect_count, // 0x51 - BattleAICmd_nullsub_52, // 0x52 - BattleAICmd_nullsub_53, // 0x53 - BattleAICmd_nullsub_54, // 0x54 - BattleAICmd_nullsub_55, // 0x55 - BattleAICmd_nullsub_56, // 0x56 - BattleAICmd_nullsub_57, // 0x57 - BattleAICmd_call, // 0x58 - BattleAICmd_goto, // 0x59 - BattleAICmd_end, // 0x5A - BattleAICmd_if_level_cond, // 0x5B - BattleAICmd_if_target_taunted, // 0x5C - BattleAICmd_if_target_not_taunted, // 0x5D - BattleAICmd_if_target_is_ally, // 0x5E - BattleAICmd_is_of_type, // 0x5F - BattleAICmd_check_ability, // 0x60 - BattleAICmd_if_flash_fired, // 0x61 - BattleAICmd_if_holds_item, // 0x62 + Cmd_if_random_less_than, // 0x0 + Cmd_if_random_greater_than, // 0x1 + Cmd_if_random_equal, // 0x2 + Cmd_if_random_not_equal, // 0x3 + Cmd_score, // 0x4 + Cmd_if_hp_less_than, // 0x5 + Cmd_if_hp_more_than, // 0x6 + Cmd_if_hp_equal, // 0x7 + Cmd_if_hp_not_equal, // 0x8 + Cmd_if_status, // 0x9 + Cmd_if_not_status, // 0xA + Cmd_if_status2, // 0xB + Cmd_if_not_status2, // 0xC + Cmd_if_status3, // 0xD + Cmd_if_not_status3, // 0xE + Cmd_if_side_affecting, // 0xF + Cmd_if_not_side_affecting, // 0x10 + Cmd_if_less_than, // 0x11 + Cmd_if_more_than, // 0x12 + Cmd_if_equal, // 0x13 + Cmd_if_not_equal, // 0x14 + Cmd_if_less_than_ptr, // 0x15 + Cmd_if_more_than_ptr, // 0x16 + Cmd_if_equal_ptr, // 0x17 + Cmd_if_not_equal_ptr, // 0x18 + Cmd_if_move, // 0x19 + Cmd_if_not_move, // 0x1A + Cmd_if_in_bytes, // 0x1B + Cmd_if_not_in_bytes, // 0x1C + Cmd_if_in_hwords, // 0x1D + Cmd_if_not_in_hwords, // 0x1E + Cmd_if_user_has_attacking_move, // 0x1F + Cmd_if_user_has_no_attacking_moves, // 0x20 + Cmd_get_turn_count, // 0x21 + Cmd_get_type, // 0x22 + Cmd_get_considered_move_power, // 0x23 + Cmd_get_how_powerful_move_is, // 0x24 + Cmd_get_last_used_battler_move, // 0x25 + Cmd_if_equal_, // 0x26 + Cmd_if_not_equal_, // 0x27 + Cmd_if_user_goes, // 0x28 + Cmd_if_user_doesnt_go, // 0x29 + Cmd_nullsub_2A, // 0x2A + Cmd_nullsub_2B, // 0x2B + Cmd_count_usable_party_mons, // 0x2C + Cmd_get_considered_move, // 0x2D + Cmd_get_considered_move_effect, // 0x2E + Cmd_get_ability, // 0x2F + Cmd_get_highest_type_effectiveness, // 0x30 + Cmd_if_type_effectiveness, // 0x31 + Cmd_nullsub_32, // 0x32 + Cmd_nullsub_33, // 0x33 + Cmd_if_status_in_party, // 0x34 + Cmd_if_status_not_in_party, // 0x35 + Cmd_get_weather, // 0x36 + Cmd_if_effect, // 0x37 + Cmd_if_not_effect, // 0x38 + Cmd_if_stat_level_less_than, // 0x39 + Cmd_if_stat_level_more_than, // 0x3A + Cmd_if_stat_level_equal, // 0x3B + Cmd_if_stat_level_not_equal, // 0x3C + Cmd_if_can_faint, // 0x3D + Cmd_if_cant_faint, // 0x3E + Cmd_if_has_move, // 0x3F + Cmd_if_doesnt_have_move, // 0x40 + Cmd_if_has_move_with_effect, // 0x41 + Cmd_if_doesnt_have_move_with_effect, // 0x42 + Cmd_if_any_move_disabled_or_encored, // 0x43 + Cmd_if_curr_move_disabled_or_encored, // 0x44 + Cmd_flee, // 0x45 + Cmd_if_random_safari_flee, // 0x46 + Cmd_watch, // 0x47 + Cmd_get_hold_effect, // 0x48 + Cmd_get_gender, // 0x49 + Cmd_is_first_turn_for, // 0x4A + Cmd_get_stockpile_count, // 0x4B + Cmd_is_double_battle, // 0x4C + Cmd_get_used_held_item, // 0x4D + Cmd_get_move_type_from_result, // 0x4E + Cmd_get_move_power_from_result, // 0x4F + Cmd_get_move_effect_from_result, // 0x50 + Cmd_get_protect_count, // 0x51 + Cmd_nullsub_52, // 0x52 + Cmd_nullsub_53, // 0x53 + Cmd_nullsub_54, // 0x54 + Cmd_nullsub_55, // 0x55 + Cmd_nullsub_56, // 0x56 + Cmd_nullsub_57, // 0x57 + Cmd_call, // 0x58 + Cmd_goto, // 0x59 + Cmd_end, // 0x5A + Cmd_if_level_cond, // 0x5B + Cmd_if_target_taunted, // 0x5C + Cmd_if_target_not_taunted, // 0x5D + Cmd_if_target_is_ally, // 0x5E + Cmd_is_of_type, // 0x5F + Cmd_check_ability, // 0x60 + Cmd_if_flash_fired, // 0x61 + Cmd_if_holds_item, // 0x62 }; static const u16 sDiscouragedPowerfulMoveEffects[] = @@ -653,7 +653,7 @@ void ClearBattlerItemEffectHistory(u8 battlerId) BATTLE_HISTORY->itemEffects[battlerId] = 0; } -static void BattleAICmd_if_random_less_than(void) +static void Cmd_if_random_less_than(void) { u16 random = Random(); @@ -663,7 +663,7 @@ static void BattleAICmd_if_random_less_than(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_random_greater_than(void) +static void Cmd_if_random_greater_than(void) { u16 random = Random(); @@ -673,7 +673,7 @@ static void BattleAICmd_if_random_greater_than(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_random_equal(void) +static void Cmd_if_random_equal(void) { u16 random = Random(); @@ -683,7 +683,7 @@ static void BattleAICmd_if_random_equal(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_random_not_equal(void) +static void Cmd_if_random_not_equal(void) { u16 random = Random(); @@ -693,7 +693,7 @@ static void BattleAICmd_if_random_not_equal(void) gAIScriptPtr += 6; } -static void BattleAICmd_score(void) +static void Cmd_score(void) { AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] += gAIScriptPtr[1]; // Add the result to the array of the move consider's score. @@ -703,7 +703,7 @@ static void BattleAICmd_score(void) gAIScriptPtr += 2; // AI return. } -static void BattleAICmd_if_hp_less_than(void) +static void Cmd_if_hp_less_than(void) { u16 battlerId; @@ -718,7 +718,7 @@ static void BattleAICmd_if_hp_less_than(void) gAIScriptPtr += 7; } -static void BattleAICmd_if_hp_more_than(void) +static void Cmd_if_hp_more_than(void) { u16 battlerId; @@ -733,7 +733,7 @@ static void BattleAICmd_if_hp_more_than(void) gAIScriptPtr += 7; } -static void BattleAICmd_if_hp_equal(void) +static void Cmd_if_hp_equal(void) { u16 battlerId; @@ -748,7 +748,7 @@ static void BattleAICmd_if_hp_equal(void) gAIScriptPtr += 7; } -static void BattleAICmd_if_hp_not_equal(void) +static void Cmd_if_hp_not_equal(void) { u16 battlerId; @@ -763,7 +763,7 @@ static void BattleAICmd_if_hp_not_equal(void) gAIScriptPtr += 7; } -static void BattleAICmd_if_status(void) +static void Cmd_if_status(void) { u16 battlerId; u32 status; @@ -781,7 +781,7 @@ static void BattleAICmd_if_status(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_not_status(void) +static void Cmd_if_not_status(void) { u16 battlerId; u32 status; @@ -799,7 +799,7 @@ static void BattleAICmd_if_not_status(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_status2(void) +static void Cmd_if_status2(void) { u16 battlerId; u32 status; @@ -817,7 +817,7 @@ static void BattleAICmd_if_status2(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_not_status2(void) +static void Cmd_if_not_status2(void) { u16 battlerId; u32 status; @@ -835,7 +835,7 @@ static void BattleAICmd_if_not_status2(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_status3(void) +static void Cmd_if_status3(void) { u16 battlerId; u32 status; @@ -853,7 +853,7 @@ static void BattleAICmd_if_status3(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_not_status3(void) +static void Cmd_if_not_status3(void) { u16 battlerId; u32 status; @@ -871,7 +871,7 @@ static void BattleAICmd_if_not_status3(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_side_affecting(void) +static void Cmd_if_side_affecting(void) { u16 battlerId; u32 side, status; @@ -890,7 +890,7 @@ static void BattleAICmd_if_side_affecting(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_not_side_affecting(void) +static void Cmd_if_not_side_affecting(void) { u16 battlerId; u32 side, status; @@ -909,7 +909,7 @@ static void BattleAICmd_if_not_side_affecting(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_less_than(void) +static void Cmd_if_less_than(void) { if (AI_THINKING_STRUCT->funcResult < gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -917,7 +917,7 @@ static void BattleAICmd_if_less_than(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_more_than(void) +static void Cmd_if_more_than(void) { if (AI_THINKING_STRUCT->funcResult > gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -925,7 +925,7 @@ static void BattleAICmd_if_more_than(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_equal(void) +static void Cmd_if_equal(void) { if (AI_THINKING_STRUCT->funcResult == gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -933,7 +933,7 @@ static void BattleAICmd_if_equal(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_not_equal(void) +static void Cmd_if_not_equal(void) { if (AI_THINKING_STRUCT->funcResult != gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -941,7 +941,7 @@ static void BattleAICmd_if_not_equal(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_less_than_ptr(void) +static void Cmd_if_less_than_ptr(void) { const u8 *value = T1_READ_PTR(gAIScriptPtr + 1); @@ -951,7 +951,7 @@ static void BattleAICmd_if_less_than_ptr(void) gAIScriptPtr += 9; } -static void BattleAICmd_if_more_than_ptr(void) +static void Cmd_if_more_than_ptr(void) { const u8 *value = T1_READ_PTR(gAIScriptPtr + 1); @@ -961,7 +961,7 @@ static void BattleAICmd_if_more_than_ptr(void) gAIScriptPtr += 9; } -static void BattleAICmd_if_equal_ptr(void) +static void Cmd_if_equal_ptr(void) { const u8 *value = T1_READ_PTR(gAIScriptPtr + 1); @@ -971,7 +971,7 @@ static void BattleAICmd_if_equal_ptr(void) gAIScriptPtr += 9; } -static void BattleAICmd_if_not_equal_ptr(void) +static void Cmd_if_not_equal_ptr(void) { const u8 *value = T1_READ_PTR(gAIScriptPtr + 1); @@ -981,7 +981,7 @@ static void BattleAICmd_if_not_equal_ptr(void) gAIScriptPtr += 9; } -static void BattleAICmd_if_move(void) +static void Cmd_if_move(void) { u16 move = T1_READ_16(gAIScriptPtr + 1); @@ -991,7 +991,7 @@ static void BattleAICmd_if_move(void) gAIScriptPtr += 7; } -static void BattleAICmd_if_not_move(void) +static void Cmd_if_not_move(void) { u16 move = T1_READ_16(gAIScriptPtr + 1); @@ -1001,7 +1001,7 @@ static void BattleAICmd_if_not_move(void) gAIScriptPtr += 7; } -static void BattleAICmd_if_in_bytes(void) +static void Cmd_if_in_bytes(void) { const u8 *ptr = T1_READ_PTR(gAIScriptPtr + 1); @@ -1017,7 +1017,7 @@ static void BattleAICmd_if_in_bytes(void) gAIScriptPtr += 9; } -static void BattleAICmd_if_not_in_bytes(void) +static void Cmd_if_not_in_bytes(void) { const u8 *ptr = T1_READ_PTR(gAIScriptPtr + 1); @@ -1033,7 +1033,7 @@ static void BattleAICmd_if_not_in_bytes(void) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 5); } -static void BattleAICmd_if_in_hwords(void) +static void Cmd_if_in_hwords(void) { const u16 *ptr = (const u16 *)T1_READ_PTR(gAIScriptPtr + 1); @@ -1049,7 +1049,7 @@ static void BattleAICmd_if_in_hwords(void) gAIScriptPtr += 9; } -static void BattleAICmd_if_not_in_hwords(void) +static void Cmd_if_not_in_hwords(void) { const u16 *ptr = (const u16 *)T1_READ_PTR(gAIScriptPtr + 1); @@ -1065,7 +1065,7 @@ static void BattleAICmd_if_not_in_hwords(void) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 5); } -static void BattleAICmd_if_user_has_attacking_move(void) +static void Cmd_if_user_has_attacking_move(void) { s32 i; @@ -1082,7 +1082,7 @@ static void BattleAICmd_if_user_has_attacking_move(void) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); } -static void BattleAICmd_if_user_has_no_attacking_moves(void) +static void Cmd_if_user_has_no_attacking_moves(void) { s32 i; @@ -1099,13 +1099,13 @@ static void BattleAICmd_if_user_has_no_attacking_moves(void) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); } -static void BattleAICmd_get_turn_count(void) +static void Cmd_get_turn_count(void) { AI_THINKING_STRUCT->funcResult = gBattleResults.battleTurnCounter; gAIScriptPtr += 1; } -static void BattleAICmd_get_type(void) +static void Cmd_get_type(void) { u8 typeVar = gAIScriptPtr[1]; @@ -1146,7 +1146,7 @@ static u8 BattleAI_GetWantedBattler(u8 wantedBattler) } } -static void BattleAICmd_is_of_type(void) +static void Cmd_is_of_type(void) { u8 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); @@ -1158,13 +1158,13 @@ static void BattleAICmd_is_of_type(void) gAIScriptPtr += 3; } -static void BattleAICmd_get_considered_move_power(void) +static void Cmd_get_considered_move_power(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power; gAIScriptPtr += 1; } -static void BattleAICmd_get_how_powerful_move_is(void) +static void Cmd_get_how_powerful_move_is(void) { s32 i, checkedMove; s32 moveDmgs[MAX_MON_MOVES]; @@ -1228,7 +1228,7 @@ static void BattleAICmd_get_how_powerful_move_is(void) gAIScriptPtr++; } -static void BattleAICmd_get_last_used_battler_move(void) +static void Cmd_get_last_used_battler_move(void) { if (gAIScriptPtr[1] == AI_USER) AI_THINKING_STRUCT->funcResult = gLastMoves[sBattler_AI]; @@ -1238,7 +1238,7 @@ static void BattleAICmd_get_last_used_battler_move(void) gAIScriptPtr += 2; } -static void BattleAICmd_if_equal_(void) // Same as if_equal. +static void Cmd_if_equal_(void) // Same as if_equal. { if (gAIScriptPtr[1] == AI_THINKING_STRUCT->funcResult) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -1246,7 +1246,7 @@ static void BattleAICmd_if_equal_(void) // Same as if_equal. gAIScriptPtr += 6; } -static void BattleAICmd_if_not_equal_(void) // Same as if_not_equal. +static void Cmd_if_not_equal_(void) // Same as if_not_equal. { if (gAIScriptPtr[1] != AI_THINKING_STRUCT->funcResult) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -1254,7 +1254,7 @@ static void BattleAICmd_if_not_equal_(void) // Same as if_not_equal. gAIScriptPtr += 6; } -static void BattleAICmd_if_user_goes(void) +static void Cmd_if_user_goes(void) { if (GetWhoStrikesFirst(sBattler_AI, gBattlerTarget, TRUE) == gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -1262,7 +1262,7 @@ static void BattleAICmd_if_user_goes(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_user_doesnt_go(void) +static void Cmd_if_user_doesnt_go(void) { if (GetWhoStrikesFirst(sBattler_AI, gBattlerTarget, TRUE) != gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -1270,15 +1270,15 @@ static void BattleAICmd_if_user_doesnt_go(void) gAIScriptPtr += 6; } -static void BattleAICmd_nullsub_2A(void) +static void Cmd_nullsub_2A(void) { } -static void BattleAICmd_nullsub_2B(void) +static void Cmd_nullsub_2B(void) { } -static void BattleAICmd_count_usable_party_mons(void) +static void Cmd_count_usable_party_mons(void) { u8 battlerId; u8 battlerOnField1, battlerOnField2; @@ -1324,19 +1324,19 @@ static void BattleAICmd_count_usable_party_mons(void) gAIScriptPtr += 2; } -static void BattleAICmd_get_considered_move(void) +static void Cmd_get_considered_move(void) { AI_THINKING_STRUCT->funcResult = AI_THINKING_STRUCT->moveConsidered; gAIScriptPtr += 1; } -static void BattleAICmd_get_considered_move_effect(void) +static void Cmd_get_considered_move_effect(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect; gAIScriptPtr += 1; } -static void BattleAICmd_get_ability(void) +static void Cmd_get_ability(void) { u8 battlerId; @@ -1393,7 +1393,7 @@ static void BattleAICmd_get_ability(void) gAIScriptPtr += 2; } -static void BattleAICmd_check_ability(void) +static void Cmd_check_ability(void) { u32 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); u32 ability = gAIScriptPtr[2]; @@ -1453,7 +1453,7 @@ static void BattleAICmd_check_ability(void) gAIScriptPtr += 3; } -static void BattleAICmd_get_highest_type_effectiveness(void) +static void Cmd_get_highest_type_effectiveness(void) { s32 i; u8 *dynamicMoveType; @@ -1495,7 +1495,7 @@ static void BattleAICmd_get_highest_type_effectiveness(void) gAIScriptPtr += 1; } -static void BattleAICmd_if_type_effectiveness(void) +static void Cmd_if_type_effectiveness(void) { u8 damageVar; @@ -1531,15 +1531,15 @@ static void BattleAICmd_if_type_effectiveness(void) gAIScriptPtr += 6; } -static void BattleAICmd_nullsub_32(void) +static void Cmd_nullsub_32(void) { } -static void BattleAICmd_nullsub_33(void) +static void Cmd_nullsub_33(void) { } -static void BattleAICmd_if_status_in_party(void) +static void Cmd_if_status_in_party(void) { struct Pokemon *party; s32 i; @@ -1576,7 +1576,7 @@ static void BattleAICmd_if_status_in_party(void) gAIScriptPtr += 10; } -static void BattleAICmd_if_status_not_in_party(void) +static void Cmd_if_status_not_in_party(void) { struct Pokemon *party; s32 i; @@ -1613,7 +1613,7 @@ static void BattleAICmd_if_status_not_in_party(void) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 6); } -static void BattleAICmd_get_weather(void) +static void Cmd_get_weather(void) { if (gBattleWeather & WEATHER_RAIN_ANY) AI_THINKING_STRUCT->funcResult = AI_WEATHER_RAIN; @@ -1627,7 +1627,7 @@ static void BattleAICmd_get_weather(void) gAIScriptPtr += 1; } -static void BattleAICmd_if_effect(void) +static void Cmd_if_effect(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -1635,7 +1635,7 @@ static void BattleAICmd_if_effect(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_not_effect(void) +static void Cmd_if_not_effect(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect != gAIScriptPtr[1]) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); @@ -1643,7 +1643,7 @@ static void BattleAICmd_if_not_effect(void) gAIScriptPtr += 6; } -static void BattleAICmd_if_stat_level_less_than(void) +static void Cmd_if_stat_level_less_than(void) { u32 battlerId; @@ -1658,7 +1658,7 @@ static void BattleAICmd_if_stat_level_less_than(void) gAIScriptPtr += 8; } -static void BattleAICmd_if_stat_level_more_than(void) +static void Cmd_if_stat_level_more_than(void) { u32 battlerId; @@ -1673,7 +1673,7 @@ static void BattleAICmd_if_stat_level_more_than(void) gAIScriptPtr += 8; } -static void BattleAICmd_if_stat_level_equal(void) +static void Cmd_if_stat_level_equal(void) { u32 battlerId; @@ -1688,7 +1688,7 @@ static void BattleAICmd_if_stat_level_equal(void) gAIScriptPtr += 8; } -static void BattleAICmd_if_stat_level_not_equal(void) +static void Cmd_if_stat_level_not_equal(void) { u32 battlerId; @@ -1703,7 +1703,7 @@ static void BattleAICmd_if_stat_level_not_equal(void) gAIScriptPtr += 8; } -static void BattleAICmd_if_can_faint(void) +static void Cmd_if_can_faint(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) { @@ -1732,7 +1732,7 @@ static void BattleAICmd_if_can_faint(void) gAIScriptPtr += 5; } -static void BattleAICmd_if_cant_faint(void) +static void Cmd_if_cant_faint(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) { @@ -1759,7 +1759,7 @@ static void BattleAICmd_if_cant_faint(void) gAIScriptPtr += 5; } -static void BattleAICmd_if_has_move(void) +static void Cmd_if_has_move(void) { s32 i; const u16 *movePtr = (u16 *)(gAIScriptPtr + 2); @@ -1811,7 +1811,7 @@ static void BattleAICmd_if_has_move(void) } } -static void BattleAICmd_if_doesnt_have_move(void) +static void Cmd_if_doesnt_have_move(void) { s32 i; const u16 *movePtr = (u16 *)(gAIScriptPtr + 2); @@ -1845,7 +1845,7 @@ static void BattleAICmd_if_doesnt_have_move(void) } } -static void BattleAICmd_if_has_move_with_effect(void) +static void Cmd_if_has_move_with_effect(void) { s32 i; @@ -1879,7 +1879,7 @@ static void BattleAICmd_if_has_move_with_effect(void) } } -static void BattleAICmd_if_doesnt_have_move_with_effect(void) +static void Cmd_if_doesnt_have_move_with_effect(void) { s32 i; @@ -1912,7 +1912,7 @@ static void BattleAICmd_if_doesnt_have_move_with_effect(void) } } -static void BattleAICmd_if_any_move_disabled_or_encored(void) +static void Cmd_if_any_move_disabled_or_encored(void) { u8 battlerId; @@ -1941,7 +1941,7 @@ static void BattleAICmd_if_any_move_disabled_or_encored(void) } } -static void BattleAICmd_if_curr_move_disabled_or_encored(void) +static void Cmd_if_curr_move_disabled_or_encored(void) { switch (gAIScriptPtr[1]) { @@ -1963,12 +1963,12 @@ static void BattleAICmd_if_curr_move_disabled_or_encored(void) } } -static void BattleAICmd_flee(void) +static void Cmd_flee(void) { AI_THINKING_STRUCT->aiAction |= (AI_ACTION_DONE | AI_ACTION_FLEE | AI_ACTION_DO_NOT_ATTACK); } -static void BattleAICmd_if_random_safari_flee(void) +static void Cmd_if_random_safari_flee(void) { u8 safariFleeRate = gBattleStruct->safariEscapeFactor * 5; // Safari flee rate, from 0-20. @@ -1978,12 +1978,12 @@ static void BattleAICmd_if_random_safari_flee(void) gAIScriptPtr += 5; } -static void BattleAICmd_watch(void) +static void Cmd_watch(void) { AI_THINKING_STRUCT->aiAction |= (AI_ACTION_DONE | AI_ACTION_WATCH | AI_ACTION_DO_NOT_ATTACK); } -static void BattleAICmd_get_hold_effect(void) +static void Cmd_get_hold_effect(void) { u8 battlerId; @@ -2000,7 +2000,7 @@ static void BattleAICmd_get_hold_effect(void) gAIScriptPtr += 2; } -static void BattleAICmd_if_holds_item(void) +static void Cmd_if_holds_item(void) { u8 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); u16 item; @@ -2021,7 +2021,7 @@ static void BattleAICmd_if_holds_item(void) gAIScriptPtr += 8; } -static void BattleAICmd_get_gender(void) +static void Cmd_get_gender(void) { u8 battlerId; @@ -2035,7 +2035,7 @@ static void BattleAICmd_get_gender(void) gAIScriptPtr += 2; } -static void BattleAICmd_is_first_turn_for(void) +static void Cmd_is_first_turn_for(void) { u8 battlerId; @@ -2049,7 +2049,7 @@ static void BattleAICmd_is_first_turn_for(void) gAIScriptPtr += 2; } -static void BattleAICmd_get_stockpile_count(void) +static void Cmd_get_stockpile_count(void) { u8 battlerId; @@ -2063,14 +2063,14 @@ static void BattleAICmd_get_stockpile_count(void) gAIScriptPtr += 2; } -static void BattleAICmd_is_double_battle(void) +static void Cmd_is_double_battle(void) { AI_THINKING_STRUCT->funcResult = gBattleTypeFlags & BATTLE_TYPE_DOUBLE; gAIScriptPtr += 1; } -static void BattleAICmd_get_used_held_item(void) +static void Cmd_get_used_held_item(void) { u8 battlerId; @@ -2089,28 +2089,28 @@ static void BattleAICmd_get_used_held_item(void) gAIScriptPtr += 2; } -static void BattleAICmd_get_move_type_from_result(void) +static void Cmd_get_move_type_from_result(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].type; gAIScriptPtr += 1; } -static void BattleAICmd_get_move_power_from_result(void) +static void Cmd_get_move_power_from_result(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].power; gAIScriptPtr += 1; } -static void BattleAICmd_get_move_effect_from_result(void) +static void Cmd_get_move_effect_from_result(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].effect; gAIScriptPtr += 1; } -static void BattleAICmd_get_protect_count(void) +static void Cmd_get_protect_count(void) { u8 battlerId; @@ -2124,48 +2124,48 @@ static void BattleAICmd_get_protect_count(void) gAIScriptPtr += 2; } -static void BattleAICmd_nullsub_52(void) +static void Cmd_nullsub_52(void) { } -static void BattleAICmd_nullsub_53(void) +static void Cmd_nullsub_53(void) { } -static void BattleAICmd_nullsub_54(void) +static void Cmd_nullsub_54(void) { } -static void BattleAICmd_nullsub_55(void) +static void Cmd_nullsub_55(void) { } -static void BattleAICmd_nullsub_56(void) +static void Cmd_nullsub_56(void) { } -static void BattleAICmd_nullsub_57(void) +static void Cmd_nullsub_57(void) { } -static void BattleAICmd_call(void) +static void Cmd_call(void) { AIStackPushVar(gAIScriptPtr + 5); gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); } -static void BattleAICmd_goto(void) +static void Cmd_goto(void) { gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); } -static void BattleAICmd_end(void) +static void Cmd_end(void) { if (AIStackPop() == 0) AI_THINKING_STRUCT->aiAction |= AI_ACTION_DONE; } -static void BattleAICmd_if_level_cond(void) +static void Cmd_if_level_cond(void) { switch (gAIScriptPtr[1]) { @@ -2190,7 +2190,7 @@ static void BattleAICmd_if_level_cond(void) } } -static void BattleAICmd_if_target_taunted(void) +static void Cmd_if_target_taunted(void) { if (gDisableStructs[gBattlerTarget].tauntTimer != 0) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); @@ -2198,7 +2198,7 @@ static void BattleAICmd_if_target_taunted(void) gAIScriptPtr += 5; } -static void BattleAICmd_if_target_not_taunted(void) +static void Cmd_if_target_not_taunted(void) { if (gDisableStructs[gBattlerTarget].tauntTimer == 0) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); @@ -2206,7 +2206,7 @@ static void BattleAICmd_if_target_not_taunted(void) gAIScriptPtr += 5; } -static void BattleAICmd_if_target_is_ally(void) +static void Cmd_if_target_is_ally(void) { if ((sBattler_AI & BIT_SIDE) == (gBattlerTarget & BIT_SIDE)) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); @@ -2214,7 +2214,7 @@ static void BattleAICmd_if_target_is_ally(void) gAIScriptPtr += 5; } -static void BattleAICmd_if_flash_fired(void) +static void Cmd_if_flash_fired(void) { u8 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); diff --git a/src/battle_main.c b/src/battle_main.c index 8a4479119..ab8c73ed4 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3954,7 +3954,7 @@ static void TryDoEventsBeforeFirstTurn(void) *(&gBattleStruct->turnEffectsBattlerId) = 0; *(&gBattleStruct->wishPerishSongState) = 0; *(&gBattleStruct->wishPerishSongBattlerId) = 0; - gBattleScripting.atk49_state = 0; + gBattleScripting.moveendState = 0; gBattleStruct->faintedActionsState = 0; gBattleStruct->turnCountersTracker = 0; gMoveResultFlags = 0; @@ -4017,7 +4017,7 @@ void BattleTurnPassed(void) gHitMarker &= ~(HITMARKER_x100000); gBattleScripting.animTurn = 0; gBattleScripting.animTargetsHit = 0; - gBattleScripting.atk49_state = 0; + gBattleScripting.moveendState = 0; gBattleMoveDamage = 0; gMoveResultFlags = 0; @@ -5885,7 +5885,7 @@ static void HandleAction_ActionFinished(void) gLastHitByType[gBattlerAttacker] = 0; gBattleStruct->dynamicMoveType = 0; gDynamicBasePower = 0; - gBattleScripting.atk49_state = 0; + gBattleScripting.moveendState = 0; gBattleCommunication[3] = 0; gBattleCommunication[4] = 0; gBattleScripting.multihitMoveEffect = 0; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 82461be32..a6c0f1ee7 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -77,507 +77,507 @@ static void PutLevelAndGenderOnLvlUpBox(void); static void SpriteCB_MonIconOnLvlUpBox(struct Sprite* sprite); -static void atk00_attackcanceler(void); -static void atk01_accuracycheck(void); -static void atk02_attackstring(void); -static void atk03_ppreduce(void); -static void atk04_critcalc(void); -static void atk05_damagecalc(void); -static void atk06_typecalc(void); -static void atk07_adjustnormaldamage(void); -static void atk08_adjustnormaldamage2(void); -static void atk09_attackanimation(void); -static void atk0A_waitanimation(void); -static void atk0B_healthbarupdate(void); -static void atk0C_datahpupdate(void); -static void atk0D_critmessage(void); -static void atk0E_effectivenesssound(void); -static void atk0F_resultmessage(void); -static void atk10_printstring(void); -static void atk11_printselectionstring(void); -static void atk12_waitmessage(void); -static void atk13_printfromtable(void); -static void atk14_printselectionstringfromtable(void); -static void atk15_seteffectwithchance(void); -static void atk16_seteffectprimary(void); -static void atk17_seteffectsecondary(void); -static void atk18_clearstatusfromeffect(void); -static void atk19_tryfaintmon(void); -static void atk1A_dofaintanimation(void); -static void atk1B_cleareffectsonfaint(void); -static void atk1C_jumpifstatus(void); -static void atk1D_jumpifstatus2(void); -static void atk1E_jumpifability(void); -static void atk1F_jumpifsideaffecting(void); -static void atk20_jumpifstat(void); -static void atk21_jumpifstatus3condition(void); -static void atk22_jumpiftype(void); -static void atk23_getexp(void); -static void atk24(void); -static void atk25_movevaluescleanup(void); -static void atk26_setmultihit(void); -static void atk27_decrementmultihit(void); -static void atk28_goto(void); -static void atk29_jumpifbyte(void); -static void atk2A_jumpifhalfword(void); -static void atk2B_jumpifword(void); -static void atk2C_jumpifarrayequal(void); -static void atk2D_jumpifarraynotequal(void); -static void atk2E_setbyte(void); -static void atk2F_addbyte(void); -static void atk30_subbyte(void); -static void atk31_copyarray(void); -static void atk32_copyarraywithindex(void); -static void atk33_orbyte(void); -static void atk34_orhalfword(void); -static void atk35_orword(void); -static void atk36_bicbyte(void); -static void atk37_bichalfword(void); -static void atk38_bicword(void); -static void atk39_pause(void); -static void atk3A_waitstate(void); -static void atk3B_healthbar_update(void); -static void atk3C_return(void); -static void atk3D_end(void); -static void atk3E_end2(void); -static void atk3F_end3(void); -static void atk40_jumpifaffectedbyprotect(void); -static void atk41_call(void); -static void atk42_jumpiftype2(void); -static void atk43_jumpifabilitypresent(void); -static void atk44_endselectionscript(void); -static void atk45_playanimation(void); -static void atk46_playanimation2(void); -static void atk47_setgraphicalstatchangevalues(void); -static void atk48_playstatchangeanimation(void); -static void atk49_moveend(void); -static void atk4A_typecalc2(void); -static void atk4B_returnatktoball(void); -static void atk4C_getswitchedmondata(void); -static void atk4D_switchindataupdate(void); -static void atk4E_switchinanim(void); -static void atk4F_jumpifcantswitch(void); -static void atk50_openpartyscreen(void); -static void atk51_switchhandleorder(void); -static void atk52_switchineffects(void); -static void atk53_trainerslidein(void); -static void atk54_playse(void); -static void atk55_fanfare(void); -static void atk56_playfaintcry(void); -static void atk57(void); -static void atk58_returntoball(void); -static void atk59_handlelearnnewmove(void); -static void atk5A_yesnoboxlearnmove(void); -static void atk5B_yesnoboxstoplearningmove(void); -static void atk5C_hitanimation(void); -static void atk5D_getmoneyreward(void); -static void atk5E(void); -static void atk5F_swapattackerwithtarget(void); -static void atk60_incrementgamestat(void); -static void atk61_drawpartystatussummary(void); -static void atk62_hidepartystatussummary(void); -static void atk63_jumptocalledmove(void); -static void atk64_statusanimation(void); -static void atk65_status2animation(void); -static void atk66_chosenstatusanimation(void); -static void atk67_yesnobox(void); -static void atk68_cancelallactions(void); -static void atk69_adjustsetdamage(void); -static void atk6A_removeitem(void); -static void atk6B_atknameinbuff1(void); -static void atk6C_drawlvlupbox(void); -static void atk6D_resetsentmonsvalue(void); -static void atk6E_setatktoplayer0(void); -static void atk6F_makevisible(void); -static void atk70_recordlastability(void); -static void atk71_buffermovetolearn(void); -static void atk72_jumpifplayerran(void); -static void atk73_hpthresholds(void); -static void atk74_hpthresholds2(void); -static void atk75_useitemonopponent(void); -static void atk76_various(void); -static void atk77_setprotectlike(void); -static void atk78_faintifabilitynotdamp(void); -static void atk79_setatkhptozero(void); -static void atk7A_jumpifnexttargetvalid(void); -static void atk7B_tryhealhalfhealth(void); -static void atk7C_trymirrormove(void); -static void atk7D_setrain(void); -static void atk7E_setreflect(void); -static void atk7F_setseeded(void); -static void atk80_manipulatedamage(void); -static void atk81_trysetrest(void); -static void atk82_jumpifnotfirstturn(void); -static void atk83_nop(void); -static void atk84_jumpifcantmakeasleep(void); -static void atk85_stockpile(void); -static void atk86_stockpiletobasedamage(void); -static void atk87_stockpiletohpheal(void); -static void atk88_negativedamage(void); -static void atk89_statbuffchange(void); -static void atk8A_normalisebuffs(void); -static void atk8B_setbide(void); -static void atk8C_confuseifrepeatingattackends(void); -static void atk8D_setmultihitcounter(void); -static void atk8E_initmultihitstring(void); -static void atk8F_forcerandomswitch(void); -static void atk90_tryconversiontypechange(void); -static void atk91_givepaydaymoney(void); -static void atk92_setlightscreen(void); -static void atk93_tryKO(void); -static void atk94_damagetohalftargethp(void); -static void atk95_setsandstorm(void); -static void atk96_weatherdamage(void); -static void atk97_tryinfatuating(void); -static void atk98_updatestatusicon(void); -static void atk99_setmist(void); -static void atk9A_setfocusenergy(void); -static void atk9B_transformdataexecution(void); -static void atk9C_setsubstitute(void); -static void atk9D_mimicattackcopy(void); -static void atk9E_metronome(void); -static void atk9F_dmgtolevel(void); -static void atkA0_psywavedamageeffect(void); -static void atkA1_counterdamagecalculator(void); -static void atkA2_mirrorcoatdamagecalculator(void); -static void atkA3_disablelastusedattack(void); -static void atkA4_trysetencore(void); -static void atkA5_painsplitdmgcalc(void); -static void atkA6_settypetorandomresistance(void); -static void atkA7_setalwayshitflag(void); -static void atkA8_copymovepermanently(void); -static void atkA9_trychoosesleeptalkmove(void); -static void atkAA_setdestinybond(void); -static void atkAB_trysetdestinybondtohappen(void); -static void atkAC_remaininghptopower(void); -static void atkAD_tryspiteppreduce(void); -static void atkAE_healpartystatus(void); -static void atkAF_cursetarget(void); -static void atkB0_trysetspikes(void); -static void atkB1_setforesight(void); -static void atkB2_trysetperishsong(void); -static void atkB3_rolloutdamagecalculation(void); -static void atkB4_jumpifconfusedandstatmaxed(void); -static void atkB5_furycuttercalc(void); -static void atkB6_happinesstodamagecalculation(void); -static void atkB7_presentdamagecalculation(void); -static void atkB8_setsafeguard(void); -static void atkB9_magnitudedamagecalculation(void); -static void atkBA_jumpifnopursuitswitchdmg(void); -static void atkBB_setsunny(void); -static void atkBC_maxattackhalvehp(void); -static void atkBD_copyfoestats(void); -static void atkBE_rapidspinfree(void); -static void atkBF_setdefensecurlbit(void); -static void atkC0_recoverbasedonsunlight(void); -static void atkC1_hiddenpowercalc(void); -static void atkC2_selectfirstvalidtarget(void); -static void atkC3_trysetfutureattack(void); -static void atkC4_trydobeatup(void); -static void atkC5_setsemiinvulnerablebit(void); -static void atkC6_clearsemiinvulnerablebit(void); -static void atkC7_setminimize(void); -static void atkC8_sethail(void); -static void atkC9_jumpifattackandspecialattackcannotfall(void); -static void atkCA_setforcedtarget(void); -static void atkCB_setcharge(void); -static void atkCC_callterrainattack(void); -static void atkCD_cureifburnedparalysedorpoisoned(void); -static void atkCE_settorment(void); -static void atkCF_jumpifnodamage(void); -static void atkD0_settaunt(void); -static void atkD1_trysethelpinghand(void); -static void atkD2_tryswapitems(void); -static void atkD3_trycopyability(void); -static void atkD4_trywish(void); -static void atkD5_trysetroots(void); -static void atkD6_doubledamagedealtifdamaged(void); -static void atkD7_setyawn(void); -static void atkD8_setdamagetohealthdifference(void); -static void atkD9_scaledamagebyhealthratio(void); -static void atkDA_tryswapabilities(void); -static void atkDB_tryimprison(void); -static void atkDC_trysetgrudge(void); -static void atkDD_weightdamagecalculation(void); -static void atkDE_assistattackselect(void); -static void atkDF_trysetmagiccoat(void); -static void atkE0_trysetsnatch(void); -static void atkE1_trygetintimidatetarget(void); -static void atkE2_switchoutabilities(void); -static void atkE3_jumpifhasnohp(void); -static void atkE4_getsecretpowereffect(void); -static void atkE5_pickup(void); -static void atkE6_docastformchangeanimation(void); -static void atkE7_trycastformdatachange(void); -static void atkE8_settypebasedhalvers(void); -static void atkE9_setweatherballtype(void); -static void atkEA_tryrecycleitem(void); -static void atkEB_settypetoterrain(void); -static void atkEC_pursuitrelated(void); -static void atkEF_snatchsetbattlers(void); -static void atkEE_removelightscreenreflect(void); -static void atkEF_handleballthrow(void); -static void atkF0_givecaughtmon(void); -static void atkF1_trysetcaughtmondexflags(void); -static void atkF2_displaydexinfo(void); -static void atkF3_trygivecaughtmonnick(void); -static void atkF4_subattackerhpbydmg(void); -static void atkF5_removeattackerstatus1(void); -static void atkF6_finishaction(void); -static void atkF7_finishturn(void); -static void atkF8_trainerslideout(void); +static void Cmd_attackcanceler(void); +static void Cmd_accuracycheck(void); +static void Cmd_attackstring(void); +static void Cmd_ppreduce(void); +static void Cmd_critcalc(void); +static void Cmd_damagecalc(void); +static void Cmd_typecalc(void); +static void Cmd_adjustnormaldamage(void); +static void Cmd_adjustnormaldamage2(void); +static void Cmd_attackanimation(void); +static void Cmd_waitanimation(void); +static void Cmd_healthbarupdate(void); +static void Cmd_datahpupdate(void); +static void Cmd_critmessage(void); +static void Cmd_effectivenesssound(void); +static void Cmd_resultmessage(void); +static void Cmd_printstring(void); +static void Cmd_printselectionstring(void); +static void Cmd_waitmessage(void); +static void Cmd_printfromtable(void); +static void Cmd_printselectionstringfromtable(void); +static void Cmd_seteffectwithchance(void); +static void Cmd_seteffectprimary(void); +static void Cmd_seteffectsecondary(void); +static void Cmd_clearstatusfromeffect(void); +static void Cmd_tryfaintmon(void); +static void Cmd_dofaintanimation(void); +static void Cmd_cleareffectsonfaint(void); +static void Cmd_jumpifstatus(void); +static void Cmd_jumpifstatus2(void); +static void Cmd_jumpifability(void); +static void Cmd_jumpifsideaffecting(void); +static void Cmd_jumpifstat(void); +static void Cmd_jumpifstatus3condition(void); +static void Cmd_jumpiftype(void); +static void Cmd_getexp(void); +static void Cmd_unknown_24(void); +static void Cmd_movevaluescleanup(void); +static void Cmd_setmultihit(void); +static void Cmd_decrementmultihit(void); +static void Cmd_goto(void); +static void Cmd_jumpifbyte(void); +static void Cmd_jumpifhalfword(void); +static void Cmd_jumpifword(void); +static void Cmd_jumpifarrayequal(void); +static void Cmd_jumpifarraynotequal(void); +static void Cmd_setbyte(void); +static void Cmd_addbyte(void); +static void Cmd_subbyte(void); +static void Cmd_copyarray(void); +static void Cmd_copyarraywithindex(void); +static void Cmd_orbyte(void); +static void Cmd_orhalfword(void); +static void Cmd_orword(void); +static void Cmd_bicbyte(void); +static void Cmd_bichalfword(void); +static void Cmd_bicword(void); +static void Cmd_pause(void); +static void Cmd_waitstate(void); +static void Cmd_healthbar_update(void); +static void Cmd_return(void); +static void Cmd_end(void); +static void Cmd_end2(void); +static void Cmd_end3(void); +static void Cmd_jumpifaffectedbyprotect(void); +static void Cmd_call(void); +static void Cmd_jumpiftype2(void); +static void Cmd_jumpifabilitypresent(void); +static void Cmd_endselectionscript(void); +static void Cmd_playanimation(void); +static void Cmd_playanimation2(void); +static void Cmd_setgraphicalstatchangevalues(void); +static void Cmd_playstatchangeanimation(void); +static void Cmd_moveend(void); +static void Cmd_typecalc2(void); +static void Cmd_returnatktoball(void); +static void Cmd_getswitchedmondata(void); +static void Cmd_switchindataupdate(void); +static void Cmd_switchinanim(void); +static void Cmd_jumpifcantswitch(void); +static void Cmd_openpartyscreen(void); +static void Cmd_switchhandleorder(void); +static void Cmd_switchineffects(void); +static void Cmd_trainerslidein(void); +static void Cmd_playse(void); +static void Cmd_fanfare(void); +static void Cmd_playfaintcry(void); +static void Cmd_unknown_57(void); +static void Cmd_returntoball(void); +static void Cmd_handlelearnnewmove(void); +static void Cmd_yesnoboxlearnmove(void); +static void Cmd_yesnoboxstoplearningmove(void); +static void Cmd_hitanimation(void); +static void Cmd_getmoneyreward(void); +static void Cmd_unknown_5E(void); +static void Cmd_swapattackerwithtarget(void); +static void Cmd_incrementgamestat(void); +static void Cmd_drawpartystatussummary(void); +static void Cmd_hidepartystatussummary(void); +static void Cmd_jumptocalledmove(void); +static void Cmd_statusanimation(void); +static void Cmd_status2animation(void); +static void Cmd_chosenstatusanimation(void); +static void Cmd_yesnobox(void); +static void Cmd_cancelallactions(void); +static void Cmd_adjustsetdamage(void); +static void Cmd_removeitem(void); +static void Cmd_atknameinbuff1(void); +static void Cmd_drawlvlupbox(void); +static void Cmd_resetsentmonsvalue(void); +static void Cmd_setatktoplayer0(void); +static void Cmd_makevisible(void); +static void Cmd_recordlastability(void); +static void Cmd_buffermovetolearn(void); +static void Cmd_jumpifplayerran(void); +static void Cmd_hpthresholds(void); +static void Cmd_hpthresholds2(void); +static void Cmd_useitemonopponent(void); +static void Cmd_various(void); +static void Cmd_setprotectlike(void); +static void Cmd_faintifabilitynotdamp(void); +static void Cmd_setatkhptozero(void); +static void Cmd_jumpifnexttargetvalid(void); +static void Cmd_tryhealhalfhealth(void); +static void Cmd_trymirrormove(void); +static void Cmd_setrain(void); +static void Cmd_setreflect(void); +static void Cmd_setseeded(void); +static void Cmd_manipulatedamage(void); +static void Cmd_trysetrest(void); +static void Cmd_jumpifnotfirstturn(void); +static void Cmd_nop(void); +static void Cmd_jumpifcantmakeasleep(void); +static void Cmd_stockpile(void); +static void Cmd_stockpiletobasedamage(void); +static void Cmd_stockpiletohpheal(void); +static void Cmd_negativedamage(void); +static void Cmd_statbuffchange(void); +static void Cmd_normalisebuffs(void); +static void Cmd_setbide(void); +static void Cmd_confuseifrepeatingattackends(void); +static void Cmd_setmultihitcounter(void); +static void Cmd_initmultihitstring(void); +static void Cmd_forcerandomswitch(void); +static void Cmd_tryconversiontypechange(void); +static void Cmd_givepaydaymoney(void); +static void Cmd_setlightscreen(void); +static void Cmd_tryKO(void); +static void Cmd_damagetohalftargethp(void); +static void Cmd_setsandstorm(void); +static void Cmd_weatherdamage(void); +static void Cmd_tryinfatuating(void); +static void Cmd_updatestatusicon(void); +static void Cmd_setmist(void); +static void Cmd_setfocusenergy(void); +static void Cmd_transformdataexecution(void); +static void Cmd_setsubstitute(void); +static void Cmd_mimicattackcopy(void); +static void Cmd_metronome(void); +static void Cmd_dmgtolevel(void); +static void Cmd_psywavedamageeffect(void); +static void Cmd_counterdamagecalculator(void); +static void Cmd_mirrorcoatdamagecalculator(void); +static void Cmd_disablelastusedattack(void); +static void Cmd_trysetencore(void); +static void Cmd_painsplitdmgcalc(void); +static void Cmd_settypetorandomresistance(void); +static void Cmd_setalwayshitflag(void); +static void Cmd_copymovepermanently(void); +static void Cmd_trychoosesleeptalkmove(void); +static void Cmd_setdestinybond(void); +static void Cmd_trysetdestinybondtohappen(void); +static void Cmd_remaininghptopower(void); +static void Cmd_tryspiteppreduce(void); +static void Cmd_healpartystatus(void); +static void Cmd_cursetarget(void); +static void Cmd_trysetspikes(void); +static void Cmd_setforesight(void); +static void Cmd_trysetperishsong(void); +static void Cmd_rolloutdamagecalculation(void); +static void Cmd_jumpifconfusedandstatmaxed(void); +static void Cmd_furycuttercalc(void); +static void Cmd_happinesstodamagecalculation(void); +static void Cmd_presentdamagecalculation(void); +static void Cmd_setsafeguard(void); +static void Cmd_magnitudedamagecalculation(void); +static void Cmd_jumpifnopursuitswitchdmg(void); +static void Cmd_setsunny(void); +static void Cmd_maxattackhalvehp(void); +static void Cmd_copyfoestats(void); +static void Cmd_rapidspinfree(void); +static void Cmd_setdefensecurlbit(void); +static void Cmd_recoverbasedonsunlight(void); +static void Cmd_hiddenpowercalc(void); +static void Cmd_selectfirstvalidtarget(void); +static void Cmd_trysetfutureattack(void); +static void Cmd_trydobeatup(void); +static void Cmd_setsemiinvulnerablebit(void); +static void Cmd_clearsemiinvulnerablebit(void); +static void Cmd_setminimize(void); +static void Cmd_sethail(void); +static void Cmd_jumpifattackandspecialattackcannotfall(void); +static void Cmd_setforcedtarget(void); +static void Cmd_setcharge(void); +static void Cmd_callterrainattack(void); +static void Cmd_cureifburnedparalysedorpoisoned(void); +static void Cmd_settorment(void); +static void Cmd_jumpifnodamage(void); +static void Cmd_settaunt(void); +static void Cmd_trysethelpinghand(void); +static void Cmd_tryswapitems(void); +static void Cmd_trycopyability(void); +static void Cmd_trywish(void); +static void Cmd_trysetroots(void); +static void Cmd_doubledamagedealtifdamaged(void); +static void Cmd_setyawn(void); +static void Cmd_setdamagetohealthdifference(void); +static void Cmd_scaledamagebyhealthratio(void); +static void Cmd_tryswapabilities(void); +static void Cmd_tryimprison(void); +static void Cmd_trysetgrudge(void); +static void Cmd_weightdamagecalculation(void); +static void Cmd_assistattackselect(void); +static void Cmd_trysetmagiccoat(void); +static void Cmd_trysetsnatch(void); +static void Cmd_trygetintimidatetarget(void); +static void Cmd_switchoutabilities(void); +static void Cmd_jumpifhasnohp(void); +static void Cmd_getsecretpowereffect(void); +static void Cmd_pickup(void); +static void Cmd_docastformchangeanimation(void); +static void Cmd_trycastformdatachange(void); +static void Cmd_settypebasedhalvers(void); +static void Cmd_setweatherballtype(void); +static void Cmd_tryrecycleitem(void); +static void Cmd_settypetoterrain(void); +static void Cmd_pursuitrelated(void); +static void Cmd_snatchsetbattlers(void); +static void Cmd_removelightscreenreflect(void); +static void Cmd_handleballthrow(void); +static void Cmd_givecaughtmon(void); +static void Cmd_trysetcaughtmondexflags(void); +static void Cmd_displaydexinfo(void); +static void Cmd_trygivecaughtmonnick(void); +static void Cmd_subattackerhpbydmg(void); +static void Cmd_removeattackerstatus1(void); +static void Cmd_finishaction(void); +static void Cmd_finishturn(void); +static void Cmd_trainerslideout(void); void (* const gBattleScriptingCommandsTable[])(void) = { - atk00_attackcanceler, - atk01_accuracycheck, - atk02_attackstring, - atk03_ppreduce, - atk04_critcalc, - atk05_damagecalc, - atk06_typecalc, - atk07_adjustnormaldamage, - atk08_adjustnormaldamage2, - atk09_attackanimation, - atk0A_waitanimation, - atk0B_healthbarupdate, - atk0C_datahpupdate, - atk0D_critmessage, - atk0E_effectivenesssound, - atk0F_resultmessage, - atk10_printstring, - atk11_printselectionstring, - atk12_waitmessage, - atk13_printfromtable, - atk14_printselectionstringfromtable, - atk15_seteffectwithchance, - atk16_seteffectprimary, - atk17_seteffectsecondary, - atk18_clearstatusfromeffect, - atk19_tryfaintmon, - atk1A_dofaintanimation, - atk1B_cleareffectsonfaint, - atk1C_jumpifstatus, - atk1D_jumpifstatus2, - atk1E_jumpifability, - atk1F_jumpifsideaffecting, - atk20_jumpifstat, - atk21_jumpifstatus3condition, - atk22_jumpiftype, - atk23_getexp, - atk24, - atk25_movevaluescleanup, - atk26_setmultihit, - atk27_decrementmultihit, - atk28_goto, - atk29_jumpifbyte, - atk2A_jumpifhalfword, - atk2B_jumpifword, - atk2C_jumpifarrayequal, - atk2D_jumpifarraynotequal, - atk2E_setbyte, - atk2F_addbyte, - atk30_subbyte, - atk31_copyarray, - atk32_copyarraywithindex, - atk33_orbyte, - atk34_orhalfword, - atk35_orword, - atk36_bicbyte, - atk37_bichalfword, - atk38_bicword, - atk39_pause, - atk3A_waitstate, - atk3B_healthbar_update, - atk3C_return, - atk3D_end, - atk3E_end2, - atk3F_end3, - atk40_jumpifaffectedbyprotect, - atk41_call, - atk42_jumpiftype2, - atk43_jumpifabilitypresent, - atk44_endselectionscript, - atk45_playanimation, - atk46_playanimation2, - atk47_setgraphicalstatchangevalues, - atk48_playstatchangeanimation, - atk49_moveend, - atk4A_typecalc2, - atk4B_returnatktoball, - atk4C_getswitchedmondata, - atk4D_switchindataupdate, - atk4E_switchinanim, - atk4F_jumpifcantswitch, - atk50_openpartyscreen, - atk51_switchhandleorder, - atk52_switchineffects, - atk53_trainerslidein, - atk54_playse, - atk55_fanfare, - atk56_playfaintcry, - atk57, - atk58_returntoball, - atk59_handlelearnnewmove, - atk5A_yesnoboxlearnmove, - atk5B_yesnoboxstoplearningmove, - atk5C_hitanimation, - atk5D_getmoneyreward, - atk5E, - atk5F_swapattackerwithtarget, - atk60_incrementgamestat, - atk61_drawpartystatussummary, - atk62_hidepartystatussummary, - atk63_jumptocalledmove, - atk64_statusanimation, - atk65_status2animation, - atk66_chosenstatusanimation, - atk67_yesnobox, - atk68_cancelallactions, - atk69_adjustsetdamage, - atk6A_removeitem, - atk6B_atknameinbuff1, - atk6C_drawlvlupbox, - atk6D_resetsentmonsvalue, - atk6E_setatktoplayer0, - atk6F_makevisible, - atk70_recordlastability, - atk71_buffermovetolearn, - atk72_jumpifplayerran, - atk73_hpthresholds, - atk74_hpthresholds2, - atk75_useitemonopponent, - atk76_various, - atk77_setprotectlike, - atk78_faintifabilitynotdamp, - atk79_setatkhptozero, - atk7A_jumpifnexttargetvalid, - atk7B_tryhealhalfhealth, - atk7C_trymirrormove, - atk7D_setrain, - atk7E_setreflect, - atk7F_setseeded, - atk80_manipulatedamage, - atk81_trysetrest, - atk82_jumpifnotfirstturn, - atk83_nop, - atk84_jumpifcantmakeasleep, - atk85_stockpile, - atk86_stockpiletobasedamage, - atk87_stockpiletohpheal, - atk88_negativedamage, - atk89_statbuffchange, - atk8A_normalisebuffs, - atk8B_setbide, - atk8C_confuseifrepeatingattackends, - atk8D_setmultihitcounter, - atk8E_initmultihitstring, - atk8F_forcerandomswitch, - atk90_tryconversiontypechange, - atk91_givepaydaymoney, - atk92_setlightscreen, - atk93_tryKO, - atk94_damagetohalftargethp, - atk95_setsandstorm, - atk96_weatherdamage, - atk97_tryinfatuating, - atk98_updatestatusicon, - atk99_setmist, - atk9A_setfocusenergy, - atk9B_transformdataexecution, - atk9C_setsubstitute, - atk9D_mimicattackcopy, - atk9E_metronome, - atk9F_dmgtolevel, - atkA0_psywavedamageeffect, - atkA1_counterdamagecalculator, - atkA2_mirrorcoatdamagecalculator, - atkA3_disablelastusedattack, - atkA4_trysetencore, - atkA5_painsplitdmgcalc, - atkA6_settypetorandomresistance, - atkA7_setalwayshitflag, - atkA8_copymovepermanently, - atkA9_trychoosesleeptalkmove, - atkAA_setdestinybond, - atkAB_trysetdestinybondtohappen, - atkAC_remaininghptopower, - atkAD_tryspiteppreduce, - atkAE_healpartystatus, - atkAF_cursetarget, - atkB0_trysetspikes, - atkB1_setforesight, - atkB2_trysetperishsong, - atkB3_rolloutdamagecalculation, - atkB4_jumpifconfusedandstatmaxed, - atkB5_furycuttercalc, - atkB6_happinesstodamagecalculation, - atkB7_presentdamagecalculation, - atkB8_setsafeguard, - atkB9_magnitudedamagecalculation, - atkBA_jumpifnopursuitswitchdmg, - atkBB_setsunny, - atkBC_maxattackhalvehp, - atkBD_copyfoestats, - atkBE_rapidspinfree, - atkBF_setdefensecurlbit, - atkC0_recoverbasedonsunlight, - atkC1_hiddenpowercalc, - atkC2_selectfirstvalidtarget, - atkC3_trysetfutureattack, - atkC4_trydobeatup, - atkC5_setsemiinvulnerablebit, - atkC6_clearsemiinvulnerablebit, - atkC7_setminimize, - atkC8_sethail, - atkC9_jumpifattackandspecialattackcannotfall, - atkCA_setforcedtarget, - atkCB_setcharge, - atkCC_callterrainattack, - atkCD_cureifburnedparalysedorpoisoned, - atkCE_settorment, - atkCF_jumpifnodamage, - atkD0_settaunt, - atkD1_trysethelpinghand, - atkD2_tryswapitems, - atkD3_trycopyability, - atkD4_trywish, - atkD5_trysetroots, - atkD6_doubledamagedealtifdamaged, - atkD7_setyawn, - atkD8_setdamagetohealthdifference, - atkD9_scaledamagebyhealthratio, - atkDA_tryswapabilities, - atkDB_tryimprison, - atkDC_trysetgrudge, - atkDD_weightdamagecalculation, - atkDE_assistattackselect, - atkDF_trysetmagiccoat, - atkE0_trysetsnatch, - atkE1_trygetintimidatetarget, - atkE2_switchoutabilities, - atkE3_jumpifhasnohp, - atkE4_getsecretpowereffect, - atkE5_pickup, - atkE6_docastformchangeanimation, - atkE7_trycastformdatachange, - atkE8_settypebasedhalvers, - atkE9_setweatherballtype, - atkEA_tryrecycleitem, - atkEB_settypetoterrain, - atkEC_pursuitrelated, - atkEF_snatchsetbattlers, - atkEE_removelightscreenreflect, - atkEF_handleballthrow, - atkF0_givecaughtmon, - atkF1_trysetcaughtmondexflags, - atkF2_displaydexinfo, - atkF3_trygivecaughtmonnick, - atkF4_subattackerhpbydmg, - atkF5_removeattackerstatus1, - atkF6_finishaction, - atkF7_finishturn, - atkF8_trainerslideout + 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_unknown_24, //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_playanimation2, //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_unknown_57, //0x57 + Cmd_returntoball, //0x58 + Cmd_handlelearnnewmove, //0x59 + Cmd_yesnoboxlearnmove, //0x5A + Cmd_yesnoboxstoplearningmove, //0x5B + Cmd_hitanimation, //0x5C + Cmd_getmoneyreward, //0x5D + Cmd_unknown_5E, //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_faintifabilitynotdamp, //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_happinesstodamagecalculation, //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_jumpifattackandspecialattackcannotfall, //0xC9 + Cmd_setforcedtarget, //0xCA + Cmd_setcharge, //0xCB + Cmd_callterrainattack, //0xCC + Cmd_cureifburnedparalysedorpoisoned, //0xCD + Cmd_settorment, //0xCE + Cmd_jumpifnodamage, //0xCF + Cmd_settaunt, //0xD0 + Cmd_trysethelpinghand, //0xD1 + Cmd_tryswapitems, //0xD2 + Cmd_trycopyability, //0xD3 + Cmd_trywish, //0xD4 + Cmd_trysetroots, //0xD5 + Cmd_doubledamagedealtifdamaged, //0xD6 + Cmd_setyawn, //0xD7 + Cmd_setdamagetohealthdifference, //0xD8 + Cmd_scaledamagebyhealthratio, //0xD9 + Cmd_tryswapabilities, //0xDA + Cmd_tryimprison, //0xDB + Cmd_trysetgrudge, //0xDC + Cmd_weightdamagecalculation, //0xDD + Cmd_assistattackselect, //0xDE + Cmd_trysetmagiccoat, //0xDF + Cmd_trysetsnatch, //0xE0 + Cmd_trygetintimidatetarget, //0xE1 + Cmd_switchoutabilities, //0xE2 + Cmd_jumpifhasnohp, //0xE3 + Cmd_getsecretpowereffect, //0xE4 + Cmd_pickup, //0xE5 + Cmd_docastformchangeanimation, //0xE6 + Cmd_trycastformdatachange, //0xE7 + Cmd_settypebasedhalvers, //0xE8 + Cmd_setweatherballtype, //0xE9 + Cmd_tryrecycleitem, //0xEA + Cmd_settypetoterrain, //0xEB + Cmd_pursuitrelated, //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 }; struct StatFractions @@ -918,7 +918,7 @@ static const u8 sUnknown_0831C4F8[] = 0x03, 0x00, 0x00, 0x00 }; -static void atk00_attackcanceler(void) +static void Cmd_attackcanceler(void) { s32 i; @@ -1030,7 +1030,7 @@ static void JumpIfMoveFailed(u8 adder, u16 move) gBattlescriptCurrInstr = BS_ptr; } -static void atk40_jumpifaffectedbyprotect(void) +static void Cmd_jumpifaffectedbyprotect(void) { if (DEFENDER_IS_PROTECTED) { @@ -1102,7 +1102,7 @@ static bool8 AccuracyCalcHelper(u16 move) return FALSE; } -static void atk01_accuracycheck(void) +static void Cmd_accuracycheck(void) { u16 move = T2_READ_16(gBattlescriptCurrInstr + 5); @@ -1194,7 +1194,7 @@ static void atk01_accuracycheck(void) } } -static void atk02_attackstring(void) +static void Cmd_attackstring(void) { if (gBattleControllerExecFlags) return; @@ -1207,7 +1207,7 @@ static void atk02_attackstring(void) gBattleCommunication[MSG_DISPLAY] = 0; } -static void atk03_ppreduce(void) +static void Cmd_ppreduce(void) { s32 ppToDeduct = 1; @@ -1254,7 +1254,7 @@ static void atk03_ppreduce(void) gBattlescriptCurrInstr++; } -static void atk04_critcalc(void) +static void Cmd_critcalc(void) { u8 holdEffect; u16 item, critChance; @@ -1291,7 +1291,7 @@ static void atk04_critcalc(void) gBattlescriptCurrInstr++; } -static void atk05_damagecalc(void) +static void Cmd_damagecalc(void) { u16 sideStatus = gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)]; gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, @@ -1356,7 +1356,7 @@ static void ModulateDmgByType(u8 multiplier) } } -static void atk06_typecalc(void) +static void Cmd_typecalc(void) { s32 i = 0; u8 moveType; @@ -1658,7 +1658,7 @@ static void Unused_ApplyRandomDmgMultiplier(void) ApplyRandomDmgMultiplier(); } -static void atk07_adjustnormaldamage(void) +static void Cmd_adjustnormaldamage(void) { u8 holdEffect, param; @@ -1700,7 +1700,7 @@ static void atk07_adjustnormaldamage(void) gBattlescriptCurrInstr++; } -static void atk08_adjustnormaldamage2(void) // The same as 0x7 except it doesn't check for false swipe move effect. +static void Cmd_adjustnormaldamage2(void) // The same as adjustnormaldamage except it doesn't check for false swipe move effect. { u8 holdEffect, param; @@ -1742,7 +1742,7 @@ static void atk08_adjustnormaldamage2(void) // The same as 0x7 except it doesn't gBattlescriptCurrInstr++; } -static void atk09_attackanimation(void) +static void Cmd_attackanimation(void) { if (gBattleControllerExecFlags) return; @@ -1796,13 +1796,13 @@ static void atk09_attackanimation(void) } } -static void atk0A_waitanimation(void) +static void Cmd_waitanimation(void) { if (gBattleControllerExecFlags == 0) gBattlescriptCurrInstr++; } -static void atk0B_healthbarupdate(void) +static void Cmd_healthbarupdate(void) { if (gBattleControllerExecFlags) return; @@ -1838,7 +1838,7 @@ static void atk0B_healthbarupdate(void) gBattlescriptCurrInstr += 2; } -static void atk0C_datahpupdate(void) +static void Cmd_datahpupdate(void) { u32 moveType; @@ -1964,7 +1964,7 @@ static void atk0C_datahpupdate(void) gBattlescriptCurrInstr += 2; } -static void atk0D_critmessage(void) +static void Cmd_critmessage(void) { if (gBattleControllerExecFlags == 0) { @@ -1977,7 +1977,7 @@ static void atk0D_critmessage(void) } } -static void atk0E_effectivenesssound(void) +static void Cmd_effectivenesssound(void) { if (gBattleControllerExecFlags) return; @@ -2024,7 +2024,7 @@ static void atk0E_effectivenesssound(void) gBattlescriptCurrInstr++; } -static void atk0F_resultmessage(void) +static void Cmd_resultmessage(void) { u32 stringId = 0; @@ -2113,7 +2113,7 @@ static void atk0F_resultmessage(void) gBattlescriptCurrInstr++; } -static void atk10_printstring(void) +static void Cmd_printstring(void) { if (gBattleControllerExecFlags == 0) { @@ -2124,7 +2124,7 @@ static void atk10_printstring(void) } } -static void atk11_printselectionstring(void) +static void Cmd_printselectionstring(void) { gActiveBattler = gBattlerAttacker; @@ -2135,7 +2135,7 @@ static void atk11_printselectionstring(void) gBattleCommunication[MSG_DISPLAY] = 1; } -static void atk12_waitmessage(void) +static void Cmd_waitmessage(void) { if (gBattleControllerExecFlags == 0) { @@ -2156,7 +2156,7 @@ static void atk12_waitmessage(void) } } -static void atk13_printfromtable(void) +static void Cmd_printfromtable(void) { if (gBattleControllerExecFlags == 0) { @@ -2170,7 +2170,7 @@ static void atk13_printfromtable(void) } } -static void atk14_printselectionstringfromtable(void) +static void Cmd_printselectionstringfromtable(void) { if (gBattleControllerExecFlags == 0) { @@ -2882,7 +2882,7 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattleCommunication[MOVE_EFFECT_BYTE] = 0; } -static void atk15_seteffectwithchance(void) +static void Cmd_seteffectwithchance(void) { u32 percentChance; @@ -2915,17 +2915,17 @@ static void atk15_seteffectwithchance(void) gBattleScripting.multihitMoveEffect = 0; } -static void atk16_seteffectprimary(void) +static void Cmd_seteffectprimary(void) { SetMoveEffect(TRUE, 0); } -static void atk17_seteffectsecondary(void) +static void Cmd_seteffectsecondary(void) { SetMoveEffect(FALSE, 0); } -static void atk18_clearstatusfromeffect(void) +static void Cmd_clearstatusfromeffect(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -2939,7 +2939,7 @@ static void atk18_clearstatusfromeffect(void) gBattleScripting.multihitMoveEffect = 0; } -static void atk19_tryfaintmon(void) +static void Cmd_tryfaintmon(void) { const u8 *BS_ptr; @@ -3026,7 +3026,7 @@ static void atk19_tryfaintmon(void) } } -static void atk1A_dofaintanimation(void) +static void Cmd_dofaintanimation(void) { if (gBattleControllerExecFlags == 0) { @@ -3037,7 +3037,7 @@ static void atk1A_dofaintanimation(void) } } -static void atk1B_cleareffectsonfaint(void) +static void Cmd_cleareffectsonfaint(void) { if (gBattleControllerExecFlags == 0) { @@ -3055,7 +3055,7 @@ static void atk1B_cleareffectsonfaint(void) } } -static void atk1C_jumpifstatus(void) +static void Cmd_jumpifstatus(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); @@ -3067,7 +3067,7 @@ static void atk1C_jumpifstatus(void) gBattlescriptCurrInstr += 10; } -static void atk1D_jumpifstatus2(void) +static void Cmd_jumpifstatus2(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); @@ -3079,7 +3079,7 @@ static void atk1D_jumpifstatus2(void) gBattlescriptCurrInstr += 10; } -static void atk1E_jumpifability(void) +static void Cmd_jumpifability(void) { u8 battlerId; u8 ability = gBattlescriptCurrInstr[2]; @@ -3126,7 +3126,7 @@ static void atk1E_jumpifability(void) } } -static void atk1F_jumpifsideaffecting(void) +static void Cmd_jumpifsideaffecting(void) { u8 side; u16 flags; @@ -3146,7 +3146,7 @@ static void atk1F_jumpifsideaffecting(void) gBattlescriptCurrInstr += 8; } -static void atk20_jumpifstat(void) +static void Cmd_jumpifstat(void) { u8 ret = 0; u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -3186,7 +3186,7 @@ static void atk20_jumpifstat(void) gBattlescriptCurrInstr += 9; } -static void atk21_jumpifstatus3condition(void) +static void Cmd_jumpifstatus3condition(void) { u32 flags; const u8 *jumpPtr; @@ -3211,7 +3211,7 @@ static void atk21_jumpifstatus3condition(void) } } -static void atk22_jumpiftype(void) +static void Cmd_jumpiftype(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u8 type = gBattlescriptCurrInstr[2]; @@ -3223,7 +3223,7 @@ static void atk22_jumpiftype(void) gBattlescriptCurrInstr += 7; } -static void atk23_getexp(void) +static void Cmd_getexp(void) { u16 item; s32 i; // also used as stringId @@ -3235,7 +3235,7 @@ static void atk23_getexp(void) gBattlerFainted = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); sentIn = gSentPokesToOpponent[(gBattlerFainted & 2) >> 1]; - switch (gBattleScripting.atk23_state) + switch (gBattleScripting.getexpState) { case 0: // check if should receive exp at all if (GetBattlerSide(gBattlerFainted) != B_SIDE_OPPONENT || (gBattleTypeFlags & @@ -3247,11 +3247,11 @@ static void atk23_getexp(void) | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))) { - gBattleScripting.atk23_state = 6; // goto last case + gBattleScripting.getexpState = 6; // goto last case } else { - gBattleScripting.atk23_state++; + gBattleScripting.getexpState++; gBattleStruct->givenExpMons |= gBitTable[gBattlerPartyIndexes[gBattlerFainted]]; } break; @@ -3298,7 +3298,7 @@ static void atk23_getexp(void) gExpShareExp = 0; } - gBattleScripting.atk23_state++; + gBattleScripting.getexpState++; gBattleStruct->expGetterMonId = 0; gBattleStruct->sentInPokes = sentIn; } @@ -3316,13 +3316,13 @@ static void atk23_getexp(void) if (holdEffect != HOLD_EFFECT_EXP_SHARE && !(gBattleStruct->sentInPokes & 1)) { *(&gBattleStruct->sentInPokes) >>= 1; - gBattleScripting.atk23_state = 5; + gBattleScripting.getexpState = 5; gBattleMoveDamage = 0; // used for exp } else if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) == MAX_LEVEL) { *(&gBattleStruct->sentInPokes) >>= 1; - gBattleScripting.atk23_state = 5; + gBattleScripting.getexpState = 5; gBattleMoveDamage = 0; // used for exp } else @@ -3394,7 +3394,7 @@ static void atk23_getexp(void) MonGainEVs(&gPlayerParty[gBattleStruct->expGetterMonId], gBattleMons[gBattlerFainted].species); } gBattleStruct->sentInPokes >>= 1; - gBattleScripting.atk23_state++; + gBattleScripting.getexpState++; } } break; @@ -3415,7 +3415,7 @@ static void atk23_getexp(void) BtlController_EmitExpUpdate(0, gBattleStruct->expGetterMonId, gBattleMoveDamage); MarkBattlerForControllerExec(gActiveBattler); } - gBattleScripting.atk23_state++; + gBattleScripting.getexpState++; } break; case 4: // lvl up if necessary @@ -3465,27 +3465,27 @@ static void atk23_getexp(void) gBattleMons[2].spAttack = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPATK); } - gBattleScripting.atk23_state = 5; + gBattleScripting.getexpState = 5; } else { gBattleMoveDamage = 0; - gBattleScripting.atk23_state = 5; + gBattleScripting.getexpState = 5; } } break; case 5: // looper increment if (gBattleMoveDamage) // there is exp to give, goto case 3 that gives exp { - gBattleScripting.atk23_state = 3; + gBattleScripting.getexpState = 3; } else { gBattleStruct->expGetterMonId++; if (gBattleStruct->expGetterMonId <= 5) - gBattleScripting.atk23_state = 2; // loop again + gBattleScripting.getexpState = 2; // loop again else - gBattleScripting.atk23_state = 6; // we're done + gBattleScripting.getexpState = 6; // we're done } break; case 6: // increment instruction @@ -3501,7 +3501,7 @@ static void atk23_getexp(void) } #ifdef NONMATCHING -static void atk24(void) +static void Cmd_unknown_24(void) { u16 HP_count = 0; s32 i; @@ -3584,7 +3584,7 @@ static void atk24(void) } #else NAKED -static void atk24(void) +static void Cmd_unknown_24(void) { asm("\n\ .syntax unified\n\ @@ -3889,19 +3889,19 @@ static void MoveValuesCleanUp(void) gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT); } -static void atk25_movevaluescleanup(void) +static void Cmd_movevaluescleanup(void) { MoveValuesCleanUp(); gBattlescriptCurrInstr += 1; } -static void atk26_setmultihit(void) +static void Cmd_setmultihit(void) { gMultiHitCounter = gBattlescriptCurrInstr[1]; gBattlescriptCurrInstr += 2; } -static void atk27_decrementmultihit(void) +static void Cmd_decrementmultihit(void) { if (--gMultiHitCounter == 0) gBattlescriptCurrInstr += 5; @@ -3909,12 +3909,12 @@ static void atk27_decrementmultihit(void) gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atk28_goto(void) +static void Cmd_goto(void) { gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atk29_jumpifbyte(void) +static void Cmd_jumpifbyte(void) { u8 caseID = gBattlescriptCurrInstr[1]; const u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2); @@ -3952,7 +3952,7 @@ static void atk29_jumpifbyte(void) } } -static void atk2A_jumpifhalfword(void) +static void Cmd_jumpifhalfword(void) { u8 caseID = gBattlescriptCurrInstr[1]; const u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2); @@ -3990,7 +3990,7 @@ static void atk2A_jumpifhalfword(void) } } -static void atk2B_jumpifword(void) +static void Cmd_jumpifword(void) { u8 caseID = gBattlescriptCurrInstr[1]; const u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2); @@ -4028,7 +4028,7 @@ static void atk2B_jumpifword(void) } } -static void atk2C_jumpifarrayequal(void) +static void Cmd_jumpifarrayequal(void) { const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); @@ -4050,7 +4050,7 @@ static void atk2C_jumpifarrayequal(void) gBattlescriptCurrInstr = jumpPtr; } -static void atk2D_jumpifarraynotequal(void) +static void Cmd_jumpifarraynotequal(void) { u8 equalBytes = 0; const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); @@ -4074,7 +4074,7 @@ static void atk2D_jumpifarraynotequal(void) gBattlescriptCurrInstr += 14; } -static void atk2E_setbyte(void) +static void Cmd_setbyte(void) { u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte = gBattlescriptCurrInstr[5]; @@ -4082,21 +4082,21 @@ static void atk2E_setbyte(void) gBattlescriptCurrInstr += 6; } -static void atk2F_addbyte(void) +static void Cmd_addbyte(void) { u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte += gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; } -static void atk30_subbyte(void) +static void Cmd_subbyte(void) { u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte -= gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; } -static void atk31_copyarray(void) +static void Cmd_copyarray(void) { u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5); @@ -4111,7 +4111,7 @@ static void atk31_copyarray(void) gBattlescriptCurrInstr += 10; } -static void atk32_copyarraywithindex(void) +static void Cmd_copyarraywithindex(void) { u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5); @@ -4127,14 +4127,14 @@ static void atk32_copyarraywithindex(void) gBattlescriptCurrInstr += 14; } -static void atk33_orbyte(void) +static void Cmd_orbyte(void) { u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte |= gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; } -static void atk34_orhalfword(void) +static void Cmd_orhalfword(void) { u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); @@ -4143,7 +4143,7 @@ static void atk34_orhalfword(void) gBattlescriptCurrInstr += 7; } -static void atk35_orword(void) +static void Cmd_orword(void) { u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); @@ -4152,14 +4152,14 @@ static void atk35_orword(void) gBattlescriptCurrInstr += 9; } -static void atk36_bicbyte(void) +static void Cmd_bicbyte(void) { u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte &= ~(gBattlescriptCurrInstr[5]); gBattlescriptCurrInstr += 6; } -static void atk37_bichalfword(void) +static void Cmd_bichalfword(void) { u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); @@ -4168,7 +4168,7 @@ static void atk37_bichalfword(void) gBattlescriptCurrInstr += 7; } -static void atk38_bicword(void) +static void Cmd_bicword(void) { u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); @@ -4177,7 +4177,7 @@ static void atk38_bicword(void) gBattlescriptCurrInstr += 9; } -static void atk39_pause(void) +static void Cmd_pause(void) { if (gBattleControllerExecFlags == 0) { @@ -4190,13 +4190,13 @@ static void atk39_pause(void) } } -static void atk3A_waitstate(void) +static void Cmd_waitstate(void) { if (gBattleControllerExecFlags == 0) gBattlescriptCurrInstr++; } -static void atk3B_healthbar_update(void) +static void Cmd_healthbar_update(void) { if (gBattlescriptCurrInstr[1] == BS_TARGET) gActiveBattler = gBattlerTarget; @@ -4208,12 +4208,12 @@ static void atk3B_healthbar_update(void) gBattlescriptCurrInstr += 2; } -static void atk3C_return(void) +static void Cmd_return(void) { BattleScriptPop(); } -static void atk3D_end(void) +static void Cmd_end(void) { if (gBattleTypeFlags & BATTLE_TYPE_ARENA) BattleArena_AddSkillPoints(gBattlerAttacker); @@ -4223,13 +4223,13 @@ static void atk3D_end(void) gCurrentActionFuncId = B_ACTION_TRY_FINISH; } -static void atk3E_end2(void) +static void Cmd_end2(void) { gActiveBattler = 0; gCurrentActionFuncId = B_ACTION_TRY_FINISH; } -static void atk3F_end3(void) // pops the main function stack +static void Cmd_end3(void) // pops the main function stack { BattleScriptPop(); if (gBattleResources->battleCallbackStack->size != 0) @@ -4237,13 +4237,13 @@ static void atk3F_end3(void) // pops the main function stack gBattleMainFunc = gBattleResources->battleCallbackStack->function[gBattleResources->battleCallbackStack->size]; } -static void atk41_call(void) +static void Cmd_call(void) { BattleScriptPush(gBattlescriptCurrInstr + 5); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atk42_jumpiftype2(void) +static void Cmd_jumpiftype2(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -4253,7 +4253,7 @@ static void atk42_jumpiftype2(void) gBattlescriptCurrInstr += 7; } -static void atk43_jumpifabilitypresent(void) +static void Cmd_jumpifabilitypresent(void) { if (AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, gBattlescriptCurrInstr[1], 0, 0)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); @@ -4261,12 +4261,12 @@ static void atk43_jumpifabilitypresent(void) gBattlescriptCurrInstr += 6; } -static void atk44_endselectionscript(void) +static void Cmd_endselectionscript(void) { *(gBattlerAttacker + gBattleStruct->selectionScriptFinished) = TRUE; } -static void atk45_playanimation(void) +static void Cmd_playanimation(void) { const u16* argumentPtr; @@ -4307,7 +4307,7 @@ static void atk45_playanimation(void) } } -static void atk46_playanimation2(void) // animation Id is stored in the first pointer +static void Cmd_playanimation2(void) // animation Id is stored in the first pointer { const u16* argumentPtr; const u8* animationIdPtr; @@ -4349,7 +4349,7 @@ static void atk46_playanimation2(void) // animation Id is stored in the first po } } -static void atk47_setgraphicalstatchangevalues(void) +static void Cmd_setgraphicalstatchangevalues(void) { u8 value = 0; switch (GET_STAT_BUFF_VALUE2(gBattleScripting.statChanger)) @@ -4372,7 +4372,7 @@ static void atk47_setgraphicalstatchangevalues(void) gBattlescriptCurrInstr++; } -static void atk48_playstatchangeanimation(void) +static void Cmd_playstatchangeanimation(void) { u32 currStat = 0; u16 statAnimId = 0; @@ -4382,10 +4382,10 @@ static void atk48_playstatchangeanimation(void) gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); statsToCheck = gBattlescriptCurrInstr[2]; - if (gBattlescriptCurrInstr[3] & ATK48_STAT_NEGATIVE) // goes down + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_NEGATIVE) // goes down { s16 startingStatAnimId; - if (gBattlescriptCurrInstr[3] & ATK48_STAT_BY_TWO) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) startingStatAnimId = STAT_ANIM_MINUS2 - 1; else startingStatAnimId = STAT_ANIM_MINUS1 - 1; @@ -4394,7 +4394,7 @@ static void atk48_playstatchangeanimation(void) { if (statsToCheck & 1) { - if (gBattlescriptCurrInstr[3] & ATK48_DONT_CHECK_LOWER) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_CANT_PREVENT) { if (gBattleMons[gActiveBattler].statStages[currStat] > 0) { @@ -4420,7 +4420,7 @@ static void atk48_playstatchangeanimation(void) if (changeableStatsCount > 1) // more than one stat, so the color is gray { - if (gBattlescriptCurrInstr[3] & ATK48_STAT_BY_TWO) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) statAnimId = STAT_ANIM_MULTIPLE_MINUS2; else statAnimId = STAT_ANIM_MULTIPLE_MINUS1; @@ -4429,7 +4429,7 @@ static void atk48_playstatchangeanimation(void) else // goes up { s16 startingStatAnimId; - if (gBattlescriptCurrInstr[3] & ATK48_STAT_BY_TWO) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) startingStatAnimId = STAT_ANIM_PLUS2 - 1; else startingStatAnimId = STAT_ANIM_PLUS1 - 1; @@ -4446,14 +4446,14 @@ static void atk48_playstatchangeanimation(void) if (changeableStatsCount > 1) // more than one stat, so the color is gray { - if (gBattlescriptCurrInstr[3] & ATK48_STAT_BY_TWO) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_BY_TWO) statAnimId = STAT_ANIM_MULTIPLE_PLUS2; else statAnimId = STAT_ANIM_MULTIPLE_PLUS1; } } - if (gBattlescriptCurrInstr[3] & ATK48_ONLY_MULTIPLE && changeableStatsCount < 2) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount < 2) { gBattlescriptCurrInstr += 4; } @@ -4461,7 +4461,7 @@ static void atk48_playstatchangeanimation(void) { BtlController_EmitBattleAnimation(0, B_ANIM_STATS_CHANGE, statAnimId); MarkBattlerForControllerExec(gActiveBattler); - if (gBattlescriptCurrInstr[3] & ATK48_ONLY_MULTIPLE && changeableStatsCount > 1) + if (gBattlescriptCurrInstr[3] & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount > 1) gBattleScripting.statAnimPlayed = TRUE; gBattlescriptCurrInstr += 4; } @@ -4471,7 +4471,7 @@ static void atk48_playstatchangeanimation(void) } } -static void atk49_moveend(void) +static void Cmd_moveend(void) { s32 i; bool32 effect = FALSE; @@ -4499,9 +4499,9 @@ static void atk49_moveend(void) do { - switch (gBattleScripting.atk49_state) + switch (gBattleScripting.moveendState) { - case ATK49_RAGE: // rage check + case MOVEEND_RAGE: // rage check if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) @@ -4513,9 +4513,9 @@ static void atk49_moveend(void) gBattlescriptCurrInstr = BattleScript_RageIsBuilding; effect = TRUE; } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_DEFROST: // defrosting check + case MOVEEND_DEFROST: // defrosting check if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget && gSpecialStatuses[gBattlerTarget].specialDmg @@ -4529,30 +4529,30 @@ static void atk49_moveend(void) gBattlescriptCurrInstr = BattleScript_DefrostedViaFireMove; effect = TRUE; } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_SYNCHRONIZE_TARGET: // target synchronize + case MOVEEND_SYNCHRONIZE_TARGET: // target synchronize if (AbilityBattleEffects(ABILITYEFFECT_SYNCHRONIZE, gBattlerTarget, 0, 0, 0)) effect = TRUE; - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_MOVE_END_ABILITIES: // Such as abilities activating on contact(Poison Spore, Rough Skin, etc.). - if (AbilityBattleEffects(ABILITYEFFECT_MOVE_END, gBattlerTarget, 0, 0, 0)) + case MOVEEND_ON_DAMAGE_ABILITIES: // Contact abilities and Color Change + if (AbilityBattleEffects(ABILITYEFFECT_ON_DAMAGE, gBattlerTarget, 0, 0, 0)) effect = TRUE; - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_STATUS_IMMUNITY_ABILITIES: // status immunities + case MOVEEND_IMMUNITY_ABILITIES: // status immunities if (AbilityBattleEffects(ABILITYEFFECT_IMMUNITY, 0, 0, 0, 0)) effect = TRUE; // it loops through all battlers, so we increment after its done with all battlers else - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_SYNCHRONIZE_ATTACKER: // attacker synchronize + case MOVEEND_SYNCHRONIZE_ATTACKER: // attacker synchronize if (AbilityBattleEffects(ABILITYEFFECT_ATK_SYNCHRONIZE, gBattlerAttacker, 0, 0, 0)) effect = TRUE; - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_CHOICE_MOVE: // update choice band move + case MOVEEND_CHOICE_MOVE: // update choice band move if (gHitMarker & HITMARKER_OBEYS && holdEffectAtk == HOLD_EFFECT_CHOICE_BAND && gChosenMove != MOVE_STRUGGLE @@ -4560,7 +4560,7 @@ static void atk49_moveend(void) { if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED)) { - ++gBattleScripting.atk49_state; + ++gBattleScripting.moveendState; break; } *choicedMoveAtk = gChosenMove; @@ -4572,9 +4572,9 @@ static void atk49_moveend(void) } if (i == MAX_MON_MOVES) *choicedMoveAtk = 0; - ++gBattleScripting.atk49_state; + ++gBattleScripting.moveendState; break; - case ATK49_CHANGED_ITEMS: // changed held items + case MOVEEND_CHANGED_ITEMS: // changed held items for (i = 0; i < gBattlersCount; i++) { u16* changedItem = &gBattleStruct->changedItems[i]; @@ -4584,32 +4584,32 @@ static void atk49_moveend(void) *changedItem = 0; } } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_ITEM_EFFECTS_ALL: // item effects for all battlers + case MOVEEND_ITEM_EFFECTS_ALL: // item effects for all battlers if (ItemBattleEffects(ITEMEFFECT_MOVE_END, 0, FALSE)) effect = TRUE; else - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_KINGSROCK_SHELLBELL: // king's rock and shell bell + case MOVEEND_KINGSROCK_SHELLBELL: // king's rock and shell bell if (ItemBattleEffects(ITEMEFFECT_KINGSROCK_SHELLBELL, 0, FALSE)) effect = TRUE; - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_ATTACKER_INVISIBLE: // make attacker sprite invisible + case MOVEEND_ATTACKER_INVISIBLE: // make attacker sprite invisible if (gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE) && gHitMarker & HITMARKER_NO_ANIMATIONS) { gActiveBattler = gBattlerAttacker; BtlController_EmitSpriteInvisibility(0, TRUE); MarkBattlerForControllerExec(gActiveBattler); - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; return; } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_ATTACKER_VISIBLE: // make attacker sprite visible + case MOVEEND_ATTACKER_VISIBLE: // make attacker sprite visible if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || !(gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE)) || WasUnableToUseMove(gBattlerAttacker)) @@ -4619,12 +4619,12 @@ static void atk49_moveend(void) MarkBattlerForControllerExec(gActiveBattler); gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE); gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1; - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; return; } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_TARGET_VISIBLE: // make target sprite visible + case MOVEEND_TARGET_VISIBLE: // make target sprite visible if (!gSpecialStatuses[gBattlerTarget].restoredBattlerSprite && gBattlerTarget < gBattlersCount && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) { @@ -4632,20 +4632,20 @@ static void atk49_moveend(void) BtlController_EmitSpriteInvisibility(0, FALSE); MarkBattlerForControllerExec(gActiveBattler); gStatuses3[gBattlerTarget] &= ~(STATUS3_SEMI_INVULNERABLE); - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; return; } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_SUBSTITUTE: // update substitute + case MOVEEND_SUBSTITUTE: // update substitute for (i = 0; i < gBattlersCount; i++) { if (gDisableStructs[i].substituteHP == 0) gBattleMons[i].status2 &= ~(STATUS2_SUBSTITUTE); } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_UPDATE_LAST_MOVES: + case MOVEEND_UPDATE_LAST_MOVES: if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET) { gActiveBattler = gBattlerAttacker; @@ -4692,9 +4692,9 @@ static void atk49_moveend(void) gLastLandedMoves[gBattlerTarget] = 0xFFFF; } } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_MIRROR_MOVE: // mirror move + case MOVEEND_MIRROR_MOVE: // mirror move if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->field_91 & gBitTable[gBattlerAttacker]) && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) @@ -4713,9 +4713,9 @@ static void atk49_moveend(void) attacker = gBattlerAttacker; *(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8; } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_NEXT_TARGET: // For moves hitting two opposing Pokemon. + case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon. if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) @@ -4725,7 +4725,7 @@ static void atk49_moveend(void) { gBattlerTarget = battlerId; gHitMarker |= HITMARKER_NO_ATTACKSTRING; - gBattleScripting.atk49_state = 0; + gBattleScripting.moveendState = 0; MoveValuesCleanUp(); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); gBattlescriptCurrInstr = BattleScript_FlushMessageBox; @@ -4736,24 +4736,24 @@ static void atk49_moveend(void) gHitMarker |= HITMARKER_NO_ATTACKSTRING; } } - gBattleScripting.atk49_state++; + gBattleScripting.moveendState++; break; - case ATK49_COUNT: + case MOVEEND_COUNT: break; } if (arg1 == 1 && effect == FALSE) - gBattleScripting.atk49_state = ATK49_COUNT; - if (arg1 == 2 && arg2 == gBattleScripting.atk49_state) - gBattleScripting.atk49_state = ATK49_COUNT; + gBattleScripting.moveendState = MOVEEND_COUNT; + if (arg1 == 2 && arg2 == gBattleScripting.moveendState) + gBattleScripting.moveendState = MOVEEND_COUNT; - } while (gBattleScripting.atk49_state != ATK49_COUNT && effect == FALSE); + } while (gBattleScripting.moveendState != MOVEEND_COUNT && effect == FALSE); - if (gBattleScripting.atk49_state == ATK49_COUNT && effect == FALSE) + if (gBattleScripting.moveendState == MOVEEND_COUNT && effect == FALSE) gBattlescriptCurrInstr += 3; } -static void atk4A_typecalc2(void) +static void Cmd_typecalc2(void) { u8 flags = 0; s32 i = 0; @@ -4848,7 +4848,7 @@ static void atk4A_typecalc2(void) gBattlescriptCurrInstr++; } -static void atk4B_returnatktoball(void) +static void Cmd_returnatktoball(void) { gActiveBattler = gBattlerAttacker; if (!(gHitMarker & HITMARKER_FAINTED(gActiveBattler))) @@ -4859,7 +4859,7 @@ static void atk4B_returnatktoball(void) gBattlescriptCurrInstr++; } -static void atk4C_getswitchedmondata(void) +static void Cmd_getswitchedmondata(void) { if (gBattleControllerExecFlags) return; @@ -4874,7 +4874,7 @@ static void atk4C_getswitchedmondata(void) gBattlescriptCurrInstr += 2; } -static void atk4D_switchindataupdate(void) +static void Cmd_switchindataupdate(void) { struct BattlePokemon oldData; s32 i; @@ -4927,7 +4927,7 @@ static void atk4D_switchindataupdate(void) gBattlescriptCurrInstr += 2; } -static void atk4E_switchinanim(void) +static void Cmd_switchinanim(void) { if (gBattleControllerExecFlags) return; @@ -4953,15 +4953,15 @@ static void atk4E_switchinanim(void) BattleArena_InitPoints(); } -static void atk4F_jumpifcantswitch(void) +static void Cmd_jumpifcantswitch(void) { s32 i; s32 lastMonId; struct Pokemon *party; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(ATK4F_DONT_CHECK_STATUSES)); + gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(SWITCH_IGNORE_ESCAPE_PREVENTION)); - if (!(gBattlescriptCurrInstr[1] & ATK4F_DONT_CHECK_STATUSES) + if (!(gBattlescriptCurrInstr[1] & SWITCH_IGNORE_ESCAPE_PREVENTION) && ((gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) || (gStatuses3[gActiveBattler] & STATUS3_ROOTED))) { @@ -5118,7 +5118,7 @@ static void sub_804CF10(u8 slotId) MarkBattlerForControllerExec(gActiveBattler); } -static void atk50_openpartyscreen(void) +static void Cmd_openpartyscreen(void) { u32 flags; u8 hitmarkerFaintBits; @@ -5408,7 +5408,7 @@ static void atk50_openpartyscreen(void) } } -static void atk51_switchhandleorder(void) +static void Cmd_switchhandleorder(void) { s32 i; if (gBattleControllerExecFlags) @@ -5475,7 +5475,7 @@ static void atk51_switchhandleorder(void) gBattlescriptCurrInstr += 3; } -static void atk52_switchineffects(void) +static void Cmd_switchineffects(void) { s32 i; @@ -5557,7 +5557,7 @@ static void atk52_switchineffects(void) } } -static void atk53_trainerslidein(void) +static void Cmd_trainerslidein(void) { gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]); BtlController_EmitTrainerSlide(0); @@ -5566,7 +5566,7 @@ static void atk53_trainerslidein(void) gBattlescriptCurrInstr += 2; } -static void atk54_playse(void) +static void Cmd_playse(void) { gActiveBattler = gBattlerAttacker; BtlController_EmitPlaySE(0, T2_READ_16(gBattlescriptCurrInstr + 1)); @@ -5575,7 +5575,7 @@ static void atk54_playse(void) gBattlescriptCurrInstr += 3; } -static void atk55_fanfare(void) +static void Cmd_fanfare(void) { gActiveBattler = gBattlerAttacker; BtlController_EmitPlayFanfareOrBGM(0, T2_READ_16(gBattlescriptCurrInstr + 1), FALSE); @@ -5584,7 +5584,7 @@ static void atk55_fanfare(void) gBattlescriptCurrInstr += 3; } -static void atk56_playfaintcry(void) +static void Cmd_playfaintcry(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); BtlController_EmitFaintingCry(0); @@ -5593,7 +5593,7 @@ static void atk56_playfaintcry(void) gBattlescriptCurrInstr += 2; } -static void atk57(void) +static void Cmd_unknown_57(void) { gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); BtlController_EmitCmd55(0, gBattleOutcome); @@ -5602,7 +5602,7 @@ static void atk57(void) gBattlescriptCurrInstr += 1; } -static void atk58_returntoball(void) +static void Cmd_returntoball(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); BtlController_EmitReturnMonToBall(0, 1); @@ -5611,7 +5611,7 @@ static void atk58_returntoball(void) gBattlescriptCurrInstr += 2; } -static void atk59_handlelearnnewmove(void) +static void Cmd_handlelearnnewmove(void) { const u8 *jumpPtr1 = T1_READ_PTR(gBattlescriptCurrInstr + 1); const u8 *jumpPtr2 = T1_READ_PTR(gBattlescriptCurrInstr + 5); @@ -5651,7 +5651,7 @@ static void atk59_handlelearnnewmove(void) } } -static void atk5A_yesnoboxlearnmove(void) +static void Cmd_yesnoboxlearnmove(void) { gActiveBattler = 0; @@ -5770,7 +5770,7 @@ static void atk5A_yesnoboxlearnmove(void) } } -static void atk5B_yesnoboxstoplearningmove(void) +static void Cmd_yesnoboxstoplearningmove(void) { switch (gBattleScripting.learnMoveState) { @@ -5817,7 +5817,7 @@ static void atk5B_yesnoboxstoplearningmove(void) } } -static void atk5C_hitanimation(void) +static void Cmd_hitanimation(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -5894,7 +5894,7 @@ static u32 GetTrainerMoneyToGive(u16 trainerId) return moneyReward; } -static void atk5D_getmoneyreward(void) +static void Cmd_getmoneyreward(void) { u32 moneyReward = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) @@ -5906,7 +5906,7 @@ static void atk5D_getmoneyreward(void) gBattlescriptCurrInstr++; } -static void atk5E(void) +static void Cmd_unknown_5E(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -5933,7 +5933,7 @@ static void atk5E(void) } } -static void atk5F_swapattackerwithtarget(void) +static void Cmd_swapattackerwithtarget(void) { gActiveBattler = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; @@ -5947,7 +5947,7 @@ static void atk5F_swapattackerwithtarget(void) gBattlescriptCurrInstr++; } -static void atk60_incrementgamestat(void) +static void Cmd_incrementgamestat(void) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) IncrementGameStat(gBattlescriptCurrInstr[1]); @@ -5955,7 +5955,7 @@ static void atk60_incrementgamestat(void) gBattlescriptCurrInstr += 2; } -static void atk61_drawpartystatussummary(void) +static void Cmd_drawpartystatussummary(void) { s32 i; struct Pokemon *party; @@ -5992,7 +5992,7 @@ static void atk61_drawpartystatussummary(void) gBattlescriptCurrInstr += 2; } -static void atk62_hidepartystatussummary(void) +static void Cmd_hidepartystatussummary(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); BtlController_EmitHidePartyStatusSummary(0); @@ -6001,7 +6001,7 @@ static void atk62_hidepartystatussummary(void) gBattlescriptCurrInstr += 2; } -static void atk63_jumptocalledmove(void) +static void Cmd_jumptocalledmove(void) { if (gBattlescriptCurrInstr[1]) gCurrentMove = gCalledMove; @@ -6011,7 +6011,7 @@ static void atk63_jumptocalledmove(void) gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } -static void atk64_statusanimation(void) +static void Cmd_statusanimation(void) { if (gBattleControllerExecFlags == 0) { @@ -6027,7 +6027,7 @@ static void atk64_statusanimation(void) } } -static void atk65_status2animation(void) +static void Cmd_status2animation(void) { u32 wantedToAnimate; @@ -6046,7 +6046,7 @@ static void atk65_status2animation(void) } } -static void atk66_chosenstatusanimation(void) +static void Cmd_chosenstatusanimation(void) { u32 wantedStatus; @@ -6065,7 +6065,7 @@ static void atk66_chosenstatusanimation(void) } } -static void atk67_yesnobox(void) +static void Cmd_yesnobox(void) { switch (gBattleCommunication[0]) { @@ -6108,7 +6108,7 @@ static void atk67_yesnobox(void) } } -static void atk68_cancelallactions(void) +static void Cmd_cancelallactions(void) { s32 i; @@ -6118,7 +6118,7 @@ static void atk68_cancelallactions(void) gBattlescriptCurrInstr++; } -static void atk69_adjustsetdamage(void) // The same as 0x7, except there's no random damage multiplier. +static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except there's no random damage multiplier. { u8 holdEffect, param; @@ -6158,7 +6158,7 @@ static void atk69_adjustsetdamage(void) // The same as 0x7, except there's no ra gBattlescriptCurrInstr++; } -static void atk6A_removeitem(void) +static void Cmd_removeitem(void) { u16* usedHeldItem; @@ -6174,35 +6174,35 @@ static void atk6A_removeitem(void) gBattlescriptCurrInstr += 2; } -static void atk6B_atknameinbuff1(void) +static void Cmd_atknameinbuff1(void) { PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattlerPartyIndexes[gBattlerAttacker]) gBattlescriptCurrInstr++; } -static void atk6C_drawlvlupbox(void) +static void Cmd_drawlvlupbox(void) { - if (gBattleScripting.atk6C_state == 0) + if (gBattleScripting.drawlvlupboxState == 0) { if (IsMonGettingExpSentOut()) - gBattleScripting.atk6C_state = 3; + gBattleScripting.drawlvlupboxState = 3; else - gBattleScripting.atk6C_state = 1; + gBattleScripting.drawlvlupboxState = 1; } - switch (gBattleScripting.atk6C_state) + switch (gBattleScripting.drawlvlupboxState) { case 1: gBattle_BG2_Y = 0x60; SetBgAttribute(2, BG_ATTR_PRIORITY, 0); ShowBg(2); sub_804F17C(); - gBattleScripting.atk6C_state = 2; + gBattleScripting.drawlvlupboxState = 2; break; case 2: if (!sub_804F1CC()) - gBattleScripting.atk6C_state = 3; + gBattleScripting.drawlvlupboxState = 3; break; case 3: gBattle_BG1_X = 0; @@ -6212,20 +6212,20 @@ static void atk6C_drawlvlupbox(void) ShowBg(0); ShowBg(1); HandleBattleWindow(0x12, 7, 0x1D, 0x13, WINDOW_x80); - gBattleScripting.atk6C_state = 4; + gBattleScripting.drawlvlupboxState = 4; break; case 4: DrawLevelUpWindow1(); PutWindowTilemap(13); CopyWindowToVram(13, 3); - gBattleScripting.atk6C_state++; + gBattleScripting.drawlvlupboxState++; break; case 5: case 7: if (!IsDma3ManagerBusyWithBgCopy()) { gBattle_BG1_Y = 0; - gBattleScripting.atk6C_state++; + gBattleScripting.drawlvlupboxState++; } break; case 6: @@ -6234,7 +6234,7 @@ static void atk6C_drawlvlupbox(void) PlaySE(SE_SELECT); DrawLevelUpWindow2(); CopyWindowToVram(13, 2); - gBattleScripting.atk6C_state++; + gBattleScripting.drawlvlupboxState++; } break; case 8: @@ -6242,7 +6242,7 @@ static void atk6C_drawlvlupbox(void) { PlaySE(SE_SELECT); HandleBattleWindow(0x12, 7, 0x1D, 0x13, WINDOW_x80 | WINDOW_CLEAR); - gBattleScripting.atk6C_state++; + gBattleScripting.drawlvlupboxState++; } break; case 9: @@ -6257,7 +6257,7 @@ static void atk6C_drawlvlupbox(void) SetBgAttribute(2, BG_ATTR_PRIORITY, 2); ShowBg(2); - gBattleScripting.atk6C_state = 10; + gBattleScripting.drawlvlupboxState = 10; } break; case 10: @@ -6455,19 +6455,19 @@ static bool32 IsMonGettingExpSentOut(void) return FALSE; } -static void atk6D_resetsentmonsvalue(void) +static void Cmd_resetsentmonsvalue(void) { ResetSentPokesToOpponentValue(); gBattlescriptCurrInstr++; } -static void atk6E_setatktoplayer0(void) +static void Cmd_setatktoplayer0(void) { gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); gBattlescriptCurrInstr++; } -static void atk6F_makevisible(void) +static void Cmd_makevisible(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); BtlController_EmitSpriteInvisibility(0, FALSE); @@ -6476,7 +6476,7 @@ static void atk6F_makevisible(void) gBattlescriptCurrInstr += 2; } -static void atk70_recordlastability(void) +static void Cmd_recordlastability(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); RecordAbilityBattle(gActiveBattler, gLastUsedAbility); @@ -6488,13 +6488,13 @@ void BufferMoveToLearnIntoBattleTextBuff2(void) PREPARE_MOVE_BUFFER(gBattleTextBuff2, gMoveToLearn); } -static void atk71_buffermovetolearn(void) +static void Cmd_buffermovetolearn(void) { BufferMoveToLearnIntoBattleTextBuff2(); gBattlescriptCurrInstr++; } -static void atk72_jumpifplayerran(void) +static void Cmd_jumpifplayerran(void) { if (TryRunFromBattle(gBattlerFainted)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -6502,7 +6502,7 @@ static void atk72_jumpifplayerran(void) gBattlescriptCurrInstr += 5; } -static void atk73_hpthresholds(void) +static void Cmd_hpthresholds(void) { u8 opposingBank; s32 result; @@ -6529,7 +6529,7 @@ static void atk73_hpthresholds(void) gBattlescriptCurrInstr += 2; } -static void atk74_hpthresholds2(void) +static void Cmd_hpthresholds2(void) { u8 opposingBank; s32 result; @@ -6555,14 +6555,14 @@ static void atk74_hpthresholds2(void) gBattlescriptCurrInstr += 2; } -static void atk75_useitemonopponent(void) +static void Cmd_useitemonopponent(void) { gBattlerInMenuId = gBattlerAttacker; PokemonUseItemEffects(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]], gLastUsedItem, gBattlerPartyIndexes[gBattlerAttacker], 0, 1); gBattlescriptCurrInstr += 1; } -static void atk76_various(void) +static void Cmd_various(void) { u8 side; s32 i; @@ -6741,7 +6741,7 @@ static void atk76_various(void) gBattlescriptCurrInstr += 3; } -static void atk77_setprotectlike(void) // protect and endure +static void Cmd_setprotectlike(void) // protect and endure { bool8 notLastTurn = TRUE; u16 lastMove = gLastResultingMoves[gBattlerAttacker]; @@ -6776,7 +6776,7 @@ static void atk77_setprotectlike(void) // protect and endure gBattlescriptCurrInstr++; } -static void atk78_faintifabilitynotdamp(void) +static void Cmd_faintifabilitynotdamp(void) { if (gBattleControllerExecFlags) return; @@ -6811,7 +6811,7 @@ static void atk78_faintifabilitynotdamp(void) } } -static void atk79_setatkhptozero(void) +static void Cmd_setatkhptozero(void) { if (gBattleControllerExecFlags) return; @@ -6824,7 +6824,7 @@ static void atk79_setatkhptozero(void) gBattlescriptCurrInstr++; } -static void atk7A_jumpifnexttargetvalid(void) +static void Cmd_jumpifnexttargetvalid(void) { const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -6849,7 +6849,7 @@ static void atk7A_jumpifnexttargetvalid(void) } } -static void atk7B_tryhealhalfhealth(void) +static void Cmd_tryhealhalfhealth(void) { const u8* failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -6867,7 +6867,7 @@ static void atk7B_tryhealhalfhealth(void) gBattlescriptCurrInstr += 6; } -static void atk7C_trymirrormove(void) +static void Cmd_trymirrormove(void) { s32 validMovesCount; s32 i; @@ -6917,7 +6917,7 @@ static void atk7C_trymirrormove(void) } } -static void atk7D_setrain(void) +static void Cmd_setrain(void) { if (gBattleWeather & WEATHER_RAIN_ANY) { @@ -6933,7 +6933,7 @@ static void atk7D_setrain(void) gBattlescriptCurrInstr++; } -static void atk7E_setreflect(void) +static void Cmd_setreflect(void) { if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT) { @@ -6954,7 +6954,7 @@ static void atk7E_setreflect(void) gBattlescriptCurrInstr++; } -static void atk7F_setseeded(void) +static void Cmd_setseeded(void) { if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED) { @@ -6976,21 +6976,21 @@ static void atk7F_setseeded(void) gBattlescriptCurrInstr++; } -static void atk80_manipulatedamage(void) +static void Cmd_manipulatedamage(void) { switch (gBattlescriptCurrInstr[1]) { - case ATK80_DMG_CHANGE_SIGN: + case DMG_CHANGE_SIGN: gBattleMoveDamage *= -1; break; - case ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP: + case DMG_RECOIL_FROM_MISS: gBattleMoveDamage /= 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; if ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage) gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; break; - case ATK80_DMG_DOUBLED: + case DMG_DOUBLED: gBattleMoveDamage *= 2; break; } @@ -6998,7 +6998,7 @@ static void atk80_manipulatedamage(void) gBattlescriptCurrInstr += 2; } -static void atk81_trysetrest(void) +static void Cmd_trysetrest(void) { const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); gActiveBattler = gBattlerTarget = gBattlerAttacker; @@ -7022,7 +7022,7 @@ static void atk81_trysetrest(void) } } -static void atk82_jumpifnotfirstturn(void) +static void Cmd_jumpifnotfirstturn(void) { const u8* failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -7032,7 +7032,7 @@ static void atk82_jumpifnotfirstturn(void) gBattlescriptCurrInstr = failJump; } -static void atk83_nop(void) +static void Cmd_nop(void) { gBattlescriptCurrInstr++; } @@ -7064,7 +7064,7 @@ bool8 UproarWakeUpCheck(u8 battlerId) return TRUE; } -static void atk84_jumpifcantmakeasleep(void) +static void Cmd_jumpifcantmakeasleep(void) { const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -7086,7 +7086,7 @@ static void atk84_jumpifcantmakeasleep(void) } } -static void atk85_stockpile(void) +static void Cmd_stockpile(void) { if (gDisableStructs[gBattlerAttacker].stockpileCounter == 3) { @@ -7104,7 +7104,7 @@ static void atk85_stockpile(void) gBattlescriptCurrInstr++; } -static void atk86_stockpiletobasedamage(void) +static void Cmd_stockpiletobasedamage(void) { const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) @@ -7130,7 +7130,7 @@ static void atk86_stockpiletobasedamage(void) } } -static void atk87_stockpiletohpheal(void) +static void Cmd_stockpiletohpheal(void) { const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -7161,7 +7161,7 @@ static void atk87_stockpiletohpheal(void) } } -static void atk88_negativedamage(void) +static void Cmd_negativedamage(void) { gBattleMoveDamage = -(gHpDealt / 2); if (gBattleMoveDamage == 0) @@ -7170,8 +7170,8 @@ static void atk88_negativedamage(void) gBattlescriptCurrInstr++; } -#define STAT_CHANGE_WORKED 0 -#define STAT_CHANGE_DIDNT_WORK 1 +#define STAT_BUFF_WORKED 0 +#define STAT_BUFF_DIDNT_WORK 1 static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) { @@ -7190,9 +7190,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) certain++; flags &= ~(MOVE_EFFECT_CERTAIN); - if (flags & STAT_CHANGE_NOT_PROTECT_AFFECTED) + if (flags & STAT_BUFF_NOT_PROTECT_AFFECTED) notProtectAffected++; - flags &= ~(STAT_CHANGE_NOT_PROTECT_AFFECTED); + flags &= ~(STAT_BUFF_NOT_PROTECT_AFFECTED); PREPARE_STAT_BUFFER(gBattleTextBuff1, statId) @@ -7201,7 +7201,7 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) if (gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].mistTimer && !certain && gCurrentMove != MOVE_CURSE) { - if (flags == STAT_CHANGE_BS_PTR) + if (flags == STAT_BUFF_ALLOW_PTR) { if (gSpecialStatuses[gActiveBattler].statLowered) { @@ -7215,19 +7215,19 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gSpecialStatuses[gActiveBattler].statLowered = 1; } } - return STAT_CHANGE_DIDNT_WORK; + return STAT_BUFF_DIDNT_WORK; } else if (gCurrentMove != MOVE_CURSE && notProtectAffected != TRUE && JumpIfMoveAffectedByProtect(0)) { gBattlescriptCurrInstr = BattleScript_ButItFailed; - return STAT_CHANGE_DIDNT_WORK; + return STAT_BUFF_DIDNT_WORK; } else if ((gBattleMons[gActiveBattler].ability == ABILITY_CLEAR_BODY || gBattleMons[gActiveBattler].ability == ABILITY_WHITE_SMOKE) && !certain && gCurrentMove != MOVE_CURSE) { - if (flags == STAT_CHANGE_BS_PTR) + if (flags == STAT_BUFF_ALLOW_PTR) { if (gSpecialStatuses[gActiveBattler].statLowered) { @@ -7243,12 +7243,12 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gSpecialStatuses[gActiveBattler].statLowered = 1; } } - return STAT_CHANGE_DIDNT_WORK; + return STAT_BUFF_DIDNT_WORK; } else if (gBattleMons[gActiveBattler].ability == ABILITY_KEEN_EYE && !certain && statId == STAT_ACC) { - if (flags == STAT_CHANGE_BS_PTR) + if (flags == STAT_BUFF_ALLOW_PTR) { BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; @@ -7256,12 +7256,12 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gLastUsedAbility = gBattleMons[gActiveBattler].ability; RecordAbilityBattle(gActiveBattler, gLastUsedAbility); } - return STAT_CHANGE_DIDNT_WORK; + return STAT_BUFF_DIDNT_WORK; } else if (gBattleMons[gActiveBattler].ability == ABILITY_HYPER_CUTTER && !certain && statId == STAT_ATK) { - if (flags == STAT_CHANGE_BS_PTR) + if (flags == STAT_BUFF_ALLOW_PTR) { BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; @@ -7269,11 +7269,11 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gLastUsedAbility = gBattleMons[gActiveBattler].ability; RecordAbilityBattle(gActiveBattler, gLastUsedAbility); } - return STAT_CHANGE_DIDNT_WORK; + return STAT_BUFF_DIDNT_WORK; } else if (gBattleMons[gActiveBattler].ability == ABILITY_SHIELD_DUST && flags == 0) { - return STAT_CHANGE_DIDNT_WORK; + return STAT_BUFF_DIDNT_WORK; } else // try to decrease { @@ -7334,23 +7334,23 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) if (gBattleMons[gActiveBattler].statStages[statId] > 0xC) gBattleMons[gActiveBattler].statStages[statId] = 0xC; - if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && flags & STAT_CHANGE_BS_PTR) + if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && flags & STAT_BUFF_ALLOW_PTR) gMoveResultFlags |= MOVE_RESULT_MISSED; - if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && !(flags & STAT_CHANGE_BS_PTR)) - return STAT_CHANGE_DIDNT_WORK; + if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && !(flags & STAT_BUFF_ALLOW_PTR)) + return STAT_BUFF_DIDNT_WORK; - return STAT_CHANGE_WORKED; + return STAT_BUFF_WORKED; } -static void atk89_statbuffchange(void) +static void Cmd_statbuffchange(void) { const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); - if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_CHANGE_WORKED) + if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_BUFF_WORKED) gBattlescriptCurrInstr += 6; } -static void atk8A_normalisebuffs(void) // haze +static void Cmd_normalisebuffs(void) // haze { s32 i, j; @@ -7363,7 +7363,7 @@ static void atk8A_normalisebuffs(void) // haze gBattlescriptCurrInstr++; } -static void atk8B_setbide(void) +static void Cmd_setbide(void) { gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gBattlerAttacker] = gCurrentMove; @@ -7373,7 +7373,7 @@ static void atk8B_setbide(void) gBattlescriptCurrInstr++; } -static void atk8C_confuseifrepeatingattackends(void) +static void Cmd_confuseifrepeatingattackends(void) { if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE)) gBattleCommunication[MOVE_EFFECT_BYTE] = (MOVE_EFFECT_THRASH | MOVE_EFFECT_AFFECTS_USER); @@ -7381,7 +7381,7 @@ static void atk8C_confuseifrepeatingattackends(void) gBattlescriptCurrInstr++; } -static void atk8D_setmultihitcounter(void) +static void Cmd_setmultihitcounter(void) { if (gBattlescriptCurrInstr[1]) { @@ -7399,7 +7399,7 @@ static void atk8D_setmultihitcounter(void) gBattlescriptCurrInstr += 2; } -static void atk8E_initmultihitstring(void) +static void Cmd_initmultihitstring(void) { PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) @@ -7427,7 +7427,7 @@ static bool8 TryDoForceSwitchOut(void) return TRUE; } -static void atk8F_forcerandomswitch(void) +static void Cmd_forcerandomswitch(void) { s32 i; s32 battler1PartyId = 0; @@ -7588,7 +7588,7 @@ static void atk8F_forcerandomswitch(void) } } -static void atk90_tryconversiontypechange(void) // randomly changes user's type to one of its moves' type +static void Cmd_tryconversiontypechange(void) // randomly changes user's type to one of its moves' type { u8 validMoves = 0; u8 moveChecked; @@ -7650,7 +7650,7 @@ static void atk90_tryconversiontypechange(void) // randomly changes user's type } } -static void atk91_givepaydaymoney(void) +static void Cmd_givepaydaymoney(void) { if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && gPaydayMoney != 0) { @@ -7668,7 +7668,7 @@ static void atk91_givepaydaymoney(void) } } -static void atk92_setlightscreen(void) +static void Cmd_setlightscreen(void) { if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN) { @@ -7690,7 +7690,7 @@ static void atk92_setlightscreen(void) gBattlescriptCurrInstr++; } -static void atk93_tryKO(void) +static void Cmd_tryKO(void) { u8 holdEffect, param; @@ -7776,7 +7776,7 @@ static void atk93_tryKO(void) } } -static void atk94_damagetohalftargethp(void) // super fang +static void Cmd_damagetohalftargethp(void) // super fang { gBattleMoveDamage = gBattleMons[gBattlerTarget].hp / 2; if (gBattleMoveDamage == 0) @@ -7785,7 +7785,7 @@ static void atk94_damagetohalftargethp(void) // super fang gBattlescriptCurrInstr++; } -static void atk95_setsandstorm(void) +static void Cmd_setsandstorm(void) { if (gBattleWeather & WEATHER_SANDSTORM_ANY) { @@ -7801,7 +7801,7 @@ static void atk95_setsandstorm(void) gBattlescriptCurrInstr++; } -static void atk96_weatherdamage(void) +static void Cmd_weatherdamage(void) { if (WEATHER_HAS_EFFECT) { @@ -7853,7 +7853,7 @@ static void atk96_weatherdamage(void) gBattlescriptCurrInstr++; } -static void atk97_tryinfatuating(void) +static void Cmd_tryinfatuating(void) { struct Pokemon *monAttacker, *monTarget; u16 speciesAttacker, speciesTarget; @@ -7898,7 +7898,7 @@ static void atk97_tryinfatuating(void) } } -static void atk98_updatestatusicon(void) +static void Cmd_updatestatusicon(void) { if (gBattleControllerExecFlags) return; @@ -7931,7 +7931,7 @@ static void atk98_updatestatusicon(void) } } -static void atk99_setmist(void) +static void Cmd_setmist(void) { if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer) { @@ -7948,7 +7948,7 @@ static void atk99_setmist(void) gBattlescriptCurrInstr++; } -static void atk9A_setfocusenergy(void) +static void Cmd_setfocusenergy(void) { if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) { @@ -7963,7 +7963,7 @@ static void atk9A_setfocusenergy(void) gBattlescriptCurrInstr++; } -static void atk9B_transformdataexecution(void) +static void Cmd_transformdataexecution(void) { gChosenMove = 0xFFFF; gBattlescriptCurrInstr++; @@ -8007,7 +8007,7 @@ static void atk9B_transformdataexecution(void) } } -static void atk9C_setsubstitute(void) +static void Cmd_setsubstitute(void) { u32 hp = gBattleMons[gBattlerAttacker].maxHP / 4; if (gBattleMons[gBattlerAttacker].maxHP / 4 == 0) @@ -8043,7 +8043,7 @@ static bool8 IsMoveUncopyableByMimic(u16 move) return (sMovesForbiddenToCopy[i] != MIMIC_FORBIDDEN_END); } -static void atk9D_mimicattackcopy(void) +static void Cmd_mimicattackcopy(void) { gChosenMove = 0xFFFF; @@ -8085,7 +8085,7 @@ static void atk9D_mimicattackcopy(void) } } -static void atk9E_metronome(void) +static void Cmd_metronome(void) { while (1) { @@ -8117,13 +8117,13 @@ static void atk9E_metronome(void) } } -static void atk9F_dmgtolevel(void) +static void Cmd_dmgtolevel(void) { gBattleMoveDamage = gBattleMons[gBattlerAttacker].level; gBattlescriptCurrInstr++; } -static void atkA0_psywavedamageeffect(void) +static void Cmd_psywavedamageeffect(void) { s32 randDamage; @@ -8134,7 +8134,7 @@ static void atkA0_psywavedamageeffect(void) gBattlescriptCurrInstr++; } -static void atkA1_counterdamagecalculator(void) +static void Cmd_counterdamagecalculator(void) { u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].physicalBattlerId); @@ -8159,7 +8159,7 @@ static void atkA1_counterdamagecalculator(void) } } -static void atkA2_mirrorcoatdamagecalculator(void) // a copy of atkA1 with the physical -> special field changes +static void Cmd_mirrorcoatdamagecalculator(void) // a copy of Cmd with the physical -> special field changes { u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].specialBattlerId); @@ -8182,7 +8182,7 @@ static void atkA2_mirrorcoatdamagecalculator(void) // a copy of atkA1 with the p } } -static void atkA3_disablelastusedattack(void) +static void Cmd_disablelastusedattack(void) { s32 i; @@ -8207,7 +8207,7 @@ static void atkA3_disablelastusedattack(void) } } -static void atkA4_trysetencore(void) +static void Cmd_trysetencore(void) { s32 i; @@ -8239,7 +8239,7 @@ static void atkA4_trysetencore(void) } } -static void atkA5_painsplitdmgcalc(void) +static void Cmd_painsplitdmgcalc(void) { if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)) { @@ -8263,7 +8263,7 @@ static void atkA5_painsplitdmgcalc(void) } } -static void atkA6_settypetorandomresistance(void) // conversion 2 +static void Cmd_settypetorandomresistance(void) // conversion 2 { if (gLastLandedMoves[gBattlerAttacker] == 0 || gLastLandedMoves[gBattlerAttacker] == 0xFFFF) @@ -8323,7 +8323,7 @@ static void atkA6_settypetorandomresistance(void) // conversion 2 } } -static void atkA7_setalwayshitflag(void) +static void Cmd_setalwayshitflag(void) { gStatuses3[gBattlerTarget] &= ~(STATUS3_ALWAYS_HITS); gStatuses3[gBattlerTarget] |= 0x10; @@ -8331,7 +8331,7 @@ static void atkA7_setalwayshitflag(void) gBattlescriptCurrInstr++; } -static void atkA8_copymovepermanently(void) // sketch +static void Cmd_copymovepermanently(void) // sketch { gChosenMove = 0xFFFF; @@ -8426,7 +8426,7 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c return 2; } -static void atkA9_trychoosesleeptalkmove(void) +static void Cmd_trychoosesleeptalkmove(void) { s32 i; u8 unusableMovesBits = 0; @@ -8465,7 +8465,7 @@ static void atkA9_trychoosesleeptalkmove(void) } } -static void atkAA_setdestinybond(void) +static void Cmd_setdestinybond(void) { gBattleMons[gBattlerAttacker].status2 |= STATUS2_DESTINY_BOND; gBattlescriptCurrInstr++; @@ -8483,13 +8483,13 @@ static void TrySetDestinyBondToHappen(void) } } -static void atkAB_trysetdestinybondtohappen(void) +static void Cmd_trysetdestinybondtohappen(void) { TrySetDestinyBondToHappen(); gBattlescriptCurrInstr++; } -static void atkAC_remaininghptopower(void) +static void Cmd_remaininghptopower(void) { s32 i; s32 hpFraction = GetScaledHPFraction(gBattleMons[gBattlerAttacker].hp, gBattleMons[gBattlerAttacker].maxHP, 48); @@ -8504,7 +8504,7 @@ static void atkAC_remaininghptopower(void) gBattlescriptCurrInstr++; } -static void atkAD_tryspiteppreduce(void) +static void Cmd_tryspiteppreduce(void) { if (gLastMoves[gBattlerTarget] != 0 && gLastMoves[gBattlerTarget] != 0xFFFF) @@ -8555,7 +8555,7 @@ static void atkAD_tryspiteppreduce(void) } } -static void atkAE_healpartystatus(void) +static void Cmd_healpartystatus(void) { u32 zero = 0; u8 toHeal = 0; @@ -8651,7 +8651,7 @@ static void atkAE_healpartystatus(void) gBattlescriptCurrInstr++; } -static void atkAF_cursetarget(void) +static void Cmd_cursetarget(void) { if (gBattleMons[gBattlerTarget].status2 & STATUS2_CURSED) { @@ -8668,7 +8668,7 @@ static void atkAF_cursetarget(void) } } -static void atkB0_trysetspikes(void) +static void Cmd_trysetspikes(void) { u8 targetSide = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; @@ -8685,13 +8685,13 @@ static void atkB0_trysetspikes(void) } } -static void atkB1_setforesight(void) +static void Cmd_setforesight(void) { gBattleMons[gBattlerTarget].status2 |= STATUS2_FORESIGHT; gBattlescriptCurrInstr++; } -static void atkB2_trysetperishsong(void) +static void Cmd_trysetperishsong(void) { s32 i; s32 notAffectedCount = 0; @@ -8719,7 +8719,7 @@ static void atkB2_trysetperishsong(void) gBattlescriptCurrInstr += 5; } -static void atkB3_rolloutdamagecalculation(void) +static void Cmd_rolloutdamagecalculation(void) { if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { @@ -8754,7 +8754,7 @@ static void atkB3_rolloutdamagecalculation(void) } } -static void atkB4_jumpifconfusedandstatmaxed(void) +static void Cmd_jumpifconfusedandstatmaxed(void) { if (gBattleMons[gBattlerTarget].status2 & STATUS2_CONFUSION && gBattleMons[gBattlerTarget].statStages[gBattlescriptCurrInstr[1]] == 0xC) @@ -8763,7 +8763,7 @@ static void atkB4_jumpifconfusedandstatmaxed(void) gBattlescriptCurrInstr += 6; } -static void atkB5_furycuttercalc(void) +static void Cmd_furycuttercalc(void) { if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { @@ -8786,7 +8786,7 @@ static void atkB5_furycuttercalc(void) } } -static void atkB6_happinesstodamagecalculation(void) +static void Cmd_happinesstodamagecalculation(void) { if (gBattleMoves[gCurrentMove].effect == EFFECT_RETURN) gDynamicBasePower = 10 * (gBattleMons[gBattlerAttacker].friendship) / 25; @@ -8796,7 +8796,7 @@ static void atkB6_happinesstodamagecalculation(void) gBattlescriptCurrInstr++; } -static void atkB7_presentdamagecalculation(void) +static void Cmd_presentdamagecalculation(void) { s32 rand = Random() & 0xFF; @@ -8824,7 +8824,7 @@ static void atkB7_presentdamagecalculation(void) } } -static void atkB8_setsafeguard(void) +static void Cmd_setsafeguard(void) { if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD) { @@ -8842,7 +8842,7 @@ static void atkB8_setsafeguard(void) gBattlescriptCurrInstr++; } -static void atkB9_magnitudedamagecalculation(void) +static void Cmd_magnitudedamagecalculation(void) { s32 magnitude = Random() % 100; @@ -8896,7 +8896,7 @@ static void atkB9_magnitudedamagecalculation(void) gBattlescriptCurrInstr++; } -static void atkBA_jumpifnopursuitswitchdmg(void) +static void Cmd_jumpifnopursuitswitchdmg(void) { if (gMultiHitCounter == 1) { @@ -8940,7 +8940,7 @@ static void atkBA_jumpifnopursuitswitchdmg(void) } } -static void atkBB_setsunny(void) +static void Cmd_setsunny(void) { if (gBattleWeather & WEATHER_SUN_ANY) { @@ -8957,7 +8957,7 @@ static void atkBB_setsunny(void) gBattlescriptCurrInstr++; } -static void atkBC_maxattackhalvehp(void) // belly drum +static void Cmd_maxattackhalvehp(void) // belly drum { u32 halfHp = gBattleMons[gBattlerAttacker].maxHP / 2; @@ -8980,7 +8980,7 @@ static void atkBC_maxattackhalvehp(void) // belly drum } } -static void atkBD_copyfoestats(void) // psych up +static void Cmd_copyfoestats(void) // psych up { s32 i; @@ -8992,7 +8992,7 @@ static void atkBD_copyfoestats(void) // psych up gBattlescriptCurrInstr += 5; // Has an unused jump ptr(possibly for a failed attempt) parameter. } -static void atkBE_rapidspinfree(void) +static void Cmd_rapidspinfree(void) { if (gBattleMons[gBattlerAttacker].status2 & STATUS2_WRAPPED) { @@ -9029,13 +9029,13 @@ static void atkBE_rapidspinfree(void) } } -static void atkBF_setdefensecurlbit(void) +static void Cmd_setdefensecurlbit(void) { gBattleMons[gBattlerAttacker].status2 |= STATUS2_DEFENSE_CURL; gBattlescriptCurrInstr++; } -static void atkC0_recoverbasedonsunlight(void) +static void Cmd_recoverbasedonsunlight(void) { gBattlerTarget = gBattlerAttacker; @@ -9060,7 +9060,7 @@ static void atkC0_recoverbasedonsunlight(void) } } -static void atkC1_hiddenpowercalc(void) +static void Cmd_hiddenpowercalc(void) { u8 powerBits; u8 typeBits; @@ -9089,7 +9089,7 @@ static void atkC1_hiddenpowercalc(void) gBattlescriptCurrInstr++; } -static void atkC2_selectfirstvalidtarget(void) +static void Cmd_selectfirstvalidtarget(void) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -9101,7 +9101,7 @@ static void atkC2_selectfirstvalidtarget(void) gBattlescriptCurrInstr++; } -static void atkC3_trysetfutureattack(void) +static void Cmd_trysetfutureattack(void) { if (gWishFutureKnock.futureSightCounter[gBattlerTarget] != 0) { @@ -9129,7 +9129,7 @@ static void atkC3_trysetfutureattack(void) } } -static void atkC4_trydobeatup(void) +static void Cmd_trydobeatup(void) { struct Pokemon *party; @@ -9176,7 +9176,7 @@ static void atkC4_trydobeatup(void) } } -static void atkC5_setsemiinvulnerablebit(void) +static void Cmd_setsemiinvulnerablebit(void) { switch (gCurrentMove) { @@ -9195,7 +9195,7 @@ static void atkC5_setsemiinvulnerablebit(void) gBattlescriptCurrInstr++; } -static void atkC6_clearsemiinvulnerablebit(void) +static void Cmd_clearsemiinvulnerablebit(void) { switch (gCurrentMove) { @@ -9214,7 +9214,7 @@ static void atkC6_clearsemiinvulnerablebit(void) gBattlescriptCurrInstr++; } -static void atkC7_setminimize(void) +static void Cmd_setminimize(void) { if (gHitMarker & HITMARKER_OBEYS) gStatuses3[gBattlerAttacker] |= STATUS3_MINIMIZED; @@ -9222,7 +9222,7 @@ static void atkC7_setminimize(void) gBattlescriptCurrInstr++; } -static void atkC8_sethail(void) +static void Cmd_sethail(void) { if (gBattleWeather & WEATHER_HAIL_ANY) { @@ -9239,7 +9239,7 @@ static void atkC8_sethail(void) gBattlescriptCurrInstr++; } -static void atkC9_jumpifattackandspecialattackcannotfall(void) // memento +static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento { if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == 0 && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == 0 @@ -9257,14 +9257,14 @@ static void atkC9_jumpifattackandspecialattackcannotfall(void) // memento } } -static void atkCA_setforcedtarget(void) // follow me +static void Cmd_setforcedtarget(void) // follow me { gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; gBattlescriptCurrInstr++; } -static void atkCB_setcharge(void) +static void Cmd_setcharge(void) { gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP; gDisableStructs[gBattlerAttacker].chargeTimer = 2; @@ -9272,7 +9272,7 @@ static void atkCB_setcharge(void) gBattlescriptCurrInstr++; } -static void atkCC_callterrainattack(void) // nature power +static void Cmd_callterrainattack(void) // nature power { gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED); gCurrentMove = sNaturePowerMoves[gBattleTerrain]; @@ -9281,7 +9281,7 @@ static void atkCC_callterrainattack(void) // nature power gBattlescriptCurrInstr++; } -static void atkCD_cureifburnedparalysedorpoisoned(void) // refresh +static void Cmd_cureifburnedparalysedorpoisoned(void) // refresh { if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) { @@ -9297,7 +9297,7 @@ static void atkCD_cureifburnedparalysedorpoisoned(void) // refresh } } -static void atkCE_settorment(void) +static void Cmd_settorment(void) { if (gBattleMons[gBattlerTarget].status2 & STATUS2_TORMENT) { @@ -9310,7 +9310,7 @@ static void atkCE_settorment(void) } } -static void atkCF_jumpifnodamage(void) +static void Cmd_jumpifnodamage(void) { if (gProtectStructs[gBattlerAttacker].physicalDmg || gProtectStructs[gBattlerAttacker].specialDmg) gBattlescriptCurrInstr += 5; @@ -9318,7 +9318,7 @@ static void atkCF_jumpifnodamage(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkD0_settaunt(void) +static void Cmd_settaunt(void) { if (gDisableStructs[gBattlerTarget].tauntTimer == 0) { @@ -9332,7 +9332,7 @@ static void atkD0_settaunt(void) } } -static void atkD1_trysethelpinghand(void) +static void Cmd_trysethelpinghand(void) { gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); @@ -9350,7 +9350,7 @@ static void atkD1_trysethelpinghand(void) } } -static void atkD2_tryswapitems(void) // trick +static void Cmd_tryswapitems(void) // trick { // opponent can't swap items with player in regular battles if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL @@ -9437,7 +9437,7 @@ static void atkD2_tryswapitems(void) // trick } } -static void atkD3_trycopyability(void) // role play +static void Cmd_trycopyability(void) // role play { if (gBattleMons[gBattlerTarget].ability != 0 && gBattleMons[gBattlerTarget].ability != ABILITY_WONDER_GUARD) @@ -9452,7 +9452,7 @@ static void atkD3_trycopyability(void) // role play } } -static void atkD4_trywish(void) +static void Cmd_trywish(void) { switch (gBattlescriptCurrInstr[1]) { @@ -9485,7 +9485,7 @@ static void atkD4_trywish(void) } } -static void atkD5_trysetroots(void) // ingrain +static void Cmd_trysetroots(void) // ingrain { if (gStatuses3[gBattlerAttacker] & STATUS3_ROOTED) { @@ -9498,7 +9498,7 @@ static void atkD5_trysetroots(void) // ingrain } } -static void atkD6_doubledamagedealtifdamaged(void) +static void Cmd_doubledamagedealtifdamaged(void) { if ((gProtectStructs[gBattlerAttacker].physicalDmg && gProtectStructs[gBattlerAttacker].physicalBattlerId == gBattlerTarget) @@ -9511,7 +9511,7 @@ static void atkD6_doubledamagedealtifdamaged(void) gBattlescriptCurrInstr++; } -static void atkD7_setyawn(void) +static void Cmd_setyawn(void) { if (gStatuses3[gBattlerTarget] & STATUS3_YAWN || gBattleMons[gBattlerTarget].status1 & STATUS1_ANY) @@ -9525,7 +9525,7 @@ static void atkD7_setyawn(void) } } -static void atkD8_setdamagetohealthdifference(void) +static void Cmd_setdamagetohealthdifference(void) { if (gBattleMons[gBattlerTarget].hp <= gBattleMons[gBattlerAttacker].hp) { @@ -9538,7 +9538,7 @@ static void atkD8_setdamagetohealthdifference(void) } } -static void atkD9_scaledamagebyhealthratio(void) +static void Cmd_scaledamagebyhealthratio(void) { if (gDynamicBasePower == 0) { @@ -9550,7 +9550,7 @@ static void atkD9_scaledamagebyhealthratio(void) gBattlescriptCurrInstr++; } -static void atkDA_tryswapabilities(void) // skill swap +static void Cmd_tryswapabilities(void) // skill swap { if ((gBattleMons[gBattlerAttacker].ability == 0 && gBattleMons[gBattlerTarget].ability == 0) @@ -9570,7 +9570,7 @@ static void atkDA_tryswapabilities(void) // skill swap } } -static void atkDB_tryimprison(void) +static void Cmd_tryimprison(void) { if ((gStatuses3[gBattlerAttacker] & STATUS3_IMPRISONED_OTHERS)) { @@ -9612,7 +9612,7 @@ static void atkDB_tryimprison(void) } } -static void atkDC_trysetgrudge(void) +static void Cmd_trysetgrudge(void) { if (gStatuses3[gBattlerAttacker] & STATUS3_GRUDGE) { @@ -9625,7 +9625,7 @@ static void atkDC_trysetgrudge(void) } } -static void atkDD_weightdamagecalculation(void) +static void Cmd_weightdamagecalculation(void) { s32 i; for (i = 0; sWeightToDamageTable[i] != 0xFFFF; i += 2) @@ -9642,7 +9642,7 @@ static void atkDD_weightdamagecalculation(void) gBattlescriptCurrInstr++; } -static void atkDE_assistattackselect(void) +static void Cmd_assistattackselect(void) { s32 chooseableMovesNo = 0; struct Pokemon* party; @@ -9695,7 +9695,7 @@ static void atkDE_assistattackselect(void) } } -static void atkDF_trysetmagiccoat(void) +static void Cmd_trysetmagiccoat(void) { gBattlerTarget = gBattlerAttacker; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; @@ -9710,7 +9710,7 @@ static void atkDF_trysetmagiccoat(void) } } -static void atkE0_trysetsnatch(void) // snatch +static void Cmd_trysetsnatch(void) // snatch { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn @@ -9724,7 +9724,7 @@ static void atkE0_trysetsnatch(void) // snatch } } -static void atkE1_trygetintimidatetarget(void) +static void Cmd_trygetintimidatetarget(void) { u8 side; @@ -9747,7 +9747,7 @@ static void atkE1_trygetintimidatetarget(void) gBattlescriptCurrInstr += 5; } -static void atkE2_switchoutabilities(void) +static void Cmd_switchoutabilities(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -9763,7 +9763,7 @@ static void atkE2_switchoutabilities(void) gBattlescriptCurrInstr += 2; } -static void atkE3_jumpifhasnohp(void) +static void Cmd_jumpifhasnohp(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -9773,7 +9773,7 @@ static void atkE3_jumpifhasnohp(void) gBattlescriptCurrInstr += 6; } -static void atkE4_getsecretpowereffect(void) +static void Cmd_getsecretpowereffect(void) { switch (gBattleTerrain) { @@ -9808,7 +9808,7 @@ static void atkE4_getsecretpowereffect(void) gBattlescriptCurrInstr++; } -static void atkE5_pickup(void) +static void Cmd_pickup(void) { s32 i; u16 species, heldItem; @@ -9885,7 +9885,7 @@ static void atkE5_pickup(void) gBattlescriptCurrInstr++; } -static void atkE6_docastformchangeanimation(void) +static void Cmd_docastformchangeanimation(void) { gActiveBattler = gBattleScripting.battler; @@ -9898,7 +9898,7 @@ static void atkE6_docastformchangeanimation(void) gBattlescriptCurrInstr++; } -static void atkE7_trycastformdatachange(void) +static void Cmd_trycastformdatachange(void) { u8 form; @@ -9911,7 +9911,7 @@ static void atkE7_trycastformdatachange(void) } } -static void atkE8_settypebasedhalvers(void) // water and mud sport +static void Cmd_settypebasedhalvers(void) // water and mud sport { bool8 worked = FALSE; @@ -9940,7 +9940,7 @@ static void atkE8_settypebasedhalvers(void) // water and mud sport gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkE9_setweatherballtype(void) +static void Cmd_setweatherballtype(void) { if (WEATHER_HAS_EFFECT) { @@ -9961,7 +9961,7 @@ static void atkE9_setweatherballtype(void) gBattlescriptCurrInstr++; } -static void atkEA_tryrecycleitem(void) +static void Cmd_tryrecycleitem(void) { u16 *usedHeldItem; @@ -9984,7 +9984,7 @@ static void atkEA_tryrecycleitem(void) } } -static void atkEB_settypetoterrain(void) +static void Cmd_settypetoterrain(void) { if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain])) { @@ -9999,7 +9999,7 @@ static void atkEB_settypetoterrain(void) } } -static void atkEC_pursuitrelated(void) +static void Cmd_pursuitrelated(void) { gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); @@ -10021,7 +10021,7 @@ static void atkEC_pursuitrelated(void) } } -static void atkEF_snatchsetbattlers(void) +static void Cmd_snatchsetbattlers(void) { gEffectBattler = gBattlerAttacker; @@ -10034,7 +10034,7 @@ static void atkEF_snatchsetbattlers(void) gBattlescriptCurrInstr++; } -static void atkEE_removelightscreenreflect(void) // brick break +static void Cmd_removelightscreenreflect(void) // brick break { u8 opposingSide = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; @@ -10056,7 +10056,7 @@ static void atkEE_removelightscreenreflect(void) // brick break gBattlescriptCurrInstr++; } -static void atkEF_handleballthrow(void) +static void Cmd_handleballthrow(void) { u8 ballMultiplier = 0; @@ -10204,7 +10204,7 @@ static void atkEF_handleballthrow(void) } } -static void atkF0_givecaughtmon(void) +static void Cmd_givecaughtmon(void) { if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]]) != MON_GIVEN_TO_PARTY) { @@ -10233,7 +10233,7 @@ static void atkF0_givecaughtmon(void) gBattlescriptCurrInstr++; } -static void atkF1_trysetcaughtmondexflags(void) +static void Cmd_trysetcaughtmondexflags(void) { u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL); u32 personality = GetMonData(&gEnemyParty[0], MON_DATA_PERSONALITY, NULL); @@ -10249,7 +10249,7 @@ static void atkF1_trysetcaughtmondexflags(void) } } -static void atkF2_displaydexinfo(void) +static void Cmd_displaydexinfo(void) { u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL); @@ -10368,7 +10368,7 @@ void BattleDestroyYesNoCursorAt(u8 cursorPosition) CopyBgTilemapBufferToVram(0); } -static void atkF3_trygivecaughtmonnick(void) +static void Cmd_trygivecaughtmonnick(void) { switch (gBattleCommunication[MULTIUSE_STATE]) { @@ -10444,30 +10444,30 @@ static void atkF3_trygivecaughtmonnick(void) } } -static void atkF4_subattackerhpbydmg(void) +static void Cmd_subattackerhpbydmg(void) { gBattleMons[gBattlerAttacker].hp -= gBattleMoveDamage; gBattlescriptCurrInstr++; } -static void atkF5_removeattackerstatus1(void) +static void Cmd_removeattackerstatus1(void) { gBattleMons[gBattlerAttacker].status1 = 0; gBattlescriptCurrInstr++; } -static void atkF6_finishaction(void) +static void Cmd_finishaction(void) { gCurrentActionFuncId = B_ACTION_FINISHED; } -static void atkF7_finishturn(void) +static void Cmd_finishturn(void) { gCurrentActionFuncId = B_ACTION_FINISHED; gCurrentTurnActionNumber = gBattlersCount; } -static void atkF8_trainerslideout(void) +static void Cmd_trainerslideout(void) { gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]); BtlController_EmitTrainerSlideBack(0); diff --git a/src/battle_util.c b/src/battle_util.c index 4d3ad3c7c..8587bb88e 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2084,7 +2084,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA } } break; - case ABILITYEFFECT_MOVE_END: // Think contact abilities. + case ABILITYEFFECT_ON_DAMAGE: // Contact abilities and Color Change switch (gLastUsedAbility) { case ABILITY_COLOR_CHANGE: