give some more labels to battle struct fields

This commit is contained in:
DizzyEggg 2017-12-02 23:31:58 +01:00
parent d75e7ace1d
commit e10aea9a51
6 changed files with 63 additions and 63 deletions

View File

@ -146,8 +146,8 @@
.equiv sANIM_ARG2, gBattleScripting + 0x11 .equiv sANIM_ARG2, gBattleScripting + 0x11
.equiv sTRIPLE_KICK_POWER, gBattleScripting + 0x12 .equiv sTRIPLE_KICK_POWER, gBattleScripting + 0x12
.equiv sMOVEEND_STATE, gBattleScripting + 0x14 .equiv sMOVEEND_STATE, gBattleScripting + 0x14
.equiv sFIELD_15, gBattleScripting + 0x15 .equiv sBANK_WITH_ABILITY, gBattleScripting + 0x15
.equiv sFIELD_16, gBattleScripting + 0x16 .equiv sMULTIHIT_EFFECT, gBattleScripting + 0x16
.equiv sBANK, gBattleScripting + 0x17 .equiv sBANK, gBattleScripting + 0x17
.equiv sANIM_TURN, gBattleScripting + 0x18 .equiv sANIM_TURN, gBattleScripting + 0x18
.equiv sANIM_TARGETS_HIT, gBattleScripting + 0x19 .equiv sANIM_TARGETS_HIT, gBattleScripting + 0x19

View File

@ -624,19 +624,19 @@ BattleScript_EffectMultiHit::
ppreduce ppreduce
setmultihitcounter 0x0 setmultihitcounter 0x0
initmultihitstring initmultihitstring
setbyte sFIELD_16, 0x0 setbyte sMULTIHIT_EFFECT, 0x0
BattleScript_82D8DFD:: BattleScript_MultiHitLoop::
jumpifhasnohp ATTACKER, BattleScript_82D8E93 jumpifhasnohp ATTACKER, BattleScript_MultiHitEnd
jumpifhasnohp TARGET, BattleScript_82D8E74 jumpifhasnohp TARGET, BattleScript_MultiHitPrintStrings
jumpifhalfword EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_82D8E1F jumpifhalfword EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoMultiHit
jumpifstatus ATTACKER, STATUS_SLEEP, BattleScript_82D8E74 jumpifstatus ATTACKER, STATUS_SLEEP, BattleScript_MultiHitPrintStrings
BattleScript_82D8E1F:: BattleScript_DoMultiHit::
movevaluescleanup movevaluescleanup
copybyte cEFFECT_CHOOSER, sFIELD_16 copybyte cEFFECT_CHOOSER, sMULTIHIT_EFFECT
critcalc critcalc
damagecalc damagecalc
typecalc typecalc
jumpifmovehadnoeffect BattleScript_82D8E71 jumpifmovehadnoeffect BattleScript_MultiHitNoMoreHits
adjustnormaldamage adjustnormaldamage
attackanimation attackanimation
waitanimation waitanimation
@ -652,19 +652,19 @@ BattleScript_82D8E1F::
addbyte sMULTIHIT_STRING + 4, 0x1 addbyte sMULTIHIT_STRING + 4, 0x1
setbyte sMOVEEND_STATE, 0x0 setbyte sMOVEEND_STATE, 0x0
moveend 0x2, 0x10 moveend 0x2, 0x10
jumpifbyte COMMON_BITS, gBattleMoveFlags, MOVESTATUS_ENDURED, BattleScript_82D8E74 jumpifbyte COMMON_BITS, gBattleMoveFlags, MOVESTATUS_ENDURED, BattleScript_MultiHitPrintStrings
decrementmultihit BattleScript_82D8DFD decrementmultihit BattleScript_MultiHitLoop
goto BattleScript_82D8E74 goto BattleScript_MultiHitPrintStrings
BattleScript_82D8E71:: BattleScript_MultiHitNoMoreHits::
pause 0x20 pause 0x20
BattleScript_82D8E74:: BattleScript_MultiHitPrintStrings::
resultmessage resultmessage
waitmessage 0x40 waitmessage 0x40
jumpifmovehadnoeffect BattleScript_82D8E93 jumpifmovehadnoeffect BattleScript_MultiHitEnd
copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6
printstring STRINGID_HITXTIMES printstring STRINGID_HITXTIMES
waitmessage 0x40 waitmessage 0x40
BattleScript_82D8E93:: BattleScript_MultiHitEnd::
seteffectwithchance seteffectwithchance
tryfaintmon TARGET, FALSE, NULL tryfaintmon TARGET, FALSE, NULL
setbyte sMOVEEND_STATE, 0x2 setbyte sMOVEEND_STATE, 0x2
@ -862,8 +862,8 @@ BattleScript_EffectDoubleHit::
ppreduce ppreduce
setmultihitcounter 0x2 setmultihitcounter 0x2
initmultihitstring initmultihitstring
setbyte sFIELD_16, 0x0 setbyte sMULTIHIT_EFFECT, 0x0
goto BattleScript_82D8DFD goto BattleScript_MultiHitLoop
BattleScript_EffectRecoilIfMiss:: BattleScript_EffectRecoilIfMiss::
attackcanceler attackcanceler
@ -1094,12 +1094,12 @@ BattleScript_EffectConfuseHit::
BattleScript_EffectTwineedle:: BattleScript_EffectTwineedle::
attackcanceler attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
setbyte sFIELD_16, 0x2 setbyte sMULTIHIT_EFFECT, EFFECT_POISON
attackstring attackstring
ppreduce ppreduce
setmultihitcounter 0x2 setmultihitcounter 0x2
initmultihitstring initmultihitstring
goto BattleScript_82D8DFD goto BattleScript_MultiHitLoop
BattleScript_EffectSubstitute:: BattleScript_EffectSubstitute::
attackcanceler attackcanceler
@ -1952,7 +1952,7 @@ BattleScript_EffectTeleport::
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed
getifcantrunfrombattle ATTACKER getifcantrunfrombattle ATTACKER
jumpifbyte EQUAL, gBattleCommunication, 0x1, BattleScript_ButItFailed jumpifbyte EQUAL, gBattleCommunication, 0x1, BattleScript_ButItFailed
jumpifbyte EQUAL, gBattleCommunication, 0x2, BattleScript_82DA382 jumpifbyte EQUAL, gBattleCommunication, 0x2, BattleScript_PrintAbilityMadeIneffective
attackanimation attackanimation
waitanimation waitanimation
printstring STRINGID_PKMNFLEDFROMBATTLE printstring STRINGID_PKMNFLEDFROMBATTLE
@ -2474,8 +2474,8 @@ BattleScript_EffectYawn::
attackcanceler attackcanceler
attackstring attackstring
ppreduce ppreduce
jumpifability TARGET, ABILITY_VITAL_SPIRIT, BattleScript_82DA378 jumpifability TARGET, ABILITY_VITAL_SPIRIT, BattleScript_PrintBankAbilityMadeIneffective
jumpifability TARGET, ABILITY_INSOMNIA, BattleScript_82DA378 jumpifability TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective
jumpifstatus2 TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed jumpifstatus2 TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed
jumpifsideaffecting TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected jumpifsideaffecting TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
@ -2486,9 +2486,9 @@ BattleScript_EffectYawn::
printstring STRINGID_PKMNWASMADEDROWSY printstring STRINGID_PKMNWASMADEDROWSY
waitmessage 0x40 waitmessage 0x40
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_82DA378:: BattleScript_PrintBankAbilityMadeIneffective::
copybyte sBANK, sFIELD_15 copybyte sBANK, sBANK_WITH_ABILITY
BattleScript_82DA382:: BattleScript_PrintAbilityMadeIneffective::
pause 0x20 pause 0x20
printstring STRINGID_PKMNSXMADEITINEFFECTIVE printstring STRINGID_PKMNSXMADEITINEFFECTIVE
waitmessage 0x40 waitmessage 0x40

View File

@ -24,13 +24,13 @@ gBattlescriptsForBallThrow:: @ 82DBD08
.4byte BattleScript_BallThrow .4byte BattleScript_BallThrow
.align 2 .align 2
gUnknown_082DBD3C:: @ 82DBD3C gBattlescriptsForUsingItem:: @ 82DBD3C
.4byte BattleScript_82DBE12 .4byte BattleScript_PlayerUsesItem
.4byte BattleScript_82DBE1C .4byte BattleScript_OpponentUsesHealItem
.4byte BattleScript_82DBE1C .4byte BattleScript_OpponentUsesHealItem
.4byte BattleScript_82DBE4B .4byte BattleScript_OpponentUsesStatusCureItem
.4byte BattleScript_82DBE6F .4byte BattleScript_OpponentUsesXItem
.4byte BattleScript_82DBE91 .4byte BattleScript_OpponentUsesGuardSpecs
.align 2 .align 2
gBattlescriptsForRunningByItem:: @ 82DBD54 gBattlescriptsForRunningByItem:: @ 82DBD54
@ -58,27 +58,27 @@ BattleScript_SafariBallThrow::
handleballthrow handleballthrow
BattleScript_SuccessBallThrow:: BattleScript_SuccessBallThrow::
jumpifhalfword EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_82DBD92 jumpifhalfword EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
incrementgamestat 0xB incrementgamestat 0xB
BattleScript_82DBD92:: BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHT printstring STRINGID_GOTCHAPKMNCAUGHT
trysetcaughtmondexflags BattleScript_82DBDA5 trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX printstring STRINGID_PKMNDATAADDEDTODEX
waitstate waitstate
setbyte gBattleCommunication, 0x0 setbyte gBattleCommunication, 0x0
displaydexinfo displaydexinfo
BattleScript_82DBDA5:: BattleScript_TryNicknameCaughtMon::
printstring STRINGID_GIVENICKNAMECAPTURED printstring STRINGID_GIVENICKNAMECAPTURED
waitstate waitstate
setbyte gBattleCommunication, 0x0 setbyte gBattleCommunication, 0x0
trygivecaughtmonnick BattleScript_82DBDC2 trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
givecaughtmon givecaughtmon
printfromtable gCaughtMonStringIds printfromtable gCaughtMonStringIds
waitmessage 0x40 waitmessage 0x40
goto BattleScript_82DBDC3 goto BattleScript_SuccessBallThrowEnd
BattleScript_82DBDC2:: BattleScript_GiveCaughtMonEnd::
givecaughtmon givecaughtmon
BattleScript_82DBDC3:: BattleScript_SuccessBallThrowEnd::
setbyte gBattleOutcome, CAUGHT setbyte gBattleOutcome, CAUGHT
finishturn finishturn
@ -106,12 +106,12 @@ BattleScript_TrainerBallBlock::
waitmessage 0x40 waitmessage 0x40
finishaction finishaction
BattleScript_82DBE12:: BattleScript_PlayerUsesItem::
setbyte sMOVEEND_STATE, 0xF setbyte sMOVEEND_STATE, 0xF
moveend 0x1, 0x0 moveend 0x1, 0x0
end end
BattleScript_82DBE1C:: BattleScript_OpponentUsesHealItem::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause 0x30
playse SE_KAIFUKU playse SE_KAIFUKU
@ -128,7 +128,7 @@ BattleScript_82DBE1C::
moveend 0x1, 0x0 moveend 0x1, 0x0
finishaction finishaction
BattleScript_82DBE4B:: BattleScript_OpponentUsesStatusCureItem::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause 0x30
playse SE_KAIFUKU playse SE_KAIFUKU
@ -142,7 +142,7 @@ BattleScript_82DBE4B::
moveend 0x1, 0x0 moveend 0x1, 0x0
finishaction finishaction
BattleScript_82DBE6F:: BattleScript_OpponentUsesXItem::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause 0x30
playse SE_KAIFUKU playse SE_KAIFUKU
@ -155,7 +155,7 @@ BattleScript_82DBE6F::
moveend 0x1, 0x0 moveend 0x1, 0x0
finishaction finishaction
BattleScript_82DBE91:: BattleScript_OpponentUsesGuardSpecs::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause 0x30
playse SE_KAIFUKU playse SE_KAIFUKU

View File

@ -616,7 +616,7 @@ struct BattleStruct
u8 focusPunchBank; u8 focusPunchBank;
u8 field_49; u8 field_49;
u8 moneyMultiplier; u8 moneyMultiplier;
u8 field_4B; u8 savedTurnActionNumber;
u8 switchInAbilitiesCounter; u8 switchInAbilitiesCounter;
u8 faintedActionsState; u8 faintedActionsState;
u8 faintedActionsBank; u8 faintedActionsBank;
@ -846,8 +846,8 @@ struct BattleScripting
u8 animArg2; u8 animArg2;
u16 tripleKickPower; u16 tripleKickPower;
u8 atk49_state; u8 atk49_state;
u8 field_15; u8 bankWithAbility;
u8 field_16; u8 multihitMoveEffect;
u8 bank; u8 bank;
u8 animTurn; u8 animTurn;
u8 animTargetsHit; u8 animTargetsHit;

View File

@ -160,7 +160,7 @@ extern const u8 gStatStageRatios[][2];
extern const u8 * const gBattleScriptsForMoveEffects[]; extern const u8 * const gBattleScriptsForMoveEffects[];
extern const u8 * const gBattlescriptsForBallThrow[]; extern const u8 * const gBattlescriptsForBallThrow[];
extern const u8 * const gBattlescriptsForRunningByItem[]; extern const u8 * const gBattlescriptsForRunningByItem[];
extern const u8 * const gUnknown_082DBD3C[]; extern const u8 * const gBattlescriptsForUsingItem[];
extern const u8 * const gBattlescriptsForSafariActions[]; extern const u8 * const gBattlescriptsForSafariActions[];
// strings // strings
@ -4692,7 +4692,7 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void)
gBattleMainFunc = RunTurnActionsFunctions; gBattleMainFunc = RunTurnActionsFunctions;
gBattleCommunication[3] = 0; gBattleCommunication[3] = 0;
gBattleCommunication[4] = 0; gBattleCommunication[4] = 0;
gBattleScripting.field_16 = 0; gBattleScripting.multihitMoveEffect = 0;
gBattleResources->battleScriptsStack->size = 0; gBattleResources->battleScriptsStack->size = 0;
} }
@ -4701,7 +4701,7 @@ static void RunTurnActionsFunctions(void)
if (gBattleOutcome != 0) if (gBattleOutcome != 0)
gCurrentActionFuncId = 12; gCurrentActionFuncId = 12;
*(&gBattleStruct->field_4B) = gCurrentTurnActionNumber; *(&gBattleStruct->savedTurnActionNumber) = gCurrentTurnActionNumber;
sTurnActionsFuncsTable[gCurrentActionFuncId](); sTurnActionsFuncsTable[gCurrentActionFuncId]();
if (gCurrentTurnActionNumber >= gNoOfAllBanks) // everyone did their actions, turn finished if (gCurrentTurnActionNumber >= gNoOfAllBanks) // everyone did their actions, turn finished
@ -4711,7 +4711,7 @@ static void RunTurnActionsFunctions(void)
} }
else else
{ {
if (gBattleStruct->field_4B != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another bank if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another bank
{ {
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING); gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE); gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
@ -5276,7 +5276,7 @@ static void HandleAction_UseItem(void)
} }
else if (GetBankSide(gBankAttacker) == SIDE_PLAYER) else if (GetBankSide(gBankAttacker) == SIDE_PLAYER)
{ {
gBattlescriptCurrInstr = gUnknown_082DBD3C[0]; gBattlescriptCurrInstr = gBattlescriptsForUsingItem[0];
} }
else else
{ {
@ -5332,7 +5332,7 @@ static void HandleAction_UseItem(void)
break; break;
} }
gBattlescriptCurrInstr = gUnknown_082DBD3C[*(gBattleStruct->AI_itemType + gBankAttacker / 2)]; gBattlescriptCurrInstr = gBattlescriptsForUsingItem[*(gBattleStruct->AI_itemType + gBankAttacker / 2)];
} }
gCurrentActionFuncId = ACTION_RUN_BATTLESCRIPT; gCurrentActionFuncId = ACTION_RUN_BATTLESCRIPT;
} }
@ -5607,6 +5607,6 @@ static void HandleAction_ActionFinished(void)
gBattleScripting.atk49_state = 0; gBattleScripting.atk49_state = 0;
gBattleCommunication[3] = 0; gBattleCommunication[3] = 0;
gBattleCommunication[4] = 0; gBattleCommunication[4] = 0;
gBattleScripting.field_16 = 0; gBattleScripting.multihitMoveEffect = 0;
gBattleResources->battleScriptsStack->size = 0; gBattleResources->battleScriptsStack->size = 0;
} }

View File

@ -3040,7 +3040,7 @@ static void atk15_seteffectwithchance(void)
} }
gBattleCommunication[MOVE_EFFECT_BYTE] = 0; gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattleScripting.field_16 = 0; gBattleScripting.multihitMoveEffect = 0;
} }
static void atk16_seteffectprimary(void) static void atk16_seteffectprimary(void)
@ -3064,7 +3064,7 @@ static void atk18_clearstatusfromeffect(void)
gBattleCommunication[MOVE_EFFECT_BYTE] = 0; gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
gBattleScripting.field_16 = 0; gBattleScripting.multihitMoveEffect = 0;
} }
static void atk19_tryfaintmon(void) static void atk19_tryfaintmon(void)
@ -3221,7 +3221,7 @@ static void atk1E_jumpifability(void)
gLastUsedAbility = ability; gLastUsedAbility = ability;
gBattlescriptCurrInstr = jumpPtr; gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(bank - 1, gLastUsedAbility); RecordAbilityBattle(bank - 1, gLastUsedAbility);
gBattleScripting.field_15 = bank - 1; gBattleScripting.bankWithAbility = bank - 1;
} }
else else
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
@ -3234,7 +3234,7 @@ static void atk1E_jumpifability(void)
gLastUsedAbility = ability; gLastUsedAbility = ability;
gBattlescriptCurrInstr = jumpPtr; gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(bank - 1, gLastUsedAbility); RecordAbilityBattle(bank - 1, gLastUsedAbility);
gBattleScripting.field_15 = bank - 1; gBattleScripting.bankWithAbility = bank - 1;
} }
else else
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
@ -3247,7 +3247,7 @@ static void atk1E_jumpifability(void)
gLastUsedAbility = ability; gLastUsedAbility = ability;
gBattlescriptCurrInstr = jumpPtr; gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(bank, gLastUsedAbility); RecordAbilityBattle(bank, gLastUsedAbility);
gBattleScripting.field_15 = bank; gBattleScripting.bankWithAbility = bank;
} }
else else
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;