"Used a (TYPE) move" cause - Pokémon Ruby
Posted by: Torchickens
Date: 2015-01-04 14:30:48
First, here are the strings that appear in the Ruby text dump:
a NORMAL move
a FIGHTING move
a FLYING move
a POISON move
a GROUND move
a ROCK move
a BUG move
a GHOST move
a STEEL move
a ??? move
a FIRE move
a WATER move
a GRASS move
an ELECTRIC move
a PSYCHIC move
an ICE move
a DRAGON move
a DARK move
The explanation is apparently rather simple:
Wack0 dumped this unmodified code ("from hexrays", I'm not sure what that means). The code begins at offset 0x120DE8 (or 8120DE8 in memory viewer).
if ( (unsigned int)*(_WORD *)dword_2039270 <= 0x162 )
strcpy((unsigned _int8 )byte_3004290, &byte_81F8320[13 (WORD )dword_2039270]);
else
strcpy((unsigned int8 *)byte_3004290, off_8401674[(unsigned int8)byte_20160A0]);
Commented:
// ptrGenericTypeMoveStrings contains pointers to the "a NORMAL move", "a FIGHTING move" etc strings, ordered by type index.
// So, ptrGenericTypeMoveStrings[0] is "a NORMAL move" etc.
// This was probably used for debugging purposes during development.
// However, if the selected move is of an invalid type (above DARK, 0x11), a string is taken from DWORDs located after the array.
if ( *ptrSelectedMoveIndex <= 0x162 )
strcpy(UsedMoveName, &MoveNames[13 * *ptrSelectedMoveIndex]);
else
strcpy(UsedMoveName, ptrGenericTypeMoveStrings[SelectedMoveType]);
It simply looks like if the move ID is greater than 0x162 (Psycho Boost), then the game is programmed to say "a(n) [type] move", but this doesn't always happen, probably because of either moves that have a very long "Super Glitch" causing name and/or have an invalid type (above Dark, 0x11); where the game will display text from an invalid pointer instead of something like "a NORMAL move".