diff options
author | DizzyEggg <jajkodizzy@wp.pl> | 2017-10-22 18:43:15 +0200 |
---|---|---|
committer | DizzyEggg <jajkodizzy@wp.pl> | 2017-10-22 18:43:15 +0200 |
commit | df4e32a307c17163e9a64e5ea615ab9eb18afc4b (patch) | |
tree | 0aa62be639c330084f67032185eff58768a5cc9e /src/battle_ai_switch_items.c | |
parent | 813b1bfd4a8f0fc316e78b39abaaafd09a42f0c4 (diff) |
player battle controller is done
Diffstat (limited to 'src/battle_ai_switch_items.c')
-rw-r--r-- | src/battle_ai_switch_items.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 3f97c59a5..de440054c 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -39,7 +39,7 @@ static bool8 ShouldSwitchIfPerishSong(void) && gDisableStructs[gActiveBank].perishSong1 == 0) { *(gBattleStruct->field_294 + gActiveBank) = 6; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } @@ -121,7 +121,7 @@ static bool8 ShouldSwitchIfWonderGuard(void) { // we found a mon *(gBattleStruct->field_294 + gActiveBank) = i; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } } @@ -221,7 +221,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) { // we found a mon *(gBattleStruct->field_294 + gActiveBank) = i; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } } @@ -241,13 +241,13 @@ static bool8 ShouldSwitchIfNaturalCure(void) if ((gUnknown_02024250[gActiveBank] == 0 || gUnknown_02024250[gActiveBank] == 0xFFFF) && Random() & 1) { *(gBattleStruct->field_294 + gActiveBank) = 6; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } else if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0 && Random() & 1) { *(gBattleStruct->field_294 + gActiveBank) = 6; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } @@ -258,7 +258,7 @@ static bool8 ShouldSwitchIfNaturalCure(void) if (Random() & 1) { *(gBattleStruct->field_294 + gActiveBank) = 6; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } @@ -426,7 +426,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) if (moveFlags & MOVESTATUS_SUPEREFFECTIVE && Random() % moduloPercent == 0) { *(gBattleStruct->field_294 + gActiveBank) = i; - EmitChoiceReturnValue(1, 2, 0); + EmitTwoReturnValues(1, ACTION_SWITCH, 0); return TRUE; } } @@ -611,7 +611,7 @@ void AI_TrySwitchOrUseItem(void) } } - EmitChoiceReturnValue(1, 0, (gActiveBank ^ BIT_SIDE) << 8); + EmitTwoReturnValues(1, ACTION_USE_MOVE, (gActiveBank ^ BIT_SIDE) << 8); } #define TYPE_FORESIGHT 0xFE @@ -940,7 +940,7 @@ static bool8 ShouldUseItem(void) if (shouldUse) { - EmitChoiceReturnValue(1, 1, 0); + EmitTwoReturnValues(1, ACTION_USE_ITEM, 0); *(gBattleStruct->field_C0 + (gActiveBank / 2) * 2) = item; gBattleResources->battleHistory->trainerItems[i] = 0; return shouldUse; |