Clean up some trainer hill
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -35,7 +35,7 @@ struct EReaderTrainerHillTrainer
|
||||
{
|
||||
u8 trainerNum;
|
||||
struct TrainerHillTrainer trainer;
|
||||
struct TrHillDisplay display;
|
||||
struct TrainerHillFloorMap map;
|
||||
u32 checksum;
|
||||
}; // size=0x274
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user