yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_state.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_DUNGEON_DUNGEON_STATE_H
2#define YAZE_ZELDA3_DUNGEON_DUNGEON_STATE_H
3
4#include <cstdint>
5
6namespace yaze {
7namespace zelda3 {
8
17 public:
18 virtual ~DungeonState() = default;
19
20 // Chest State
21 virtual bool IsChestOpen(int room_id, int chest_index) const = 0;
22 // Legacy editor-wide big-chest preview override.
23 virtual bool IsBigChestOpen() const = 0;
24 // Runtime big chests use the same room+slot flag domain as small chests.
25 // Preserve the legacy global preview toggle as a compatibility override.
26 virtual bool IsBigChestOpen(int room_id, int chest_index) const {
27 return IsChestOpen(room_id, chest_index) || IsBigChestOpen();
28 }
29
30 // Door State
31 virtual bool IsDoorOpen(int room_id, int door_index) const = 0;
32 virtual bool IsDoorSwitchActive(int room_id) const = 0;
33
34 // Big-key locks share the room-event slot counter used by chests in the
35 // original engine ($0498 / RoomFlagMask). Keep this separate from door
36 // state so rooms with multiple locks or a chest before a lock can be
37 // previewed correctly. Existing state implementations inherit chest-slot
38 // behavior until they need a distinct lock preview control.
39 virtual bool IsBigKeyLockOpen(int room_id, int room_event_index) const {
40 return IsChestOpen(room_id, room_event_index);
41 }
42
43 // Water Face State (Type 3 object 0xF80 active variant)
44 // Default false so implementations can opt in without breaking callers.
45 virtual bool IsWaterFaceActive(int room_id) const {
46 (void)room_id;
47 return false;
48 }
49
50 // Dam Floodgate State (Type 2 object 0x137 alternate water-open variant)
51 // Default false so implementations can opt in without breaking callers.
52 virtual bool IsDamFloodgateOpen(int room_id) const {
53 (void)room_id;
54 return false;
55 }
56
57 // Object State
58 virtual bool IsWallMoved(int room_id) const = 0;
59 virtual bool IsFloorBombable(int room_id) const = 0;
60 // True once the room's rupee-floor reward has been collected. USDASM's
61 // RoomDraw_RupeeFloor suppresses the object while this room flag is set.
62 virtual bool IsRupeeFloorCleared(int room_id) const = 0;
63
64 // General Flags
65 virtual bool IsCrystalSwitchBlue() const = 0;
66};
67
68} // namespace zelda3
69} // namespace yaze
70
71#endif // YAZE_ZELDA3_DUNGEON_DUNGEON_STATE_H
Interface for accessing dungeon game state.
virtual bool IsWaterFaceActive(int room_id) const
virtual bool IsFloorBombable(int room_id) const =0
virtual bool IsWallMoved(int room_id) const =0
virtual bool IsChestOpen(int room_id, int chest_index) const =0
virtual bool IsDoorSwitchActive(int room_id) const =0
virtual bool IsDoorOpen(int room_id, int door_index) const =0
virtual bool IsDamFloodgateOpen(int room_id) const
virtual bool IsBigKeyLockOpen(int room_id, int room_event_index) const
virtual bool IsCrystalSwitchBlue() const =0
virtual bool IsRupeeFloorCleared(int room_id) const =0
virtual ~DungeonState()=default
virtual bool IsBigChestOpen() const =0
virtual bool IsBigChestOpen(int room_id, int chest_index) const