diff --git a/asm/code_806CD90.s b/asm/code_806CD90.s index 040cc3189..fc34120ec 100644 --- a/asm/code_806CD90.s +++ b/asm/code_806CD90.s @@ -2030,7 +2030,7 @@ _0806E040: ldr r1, _0806E0C0 adds r0, r1 ldrb r0, [r0] - bl IsDungeonUnk1 + bl DoEnemiesEvolveWhenKOed lsls r0, 24 cmp r0, 0 beq _0806E066 diff --git a/include/dungeon.h b/include/dungeon.h index 3fc27fd1c..73a3b72fc 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -12,7 +12,9 @@ struct DungeonName struct DungeonDataEntry { /* 0x0 */ bool8 stairDirectionUp; - /* 0x1 */ bool8 unk1; + // If enabled, enemies will evolve when a team member is KOed (and doesn't revive) if their evolution spawns on the floor. + // False for all dungeons, but the code still works if this flag is enabled. + /* 0x1 */ bool8 enemiesEvolveWhenKOed; /* 0x2 */ bool8 recruitingEnabled; /* 0x3 */ s8 rescuesAllowed; /* 0x4 */ u8 maxItemsAllowed; @@ -24,7 +26,9 @@ struct DungeonDataEntry /* 0xA */ bool8 enterWithoutGameSave; // If false, the dungeon will force a quicksave before entering. /* 0xB */ u8 HMMask; // HM mask for dungeon entry requirements (Fly, Dive, Waterfall, Surf, Water). /* 0xC */ s16 turnLimit; - /* 0xE */ s16 randomMovementChance; // The chance that a wild Pokémon's moveRandomly flag will be set when spawning, causing them to move randomly inside a room instead of exploring rooms. + // The chance that a wild Pokémon's moveRandomly flag will be set when spawning, + // causing them to move randomly inside a room instead of exploring rooms. + /* 0xE */ s16 randomMovementChance; }; extern struct DungeonDataEntry gDungeons[]; diff --git a/src/dungeon.c b/src/dungeon.c index 395f80a96..ec4a5f55e 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -159,7 +159,7 @@ void RestoreDungeonLocation(struct unkStruct_8094924* r0, struct DungeonLocation RestoreIntegerBits(r0, &r1->floor, 0x7); } -bool8 IsDungeonUnk1(u8 dungeon) +bool8 DoEnemiesEvolveWhenKOed(u8 dungeon) { - return gDungeons[dungeon].unk1; + return gDungeons[dungeon].enemiesEvolveWhenKOed; } diff --git a/tools/dungeonjson/dungeonjson.cpp b/tools/dungeonjson/dungeonjson.cpp index 71a6cb030..ddf4dbf65 100644 --- a/tools/dungeonjson/dungeonjson.cpp +++ b/tools/dungeonjson/dungeonjson.cpp @@ -765,7 +765,7 @@ string generate_dungeon_data_text(Json data) { text << "gDungeons:"; for (Json data_entry : data.array_items()) { text << read_json_bool(data_entry["stairDirectionUp"]) - << read_json_bool(data_entry["unk1"]) + << read_json_bool(data_entry["enemiesEvolveWhenKOed"]) << read_json_bool(data_entry["recruitingEnabled"]) << read_json_int(data_entry["rescuesAllowed"], 1) << read_json_int(data_entry["maxItemsAllowed"], 1)