Merge pull request #2159 from Sneed69/trap-move-arrays
Trap move battle string related code cleanup
This commit is contained in:
commit
6cf0620f93
3 changed files with 25 additions and 15 deletions
|
@ -872,4 +872,16 @@
|
|||
#define B_MSG_TERRAINPREVENTS_ELECTRIC 1
|
||||
#define B_MSG_TERRAINPREVENTS_PSYCHIC 2
|
||||
|
||||
// gWrappedStringIds
|
||||
#define B_MSG_WRAPPED_BIND 0
|
||||
#define B_MSG_WRAPPED_WRAP 1
|
||||
#define B_MSG_WRAPPED_FIRE_SPIN 2
|
||||
#define B_MSG_WRAPPED_CLAMP 3
|
||||
#define B_MSG_WRAPPED_WHIRLPOOL 4
|
||||
#define B_MSG_WRAPPED_SAND_TOMB 5
|
||||
#define B_MSG_WRAPPED_MAGMA_STORM 6
|
||||
#define B_MSG_WRAPPED_INFESTATION 7
|
||||
#define B_MSG_WRAPPED_SNAP_TRAP 8
|
||||
#define TRAPPING_MOVES_COUNT 9
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H
|
||||
|
|
|
@ -1562,17 +1562,17 @@ const u16 gFirstTurnOfTwoStringIds[] =
|
|||
};
|
||||
|
||||
// Index copied from move's index in sTrappingMoves
|
||||
const u16 gWrappedStringIds[] =
|
||||
const u16 gWrappedStringIds[TRAPPING_MOVES_COUNT] =
|
||||
{
|
||||
STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND
|
||||
STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP
|
||||
STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN
|
||||
STRINGID_PKMNCLAMPED, // MOVE_CLAMP
|
||||
STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL
|
||||
STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB
|
||||
STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM
|
||||
STRINGID_INFESTATION, // MOVE_INFESTATION
|
||||
STRINGID_PKMNINSNAPTRAP, // MOVE_SNAPTRAP
|
||||
[B_MSG_WRAPPED_BIND] = STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND
|
||||
[B_MSG_WRAPPED_WRAP] = STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP
|
||||
[B_MSG_WRAPPED_FIRE_SPIN] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN
|
||||
[B_MSG_WRAPPED_CLAMP] = STRINGID_PKMNCLAMPED, // MOVE_CLAMP
|
||||
[B_MSG_WRAPPED_WHIRLPOOL] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL
|
||||
[B_MSG_WRAPPED_SAND_TOMB] = STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB
|
||||
[B_MSG_WRAPPED_MAGMA_STORM] = STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM
|
||||
[B_MSG_WRAPPED_INFESTATION] = STRINGID_INFESTATION, // MOVE_INFESTATION
|
||||
[B_MSG_WRAPPED_SNAP_TRAP] = STRINGID_PKMNINSNAPTRAP, // MOVE_SNAP_TRAP
|
||||
};
|
||||
|
||||
const u16 gMistUsedStringIds[] =
|
||||
|
|
|
@ -279,9 +279,9 @@ static const s32 sExperienceScalingFactors[] =
|
|||
159767,
|
||||
};
|
||||
|
||||
static const u16 sTrappingMoves[] =
|
||||
static const u16 sTrappingMoves[TRAPPING_MOVES_COUNT] =
|
||||
{
|
||||
MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, MOVE_SNAP_TRAP, 0xFFFF
|
||||
MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, MOVE_SNAP_TRAP,
|
||||
};
|
||||
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
|
@ -3037,10 +3037,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect];
|
||||
|
||||
for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++)
|
||||
for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] < TRAPPING_MOVES_COUNT; gBattleCommunication[MULTISTRING_CHOOSER]++)
|
||||
{
|
||||
if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves) - 1)
|
||||
break;
|
||||
if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove)
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue