From bbf7b62ceb5d4a45b489719a074bf2218b3950fd Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 11 Dec 2021 23:03:50 -0300 Subject: [PATCH 01/22] Config for lost money after losing a battle --- data/battle_scripts_1.s | 18 ++++++++++++ include/constants/battle_config.h | 1 + include/constants/battle_string_ids.h | 4 ++- src/battle_message.c | 8 +++++ src/battle_script_commands.c | 42 +++++++++++++++++++++++---- src/overworld.c | 2 ++ 6 files changed, 69 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 24a3d16eda..a0e5577aaf 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5936,12 +5936,30 @@ BattleScript_LocalBattleLost:: jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_LocalBattleLostEnd jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: +.if B_WHITEOUT_MONEY >= GEN_4 + jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalBattleLostEnd + printstring STRINGID_PLAYERWHITEOUT + waitmessage B_WAIT_TIME_LONG + getmoneyreward + printstring STRINGID_PLAYERWHITEOUT2 + waitmessage B_WAIT_TIME_LONG + end2 +BattleScript_LocalBattleLostEnd:: + printstring STRINGID_PLAYERLOSTTOENEMYTRAINER + waitmessage B_WAIT_TIME_LONG + getmoneyreward + printstring STRINGID_PLAYERPAIDPRIZEMONEY + waitmessage B_WAIT_TIME_LONG + end2 +.else printstring STRINGID_PLAYERWHITEOUT waitmessage B_WAIT_TIME_LONG printstring STRINGID_PLAYERWHITEOUT2 waitmessage B_WAIT_TIME_LONG BattleScript_LocalBattleLostEnd:: end2 +.endif + BattleScript_CheckDomeDrew:: jumpifbyte CMP_EQUAL, gBattleOutcome, B_OUTCOME_DREW, BattleScript_LocalBattleLostEnd_ BattleScript_LocalBattleLostPrintTrainersWinText:: diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 8f8d30b568..05357b3bcb 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -101,6 +101,7 @@ #define B_PARALYSIS_SPEED GEN_7 // In Gen7+, Speed is decreased by 50% instead of 75%. #define B_CONFUSION_SELF_DMG_CHANCE GEN_7 // In Gen7+, confusion has a 33.3% of self-damage, instead of 50%. #define B_MULTI_HIT_CHANCE GEN_7 // In Gen5+, multi-hit moves have different %. See Cmd_setmultihitcounter for values. +#define B_WHITEOUT_MONEY GEN_7 // In Gen4+, the amount of money lost by losing a battle is determined by the amount of badges earned. Previously, it would cut the current money by half. (While this change was also in FRLG, for the sake of simplicity, setting this to GEN_3 will result in RSE behavior.) // Exp and stat settings #define B_EXP_CATCH GEN_7 // In Gen6+, Pokémon get experience from catching. diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 7846fa5218..48352bf34e 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -609,8 +609,10 @@ #define STRINGID_CANTESCAPEBECAUSEOFCURRENTMOVE 606 #define STRINGID_NEUTRALIZINGGASENTERS 607 #define STRINGID_NEUTRALIZINGGASOVER 608 +#define STRINGID_PLAYERLOSTTOENEMYTRAINER 609 +#define STRINGID_PLAYERPAIDPRIZEMONEY 610 -#define BATTLESTRINGS_COUNT 609 +#define BATTLESTRINGS_COUNT 611 // 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 2f9fccaafe..ec9b664519 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -76,8 +76,14 @@ static const u8 sText_ItDoesntAffect[] = _("It doesn't affect\n{B_DEF_NAME_WITH_ static const u8 sText_AttackerFainted[] = _("{B_ATK_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_TargetFainted[] = _("{B_DEF_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_PlayerGotMoney[] = _("{B_PLAYER_NAME} got ¥{B_BUFF1}\nfor winning!\p"); +static const u8 sText_PlayerLostToEnemyTrainer[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\pPlayer lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!{PAUSE_UNTIL_PRESS}"); +static const u8 sText_PlayerPaidPrizeMoney[] = _("{B_PLAYER_NAME} paid ¥{B_BUFF1} as the prize\nmoney…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); static const u8 sText_PlayerWhiteout[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\p"); +#if B_WHITEOUT_MONEY >= GEN_4 +static const u8 sText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} panicked and lost ¥{B_BUFF1}…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); +#else static const u8 sText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); +#endif static const u8 sText_PreventsEscape[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} prevents\nescape with {B_SCR_ACTIVE_ABILITY}!\p"); static const u8 sText_CantEscape2[] = _("Can't escape!\p"); static const u8 sText_AttackerCantEscape[] = _("{B_ATK_NAME_WITH_PREFIX} can't escape!"); @@ -827,6 +833,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ATTACKERFAINTED - 12] = sText_AttackerFainted, [STRINGID_TARGETFAINTED - 12] = sText_TargetFainted, [STRINGID_PLAYERGOTMONEY - 12] = sText_PlayerGotMoney, + [STRINGID_PLAYERLOSTTOENEMYTRAINER - 12] = sText_PlayerLostToEnemyTrainer, + [STRINGID_PLAYERPAIDPRIZEMONEY - 12] = sText_PlayerPaidPrizeMoney, [STRINGID_PLAYERWHITEOUT - 12] = sText_PlayerWhiteout, [STRINGID_PLAYERWHITEOUT2 - 12] = sText_PlayerWhiteout2, [STRINGID_PREVENTSESCAPE - 12] = sText_PreventsEscape, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b46331be18..d888cdfe1d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -284,6 +284,13 @@ static const u16 sTrappingMoves[] = MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, 0xFFFF }; +static const u16 sBadgeFlags[8] = { + FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET, + FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET, +}; + +static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; + #define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_DIDNT_WORK 1 @@ -6648,13 +6655,38 @@ static u32 GetTrainerMoneyToGive(u16 trainerId) static void Cmd_getmoneyreward(void) { - u32 moneyReward = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) - moneyReward += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + u32 money; + u8 sPartyLevel = 1; - AddMoney(&gSaveBlock1Ptr->money, moneyReward); - PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, moneyReward); + if (gBattleOutcome == B_OUTCOME_WON) + { + money = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + money += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + AddMoney(&gSaveBlock1Ptr->money, money); + } + else + { + s32 i, count; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) > sPartyLevel) + sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + } + } + for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++) + { + if (FlagGet(sBadgeFlags[i]) == TRUE) + ++count; + } + money = sWhiteOutBadgeMoney[count] * sPartyLevel; + RemoveMoney(&gSaveBlock1Ptr->money, money); + } + PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money); gBattlescriptCurrInstr++; } diff --git a/src/overworld.c b/src/overworld.c index ee4c660bda..1146748861 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -361,7 +361,9 @@ static void (*const gMovementStatusHandler[])(struct LinkPlayerObjectEvent *, st void DoWhiteOut(void) { ScriptContext2_RunNewScript(EventScript_WhiteOut); + #if B_WHITEOUT_MONEY == GEN_3 SetMoney(&gSaveBlock1Ptr->money, GetMoney(&gSaveBlock1Ptr->money) / 2); + #endif HealPlayerParty(); Overworld_ResetStateAfterWhiteOut(); SetWarpDestinationToLastHealLocation(); From f8b3a1c6584a76cd3e3f2721c5fb3a54bbf3a4f6 Mon Sep 17 00:00:00 2001 From: Andrea Jemmett <1787979+acidghost@users.noreply.github.com> Date: Wed, 16 Mar 2022 14:41:12 +0100 Subject: [PATCH 02/22] Fix finding libpng in gbagfx and rsfont On macOS 12, Homebrew installs libpng in a custom location. --- tools/gbagfx/Makefile | 2 ++ tools/rsfont/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/gbagfx/Makefile b/tools/gbagfx/Makefile index b4244aa8d6..8728fa8d09 100644 --- a/tools/gbagfx/Makefile +++ b/tools/gbagfx/Makefile @@ -1,8 +1,10 @@ CC = gcc CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK +CFLAGS += $(shell pkg-config --cflags libpng) LIBS = -lpng -lz +LDFLAGS += $(shell pkg-config --libs-only-L libpng) SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c diff --git a/tools/rsfont/Makefile b/tools/rsfont/Makefile index 0bc88a42b7..92e44b5459 100644 --- a/tools/rsfont/Makefile +++ b/tools/rsfont/Makefile @@ -1,8 +1,10 @@ CC ?= gcc CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK +CFLAGS += $(shell pkg-config --cflags libpng) LIBS = -lpng -lz +LDFLAGS += $(shell pkg-config --libs-only-L libpng) SRCS = main.c convert_png.c util.c font.c From 62f3f144ab499ff47c4451212b7350e0815a57c7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 4 Mar 2022 11:02:19 -0500 Subject: [PATCH 03/22] Clean up some trainer hill --- asm/macros/trainer_hill.inc | 8 +- data/maps/TrainerHill_Entrance/scripts.inc | 2 +- include/constants/trainer_hill.h | 27 +- include/ereader_helpers.h | 2 +- include/global.h | 11 +- include/trainer_hill.h | 40 +- src/data/battle_frontier/trainer_hill.h | 957 ++++++--------------- src/ereader_helpers.c | 122 ++- src/trainer_hill.c | 167 ++-- 9 files changed, 456 insertions(+), 880 deletions(-) diff --git a/asm/macros/trainer_hill.inc b/asm/macros/trainer_hill.inc index 65c8c6befc..988e2867ae 100644 --- a/asm/macros/trainer_hill.inc +++ b/asm/macros/trainer_hill.inc @@ -100,9 +100,9 @@ special CallTrainerHillFunction .endm - @ Set the challenge mode to HILL_TAG_* (Normal, Variety, Unique, or Expert) - .macro trainerhill_settag tag:req - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG - copyvar VAR_0x8005, \tag + @ Set the challenge mode to HILL_MODE_* (Normal, Variety, Unique, or Expert) + .macro trainerhill_setmode mode:req + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_MODE + copyvar VAR_0x8005, \mode special CallTrainerHillFunction .endm diff --git a/data/maps/TrainerHill_Entrance/scripts.inc b/data/maps/TrainerHill_Entrance/scripts.inc index 8989883e47..2dd001a3ba 100644 --- a/data/maps/TrainerHill_Entrance/scripts.inc +++ b/data/maps/TrainerHill_Entrance/scripts.inc @@ -157,7 +157,7 @@ TrainerHill_Entrance_EventScript_ChooseChallenge:: switch VAR_RESULT case 4, TrainerHill_Entrance_EventScript_CancelEntry case MULTI_B_PRESSED, TrainerHill_Entrance_EventScript_CancelEntry - trainerhill_settag VAR_RESULT + trainerhill_setmode VAR_RESULT setvar VAR_TRAINER_HILL_IS_ACTIVE, 1 setvar VAR_TEMP_5, 0 special HealPlayerParty diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index 0e802bba80..371763faf3 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -8,6 +8,12 @@ #define TRAINER_HILL_ROOF 5 #define TRAINER_HILL_ENTRANCE 6 +#define HILL_MODE_NORMAL 0 +#define HILL_MODE_VARIETY 1 +#define HILL_MODE_UNIQUE 2 +#define HILL_MODE_EXPERT 3 +#define NUM_TRAINER_HILL_MODES 4 + #define NUM_TRAINER_HILL_FLOORS 4 #define NUM_TRAINER_HILL_FLOORS_JP 2 @@ -30,20 +36,33 @@ #define TRAINER_HILL_FUNC_SET_GAME_SAVED 14 #define TRAINER_HILL_FUNC_CLEAR_GAME_SAVED 15 #define TRAINER_HILL_FUNC_GET_WON 16 -#define TRAINER_HILL_FUNC_SET_TAG 17 +#define TRAINER_HILL_FUNC_SET_MODE 17 #define TRAINER_HILL_TEXT_INTRO 2 #define TRAINER_HILL_TEXT_PLAYER_LOST 3 #define TRAINER_HILL_TEXT_PLAYER_WON 4 #define TRAINER_HILL_TEXT_AFTER 5 -#define TRAINER_HILL_TRAINERS_PER_FLOOR 2 -#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR) -#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR) +#define HILL_TRAINERS_PER_FLOOR 2 +#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * HILL_TRAINERS_PER_FLOOR) +#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * HILL_TRAINERS_PER_FLOOR) // Values returned by TrainerHillGetChallengeStatus #define TRAINER_HILL_PLAYER_STATUS_LOST 0 #define TRAINER_HILL_PLAYER_STATUS_ECARD_SCANNED 1 #define TRAINER_HILL_PLAYER_STATUS_NORMAL 2 +#define HILL_TRAINER_NAME_LENGTH 11 + +#define TRAINER_HILL_OTID 0x10000000 + +// The full map of each Trainer Hill floor is 16x21. +// The first 5x21 at the top is the entrance/exit area, +// and the remaining 16x16 is the randomized portion of +// the room where the trainers are. +#define HILL_FLOOR_WIDTH 16 +#define HILL_FLOOR_HEIGHT_MAIN 16 +#define HILL_FLOOR_HEIGHT_MARGIN 5 +#define HILL_FLOOR_HEIGHT (HILL_FLOOR_HEIGHT_MAIN + HILL_FLOOR_HEIGHT_MARGIN) + #endif diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 8bf3dc43b6..29386bcb22 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -35,7 +35,7 @@ struct EReaderTrainerHillTrainer { u8 trainerNum; struct TrainerHillTrainer trainer; - struct TrHillDisplay display; + struct TrainerHillFloorMap map; u32 checksum; }; // size=0x274 diff --git a/include/global.h b/include/global.h index 0122ecd5c4..89f7251767 100644 --- a/include/global.h +++ b/include/global.h @@ -14,6 +14,7 @@ #include "constants/maps.h" #include "constants/pokemon.h" #include "constants/easy_chat.h" +#include "constants/trainer_hill.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -279,8 +280,6 @@ struct BattleTowerPokemon u8 friendship; }; -#define NULL_BATTLE_TOWER_POKEMON { .nickname = __("$$$$$$$$$$$") } - struct EmeraldBattleTowerRecord { /*0x00*/ u8 lvlMode; // 0 = level 50, 1 = level 100 @@ -808,7 +807,7 @@ struct TrainerNameRecord u8 trainerName[PLAYER_NAME_LENGTH + 1]; }; -struct SaveTrainerHill +struct TrainerHillSave { /*0x3D64*/ u32 timer; /*0x3D68*/ u32 bestTime; @@ -820,7 +819,7 @@ struct SaveTrainerHill /*0x3D6E*/ u16 hasLost:1; /*0x3D6E*/ u16 maybeECardScanDuringChallenge:1; /*0x3D6E*/ u16 field_3D6E_0f:1; - /*0x3D6E*/ u16 tag:2; + /*0x3D6E*/ u16 mode:2; // HILL_MODE_* }; struct WonderNewsMetadata @@ -1003,7 +1002,7 @@ struct SaveBlock1 /*0x31F8*/ struct EnigmaBerry enigmaBerry; /*0x322C*/ struct MysteryGiftSave mysteryGift; /*0x3598*/ u8 unused_3598[0x180]; - /*0x3718*/ u32 trainerHillTimes[4]; + /*0x3718*/ u32 trainerHillTimes[NUM_TRAINER_HILL_MODES]; /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[NUM_DEX_FLAG_BYTES]; @@ -1011,7 +1010,7 @@ struct SaveBlock1 /*0x3B98*/ struct TrainerNameRecord trainerNameRecords[20]; /*0x3C88*/ u8 registeredTexts[UNION_ROOM_KB_ROW_COUNT][21]; /*0x3D5A*/ u8 unused_3D5A[10]; - /*0x3D64*/ struct SaveTrainerHill trainerHill; + /*0x3D64*/ struct TrainerHillSave trainerHill; /*0x3D70*/ struct WaldaPhrase waldaPhrase; // sizeof: 0x3D88 }; diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 647ba96470..857cabeae6 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -1,7 +1,7 @@ #ifndef GUARD_TRAINER_HILL_H #define GUARD_TRAINER_HILL_H -#define HILL_TRAINER_NAME_LENGTH 11 +#define DUMMY_HILL_MON { .nickname = __("$$$$$$$$$$$") } struct TrainerHillTrainer { @@ -15,44 +15,30 @@ struct TrainerHillTrainer struct BattleTowerPokemon mons[PARTY_SIZE]; }; -struct TrHillRoomTrainers +struct TrainerHillFloorMap { - u8 name[2][HILL_TRAINER_NAME_LENGTH]; - u8 facilityClass[2]; + u8 metatileData[HILL_FLOOR_WIDTH * HILL_FLOOR_HEIGHT_MAIN]; // Add NUM_METATILES_IN_PRIMARY to the values in this array to get metatile ids. + u16 collisionData[HILL_FLOOR_WIDTH]; // One bit for each tile in column-major order, so every array entry is one row. 1 = impassable, 0 = passable + u8 trainerCoords[HILL_TRAINERS_PER_FLOOR]; // Starting at (0,6). Format is 0bYYYYXXXX. + u8 trainerDirections; // DIR_* - 1, 4 bits per trainer + u8 trainerRanges; // 4 bits per trainer }; -struct TrHillDisplay -{ - // Metatile data. Add 0x200 to the values in this array to get metatiles. - // This data then overwrites the metatiles in the map starting at (0,5) - u8 metatileData[0x100]; - // Collision data. One bit for each tile in column-major order, - // so every array entry is one row. 1 = impassable, 0 = passable - u16 collisionData[16]; - // Trainer coordinates, starting at (0,6). Format is 0bYYYYXXXX. - u8 coords[2]; - // Trainer facing directions. Same as (DIR_* - 1). - // Effectively an array of nibbles, one for each trainer. - u8 direction; - // Trainer sight ranges. Effectively an array of nibbles, one for each trainer. - u8 range; -}; - -struct TrHillFloor +struct TrainerHillFloor { u8 trainerNum1; u8 trainerNum2; - struct TrainerHillTrainer trainers[2]; - struct TrHillDisplay display; + struct TrainerHillTrainer trainers[HILL_TRAINERS_PER_FLOOR]; + struct TrainerHillFloorMap map; }; -struct TrHillTag +struct TrainerHillChallenge { u8 numTrainers; u8 unused1; u8 numFloors; - u32 checksum; - struct TrHillFloor floors[0]; + u32 checksum; // A byte array sum of the floor data + struct TrainerHillFloor floors[0]; // Floor data is assumed to follow, so this will be intentionally read out of bounds }; extern u32 *gTrainerHillVBlankCounter; diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h index 75785b2589..413ec8e129 100644 --- a/src/data/battle_frontier/trainer_hill.h +++ b/src/data/battle_frontier/trainer_hill.h @@ -1,20 +1,23 @@ -#define TRAINER_HILL_OTID 0x10000000 - // NOTE: Each of these macros turn data into one byte. Therefore ranges for all arguments is 0-15 -// See struct TrHillDisplay for more info about each +// See struct TrainerHillFloorMap for more info about each #define COORDS_XY(x,y) ((y<<4)|(x)) #define TRAINER_DIRS(a, b) (((a-1)<<4)|(b-1)) #define TRAINER_RANGE(a, b) ((a<<4)|(b)) -static const struct TrHillTag sDataTagJPDefault = { +// WARNING: While not referenced directly, the floor data in this file is referenced by virtue +// of coming after its corresponding challenge (see SetUpDataStruct in trainer_hill.c). +// Do not insert data between a pair of 'sChallenge_Mode' and 'sFloors_Mode'. + +// Unused +static const struct TrainerHillChallenge sChallenge_JPDefault = { .numTrainers = NUM_TRAINER_HILL_TRAINERS_JP, .unused1 = 1, .numFloors = NUM_TRAINER_HILL_FLOORS_JP, .checksum = 0x0 }; - -static const struct TrHillFloor sDataTagJPDefault_Floors[] = { +// Unused +static const struct TrainerHillFloor sFloors_JPDefault[] = { [0] = { .trainerNum1 = 0, .trainerNum2 = 0, @@ -32,8 +35,6 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .species = SPECIES_ZIGZAGOON, .heldItem = ITEM_SITRUS_BERRY, .moves = { MOVE_HEADBUTT, MOVE_PIN_MISSILE, MOVE_GROWL, MOVE_TAIL_WHIP }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -50,14 +51,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("ジグザグマ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [1] = { .species = SPECIES_SHROOMISH, .heldItem = ITEM_PECHA_BERRY, .moves = { MOVE_MEGA_DRAIN, MOVE_LEECH_SEED, MOVE_POISON_POWDER, MOVE_GROWTH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 120, .attackEV = 0, .defenseEV = 120, @@ -74,14 +73,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("キノココ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [2] = { .species = SPECIES_SANDSHREW, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_SCRATCH, MOVE_POISON_STING, MOVE_SAND_ATTACK, MOVE_SWIFT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -98,11 +95,11 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("サンド$$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, - [3] = NULL_BATTLE_TOWER_POKEMON, - [4] = NULL_BATTLE_TOWER_POKEMON, - [5] = NULL_BATTLE_TOWER_POKEMON + [3] = DUMMY_HILL_MON, + [4] = DUMMY_HILL_MON, + [5] = DUMMY_HILL_MON } }, [1] = { @@ -114,15 +111,13 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .speechLose = { EC_WORD_OH_QUES, EC_MOVE(EARTHQUAKE), EC_WORD_EXISTS, EC_WORD_OF, EC_WORD_WITHOUT, EC_WORD_EXCL }, .speechAfter = { EC_WORD_YOU_RE, EC_WORD_PROBABLY, EC_WORD_END, EC_WORD_UNTIL, EC_WORD_GOING, EC_WORD_ANYWHERE }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_WINGULL, .heldItem = ITEM_CHERI_BERRY, .moves = { MOVE_WATER_GUN, MOVE_WING_ATTACK, MOVE_GROWL, MOVE_SUPERSONIC }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -139,14 +134,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("キャモメ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_NUMEL, .heldItem = ITEM_FOCUS_BAND, .moves = { MOVE_EMBER, MOVE_DIG, MOVE_TACKLE, MOVE_FOCUS_ENERGY }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -163,14 +156,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ドンメル$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_SURSKIT, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_BUBBLE_BEAM, MOVE_MUD_SHOT, MOVE_QUICK_ATTACK, MOVE_AGILITY }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, @@ -187,12 +178,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("アメタマ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, }, - .display = { + .map = { .metatileData = { 0x31, 0x35, 0x35, 0x3b, 0x26, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x3b, 0x3b, 0x08, 0x31, 0x2b, 0x2b, 0x3b, 0x34, 0x34, 0x2b, 0x2b, 0x34, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x08, @@ -212,9 +203,9 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = { 0x0381, 0x6fc1, 0x6341, 0x6041, 0x7f41, 0x4401, 0x5541, 0x5541, 0x11c1, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, - .coords = { COORDS_XY(8,2), COORDS_XY(8,7) }, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(2, 3) + .trainerCoords = { COORDS_XY(8,2), COORDS_XY(8,7) }, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(2, 3) } }, [1] = { @@ -234,8 +225,6 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .species = SPECIES_ELECTRIKE, .heldItem = ITEM_CHERI_BERRY, .moves = { MOVE_SPARK, MOVE_THUNDER_WAVE, MOVE_QUICK_ATTACK, MOVE_ROAR }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 120, .attackEV = 120, .defenseEV = 0, @@ -252,14 +241,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0x0, .nickname = __("ラクライ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [1] = { .species = SPECIES_CORPHISH, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_KNOCK_OFF, MOVE_CRABHAMMER, MOVE_TAUNT, MOVE_PROTECT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 110, .defenseEV = 100, @@ -276,14 +263,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0x96, .nickname = __("ヘイガニ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [2] = { .species = SPECIES_BALTOY, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_PSYBEAM, MOVE_ROCK_TOMB, MOVE_MUD_SLAP, MOVE_HARDEN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, @@ -300,11 +285,11 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ヤジロン$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, - [3] = NULL_BATTLE_TOWER_POKEMON, - [4] = NULL_BATTLE_TOWER_POKEMON, - [5] = NULL_BATTLE_TOWER_POKEMON, + [3] = DUMMY_HILL_MON, + [4] = DUMMY_HILL_MON, + [5] = DUMMY_HILL_MON, } }, [1] = { @@ -316,15 +301,13 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .speechLose = { EC_WORD_AWFUL, EC_WORD_GWAH, EC_WORD_HOPELESS, EC_WORD_CAN_T_WIN, EC_WORD_IS, EC_WORD_NONE }, .speechAfter = { EC_WORD_AWW, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_SPHEAL, .heldItem = ITEM_FOCUS_BAND, .moves = { MOVE_ICE_BALL, MOVE_BODY_SLAM, MOVE_WATER_GUN, MOVE_ENCORE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, @@ -341,14 +324,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("タマザラシ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SPOINK, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_PSYWAVE, MOVE_FUTURE_SIGHT, MOVE_CONFUSE_RAY, MOVE_MAGIC_COAT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 0, .defenseEV = 100, @@ -365,14 +346,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0xf, .nickname = __("バネブー$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_POOCHYENA, .heldItem = ITEM_PECHA_BERRY, .moves = { MOVE_BITE, MOVE_POISON_FANG, MOVE_SWAGGER, MOVE_SCARY_FACE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 70, .attackEV = 80, .defenseEV = 80, @@ -389,12 +368,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ポチエナ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3b, 0x35, 0x3b, 0x39, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x35, 0x3b, 0x08, 0x31, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x2b, 0x3b, 0x08, @@ -414,14 +393,14 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = { 0x0381, 0x27c5, 0x27c5, 0x27c5, 0x27c5, 0x27c5, 0x26c5, 0x2005, 0x3efd, 0x1, 0x6ff, 0x7ff, 0x7ff, 0xffff, 0xffff, 0xffff }, - .coords = { COORDS_XY(7,6), COORDS_XY(7,10) }, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3) + .trainerCoords = { COORDS_XY(7,6), COORDS_XY(7,10) }, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3) } }, }; -static const struct TrHillTag sDataTagNormal = +static const struct TrainerHillChallenge sChallenge_Normal = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 2, @@ -429,7 +408,7 @@ static const struct TrHillTag sDataTagNormal = .checksum = 0x00051E05 }; -static const struct TrHillFloor sDataTagNormal_Floors[] = +static const struct TrainerHillFloor sFloors_Normal[] = { [0] = { @@ -453,8 +432,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_MISDREAVUS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SHADOW_BALL, MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .attackEV = 155, .speedEV = 255, .spAttackEV = 100, @@ -468,15 +445,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x0, .nickname = _("MISDREAVUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SOLROCK, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCHIC, MOVE_FLAMETHROWER, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 100, .spAttackEV = 110, @@ -491,15 +466,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("SOLROCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_CLAYDOL, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_EARTHQUAKE, MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 135, .spDefenseEV = 120, @@ -513,15 +486,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xC, .nickname = _("CLAYDOL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_WEEZING, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_FRUSTRATION, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .attackEV = 200, .spDefenseEV = 200, @@ -542,8 +513,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_LUNATONE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCHIC, MOVE_ICE_BEAM, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 100, .spAttackEV = 110, @@ -558,15 +527,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("LUNATONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_FLYGON, .heldItem = ITEM_CHOICE_BAND, .moves = {MOVE_EARTHQUAKE, MOVE_DRAGON_CLAW, MOVE_CRUNCH, MOVE_FLAMETHROWER}, - .level = 0, - .ppBonuses = 0, .attackEV = 155, .speedEV = 255, .spAttackEV = 100, @@ -580,7 +547,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x83, .nickname = _("FLYGON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -600,8 +567,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_SEALEO, .heldItem = ITEM_NEVER_MELT_ICE, .moves = {MOVE_BLIZZARD, MOVE_ICE_BALL, MOVE_ENCORE, MOVE_HAIL}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -614,15 +579,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("SEALEO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_AMPHAROS, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDER_WAVE, MOVE_COTTON_SPORE, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -635,15 +598,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("AMPHAROS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_MACHOKE, .heldItem = ITEM_BLACK_BELT, .moves = {MOVE_DYNAMIC_PUNCH, MOVE_MUD_SLAP, MOVE_COUNTER, MOVE_SCARY_FACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -656,15 +617,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x4E, .nickname = _("MACHOKE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_FLAREON, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_FIRE_BLAST, MOVE_BITE, MOVE_QUICK_ATTACK, MOVE_SAND_ATTACK}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -677,15 +636,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x28, .nickname = _("FLAREON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MAGNETON, .heldItem = ITEM_MAGNET, .moves = {MOVE_ZAP_CANNON, MOVE_THUNDER_WAVE, MOVE_SCREECH, MOVE_METAL_SOUND}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -698,15 +655,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x0, .nickname = _("MAGNETON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_PINSIR, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_GUILLOTINE, MOVE_BRICK_BREAK, MOVE_SWAGGER, MOVE_FAINT_ATTACK}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 155, .spDefenseEV = 155, @@ -720,12 +675,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x85, .nickname = _("PINSIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x08, 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x08, @@ -745,10 +700,10 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x3FE5, 0x0401, 0xBDED, 0x8425, 0xDFBD, 0x0221, 0x7E7F, 0x0941, 0x7F7D, 0x0911, 0x7FF7, 0x4101, 0x79F9, 0x0803, 0xFFFF}, - .coords = {COORDS_XY(11,1), COORDS_XY(13,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH), - .range = TRAINER_RANGE(2, 1), - } + .trainerCoords = {COORDS_XY(11,1), COORDS_XY(13,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(2, 1), + } }, [1] = { @@ -772,8 +727,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_MEDITITE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -787,15 +740,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("MEDITITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_HERACROSS, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -809,15 +760,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0x80, .nickname = _("HERACROSS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_HITMONTOP, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -831,15 +780,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONTOP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MACHOP, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -853,15 +800,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x4E, .nickname = _("MACHOP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PINSIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -875,15 +820,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("PINSIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_HITMONCHAN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -897,7 +840,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONCHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -917,8 +860,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_VULPIX, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_WILL_O_WISP, MOVE_CONFUSE_RAY, MOVE_TAIL_WHIP, MOVE_OVERHEAT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -932,15 +873,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("VULPIX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MINUN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_THUNDER_WAVE, MOVE_CHARM, MOVE_ENCORE, MOVE_SPARK}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -954,15 +893,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("MINUN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ROSELIA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TOXIC, MOVE_LEECH_SEED, MOVE_SWEET_SCENT, MOVE_GIGA_DRAIN}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -976,15 +913,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("ROSELIA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MR_MIME, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_SAFEGUARD, MOVE_REFLECT, MOVE_LIGHT_SCREEN, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -998,15 +933,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x82, .nickname = _("MR. MIME"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PLUSLE, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_RAIN_DANCE, MOVE_LIGHT_SCREEN, MOVE_HELPING_HAND, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -1020,15 +953,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x5, .nickname = _("PLUSLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_TOGEPI, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_LIGHT_SCREEN, MOVE_REFLECT, MOVE_FOLLOW_ME, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -1042,12 +973,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0x37, .nickname = _("TOGEPI"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x08, 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x08, @@ -1067,10 +998,10 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF}, - .coords = {COORDS_XY(4,11), COORDS_XY(9,14)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_EAST), - .range = TRAINER_RANGE(3, 5), - } + .trainerCoords = {COORDS_XY(4,11), COORDS_XY(9,14)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 5), + } }, [2] = { @@ -1094,8 +1025,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_VAPOREON, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_HAZE, MOVE_HELPING_HAND, MOVE_TICKLE, MOVE_WATER_PULSE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1116,8 +1045,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_DODRIO, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_HAZE, MOVE_TRI_ATTACK, MOVE_TAUNT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -1138,8 +1065,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_OMASTAR, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_HAZE, MOVE_HYDRO_PUMP, MOVE_TICKLE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1153,15 +1078,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x14, .nickname = _("OMASTAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_LICKITUNG, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1175,15 +1098,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8, .nickname = _("LICKITUNG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SLOWBRO, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_BELLY_DRUM, MOVE_MUD_SLAP, MOVE_SWAGGER, MOVE_AMNESIA}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1204,8 +1125,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_LINOONE, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1219,7 +1138,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8, .nickname = _("LINOONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1239,8 +1158,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_SKITTY, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCH_UP, MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_IRON_TAIL}, - .level = 0, - .ppBonuses = 0, .attackEV = 252, .speedEV = 252, .otId = TRAINER_HILL_OTID, @@ -1253,15 +1170,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xCB, .nickname = _("SKITTY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MEDICHAM, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PSYCH_UP, MOVE_HI_JUMP_KICK, MOVE_MEGA_KICK, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -1282,8 +1197,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_STANTLER, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_PSYCH_UP, MOVE_RETURN, MOVE_EARTHQUAKE, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -1304,8 +1217,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_NIDOQUEEN, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SUPERPOWER, MOVE_BITE, MOVE_CHARM, MOVE_FLATTER}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -1326,8 +1237,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_NINETALES, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_OVERHEAT, MOVE_QUICK_ATTACK, MOVE_SPITE, MOVE_TAIL_WHIP}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -1341,15 +1250,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xD7, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_CHARIZARD, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_OVERHEAT, MOVE_BEAT_UP, MOVE_SCARY_FACE, MOVE_GROWL}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -1363,12 +1270,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x28, .nickname = _("CHARIZARD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x08, 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x08, @@ -1388,10 +1295,10 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x08, }, .collisionData = {0x0381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1}, - .coords = {COORDS_XY(5,2), COORDS_XY(9,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), - } + .trainerCoords = {COORDS_XY(5,2), COORDS_XY(9,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), + } }, [3] = { @@ -1415,8 +1322,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_ALAKAZAM, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1429,15 +1334,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x41, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_BLISSEY, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SKILL_SWAP, MOVE_EGG_BOMB, MOVE_THUNDERBOLT, MOVE_SING}, - .level = 0, - .ppBonuses = 0, .defenseEV = 255, .spAttackEV = 155, .spDefenseEV = 100, @@ -1451,15 +1354,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("BLISSEY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GRUMPIG, .heldItem = ITEM_TWISTED_SPOON, .moves = {MOVE_SKILL_SWAP, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spAttackEV = 200, @@ -1473,15 +1374,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("GRUMPIG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GARDEVOIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_DREAM_EATER, MOVE_HYPNOSIS, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1494,15 +1393,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("GARDEVOIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_VENOMOTH, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SKILL_SWAP, MOVE_SIGNAL_BEAM, MOVE_SLEEP_POWDER, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1515,15 +1412,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("VENOMOTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ESPEON, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_PSYBEAM, MOVE_SWIFT, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1536,7 +1431,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("ESPEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1556,8 +1451,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_WEEZING, .heldItem = ITEM_POISON_BARB, .moves = {MOVE_TOXIC, MOVE_SLUDGE_BOMB, MOVE_SMOKESCREEN, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1570,15 +1463,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("WEEZING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GLOOM, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_PETAL_DANCE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1591,15 +1482,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("GLOOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_MUK, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SCREECH, MOVE_DISABLE, MOVE_SLUDGE_BOMB, MOVE_ACID_ARMOR}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1612,15 +1501,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("MUK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_TROPIUS, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM, MOVE_SWEET_SCENT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .attackEV = 120, .speedEV = 255, .spAttackEV = 135, @@ -1634,15 +1521,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x83, .nickname = _("TROPIUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_BELLOSSOM, .heldItem = ITEM_MENTAL_HERB, .moves = {MOVE_SWEET_SCENT, MOVE_PETAL_DANCE, MOVE_STUN_SPORE, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1655,15 +1540,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x6, .nickname = _("BELLOSSOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MEGANIUM, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_RAZOR_LEAF, MOVE_BODY_SLAM, MOVE_LEECH_SEED, MOVE_SYNTHESIS}, - .level = 0, - .ppBonuses = 0, .attackEV = 200, .speedEV = 110, .spAttackEV = 200, @@ -1677,12 +1560,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x1F, .nickname = _("MEGANIUM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, @@ -1702,14 +1585,14 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x0401, 0x1, 0x8401, 0x8465, 0x0445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF}, - .coords = {COORDS_XY(7,4), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), - } + .trainerCoords = {COORDS_XY(7,4), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), + } }, }; -static const struct TrHillTag sDataTagVariety = +static const struct TrainerHillChallenge sChallenge_Variety = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 1, @@ -1717,7 +1600,7 @@ static const struct TrHillTag sDataTagVariety = .checksum = 0x00054C15 }; -static const struct TrHillFloor sDataTagVariety_Floors[] = { +static const struct TrainerHillFloor sFloors_Variety[] = { [0] = { .trainerNum1 = 41, @@ -1740,8 +1623,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_DELIBIRD, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_SPLASH, MOVE_HAIL, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1754,15 +1635,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x8A, .nickname = _("DELIBIRD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_CLEFAIRY, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_COSMIC_POWER, MOVE_LIGHT_SCREEN, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1775,15 +1654,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("CLEFAIRY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_PIKACHU, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_GROWL, MOVE_TAIL_WHIP, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1796,15 +1673,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("PIKACHU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MARILL, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_DEFENSE_CURL, MOVE_TAIL_WHIP, MOVE_ENDURE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1817,15 +1692,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x8A, .nickname = _("MARILL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_JIGGLYPUFF, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_SING, MOVE_DISABLE, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1838,15 +1711,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("JIGGLYPUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_TOGETIC, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_CHARM, MOVE_SWEET_KISS, MOVE_WISH}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1859,7 +1730,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x26, .nickname = _("TOGETIC"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1879,8 +1750,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_WIGGLYTUFF, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_ROLLOUT, MOVE_DEFENSE_CURL, MOVE_SING, MOVE_DREAM_EATER}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1893,15 +1762,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xC1, .nickname = _("WIGGLYTUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SABLEYE, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_ASTONISH, MOVE_FAINT_ATTACK, MOVE_DETECT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1914,15 +1781,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("SABLEYE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GRUMPIG, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_PSYBEAM, MOVE_MAGIC_COAT, MOVE_BOUNCE, MOVE_FUTURE_SIGHT}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1935,15 +1800,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("GRUMPIG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_CORSOLA, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_BUBBLE_BEAM, MOVE_ROCK_BLAST, MOVE_REFLECT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1956,15 +1819,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x12, .nickname = _("CORSOLA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_CLAMPERL, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_WHIRLPOOL, MOVE_IRON_DEFENSE, MOVE_ENDURE, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1977,15 +1838,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("CLAMPERL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_DIVE, MOVE_ICY_WIND, MOVE_SWIFT, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1998,12 +1857,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x08, @@ -2023,9 +1882,9 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x08, }, .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}, - .coords = {COORDS_XY(5,8), COORDS_XY(9,8)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(5,8), COORDS_XY(9,8)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [1] = @@ -2050,8 +1909,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_JIGGLYPUFF, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SING, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2068,15 +1925,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("JIGGLYPUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_JYNX, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_PERISH_SONG, MOVE_FAKE_TEARS, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2093,15 +1948,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("JYNX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_EXPLOUD, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HOWL, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2118,15 +1971,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("EXPLOUD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_ABSOL, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SWORDS_DANCE, MOVE_SLASH, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2143,15 +1994,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("ABSOL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PIDGEOTTO, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_FEATHER_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2168,15 +2017,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("PIDGEOTTO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ALTARIA, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DRAGON_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2193,7 +2040,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("ALTARIA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -2213,8 +2060,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_CHIMECHO, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2228,15 +2073,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("CHIMECHO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_WHISMUR, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2250,15 +2093,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("WHISMUR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_YANMA, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2272,15 +2113,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("YANMA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_ILLUMISE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -2294,15 +2133,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("ILLUMISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SPHEAL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -2316,15 +2153,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SPHEAL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_VIGOROTH, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -2338,12 +2173,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("VIGOROTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x91, 0x9B, 0x9C, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x08, @@ -2363,9 +2198,9 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(3,8), COORDS_XY(11,8)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(7, 7), + .trainerCoords = {COORDS_XY(3,8), COORDS_XY(11,8)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(7, 7), } }, [2] = @@ -2390,8 +2225,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_WOOPER, .heldItem = ITEM_FIGY_BERRY, .moves = {MOVE_RAIN_DANCE, MOVE_YAWN, MOVE_SURF, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -2405,15 +2238,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("WOOPER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_POLIWAG, .heldItem = ITEM_WIKI_BERRY, .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_MIST, MOVE_HYPNOSIS}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -2427,15 +2258,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x3, .nickname = _("POLIWAG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_PSYDUCK, .heldItem = ITEM_AGUAV_BERRY, .moves = {MOVE_HYPNOSIS, MOVE_SURF, MOVE_DISABLE, MOVE_SEISMIC_TOSS}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -2449,15 +2278,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("PSYDUCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_RHYDON, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -2478,8 +2305,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_RHYHORN, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2500,8 +2325,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_CUBONE, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2535,8 +2358,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_MAGNEMITE, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_ZAP_CANNON, MOVE_SPARK, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -2550,15 +2371,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("MAGNEMITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ELECTABUZZ, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_THUNDER_PUNCH, MOVE_SHOCK_WAVE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -2572,15 +2391,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x41, .nickname = _("ELECTABUZZ"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_FLAAFFY, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_SHOCK_WAVE, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .spAttackEV = 130, .otId = TRAINER_HILL_OTID, @@ -2593,15 +2410,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("FLAAFFY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_BALTOY, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2622,8 +2437,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_PINECO, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -2644,8 +2457,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_VOLTORB, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2664,7 +2475,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, @@ -2684,9 +2495,9 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x08, }, .collisionData = {0x0381, 0x0381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1}, - .coords = {COORDS_XY(9,1), COORDS_XY(14,1)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(4, 4), + .trainerCoords = {COORDS_XY(9,1), COORDS_XY(14,1)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(4, 4), } }, [3] = @@ -2711,8 +2522,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_UNOWN, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2725,15 +2534,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x202, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_UNOWN, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2746,15 +2553,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x10001, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_UNOWN, .heldItem = ITEM_BLACK_BELT, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2767,15 +2572,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x102, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SPINDA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -2789,15 +2592,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x88FE980F, .nickname = _("SPINDA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PLUSLE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2810,15 +2611,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("PLUSLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_VOLBEAT, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_HELPING_HAND, MOVE_SIGNAL_BEAM, MOVE_SOLAR_BEAM, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2831,7 +2630,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("VOLBEAT"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -2851,8 +2650,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_SPINDA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -2866,15 +2663,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xE2880098, .nickname = _("SPINDA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MINUN, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2887,15 +2682,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("MINUN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ILLUMISE, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_HELPING_HAND, MOVE_WISH, MOVE_THUNDERBOLT, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2908,15 +2701,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ILLUMISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_UNOWN, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2929,15 +2720,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x302, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_UNOWN, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2950,15 +2739,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x203, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_UNOWN, .heldItem = ITEM_TWISTED_SPOON, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2971,12 +2758,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x301, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08, @@ -2996,14 +2783,14 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF}, - .coords = {COORDS_XY(10,2), COORDS_XY(14,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(10,2), COORDS_XY(14,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; -static const struct TrHillTag sDataTagUnique = +static const struct TrainerHillChallenge sChallenge_Unique = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 3, @@ -3011,7 +2798,7 @@ static const struct TrHillTag sDataTagUnique = .checksum = 0x000652F3 }; -static const struct TrHillFloor sDataTagUnique_Floors[] = { +static const struct TrainerHillFloor sFloors_Unique[] = { [0] = { .trainerNum1 = 49, @@ -3034,8 +2821,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SUNFLORA, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_PETAL_DANCE, MOVE_GRASS_WHISTLE, MOVE_LIGHT_SCREEN, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 155, .spDefenseEV = 100, @@ -3049,15 +2834,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("SUNFLORA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_TANGELA, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_GIGA_DRAIN, MOVE_SLEEP_POWDER, MOVE_AMNESIA, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spDefenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -3070,15 +2853,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x91, .nickname = _("TANGELA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_VENUSAUR, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SOLAR_BEAM, MOVE_EARTHQUAKE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 100, .attackEV = 110, .defenseEV = 100, @@ -3094,15 +2875,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x1F, .nickname = _("VENUSAUR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_LANTURN, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_SPARK, MOVE_WATER_PULSE, MOVE_CONFUSE_RAY, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3115,15 +2894,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("LANTURN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MANECTRIC, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_THUNDERBOLT, MOVE_HEADBUTT, MOVE_BITE, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3136,15 +2913,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("MANECTRIC"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_RAIKOU, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDER, MOVE_CRUNCH, MOVE_ROAR, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3157,7 +2932,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("RAIKOU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -3177,8 +2952,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_RELICANTH, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_ANCIENT_POWER, MOVE_WATER_PULSE, MOVE_MUD_SPORT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .hpEV = 155, .defenseEV = 100, .spDefenseEV = 255, @@ -3192,15 +2965,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x2F, .nickname = _("RELICANTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GOLDUCK, .heldItem = ITEM_LAX_INCENSE, .moves = {MOVE_SURF, MOVE_PSYBEAM, MOVE_BRICK_BREAK, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3213,15 +2984,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GOLDUCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_BLASTOISE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_HYDRO_PUMP, MOVE_BITE, MOVE_MIRROR_COAT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3234,15 +3003,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("BLASTOISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MAGCARGO, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_HEAT_WAVE, MOVE_ROCK_SLIDE, MOVE_PROTECT, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spDefenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -3255,15 +3022,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x93, .nickname = _("MAGCARGO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_RAPIDASH, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_FIRE_BLAST, MOVE_BOUNCE, MOVE_QUICK_ATTACK, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3276,15 +3041,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("RAPIDASH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MOLTRES, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SKY_ATTACK, MOVE_AERIAL_ACE, MOVE_ROAR, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3297,12 +3060,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("MOLTRES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x08, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x08, @@ -3322,9 +3085,9 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF}, - .coords = {COORDS_XY(4,3), COORDS_XY(7,3)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(2, 2), + .trainerCoords = {COORDS_XY(4,3), COORDS_XY(7,3)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(2, 2), } }, [1] = @@ -3349,8 +3112,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_EARTHQUAKE, MOVE_SHADOW_BALL, MOVE_AERIAL_ACE, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -3364,15 +3125,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_REST, MOVE_THUNDER_WAVE, MOVE_FLAMETHROWER, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3386,15 +3145,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -3408,15 +3165,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3430,15 +3185,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_TOXIC, MOVE_PROTECT, MOVE_WILL_O_WISP, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3452,15 +3205,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3474,7 +3225,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -3494,8 +3245,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_STARYU, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_CAMOUFLAGE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3509,15 +3258,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xA, .nickname = _("STARYU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MEOWTH, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PAY_DAY, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3531,15 +3278,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("MEOWTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_BLAZIKEN, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_BLAZE_KICK, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -3553,15 +3298,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("BLAZIKEN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_CUBONE, .heldItem = ITEM_THICK_CLUB, .moves = {MOVE_BONEMERANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .spDefenseEV = 252, @@ -3575,15 +3318,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x16, .nickname = _("CUBONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_BEEDRILL, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_TWINEEDLE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .otId = TRAINER_HILL_OTID, @@ -3596,15 +3337,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("BEEDRILL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_RATICATE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SUPER_FANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3618,12 +3357,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xD, .nickname = _("RATICATE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, @@ -3643,9 +3382,9 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7C1, 0x8AA1, 0x0209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF}, - .coords = {COORDS_XY(9,6), COORDS_XY(13,6)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(9,6), COORDS_XY(13,6)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [2] = @@ -3670,8 +3409,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CHARMELEON, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_FIRE_SPIN, MOVE_DRAGON_RAGE, MOVE_FLAMETHROWER, MOVE_SLASH}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3692,8 +3429,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_WARTORTLE, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_HYDRO_PUMP, MOVE_SKULL_BASH, MOVE_RAIN_DANCE, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .otId = TRAINER_HILL_OTID, @@ -3713,8 +3448,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_IVYSAUR, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_SOLAR_BEAM, MOVE_SYNTHESIS, MOVE_GROWTH, MOVE_SWEET_SCENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -3735,8 +3468,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_BAYLEEF, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_SOLAR_BEAM, MOVE_SAFEGUARD, MOVE_LIGHT_SCREEN, MOVE_BODY_SLAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .attackEV = 130, .spAttackEV = 130, @@ -3757,8 +3488,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CROCONAW, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_SCARY_FACE, MOVE_SLASH, MOVE_HYDRO_PUMP, MOVE_SCREECH}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -3779,8 +3508,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_QUILAVA, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_QUICK_ATTACK, MOVE_FLAMETHROWER, MOVE_FLAME_WHEEL, MOVE_SWIFT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3814,8 +3541,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SMOOCHUM, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_ICE_BEAM, MOVE_PSYCHIC, MOVE_SWEET_KISS, MOVE_FAKE_TEARS}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3836,8 +3561,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_AZURILL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SURF, MOVE_SING, MOVE_RAIN_DANCE, MOVE_BLIZZARD}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3858,8 +3581,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_ELEKID, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_FIRE_PUNCH, MOVE_THUNDER, MOVE_ICE_PUNCH, MOVE_THUNDER_WAVE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3880,8 +3601,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CLEFFA, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_MEGA_KICK, MOVE_SWEET_KISS, MOVE_SING, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -3902,8 +3621,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_WYNAUT, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_ENCORE, MOVE_COUNTER, MOVE_MIRROR_COAT, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -3924,8 +3641,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_MAGBY, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_FIRE_BLAST, MOVE_CONFUSE_RAY, MOVE_THUNDER_PUNCH, MOVE_BARRIER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3944,7 +3659,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x08, @@ -3964,9 +3679,9 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF}, - .coords = {COORDS_XY(6,9), COORDS_XY(8,9)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(1, 1), + .trainerCoords = {COORDS_XY(6,9), COORDS_XY(8,9)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(1, 1), } }, [3] = @@ -3991,8 +3706,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SUDOWOODO, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_ROCK_SLIDE, MOVE_BLOCK, MOVE_TOXIC, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, .hpEV = 100, .attackEV = 255, .spDefenseEV = 155, @@ -4006,15 +3719,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("SUDOWOODO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SLOWKING, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_BLIZZARD, MOVE_DISABLE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -4027,15 +3738,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x8C, .nickname = _("SLOWKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ENTEI, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_FLAMETHROWER, MOVE_CALM_MIND, MOVE_FIRE_SPIN, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4048,15 +3757,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ENTEI"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_HITMONCHAN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEGA_PUNCH, MOVE_DETECT, MOVE_COUNTER, MOVE_SKY_UPPERCUT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -4069,15 +3776,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONCHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MANTINE, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SURF, MOVE_CONFUSE_RAY, MOVE_ATTRACT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -4090,15 +3795,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x6, .nickname = _("MANTINE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ZAPDOS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDERBOLT, MOVE_DRILL_PECK, MOVE_THUNDER_WAVE, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4111,7 +3814,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x18, .nickname = _("ZAPDOS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4131,8 +3834,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_HITMONLEE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEGA_KICK, MOVE_MIND_READER, MOVE_FOCUS_ENERGY, MOVE_HI_JUMP_KICK}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4145,15 +3846,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONLEE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_PORYGON2, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_LOCK_ON, MOVE_BLIZZARD, MOVE_CONVERSION_2, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4166,15 +3865,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("PORYGON2"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_SUICUNE, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_SURF, MOVE_CALM_MIND, MOVE_MIRROR_COAT, MOVE_MIST}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4187,15 +3884,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("SUICUNE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_HOUNDOOM, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_FLAMETHROWER, MOVE_CRUNCH, MOVE_ROAR, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4208,15 +3903,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("HOUNDOOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_STANTLER, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_CONFUSE_RAY, MOVE_SWAGGER, MOVE_PSYCH_UP, MOVE_TAKE_DOWN}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -4229,15 +3922,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("STANTLER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ARTICUNO, .heldItem = ITEM_NEVER_MELT_ICE, .moves = {MOVE_BLIZZARD, MOVE_SHEER_COLD, MOVE_MIST, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4250,12 +3941,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ARTICUNO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0xF1, 0xFB, 0xFB, 0xFB, 0xF9, 0xF9, 0x1B, 0x1C, 0x1D, 0xE5, 0xE6, 0xEE, 0xF5, 0xFB, 0xFB, 0x08, 0xED, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x08, @@ -4275,14 +3966,14 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF}, - .coords = {COORDS_XY(8,2), COORDS_XY(11,5)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(8,2), COORDS_XY(11,5)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; -static const struct TrHillTag sDataTagExpert = +static const struct TrainerHillChallenge sChallenge_Expert = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 1, @@ -4290,7 +3981,7 @@ static const struct TrHillTag sDataTagExpert = .checksum = 0x00061F3F }; -static const struct TrHillFloor sDataTagExpert_Floors[] = { +static const struct TrainerHillFloor sFloors_Expert[] = { [0] = { .trainerNum1 = 57, @@ -4313,8 +4004,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SNORLAX, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .defenseEV = 252, @@ -4328,15 +4017,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x35, .nickname = _("SNORLAX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MILTANK, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_MILK_DRINK}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4350,15 +4037,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("MILTANK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_URSARING, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_DOUBLE_EDGE, MOVE_CRUNCH, MOVE_BRICK_BREAK, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spAttackEV = 6, @@ -4372,15 +4057,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x7F, .nickname = _("URSARING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SLAKING, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_HYPER_BEAM, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .spDefenseEV = 252, @@ -4394,15 +4077,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("SLAKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_KANGASKHAN, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_FAKE_OUT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4416,15 +4097,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("KANGASKHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ZANGOOSE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_CRUSH_CLAW, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4438,7 +4117,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("ZANGOOSE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4458,8 +4137,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SLOWKING, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_ICE_BEAM, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 110, .spAttackEV = 200, @@ -4473,15 +4150,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("SLOWKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ESPEON, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_BITE, MOVE_CALM_MIND, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4495,15 +4170,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("ESPEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4517,15 +4190,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GENGAR, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4539,15 +4210,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_GARDEVOIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_MAGICAL_LEAF, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4561,15 +4230,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GARDEVOIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ALAKAZAM, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_RECOVER, MOVE_THUNDER_WAVE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4583,12 +4250,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, @@ -4608,9 +4275,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x0201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(4,7), COORDS_XY(10,7)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(5, 5), + .trainerCoords = {COORDS_XY(4,7), COORDS_XY(10,7)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(5, 5), } }, [1] = @@ -4635,8 +4302,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SWELLOW, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_AERIAL_ACE, MOVE_AGILITY, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4650,15 +4315,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("SWELLOW"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MACHAMP, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_LOW_KICK, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4672,15 +4335,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("MACHAMP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_URSARING, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PROTECT, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4694,15 +4355,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("URSARING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_KINGLER, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_RETURN, MOVE_PROTECT, MOVE_CRABHAMMER, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4716,15 +4375,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("KINGLER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_TYRANITAR, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_ROCK_SLIDE, MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .defenseEV = 6, @@ -4738,15 +4395,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("TYRANITAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_DRAGONITE, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_BODY_SLAM, MOVE_THUNDER_WAVE, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4760,7 +4415,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("DRAGONITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4780,8 +4435,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_JOLTEON, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4795,15 +4448,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("JOLTEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ALAKAZAM, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_PSYCHIC, MOVE_ICE_PUNCH, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4817,15 +4468,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4839,15 +4488,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xA, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PURSUIT, MOVE_PROTECT, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -4861,15 +4508,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x82, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_NINETALES, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_OVERHEAT, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4883,15 +4528,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xD2, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SHADOW_BALL, MOVE_FAINT_ATTACK, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -4905,12 +4548,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x85, .nickname = _("BANETTE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x08, @@ -4930,9 +4573,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(7,10), COORDS_XY(7,14)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(7,10), COORDS_XY(7,14)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [2] = @@ -4957,8 +4600,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_WOBBUFFET, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MIRROR_COAT, MOVE_COUNTER, MOVE_SAFEGUARD, MOVE_ENCORE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -4972,15 +4613,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x94, .nickname = _("WOBBUFFET"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_EXPLOUD, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_HYPER_VOICE, MOVE_COUNTER, MOVE_REST, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5001,8 +4640,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_CROBAT, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_AERIAL_ACE, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5016,15 +4653,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("CROBAT"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUGTRIO, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DOUBLE_TEAM, MOVE_PROTECT, MOVE_RETURN, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -5038,15 +4673,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xD, .nickname = _("DUGTRIO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_ELECTRODE, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_TORMENT, MOVE_MIRROR_COAT, MOVE_THUNDERBOLT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -5067,8 +4700,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_GENGAR, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_CONFUSE_RAY, MOVE_MEAN_LOOK, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -5082,7 +4713,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x14, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -5102,8 +4733,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_LAPRAS, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_PERISH_SONG, MOVE_SING}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5124,8 +4753,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_ABSOL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PERISH_SONG, MOVE_DOUBLE_EDGE, MOVE_PROTECT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -5146,8 +4773,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_ALTARIA, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_PERISH_SONG, MOVE_PROTECT, MOVE_DRAGON_CLAW, MOVE_FIRE_BLAST}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .spAttackEV = 6, .spDefenseEV = 252, @@ -5168,8 +4793,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_DEWGONG, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_ICE_BEAM, MOVE_SIGNAL_BEAM, MOVE_REST, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -5190,8 +4813,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_POLITOED, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HYDRO_PUMP, MOVE_BLIZZARD, MOVE_MIND_READER, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .spAttackEV = 6, .spDefenseEV = 252, @@ -5212,8 +4833,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_MAROWAK, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PERISH_SONG, MOVE_EARTHQUAKE, MOVE_COUNTER, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spDefenseEV = 252, @@ -5232,7 +4851,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { }, }, }, - .display = { + .map = { .metatileData = { 0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9B, 0x08, 0xD1, 0xDB, 0xDB, 0xDB, 0xD5, 0xD5, 0xC3, 0xF9, 0x86, 0x8E, 0x95, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, @@ -5252,9 +4871,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, }, .collisionData = {0x0381, 0x0201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201}, - .coords = {COORDS_XY(7,6), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(7,6), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [3] = @@ -5279,8 +4898,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_FORRETRESS, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_EXPLOSION, MOVE_EARTHQUAKE, MOVE_ATTRACT, MOVE_SPIKES}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .attackEV = 200, .spDefenseEV = 200, @@ -5294,15 +4911,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("FORRETRESS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ELECTRODE, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_EXPLOSION, MOVE_THUNDERBOLT, MOVE_SWIFT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5315,15 +4930,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xC, .nickname = _("ELECTRODE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_EXEGGUTOR, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_EXPLOSION, MOVE_HYPNOSIS, MOVE_PSYCHIC, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5336,15 +4949,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x7F, .nickname = _("EXEGGUTOR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_ICE_BEAM, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -5358,15 +4969,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x93, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_NINETALES, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_OVERHEAT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5379,15 +4988,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_THUNDERBOLT, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5400,7 +5007,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("BANETTE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -5420,8 +5027,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SALAMENCE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_ROCK_SLIDE, MOVE_FLAMETHROWER, MOVE_DRAGON_CLAW, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5434,15 +5039,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x95, .nickname = _("SALAMENCE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GENGAR, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5455,15 +5058,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GYARADOS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DRAGON_DANCE, MOVE_HYPER_BEAM, MOVE_BITE, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -5476,15 +5077,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("GYARADOS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GENGAR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_EXPLOSION, MOVE_MEAN_LOOK, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -5497,15 +5096,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -5519,15 +5116,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x14, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MISDREAVUS, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_PERISH_SONG, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 180, .defenseEV = 180, .spDefenseEV = 150, @@ -5541,12 +5136,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x85, .nickname = _("MISDREAVUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08, @@ -5566,9 +5161,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08, }, .collisionData = {0x0381, 0x0101, 0x0101, 0x6C1, 0x0821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x0821, 0x6C1, 0x0101, 0x101}, - .coords = {COORDS_XY(7,6), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(7,6), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index c3f17f234a..ac6e0e1e1c 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -57,22 +57,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_TO_HER, EC_WORD_WIN, EC_WORD_JOKING, EC_WORD_HIGHS, EC_WORD_SCARY, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_IGNORANT, EC_WORD_SO, EC_WORD_TODAY, EC_WORD_NIGHTTIME, EC_WORD_YOU_RE, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_SWALOT, .heldItem = ITEM_SHELL_BELL, .moves = { MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_PAIN_SPLIT, MOVE_YAWN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 55, .attackEV = 255, .defenseEV = 100, .speedEV = 0, .spAttackEV = 0, .spDefenseEV = 100, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -82,21 +80,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x80, .nickname = __("マルノーム$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_DUSTOX, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_SILVER_WIND, MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_GIGA_DRAIN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -106,21 +102,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x6, .nickname = __("ドクケイル$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_RELICANTH, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_ANCIENT_POWER, MOVE_SURF, MOVE_EARTHQUAKE, MOVE_AMNESIA }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 155, .spDefenseEV = 255, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -130,7 +124,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x2f, .nickname = __("ジーランス$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -143,22 +137,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL }, .speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_CACTURNE, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_GIGA_DRAIN, MOVE_FAINT_ATTACK, MOVE_THUNDER_PUNCH, MOVE_GROWTH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 55, .attackEV = 0, .defenseEV = 100, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 100, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -168,21 +160,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x8c, .nickname = __("ノクタス$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SWELLOW, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_FACADE, MOVE_AERIAL_ACE, MOVE_QUICK_ATTACK, MOVE_DOUBLE_TEAM }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 0, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -192,21 +182,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("オオスバメ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_WHISCASH, .heldItem = ITEM_CHESTO_BERRY, .moves = { MOVE_SURF, MOVE_EARTHQUAKE, MOVE_AMNESIA, MOVE_REST }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -216,7 +204,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("ナマズン$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -229,22 +217,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_THAT, EC_WORD_ABOVE, EC_WORD_LOST, EC_WORD_STORES, EC_WORD_JOKING, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, EC_EMPTY_WORD }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_DELCATTY, .heldItem = ITEM_LUM_BERRY, .moves = { MOVE_SING, MOVE_BODY_SLAM, MOVE_SHADOW_BALL, MOVE_IRON_TAIL }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 255, .spAttackEV = 0, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -254,21 +240,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x3, .nickname = __("エネコロロ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_ROSELIA, .heldItem = ITEM_LEFTOVERS, .moves = { MOVE_GIGA_DRAIN, MOVE_GRASS_WHISTLE, MOVE_TOXIC, MOVE_LEECH_SEED }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -278,21 +262,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x6, .nickname = __("ロゼリア$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_BEAUTIFLY, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_SILVER_WIND, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_PSYCHIC }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 200, .defenseEV = 0, .speedEV = 0, .spAttackEV = 200, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -302,7 +284,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x6, .nickname = __("アゲハント$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -315,22 +297,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_OUTSIDE, EC_WORD_UNCLE, EC_WORD_SURPRISE, EC_WORD_THESE, EC_WORD_HEY_QUES, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_HE_S, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_CHILDREN, EC_WORD_CAN_T, EC_WORD_EXCL_EXCL }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_MAWILE, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_CRUNCH, MOVE_FLAMETHROWER, MOVE_THUNDER_PUNCH, MOVE_COMET_PUNCH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 0, .defenseEV = 100, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 155, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -340,21 +320,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x0, .nickname = __("クチート$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SHARPEDO, .heldItem = ITEM_SCOPE_LENS, .moves = { MOVE_SURF, MOVE_CRUNCH, MOVE_DOUBLE_EDGE, MOVE_EARTHQUAKE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -364,21 +342,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("サメハダー$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_LUM_BERRY, .moves = { MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_THUNDERBOLT, MOVE_WILL_O_WISP }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -388,7 +364,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ジュペッタ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -447,40 +423,40 @@ static bool32 ValidateTrainerHillChecksum(struct EReaderTrainerHillSet *hillSet) return TRUE; } -static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrHillTag * hillTag) +static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrainerHillChallenge * challenge) { int i; AGB_ASSERT_EX(hillSet->dummy == 0, "cereader_tool.c", 450); AGB_ASSERT_EX(hillSet->id == 0, "cereader_tool.c", 452); - memset(hillTag, 0, SECTOR_SIZE); - hillTag->numTrainers = hillSet->numTrainers; - hillTag->unused1 = GetTrainerHillUnkVal(); - hillTag->numFloors = (hillSet->numTrainers + 1) / TRAINER_HILL_TRAINERS_PER_FLOOR; + memset(challenge, 0, SECTOR_SIZE); + challenge->numTrainers = hillSet->numTrainers; + challenge->unused1 = GetTrainerHillUnkVal(); + challenge->numFloors = (hillSet->numTrainers + 1) / HILL_TRAINERS_PER_FLOOR; for (i = 0; i < hillSet->numTrainers; i++) { if (!(i & 1)) { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].display = hillSet->trainers[i].display; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].map = hillSet->trainers[i].map; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer; } else { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer; } } if (i & 1) { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / TRAINER_HILL_TRAINERS_PER_FLOOR]; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / HILL_TRAINERS_PER_FLOOR]; } - hillTag->checksum = CalcByteArraySum((u8 *)hillTag->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrHillFloor)); - if (TryWriteSpecialSaveSector(SECTOR_ID_TRAINER_HILL, (u8 *)hillTag) != SAVE_STATUS_OK) + challenge->checksum = CalcByteArraySum((u8 *)challenge->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrainerHillFloor)); + if (TryWriteSpecialSaveSector(SECTOR_ID_TRAINER_HILL, (u8 *)challenge) != SAVE_STATUS_OK) return FALSE; return TRUE; diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 39c6202a0f..2deacfc705 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -32,23 +32,21 @@ #include "constants/trainer_hill.h" #include "constants/trainer_types.h" -#define HILL_TAG_NORMAL 0 -#define HILL_TAG_VARIETY 1 -#define HILL_TAG_UNIQUE 2 -#define HILL_TAG_EXPERT 3 - #define HILL_MAX_TIME 215999 // 60 * 60 * 60 - 1 -// EWRAM -struct TrHillStruct2 +struct FloorTrainers { - u8 floorId; - struct TrHillTag tag; - struct TrHillFloor floors[NUM_TRAINER_HILL_FLOORS]; + u8 name[HILL_TRAINERS_PER_FLOOR][HILL_TRAINER_NAME_LENGTH]; + u8 facilityClass[HILL_TRAINERS_PER_FLOOR]; }; -static EWRAM_DATA struct TrHillStruct2 *sHillData = NULL; -static EWRAM_DATA struct TrHillRoomTrainers *sRoomTrainers = NULL; +static EWRAM_DATA struct { + u8 floorId; + struct TrainerHillChallenge challenge; + struct TrainerHillFloor floors[NUM_TRAINER_HILL_FLOORS]; +} *sHillData = NULL; + +static EWRAM_DATA struct FloorTrainers *sFloorTrainers = NULL; EWRAM_DATA u32 *gTrainerHillVBlankCounter = NULL; // This file's functions. @@ -69,7 +67,7 @@ static void GetGameSaved(void); static void SetGameSaved(void); static void ClearGameSaved(void); static void GetChallengeWon(void); -static void TrainerHillSetTag(void); +static void TrainerHillSetMode(void); static void SetUpDataStruct(void); static void FreeDataStruct(void); static void TrainerHillDummy(void); @@ -202,12 +200,12 @@ static const u16 *const *const sPrizeListSets[] = static const u16 sEReader_Pal[] = INCBIN_U16("graphics/trainer_hill/ereader.gbapal"); static const u8 sRecordWinColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; -static const struct TrHillTag *const sDataPerTag[] = +static const struct TrainerHillChallenge *const sChallengeData[NUM_TRAINER_HILL_MODES] = { - &sDataTagNormal, - &sDataTagVariety, - &sDataTagUnique, - &sDataTagExpert, + [HILL_MODE_NORMAL] = &sChallenge_Normal, + [HILL_MODE_VARIETY] = &sChallenge_Variety, + [HILL_MODE_UNIQUE] = &sChallenge_Unique, + [HILL_MODE_EXPERT] = &sChallenge_Expert, }; // Unused. @@ -238,15 +236,15 @@ static void (* const sHillFunctions[])(void) = [TRAINER_HILL_FUNC_SET_GAME_SAVED] = SetGameSaved, [TRAINER_HILL_FUNC_CLEAR_GAME_SAVED] = ClearGameSaved, [TRAINER_HILL_FUNC_GET_WON] = GetChallengeWon, - [TRAINER_HILL_FUNC_SET_TAG] = TrainerHillSetTag, + [TRAINER_HILL_FUNC_SET_MODE] = TrainerHillSetMode, }; -static const u8 *const sTagMatchStrings[] = +static const u8 *const sModeStrings[NUM_TRAINER_HILL_MODES] = { - gText_NormalTagMatch, - gText_VarietyTagMatch, - gText_UniqueTagMatch, - gText_ExpertTagMatch, + [HILL_MODE_NORMAL] = gText_NormalTagMatch, + [HILL_MODE_VARIETY] = gText_VarietyTagMatch, + [HILL_MODE_UNIQUE] = gText_UniqueTagMatch, + [HILL_MODE_EXPERT] = gText_ExpertTagMatch, }; static const struct ObjectEventTemplate sTrainerObjectEventTemplate = @@ -261,18 +259,17 @@ static const struct ObjectEventTemplate sTrainerObjectEventTemplate = static const u32 sNextFloorMapNum[NUM_TRAINER_HILL_FLOORS] = { - MAP_NUM(TRAINER_HILL_2F), - MAP_NUM(TRAINER_HILL_3F), - MAP_NUM(TRAINER_HILL_4F), - MAP_NUM(TRAINER_HILL_ROOF) + [TRAINER_HILL_1F - 1] = MAP_NUM(TRAINER_HILL_2F), + [TRAINER_HILL_2F - 1] = MAP_NUM(TRAINER_HILL_3F), + [TRAINER_HILL_3F - 1] = MAP_NUM(TRAINER_HILL_4F), + [TRAINER_HILL_4F - 1] = MAP_NUM(TRAINER_HILL_ROOF) }; -static const u8 sTrainerPartySlots[][PARTY_SIZE / 2] = +static const u8 sTrainerPartySlots[HILL_TRAINERS_PER_FLOOR][PARTY_SIZE / 2] = { {0, 1, 2}, {3, 4, 5} }; -// code void CallTrainerHillFunction(void) { SetUpDataStruct(); @@ -287,7 +284,7 @@ void ResetTrainerHillResults(void) gSaveBlock2Ptr->frontier.savedGame = 0; gSaveBlock2Ptr->frontier.unk_EF9 = 0; gSaveBlock1Ptr->trainerHill.bestTime = 0; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_TRAINER_HILL_MODES; i++) SetTimerValue(&gSaveBlock1Ptr->trainerHillTimes[i], HILL_MAX_TIME); } @@ -300,7 +297,7 @@ u8 GetTrainerHillOpponentClass(u16 trainerId) { u8 id = trainerId - 1; - return gFacilityClassToTrainerClass[sRoomTrainers->facilityClass[id]]; + return gFacilityClassToTrainerClass[sFloorTrainers->facilityClass[id]]; } void GetTrainerHillTrainerName(u8 *dst, u16 trainerId) @@ -309,7 +306,7 @@ void GetTrainerHillTrainerName(u8 *dst, u16 trainerId) u8 id = trainerId - 1; for (i = 0; i < HILL_TRAINER_NAME_LENGTH; i++) - dst[i] = sRoomTrainers->name[id][i]; + dst[i] = sFloorTrainers->name[id][i]; } u8 GetTrainerHillTrainerFrontSpriteId(u16 trainerId) @@ -329,15 +326,14 @@ void InitTrainerHillBattleStruct(void) s32 i, j; SetUpDataStruct(); - sRoomTrainers = AllocZeroed(sizeof(*sRoomTrainers)); + sFloorTrainers = AllocZeroed(sizeof(*sFloorTrainers)); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { for (j = 0; j < HILL_TRAINER_NAME_LENGTH; j++) - { - sRoomTrainers->name[i][j] = sHillData->floors[sHillData->floorId].trainers[i].name[j]; - } - sRoomTrainers->facilityClass[i] = sHillData->floors[sHillData->floorId].trainers[i].facilityClass; + sFloorTrainers->name[i][j] = sHillData->floors[sHillData->floorId].trainers[i].name[j]; + + sFloorTrainers->facilityClass[i] = sHillData->floors[sHillData->floorId].trainers[i].facilityClass; } SetTrainerHillVBlankCounter(&gSaveBlock1Ptr->trainerHill.timer); FreeDataStruct(); @@ -345,8 +341,7 @@ void InitTrainerHillBattleStruct(void) void FreeTrainerHillBattleStruct(void) { - if (sRoomTrainers != NULL) - FREE_AND_SET_NULL(sRoomTrainers); + TRY_FREE_AND_SET_NULL(sFloorTrainers); } static void SetUpDataStruct(void) @@ -355,15 +350,20 @@ static void SetUpDataStruct(void) { sHillData = AllocZeroed(sizeof(*sHillData)); sHillData->floorId = gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; - CpuCopy32(sDataPerTag[gSaveBlock1Ptr->trainerHill.tag], &sHillData->tag, sizeof(sHillData->tag) + 4 * sizeof(struct TrHillFloor)); + + // This copy depends on the floor data for each challenge being directly after the + // challenge header data, and for the field 'floors' in sHillData to come directly + // after the field 'challenge'. + // e.g. for HILL_MODE_NORMAL, it will copy sChallenge_Normal to sHillData->challenge and + // it will copy sFloors_Normal to sHillData->floors + CpuCopy32(sChallengeData[gSaveBlock1Ptr->trainerHill.mode], &sHillData->challenge, sizeof(sHillData->challenge) + sizeof(sHillData->floors)); TrainerHillDummy(); } } static void FreeDataStruct(void) { - if (sHillData != NULL) - FREE_AND_SET_NULL(sHillData); + TRY_FREE_AND_SET_NULL(sHillData); } void CopyTrainerHillTrainerText(u8 which, u16 trainerId) @@ -428,7 +428,7 @@ static void GiveChallengePrize(void) { u16 itemId = GetPrizeItemId(); - if (sHillData->tag.numFloors != NUM_TRAINER_HILL_FLOORS || gSaveBlock1Ptr->trainerHill.receivedPrize) + if (sHillData->challenge.numFloors != NUM_TRAINER_HILL_FLOORS || gSaveBlock1Ptr->trainerHill.receivedPrize) { gSpecialVar_Result = 2; } @@ -456,7 +456,7 @@ static void CheckFinalTime(void) else if (GetTimerValue(&gSaveBlock1Ptr->trainerHill.bestTime) > gSaveBlock1Ptr->trainerHill.timer) { SetTimerValue(&gSaveBlock1Ptr->trainerHill.bestTime, gSaveBlock1Ptr->trainerHill.timer); - gSaveBlock1Ptr->trainerHillTimes[gSaveBlock1Ptr->trainerHill.tag] = gSaveBlock1Ptr->trainerHill.bestTime; + gSaveBlock1Ptr->trainerHillTimes[gSaveBlock1Ptr->trainerHill.mode] = gSaveBlock1Ptr->trainerHill.bestTime; gSpecialVar_Result = 0; } else @@ -529,9 +529,9 @@ static void BufferChallengeTime(void) static void GetAllFloorsUsed(void) { SetUpDataStruct(); - if (sHillData->tag.numFloors != NUM_TRAINER_HILL_FLOORS) + if (sHillData->challenge.numFloors != NUM_TRAINER_HILL_FLOORS) { - ConvertIntToDecimalStringN(gStringVar1, sHillData->tag.numFloors, STR_CONV_MODE_LEFT_ALIGN, 1); + ConvertIntToDecimalStringN(gStringVar1, sHillData->challenge.numFloors, STR_CONV_MODE_LEFT_ALIGN, 1); gSpecialVar_Result = FALSE; } else @@ -592,9 +592,9 @@ void PrintOnTrainerHillRecordsWindow(void) AddTextPrinterParameterized3(0, FONT_NORMAL, x, 2, sRecordWinColors, TEXT_SKIP_DRAW, gText_TimeBoard); y = 18; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_TRAINER_HILL_MODES; i++) { - AddTextPrinterParameterized3(0, FONT_NORMAL, 0, y, sRecordWinColors, TEXT_SKIP_DRAW, sTagMatchStrings[i]); + AddTextPrinterParameterized3(0, FONT_NORMAL, 0, y, sRecordWinColors, TEXT_SKIP_DRAW, sModeStrings[i]); y += 15; total = GetTimerValue(&gSaveBlock1Ptr->trainerHillTimes[i]); minutes = total / (60 * 60); @@ -637,23 +637,23 @@ void LoadTrainerHillObjectEventTemplates(void) return; SetUpDataStruct(); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; CpuFill32(0, gSaveBlock1Ptr->objectEventTemplates, sizeof(gSaveBlock1Ptr->objectEventTemplates)); floorId = GetFloorId(); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { u8 bits; eventTemplates[i] = sTrainerObjectEventTemplate; eventTemplates[i].localId = i + 1; eventTemplates[i].graphicsId = FacilityClassToGraphicsId(sHillData->floors[floorId].trainers[i].facilityClass); - eventTemplates[i].x = sHillData->floors[floorId].display.coords[i] & 0xF; - eventTemplates[i].y = ((sHillData->floors[floorId].display.coords[i] >> 4) & 0xF) + 5; + eventTemplates[i].x = sHillData->floors[floorId].map.trainerCoords[i] & 0xF; + eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + 5; bits = i << 2; - eventTemplates[i].movementType = ((sHillData->floors[floorId].display.direction >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; - eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].display.range >> bits) & 0xF; + eventTemplates[i].movementType = ((sHillData->floors[floorId].map.trainerDirections >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; + eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].map.trainerRanges >> bits) & 0xF; eventTemplates[i].script = TrainerHill_EventScript_TrainerBattle; gSaveBlock2Ptr->frontier.trainerIds[i] = i + 1; } @@ -669,14 +669,14 @@ bool32 LoadTrainerHillFloorObjectEventScripts(void) return TRUE; } -static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride is always 16 +static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 floorWidth) // floorWidth is always 16 { bool8 impassable; u16 metatile; u16 elevation; - impassable = (sHillData->floors[floorId].display.collisionData[y] >> (15 - x) & 1); - metatile = sHillData->floors[floorId].display.metatileData[stride * y + x] + NUM_METATILES_IN_PRIMARY; + impassable = (sHillData->floors[floorId].map.collisionData[y] >> (15 - x) & 1); + metatile = sHillData->floors[floorId].map.metatileData[floorWidth * y + x] + NUM_METATILES_IN_PRIMARY; elevation = 3 << MAPGRID_ELEVATION_SHIFT; return ((impassable << MAPGRID_COLLISION_SHIFT) & MAPGRID_COLLISION_MASK) | elevation | (metatile & MAPGRID_METATILE_ID_MASK); @@ -684,7 +684,7 @@ static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride i void GenerateTrainerHillFloorLayout(u16 *mapArg) { - s32 i, j; + s32 y, x; u16 *src, *dst; u8 mapId = GetCurrentTrainerHillMapId(); @@ -705,24 +705,25 @@ void GenerateTrainerHillFloorLayout(u16 *mapArg) mapId = GetFloorId(); src = gMapHeader.mapLayout->map; gBackupMapLayout.map = mapArg; - gBackupMapLayout.width = 31; - gBackupMapLayout.height = 35; + // Dimensions include border area loaded beyond map + gBackupMapLayout.width = HILL_FLOOR_WIDTH + 15; + gBackupMapLayout.height = HILL_FLOOR_HEIGHT + 14; dst = mapArg + 224; // First 5 rows of the map (Entrance / Exit) are always the same - for (i = 0; i < 5; i++) + for (y = 0; y < HILL_FLOOR_HEIGHT_MARGIN; y++) { - for (j = 0; j < 16; j++) - dst[j] = src[j]; + for (x = 0; x < HILL_FLOOR_WIDTH; x++) + dst[x] = src[x]; dst += 31; src += 16; } // Load the 16x16 floor-specific layout - for (i = 0; i < 16; i++) + for (y = 0; y < HILL_FLOOR_HEIGHT_MAIN; y++) { - for (j = 0; j < 16; j++) - dst[j] = GetMetatileForFloor(mapId, j, i, 16); + for (x = 0; x < HILL_FLOOR_WIDTH; x++) + dst[x] = GetMetatileForFloor(mapId, x, y, HILL_FLOOR_WIDTH); dst += 31; } @@ -812,8 +813,8 @@ u16 LocalIdToHillTrainerId(u8 localId) bool8 GetHillTrainerFlag(u8 objectEventId) { - u32 floorId = GetFloorId() * 2; - u8 bitId = gObjectEvents[objectEventId].localId - 1 + floorId; + u32 trainerIndexStart = GetFloorId() * HILL_TRAINERS_PER_FLOOR; + u8 bitId = gObjectEvents[objectEventId].localId - 1 + trainerIndexStart; return gSaveBlock2Ptr->frontier.trainerFlags & gBitTable[bitId]; } @@ -821,24 +822,24 @@ bool8 GetHillTrainerFlag(u8 objectEventId) void SetHillTrainerFlag(void) { u8 i; - u8 floorId = GetFloorId() * 2; + u8 trainerIndexStart = GetFloorId() * HILL_TRAINERS_PER_FLOOR; - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_A) { - gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[floorId + i]; + gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[trainerIndexStart + i]; break; } } if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) { - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_B) { - gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[floorId + i]; + gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[trainerIndexStart + i]; break; } } @@ -861,14 +862,14 @@ static void CreateNPCTrainerHillParty(u16 trainerId, u8 firstMonId) u8 trId, level; s32 i, floorId, partySlot; - if (trainerId == 0 || trainerId > 2) + if (trainerId == 0 || trainerId > HILL_TRAINERS_PER_FLOOR) return; trId = trainerId - 1; SetUpDataStruct(); level = GetHighestLevelInPlayerParty(); floorId = GetFloorId(); - for (i = firstMonId, partySlot = 0; i < firstMonId + 3; i++, partySlot++) + for (i = firstMonId, partySlot = 0; i < firstMonId + PARTY_SIZE / 2; i++, partySlot++) { u8 id = sTrainerPartySlots[trId][partySlot]; struct Pokemon *mon = &gEnemyParty[i]; @@ -890,7 +891,7 @@ void FillHillTrainersParties(void) { ZeroEnemyPartyMons(); CreateNPCTrainerHillParty(gTrainerBattleOpponent_A, 0); - CreateNPCTrainerHillParty(gTrainerBattleOpponent_B, 3); + CreateNPCTrainerHillParty(gTrainerBattleOpponent_B, PARTY_SIZE / 2); } // This function is unused, but my best guess is @@ -935,7 +936,7 @@ u8 GetNumFloorsInTrainerHillChallenge(void) u8 floors; SetUpDataStruct(); - floors = sHillData->tag.numFloors; + floors = sHillData->challenge.numFloors; FreeDataStruct(); return floors; @@ -989,9 +990,9 @@ static void GetChallengeWon(void) gSpecialVar_Result = TRUE; } -static void TrainerHillSetTag(void) +static void TrainerHillSetMode(void) { - gSaveBlock1Ptr->trainerHill.tag = gSpecialVar_0x8005; + gSaveBlock1Ptr->trainerHill.mode = gSpecialVar_0x8005; gSaveBlock1Ptr->trainerHill.bestTime = gSaveBlock1Ptr->trainerHillTimes[gSpecialVar_0x8005]; } @@ -1030,12 +1031,12 @@ static u16 GetPrizeItemId(void) prizeListSetId = var / 256; prizeListSetId %= 2; - if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->tag.numTrainers == NUM_TRAINER_HILL_TRAINERS) + if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->challenge.numTrainers == NUM_TRAINER_HILL_TRAINERS) i = GetPrizeListId(TRUE); else i = GetPrizeListId(FALSE); - if (gSaveBlock1Ptr->trainerHill.tag == HILL_TAG_EXPERT) + if (gSaveBlock1Ptr->trainerHill.mode == HILL_MODE_EXPERT) i = (i + 1) % NUM_TRAINER_HILL_PRIZE_LISTS; prizeList = sPrizeListSets[prizeListSetId][i]; From 328b925a08c3dfc47ebd49b7b8f9db2822790e34 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 31 Mar 2022 13:11:44 -0400 Subject: [PATCH 04/22] Move trainer hill map data to bin files --- .../maps_expert/floor_0/collision.bin | Bin 0 -> 32 bytes .../maps_expert/floor_0/metatiles.bin | 1 + .../maps_expert/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_expert/floor_1/metatiles.bin | 1 + .../maps_expert/floor_2/collision.bin | 1 + .../maps_expert/floor_2/metatiles.bin | 1 + .../maps_expert/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_expert/floor_3/metatiles.bin | 1 + .../maps_jp/floor_0/collision.bin | 1 + .../maps_jp/floor_0/metatiles.bin | 1 + .../maps_jp/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_jp/floor_1/metatiles.bin | 1 + .../maps_normal/floor_0/collision.bin | 1 + .../maps_normal/floor_0/metatiles.bin | 1 + .../maps_normal/floor_1/collision.bin | 1 + .../maps_normal/floor_1/metatiles.bin | 1 + .../maps_normal/floor_2/collision.bin | Bin 0 -> 32 bytes .../maps_normal/floor_2/metatiles.bin | 1 + .../maps_normal/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_normal/floor_3/metatiles.bin | 1 + .../maps_unique/floor_0/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_0/metatiles.bin | 1 + .../maps_unique/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_1/metatiles.bin | 1 + .../maps_unique/floor_2/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_2/metatiles.bin | 1 + .../maps_unique/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_3/metatiles.bin | 1 + .../maps_variety/floor_0/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_0/metatiles.bin | 1 + .../maps_variety/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_1/metatiles.bin | 1 + .../maps_variety/floor_2/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_2/metatiles.bin | 1 + .../maps_variety/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_3/metatiles.bin | 1 + include/trainer_hill.h | 2 +- src/data/battle_frontier/trainer_hill.h | 432 ++---------------- 38 files changed, 63 insertions(+), 393 deletions(-) create mode 100755 graphics/trainer_hill/maps_expert/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_3/metatiles.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_3/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_3/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_3/metatiles.bin diff --git a/graphics/trainer_hill/maps_expert/floor_0/collision.bin b/graphics/trainer_hill/maps_expert/floor_0/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..ca6e4ca28beaf070d34dedbd697149620da6ea68 GIT binary patch literal 32 ecmZo0f}Z{gu?&-0mT0byZ`_I literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin new file mode 100755 index 0000000000..a89a14c69e --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;FFFFFFFFFFFFFxF|}|{zF}FFFFFFFFFFFFF~}~FFFFFFFFFFFFFF}|{z|FFFFFFFFFFFFFF|}~}~FFFFFFFFFFFFF֖֖֛֖֖֖֖֖֖֖֛ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_2/collision.bin b/graphics/trainer_hill/maps_expert/floor_2/collision.bin new file mode 100755 index 0000000000..891a7f2c1d --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_2/collision.bin @@ -0,0 +1 @@ +>>}~=x=x}~y>> \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin new file mode 100755 index 0000000000..7164f059d1 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_3/collision.bin b/graphics/trainer_hill/maps_expert/floor_3/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..3d25428f1569114f61521dfb75a0b10efeaee5ba GIT binary patch literal 32 kcmZoFHg#WXcI6&M*f6*M(2iYam&WCO_n09tVcFaQ7m literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin new file mode 100755 index 0000000000..f2200b7135 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin @@ -0,0 +1 @@ +1;;;9999:;;;FFFFFFF6666FFFFFFFF6FۛF6FF6ۛ6F֖ۛF6ۛ6FF6FۛF6FFFFFFFF6666FFFFFFF \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_0/collision.bin b/graphics/trainer_hill/maps_jp/floor_0/collision.bin new file mode 100755 index 0000000000..817f4f54ca --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_0/collision.bin @@ -0,0 +1 @@ +oAcA`ADAUAU \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin b/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin new file mode 100755 index 0000000000..8d1787efdf --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin @@ -0,0 +1 @@ +155;&&%9:;;;1++;44++43????;1++;;;44;3???;;1++55555;3???;?1+444+44;,???;;1+;5;+;5;5;???;1+;+;+;+;+;???;14;+;4;+5+;;?;;1;;4;;;444?;;;? \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_1/collision.bin b/graphics/trainer_hill/maps_jp/floor_1/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..58f80b49bb1ab2c9e27f9e8c19f3cfa17b6dcdfe GIT binary patch literal 32 bcmZo?HC#Uv;AiWLNEXT<6#hZ literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin b/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin new file mode 100755 index 0000000000..9517237925 --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;5;9&%9:;5;1;+;;+++++;;;+;1;+;;+++++>>;+;1;+;;+++++;;;+;?;+;;+++++;>>+;1;+;;++,++;;;+;1?+;;,,;,,>>;+;1;+5555;55555+;?;,,,,,;,,,,,,;1;??;55;55555551???;++5+++++++1??;;++++++++++1;;;?,,,,,,,,,, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_0/collision.bin b/graphics/trainer_hill/maps_normal/floor_0/collision.bin new file mode 100755 index 0000000000..80213aaaeb --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_0/collision.bin @@ -0,0 +1 @@ +?%!~A } Ay \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin new file mode 100755 index 0000000000..658a5ace61 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin @@ -0,0 +1 @@ +1;55&&%&:;5;1;,,,+$$$$,;;,;-;;;;+;;;;5;55;3;2!0+;2!0+;,+;35;;;,5;;;+;;+;4,;2!0+20;+20,;15;;5;,;;5,;;551,20+205;+2!0,,15;;+;;+;,;5;;;1,20+20+;20+20;1555+;;+;;5+;551+,,,20+20,,;,,1+;;5;;+;;5;;;;1,20+;;,20,20;51;;;,;;;;;;;;;, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_1/collision.bin b/graphics/trainer_hill/maps_normal/floor_1/collision.bin new file mode 100755 index 0000000000..fb3f6aec00 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_1/collision.bin @@ -0,0 +1 @@ +s @ @QSQQQQQPP \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin new file mode 100755 index 0000000000..52af9cfdcb --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin @@ -0,0 +1 @@ +˛ۛۛۛ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_2/collision.bin b/graphics/trainer_hill/maps_normal/floor_2/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..b3ccacdd4c25fee4cf227fac1346ee02b189d8c2 GIT binary patch literal 32 acmZoeskKr|x*BLe_r>jg#t literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin new file mode 100755 index 0000000000..bf2b52c32d --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin @@ -0,0 +1 @@ +1555&&8&.55;icddddqqqrdddcsicssssssssssscsicssssssssssscsicCA@ABAAJBAAcsicsssssssdssscsicACKCCABB@A@csicssdsssssssscsicA@BBAABJBABcsicsssssssdssscsicABACKAAA@CAcsicssssdsssssscsicA@CABBAJBABcsidsssssssdsssdsiCCABBACAA@BABsiBsssssssssssBs \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_3/collision.bin b/graphics/trainer_hill/maps_normal/floor_3/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..f4c47254c56adb7e19d0d6ed491a13178b73c526 GIT binary patch literal 32 ncmZoUbL@H$@m!0ULkk4!I2@pp3%k8wKCK(G#-c@Lu*4B1sMhZ{|5lD4+_)( literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin b/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin new file mode 100755 index 0000000000..66840137c3 --- /dev/null +++ b/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_0/collision.bin b/graphics/trainer_hill/maps_variety/floor_0/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..24fc2ea1e6b203d760a554f6b02de209bdeadb1e GIT binary patch literal 32 McmZo+m literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin b/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin new file mode 100755 index 0000000000..c5a9aa5d4e --- /dev/null +++ b/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;@@@@@@@B@BBBBBBBBBBBBBBBBBAB֖AB֖@֜ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_2/collision.bin b/graphics/trainer_hill/maps_variety/floor_2/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..606249b2a0085c18fc9fea19f02a98713c93233a GIT binary patch literal 32 RcmZo Date: Fri, 1 Apr 2022 01:21:00 -0400 Subject: [PATCH 05/22] Document trainer hill prize selection --- src/trainer_hill.c | 60 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 2deacfc705..dad6b97ea3 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -996,10 +996,14 @@ static void TrainerHillSetMode(void) gSaveBlock1Ptr->trainerHill.bestTime = gSaveBlock1Ptr->trainerHillTimes[gSpecialVar_0x8005]; } -static u8 GetPrizeListId(bool8 maxTrainers) +// Determines which prize list to use from the set of prize lists. +static u8 GetPrizeListId(bool8 allowTMs) { u8 prizeListId, i, modBy; + // The initial selection depends on the trainer numbers for the completed challenge. + // These don't change with the available challenge modes, so Normal/Unique will always + // have a prizeListId of 8, and Variety/Expert will have a prizeListId of 24. prizeListId = 0; for (i = 0; i < NUM_TRAINER_HILL_FLOORS; i++) { @@ -1007,8 +1011,10 @@ static u8 GetPrizeListId(bool8 maxTrainers) prizeListId ^= sHillData->floors[i].trainerNum2 & 0x1F; } - // Not possible to win TMs with fewer than 8 trainers - if (maxTrainers) + // In practice, the conditional below is always true. + // The 2nd half of the lists in both sets of lists all have a TM as the "grand prize", while the 1st half do not, + // so taking the mod of the (total / 2) ensures that a prize list without a TM will be used. + if (allowTMs) modBy = NUM_TRAINER_HILL_PRIZE_LISTS; else modBy = NUM_TRAINER_HILL_PRIZE_LISTS / 2; @@ -1021,38 +1027,64 @@ static u16 GetPrizeItemId(void) { u8 i; const u16 *prizeList; - s32 var = 0, prizeListSetId, minutes, id; + s32 trainerNumSum = 0, prizeListSetId, minutes, id; + // First determine which set of prize lists to use. The sets of lists only differ in + // what TMs they can offer as the "grand prize" for a time under 12 minutes. + // Which set of lists gets used is based on the sum of all the trainer numbers for that + // challenge. These don't change with the available challenge modes, so Normal will always + // have a prizeListSetId of 0, and Unique/Variety/Expert will have a prizeListSetId of 1. for (i = 0; i < NUM_TRAINER_HILL_FLOORS; i++) { - var += sHillData->floors[i].trainerNum1; - var += sHillData->floors[i].trainerNum2; + trainerNumSum += sHillData->floors[i].trainerNum1; + trainerNumSum += sHillData->floors[i].trainerNum2; } + prizeListSetId = trainerNumSum / 256; + prizeListSetId %= (int)ARRAY_COUNT(sPrizeListSets); - prizeListSetId = var / 256; - prizeListSetId %= 2; + // Now get which prize list to use from the set. See GetPrizeListId for details. + // The below conditional will always be true, because a Trainer Hill challenge can't be entered + // until the player has entered the Hall of Fame (FLAG_SYS_GAME_CLEAR is set) and because all + // of the available challenge modes have the full 8 trainers (NUM_TRAINER_HILL_TRAINERS). if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->challenge.numTrainers == NUM_TRAINER_HILL_TRAINERS) i = GetPrizeListId(TRUE); else i = GetPrizeListId(FALSE); + // 1 is added to Expert mode's prize list selection because otherwise it has the same prizes as Variety if (gSaveBlock1Ptr->trainerHill.mode == HILL_MODE_EXPERT) i = (i + 1) % NUM_TRAINER_HILL_PRIZE_LISTS; + // After the above (non-random) calculations, the following are the possible prize list selections: + // sPrizeListSets[0][8] (Normal) + // sPrizeListSets[1][4] (Variety) + // sPrizeListSets[1][8] (Unique) + // sPrizeListSets[1][5] (Expert) prizeList = sPrizeListSets[prizeListSetId][i]; + + // Which prize is given from the list depends on the time scored. + // The prize for any time after 12 minutes is the same in every list. + // The prizes for a time under 12 minutes are: + // - ITEM_TM11_SUNNY_DAY (Normal) + // - ITEM_ELIXIR (Variety) + // - ITEM_TM19_GIGA_DRAIN (Unique) + // - ITEM_TM31_BRICK_BREAK (Expert) + // As an additional note, if players were allowed to enter a Trainer Hill challenge before + // entering the Hall of Fame, there would be 1 additional prize possibility (ITEM_MAX_ETHER) + // as Normal / Unique modes would use sPrizeListSets[0][3] / sPrizeListSets[1][3] respectively. minutes = (signed)(gSaveBlock1Ptr->trainerHill.timer) / (60 * 60); if (minutes < 12) - id = 0; + id = 0; // Depends on list else if (minutes < 13) - id = 1; + id = 1; // ITEM_ETHER else if (minutes < 14) - id = 2; + id = 2; // ITEM_MAX_POTION else if (minutes < 16) - id = 3; + id = 3; // ITEM_REVIVE else if (minutes < 18) - id = 4; + id = 4; // ITEM_FLUFFY_TAIL else - id = 5; + id = 5; // ITEM_GREAT_BALL return prizeList[id]; } From 59cff2190d44edf9e64c1d8c4cfd5931b2354aaf Mon Sep 17 00:00:00 2001 From: sbird Date: Sat, 16 Apr 2022 19:03:20 +0200 Subject: [PATCH 06/22] fix building without NDEBUG on agbcc --- ld_script.txt | 43 ++++++++++++++++++++++++++++++++++++++++--- src/libisagbprn.c | 10 +++++----- src/mystery_gift.c | 4 ++++ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/ld_script.txt b/ld_script.txt index d68498a8ba..1460c84435 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -20,7 +20,9 @@ SECTIONS { . = 0x1C000; INCLUDE "sym_ewram.ld" - + *libc.a:impure.o(.data); + *libc.a:locale.o(.data); + *libc.a:mallocr.o(.data); . = 0x40000; } @@ -462,6 +464,7 @@ SECTIONS { src/mystery_gift_server.o(.rodata); src/mystery_gift_client.o(.rodata); src/mystery_gift_scripts.o(.rodata); + src/wonder_news.o(.rodata); src/union_room_chat.o(.rodata); src/berry_crush.o(.rodata); src/berry_powder.o(.rodata); @@ -1245,9 +1248,43 @@ SECTIONS { src/librfu_sio32id.o(.rodata); *libgcc.a:_divdi3.o(.rodata); *libgcc.a:_udivdi3.o(.rodata); - *libc.a(.rodata); - *libc.a(.data); + *libc.a:memcpy.o(.rodata); + *libc.a:memset.o(.rodata); + *libc.a:strcmp.o(.rodata); + *libc.a:strcpy.o(.rodata); + *libc.a:impure.o(.rodata); + *libc.a:vsprintf.o(.rodata); + *libc.a:vfprintf.o(.rodata); + *libc.a:wsetup.o(.rodata); + *libc.a:dtoa.o(.rodata); + *libc.a:fflush.o(.rodata); + *libc.a:findfp.o(.rodata); + *libc.a:freer.o(.rodata); + *libc.a:mtrim.o(.rodata); + *libc.a:fvwrite.o(.rodata); + *libc.a:fwalk.o(.rodata); + *libc.a:locale.o(.rodata); + *libc.a:makebuf.o(.rodata); + *libc.a:mallocr.o(.rodata); + *libc.a:mbtowc_r.o(.rodata); + *libc.a:memchr.o(.rodata); + *libc.a:memmove.o(.rodata); + *libc.a:mlock.o(.rodata); + *libc.a:mprec.o(.rodata); + *libc.a:s_isinf.o(.rodata); + *libc.a:s_isnan.o(.rodata); + *libc.a:sbrkr.o(.rodata); + *libc.a:stdio.o(.rodata); + *libc.a:strlen.o(.rodata); *libc.a:syscalls.o(.rodata); + *libc.a:writer.o(.rodata); + *libc.a:callocr.o(.rodata); + *libc.a:closer.o(.rodata); + *libc.a:errno.o(.rodata); + *libc.a:fstatr.o(.rodata); + *libc.a:libcfunc.o(.rodata); + *libc.a:lseekr.o(.rodata); + *libc.a:readr.o(.rodata); src/libisagbprn.o(.rodata); } =0 diff --git a/src/libisagbprn.c b/src/libisagbprn.c index 69c6986aef..7a70cf41fa 100644 --- a/src/libisagbprn.c +++ b/src/libisagbprn.c @@ -31,7 +31,7 @@ void AGBPrintFlush1Block(void); void AGBPrintInit(void) { volatile struct AGBPrintStruct *pPrint = (struct AGBPrintStruct *)AGB_PRINT_STRUCT_ADDR; - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 *pProtect = (u16 *)AGB_PRINT_PROTECT_ADDR; u16 nOldWSCNT = *pWSCNT; *pWSCNT = WSCNT_DATA; @@ -57,7 +57,7 @@ static void AGBPutcInternal(const char cChr) void AGBPutc(const char cChr) { - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 nOldWSCNT = *pWSCNT; volatile struct AGBPrintStruct *pPrint; *pWSCNT = WSCNT_DATA; @@ -71,7 +71,7 @@ void AGBPutc(const char cChr) void AGBPrint(const char *pBuf) { volatile struct AGBPrintStruct *pPrint = (struct AGBPrintStruct *)AGB_PRINT_STRUCT_ADDR; - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 nOldWSCNT = *pWSCNT; *pWSCNT = WSCNT_DATA; while (*pBuf) @@ -95,9 +95,9 @@ void AGBPrintf(const char *pBuf, ...) static void AGBPrintTransferDataInternal(u32 bAllData) { LPFN_PRINT_FLUSH lpfnFuncFlush; - u16 *pIME; + vu16 *pIME; u16 nIME; - u16 *pWSCNT; + vu16 *pWSCNT; u16 nOldWSCNT; u16 *pProtect; volatile struct AGBPrintStruct *pPrint; diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 1df6533d96..72fc2b3774 100755 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -506,9 +506,13 @@ static void IncrementCardStat(u32 statType) } if (stat == NULL) + { AGB_ASSERT(0); + } else if (++(*stat) > MAX_WONDER_CARD_STAT) + { *stat = MAX_WONDER_CARD_STAT; + } } } From 0bda107188b5623f34d95214fae1c715b757ec7f Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Wed, 20 Apr 2022 01:07:10 -0400 Subject: [PATCH 07/22] don't build modern with -g by default --- INSTALL.md | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index f6434c07be..72f3c92f3f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -457,6 +457,7 @@ To build **pokeemerald.elf** with enhanced debug info: ```bash make DINFO=1 ``` +Note that this is only necessary for the `modern` target; the regular target has debug info enabled by default. ## devkitARM's C compiler diff --git a/Makefile b/Makefile index 6283a87fe3..c36cc8e936 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,7 @@ LIBPATH := -L ../../tools/agbcc/lib LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" From 2b223acd876169cd8f90f8f5723f28aaaa32f373 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Apr 2022 21:44:11 -0400 Subject: [PATCH 08/22] Fix math in CreateBerrySprite --- src/berry_blender.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/berry_blender.c b/src/berry_blender.c index 27ea641ce1..9b74c7bab6 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1188,9 +1188,9 @@ static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSp #undef sXSpeed #undef sYDownSpeed -static void CreateBerrySprite(u16 a0, u8 playerId) +static void CreateBerrySprite(u16 itemId, u8 playerId) { - u8 spriteId = CreateSpinningBerrySprite(a0 + FIRST_BERRY_INDEX - 10, 0, 80, playerId & 1); + u8 spriteId = CreateSpinningBerrySprite(ITEM_TO_BERRY(itemId) - 1, 0, 80, playerId & 1); SetBerrySpriteData(&gSprites[spriteId], sBerrySpriteData[playerId][0], sBerrySpriteData[playerId][1], From 1c13335d16f610d2c3881effb7eddf3fefd5d894 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 12 May 2022 22:05:44 -0400 Subject: [PATCH 09/22] Update INSTALL.md --- INSTALL.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 72f3c92f3f..42d8a75ec8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -451,14 +451,6 @@ Replace `` with the number that the `nproc` command returned. `nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)). -## Debug info - -To build **pokeemerald.elf** with enhanced debug info: -```bash -make DINFO=1 -``` -Note that this is only necessary for the `modern` target; the regular target has debug info enabled by default. - ## devkitARM's C compiler This project supports the `arm-none-eabi-gcc` compiler included with devkitARM. If devkitARM (a.k.a. gba-dev) has already been installed as part of the platform-specific instructions, simply run: @@ -535,7 +527,7 @@ devkitARM is now installed. devkitARM is now installed. -## Installing devkitARM on Arch Linux +### Installing devkitARM on Arch Linux 1. Follow [devkitPro's instructions](https://devkitpro.org/wiki/devkitPro_pacman#Customising_Existing_Pacman_Install) to configure `pacman` to download devkitPro packages. 2. Install `gba-dev`: run the following command as root. @@ -553,7 +545,7 @@ devkitARM is now installed. devkitARM is now installed. -## Other toolchains +### Other toolchains To build using a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain, which must contain the subdirectory `bin`. ```bash @@ -565,6 +557,14 @@ make TOOLCHAIN="/usr/local/arm-none-eabi" ``` To compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present. +### Building with debug info under a modern toolchain + +To build **pokeemerald.elf** with debug symbols under a modern toolchain: +```bash +make DINFO=1 +``` +Note that this is not necessary for a non-modern build since those are built with debug symbols by default. + # Useful additional tools * [porymap](https://github.com/huderlem/porymap) for viewing and editing maps From 7d224197c05fb319c03d2bcbed3ed36d6f246fd8 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 12 May 2022 22:33:17 -0400 Subject: [PATCH 10/22] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 42d8a75ec8..7f1d47879f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -561,7 +561,7 @@ To compile the `modern` target with this toolchain, the subdirectories `lib`, `i To build **pokeemerald.elf** with debug symbols under a modern toolchain: ```bash -make DINFO=1 +make modern DINFO=1 ``` Note that this is not necessary for a non-modern build since those are built with debug symbols by default. From 577791a6bc203e0ce5c8e564b88d9c7a5040f4cc Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 13 May 2022 10:52:09 -0300 Subject: [PATCH 11/22] Moved order of defined header files in include/global.h --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/global.h b/include/global.h index ddd77ac9ba..e1d19cdec1 100644 --- a/include/global.h +++ b/include/global.h @@ -14,8 +14,8 @@ #include "constants/maps.h" #include "constants/pokemon.h" #include "constants/easy_chat.h" -#include "constants/expansion_branches.h" #include "constants/trainer_hill.h" +#include "constants/expansion_branches.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); From 307d5d93c4bbf2d1f6a624761a53ceae8d8d32b5 Mon Sep 17 00:00:00 2001 From: hamish Date: Mon, 23 May 2022 08:53:08 -0400 Subject: [PATCH 12/22] add potlergeist animation --- data/battle_anim_scripts.s | 37 +++++++++++++- .../battle_anims/sprites/new/poltergeist.pal | 19 +++++++ include/constants/battle_anim.h | 1 + include/graphics.h | 1 + src/battle_anim_ghost.c | 49 ++++++++++++++++++- src/battle_script_commands.c | 1 + src/data/battle_anim.h | 2 + src/graphics.c | 2 + 8 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 graphics/battle_anims/sprites/new/poltergeist.pal diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d76aff05a6..f1ef78fe08 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -14193,7 +14193,42 @@ Move_LASH_OUT:: end @to do: Move_POLTERGEIST:: - end @to do: + loadspritegfx ANIM_TAG_EYE_SPARKLE + loadspritegfx ANIM_TAG_WHITE_SHADOW @Destiny Bond + loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @Black Colour + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_POLTERGEIST + fadetobg BG_NIGHTMARE + waitbgfadein + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 0, 16, RGB_BLACK + waitforvisualfinish + createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 + createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + waitforvisualfinish + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 16, 0, RGB_BLACK + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + delay 0x1 + launchtask AnimTask_DestinyBondWhiteShadow 0x5 0x2 0x0 0x24 + delay 0x30 + playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_TARGET + createvisualtask AnimTask_PoltergeistItem, 2 + waitforvisualfinish + setalpha 12, 8 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x5 0x5 0x1 + launchtemplate gComplexPaletteBlendSpriteTemplate 0x2 0x7 0x7 0x5 0x1 0x0 0xa 0x0 0x0 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + launchtask AnimTask_NightmareClone 0x2 0x0 + launchtask AnimTask_ShakeMon 0x2 0x5 0x1 0x3 0x0 0x28 0x1 + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET + waitforvisualfinish + restorebg + waitbgfadein + clearmonbg 0x3 + blendoff + end Move_CORROSIVE_GAS:: end @to do: diff --git a/graphics/battle_anims/sprites/new/poltergeist.pal b/graphics/battle_anims/sprites/new/poltergeist.pal new file mode 100644 index 0000000000..699ab1ffa7 --- /dev/null +++ b/graphics/battle_anims/sprites/new/poltergeist.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +246 246 246 +246 246 246 +213 197 230 +213 197 230 +180 148 213 +180 148 213 +180 148 213 +148 98 197 +115 65 164 +82 32 131 +82 32 131 +82 32 131 +0 0 0 +0 0 0 +0 0 0 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index bddb727fd7..52f46e46d9 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -395,6 +395,7 @@ #define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 383) #define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 384) #define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 385) +#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 386) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index 1e2a0f4d8b..10e10a1c7b 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4906,6 +4906,7 @@ extern const u32 gBattleAnimSpriteGfx_StonePillar[]; extern const u32 gBattleAnimSpritePal_StonePillar[]; extern const u32 gBattleAnimSpriteGfx_StraightBeam[]; extern const u32 gBattleAnimSpritePal_StraightBeam[]; +extern const u32 gBattleAnimSpritePal_Poltergeist[]; extern const u32 gBattleAnimSpriteGfx_SubstituteBack[]; extern const u32 gBattleAnimSpriteGfx_SubstituteFront[]; extern const u32 gBattleAnimSpritePal_SubstituteFront[]; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index d9cbc919cd..5ced0567bc 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -2,6 +2,7 @@ #include "battle.h" #include "battle_anim.h" #include "gpu_regs.h" +#include "item_icon.h" #include "palette.h" #include "constants/rgb.h" #include "scanline_effect.h" @@ -39,6 +40,7 @@ static void AnimGhostStatusSprite_Step(struct Sprite *); static void AnimGrudgeFlame(struct Sprite *); static void AnimMonMoveCircular(struct Sprite *); static void AnimMonMoveCircular_Step(struct Sprite *); +static void AnimPoltergeistItem(struct Sprite *); static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] = { @@ -270,6 +272,17 @@ const struct SpriteTemplate gFlashCannonBallMovementTemplate = .callback = AnimShadowBall }; +const struct SpriteTemplate gPoltergeistEffectTemplate = +{ + .tileTag = ANIM_TAG_POLTERGEIST, + .paletteTag = ANIM_TAG_POLTERGEIST, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_ShadowBall, + .callback = AnimPoltergeistItem, +}; + static void AnimConfuseRayBallBounce(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); @@ -870,7 +883,8 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) && battler != (gBattleAnimAttacker ^ 2) && IsBattlerSpriteVisible(battler)) { - if (gAnimMoveIndex == MOVE_DARK_VOID) + if (gAnimMoveIndex == MOVE_DARK_VOID + || gAnimMoveIndex == MOVE_POLTERGEIST) spriteId = CreateSprite(&gDarkVoidBlackHoleTemplate, baseX, baseY, 55); //dark void else spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); //destiny bond @@ -1395,3 +1409,36 @@ static void AnimMonMoveCircular_Step(struct Sprite *sprite) sprite->callback = DestroySpriteAndMatrix; } } + +void AnimTask_PoltergeistItem(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + (GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT) / 2); + + task->data[0] = AddItemIconSprite(ANIM_TAG_ITEM_BAG, ANIM_TAG_ITEM_BAG, gLastUsedItem); + gSprites[task->data[0]].x = x + 4; + gSprites[task->data[0]].y = y + 4; + gSprites[task->data[0]].data[0] = x + 4; + gSprites[task->data[0]].data[1] = y + 4; + gSprites[task->data[0]].callback = AnimPoltergeistItem; + + task->data[1] = CreateSprite(&gPoltergeistEffectTemplate, x, y, 1); + gSprites[task->data[1]].data[0] = x; + gSprites[task->data[1]].data[1] = y; + + gAnimVisualTaskCount += 2; + + DestroyAnimVisualTask(taskId); +} + +static void AnimPoltergeistItem(struct Sprite *sprite) +{ + sprite->data[2] += 4; + + sprite->x = sprite->data[0] + Sin(sprite->data[2], 24); + sprite->y = sprite->data[1] + (Cos(sprite->data[2], 24) - 24); + + if (sprite->data[2] == 256) + DestroyAnimSprite(sprite); +} diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 15915c71a6..6892e1766c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9448,6 +9448,7 @@ static void Cmd_various(void) else { PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].item); + gLastUsedItem = gBattleMons[gActiveBattler].item; gBattlescriptCurrInstr += 7; } return; diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 5483b8f3ba..62f3802a5c 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1451,6 +1451,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL}, {gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, + {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1902,6 +1903,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL}, {gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, + {gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/graphics.c b/src/graphics.c index b735d20b18..6aae37a9ff 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -269,6 +269,8 @@ const u32 gBattleAnimSpritePal_Steamroller[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimSpriteGfx_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.4bpp.lz"); const u32 gBattleAnimSpritePal_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.gbapal.lz"); +const u32 gBattleAnimSpritePal_Poltergeist[] = INCBIN_U32("graphics/battle_anims/sprites/new/poltergeist.gbapal.lz"); + const u32 gBattleAnimSpriteGfx_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.4bpp.lz"); const u32 gBattleAnimSpritePal_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.gbapal.lz"); From 2e855b204a42f5845520aca1936021390c44fd94 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 29 May 2022 04:41:59 +0300 Subject: [PATCH 13/22] ai accounts for a third type --- include/battle_ai_util.h | 2 +- include/constants/battle_ai.h | 2 ++ src/battle_ai_main.c | 37 +++++++++++------------------------ src/battle_ai_util.c | 11 ++++++++--- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 0b2afebaec..4f0f68b338 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -85,7 +85,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef); u8 GetMoveDamageResult(u16 move); u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef); u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); -u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); +u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); u16 *GetMovesArray(u32 battler); bool32 IsConfusionMoveEffect(u16 moveEffect); bool32 HasMove(u32 battlerId, u32 move); diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 7d38d6dbaf..67f5c11b8e 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -15,11 +15,13 @@ #define AI_TYPE_MOVE 4 // type effectiveness +#define AI_EFFECTIVENESS_x8 320 #define AI_EFFECTIVENESS_x4 160 #define AI_EFFECTIVENESS_x2 80 #define AI_EFFECTIVENESS_x1 40 #define AI_EFFECTIVENESS_x0_5 20 #define AI_EFFECTIVENESS_x0_25 10 +#define AI_EFFECTIVENESS_x0_125 5 #define AI_EFFECTIVENESS_x0 0 // ai weather diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 5c7d577c01..c4ad06ee54 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -555,7 +555,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) s32 moveType; u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u32 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; u16 predictedMove = gLastMoves[battlerDef]; // TODO better move prediction @@ -600,6 +600,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case AI_EFFECTIVENESS_x0: RETURN_SCORE_MINUS(20); break; + case AI_EFFECTIVENESS_x0_125: case AI_EFFECTIVENESS_x0_25: RETURN_SCORE_MINUS(10); break; @@ -642,7 +643,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) RETURN_SCORE_MINUS(20); break; case ABILITY_WONDER_GUARD: - if (effectiveness != AI_EFFECTIVENESS_x2 && effectiveness != AI_EFFECTIVENESS_x4) + if (effectiveness < AI_EFFECTIVENESS_x2) return 0; break; case ABILITY_SAP_SIPPER: @@ -2524,33 +2525,17 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef)) { + case AI_EFFECTIVENESS_x8: + score += 8; + break; case AI_EFFECTIVENESS_x4: - if (WEATHER_HAS_EFFECT - && gBattleWeather & B_WEATHER_STRONG_WINDS - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) - { - if (AI_RandLessThan(176)) //Consider it supereffective instead of hypereffective. - score += 2; - else - score++; - } - else - score += 4; + score += 4; break; case AI_EFFECTIVENESS_x2: - if (WEATHER_HAS_EFFECT - && gBattleWeather & B_WEATHER_STRONG_WINDS - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) - { - break; // Don't increase score, consider it neutral. - } + if (AI_RandLessThan(176)) + score += 2; else - { - if (AI_RandLessThan(176)) - score += 2; - else - score++; - } + score++; break; } } @@ -2962,7 +2947,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { // move data u16 moveEffect = gBattleMoves[move].effect; - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u32 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); u8 atkPriority = GetMovePriority(battlerAtk, move); u16 predictedMove = gLastMoves[battlerDef]; //for now bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 8ed6e0490f..59acbe0b7e 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -950,10 +950,9 @@ u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) return typeEffectiveness; } -u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) +u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) { - u8 damageVar; - u32 effectivenessMultiplier; + u32 damageVar, effectivenessMultiplier; gMoveResultFlags = 0; gCurrentMove = move; @@ -965,6 +964,9 @@ u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) default: damageVar = AI_EFFECTIVENESS_x0; break; + case UQ_4_12(0.125): + damageVar = AI_EFFECTIVENESS_x0_125; + break; case UQ_4_12(0.25): damageVar = AI_EFFECTIVENESS_x0_25; break; @@ -980,6 +982,9 @@ u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) case UQ_4_12(4.0): damageVar = AI_EFFECTIVENESS_x4; break; + case UQ_4_12(8.0): + damageVar = AI_EFFECTIVENESS_x8; + break; } return damageVar; From 86b436782aa756a2d9ffe14fdf1ca908178e1b9b Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 1 Jun 2022 22:01:50 +0300 Subject: [PATCH 14/22] trap move related code cleanup --- include/constants/battle.h | 3 +++ src/battle_message.c | 2 +- src/battle_script_commands.c | 8 +++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index d651dab189..bcfb34c45f 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -475,4 +475,7 @@ // For the second argument of GetMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 +// Makes sure gWrappedStringIds and sTrappingMoves have the same size +#define TRAPPING_MOVES_COUNT 9 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/src/battle_message.c b/src/battle_message.c index 8cf9a508b2..34d020188a 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1562,7 +1562,7 @@ 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 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 15915c71a6..4abaf5adbd 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -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; } From 5934acbdc5c3584c71cde625a9d0117dd1505b4c Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 1 Jun 2022 22:21:32 +0300 Subject: [PATCH 15/22] IS_BATTLER_OF_TYPE ignores 3rd type if mystery --- include/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/battle.h b/include/battle.h index ea556c012a..dd16ecbb05 100644 --- a/include/battle.h +++ b/include/battle.h @@ -633,7 +633,7 @@ struct BattleStruct #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0)) #define BATTLER_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0)) -#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type || gBattleMons[battlerId].type3 == type)) +#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type || (gBattleMons[battlerId].type3 != TYPE_MYSTERY && gBattleMons[battlerId].type3 == type))) #define SET_BATTLER_TYPE(battlerId, type) \ { \ gBattleMons[battlerId].type1 = type; \ From e1c57e4071c19cadd69c57420adfc97838b7cf3f Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 1 Jun 2022 22:45:50 +0300 Subject: [PATCH 16/22] move_none does not benefit from stab --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index d0ff7c5beb..b060a15ce9 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8941,7 +8941,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } // check stab - if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE) + if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE && move != MOVE_NONE) { if (abilityAtk == ABILITY_ADAPTABILITY) MulModifier(&finalModifier, UQ_4_12(2.0)); From f419fc3ae77acf136c7e3c1367b4e8bbb2f3779b Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 4 Jun 2022 18:36:18 +0300 Subject: [PATCH 17/22] fix terrain move softlock --- data/battle_scripts_1.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a9c15040d3..5ffe483b56 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2390,7 +2390,7 @@ BattleScript_EffectPsychicTerrain: waitanimation printfromtable gTerrainStringIds waitmessage B_WAIT_TIME_LONG - playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG call BattleScript_TerrainSeedLoop jumpifabilitypresent ABILITY_MIMICRY, BattleScript_ApplyMimicry goto BattleScript_MoveEnd From 1d19c0dc9fc44e1c3e3d51969daa82b3f6377790 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 5 Jun 2022 16:38:37 +0300 Subject: [PATCH 18/22] Update battle_util.c --- src/battle_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_util.c b/src/battle_util.c index ebd7917d47..3504c0a52d 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1704,6 +1704,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) case EFFECT_HEALING_WISH: case EFFECT_WISH: case EFFECT_HEAL_PULSE: + case EFFECT_JUNGLE_HEALING: return TRUE; default: return FALSE; From 407047ace7bcfbf73119dd0b80cf890a23725604 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 10 Jun 2022 22:31:53 +0300 Subject: [PATCH 19/22] ground x2 vs flying if inverse battle --- src/battle_util.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index ebd7917d47..e521ef00d3 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7770,33 +7770,35 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) return FALSE; } - -bool32 IsBattlerGrounded(u8 battlerId) +// Only called directly when calculating damage type effectiveness +static bool32 IsBattlerGrounded2(u8 battlerId, bool32 considerInverse) { if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_IRON_BALL) return TRUE; - else if (gFieldStatuses & STATUS_FIELD_GRAVITY) + if (gFieldStatuses & STATUS_FIELD_GRAVITY) return TRUE; #if B_ROOTED_GROUNDING >= GEN_4 - else if (gStatuses3[battlerId] & STATUS3_ROOTED) + if (gStatuses3[battlerId] & STATUS3_ROOTED) return TRUE; #endif - else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) + if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) return TRUE; + if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) + return FALSE; + if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) + return FALSE; + if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON) + return FALSE; + if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE) + return FALSE; + if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING) && (!considerInverse || !FlagGet(B_FLAG_INVERSE_BATTLE))) + return FALSE; + return TRUE; +} - else if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) - return FALSE; - else if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) - return FALSE; - else if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON) - return FALSE; - else if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE) - return FALSE; - else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING)) - return FALSE; - - else - return TRUE; +bool32 IsBattlerGrounded(u8 battlerId) +{ + IsBattlerGrounded2(battlerId, FALSE); } bool32 IsBattlerAlive(u8 battlerId) @@ -9172,7 +9174,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat && gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1) MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities); - if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) + if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) { modifier = UQ_4_12(0.0); if (recordAbilities && defAbility == ABILITY_LEVITATE) From f43d54af8935fddc511d90aac46eecc1f2ec3abe Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 18 Jun 2022 19:00:33 +0300 Subject: [PATCH 20/22] AI chooses most resistant mon --- src/battle_ai_switch_items.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 9136d667ca..0d394c3b80 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -602,39 +602,39 @@ static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u return PARTY_SIZE; } -static u32 GestBestMonOffensive(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) +static u32 GestBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) { int i, bits = 0; while (bits != 0x3F) // All mons were checked. { - int bestDmg = 0; + u32 bestResist = UQ_4_12(1.0); int bestMonId = PARTY_SIZE; - // Find the mon whose type is the most suitable offensively. + // Find the mon whose type is the most suitable defensively. for (i = firstId; i < lastId; i++) { if (!(gBitTable[i] & invalidMons) && !(gBitTable[i] & bits)) { u16 species = GetMonData(&party[i], MON_DATA_SPECIES); - u32 typeDmg = UQ_4_12(1.0); + u32 typeEffectiveness = UQ_4_12(1.0); - u8 atkType1 = gBaseStats[species].type1; - u8 atkType2 = gBaseStats[species].type2; - u8 defType1 = gBattleMons[opposingBattler].type1; - u8 defType2 = gBattleMons[opposingBattler].type2; + u8 atkType1 = gBattleMons[opposingBattler].type1; + u8 atkType2 = gBattleMons[opposingBattler].type2; + u8 defType1 = gBaseStats[species].type1; + u8 defType2 = gBaseStats[species].type2; - typeDmg *= GetTypeModifier(atkType1, defType1); + typeEffectiveness *= GetTypeModifier(atkType1, defType1); if (atkType2 != atkType1) - typeDmg *= GetTypeModifier(atkType2, defType1); + typeEffectiveness *= GetTypeModifier(atkType2, defType1); if (defType2 != defType1) { - typeDmg *= GetTypeModifier(atkType1, defType2); + typeEffectiveness *= GetTypeModifier(atkType1, defType2); if (atkType2 != atkType1) - typeDmg *= GetTypeModifier(atkType2, defType2); + typeEffectiveness *= GetTypeModifier(atkType2, defType2); } - if (bestDmg < typeDmg) + if (typeEffectiveness < bestResist) { - bestDmg = typeDmg; + bestResist = typeEffectiveness; bestMonId = i; } } @@ -698,7 +698,6 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva u8 GetMostSuitableMonToSwitchInto(void) { u32 opposingBattler = 0; - u32 bestDmg = 0; u32 bestMonId = 0; u8 battlerIn1 = 0, battlerIn2 = 0; s32 firstId = 0; @@ -757,7 +756,7 @@ u8 GetMostSuitableMonToSwitchInto(void) if (bestMonId != PARTY_SIZE) return bestMonId; - bestMonId = GestBestMonOffensive(party, firstId, lastId, invalidMons, opposingBattler); + bestMonId = GestBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); if (bestMonId != PARTY_SIZE) return bestMonId; From 5e7df653bd2658d6b55c28d00f180eea744caa2d Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 18 Jun 2022 19:18:01 +0300 Subject: [PATCH 21/22] no gest --- src/battle_ai_switch_items.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 0d394c3b80..42f6c7fc9c 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -602,7 +602,7 @@ static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u return PARTY_SIZE; } -static u32 GestBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) +static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) { int i, bits = 0; @@ -756,7 +756,7 @@ u8 GetMostSuitableMonToSwitchInto(void) if (bestMonId != PARTY_SIZE) return bestMonId; - bestMonId = GestBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); + bestMonId = GetBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); if (bestMonId != PARTY_SIZE) return bestMonId; From c1af41834041817e78eea735d17e09fdcd1246e5 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 1 Jul 2022 17:52:46 +0300 Subject: [PATCH 22/22] define B_MSG_WRAPPED_ constants --- include/constants/battle.h | 3 --- include/constants/battle_string_ids.h | 12 ++++++++++++ src/battle_message.c | 18 +++++++++--------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index bcfb34c45f..d651dab189 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -475,7 +475,4 @@ // For the second argument of GetMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 -// Makes sure gWrappedStringIds and sTrappingMoves have the same size -#define TRAPPING_MOVES_COUNT 9 - #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 4eff91c857..2017d70852 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -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 diff --git a/src/battle_message.c b/src/battle_message.c index 34d020188a..f9e6252247 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1564,15 +1564,15 @@ const u16 gFirstTurnOfTwoStringIds[] = // Index copied from move's index in sTrappingMoves 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[] =