Merge pull request #1304 from GriffinRichards/misc-clean

Minor table clean up
This commit is contained in:
GriffinR 2021-01-14 15:34:26 -05:00 committed by GitHub
commit 8305342521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 130 additions and 130 deletions

View File

@ -25,8 +25,8 @@ const struct BardSound *GetWordSounds(u16 word)
{ {
return gBardSound_InvalidWord; return gBardSound_InvalidWord;
} }
category = word >> 9; category = EC_GROUP(word);
subword = word & 0x1ff; subword = EC_INDEX(word);
switch (category) switch (category)
{ {
case EC_GROUP_POKEMON: case EC_GROUP_POKEMON:

View File

@ -24,29 +24,29 @@
#include "events.h" #include "events.h"
#include "trendysaying.h" #include "trendysaying.h"
const struct BardSound (*const gBardSoundsTable[])[6] = { const struct BardSound (*const gBardSoundsTable[EC_NUM_GROUPS])[6] = {
NULL, [EC_GROUP_POKEMON] = NULL, // Handled by gBardSounds_Pokemon
gBardSounds_Trainer, [EC_GROUP_TRAINER] = gBardSounds_Trainer,
gBardSounds_Status, [EC_GROUP_STATUS] = gBardSounds_Status,
gBardSounds_Battle, [EC_GROUP_BATTLE] = gBardSounds_Battle,
gBardSounds_Greetings, [EC_GROUP_GREETINGS] = gBardSounds_Greetings,
gBardSounds_People, [EC_GROUP_PEOPLE] = gBardSounds_People,
gBardSounds_Voices, [EC_GROUP_VOICES] = gBardSounds_Voices,
gBardSounds_Speech, [EC_GROUP_SPEECH] = gBardSounds_Speech,
gBardSounds_Endings, [EC_GROUP_ENDINGS] = gBardSounds_Endings,
gBardSounds_Feelings, [EC_GROUP_FEELINGS] = gBardSounds_Feelings,
gBardSounds_Conditions, [EC_GROUP_CONDITIONS] = gBardSounds_Conditions,
gBardSounds_Actions, [EC_GROUP_ACTIONS] = gBardSounds_Actions,
gBardSounds_Lifestyle, [EC_GROUP_LIFESTYLE] = gBardSounds_Lifestyle,
gBardSounds_Hobbies, [EC_GROUP_HOBBIES] = gBardSounds_Hobbies,
gBardSounds_Time, [EC_GROUP_TIME] = gBardSounds_Time,
gBardSounds_Misc, [EC_GROUP_MISC] = gBardSounds_Misc,
gBardSounds_Adjectives, [EC_GROUP_ADJECTIVES] = gBardSounds_Adjectives,
gBardSounds_Events, [EC_GROUP_EVENTS] = gBardSounds_Events,
NULL, [EC_GROUP_MOVE_1] = NULL, // Handled by gBardSounds_Moves
NULL, [EC_GROUP_MOVE_2] = NULL, // Handled by gBardSounds_Moves
gBardSounds_TrendySaying, [EC_GROUP_TRENDY_SAYING] = gBardSounds_TrendySaying,
NULL [EC_GROUP_POKEMON_2] = NULL // Handled by gBardSounds_Pokemon
}; };
#endif //GUARD_BARD_SOUNDS_TABLE_H #endif //GUARD_BARD_SOUNDS_TABLE_H

View File

@ -26,112 +26,112 @@
const struct EasyChatGroup gEasyChatGroups[] = { const struct EasyChatGroup gEasyChatGroups[] = {
{ {
.wordData = {.valueList = gEasyChatGroup_Pokemon}, .wordData = {.valueList = gEasyChatGroup_Pokemon},
.numWords = 202, .numWords = ARRAY_COUNT(gEasyChatGroup_Pokemon),
.numEnabledWords = 202, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Pokemon),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Trainer}, .wordData = {.words = gEasyChatGroup_Trainer},
.numWords = 27, .numWords = ARRAY_COUNT(gEasyChatGroup_Trainer),
.numEnabledWords = 21, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Trainer) - 6, // Excludes Red, Green, Flame, Gold, Leaf, and Silver
}, },
{ {
.wordData = {.words = gEasyChatGroup_Status}, .wordData = {.words = gEasyChatGroup_Status},
.numWords = 109, .numWords = ARRAY_COUNT(gEasyChatGroup_Status),
.numEnabledWords = 109, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Status),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Battle}, .wordData = {.words = gEasyChatGroup_Battle},
.numWords = 63, .numWords = ARRAY_COUNT(gEasyChatGroup_Battle),
.numEnabledWords = 63, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Battle),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Greetings}, .wordData = {.words = gEasyChatGroup_Greetings},
.numWords = 42, .numWords = ARRAY_COUNT(gEasyChatGroup_Greetings),
.numEnabledWords = 42, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Greetings),
}, },
{ {
.wordData = {.words = gEasyChatGroup_People}, .wordData = {.words = gEasyChatGroup_People},
.numWords = 75, .numWords = ARRAY_COUNT(gEasyChatGroup_People),
.numEnabledWords = 75, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_People),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Voices}, .wordData = {.words = gEasyChatGroup_Voices},
.numWords = 63, .numWords = ARRAY_COUNT(gEasyChatGroup_Voices),
.numEnabledWords = 63, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Voices),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Speech}, .wordData = {.words = gEasyChatGroup_Speech},
.numWords = 60, .numWords = ARRAY_COUNT(gEasyChatGroup_Speech),
.numEnabledWords = 60, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Speech),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Endings}, .wordData = {.words = gEasyChatGroup_Endings},
.numWords = 69, .numWords = ARRAY_COUNT(gEasyChatGroup_Endings),
.numEnabledWords = 69, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Endings),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Feelings}, .wordData = {.words = gEasyChatGroup_Feelings},
.numWords = 69, .numWords = ARRAY_COUNT(gEasyChatGroup_Feelings),
.numEnabledWords = 69, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Feelings),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Conditions}, .wordData = {.words = gEasyChatGroup_Conditions},
.numWords = 69, .numWords = ARRAY_COUNT(gEasyChatGroup_Conditions),
.numEnabledWords = 69, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Conditions),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Actions}, .wordData = {.words = gEasyChatGroup_Actions},
.numWords = 78, .numWords = ARRAY_COUNT(gEasyChatGroup_Actions),
.numEnabledWords = 78, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Actions),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Lifestyle}, .wordData = {.words = gEasyChatGroup_Lifestyle},
.numWords = 45, .numWords = ARRAY_COUNT(gEasyChatGroup_Lifestyle),
.numEnabledWords = 45, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Lifestyle),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Hobbies}, .wordData = {.words = gEasyChatGroup_Hobbies},
.numWords = 54, .numWords = ARRAY_COUNT(gEasyChatGroup_Hobbies),
.numEnabledWords = 54, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Hobbies),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Time}, .wordData = {.words = gEasyChatGroup_Time},
.numWords = 45, .numWords = ARRAY_COUNT(gEasyChatGroup_Time),
.numEnabledWords = 45, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Time),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Misc}, .wordData = {.words = gEasyChatGroup_Misc},
.numWords = 42, .numWords = ARRAY_COUNT(gEasyChatGroup_Misc),
.numEnabledWords = 42, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Misc),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Adjectives}, .wordData = {.words = gEasyChatGroup_Adjectives},
.numWords = 36, .numWords = ARRAY_COUNT(gEasyChatGroup_Adjectives),
.numEnabledWords = 36, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Adjectives),
}, },
{ {
.wordData = {.words = gEasyChatGroup_Events}, .wordData = {.words = gEasyChatGroup_Events},
.numWords = 29, .numWords = ARRAY_COUNT(gEasyChatGroup_Events),
.numEnabledWords = 29, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Events),
}, },
{ {
.wordData = {.valueList = gEasyChatGroup_Move1}, .wordData = {.valueList = gEasyChatGroup_Move1},
.numWords = 154, .numWords = ARRAY_COUNT(gEasyChatGroup_Move1),
.numEnabledWords = 154, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Move1),
}, },
{ {
.wordData = {.valueList = gEasyChatGroup_Move2}, .wordData = {.valueList = gEasyChatGroup_Move2},
.numWords = 200, .numWords = ARRAY_COUNT(gEasyChatGroup_Move2),
.numEnabledWords = 200, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Move2),
}, },
{ {
.wordData = {.words = gEasyChatGroup_TrendySaying}, .wordData = {.words = gEasyChatGroup_TrendySaying},
.numWords = 33, .numWords = ARRAY_COUNT(gEasyChatGroup_TrendySaying),
.numEnabledWords = 33, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_TrendySaying),
}, },
{ {
.wordData = {.valueList = gEasyChatGroup_Pokemon2}, .wordData = {.valueList = gEasyChatGroup_Pokemon2},
.numWords = 251, .numWords = ARRAY_COUNT(gEasyChatGroup_Pokemon2),
.numEnabledWords = 251, .numEnabledWords = ARRAY_COUNT(gEasyChatGroup_Pokemon2),
}, },
}; };

View File

@ -1194,62 +1194,62 @@ static const u8 *const sUnused_StatStrings[] =
static const u16 sTMHMMoves[] = static const u16 sTMHMMoves[] =
{ {
MOVE_FOCUS_PUNCH, [ITEM_TM01 - ITEM_TM01] = MOVE_FOCUS_PUNCH,
MOVE_DRAGON_CLAW, [ITEM_TM02 - ITEM_TM01] = MOVE_DRAGON_CLAW,
MOVE_WATER_PULSE, [ITEM_TM03 - ITEM_TM01] = MOVE_WATER_PULSE,
MOVE_CALM_MIND, [ITEM_TM04 - ITEM_TM01] = MOVE_CALM_MIND,
MOVE_ROAR, [ITEM_TM05 - ITEM_TM01] = MOVE_ROAR,
MOVE_TOXIC, [ITEM_TM06 - ITEM_TM01] = MOVE_TOXIC,
MOVE_HAIL, [ITEM_TM07 - ITEM_TM01] = MOVE_HAIL,
MOVE_BULK_UP, [ITEM_TM08 - ITEM_TM01] = MOVE_BULK_UP,
MOVE_BULLET_SEED, [ITEM_TM09 - ITEM_TM01] = MOVE_BULLET_SEED,
MOVE_HIDDEN_POWER, [ITEM_TM10 - ITEM_TM01] = MOVE_HIDDEN_POWER,
MOVE_SUNNY_DAY, [ITEM_TM11 - ITEM_TM01] = MOVE_SUNNY_DAY,
MOVE_TAUNT, [ITEM_TM12 - ITEM_TM01] = MOVE_TAUNT,
MOVE_ICE_BEAM, [ITEM_TM13 - ITEM_TM01] = MOVE_ICE_BEAM,
MOVE_BLIZZARD, [ITEM_TM14 - ITEM_TM01] = MOVE_BLIZZARD,
MOVE_HYPER_BEAM, [ITEM_TM15 - ITEM_TM01] = MOVE_HYPER_BEAM,
MOVE_LIGHT_SCREEN, [ITEM_TM16 - ITEM_TM01] = MOVE_LIGHT_SCREEN,
MOVE_PROTECT, [ITEM_TM17 - ITEM_TM01] = MOVE_PROTECT,
MOVE_RAIN_DANCE, [ITEM_TM18 - ITEM_TM01] = MOVE_RAIN_DANCE,
MOVE_GIGA_DRAIN, [ITEM_TM19 - ITEM_TM01] = MOVE_GIGA_DRAIN,
MOVE_SAFEGUARD, [ITEM_TM20 - ITEM_TM01] = MOVE_SAFEGUARD,
MOVE_FRUSTRATION, [ITEM_TM21 - ITEM_TM01] = MOVE_FRUSTRATION,
MOVE_SOLAR_BEAM, [ITEM_TM22 - ITEM_TM01] = MOVE_SOLAR_BEAM,
MOVE_IRON_TAIL, [ITEM_TM23 - ITEM_TM01] = MOVE_IRON_TAIL,
MOVE_THUNDERBOLT, [ITEM_TM24 - ITEM_TM01] = MOVE_THUNDERBOLT,
MOVE_THUNDER, [ITEM_TM25 - ITEM_TM01] = MOVE_THUNDER,
MOVE_EARTHQUAKE, [ITEM_TM26 - ITEM_TM01] = MOVE_EARTHQUAKE,
MOVE_RETURN, [ITEM_TM27 - ITEM_TM01] = MOVE_RETURN,
MOVE_DIG, [ITEM_TM28 - ITEM_TM01] = MOVE_DIG,
MOVE_PSYCHIC, [ITEM_TM29 - ITEM_TM01] = MOVE_PSYCHIC,
MOVE_SHADOW_BALL, [ITEM_TM30 - ITEM_TM01] = MOVE_SHADOW_BALL,
MOVE_BRICK_BREAK, [ITEM_TM31 - ITEM_TM01] = MOVE_BRICK_BREAK,
MOVE_DOUBLE_TEAM, [ITEM_TM32 - ITEM_TM01] = MOVE_DOUBLE_TEAM,
MOVE_REFLECT, [ITEM_TM33 - ITEM_TM01] = MOVE_REFLECT,
MOVE_SHOCK_WAVE, [ITEM_TM34 - ITEM_TM01] = MOVE_SHOCK_WAVE,
MOVE_FLAMETHROWER, [ITEM_TM35 - ITEM_TM01] = MOVE_FLAMETHROWER,
MOVE_SLUDGE_BOMB, [ITEM_TM36 - ITEM_TM01] = MOVE_SLUDGE_BOMB,
MOVE_SANDSTORM, [ITEM_TM37 - ITEM_TM01] = MOVE_SANDSTORM,
MOVE_FIRE_BLAST, [ITEM_TM38 - ITEM_TM01] = MOVE_FIRE_BLAST,
MOVE_ROCK_TOMB, [ITEM_TM39 - ITEM_TM01] = MOVE_ROCK_TOMB,
MOVE_AERIAL_ACE, [ITEM_TM40 - ITEM_TM01] = MOVE_AERIAL_ACE,
MOVE_TORMENT, [ITEM_TM41 - ITEM_TM01] = MOVE_TORMENT,
MOVE_FACADE, [ITEM_TM42 - ITEM_TM01] = MOVE_FACADE,
MOVE_SECRET_POWER, [ITEM_TM43 - ITEM_TM01] = MOVE_SECRET_POWER,
MOVE_REST, [ITEM_TM44 - ITEM_TM01] = MOVE_REST,
MOVE_ATTRACT, [ITEM_TM45 - ITEM_TM01] = MOVE_ATTRACT,
MOVE_THIEF, [ITEM_TM46 - ITEM_TM01] = MOVE_THIEF,
MOVE_STEEL_WING, [ITEM_TM47 - ITEM_TM01] = MOVE_STEEL_WING,
MOVE_SKILL_SWAP, [ITEM_TM48 - ITEM_TM01] = MOVE_SKILL_SWAP,
MOVE_SNATCH, [ITEM_TM49 - ITEM_TM01] = MOVE_SNATCH,
MOVE_OVERHEAT, [ITEM_TM50 - ITEM_TM01] = MOVE_OVERHEAT,
MOVE_CUT, [ITEM_HM01 - ITEM_TM01] = MOVE_CUT,
MOVE_FLY, [ITEM_HM02 - ITEM_TM01] = MOVE_FLY,
MOVE_SURF, [ITEM_HM03 - ITEM_TM01] = MOVE_SURF,
MOVE_STRENGTH, [ITEM_HM04 - ITEM_TM01] = MOVE_STRENGTH,
MOVE_FLASH, [ITEM_HM05 - ITEM_TM01] = MOVE_FLASH,
MOVE_ROCK_SMASH, [ITEM_HM06 - ITEM_TM01] = MOVE_ROCK_SMASH,
MOVE_WATERFALL, [ITEM_HM07 - ITEM_TM01] = MOVE_WATERFALL,
MOVE_DIVE, [ITEM_HM08 - ITEM_TM01] = MOVE_DIVE,
}; };

View File

@ -1961,9 +1961,9 @@ static u8 CanMonLearnTMTutor(struct Pokemon *mon, u16 item, u8 tutor)
if (GetMonData(mon, MON_DATA_IS_EGG)) if (GetMonData(mon, MON_DATA_IS_EGG))
return CANNOT_LEARN_MOVE_IS_EGG; return CANNOT_LEARN_MOVE_IS_EGG;
if (item >= ITEM_TM01_FOCUS_PUNCH) if (item >= ITEM_TM01)
{ {
if (!CanMonLearnTMHM(mon, item - ITEM_TM01_FOCUS_PUNCH)) if (!CanMonLearnTMHM(mon, item - ITEM_TM01))
return CANNOT_LEARN_MOVE; return CANNOT_LEARN_MOVE;
else else
move = ItemIdToBattleMoveId(item); move = ItemIdToBattleMoveId(item);
@ -4612,7 +4612,7 @@ void ItemUseCB_PPUp(u8 taskId, TaskFunc task)
u16 ItemIdToBattleMoveId(u16 item) u16 ItemIdToBattleMoveId(u16 item)
{ {
u16 tmNumber = item - ITEM_TM01_FOCUS_PUNCH; u16 tmNumber = item - ITEM_TM01;
return sTMHMMoves[tmNumber]; return sTMHMMoves[tmNumber];
} }