diff options
author | DizzyEggg <jajkodizzy@wp.pl> | 2018-02-08 11:17:41 +0100 |
---|---|---|
committer | DizzyEggg <jajkodizzy@wp.pl> | 2018-02-08 11:17:41 +0100 |
commit | 96290f4ee3864afdd9946541706102ecf6c1c009 (patch) | |
tree | d22bc2135fdee82ab53023ee42a2164379aafe82 /src/battle_util2.c | |
parent | a10fd5a7c4d92551c579baacf07c499b6f434619 (diff) |
pokemon and battle constants
Diffstat (limited to 'src/battle_util2.c')
-rw-r--r-- | src/battle_util2.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/battle_util2.c b/src/battle_util2.c index d079ccb25..c1bbabc85 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -74,7 +74,7 @@ void FreeBattleResources(void) } } -void AdjustFriendshipOnBattleFaint(u8 bank) +void AdjustFriendshipOnBattleFaint(u8 battlerId) { u8 opposingBank; @@ -93,22 +93,22 @@ void AdjustFriendshipOnBattleFaint(u8 bank) opposingBank = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); } - if (gBattleMons[opposingBank].level > gBattleMons[bank].level) + if (gBattleMons[opposingBank].level > gBattleMons[battlerId].level) { - if (gBattleMons[opposingBank].level - gBattleMons[bank].level > 29) - AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[bank]], 8); + if (gBattleMons[opposingBank].level - gBattleMons[battlerId].level > 29) + AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], 8); else - AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[bank]], 6); + AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], 6); } else { - AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[bank]], 6); + AdjustFriendship(&gPlayerParty[gBattlerPartyIndexes[battlerId]], 6); } } -void sub_80571DC(u8 bank, u8 arg1) +void sub_80571DC(u8 battlerId, u8 arg1) { - if (GetBattlerSide(bank) != B_SIDE_OPPONENT) + if (GetBattlerSide(battlerId) != B_SIDE_OPPONENT) { s32 i; @@ -117,14 +117,14 @@ void sub_80571DC(u8 bank, u8 arg1) for (i = 0; i < 3; i++) gUnknown_0203CF00[i] = *(0 * 3 + i + (u8*)(gBattleStruct->field_60)); - sub_81B8FB0(pokemon_order_func(gBattlerPartyIndexes[bank]), pokemon_order_func(arg1)); + sub_81B8FB0(pokemon_order_func(gBattlerPartyIndexes[battlerId]), pokemon_order_func(arg1)); for (i = 0; i < 3; i++) *(0 * 3 + i + (u8*)(gBattleStruct->field_60)) = gUnknown_0203CF00[i]; } } -u32 sub_805725C(u8 bank) +u32 sub_805725C(u8 battlerId) { u32 effect = 0; @@ -133,12 +133,12 @@ u32 sub_805725C(u8 bank) switch (gBattleCommunication[MULTIUSE_STATE]) { case 0: - if (gBattleMons[bank].status1 & STATUS1_SLEEP) + if (gBattleMons[battlerId].status1 & STATUS1_SLEEP) { - if (UproarWakeUpCheck(bank)) + if (UproarWakeUpCheck(battlerId)) { - gBattleMons[bank].status1 &= ~(STATUS1_SLEEP); - gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE); + gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP); + gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE); BattleScriptPushCursor(); gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; @@ -148,24 +148,24 @@ u32 sub_805725C(u8 bank) { u32 toSub; - if (gBattleMons[bank].ability == ABILITY_EARLY_BIRD) + if (gBattleMons[battlerId].ability == ABILITY_EARLY_BIRD) toSub = 2; else toSub = 1; - if ((gBattleMons[bank].status1 & STATUS1_SLEEP) < toSub) - gBattleMons[bank].status1 &= ~(STATUS1_SLEEP); + if ((gBattleMons[battlerId].status1 & STATUS1_SLEEP) < toSub) + gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP); else - gBattleMons[bank].status1 -= toSub; + gBattleMons[battlerId].status1 -= toSub; - if (gBattleMons[bank].status1 & STATUS1_SLEEP) + if (gBattleMons[battlerId].status1 & STATUS1_SLEEP) { gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep; effect = 2; } else { - gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE); + gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE); BattleScriptPushCursor(); gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; @@ -176,7 +176,7 @@ u32 sub_805725C(u8 bank) gBattleCommunication[MULTIUSE_STATE]++; break; case 1: - if (gBattleMons[bank].status1 & STATUS1_FREEZE) + if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) { if (Random() % 5 != 0) { @@ -184,7 +184,7 @@ u32 sub_805725C(u8 bank) } else { - gBattleMons[bank].status1 &= ~(STATUS1_FREEZE); + gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; gBattleCommunication[MULTISTRING_CHOOSER] = 0; @@ -201,7 +201,7 @@ u32 sub_805725C(u8 bank) if (effect == 2) { - gActiveBattler = bank; + gActiveBattler = battlerId; BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); } |