mirror of
https://github.com/pret/pokeemerald.git
synced 2026-10-24 01:53:39 -05:00
merge w be
This commit is contained in:
@@ -621,7 +621,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; \
|
||||
|
||||
@@ -86,7 +86,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *effectiveness);
|
||||
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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -104,6 +104,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.
|
||||
|
||||
@@ -613,8 +613,10 @@
|
||||
#define STRINGID_METEORBEAMCHARGING 611
|
||||
#define STRINGID_HEATUPBEAK 612
|
||||
#define STRINGID_COURTCHANGE 613
|
||||
#define STRINGID_PLAYERLOSTTOENEMYTRAINER 614
|
||||
#define STRINGID_PLAYERPAIDPRIZEMONEY 615
|
||||
|
||||
#define BATTLESTRINGS_COUNT 614
|
||||
#define BATTLESTRINGS_COUNT 616
|
||||
|
||||
// This is the string id that gBattleStringsTable starts with.
|
||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||
@@ -872,4 +874,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
|
||||
|
||||
@@ -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"
|
||||
#include "constants/expansion_branches.h"
|
||||
|
||||
// Prevent cross-jump optimization.
|
||||
@@ -286,8 +287,6 @@ struct BattleTowerPokemon
|
||||
u8 friendship;
|
||||
};
|
||||
|
||||
#define NULL_BATTLE_TOWER_POKEMON { .nickname = __("$$$$$$$$$$$") }
|
||||
|
||||
struct EmeraldBattleTowerRecord
|
||||
{
|
||||
/*0x00*/ u8 lvlMode; // 0 = level 50, 1 = level 100
|
||||
@@ -815,7 +814,7 @@ struct TrainerNameRecord
|
||||
u8 trainerName[PLAYER_NAME_LENGTH + 1];
|
||||
};
|
||||
|
||||
struct SaveTrainerHill
|
||||
struct TrainerHillSave
|
||||
{
|
||||
/*0x3D64*/ u32 timer;
|
||||
/*0x3D68*/ u32 bestTime;
|
||||
@@ -827,7 +826,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
|
||||
@@ -1010,7 +1009,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];
|
||||
@@ -1018,7 +1017,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
|
||||
};
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#ifndef GUARD_TRAINER_HILL_H
|
||||
#define GUARD_TRAINER_HILL_H
|
||||
|
||||
#define HILL_TRAINER_NAME_LENGTH 11
|
||||
#define DUMMY_HILL_MON { .nickname = __("$$$$$$$$$$$") }
|
||||
|
||||
struct TrainerHillTrainer
|
||||
{
|
||||
u8 name[HILL_TRAINER_NAME_LENGTH];
|
||||
u8 facilityClass;
|
||||
u32 unused;
|
||||
bool32 unused; // Set to TRUE on JP trainers
|
||||
u16 speechBefore[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
u16 speechWin[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
u16 speechLose[EASY_CHAT_BATTLE_WORDS_COUNT];
|
||||
@@ -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