From b47d8f5f0a298414cb75396ad8b6e692be523d3a Mon Sep 17 00:00:00 2001 From: "Matthew D. Steele" Date: Mon, 13 May 2024 17:14:44 -0400 Subject: [PATCH] Add placeholder data for missing Shadow rooms --- src/room.asm | 9 +++ src/room.inc | 3 + src/rooms/boss_shadow.asm | 4 +- src/rooms/shadow_depths.asm | 2 +- src/rooms/shadow_descent.asm | 109 +++++++++++++++++++++++++++++++++++ src/rooms/shadow_descent.bg | 32 ++++++++++ src/rooms/shadow_drill.asm | 2 +- src/rooms/shadow_flower.asm | 85 +++++++++++++++++++++++++++ src/rooms/shadow_flower.bg | 23 ++++++++ src/rooms/shadow_heart.asm | 82 ++++++++++++++++++++++++++ src/rooms/shadow_heart.bg | 23 ++++++++ src/rooms/shadow_trap.asm | 2 +- tests/scenario.py | 22 +++++-- 13 files changed, 388 insertions(+), 10 deletions(-) create mode 100644 src/rooms/shadow_descent.asm create mode 100644 src/rooms/shadow_descent.bg create mode 100644 src/rooms/shadow_flower.asm create mode 100644 src/rooms/shadow_flower.bg create mode 100644 src/rooms/shadow_heart.asm create mode 100644 src/rooms/shadow_heart.bg diff --git a/src/room.asm b/src/room.asm index 710b99e6..bf7939ab 100644 --- a/src/room.asm +++ b/src/room.asm @@ -146,10 +146,13 @@ .IMPORT DataC_Sewer_Trap_sRoom .IMPORT DataC_Sewer_West_sRoom .IMPORT DataC_Shadow_Depths_sRoom +.IMPORT DataC_Shadow_Descent_sRoom .IMPORT DataC_Shadow_Drill_sRoom .IMPORT DataC_Shadow_Entry_sRoom +.IMPORT DataC_Shadow_Flower_sRoom .IMPORT DataC_Shadow_Gate_sRoom .IMPORT DataC_Shadow_Hall_sRoom +.IMPORT DataC_Shadow_Heart_sRoom .IMPORT DataC_Shadow_Teleport_sRoom .IMPORT DataC_Shadow_Trap_sRoom .IMPORT DataC_Temple_Altar_sRoom @@ -412,10 +415,13 @@ _LoadNewRoom: d_entry table, SewerTrap, DataC_Sewer_Trap_sRoom d_entry table, SewerWest, DataC_Sewer_West_sRoom d_entry table, ShadowDepths, DataC_Shadow_Depths_sRoom + d_entry table, ShadowDescent, DataC_Shadow_Descent_sRoom d_entry table, ShadowDrill, DataC_Shadow_Drill_sRoom d_entry table, ShadowEntry, DataC_Shadow_Entry_sRoom + d_entry table, ShadowFlower, DataC_Shadow_Flower_sRoom d_entry table, ShadowGate, DataC_Shadow_Gate_sRoom d_entry table, ShadowHall, DataC_Shadow_Hall_sRoom + d_entry table, ShadowHeart, DataC_Shadow_Heart_sRoom d_entry table, ShadowTeleport, DataC_Shadow_Teleport_sRoom d_entry table, ShadowTrap, DataC_Shadow_Trap_sRoom d_entry table, TempleAltar, DataC_Temple_Altar_sRoom @@ -605,10 +611,13 @@ _PrisonMusic: d_byte SewerTrap, eMusic::Silence d_byte SewerWest, eMusic::Silence d_byte ShadowDepths, eMusic::Silence + d_byte ShadowDescent, eMusic::Silence d_byte ShadowDrill, eMusic::Silence d_byte ShadowEntry, eMusic::Silence + d_byte ShadowFlower, eMusic::Silence d_byte ShadowGate, eMusic::Silence d_byte ShadowHall, eMusic::Silence + d_byte ShadowHeart, eMusic::Silence d_byte ShadowTeleport, eMusic::Silence d_byte ShadowTrap, eMusic::Silence d_byte TempleAltar, eMusic::Temple diff --git a/src/room.inc b/src/room.inc index 7d1f0b9f..a47db269 100644 --- a/src/room.inc +++ b/src/room.inc @@ -156,10 +156,13 @@ kMaxPassages = 8 SewerTrap SewerWest ShadowDepths + ShadowDescent ShadowDrill ShadowEntry + ShadowFlower ShadowGate ShadowHall + ShadowHeart ShadowTeleport ShadowTrap TempleAltar diff --git a/src/rooms/boss_shadow.asm b/src/rooms/boss_shadow.asm index f262c1b2..7457c51f 100644 --- a/src/rooms/boss_shadow.asm +++ b/src/rooms/boss_shadow.asm @@ -183,7 +183,7 @@ _Machines_sMachine_arr: d_byte Code_eProgram, eProgram::BossShadowEmitterX d_byte Breaker_eFlag, 0 d_byte Flags_bMachine, bMachine::Act | bMachine::WriteE - d_byte Status_eDiagram, eDiagram::MinigunDown + d_byte Status_eDiagram, eDiagram::MinigunDown ; TODO d_word ScrollGoalX_u16, $0 d_byte ScrollGoalY_u8, $0 d_byte RegNames_u8_arr4, 0, 0, "X", 0 @@ -202,7 +202,7 @@ _Machines_sMachine_arr: d_byte Code_eProgram, eProgram::BossShadowEmitterY d_byte Breaker_eFlag, 0 d_byte Flags_bMachine, bMachine::Act | bMachine::WriteF - d_byte Status_eDiagram, eDiagram::MinigunLeft + d_byte Status_eDiagram, eDiagram::MinigunLeft ; TODO d_word ScrollGoalX_u16, $0 d_byte ScrollGoalY_u8, $0 d_byte RegNames_u8_arr4, 0, 0, 0, "Y" diff --git a/src/rooms/shadow_depths.asm b/src/rooms/shadow_depths.asm index 456b67f0..125463c1 100644 --- a/src/rooms/shadow_depths.asm +++ b/src/rooms/shadow_depths.asm @@ -105,7 +105,7 @@ _Devices_sDevice_arr: _Passages_sPassage_arr: : D_STRUCT sPassage d_byte Exit_bPassage, ePassage::Western | 0 - d_byte Destination_eRoom, eRoom::ShadowDepths ; TODO: ShadowDescent + d_byte Destination_eRoom, eRoom::ShadowDescent d_byte SpawnBlock_u8, 11 d_byte SpawnAdjust_byte, 0 D_END diff --git a/src/rooms/shadow_descent.asm b/src/rooms/shadow_descent.asm new file mode 100644 index 00000000..d83e94dd --- /dev/null +++ b/src/rooms/shadow_descent.asm @@ -0,0 +1,109 @@ +;;;=========================================================================;;; +;;; Copyright 2022 Matthew D. Steele ;;; +;;; ;;; +;;; This file is part of Annalog. ;;; +;;; ;;; +;;; Annalog is free software: you can redistribute it and/or modify it ;;; +;;; under the terms of the GNU General Public License as published by the ;;; +;;; Free Software Foundation, either version 3 of the License, or (at your ;;; +;;; option) any later version. ;;; +;;; ;;; +;;; Annalog is distributed in the hope that it will be useful, but WITHOUT ;;; +;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;;; +;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;;; +;;; for more details. ;;; +;;; ;;; +;;; You should have received a copy of the GNU General Public License along ;;; +;;; with Annalog. If not, see . ;;; +;;;=========================================================================;;; + +.INCLUDE "../actor.inc" +.INCLUDE "../actors/orc.inc" +.INCLUDE "../actors/townsfolk.inc" +.INCLUDE "../device.inc" +.INCLUDE "../macros.inc" +.INCLUDE "../platform.inc" +.INCLUDE "../platforms/lava.inc" +.INCLUDE "../room.inc" + +.IMPORT DataA_Room_Shadow_sTileset +.IMPORT FuncA_Objects_AnimateLavaTerrain +.IMPORT FuncA_Terrain_FadeInTallRoomWithLava +.IMPORT Func_Noop +.IMPORT Ppu_ChrObjShadow + +;;;=========================================================================;;; + +.SEGMENT "PRGC_Shadow" + +.EXPORT DataC_Shadow_Descent_sRoom +.PROC DataC_Shadow_Descent_sRoom + D_STRUCT sRoom + d_byte MinScrollX_u8, $10 + d_word MaxScrollX_u16, $0010 + d_byte Flags_bRoom, bRoom::Tall | eArea::Shadow + d_byte MinimapStartRow_u8, 13 + d_byte MinimapStartCol_u8, 4 + d_addr TerrainData_ptr, _TerrainData + d_byte NumMachines_u8, 0 + d_addr Machines_sMachine_arr_ptr, 0 + d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjShadow) + d_addr Ext_sRoomExt_ptr, _Ext_sRoomExt + D_END +_Ext_sRoomExt: + D_STRUCT sRoomExt + d_addr Terrain_sTileset_ptr, DataA_Room_Shadow_sTileset + d_addr Platforms_sPlatform_arr_ptr, _Platforms_sPlatform_arr + d_addr Actors_sActor_arr_ptr, _Actors_sActor_arr + d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr + d_addr Passages_sPassage_arr_ptr, _Passages_sPassage_arr + d_addr Enter_func_ptr, Func_Noop + d_addr FadeIn_func_ptr, FuncA_Terrain_FadeInTallRoomWithLava + d_addr Tick_func_ptr, Func_Noop + d_addr Draw_func_ptr, FuncA_Objects_AnimateLavaTerrain + D_END +_TerrainData: +: .incbin "out/rooms/shadow_descent.room" + .assert * - :- = 18 * 24, error +_Platforms_sPlatform_arr: +: ;; Lava: + D_STRUCT sPlatform + d_byte Type_ePlatform, ePlatform::Kill + d_word WidthPx_u16, $120 + d_byte HeightPx_u8, kLavaPlatformHeightPx + d_word Left_i16, $0000 + d_word Top_i16, kLavaPlatformTopTallRoom + D_END + .assert * - :- <= kMaxPlatforms * .sizeof(sPlatform), error + .byte ePlatform::None +_Actors_sActor_arr: +: ;; TODO + .assert * - :- <= kMaxActors * .sizeof(sActor), error + .byte eActor::None +_Devices_sDevice_arr: +: ;; TODO + .assert * - :- <= kMaxDevices * .sizeof(sDevice), error + .byte eDevice::None +_Passages_sPassage_arr: +: D_STRUCT sPassage + d_byte Exit_bPassage, ePassage::Western | 0 + d_byte Destination_eRoom, eRoom::ShadowFlower + d_byte SpawnBlock_u8, 5 + d_byte SpawnAdjust_byte, 0 + D_END + D_STRUCT sPassage + d_byte Exit_bPassage, ePassage::Eastern | 0 + d_byte Destination_eRoom, eRoom::ShadowDrill + d_byte SpawnBlock_u8, 5 + d_byte SpawnAdjust_byte, 0 + D_END + D_STRUCT sPassage + d_byte Exit_bPassage, ePassage::Eastern | 1 + d_byte Destination_eRoom, eRoom::ShadowDepths + d_byte SpawnBlock_u8, 20 + d_byte SpawnAdjust_byte, 0 + D_END + .assert * - :- <= kMaxPassages * .sizeof(sPassage), error +.ENDPROC + +;;;=========================================================================;;; diff --git a/src/rooms/shadow_descent.bg b/src/rooms/shadow_descent.bg new file mode 100644 index 00000000..c39a2076 --- /dev/null +++ b/src/rooms/shadow_descent.bg @@ -0,0 +1,32 @@ +@BG 0 0 0 18x24 +>shadow_0 +>shadow_1 +>shadow_2 +>shadow_3 +>shadow_4 +>shadow_5 + +EOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +EOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +EOEO EOEO +EOEO EOEO + + +EOEOEO EOEOEO +EOEO EOEO +EOEO EOEOEOEOEOEOEOEO EOEO +EOEO EOEO +EOEOEO EOEOEO +EOEO EOEO +EOEO EOEOEOEOEOEO EOEO +EOEO EOEO +EOEOEO EOEOEO +EOEO EOEO +EOEO EOEOEOEO EOEO +EOEO EOEO +EOEOEO EOEOEO +EOEO +EOEO EOEOEOEO +EOEOEOEO EOEOEOEO EOEOEOEO +ALALALALALALALALALALALALALALALALALAL +ALALALALALALALALALALALALALALALALALAL diff --git a/src/rooms/shadow_drill.asm b/src/rooms/shadow_drill.asm index 62e5f019..2b7b3359 100644 --- a/src/rooms/shadow_drill.asm +++ b/src/rooms/shadow_drill.asm @@ -149,7 +149,7 @@ _Passages_sPassage_arr: D_END D_STRUCT sPassage d_byte Exit_bPassage, ePassage::Western | 1 - d_byte Destination_eRoom, eRoom::ShadowDrill ; TODO ShadowDescent + d_byte Destination_eRoom, eRoom::ShadowDescent d_byte SpawnBlock_u8, 21 d_byte SpawnAdjust_byte, 0 D_END diff --git a/src/rooms/shadow_flower.asm b/src/rooms/shadow_flower.asm new file mode 100644 index 00000000..54e87fe1 --- /dev/null +++ b/src/rooms/shadow_flower.asm @@ -0,0 +1,85 @@ +;;;=========================================================================;;; +;;; Copyright 2022 Matthew D. Steele ;;; +;;; ;;; +;;; This file is part of Annalog. ;;; +;;; ;;; +;;; Annalog is free software: you can redistribute it and/or modify it ;;; +;;; under the terms of the GNU General Public License as published by the ;;; +;;; Free Software Foundation, either version 3 of the License, or (at your ;;; +;;; option) any later version. ;;; +;;; ;;; +;;; Annalog is distributed in the hope that it will be useful, but WITHOUT ;;; +;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;;; +;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;;; +;;; for more details. ;;; +;;; ;;; +;;; You should have received a copy of the GNU General Public License along ;;; +;;; with Annalog. If not, see . ;;; +;;;=========================================================================;;; + +.INCLUDE "../actor.inc" +.INCLUDE "../device.inc" +.INCLUDE "../macros.inc" +.INCLUDE "../platform.inc" +.INCLUDE "../room.inc" + +.IMPORT DataA_Room_Shadow_sTileset +.IMPORT Func_Noop +.IMPORT Ppu_ChrObjShadow + +;;;=========================================================================;;; + +.SEGMENT "PRGC_Shadow" + +.EXPORT DataC_Shadow_Flower_sRoom +.PROC DataC_Shadow_Flower_sRoom + D_STRUCT sRoom + d_byte MinScrollX_u8, $00 + d_word MaxScrollX_u16, $0000 + d_byte Flags_bRoom, eArea::Shadow + d_byte MinimapStartRow_u8, 13 + d_byte MinimapStartCol_u8, 3 + d_addr TerrainData_ptr, _TerrainData + d_byte NumMachines_u8, 0 + d_addr Machines_sMachine_arr_ptr, 0 + d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjShadow) + d_addr Ext_sRoomExt_ptr, _Ext_sRoomExt + D_END +_Ext_sRoomExt: + D_STRUCT sRoomExt + d_addr Terrain_sTileset_ptr, DataA_Room_Shadow_sTileset + d_addr Platforms_sPlatform_arr_ptr, _Platforms_sPlatform_arr + d_addr Actors_sActor_arr_ptr, _Actors_sActor_arr + d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr + d_addr Passages_sPassage_arr_ptr, _Passages_sPassage_arr + d_addr Enter_func_ptr, Func_Noop + d_addr FadeIn_func_ptr, Func_Noop + d_addr Tick_func_ptr, Func_Noop + d_addr Draw_func_ptr, Func_Noop + D_END +_TerrainData: +: .incbin "out/rooms/shadow_flower.room" + .assert * - :- = 17 * 15, error +_Platforms_sPlatform_arr: +: ;; TODO + .assert * - :- <= kMaxPlatforms * .sizeof(sPlatform), error + .byte ePlatform::None +_Actors_sActor_arr: +: ;; TODO + .assert * - :- <= kMaxActors * .sizeof(sActor), error + .byte eActor::None +_Devices_sDevice_arr: +: ;; TODO + .assert * - :- <= kMaxDevices * .sizeof(sDevice), error + .byte eDevice::None +_Passages_sPassage_arr: +: D_STRUCT sPassage + d_byte Exit_bPassage, ePassage::Eastern | 0 + d_byte Destination_eRoom, eRoom::ShadowDescent + d_byte SpawnBlock_u8, 5 + d_byte SpawnAdjust_byte, 0 + D_END + .assert * - :- <= kMaxPassages * .sizeof(sPassage), error +.ENDPROC + +;;;=========================================================================;;; diff --git a/src/rooms/shadow_flower.bg b/src/rooms/shadow_flower.bg new file mode 100644 index 00000000..bd42309e --- /dev/null +++ b/src/rooms/shadow_flower.bg @@ -0,0 +1,23 @@ +@BG 0 0 0 17x15 +>shadow_0 +>shadow_1 +>shadow_2 +>shadow_3 +>shadow_4 +>shadow_5 + +EOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +EOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +EO EOEO +EO EOEO +EO +EO +EO EOEOEO +EO EOEO +EO EOEO EOEO +EO EOEO +EO EOEOEO +EO EOEO +EOEOEOEO EOEOEOEO +EOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +EOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO diff --git a/src/rooms/shadow_heart.asm b/src/rooms/shadow_heart.asm new file mode 100644 index 00000000..619cf629 --- /dev/null +++ b/src/rooms/shadow_heart.asm @@ -0,0 +1,82 @@ +;;;=========================================================================;;; +;;; Copyright 2022 Matthew D. Steele ;;; +;;; ;;; +;;; This file is part of Annalog. ;;; +;;; ;;; +;;; Annalog is free software: you can redistribute it and/or modify it ;;; +;;; under the terms of the GNU General Public License as published by the ;;; +;;; Free Software Foundation, either version 3 of the License, or (at your ;;; +;;; option) any later version. ;;; +;;; ;;; +;;; Annalog is distributed in the hope that it will be useful, but WITHOUT ;;; +;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;;; +;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;;; +;;; for more details. ;;; +;;; ;;; +;;; You should have received a copy of the GNU General Public License along ;;; +;;; with Annalog. If not, see . ;;; +;;;=========================================================================;;; + +.INCLUDE "../actor.inc" +.INCLUDE "../device.inc" +.INCLUDE "../macros.inc" +.INCLUDE "../platform.inc" +.INCLUDE "../room.inc" + +.IMPORT DataA_Room_Shadow_sTileset +.IMPORT Data_Empty_sActor_arr +.IMPORT Func_Noop +.IMPORT Ppu_ChrObjShadow + +;;;=========================================================================;;; + +.SEGMENT "PRGC_Shadow" + +.EXPORT DataC_Shadow_Heart_sRoom +.PROC DataC_Shadow_Heart_sRoom + D_STRUCT sRoom + d_byte MinScrollX_u8, $10 + d_word MaxScrollX_u16, $0110 + d_byte Flags_bRoom, eArea::Shadow + d_byte MinimapStartRow_u8, 13 + d_byte MinimapStartCol_u8, 7 + d_addr TerrainData_ptr, _TerrainData + d_byte NumMachines_u8, 0 + d_addr Machines_sMachine_arr_ptr, 0 + d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjShadow) + d_addr Ext_sRoomExt_ptr, _Ext_sRoomExt + D_END +_Ext_sRoomExt: + D_STRUCT sRoomExt + d_addr Terrain_sTileset_ptr, DataA_Room_Shadow_sTileset + d_addr Platforms_sPlatform_arr_ptr, _Platforms_sPlatform_arr + d_addr Actors_sActor_arr_ptr, Data_Empty_sActor_arr + d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr + d_addr Passages_sPassage_arr_ptr, _Passages_sPassage_arr + d_addr Enter_func_ptr, Func_Noop + d_addr FadeIn_func_ptr, Func_Noop + d_addr Tick_func_ptr, Func_Noop + d_addr Draw_func_ptr, Func_Noop + D_END +_TerrainData: +: .incbin "out/rooms/shadow_heart.room" + .assert * - :- = 33 * 15, error +_Platforms_sPlatform_arr: +: ;; TODO + .assert * - :- <= kMaxPlatforms * .sizeof(sPlatform), error + .byte ePlatform::None +_Devices_sDevice_arr: +: ;; TODO + .assert * - :- <= kMaxDevices * .sizeof(sDevice), error + .byte eDevice::None +_Passages_sPassage_arr: +: D_STRUCT sPassage + d_byte Exit_bPassage, ePassage::Western | 0 + d_byte Destination_eRoom, eRoom::ShadowTrap + d_byte SpawnBlock_u8, 10 + d_byte SpawnAdjust_byte, 0 + D_END + .assert * - :- <= kMaxPassages * .sizeof(sPassage), error +.ENDPROC + +;;;=========================================================================;;; diff --git a/src/rooms/shadow_heart.bg b/src/rooms/shadow_heart.bg new file mode 100644 index 00000000..b5da564c --- /dev/null +++ b/src/rooms/shadow_heart.bg @@ -0,0 +1,23 @@ +@BG 0 0 0 33x15 +>shadow_0 +>shadow_1 +>shadow_2 +>shadow_3 +>shadow_4 +>shadow_5 + +EFEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +EGEO EO +ECEO EO +EMEO EO +EJEO EO +EMEO EO +EHEO EO +EBEOEO EO +ENEOEO EO + EO + EO +EEEOEO EO +EMEOEO EOEO EO +EGEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO +ENEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEOEO diff --git a/src/rooms/shadow_trap.asm b/src/rooms/shadow_trap.asm index e17f010a..ffa42bb2 100644 --- a/src/rooms/shadow_trap.asm +++ b/src/rooms/shadow_trap.asm @@ -247,7 +247,7 @@ _Passages_sPassage_arr: D_END D_STRUCT sPassage d_byte Exit_bPassage, ePassage::Eastern | 0 - d_byte Destination_eRoom, eRoom::ShadowTrap ; TODO ShadowHeart + d_byte Destination_eRoom, eRoom::ShadowHeart d_byte SpawnBlock_u8, 10 d_byte SpawnAdjust_byte, 0 D_END diff --git a/tests/scenario.py b/tests/scenario.py index 94cf33a2..2fc1c915 100644 --- a/tests/scenario.py +++ b/tests/scenario.py @@ -32,11 +32,17 @@ 'CityCenter': (1, 21), } -PERMITTED_OOB_CELLS = set([ +PERMITTED_OOB_CELLS = frozenset([ ('CoreWest', (3, 10)), ('GardenLanding', (6, 7)), ]) +PERMITTED_UNCOVERED_CELLS = { + 'Factory': frozenset([(5, 14)]), + 'Garden': frozenset([(4, 6), (5, 6)]), + 'Lava': frozenset([(12, 14)]), +} + ROOM_PARENTS = { 'BossCity': 'CitySinkhole', 'BossCrypt': 'CryptTomb', @@ -323,7 +329,7 @@ def test_markers_sorted(markers): def test_minimap_coverage(areas, minimap): failed = False - all_cells = {} + all_cells = {} # maps from cell to area name it's in for area_name, area in areas.items(): area_cells = area['cells'] for cell in area_cells: @@ -368,7 +374,11 @@ def test_room_cells(areas): failed = True else: covered_area_cells[cell] = room_name - # TODO: Once all rooms are added, require all area cells to be covered. + for cell in area_cells - frozenset(covered_area_cells): + if cell not in PERMITTED_UNCOVERED_CELLS.get(area_name, ()): + print('SCENARIO: {} cell {} is not covered by any room'.format( + area_name, cell)) + failed = True return failed def test_room_doors(areas): @@ -403,8 +413,10 @@ def test_room_passages(areas): for passage in room['passages']: dest_area = areas[passage['dest_area']] dest_room_name = passage['dest_room'] - # TODO: remove this if statement once all rooms are added. - if dest_room_name == room_name: continue + if dest_room_name == room_name: + print('SCENARIO: {} has a passage to itself'.format( + room_name)) + continue dest_room = dest_area['rooms'][dest_room_name] side = passage['side'] for dest_passage in dest_room['passages']: