Skip to content

Commit

Permalink
Various Dungeon Mode Findings (#292)
Browse files Browse the repository at this point in the history
Includes snatch, explorer maze, shadows, fixed rooms, warp scarf, traps.
  • Loading branch information
Jawshoeuh authored Nov 22, 2024
1 parent 39e5279 commit 0964730
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 4 deletions.
6 changes: 6 additions & 0 deletions headers/functions/overlay29.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ bool RunLeaderTurn(undefined param_1);
void TrySpawnMonsterAndActivatePlusMinus(void);
bool IsFloorOver(void);
void DecrementWindCounter(void);
bool IsDungeonEndReasonFailure(void);
void SetForcedLossReason(enum forced_loss_reason forced_loss_reason);
enum forced_loss_reason GetForcedLossReason(void);
void BindTrapToTile(struct tile* tile, struct entity* trap, bool is_visible);
bool AreLateGameTrapsEnabledWrapper(void);
void SpawnEnemyTrapAtPos(enum trap_id trap_id, int16_t x, int16_t y, uint8_t flags,
bool is_visible);
void PrepareTrapperTrap(struct entity* entity, enum trap_id trap_id, uint8_t team);
Expand Down Expand Up @@ -204,6 +206,8 @@ bool IsMonster(struct entity* entity);
void TryActivateConversion2(struct entity* attacker, struct entity* defender, struct move* move);
void TryActivateTruant(struct entity* entity);
void TryPointCameraToMonster(struct entity* entity, undefined param_2, undefined param_3);
void ReevaluateSnatchMonster(void);
struct entity* GetRandomExplorerMazeMonster(void);
void RestorePpAllMovesSetFlags(struct entity* entity);
bool CheckTeamMemberIdxVeneer(int member_idx);
bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id);
Expand Down Expand Up @@ -318,6 +322,8 @@ void EvolveMonster(struct entity* user, struct entity* target, enum monster_id n
void ChangeMonsterAnimation(struct entity* monster, int8_t animation_id,
enum direction_id direction);
uint8_t GetIdleAnimationId(struct entity* entity);
void DetermineAllMonsterShadow(void);
uint8_t DetermineMonsterShadow(struct entity* monster);
bool DisplayActions(struct entity* param_1);
void CheckNonLeaderTile(struct entity* entity);
bool EndNegativeStatusCondition(struct entity* user, struct entity* target, bool animation,
Expand Down
12 changes: 8 additions & 4 deletions headers/types/dungeon_mode/dungeon_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,10 @@ struct monster {
undefined field_0x17a;
// 0x17B: Somehow related to sprite size?
undefined field_0x17b;
undefined field_0x17c;
// 0x17C: Tracks the number of turns since the last warp scarf activation if it is
// held. The number is capped at 20 because it's used to lookup the chance to warp
// on a table.
uint8_t turns_since_last_warp_scarf;
undefined field_0x17d;
struct position target_pos; // 0x17E: The AI's target's position on screen
struct position pixel_pos; // 0x182: The monster's graphical position on screen?
Expand Down Expand Up @@ -990,9 +993,10 @@ struct dungeon_generation_info {
bool dough_seed_extra_poke_flag;
// 0x5: Room index of Monster House on the floor. 0xFF if there's no Monster House
uint8_t monster_house_room;
// 0x6: Related to when a monster from a fixed room faints. Maybe to check if the floor
// should be over after knocking them out?
undefined unk_fixed_room_static_monster_tracker;
// 0x6: It's set to 0 when it's not a fixed room, 1 when it's a fixed room with no boss fight,
// and 2 when it's a fixed room with a boss fight. If this tracker is 0, 1, or 3 the floor
// will not automatically end when there are no monsters with is_ally being false.
uint8_t fixed_room_boss_tracker;
undefined field_0x7;
// 0x8: The type of the hidden stairs on the current floor.
enum hidden_stairs_type hidden_stairs_type;
Expand Down
55 changes: 55 additions & 0 deletions symbols/overlay29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,14 @@ overlay29:
Decrements dungeon::wind_turns and displays a wind warning message if required.
No params.
- name: IsDungeonEndReasonFailure
address:
NA: 0x22ECF44
description: |-
Checks if the damage_source of the dungeon ending is because of a failure to complete the dungeon.
Specifically checks fainted_monster_dungeon_end_reason to be less than DAMAGE_SOURCE_ESCAPE.
return: bool
- name: SetForcedLossReason
address:
EU: 0x22ED9B8
Expand Down Expand Up @@ -1499,6 +1507,14 @@ overlay29:
r0: tile pointer
r1: entity pointer
r2: visibility flag
- name: AreLateGameTrapsEnabledWrapper
address:
EU: 0x22EE218
NA: 0x22ED868
description: |-
A wrapper around AreLateGameTrapsEnabled that passes the fixed room for the floor.
return: bool
- name: SpawnEnemyTrapAtPos
address:
EU: 0x22EE320
Expand Down Expand Up @@ -2244,6 +2260,25 @@ overlay29:
r0: Entity pointer. Must be a monster, otherwise the function does nothing.
r1: ?
r2: ?
- name: ReevaluateSnatchMonster
address:
NA: 0x22F9970
description: |-
Checks if any monster on the floor has the snatch status and stores the corresponding info
onto the dungeon struct. This is only called when reinitalizing a dungeon from a quicksave.
Normally, the game will try to prevent multiple monsters from having snatch, but will pick
the first one in the list if multiple have the status.
No params.
- name: GetRandomExplorerMazeMonster
address:
NA: 0x22F99EC
description: |-
Checks if any enemy monsters on the floor have the behavior BEHAVIOR_EXPLORER_MAZE_1,
BEHAVIOR_EXPLORER_MAZE_2, BEHAVIOR_EXPLORER_MAZE_3 or BEHAVIOR_EXPLORER_MAZE_4 and returns
one at random. If none can be found, it returns NULL.
return: monster entity pointer
- name: RestorePpAllMovesSetFlags
address:
EU: 0x22FA480
Expand Down Expand Up @@ -3442,6 +3477,26 @@ overlay29:
r0: pointer to entity
return: animation ID
- name: DetermineAllMonsterShadow
address:
NA: 0x2304B64
description: |-
Change all monsters' shadows to be appropriate for their sizes and the tile they're
standing on. It simply calls DetermineMontersShadow for all monsters in the dungeon.
No params.
- name: DetermineMonsterShadow
address:
NA: 0x2304BAC
description: |-
Changes the monster's shadow to be appropriate for its size and the tile it's standing on.
If the tile is a floor and it's a water tileset, it changes the monster to use the water
shadows. If the tile is secondary terrain and secondary terrain is water, it also uses the
water shadows. If the tile is a chasm, it changes nothing and returns 6. Otherwise, use
the default land shadow.
r0: monster entity pointer
return: the type of shadow used?
- name: DisplayActions
address:
EU: 0x2305A0C
Expand Down

0 comments on commit 0964730

Please sign in to comment.