summary refs log tree commit diff stats
path: root/utils
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-07-26 04:53:11 -0400
committerGitHub <noreply@github.com>2024-07-26 10:53:11 +0200
commit7641d9590110fa7b4901c7f7ca0384392ef24375 (patch)
tree8efdfa5be3a88879a690a4a7351eb7b635989dc7 /utils
parent00c16023c45301224400a06f31f637fdedba00ee (diff)
downloadlingo-apworld-7641d9590110fa7b4901c7f7ca0384392ef24375.tar.gz
lingo-apworld-7641d9590110fa7b4901c7f7ca0384392ef24375.tar.bz2
lingo-apworld-7641d9590110fa7b4901c7f7ca0384392ef24375.zip
Lingo: Add panels mode door shuffle (#3163)
* Created panels mode door shuffle

* Added some panel door item names

* Remove RUNT TURN panel door

Not really useful.

* Fix logic with First SIX related stuff

* Add group_doors to slot data

* Fix LEVEL 2 behavior with panels mode

* Fixed unit tests

* Fixed duplicate IDs from merge

* Just regenerated new IDs

* Fixed duplication of color and door group items

* Removed unnecessary unit test option

* Fix The Seeker being achievable without entrance door

* Fix The Observant being achievable without locked panels

* Added some more panel doors

* Added Progressive Suits Area

* Lingo: Fix Basement access with THE MASTER

* Added indirect conditions for MASTER-blocked entrances

* Fixed Incomparable achievement access

* Fix STAIRS panel logic

* Fix merge error with good items

* Is this clearer?

* DREAD and TURN LEARN

* Allow a weird edge case for reduced locations

Panels mode door shuffle + grouped doors + color shuffle + pilgrimage enabled is exactly the right number of items for reduced locations. Removing color shuffle also allows for disabling pilgrimage, adding sunwarp locking, or both, with a couple of locations left over.

* Prevent small sphere one on panels mode

* Added shuffle_doors aliases for old options

* Fixed a unit test

* Updated datafile

* Tweaked requirements for reduced locations

* Added player name to OptionError messages

* Update generated.dat
Diffstat (limited to 'utils')
-rw-r--r--utils/assign_ids.rb40
-rw-r--r--utils/pickle_static_data.py124
-rw-r--r--utils/validate_config.rb88
3 files changed, 228 insertions, 24 deletions
diff --git a/utils/assign_ids.rb b/utils/assign_ids.rb index 9e1ce67..f7de3d0 100644 --- a/utils/assign_ids.rb +++ b/utils/assign_ids.rb
@@ -73,6 +73,22 @@ if old_generated.include? "door_groups" then
73 end 73 end
74 end 74 end
75end 75end
76if old_generated.include? "panel_doors" then
77 old_generated["panel_doors"].each do |room, panel_doors|
78 panel_doors.each do |name, id|
79 if id >= next_item_id then
80 next_item_id = id + 1
81 end
82 end
83 end
84end
85if old_generated.include? "panel_groups" then
86 old_generated["panel_groups"].each do |name, id|
87 if id >= next_item_id then
88 next_item_id = id + 1
89 end
90 end
91end
76if old_generated.include? "progression" then 92if old_generated.include? "progression" then
77 old_generated["progression"].each do |name, id| 93 old_generated["progression"].each do |name, id|
78 if id >= next_item_id then 94 if id >= next_item_id then
@@ -82,6 +98,7 @@ if old_generated.include? "progression" then
82end 98end
83 99
84door_groups = Set[] 100door_groups = Set[]
101panel_groups = Set[]
85 102
86config = YAML.load_file(configpath) 103config = YAML.load_file(configpath)
87config.each do |room_name, room_data| 104config.each do |room_name, room_data|
@@ -163,6 +180,29 @@ config.each do |room_name, room_data|
163 end 180 end
164 end 181 end
165 182
183 if room_data.include? "panel_doors"
184 room_data["panel_doors"].each do |panel_door_name, panel_door|
185 unless old_generated.include? "panel_doors" and old_generated["panel_doors"].include? room_name and old_generated["panel_doors"][room_name].include? panel_door_name then
186 old_generated["panel_doors"] ||= {}
187 old_generated["panel_doors"][room_name] ||= {}
188 old_generated["panel_doors"][room_name][panel_door_name] = next_item_id
189
190 next_item_id += 1
191 end
192
193 if panel_door.include? "panel_group" and not panel_groups.include? panel_door["panel_group"] then
194 panel_groups.add(panel_door["panel_group"])
195
196 unless old_generated.include? "panel_groups" and old_generated["panel_groups"].include? panel_door["panel_group"] then
197 old_generated["panel_groups"] ||= {}
198 old_generated["panel_groups"][panel_door["panel_group"]] = next_item_id
199
200 next_item_id += 1
201 end
202 end
203 end
204 end
205
166 if room_data.include? "progression" 206 if room_data.include? "progression"
167 room_data["progression"].each do |progression_name, pdata| 207 room_data["progression"].each do |progression_name, pdata|
168 unless old_generated.include? "progression" and old_generated["progression"].include? progression_name then 208 unless old_generated.include? "progression" and old_generated["progression"].include? progression_name then
diff --git a/utils/pickle_static_data.py b/utils/pickle_static_data.py index e40c21c..92bcb7a 100644 --- a/utils/pickle_static_data.py +++ b/utils/pickle_static_data.py
@@ -6,8 +6,8 @@ import sys
6sys.path.append(os.path.join("worlds", "lingo")) 6sys.path.append(os.path.join("worlds", "lingo"))
7sys.path.append(".") 7sys.path.append(".")
8sys.path.append("..") 8sys.path.append("..")
9from datatypes import Door, DoorType, EntranceType, Painting, Panel, Progression, Room, RoomAndDoor, RoomAndPanel,\ 9from datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor,\
10 RoomEntrance 10 RoomAndPanel, RoomAndPanelDoor, RoomEntrance
11 11
12import hashlib 12import hashlib
13import pickle 13import pickle
@@ -18,10 +18,12 @@ import Utils
18ALL_ROOMS: List[Room] = [] 18ALL_ROOMS: List[Room] = []
19DOORS_BY_ROOM: Dict[str, Dict[str, Door]] = {} 19DOORS_BY_ROOM: Dict[str, Dict[str, Door]] = {}
20PANELS_BY_ROOM: Dict[str, Dict[str, Panel]] = {} 20PANELS_BY_ROOM: Dict[str, Dict[str, Panel]] = {}
21PANEL_DOORS_BY_ROOM: Dict[str, Dict[str, PanelDoor]] = {}
21PAINTINGS: Dict[str, Painting] = {} 22PAINTINGS: Dict[str, Painting] = {}
22 23
23PROGRESSIVE_ITEMS: List[str] = [] 24PROGRESSIVE_ITEMS: Set[str] = set()
24PROGRESSION_BY_ROOM: Dict[str, Dict[str, Progression]] = {} 25PROGRESSIVE_DOORS_BY_ROOM: Dict[str, Dict[str, Progression]] = {}
26PROGRESSIVE_PANELS_BY_ROOM: Dict[str, Dict[str, Progression]] = {}
25 27
26PAINTING_ENTRANCES: int = 0 28PAINTING_ENTRANCES: int = 0
27PAINTING_EXIT_ROOMS: Set[str] = set() 29PAINTING_EXIT_ROOMS: Set[str] = set()
@@ -37,8 +39,13 @@ PANEL_LOCATION_IDS: Dict[str, Dict[str, int]] = {}
37DOOR_LOCATION_IDS: Dict[str, Dict[str, int]] = {} 39DOOR_LOCATION_IDS: Dict[str, Dict[str, int]] = {}
38DOOR_ITEM_IDS: Dict[str, Dict[str, int]] = {} 40DOOR_ITEM_IDS: Dict[str, Dict[str, int]] = {}
39DOOR_GROUP_ITEM_IDS: Dict[str, int] = {} 41DOOR_GROUP_ITEM_IDS: Dict[str, int] = {}
42PANEL_DOOR_ITEM_IDS: Dict[str, Dict[str, int]] = {}
43PANEL_GROUP_ITEM_IDS: Dict[str, int] = {}
40PROGRESSIVE_ITEM_IDS: Dict[str, int] = {} 44PROGRESSIVE_ITEM_IDS: Dict[str, int] = {}
41 45
46# This doesn't need to be stored in the datafile.
47PANEL_DOOR_BY_PANEL_BY_ROOM: Dict[str, Dict[str, str]] = {}
48
42 49
43def hash_file(path): 50def hash_file(path):
44 md5 = hashlib.md5() 51 md5 = hashlib.md5()
@@ -53,7 +60,7 @@ def hash_file(path):
53 60
54def load_static_data(ll1_path, ids_path): 61def load_static_data(ll1_path, ids_path):
55 global PAINTING_EXITS, SPECIAL_ITEM_IDS, PANEL_LOCATION_IDS, DOOR_LOCATION_IDS, DOOR_ITEM_IDS, \ 62 global PAINTING_EXITS, SPECIAL_ITEM_IDS, PANEL_LOCATION_IDS, DOOR_LOCATION_IDS, DOOR_ITEM_IDS, \
56 DOOR_GROUP_ITEM_IDS, PROGRESSIVE_ITEM_IDS 63 DOOR_GROUP_ITEM_IDS, PROGRESSIVE_ITEM_IDS, PANEL_DOOR_ITEM_IDS, PANEL_GROUP_ITEM_IDS
57 64
58 # Load in all item and location IDs. These are broken up into groups based on the type of item/location. 65 # Load in all item and location IDs. These are broken up into groups based on the type of item/location.
59 with open(ids_path, "r") as file: 66 with open(ids_path, "r") as file:
@@ -86,6 +93,17 @@ def load_static_data(ll1_path, ids_path):
86 for item_name, item_id in config["door_groups"].items(): 93 for item_name, item_id in config["door_groups"].items():
87 DOOR_GROUP_ITEM_IDS[item_name] = item_id 94 DOOR_GROUP_ITEM_IDS[item_name] = item_id
88 95
96 if "panel_doors" in config:
97 for room_name, panel_doors in config["panel_doors"].items():
98 PANEL_DOOR_ITEM_IDS[room_name] = {}
99
100 for panel_door, item_id in panel_doors.items():
101 PANEL_DOOR_ITEM_IDS[room_name][panel_door] = item_id
102
103 if "panel_groups" in config:
104 for item_name, item_id in config["panel_groups"].items():
105 PANEL_GROUP_ITEM_IDS[item_name] = item_id
106
89 if "progression" in config: 107 if "progression" in config:
90 for item_name, item_id in config["progression"].items(): 108 for item_name, item_id in config["progression"].items():
91 PROGRESSIVE_ITEM_IDS[item_name] = item_id 109 PROGRESSIVE_ITEM_IDS[item_name] = item_id
@@ -147,6 +165,46 @@ def process_entrance(source_room, doors, room_obj):
147 room_obj.entrances.append(RoomEntrance(source_room, door, entrance_type)) 165 room_obj.entrances.append(RoomEntrance(source_room, door, entrance_type))
148 166
149 167
168def process_panel_door(room_name, panel_door_name, panel_door_data):
169 global PANEL_DOORS_BY_ROOM, PANEL_DOOR_BY_PANEL_BY_ROOM
170
171 panels: List[RoomAndPanel] = list()
172 for panel in panel_door_data["panels"]:
173 if isinstance(panel, dict):
174 panels.append(RoomAndPanel(panel["room"], panel["panel"]))
175 else:
176 panels.append(RoomAndPanel(room_name, panel))
177
178 for panel in panels:
179 PANEL_DOOR_BY_PANEL_BY_ROOM.setdefault(panel.room, {})[panel.panel] = RoomAndPanelDoor(room_name,
180 panel_door_name)
181
182 if "item_name" in panel_door_data:
183 item_name = panel_door_data["item_name"]
184 else:
185 panel_per_room = dict()
186 for panel in panels:
187 panel_room_name = room_name if panel.room is None else panel.room
188 panel_per_room.setdefault(panel_room_name, []).append(panel.panel)
189
190 room_strs = list()
191 for door_room_str, door_panels_str in panel_per_room.items():
192 room_strs.append(door_room_str + " - " + ", ".join(door_panels_str))
193
194 if len(panels) == 1:
195 item_name = f"{room_strs[0]} (Panel)"
196 else:
197 item_name = " and ".join(room_strs) + " (Panels)"
198
199 if "panel_group" in panel_door_data:
200 panel_group = panel_door_data["panel_group"]
201 else:
202 panel_group = None
203
204 panel_door_obj = PanelDoor(item_name, panel_group)
205 PANEL_DOORS_BY_ROOM[room_name][panel_door_name] = panel_door_obj
206
207
150def process_panel(room_name, panel_name, panel_data): 208def process_panel(room_name, panel_name, panel_data):
151 global PANELS_BY_ROOM 209 global PANELS_BY_ROOM
152 210
@@ -227,13 +285,18 @@ def process_panel(room_name, panel_name, panel_data):
227 else: 285 else:
228 non_counting = False 286 non_counting = False
229 287
288 if room_name in PANEL_DOOR_BY_PANEL_BY_ROOM and panel_name in PANEL_DOOR_BY_PANEL_BY_ROOM[room_name]:
289 panel_door = PANEL_DOOR_BY_PANEL_BY_ROOM[room_name][panel_name]
290 else:
291 panel_door = None
292
230 if "location_name" in panel_data: 293 if "location_name" in panel_data:
231 location_name = panel_data["location_name"] 294 location_name = panel_data["location_name"]
232 else: 295 else:
233 location_name = None 296 location_name = None
234 297
235 panel_obj = Panel(required_rooms, required_doors, required_panels, colors, check, event, exclude_reduce, 298 panel_obj = Panel(required_rooms, required_doors, required_panels, colors, check, event, exclude_reduce,
236 achievement, non_counting, location_name) 299 achievement, non_counting, panel_door, location_name)
237 PANELS_BY_ROOM[room_name][panel_name] = panel_obj 300 PANELS_BY_ROOM[room_name][panel_name] = panel_obj
238 301
239 302
@@ -325,7 +388,7 @@ def process_door(room_name, door_name, door_data):
325 painting_ids = [] 388 painting_ids = []
326 389
327 door_type = DoorType.NORMAL 390 door_type = DoorType.NORMAL
328 if door_name.endswith(" Sunwarp"): 391 if room_name == "Sunwarps":
329 door_type = DoorType.SUNWARP 392 door_type = DoorType.SUNWARP
330 elif room_name == "Pilgrim Antechamber" and door_name == "Sun Painting": 393 elif room_name == "Pilgrim Antechamber" and door_name == "Sun Painting":
331 door_type = DoorType.SUN_PAINTING 394 door_type = DoorType.SUN_PAINTING
@@ -404,11 +467,11 @@ def process_sunwarp(room_name, sunwarp_data):
404 SUNWARP_EXITS[sunwarp_data["dots"] - 1] = room_name 467 SUNWARP_EXITS[sunwarp_data["dots"] - 1] = room_name
405 468
406 469
407def process_progression(room_name, progression_name, progression_doors): 470def process_progressive_door(room_name, progression_name, progression_doors):
408 global PROGRESSIVE_ITEMS, PROGRESSION_BY_ROOM 471 global PROGRESSIVE_ITEMS, PROGRESSIVE_DOORS_BY_ROOM
409 472
410 # Progressive items are configured as a list of doors. 473 # Progressive items are configured as a list of doors.
411 PROGRESSIVE_ITEMS.append(progression_name) 474 PROGRESSIVE_ITEMS.add(progression_name)
412 475
413 progression_index = 1 476 progression_index = 1
414 for door in progression_doors: 477 for door in progression_doors:
@@ -419,11 +482,31 @@ def process_progression(room_name, progression_name, progression_doors):
419 door_room = room_name 482 door_room = room_name
420 door_door = door 483 door_door = door
421 484
422 room_progressions = PROGRESSION_BY_ROOM.setdefault(door_room, {}) 485 room_progressions = PROGRESSIVE_DOORS_BY_ROOM.setdefault(door_room, {})
423 room_progressions[door_door] = Progression(progression_name, progression_index) 486 room_progressions[door_door] = Progression(progression_name, progression_index)
424 progression_index += 1 487 progression_index += 1
425 488
426 489
490def process_progressive_panel(room_name, progression_name, progression_panel_doors):
491 global PROGRESSIVE_ITEMS, PROGRESSIVE_PANELS_BY_ROOM
492
493 # Progressive items are configured as a list of panel doors.
494 PROGRESSIVE_ITEMS.add(progression_name)
495
496 progression_index = 1
497 for panel_door in progression_panel_doors:
498 if isinstance(panel_door, Dict):
499 panel_door_room = panel_door["room"]
500 panel_door_door = panel_door["panel_door"]
501 else:
502 panel_door_room = room_name
503 panel_door_door = panel_door
504
505 room_progressions = PROGRESSIVE_PANELS_BY_ROOM.setdefault(panel_door_room, {})
506 room_progressions[panel_door_door] = Progression(progression_name, progression_index)
507 progression_index += 1
508
509
427def process_room(room_name, room_data): 510def process_room(room_name, room_data):
428 global ALL_ROOMS 511 global ALL_ROOMS
429 512
@@ -433,6 +516,12 @@ def process_room(room_name, room_data):
433 for source_room, doors in room_data["entrances"].items(): 516 for source_room, doors in room_data["entrances"].items():
434 process_entrance(source_room, doors, room_obj) 517 process_entrance(source_room, doors, room_obj)
435 518
519 if "panel_doors" in room_data:
520 PANEL_DOORS_BY_ROOM[room_name] = dict()
521
522 for panel_door_name, panel_door_data in room_data["panel_doors"].items():
523 process_panel_door(room_name, panel_door_name, panel_door_data)
524
436 if "panels" in room_data: 525 if "panels" in room_data:
437 PANELS_BY_ROOM[room_name] = dict() 526 PANELS_BY_ROOM[room_name] = dict()
438 527
@@ -454,8 +543,11 @@ def process_room(room_name, room_data):
454 process_sunwarp(room_name, sunwarp_data) 543 process_sunwarp(room_name, sunwarp_data)
455 544
456 if "progression" in room_data: 545 if "progression" in room_data:
457 for progression_name, progression_doors in room_data["progression"].items(): 546 for progression_name, pdata in room_data["progression"].items():
458 process_progression(room_name, progression_name, progression_doors) 547 if "doors" in pdata:
548 process_progressive_door(room_name, progression_name, pdata["doors"])
549 if "panel_doors" in pdata:
550 process_progressive_panel(room_name, progression_name, pdata["panel_doors"])
459 551
460 ALL_ROOMS.append(room_obj) 552 ALL_ROOMS.append(room_obj)
461 553
@@ -492,8 +584,10 @@ if __name__ == '__main__':
492 "ALL_ROOMS": ALL_ROOMS, 584 "ALL_ROOMS": ALL_ROOMS,
493 "DOORS_BY_ROOM": DOORS_BY_ROOM, 585 "DOORS_BY_ROOM": DOORS_BY_ROOM,
494 "PANELS_BY_ROOM": PANELS_BY_ROOM, 586 "PANELS_BY_ROOM": PANELS_BY_ROOM,
587 "PANEL_DOORS_BY_ROOM": PANEL_DOORS_BY_ROOM,
495 "PROGRESSIVE_ITEMS": PROGRESSIVE_ITEMS, 588 "PROGRESSIVE_ITEMS": PROGRESSIVE_ITEMS,
496 "PROGRESSION_BY_ROOM": PROGRESSION_BY_ROOM, 589 "PROGRESSIVE_DOORS_BY_ROOM": PROGRESSIVE_DOORS_BY_ROOM,
590 "PROGRESSIVE_PANELS_BY_ROOM": PROGRESSIVE_PANELS_BY_ROOM,
497 "PAINTING_ENTRANCES": PAINTING_ENTRANCES, 591 "PAINTING_ENTRANCES": PAINTING_ENTRANCES,
498 "PAINTING_EXIT_ROOMS": PAINTING_EXIT_ROOMS, 592 "PAINTING_EXIT_ROOMS": PAINTING_EXIT_ROOMS,
499 "PAINTING_EXITS": PAINTING_EXITS, 593 "PAINTING_EXITS": PAINTING_EXITS,
@@ -506,6 +600,8 @@ if __name__ == '__main__':
506 "DOOR_LOCATION_IDS": DOOR_LOCATION_IDS, 600 "DOOR_LOCATION_IDS": DOOR_LOCATION_IDS,
507 "DOOR_ITEM_IDS": DOOR_ITEM_IDS, 601 "DOOR_ITEM_IDS": DOOR_ITEM_IDS,
508 "DOOR_GROUP_ITEM_IDS": DOOR_GROUP_ITEM_IDS, 602 "DOOR_GROUP_ITEM_IDS": DOOR_GROUP_ITEM_IDS,
603 "PANEL_DOOR_ITEM_IDS": PANEL_DOOR_ITEM_IDS,
604 "PANEL_GROUP_ITEM_IDS": PANEL_GROUP_ITEM_IDS,
509 "PROGRESSIVE_ITEM_IDS": PROGRESSIVE_ITEM_IDS, 605 "PROGRESSIVE_ITEM_IDS": PROGRESSIVE_ITEM_IDS,
510 } 606 }
511 607
diff --git a/utils/validate_config.rb b/utils/validate_config.rb index 498980b..70f7fc2 100644 --- a/utils/validate_config.rb +++ b/utils/validate_config.rb
@@ -33,19 +33,23 @@ end
33configured_rooms = Set["Menu"] 33configured_rooms = Set["Menu"]
34configured_doors = Set[] 34configured_doors = Set[]
35configured_panels = Set[] 35configured_panels = Set[]
36configured_panel_doors = Set[]
36 37
37mentioned_rooms = Set[] 38mentioned_rooms = Set[]
38mentioned_doors = Set[] 39mentioned_doors = Set[]
39mentioned_panels = Set[] 40mentioned_panels = Set[]
41mentioned_panel_doors = Set[]
40mentioned_sunwarp_entrances = Set[] 42mentioned_sunwarp_entrances = Set[]
41mentioned_sunwarp_exits = Set[] 43mentioned_sunwarp_exits = Set[]
42mentioned_paintings = Set[] 44mentioned_paintings = Set[]
43 45
44door_groups = {} 46door_groups = {}
47panel_groups = {}
45 48
46directives = Set["entrances", "panels", "doors", "paintings", "sunwarps", "progression"] 49directives = Set["entrances", "panels", "doors", "panel_doors", "paintings", "sunwarps", "progression"]
47panel_directives = Set["id", "required_room", "required_door", "required_panel", "colors", "check", "exclude_reduce", "tag", "link", "subtag", "achievement", "copy_to_sign", "non_counting", "hunt", "location_name"] 50panel_directives = Set["id", "required_room", "required_door", "required_panel", "colors", "check", "exclude_reduce", "tag", "link", "subtag", "achievement", "copy_to_sign", "non_counting", "hunt", "location_name"]
48door_directives = Set["id", "painting_id", "panels", "item_name", "item_group", "location_name", "skip_location", "skip_item", "door_group", "include_reduce", "event", "warp_id"] 51door_directives = Set["id", "painting_id", "panels", "item_name", "item_group", "location_name", "skip_location", "skip_item", "door_group", "include_reduce", "event", "warp_id"]
52panel_door_directives = Set["panels", "item_name", "panel_group"]
49painting_directives = Set["id", "enter_only", "exit_only", "orientation", "required_door", "required", "required_when_no_doors", "move", "req_blocked", "req_blocked_when_no_doors"] 53painting_directives = Set["id", "enter_only", "exit_only", "orientation", "required_door", "required", "required_when_no_doors", "move", "req_blocked", "req_blocked_when_no_doors"]
50 54
51non_counting = 0 55non_counting = 0
@@ -253,6 +257,43 @@ config.each do |room_name, room|
253 end 257 end
254 end 258 end
255 259
260 (room["panel_doors"] || {}).each do |panel_door_name, panel_door|
261 configured_panel_doors.add("#{room_name} - #{panel_door_name}")
262
263 if panel_door.include?("panels")
264 panel_door["panels"].each do |panel|
265 if panel.kind_of? Hash then
266 other_room = panel.include?("room") ? panel["room"] : room_name
267 mentioned_panels.add("#{other_room} - #{panel["panel"]}")
268 else
269 other_room = panel.include?("room") ? panel["room"] : room_name
270 mentioned_panels.add("#{room_name} - #{panel}")
271 end
272 end
273 else
274 puts "#{room_name} - #{panel_door_name} :::: Missing panels field"
275 end
276
277 if panel_door.include?("panel_group")
278 panel_groups[panel_door["panel_group"]] ||= 0
279 panel_groups[panel_door["panel_group"]] += 1
280 end
281
282 bad_subdirectives = []
283 panel_door.keys.each do |key|
284 unless panel_door_directives.include?(key) then
285 bad_subdirectives << key
286 end
287 end
288 unless bad_subdirectives.empty? then
289 puts "#{room_name} - #{panel_door_name} :::: Panel door has the following invalid subdirectives: #{bad_subdirectives.join(", ")}"
290 end
291
292 unless ids.include?("panel_doors") and ids["panel_doors"].include?(room_name) and ids["panel_doors"][room_name].include?(panel_door_name)
293 puts "#{room_name} - #{panel_door_name} :::: Panel door is missing an item ID"
294 end
295 end
296
256 (room["paintings"] || []).each do |painting| 297 (room["paintings"] || []).each do |painting|
257 if painting.include?("id") and painting["id"].kind_of? String then 298 if painting.include?("id") and painting["id"].kind_of? String then
258 unless paintings.include? painting["id"] then 299 unless paintings.include? painting["id"] then
@@ -327,12 +368,24 @@ config.each do |room_name, room|
327 end 368 end
328 end 369 end
329 370
330 (room["progression"] || {}).each do |progression_name, door_list| 371 (room["progression"] || {}).each do |progression_name, pdata|
331 door_list.each do |door| 372 if pdata.include? "doors" then
332 if door.kind_of? Hash then 373 pdata["doors"].each do |door|
333 mentioned_doors.add("#{door["room"]} - #{door["door"]}") 374 if door.kind_of? Hash then
334 else 375 mentioned_doors.add("#{door["room"]} - #{door["door"]}")
335 mentioned_doors.add("#{room_name} - #{door}") 376 else
377 mentioned_doors.add("#{room_name} - #{door}")
378 end
379 end
380 end
381
382 if pdata.include? "panel_doors" then
383 pdata["panel_doors"].each do |panel_door|
384 if panel_door.kind_of? Hash then
385 mentioned_panel_doors.add("#{panel_door["room"]} - #{panel_door["panel_door"]}")
386 else
387 mentioned_panel_doors.add("#{room_name} - #{panel_door}")
388 end
336 end 389 end
337 end 390 end
338 391
@@ -344,17 +397,22 @@ end
344 397
345errored_rooms = mentioned_rooms - configured_rooms 398errored_rooms = mentioned_rooms - configured_rooms
346unless errored_rooms.empty? then 399unless errored_rooms.empty? then
347 puts "The folloring rooms are mentioned but do not exist: " + errored_rooms.to_s 400 puts "The following rooms are mentioned but do not exist: " + errored_rooms.to_s
348end 401end
349 402
350errored_panels = mentioned_panels - configured_panels 403errored_panels = mentioned_panels - configured_panels
351unless errored_panels.empty? then 404unless errored_panels.empty? then
352 puts "The folloring panels are mentioned but do not exist: " + errored_panels.to_s 405 puts "The following panels are mentioned but do not exist: " + errored_panels.to_s
353end 406end
354 407
355errored_doors = mentioned_doors - configured_doors 408errored_doors = mentioned_doors - configured_doors
356unless errored_doors.empty? then 409unless errored_doors.empty? then
357 puts "The folloring doors are mentioned but do not exist: " + errored_doors.to_s 410 puts "The following doors are mentioned but do not exist: " + errored_doors.to_s
411end
412
413errored_panel_doors = mentioned_panel_doors - configured_panel_doors
414unless errored_panel_doors.empty? then
415 puts "The following panel doors are mentioned but do not exist: " + errored_panel_doors.to_s
358end 416end
359 417
360door_groups.each do |group,num| 418door_groups.each do |group,num|
@@ -367,6 +425,16 @@ door_groups.each do |group,num|
367 end 425 end
368end 426end
369 427
428panel_groups.each do |group,num|
429 if num == 1 then
430 puts "Panel group \"#{group}\" only has one panel in it"
431 end
432
433 unless ids.include?("panel_groups") and ids["panel_groups"].include?(group)
434 puts "#{group} :::: Panel group is missing an item ID"
435 end
436end
437
370slashed_rooms = configured_rooms.select do |room| 438slashed_rooms = configured_rooms.select do |room|
371 room.include? "/" 439 room.include? "/"
372end 440end