diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-04-02 02:27:12 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-04-03 11:49:06 -0400 |
commit | 9ea9ffde09c9f3ca1772045935b3b0bd858232a0 (patch) | |
tree | d4af51f0ee17fcc2bd51cc19fd62f5524a526ef9 /src/battle_ai_switch_items.c | |
parent | a836bd1085c64f34d58584cb0e510d9af72a586c (diff) |
Add remaining multistring chooser constants
Diffstat (limited to 'src/battle_ai_switch_items.c')
-rw-r--r-- | src/battle_ai_switch_items.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 263c1e7cc..e92630808 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -863,32 +863,33 @@ static bool8 ShouldUseItem(void) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0; if (itemEffects[3] & ITEM3_SLEEP && gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_SLEEP); shouldUse = TRUE; } - if (itemEffects[3] & ITEM3_POISON && (gBattleMons[gActiveBattler].status1 & STATUS1_POISON || gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON)) + if (itemEffects[3] & ITEM3_POISON && (gBattleMons[gActiveBattler].status1 & STATUS1_POISON + || gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON)) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x10; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_POISON); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_BURN && gBattleMons[gActiveBattler].status1 & STATUS1_BURN) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_BURN); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_FREEZE && gBattleMons[gActiveBattler].status1 & STATUS1_FREEZE) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_FREEZE); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_PARALYSIS && gBattleMons[gActiveBattler].status1 & STATUS1_PARALYSIS) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_PARALYSIS); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_CONFUSION && gBattleMons[gActiveBattler].status2 & STATUS2_CONFUSION) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_CONFUSION); shouldUse = TRUE; } break; @@ -897,17 +898,17 @@ static bool8 ShouldUseItem(void) if (gDisableStructs[gActiveBattler].isFirstTurn == 0) break; if (itemEffects[0] & ITEM0_X_ATTACK) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_ATTACK); if (itemEffects[1] & ITEM1_X_DEFEND) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_DEFEND); if (itemEffects[1] & ITEM1_X_SPEED) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPEED); if (itemEffects[2] & ITEM2_X_SPATK) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPATK); if (itemEffects[2] & ITEM2_X_ACCURACY) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_ACCURACY); if (itemEffects[0] & ITEM0_DIRE_HIT) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_DIRE_HIT); shouldUse = TRUE; break; case AI_ITEM_GUARD_SPECS: |