From 5a094a30338639648a89b365419263761064ca86 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 16:22:42 +0200 Subject: [PATCH] Snap Trap --- include/constants/battle_string_ids.h | 3 ++- src/battle_message.c | 5 ++++- src/battle_script_commands.c | 2 +- src/data/battle_moves.h | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index cda885694..cf26ef2ef 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -570,8 +570,9 @@ #define STRINGID_MICLEBERRYACTIVATES 566 #define STRINGID_PKMNSHOOKOFFTHETAUNT 567 #define STRINGID_PKMNGOTOVERITSINFATUATION 568 +#define STRINGID_PKMNINSNAPTRAP 569 -#define BATTLESTRINGS_COUNT 569 +#define BATTLESTRINGS_COUNT 570 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index c4f043e15..d8b0fc8f9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -147,6 +147,7 @@ static const u8 sText_PkmnDugHole[] = _("{B_ATK_NAME_WITH_PREFIX} dug a hole!"); static const u8 sText_PkmnHidUnderwater[] = _("{B_ATK_NAME_WITH_PREFIX} hid\nunderwater!"); static const u8 sText_PkmnSprangUp[] = _("{B_ATK_NAME_WITH_PREFIX} sprang up!"); static const u8 sText_PkmnSqueezedByBind[] = _("{B_DEF_NAME_WITH_PREFIX} was squeezed by\n{B_ATK_NAME_WITH_PREFIX}'s BIND!"); +static const u8 sText_PkmnInSnapTrap[] = _("{B_DEF_NAME_WITH_PREFIX} got trapped\nby a snap trap!"); static const u8 sText_PkmnTrappedInVortex[] = _("{B_DEF_NAME_WITH_PREFIX} was trapped\nin the vortex!"); static const u8 sText_PkmnTrappedBySandTomb[] = _("{B_DEF_NAME_WITH_PREFIX} was trapped\nby SAND TOMB!"); static const u8 sText_PkmnWrappedBy[] = _("{B_DEF_NAME_WITH_PREFIX} was WRAPPED by\n{B_ATK_NAME_WITH_PREFIX}!"); @@ -699,6 +700,7 @@ static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_P const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, [STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt, [STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates, @@ -1463,6 +1465,7 @@ const u16 gWrappedStringIds[] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL STRINGID_PKMNTRAPPEDBYSANDTOMB,// MOVE_SAND_TOMB STRINGID_INFESTATION, // MOVE_INFESTATION + STRINGID_PKMNINSNAPTRAP, // MOVE_SNAPTRAP }; const u16 gMistUsedStringIds[] = @@ -1675,7 +1678,7 @@ const u16 gCaughtMonStringIds[] = const u16 gTrappingMoves[] = { - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, 0xFFFF + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, MOVE_SNAP_TRAP, 0xFFFF }; const u16 gRoomsStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c8a393da3..014c3c3c8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2895,7 +2895,7 @@ void SetMoveEffect(bool32 primary, u32 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > 5) + if (gBattleCommunication[MULTISTRING_CHOOSER] > 6) break; if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index db02083b0..69b612e0c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10968,7 +10968,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SNAP_TRAP] = { - .effect = EFFECT_TRAP, //TODO: add case/effect + .effect = EFFECT_TRAP, .power = 35, .type = TYPE_GRASS, .accuracy = 100,