Refactor trainer classes (#3875)
* Created TrainerClass struct * Added money multiplier to TrainerClass struct * Added Poke Balls to struct * Condensed gTrainerClasses * Simplified trainer Poke Balls * Moved trainer classes into battle_main.c * Removed complicated ball macro --------- Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
parent
6cb89ef382
commit
4d5c572d0c
12 changed files with 109 additions and 188 deletions
|
@ -4,12 +4,6 @@
|
|||
#include "pokemon.h"
|
||||
#include "data.h"
|
||||
|
||||
struct TrainerMoney
|
||||
{
|
||||
u8 classId;
|
||||
u8 value;
|
||||
};
|
||||
|
||||
// For displaying a multi battle partner's Pokémon in the party menu
|
||||
struct MultiPartnerMenuPokemon
|
||||
{
|
||||
|
@ -83,7 +77,6 @@ extern const struct SpriteTemplate gUnusedBattleInitSprite;
|
|||
extern const struct OamData gOamData_BattleSpriteOpponentSide;
|
||||
extern const struct OamData gOamData_BattleSpritePlayerSide;
|
||||
extern const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1];
|
||||
extern const struct TrainerMoney gTrainerMoneyTable[];
|
||||
|
||||
extern const u8 gStatusConditionString_PoisonJpn[8];
|
||||
extern const u8 gStatusConditionString_SleepJpn[8];
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define GUARD_DATA_H
|
||||
|
||||
#include "constants/moves.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
#define SPECIES_SHINY_TAG 5000
|
||||
|
||||
|
@ -86,6 +87,13 @@ struct Trainer
|
|||
/*0x1F*/ u8 partySize;
|
||||
};
|
||||
|
||||
struct TrainerClass
|
||||
{
|
||||
u8 name[13];
|
||||
u8 money;
|
||||
u16 ball;
|
||||
};
|
||||
|
||||
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
||||
|
||||
extern const u16 gMinigameDigits_Pal[];
|
||||
|
@ -117,7 +125,7 @@ extern const struct TrainerBacksprite gTrainerBacksprites[];
|
|||
extern const struct Trainer gTrainers[];
|
||||
extern const struct Trainer gBattlePartners[];
|
||||
|
||||
extern const u8 gTrainerClassNames[][13];
|
||||
extern const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT];
|
||||
extern const u8 gMoveNames[MOVES_COUNT_DYNAMAX][MOVE_NAME_LENGTH + 1];
|
||||
extern const u8 *const gZMoveNames[];
|
||||
extern const u8 *const gMaxMoveNames[];
|
||||
|
|
|
@ -4263,8 +4263,8 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||
else
|
||||
j = GetFrontierOpponentClass(trainerId);
|
||||
|
||||
for (;gTrainerClassNames[j][i] != EOS; i++)
|
||||
gStringVar1[i] = gTrainerClassNames[j][i];
|
||||
for (;gTrainerClasses[j].name[i] != EOS; i++)
|
||||
gStringVar1[i] = gTrainerClasses[j].name[i];
|
||||
gStringVar1[i] = CHAR_SPACE;
|
||||
gStringVar1[i + 1] = EOS;
|
||||
|
||||
|
|
|
@ -322,92 +322,86 @@ const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1] =
|
|||
[TYPE_FAIRY] = _("Fairy"),
|
||||
};
|
||||
|
||||
// This is a factor in how much money you get for beating a trainer.
|
||||
const struct TrainerMoney gTrainerMoneyTable[] =
|
||||
{
|
||||
{TRAINER_CLASS_TEAM_AQUA, 5},
|
||||
{TRAINER_CLASS_AQUA_ADMIN, 10},
|
||||
{TRAINER_CLASS_AQUA_LEADER, 20},
|
||||
{TRAINER_CLASS_AROMA_LADY, 10},
|
||||
{TRAINER_CLASS_RUIN_MANIAC, 15},
|
||||
{TRAINER_CLASS_INTERVIEWER, 12},
|
||||
{TRAINER_CLASS_TUBER_F, 1},
|
||||
{TRAINER_CLASS_TUBER_M, 1},
|
||||
{TRAINER_CLASS_SIS_AND_BRO, 3},
|
||||
{TRAINER_CLASS_COOLTRAINER, 12},
|
||||
{TRAINER_CLASS_HEX_MANIAC, 6},
|
||||
{TRAINER_CLASS_LADY, 50},
|
||||
{TRAINER_CLASS_BEAUTY, 20},
|
||||
{TRAINER_CLASS_RICH_BOY, 50},
|
||||
{TRAINER_CLASS_POKEMANIAC, 15},
|
||||
{TRAINER_CLASS_SWIMMER_M, 2},
|
||||
{TRAINER_CLASS_BLACK_BELT, 8},
|
||||
{TRAINER_CLASS_GUITARIST, 8},
|
||||
{TRAINER_CLASS_KINDLER, 8},
|
||||
{TRAINER_CLASS_CAMPER, 4},
|
||||
{TRAINER_CLASS_OLD_COUPLE, 10},
|
||||
{TRAINER_CLASS_BUG_MANIAC, 15},
|
||||
{TRAINER_CLASS_PSYCHIC, 6},
|
||||
{TRAINER_CLASS_GENTLEMAN, 20},
|
||||
{TRAINER_CLASS_ELITE_FOUR, 25},
|
||||
{TRAINER_CLASS_LEADER, 25},
|
||||
{TRAINER_CLASS_SCHOOL_KID, 5},
|
||||
{TRAINER_CLASS_SR_AND_JR, 4},
|
||||
{TRAINER_CLASS_POKEFAN, 20},
|
||||
{TRAINER_CLASS_EXPERT, 10},
|
||||
{TRAINER_CLASS_YOUNGSTER, 4},
|
||||
{TRAINER_CLASS_CHAMPION, 50},
|
||||
{TRAINER_CLASS_FISHERMAN, 10},
|
||||
{TRAINER_CLASS_TRIATHLETE, 10},
|
||||
{TRAINER_CLASS_DRAGON_TAMER, 12},
|
||||
{TRAINER_CLASS_BIRD_KEEPER, 8},
|
||||
{TRAINER_CLASS_NINJA_BOY, 3},
|
||||
{TRAINER_CLASS_BATTLE_GIRL, 6},
|
||||
{TRAINER_CLASS_PARASOL_LADY, 10},
|
||||
{TRAINER_CLASS_SWIMMER_F, 2},
|
||||
{TRAINER_CLASS_PICNICKER, 4},
|
||||
{TRAINER_CLASS_TWINS, 3},
|
||||
{TRAINER_CLASS_SAILOR, 8},
|
||||
{TRAINER_CLASS_COLLECTOR, 15},
|
||||
{TRAINER_CLASS_RIVAL, 15},
|
||||
{TRAINER_CLASS_PKMN_BREEDER, 10},
|
||||
{TRAINER_CLASS_PKMN_RANGER, 12},
|
||||
{TRAINER_CLASS_TEAM_MAGMA, 5},
|
||||
{TRAINER_CLASS_MAGMA_ADMIN, 10},
|
||||
{TRAINER_CLASS_MAGMA_LEADER, 20},
|
||||
{TRAINER_CLASS_LASS, 4},
|
||||
{TRAINER_CLASS_BUG_CATCHER, 4},
|
||||
{TRAINER_CLASS_HIKER, 10},
|
||||
{TRAINER_CLASS_YOUNG_COUPLE, 8},
|
||||
{TRAINER_CLASS_WINSTRATE, 10},
|
||||
{0xFF, 5}, // Any trainer class not listed above uses this
|
||||
};
|
||||
#define DEFAULT_MONEY 5
|
||||
#define DEFAULT_BALL ITEM_POKE_BALL
|
||||
|
||||
#if B_TRAINER_CLASS_POKE_BALLS >= GEN_7
|
||||
static const u16 sTrainerBallTable[TRAINER_CLASS_COUNT] =
|
||||
#define TRAINER_CLASS(trainerClass, trainerName, trainerMoney, trainerBall) \
|
||||
[TRAINER_CLASS_##trainerClass] = \
|
||||
{ \
|
||||
.name = _(trainerName), \
|
||||
.money = trainerMoney, \
|
||||
.ball = trainerBall, \
|
||||
}
|
||||
|
||||
const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] =
|
||||
{
|
||||
#if B_TRAINER_CLASS_POKE_BALLS == GEN_7
|
||||
[TRAINER_CLASS_PKMN_BREEDER] = ITEM_FRIEND_BALL,
|
||||
#elif B_TRAINER_CLASS_POKE_BALLS == GEN_8
|
||||
[TRAINER_CLASS_PKMN_BREEDER] = ITEM_HEAL_BALL,
|
||||
#endif
|
||||
[TRAINER_CLASS_COOLTRAINER] = ITEM_ULTRA_BALL,
|
||||
[TRAINER_CLASS_COLLECTOR] = ITEM_PREMIER_BALL,
|
||||
[TRAINER_CLASS_SWIMMER_M] = ITEM_DIVE_BALL,
|
||||
[TRAINER_CLASS_BLACK_BELT] = ITEM_ULTRA_BALL,
|
||||
[TRAINER_CLASS_AQUA_LEADER] = ITEM_MASTER_BALL,
|
||||
[TRAINER_CLASS_GENTLEMAN] = ITEM_LUXURY_BALL,
|
||||
[TRAINER_CLASS_ELITE_FOUR] = ITEM_ULTRA_BALL,
|
||||
#if B_TRAINER_CLASS_POKE_BALLS == GEN_7
|
||||
[TRAINER_CLASS_FISHERMAN] = ITEM_LURE_BALL,
|
||||
#elif B_TRAINER_CLASS_POKE_BALLS == GEN_8
|
||||
[TRAINER_CLASS_FISHERMAN] = ITEM_DIVE_BALL,
|
||||
#endif
|
||||
[TRAINER_CLASS_SWIMMER_F] = ITEM_DIVE_BALL,
|
||||
[TRAINER_CLASS_COOLTRAINER_2] = ITEM_ULTRA_BALL,
|
||||
[TRAINER_CLASS_MAGMA_LEADER] = ITEM_MASTER_BALL,
|
||||
TRAINER_CLASS(PKMN_TRAINER_1, "{PKMN} TRAINER", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PKMN_TRAINER_2, "{PKMN} TRAINER", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(HIKER, "HIKER", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(TEAM_AQUA, "TEAM AQUA", 5, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PKMN_BREEDER, "{PKMN} BREEDER", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_HEAL_BALL : ITEM_FRIEND_BALL),
|
||||
TRAINER_CLASS(COOLTRAINER, "COOLTRAINER", 12, ITEM_ULTRA_BALL),
|
||||
TRAINER_CLASS(BIRD_KEEPER, "BIRD KEEPER", 8, DEFAULT_BALL),
|
||||
TRAINER_CLASS(COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL),
|
||||
TRAINER_CLASS(SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL),
|
||||
TRAINER_CLASS(TEAM_MAGMA, "TEAM MAGMA", 5, DEFAULT_BALL),
|
||||
TRAINER_CLASS(EXPERT, "EXPERT", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(AQUA_ADMIN, "AQUA ADMIN", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(BLACK_BELT, "BLACK BELT", 8, ITEM_ULTRA_BALL),
|
||||
TRAINER_CLASS(AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL),
|
||||
TRAINER_CLASS(HEX_MANIAC, "HEX MANIAC", 6, DEFAULT_BALL),
|
||||
TRAINER_CLASS(AROMA_LADY, "AROMA LADY", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(RUIN_MANIAC, "RUIN MANIAC", 15, DEFAULT_BALL),
|
||||
TRAINER_CLASS(INTERVIEWER, "INTERVIEWER", 12, DEFAULT_BALL),
|
||||
TRAINER_CLASS(TUBER_F, "TUBER", 1, DEFAULT_BALL),
|
||||
TRAINER_CLASS(TUBER_M, "TUBER", 1, DEFAULT_BALL),
|
||||
TRAINER_CLASS(LADY, "LADY", 50, DEFAULT_BALL),
|
||||
TRAINER_CLASS(BEAUTY, "BEAUTY", 20, DEFAULT_BALL),
|
||||
TRAINER_CLASS(RICH_BOY, "RICH BOY", 50, DEFAULT_BALL),
|
||||
TRAINER_CLASS(POKEMANIAC, "POKéMANIAC", 15, DEFAULT_BALL),
|
||||
TRAINER_CLASS(GUITARIST, "GUITARIST", 8, DEFAULT_BALL),
|
||||
TRAINER_CLASS(KINDLER, "KINDLER", 8, DEFAULT_BALL),
|
||||
TRAINER_CLASS(CAMPER, "CAMPER", 4, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PICNICKER, "PICNICKER", 4, DEFAULT_BALL),
|
||||
TRAINER_CLASS(BUG_MANIAC, "BUG MANIAC", 15, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PSYCHIC, "PSYCHIC", 6, DEFAULT_BALL),
|
||||
TRAINER_CLASS(GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL),
|
||||
TRAINER_CLASS(ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL),
|
||||
TRAINER_CLASS(LEADER, "LEADER", 25, DEFAULT_BALL),
|
||||
TRAINER_CLASS(SCHOOL_KID, "SCHOOL KID", 5, DEFAULT_BALL),
|
||||
TRAINER_CLASS(SR_AND_JR, "SR. AND JR.", 4, DEFAULT_BALL),
|
||||
TRAINER_CLASS(WINSTRATE, "WINSTRATE", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(POKEFAN, "POKéFAN", 20, DEFAULT_BALL),
|
||||
TRAINER_CLASS(YOUNGSTER, "YOUNGSTER", 4, DEFAULT_BALL),
|
||||
TRAINER_CLASS(CHAMPION, "CHAMPION", 50, DEFAULT_BALL),
|
||||
TRAINER_CLASS(FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_DIVE_BALL : ITEM_LURE_BALL),
|
||||
TRAINER_CLASS(TRIATHLETE, "TRIATHLETE", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(DRAGON_TAMER, "DRAGON TAMER", 12, DEFAULT_BALL),
|
||||
TRAINER_CLASS(NINJA_BOY, "NINJA BOY", 3, DEFAULT_BALL),
|
||||
TRAINER_CLASS(BATTLE_GIRL, "BATTLE GIRL", 6, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PARASOL_LADY, "PARASOL LADY", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(SWIMMER_F, "SWIMMER♀", 2, ITEM_DIVE_BALL),
|
||||
TRAINER_CLASS(TWINS, "TWINS", 3, DEFAULT_BALL),
|
||||
TRAINER_CLASS(SAILOR, "SAILOR", 8, DEFAULT_BALL),
|
||||
TRAINER_CLASS(COOLTRAINER_2, "COOLTRAINER", DEFAULT_MONEY, ITEM_ULTRA_BALL),
|
||||
TRAINER_CLASS(MAGMA_ADMIN, "MAGMA ADMIN", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(RIVAL, "{PKMN} TRAINER", 15, DEFAULT_BALL),
|
||||
TRAINER_CLASS(BUG_CATCHER, "BUG CATCHER", 4, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PKMN_RANGER, "{PKMN} RANGER", 12, DEFAULT_BALL),
|
||||
TRAINER_CLASS(MAGMA_LEADER, "MAGMA LEADER", 20, ITEM_MASTER_BALL),
|
||||
TRAINER_CLASS(LASS, "LASS", 4, DEFAULT_BALL),
|
||||
TRAINER_CLASS(YOUNG_COUPLE, "YOUNG COUPLE", 8, DEFAULT_BALL),
|
||||
TRAINER_CLASS(OLD_COUPLE, "OLD COUPLE", 10, DEFAULT_BALL),
|
||||
TRAINER_CLASS(SIS_AND_BRO, "SIS AND BRO", 3, DEFAULT_BALL),
|
||||
TRAINER_CLASS(SALON_MAIDEN, "SALON MAIDEN", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(DOME_ACE, "DOME ACE", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PALACE_MAVEN, "PALACE MAVEN", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(ARENA_TYCOON, "ARENA TYCOON", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(FACTORY_HEAD, "FACTORY HEAD", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PIKE_QUEEN, "PIKE QUEEN", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(PYRAMID_KING, "PYRAMID KING", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
TRAINER_CLASS(RS_PROTAG, "{PKMN} TRAINER", DEFAULT_MONEY, DEFAULT_BALL),
|
||||
};
|
||||
#endif
|
||||
|
||||
static void (* const sTurnActionsFuncsTable[])(void) =
|
||||
{
|
||||
|
@ -2036,7 +2030,7 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer
|
|||
#if B_TRAINER_CLASS_POKE_BALLS >= GEN_7
|
||||
if (ball == -1)
|
||||
{
|
||||
ball = (sTrainerBallTable[trainer->trainerClass]) ? sTrainerBallTable[trainer->trainerClass] : ITEM_POKE_BALL;
|
||||
ball = gTrainerClasses[trainer->trainerClass].ball ?: ITEM_POKE_BALL;
|
||||
SetMonData(&party[i], MON_DATA_POKEBALL, &ball);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3214,19 +3214,19 @@ static const u8 *BattleStringGetOpponentClassByTrainerId(u16 trainerId)
|
|||
const u8 *toCpy;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE)
|
||||
toCpy = gTrainerClassNames[GetSecretBaseTrainerClass()];
|
||||
toCpy = gTrainerClasses[GetSecretBaseTrainerClass()].name;
|
||||
else if (trainerId == TRAINER_UNION_ROOM)
|
||||
toCpy = gTrainerClassNames[GetUnionRoomTrainerClass()];
|
||||
toCpy = gTrainerClasses[GetUnionRoomTrainerClass()].name;
|
||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
toCpy = gTrainerClassNames[GetFrontierBrainTrainerClass()];
|
||||
toCpy = gTrainerClasses[GetFrontierBrainTrainerClass()].name;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
toCpy = gTrainerClassNames[GetFrontierOpponentClass(trainerId)];
|
||||
toCpy = gTrainerClasses[GetFrontierOpponentClass(trainerId)].name;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
|
||||
toCpy = gTrainerClassNames[GetTrainerHillOpponentClass(trainerId)];
|
||||
toCpy = gTrainerClasses[GetTrainerHillOpponentClass(trainerId)].name;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER)
|
||||
toCpy = gTrainerClassNames[GetEreaderTrainerClassId()];
|
||||
toCpy = gTrainerClasses[GetEreaderTrainerClassId()].name;
|
||||
else
|
||||
toCpy = gTrainerClassNames[gTrainers[trainerId].trainerClass];
|
||||
toCpy = gTrainerClasses[gTrainers[trainerId].trainerClass].name;
|
||||
|
||||
return toCpy;
|
||||
}
|
||||
|
@ -3575,7 +3575,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
|||
}
|
||||
break;
|
||||
case B_TXT_PARTNER_CLASS:
|
||||
toCpy = gTrainerClassNames[GetFrontierOpponentClass(gPartnerTrainerId)];
|
||||
toCpy = gTrainerClasses[GetFrontierOpponentClass(gPartnerTrainerId)].name;
|
||||
break;
|
||||
case B_TXT_PARTNER_NAME:
|
||||
toCpy = BattleStringGetPlayerName(text, GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT));
|
||||
|
@ -3588,7 +3588,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
|||
{
|
||||
case B_POSITION_PLAYER_RIGHT:
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
|
||||
toCpy = gTrainerClassNames[GetFrontierOpponentClass(gPartnerTrainerId)];
|
||||
toCpy = gTrainerClasses[GetFrontierOpponentClass(gPartnerTrainerId)].name;
|
||||
break;
|
||||
case B_POSITION_OPPONENT_LEFT:
|
||||
toCpy = BattleStringGetOpponentClassByTrainerId(gTrainerBattleOpponent_A);
|
||||
|
|
|
@ -7362,9 +7362,9 @@ static void Cmd_hitanimation(void)
|
|||
|
||||
static u32 GetTrainerMoneyToGive(u16 trainerId)
|
||||
{
|
||||
u32 i = 0;
|
||||
u32 lastMonLevel = 0;
|
||||
u32 moneyReward;
|
||||
u8 trainerMoney;
|
||||
|
||||
if (trainerId == TRAINER_SECRET_BASE)
|
||||
{
|
||||
|
@ -7374,19 +7374,14 @@ static u32 GetTrainerMoneyToGive(u16 trainerId)
|
|||
{
|
||||
const struct TrainerMon *party = gTrainers[trainerId].party;
|
||||
lastMonLevel = party[gTrainers[trainerId].partySize - 1].lvl;
|
||||
|
||||
for (; gTrainerMoneyTable[i].classId != 0xFF; i++)
|
||||
{
|
||||
if (gTrainerMoneyTable[i].classId == gTrainers[trainerId].trainerClass)
|
||||
break;
|
||||
}
|
||||
trainerMoney = gTrainerClasses[gTrainers[trainerId].trainerClass].money;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
|
||||
moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * gTrainerMoneyTable[i].value;
|
||||
moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * trainerMoney;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * 2 * gTrainerMoneyTable[i].value;
|
||||
moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * 2 * trainerMoney;
|
||||
else
|
||||
moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * gTrainerMoneyTable[i].value;
|
||||
moneyReward = 4 * lastMonLevel * gBattleStruct->moneyMultiplier * trainerMoney;
|
||||
}
|
||||
|
||||
return moneyReward;
|
||||
|
|
|
@ -220,6 +220,5 @@ const union AnimCmd *const gAnims_MonPic[MAX_MON_PIC_FRAMES] =
|
|||
};
|
||||
|
||||
#include "data/trainer_parties.h"
|
||||
#include "data/text/trainer_class_names.h"
|
||||
#include "data/trainers.h"
|
||||
#include "data/text/move_names.h"
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
const u8 gTrainerClassNames[][13] = {
|
||||
[TRAINER_CLASS_PKMN_TRAINER_1] = _("{PKMN} TRAINER"),
|
||||
[TRAINER_CLASS_PKMN_TRAINER_2] = _("{PKMN} TRAINER"),
|
||||
[TRAINER_CLASS_HIKER] = _("HIKER"),
|
||||
[TRAINER_CLASS_TEAM_AQUA] = _("TEAM AQUA"),
|
||||
[TRAINER_CLASS_PKMN_BREEDER] = _("{PKMN} BREEDER"),
|
||||
[TRAINER_CLASS_COOLTRAINER] = _("COOLTRAINER"),
|
||||
[TRAINER_CLASS_BIRD_KEEPER] = _("BIRD KEEPER"),
|
||||
[TRAINER_CLASS_COLLECTOR] = _("COLLECTOR"),
|
||||
[TRAINER_CLASS_SWIMMER_M] = _("SWIMMER♂"),
|
||||
[TRAINER_CLASS_TEAM_MAGMA] = _("TEAM MAGMA"),
|
||||
[TRAINER_CLASS_EXPERT] = _("EXPERT"),
|
||||
[TRAINER_CLASS_AQUA_ADMIN] = _("AQUA ADMIN"),
|
||||
[TRAINER_CLASS_BLACK_BELT] = _("BLACK BELT"),
|
||||
[TRAINER_CLASS_AQUA_LEADER] = _("AQUA LEADER"),
|
||||
[TRAINER_CLASS_HEX_MANIAC] = _("HEX MANIAC"),
|
||||
[TRAINER_CLASS_AROMA_LADY] = _("AROMA LADY"),
|
||||
[TRAINER_CLASS_RUIN_MANIAC] = _("RUIN MANIAC"),
|
||||
[TRAINER_CLASS_INTERVIEWER] = _("INTERVIEWER"),
|
||||
[TRAINER_CLASS_TUBER_F] = _("TUBER"),
|
||||
[TRAINER_CLASS_TUBER_M] = _("TUBER"),
|
||||
[TRAINER_CLASS_LADY] = _("LADY"),
|
||||
[TRAINER_CLASS_BEAUTY] = _("BEAUTY"),
|
||||
[TRAINER_CLASS_RICH_BOY] = _("RICH BOY"),
|
||||
[TRAINER_CLASS_POKEMANIAC] = _("POKéMANIAC"),
|
||||
[TRAINER_CLASS_GUITARIST] = _("GUITARIST"),
|
||||
[TRAINER_CLASS_KINDLER] = _("KINDLER"),
|
||||
[TRAINER_CLASS_CAMPER] = _("CAMPER"),
|
||||
[TRAINER_CLASS_PICNICKER] = _("PICNICKER"),
|
||||
[TRAINER_CLASS_BUG_MANIAC] = _("BUG MANIAC"),
|
||||
[TRAINER_CLASS_PSYCHIC] = _("PSYCHIC"),
|
||||
[TRAINER_CLASS_GENTLEMAN] = _("GENTLEMAN"),
|
||||
[TRAINER_CLASS_ELITE_FOUR] = _("ELITE FOUR"),
|
||||
[TRAINER_CLASS_LEADER] = _("LEADER"),
|
||||
[TRAINER_CLASS_SCHOOL_KID] = _("SCHOOL KID"),
|
||||
[TRAINER_CLASS_SR_AND_JR] = _("SR. AND JR."),
|
||||
[TRAINER_CLASS_WINSTRATE] = _("WINSTRATE"),
|
||||
[TRAINER_CLASS_POKEFAN] = _("POKéFAN"),
|
||||
[TRAINER_CLASS_YOUNGSTER] = _("YOUNGSTER"),
|
||||
[TRAINER_CLASS_CHAMPION] = _("CHAMPION"),
|
||||
[TRAINER_CLASS_FISHERMAN] = _("FISHERMAN"),
|
||||
[TRAINER_CLASS_TRIATHLETE] = _("TRIATHLETE"),
|
||||
[TRAINER_CLASS_DRAGON_TAMER] = _("DRAGON TAMER"),
|
||||
[TRAINER_CLASS_NINJA_BOY] = _("NINJA BOY"),
|
||||
[TRAINER_CLASS_BATTLE_GIRL] = _("BATTLE GIRL"),
|
||||
[TRAINER_CLASS_PARASOL_LADY] = _("PARASOL LADY"),
|
||||
[TRAINER_CLASS_SWIMMER_F] = _("SWIMMER♀"),
|
||||
[TRAINER_CLASS_TWINS] = _("TWINS"),
|
||||
[TRAINER_CLASS_SAILOR] = _("SAILOR"),
|
||||
[TRAINER_CLASS_COOLTRAINER_2] = _("COOLTRAINER"),
|
||||
[TRAINER_CLASS_MAGMA_ADMIN] = _("MAGMA ADMIN"),
|
||||
[TRAINER_CLASS_RIVAL] = _("{PKMN} TRAINER"),
|
||||
[TRAINER_CLASS_BUG_CATCHER] = _("BUG CATCHER"),
|
||||
[TRAINER_CLASS_PKMN_RANGER] = _("{PKMN} RANGER"),
|
||||
[TRAINER_CLASS_MAGMA_LEADER] = _("MAGMA LEADER"),
|
||||
[TRAINER_CLASS_LASS] = _("LASS"),
|
||||
[TRAINER_CLASS_YOUNG_COUPLE] = _("YOUNG COUPLE"),
|
||||
[TRAINER_CLASS_OLD_COUPLE] = _("OLD COUPLE"),
|
||||
[TRAINER_CLASS_SIS_AND_BRO] = _("SIS AND BRO"),
|
||||
[TRAINER_CLASS_SALON_MAIDEN] = _("SALON MAIDEN"),
|
||||
[TRAINER_CLASS_DOME_ACE] = _("DOME ACE"),
|
||||
[TRAINER_CLASS_PALACE_MAVEN] = _("PALACE MAVEN"),
|
||||
[TRAINER_CLASS_ARENA_TYCOON] = _("ARENA TYCOON"),
|
||||
[TRAINER_CLASS_FACTORY_HEAD] = _("FACTORY HEAD"),
|
||||
[TRAINER_CLASS_PIKE_QUEEN] = _("PIKE QUEEN"),
|
||||
[TRAINER_CLASS_PYRAMID_KING] = _("PYRAMID KING"),
|
||||
[TRAINER_CLASS_RS_PROTAG] = _("{PKMN} TRAINER"),
|
||||
};
|
|
@ -5791,11 +5791,11 @@ void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality)
|
|||
const u8 *GetTrainerClassNameFromId(u16 trainerId)
|
||||
{
|
||||
if (trainerId > TRAINER_PARTNER(PARTNER_NONE))
|
||||
return gTrainerClassNames[gBattlePartners[trainerId].trainerClass];
|
||||
return gTrainerClasses[gBattlePartners[trainerId].trainerClass].name;
|
||||
else if (trainerId < TRAINERS_COUNT)
|
||||
return gTrainerClassNames[gTrainers[trainerId].trainerClass];
|
||||
return gTrainerClasses[gTrainers[trainerId].trainerClass].name;
|
||||
|
||||
return gTrainerClassNames[gTrainers[TRAINER_NONE].trainerClass];
|
||||
return gTrainerClasses[gTrainers[TRAINER_NONE].trainerClass].name;
|
||||
}
|
||||
|
||||
const u8 *GetTrainerNameFromId(u16 trainerId)
|
||||
|
|
|
@ -1088,7 +1088,7 @@ static void MatchCall_GetNameAndDesc_Birch(match_call_t matchCall, const u8 **de
|
|||
static void MatchCall_GetNameAndDescByRematchIdx(u32 idx, const u8 **desc, const u8 **name)
|
||||
{
|
||||
const struct Trainer *trainer = gTrainers + GetTrainerIdxByRematchIdx(idx);
|
||||
*desc = gTrainerClassNames[trainer->trainerClass];
|
||||
*desc = gTrainerClasses[trainer->trainerClass].name;
|
||||
*name = trainer->trainerName;
|
||||
}
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8
|
|||
int index = GetTrainerIdxByRematchIdx(matchCallEntry->headerId);
|
||||
const struct Trainer *trainer = &gTrainers[index];
|
||||
int class = trainer->trainerClass;
|
||||
className = gTrainerClassNames[class];
|
||||
className = gTrainerClasses[class].name;
|
||||
trainerName = trainer->trainerName;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4444,7 +4444,7 @@ static void ViewURoomPartnerTrainerCard(u8 *unused, struct WirelessLink_URoom *d
|
|||
|
||||
DynamicPlaceholderTextUtil_Reset();
|
||||
|
||||
StringCopy(data->trainerCardStrBuffer[0], gTrainerClassNames[GetUnionRoomTrainerClass()]);
|
||||
StringCopy(data->trainerCardStrBuffer[0], gTrainerClasses[GetUnionRoomTrainerClass()].name);
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, data->trainerCardStrBuffer[0]);
|
||||
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, trainerCard->playerName);
|
||||
|
|
Loading…
Reference in a new issue