1
1
from typing import Dict , Optional
2
2
3
- from BaseClasses import Location
3
+ from BaseClasses import Location , ItemClassification , Item
4
4
from .Regions import LandstalkerRegion
5
5
from .data .item_source import ITEM_SOURCES_JSON
6
+ from .data .world_path import WORLD_PATHS_JSON
6
7
7
8
BASE_LOCATION_ID = 4000
8
9
BASE_GROUND_LOCATION_ID = BASE_LOCATION_ID + 256
@@ -28,6 +29,18 @@ def create_locations(player: int, regions_table: Dict[str, LandstalkerRegion], n
28
29
new_location = LandstalkerLocation (player , data ["name" ], name_to_id_table [data ["name" ]], region , data ["type" ])
29
30
region .locations .append (new_location )
30
31
32
+ # Create fake event locations that will be used to determine if some key regions has been visited
33
+ regions_with_entrance_checks = []
34
+ for data in WORLD_PATHS_JSON :
35
+ if "requiredNodes" in data :
36
+ regions_with_entrance_checks .extend ([region_id for region_id in data ["requiredNodes" ]])
37
+ regions_with_entrance_checks = list (set (regions_with_entrance_checks ))
38
+ for region_id in regions_with_entrance_checks :
39
+ region = regions_table [region_id ]
40
+ location = LandstalkerLocation (player , 'event_visited_' + region_id , None , region , "event" )
41
+ location .place_locked_item (Item ("event_visited_" + region_id , ItemClassification .progression , None , player ))
42
+ region .locations .append (location )
43
+
31
44
# Create a specific end location that will contain a fake win-condition item
32
45
end_location = LandstalkerLocation (player , "End" , None , regions_table ["end" ], "reward" )
33
46
regions_table ["end" ].locations .append (end_location )
0 commit comments