From f61d516aad400c7ce7bcae7f85db54cad74ecf0e Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 15 Sep 2021 17:15:50 -0400 Subject: [PATCH] some syntax/format fixes --- include/battle_util.h | 2 -- include/constants/battle_string_ids.h | 5 +++++ src/battle_message.c | 4 +++- src/battle_util.c | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index a7263e4be..202cdbddb 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -145,7 +145,6 @@ bool32 CanStealItem(u8 battlerStealing, u8 battlerItem, u16 item); void TrySaveExchangedItem(u8 battlerId, u16 stolenItem); bool32 IsPartnerMonFromSameTrainer(u8 battlerId); - // ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); @@ -163,5 +162,4 @@ bool32 CanBeFrozen(u8 battlerId); bool32 CanBeConfused(u8 battlerId); bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag); - #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 0558e4feb..e0b466b17 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -810,4 +810,9 @@ #define B_MSG_SWITCHIN_ASONE 13 #define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14 +// gTerrainPreventsStringIds +#define B_MSG_TERRAINPREVENTS_MISTY 0 +#define B_MSG_TERRAINPREVENTS_ELECTRIC 1 +#define B_MSG_TERRAINPREVENTS_PSYCHIC 2 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_message.c b/src/battle_message.c index 19468f168..1e9fd918b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1271,7 +1271,9 @@ const u16 gTerrainStringIds[] = const u16 gTerrainPreventsStringIds[] = { - STRINGID_MISTYTERRAINPREVENTS, STRINGID_ELECTRICTERRAINPREVENTS, STRINGID_PSYCHICTERRAINPREVENTS + [B_MSG_TERRAINPREVENTS_MISTY] = STRINGID_MISTYTERRAINPREVENTS, + [B_MSG_TERRAINPREVENTS_ELECTRIC] = STRINGID_ELECTRICTERRAINPREVENTS, + [B_MSG_TERRAINPREVENTS_PSYCHIC] = STRINGID_PSYCHICTERRAINPREVENTS }; const u16 gMagicCoatBounceStringIds[] = diff --git a/src/battle_util.c b/src/battle_util.c index 8b2a186f1..9c1061b33 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2730,12 +2730,12 @@ u8 DoBattlerEndTurnEffects(void) gEffectBattler = gActiveBattler; if (IsBattlerTerrainAffected(gActiveBattler, STATUS_FIELD_ELECTRIC_TERRAIN)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAINPREVENTS_ELECTRIC; BattleScriptExecute(BattleScript_TerrainPreventsEnd2); } else if (IsBattlerTerrainAffected(gActiveBattler, STATUS_FIELD_MISTY_TERRAIN)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAINPREVENTS_MISTY; BattleScriptExecute(BattleScript_TerrainPreventsEnd2); } else