Skip to content

Commit

Permalink
Add status class enums, fill in language addresses (#301)
Browse files Browse the repository at this point in the history
* Add TWO_TURN_STATUSES, fill in language addresses

* Add status class enums

* Fix enum action values

* Fill in language addresses for RAM

* Fix lengths

* Adjust TEAM_NAME size
  • Loading branch information
AnonymousRandomPerson authored Dec 31, 2024
1 parent 9149d2c commit 0ebe117
Show file tree
Hide file tree
Showing 7 changed files with 354 additions and 59 deletions.
1 change: 1 addition & 0 deletions headers/data/overlay29.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ extern struct fx64_16 DAMAGE_FORMULA_MAX_BASE;
extern struct fx64_16 WONDER_GUARD_MULTIPLIER;
extern struct fx64_16 DAMAGE_FORMULA_MIN_BASE;
extern struct damage_negating_exclusive_eff_entry TYPE_DAMAGE_NEGATING_EXCLUSIVE_ITEM_EFFECTS[28];
extern struct status_two_turn_id_8 TWO_TURN_STATUSES[11];
extern struct two_turn_move_and_status TWO_TURN_MOVES_AND_STATUSES[22];
extern int32_t SPATK_STAT_IDX;
extern int32_t ATK_STAT_IDX;
Expand Down
13 changes: 9 additions & 4 deletions headers/data/ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ extern struct bulk_item UNUSED_KECLEON_WARES_ITEMS[4];
extern int32_t MONEY_CARRIED;
extern int32_t MONEY_STORED;
extern struct audio_command AUDIO_COMMANDS_BUFFER[16];
extern struct mem_arena* SOUND_MEMORY_ARENA_PTR;
extern struct window_list WINDOW_LIST;
extern uint16_t CURSOR_16_SPRITE_ID;
extern uint16_t CURSOR_SPRITE_ID;
extern struct animation_control* CURSOR_ANIMATION_CONTROL;
extern struct animation_control* CURSOR_16_ANIMATION_CONTROL;
extern uint16_t ALERT_SPRITE_ID;
extern struct animation_control* ALERT_ANIMATION_CONTROL;
extern struct mem_arena* SOUND_MEMORY_ARENA_PTR;
extern struct window_list WINDOW_LIST;
extern struct move LAST_NEW_MOVE;
extern struct script_var_value_table SCRIPT_VARS_VALUES;
extern uint8_t BAG_LEVEL;
Expand All @@ -43,7 +43,12 @@ extern struct dungeon_id_8 PENDING_DUNGEON_ID;
extern uint8_t PENDING_STARTING_FLOOR;
extern uint32_t PLAY_TIME_SECONDS;
extern uint8_t PLAY_TIME_FRAME_COUNTER;
extern char TEAM_NAME[10];
#if PMDSKY_VERSION == PMDSKY_JP
#define TEAM_NAME_LENGTH_ 5
#else
#define TEAM_NAME_LENGTH_ 10
#endif
extern char TEAM_NAME[TEAM_NAME_LENGTH_];
extern struct monster_id_16 LEVEL_UP_DATA_MONSTER_ID;
extern struct level_up_entry LEVEL_UP_DATA_DECOMPRESS_BUFFER[100];
extern struct team_member_table TEAM_MEMBER_TABLE;
Expand All @@ -64,8 +69,8 @@ extern struct sentry_duty SENTRY_DUTY_STRUCT;
extern bool TURNING_ON_THE_SPOT_FLAG;
extern struct loaded_attack_sprite_data* LOADED_ATTACK_SPRITE_DATA;
extern bool AI_THROWN_ITEM_DIRECTION_IS_USED[8];
extern uint32_t AI_THROWN_ITEM_DIRECTIONS[8];
extern uint32_t AI_THROWN_ITEM_PROBABILITIES[8];
extern uint32_t AI_THROWN_ITEM_DIRECTIONS[8];
extern bool ROLLOUT_ICE_BALL_MISSED;
extern bool MULTIHIT_FATIGUE_MOVE_USED;
extern bool TWINEEDLE_HIT_TRACKER;
Expand Down
46 changes: 29 additions & 17 deletions headers/types/dungeon_mode/dungeon_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ struct statuses {
// 0xF: Tracks the damage taken to deal when bide status ends. Max 0x3E7 (999).
uint32_t bide_damage_tally;
struct monster_behavior_8 monster_behavior; // 0x13
uint8_t sleep; // 0x14: STATUS_SLEEP if 1
// 0x14: If non-zero, the corresponding status in status_sleep_id is active.
struct status_sleep_id_8 sleep;
uint8_t sleep_turns; // 0x15: Turns left for the status in statuses::sleep
uint8_t burn; // 0x16: STATUS_BURN if 1
uint8_t burn_turns; // 0x17: Turns left for the status in statuses::burn
// 0x16: If non-zero, the corresponding status in status_burn_id is active.
struct status_burn_id_8 burn;
uint8_t burn_turns; // 0x17: Turns left for the status in statuses::burn
// 0x18: Turns left until residual damage for the status in statuses::burn, if applicable
uint8_t burn_damage_countdown;
// 0x19: The number of times the statuses::burn_damage_countdown has reached 0. Only used
Expand All @@ -114,7 +116,8 @@ struct statuses {
// on is filled with 0x6
uint8_t badly_poisoned_damage_count;
undefined field_0x1a;
uint8_t freeze; // 0x1B: STATUS_FROZEN if 1
// 0x1B: If non-zero, the corresponding status in status_frozen_id is active.
struct status_frozen_id_8 freeze;
undefined field_0x1c;
undefined field_0x1d;
undefined field_0x1e;
Expand All @@ -127,16 +130,20 @@ struct statuses {
uint8_t freeze_damage_countdown;
undefined field_0x25;
undefined field_0x26;
uint8_t cringe; // 0x27: STATUS_CRINGE if 1
uint8_t cringe_turns; // 0x28: Turns left for the status in statuses::cringe
uint8_t bide; // 0x29: STATUS_BIDE if 1
// 0x27: If non-zero, the corresponding status in status_cringe_id is active.
struct status_cringe_id_8 cringe;
uint8_t cringe_turns; // 0x28: Turns left for the status in statuses::cringe
// 0x29: If non-zero, the corresponding status in status_two_turn_id is active.
struct status_two_turn_id_8 bide;
uint8_t bide_turns; // 0x2A: Turns left for the status in statuses::bide
uint8_t bide_move_slot; // 0x2B: Slot in the user's move list
uint8_t reflect; // 0x2C: STATUS_REFLECT if 1
uint8_t reflect_turns; // 0x2D: Turns left for the status in statuses::reflect
// 0x2C: If non-zero, the corresponding status in status_reflect_id is active.
struct status_reflect_id_8 reflect;
uint8_t reflect_turns; // 0x2D: Turns left for the status in statuses::reflect
// 0x2E: Turns left until residual healing for the status in statuses::reflect, if applicable
uint8_t reflect_damage_countdown;
uint8_t curse; // 0x2F: STATUS_CURSED if 1
// 0x2F: If non-zero, the corresponding status in status_curse_id is active.
struct status_curse_id_8 curse;
// 0x30: Set to monster::is_not_team_member of the attacker (the one causing the decoy status).
uint8_t curse_applier_non_team_member_flag;
// 0x31: Set to 1 on a Pokemon when inflicted with the Decoy status.
Expand All @@ -147,7 +154,8 @@ struct statuses {
undefined field_0x34;
undefined field_0x35;
undefined field_0x36;
uint8_t leech_seed; // 0x37: STATUS_LEECH_SEED if 1
// 0x37: If non-zero, the corresponding status in status_leech_seed_id is active.
struct status_leech_seed_id_8 leech_seed;
undefined field_0x38;
undefined field_0x39;
undefined field_0x3a;
Expand All @@ -162,12 +170,16 @@ struct statuses {
// Behaves weirdly without an afflictor
uint8_t leech_seed_damage_countdown;
undefined field_0x42;
uint8_t sure_shot; // 0x43: STATUS_SURE_SHOT if 1
uint8_t sure_shot_turns; // 0x44: Turns left for the status in statuses::sure_shot
uint8_t long_toss; // 0x45: STATUS_LONG_TOSS if 1
uint8_t invisible; // 0x46: STATUS_INVISIBLE if 1
uint8_t invisible_turns; // 0x47: Turns left for the status in statuses::invisible
uint8_t blinded; // 0x48: STATUS_BLINKER if 1
// 0x43: If non-zero, the corresponding status in status_sure_shot_id is active.
struct status_sure_shot_id_8 sure_shot;
uint8_t sure_shot_turns; // 0x44: Turns left for the status in statuses::sure_shot
// 0x45: If non-zero, the corresponding status in status_long_toss_id is active.
struct status_long_toss_id_8 long_toss;
// 0x46: If non-zero, the corresponding status in status_invisible_id is active.
struct status_invisible_id_8 invisible;
uint8_t invisible_turns; // 0x47: Turns left for the status in statuses::invisible
// 0x48: If non-zero, the corresponding status in status_blinker_id is active.
struct status_blinker_id_8 blinded;
uint8_t blinded_turns; // 0x49: Turns left for the status in statuses::blinded
uint8_t muzzled; // 0x4A: STATUS_MUZZLED if 1
uint8_t muzzled_turns; // 0x4B: Turns left for the status in statuses::muzzled
Expand Down
178 changes: 166 additions & 12 deletions headers/types/dungeon_mode/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,65 @@ enum status_id {
ENUM_8_BIT(status_id);
#pragma pack(pop)

enum status_sleep_id {
STATUS_SLEEP_NONE = 0,
STATUS_SLEEP_SLEEP = 1,
STATUS_SLEEP_SLEEPLESS = 2,
STATUS_SLEEP_NIGHTMARE = 3,
STATUS_SLEEP_YAWNING = 4,
STATUS_SLEEP_NAPPING = 5,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_sleep_id);
#pragma pack(pop)

enum status_burn_id {
STATUS_BURN_NONE = 0,
STATUS_BURN_BURN = 1,
STATUS_BURN_POISONED = 2,
STATUS_BURN_BADLY_POISONED = 3,
STATUS_BURN_PARALYSIS = 4,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_burn_id);
#pragma pack(pop)

enum status_frozen_id {
STATUS_FROZEN_NONE = 0,
STATUS_FROZEN_FROZEN = 1,
STATUS_FROZEN_SHADOW_HOLD = 2,
STATUS_FROZEN_WRAP = 3,
STATUS_FROZEN_WRAPPED = 4,
STATUS_FROZEN_INGRAIN = 5,
STATUS_FROZEN_PETRIFIED = 6,
STATUS_FROZEN_CONSTRICTION = 7,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_frozen_id);
#pragma pack(pop)

enum status_cringe_id {
STATUS_CRINGE_NONE = 0,
STATUS_CRINGE_CRINGE = 1,
STATUS_CRINGE_CONFUSED = 2,
STATUS_CRINGE_PAUSED = 3,
STATUS_CRINGE_COWERING = 4,
STATUS_CRINGE_TAUNTED = 5,
STATUS_CRINGE_ENCORE = 6,
STATUS_CRINGE_INFATUATED = 7,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_cringe_id);
#pragma pack(pop)

// Values for the two-turn move status group
// Corresponds to values 28 to 40 in the status_id enum
enum status_two_turn_id {
STATUS_TWO_TURN_NONE = 0,
STATUS_TWO_TURN_BIDE = 1,
STATUS_TWO_TURN_SOLARBEAM = 2,
STATUS_TWO_TURN_SKY_ATTACK = 3,
Expand All @@ -289,11 +345,109 @@ enum status_two_turn_id {
STATUS_TWO_TURN_SHADOW_FORCE = 13,
};

// This is usually stored as a 16-bit integer
#pragma pack(push, 1)
ENUM_8_BIT(status_two_turn_id);
#pragma pack(pop)

#pragma pack(push, 2)
ENUM_16_BIT(status_two_turn_id);
#pragma pack(pop)

enum status_reflect_id {
STATUS_REFLECT_NONE = 0,
STATUS_REFLECT_REFLECT = 1,
STATUS_REFLECT_SAFEGUARD = 2,
STATUS_REFLECT_LIGHT_SCREEN = 3,
STATUS_REFLECT_COUNTER = 4,
STATUS_REFLECT_MAGIC_COAT = 5,
STATUS_REFLECT_WISH = 6,
STATUS_REFLECT_PROTECT = 7,
STATUS_REFLECT_MIRROR_COAT = 8,
STATUS_REFLECT_ENDURING = 9,
STATUS_REFLECT_MINI_COUNTER = 10,
STATUS_REFLECT_MIRROR_MOVE = 11,
STATUS_REFLECT_CONVERSION2 = 12,
STATUS_REFLECT_VITAL_THROW = 13,
STATUS_REFLECT_MIST = 14,
STATUS_REFLECT_METAL_BURST = 15,
STATUS_REFLECT_AQUA_RING = 16,
STATUS_REFLECT_LUCKY_CHANT = 17,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_reflect_id);
#pragma pack(pop)

enum status_curse_id {
STATUS_CURSE_NONE = 0,
STATUS_CURSE_CURSED = 1,
STATUS_CURSE_DECOY = 2,
STATUS_CURSE_SNATCH = 3,
STATUS_CURSE_GASTRO_ACID = 4,
STATUS_CURSE_HEAL_BLOCK = 5,
STATUS_CURSE_EMBARGO = 6,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_curse_id);
#pragma pack(pop)

enum status_leech_seed_id {
STATUS_LEECH_SEED_NONE = 0,
STATUS_LEECH_SEED_LEECH_SEED = 1,
STATUS_LEECH_SEED_DESTINY_BOND = 2,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_leech_seed_id);
#pragma pack(pop)

enum status_sure_shot_id {
STATUS_SURE_SHOT_NONE = 0,
STATUS_SURE_SHOT_SURE_SHOT = 1,
STATUS_SURE_SHOT_WHIFFER = 2,
STATUS_SURE_SHOT_SET_DAMAGE = 3,
STATUS_SURE_SHOT_FOCUS_ENERGY = 4,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_sure_shot_id);
#pragma pack(pop)

enum status_long_toss_id {
STATUS_LONG_TOSS_NONE = 0,
STATUS_LONG_TOSS_LONG_TOSS = 1,
STATUS_LONG_TOSS_PIERCE = 2,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_long_toss_id);
#pragma pack(pop)

enum status_invisible_id {
STATUS_INVISIBLE_NONE = 0,
STATUS_INVISIBLE_INVISIBLE = 1,
STATUS_INVISIBLE_TRANSFORMED = 2,
STATUS_INVISIBLE_MOBILE = 3,
STATUS_INVISIBLE_SLIP = 4,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_invisible_id);
#pragma pack(pop)

enum status_blinker_id {
STATUS_BLINKER_NONE = 0,
STATUS_BLINKER_BLINKER = 1,
STATUS_BLINKER_CROSS_EYED = 2,
STATUS_BLINKER_EYEDROPS = 3,
STATUS_BLINKER_DROPEYE = 4,
};

#pragma pack(push, 1)
ENUM_8_BIT(status_blinker_id);
#pragma pack(pop)

// Tactic ID. These are usually encoded as bitvectors.
enum tactic_id {
TACTIC_LETS_GO_TOGETHER = 0,
Expand Down Expand Up @@ -436,19 +590,19 @@ enum action {
ACTION_SEND_HOME = 52, // 0x34: Send a pokémon home
ACTION_UNK_35 = 53,
ACTION_GIVE_ITEM = 54, // 0X36: Give held item
ACTION_TAKE_ITEM = 35, // 0x37: Take a held item
ACTION_UNK_38 = 36,
ACTION_TAKE_ITEM = 55, // 0x37: Take a held item
ACTION_UNK_38 = 56,
// 0x39: <pokémon> had second thoughts! - Used as a failsafe when trying to take an illegal
// action
ACTION_SECOND_THOUGHTS = 37,
ACTION_SWAP_ITEM = 38, // 0x3A: Swapping an item
ACTION_CHANGE_LEADER = 39, // 0x3B: Change the team's leader
ACTION_SET_ITEM = 40, // 0x3C: Set item
ACTION_UNSET_ITEM = 41, // 0x3D: Unset item
ACTION_UNK_3E = 42,
ACTION_PICK_UP_AI = 43, // 0x3F: Pick up an item (AI)
ACTION_UNK_40 = 44,
ACTION_THROW_ARC_PLAYER = 45, // 0x41: Throw a Gravelerock or a similar item (player)
ACTION_SECOND_THOUGHTS = 57,
ACTION_SWAP_ITEM = 58, // 0x3A: Swapping an item
ACTION_CHANGE_LEADER = 59, // 0x3B: Change the team's leader
ACTION_SET_ITEM = 60, // 0x3C: Set item
ACTION_UNSET_ITEM = 61, // 0x3D: Unset item
ACTION_UNK_3E = 62,
ACTION_PICK_UP_AI = 63, // 0x3F: Pick up an item (AI)
ACTION_UNK_40 = 64,
ACTION_THROW_ARC_PLAYER = 65, // 0x41: Throw a Gravelerock or a similar item (player)
};

// This is usually stored as a 16-bit integer
Expand Down
2 changes: 2 additions & 0 deletions symbols/arm9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,8 @@ arm9:
- name: CopyAndInterleaveWrapper
address:
EU: 0x201C08C
NA: 0x201BFF0
JP: 0x201C048
description: |-
Calls CopyAndInterleave with the passed len divided by 2.
Expand Down
16 changes: 16 additions & 0 deletions symbols/overlay29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7017,13 +7017,17 @@ overlay29:
- name: LoadWeather3DFiles
address:
EU: 0x2339480
NA: 0x23388B0
JP: 0x2339C74
description: |-
Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm/Fog weather conditions.
No params.
- name: RenderWeather3D
address:
EU: 0x2339694
NA: 0x2338AC4
JP: 0x2339E88
description: |-
Renders the 3D effects for the tileset weather as well as the Sandstorm/Fog weather conditions.
Expand All @@ -7050,6 +7054,8 @@ overlay29:
- name: FlashLeaderIcon
address:
EU: 0x233A5F4
NA: 0x2339A24
JP: 0x233ADE8
description: |-
Seems to control flashing the leader's icon on the minimap when r0 = 0? Doesn't seem to ever be called when r0 = 1.
Expand Down Expand Up @@ -9755,6 +9761,16 @@ overlay29:
List of exclusive item effects that negate damage of a certain type, terminated by a TYPE_NEUTRAL entry.
type: struct damage_negating_exclusive_eff_entry[28]
- name: TWO_TURN_STATUSES
address:
EU: 0x235366C
NA: 0x2352A60
JP: 0x2353CE0
length:
EU: 0xB
NA: 0xB
JP: 0xB
description: Lists all status IDs that are for two-turn moves. The last entry is null.
- name: TWO_TURN_MOVES_AND_STATUSES
address:
EU: 0x23536B8
Expand Down
Loading

0 comments on commit 0ebe117

Please sign in to comment.