Rogue Legacy: World folder clean up and generation improvements. (#1148)
* Minor cleanup and renaming of some files/functions. * Rename `LegacyWorld` and `LegacyWeb` to RLWorld and RLWeb. * Undo accidental change to comment. * Undo accidental change to comment. * Restructure Items.py format and combine all tables into one. * Restructure Locations.py format and combine all tables into one. * Split boss event items into separate boss entries. * Remove definitions folder. * Reformatted __init__.py for Rogue Legacy. * Allow fairy chests to be disabled. * Add working prefill logic for early vendors. * Re-introduce Early Architect setting. * Revamped rules and regions and can now generate games. * Fix normal vendors breaking everything. * Fix early vendor logic and add fairy chest logic to require Dragons or Enchantress + runes. * Fix issue with duplicate items being created. * Move event placement into __init__.py and fix duplicate Vendors. * Tweak weights and spacing. * Update documentation and include bug report link. * Fix relative link for template file. * Increase amount of chest locations in `location_table`. * Correct a refactor rename gone wrong. * Remove unused reference in imports. * Tweak mistake in boss name in place_events. * English is hard. * Tweak some lines in __init__.py to use `.settings()` method. * Add unique id tests for Rogue Legacy. IDs are mixed around, so let's try to avoid accidentally using the same identifier twice. * Fix typo in doc. * Simplify `fill_slot_data`. * Change prefix on `_place_events` to maintain convention. * Remove items that are **not** progression from rules.
This commit is contained in:
		
							
								
								
									
										23
									
								
								test/worlds/rogue_legacy/TestUnique.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								test/worlds/rogue_legacy/TestUnique.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| from typing import Dict | ||||
|  | ||||
| from . import RLTestBase | ||||
| from worlds.rogue_legacy.Items import RLItemData, item_table | ||||
| from worlds.rogue_legacy.Locations import RLLocationData, location_table | ||||
|  | ||||
|  | ||||
| class UniqueTest(RLTestBase): | ||||
|     @staticmethod | ||||
|     def test_item_ids_are_all_unique(): | ||||
|         item_ids: Dict[int, str] = {} | ||||
|         for name, data in item_table.items(): | ||||
|             assert data.code not in item_ids.keys(), f"'{name}': {data.code}, is not unique. " \ | ||||
|                                                      f"'{item_ids[data.code]}' also has this identifier." | ||||
|             item_ids[data.code] = name | ||||
|  | ||||
|     @staticmethod | ||||
|     def test_location_ids_are_all_unique(): | ||||
|         location_ids: Dict[int, str] = {} | ||||
|         for name, data in location_table.items(): | ||||
|             assert data.code not in location_ids.keys(), f"'{name}': {data.code}, is not unique. " \ | ||||
|                                                          f"'{location_ids[data.code]}' also has this identifier." | ||||
|             location_ids[data.code] = name | ||||
							
								
								
									
										5
									
								
								test/worlds/rogue_legacy/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								test/worlds/rogue_legacy/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| from test.worlds.test_base import WorldTestBase | ||||
|  | ||||
|  | ||||
| class RLTestBase(WorldTestBase): | ||||
|     game = "Rogue Legacy" | ||||
		Reference in New Issue
	
	Block a user
	 Zach Parks
					Zach Parks