diff options
author | Marcus Huderle <huderlem@gmail.com> | 2018-10-11 11:56:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-11 11:56:24 -0500 |
commit | bd88c803793a6e5c8f5d2ac1a852c912e980ef1d (patch) | |
tree | d45390654cd3f80ffccd4af95760133ef77366bd /src/battle_ai_script_commands.c | |
parent | 10fff9c6f2d29899952d1751d3de827e7e98bb60 (diff) | |
parent | 05d03f7f3256b143a01506421c19964bcceaea5c (diff) |
Merge pull request #18 from ProjectRevoTPP/pokemon
almost finish decompiling pokemon.c
Diffstat (limited to 'src/battle_ai_script_commands.c')
-rw-r--r-- | src/battle_ai_script_commands.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 22ed95040..6f5577f70 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -256,7 +256,6 @@ extern const u32 gBitTable[]; // util.h extern u32 gStatuses3[]; // battle_2.h extern u16 gSideAffecting[2]; extern const struct BattleMove gBattleMoves[]; -extern u16 gBattlerPartyIndexes[]; extern u16 gDynamicBasePower; extern u8 gMoveResultFlags; extern u8 gCritMultiplier; @@ -485,14 +484,14 @@ void sub_80C71A8(u8 a) void sub_80C71D0(u8 a, u8 b) { - if (GetBankSide(a) == 0) - BATTLE_HISTORY->abilities[GetBankIdentity(a) & 1] = b; + if (GetBattlerSide(a) == 0) + BATTLE_HISTORY->abilities[GetBattlerPosition(a) & 1] = b; } void sub_80C7208(u8 a, u8 b) { - if (GetBankSide(a) == 0) - BATTLE_HISTORY->itemEffects[GetBankIdentity(a) & 1] = b; + if (GetBattlerSide(a) == 0) + BATTLE_HISTORY->itemEffects[GetBattlerPosition(a) & 1] = b; } static void BattleAICmd_if_random_less_than(void) @@ -720,7 +719,7 @@ static void BattleAICmd_if_status4(void) else index = gBattlerTarget; - arg1 = GetBankIdentity(index) & 1; + arg1 = GetBattlerPosition(index) & 1; arg2 = T1_READ_32(gAIScriptPtr + 2); if ((gSideAffecting[arg1] & arg2) != 0) @@ -739,7 +738,7 @@ static void BattleAICmd_if_not_status4(void) else index = gBattlerTarget; - arg1 = GetBankIdentity(index) & 1; + arg1 = GetBattlerPosition(index) & 1; arg2 = T1_READ_32(gAIScriptPtr + 2); if ((gSideAffecting[arg1] & arg2) == 0) @@ -1361,7 +1360,7 @@ static void BattleAICmd_count_alive_pokemon(void) else index = gBattlerTarget; - if (GetBankSide(index) == 0) + if (GetBattlerSide(index) == 0) party = gPlayerParty; else party = gEnemyParty; @@ -1370,8 +1369,8 @@ static void BattleAICmd_count_alive_pokemon(void) { u32 status; var = gBattlerPartyIndexes[index]; - status = GetBankIdentity(index) ^ 2; - var2 = gBattlerPartyIndexes[GetBankByIdentity(status)]; + status = GetBattlerPosition(index) ^ 2; + var2 = gBattlerPartyIndexes[GetBattlerAtPosition(status)]; } else { @@ -1414,9 +1413,9 @@ static void BattleAICmd_get_ability(void) else index = gBattlerTarget; - if (GetBankSide(index) == TARGET) + if (GetBattlerSide(index) == TARGET) { - u16 side = GetBankIdentity(index) & 1; + u16 side = GetBattlerPosition(index) & 1; if (BATTLE_HISTORY->abilities[side] != 0) { @@ -2008,9 +2007,9 @@ static void BattleAICmd_get_hold_effect(void) else index = gBattlerTarget; - if (GetBankSide(index) == 0) + if (GetBattlerSide(index) == 0) { - side = (GetBankIdentity(index) & 1); + side = (GetBattlerPosition(index) & 1); AI_THINKING_STRUCT->funcResult = BATTLE_HISTORY->itemEffects[side]; } else |