From 72851fb047f3f4d95a80ad73670da98023ebd2c1 Mon Sep 17 00:00:00 2001 From: darsh Date: Mon, 29 Sep 2025 23:39:07 -0400 Subject: [PATCH] update member names of FloorProperties struct --- include/structs/str_dungeon.h | 25 +++++++++++++------------ src/dungeon_generation.c | 2 +- src/dungeon_items.c | 2 +- src/dungeon_tilemap.c | 2 +- src/run_dungeon.c | 6 +++--- src/unk_dungeon_load_maybe.c | 2 +- src/weather.c | 2 +- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index a18972e69..f57bc9024 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -121,9 +121,9 @@ typedef struct FloorProperties { u8 layout; s8 roomDensity; - u8 unk2; - u8 unk3; - u8 unk4; + u8 tileset; + u8 bgMusic; + u8 weather; // See include/constants/weather.h u8 floorConnectivity; u8 enemyDensity; u8 kecleonShopChance; // Percentage chance 0-100% @@ -133,19 +133,20 @@ typedef struct FloorProperties bool8 allowDeadEnds; u8 secondaryStructuresBudget; // Maximum number of secondary structures that can be generated u8 roomFlags; // See ROOM_FLAG_ - u8 unkE; + bool8 unkE; // Unreferenced flag u8 itemDensity; u8 trapDensity; - u8 unk11; - u8 unk12; + u8 floorNumber; // Unreferenced + u8 fixedRoomNumber; u8 numExtraHallways; u8 buriedItemDensity; // Density of buried items (in walls) - u8 unk15; - u8 unk16; - u8 unk17; - u8 unk18; - u8 itemlessMonsterHouseChance; // Chance that a monster house will be itemless - u8 unk1A; + u8 unk15; // Unreferenced + u8 visibilityRange; + u8 moneyUpperBound; // Generated money stacks cannot exceed this amount (multiplied by 40) + u8 kecleonShopLayout; + u8 itemlessMonsterHouseChance; // Chance that a monster house will be itemless (always 0) + u8 unk1A; // Unreferenced (always 0) + u8 unk1B; // Unreferenced (always 0) } FloorProperties; enum { diff --git a/src/dungeon_generation.c b/src/dungeon_generation.c index 75eb3b7a2..da85bac45 100644 --- a/src/dungeon_generation.c +++ b/src/dungeon_generation.c @@ -6097,7 +6097,7 @@ static void sub_8051654(FloorProperties *floorProps) if ((tile->terrainFlags & TERRAIN_TYPE_NATURAL_JUNCTION)) continue; - if (sKecleonShopItemSpawnChances[floorProps->unk18][yIndex][xIndex] > DungeonRandInt(100)) { + if (sKecleonShopItemSpawnChances[floorProps->kecleonShopLayout][yIndex][xIndex] > DungeonRandInt(100)) { tile->spawnOrVisibilityFlags.spawn |= SPAWN_FLAG_ITEM; } } diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 7b72e5d24..4121ba661 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -83,7 +83,7 @@ void CreateItemWithStickyChance(Item *item, u8 itemID, u32 forceSticky) } if (GetItemCategory(itemID) == CATEGORY_POKE) { - sub_8046CE4(item, gDungeon->floorProperties.unk17 * 40); + sub_8046CE4(item, gDungeon->floorProperties.moneyUpperBound * 40); } } diff --git a/src/dungeon_tilemap.c b/src/dungeon_tilemap.c index 75cf06e8a..86e993ce7 100644 --- a/src/dungeon_tilemap.c +++ b/src/dungeon_tilemap.c @@ -88,7 +88,7 @@ void sub_803F27C(bool8 a0) gUnknown_202EDFC = 0xFFFF; if (!a0) { - strPtr->visibilityRange = gDungeon->floorProperties.unk16 & 3; + strPtr->visibilityRange = gDungeon->floorProperties.visibilityRange & 3; if (strPtr->visibilityRange == 0) { strPtr->unk1820C = 1; } diff --git a/src/run_dungeon.c b/src/run_dungeon.c index eec8be2ec..94d289148 100644 --- a/src/run_dungeon.c +++ b/src/run_dungeon.c @@ -309,9 +309,9 @@ void RunDungeon_Async(DungeonSetupStruct *setupPtr) gDungeon->unk644.unk40 = 99; gDungeon->unk644.unk42 = 99; gDungeon->weather.weather = 0; - gDungeon->tileset = gDungeon->floorProperties.unk2; - gDungeon->unk3A10 = gDungeon->floorProperties.unk3; - gDungeon->fixedRoomNumber = gDungeon->floorProperties.unk12; + gDungeon->tileset = gDungeon->floorProperties.tileset; + gDungeon->unk3A10 = gDungeon->floorProperties.bgMusic; + gDungeon->fixedRoomNumber = gDungeon->floorProperties.fixedRoomNumber; sub_807E5E4(0); sub_80842F0(); } diff --git a/src/unk_dungeon_load_maybe.c b/src/unk_dungeon_load_maybe.c index e1a92d80b..0f3d7d633 100644 --- a/src/unk_dungeon_load_maybe.c +++ b/src/unk_dungeon_load_maybe.c @@ -42,7 +42,7 @@ void sub_80ADD9C(OpenedFile **a0, OpenedFile **a1, u32 *a2, void *a3, u16 *a4, c } strPtr = &((struct DungeonMapParam2 *)(mapParamFile->data))->unk0[dungId][dungFloor]; - r8 = ((struct DungeonMapParam2 *)(mapParamFile->data))->floorProperties[strPtr->unk0].unk2; + r8 = ((struct DungeonMapParam2 *)(mapParamFile->data))->floorProperties[strPtr->unk0].tileset; CloseFile(mapParamFile); diff --git a/src/weather.c b/src/weather.c index a4d4b1a69..809d8d8d3 100644 --- a/src/weather.c +++ b/src/weather.c @@ -51,7 +51,7 @@ u8 GetApparentWeather(Entity *pokemon) void sub_807E5AC(void) { u8 weather; - weather = gDungeon->floorProperties.unk4; + weather = gDungeon->floorProperties.weather; if(weather == WEATHER_COUNT) weather = DungeonRandInt(WEATHER_COUNT); sub_807E5E4(weather);