|
23 | 23 | from .options import CrystalProjectOptions, create_option_groups |
24 | 24 | from .rules import CrystalProjectLogic |
25 | 25 | from .mod_helper import ModLocationData, get_modded_items, get_modded_locations, get_modded_home_points, \ |
26 | | - get_modded_shopsanity_locations, get_modded_bosses, build_condition_rule, update_item_classification, get_mod_info, get_removed_locations |
| 26 | + get_modded_shopsanity_locations, get_modded_bosses, build_condition_rule, update_item_classification, get_mod_info, get_removed_locations, get_removed_home_points |
27 | 27 | from typing import List, Set, Dict, Any |
28 | 28 | from worlds.AutoWorld import World, WebWorld |
29 | 29 | from BaseClasses import Item, Tutorial, MultiWorld, CollectionState, ItemClassification |
@@ -104,6 +104,7 @@ class CrystalProjectWorld(World): |
104 | 104 | item_name_groups.setdefault(MOD, set()).add(modded_home_point.name) |
105 | 105 |
|
106 | 106 | removed_locations = get_removed_locations(mod_info) |
| 107 | + removed_home_points = get_removed_home_points(mod_info) |
107 | 108 |
|
108 | 109 | web = CrystalProjectWeb() |
109 | 110 |
|
@@ -229,11 +230,16 @@ def create_regions(self) -> None: |
229 | 230 |
|
230 | 231 | if self.options.home_point_hustle.value != self.options.home_point_hustle.option_disabled: |
231 | 232 | home_points = get_home_points() |
| 233 | + removed_code_list = [home_point.code for home_point in self.removed_home_points] |
232 | 234 |
|
233 | | - # todo removed home points |
234 | 235 | for home_point in home_points: |
235 | | - home_point_location = LocationData(home_point.ap_region, home_point.name, (home_point.code + home_point_location_index_offset), home_point.rule) |
236 | | - locations.append(home_point_location) |
| 236 | + should_add = True |
| 237 | + if self.options.use_mods.value == self.options.use_mods.option_true: |
| 238 | + should_add = home_point.code not in removed_code_list |
| 239 | + |
| 240 | + if should_add: |
| 241 | + home_point_location = LocationData(home_point.ap_region, home_point.name, (home_point.code + home_point_location_index_offset), home_point.rule) |
| 242 | + locations.append(home_point_location) |
237 | 243 |
|
238 | 244 | if self.options.use_mods.value == self.options.use_mods.option_true: |
239 | 245 | for modded_home_point in self.modded_home_points: |
@@ -787,6 +793,10 @@ def fill_slot_data(self) -> Dict[str, Any]: |
787 | 793 | slot_data_removed_locations.append({"Id": location.code, |
788 | 794 | "APRegion": location.ap_region}) |
789 | 795 |
|
| 796 | + for home_point in self.removed_home_points: |
| 797 | + slot_data_removed_home_points.append({"Id": home_point.code, |
| 798 | + "APRegion": location.ap_region}) |
| 799 | + |
790 | 800 | #TODO removed home points |
791 | 801 |
|
792 | 802 | # look into replacing this big chonky return block with self.options.as_dict() and then just adding the extras to the dict after |
@@ -829,6 +839,7 @@ def fill_slot_data(self) -> Dict[str, Any]: |
829 | 839 | "moddedLocations": slot_data_locations, |
830 | 840 | "moddedHomePoints": slot_data_home_points, |
831 | 841 | "removedLocations": slot_data_removed_locations, |
| 842 | + "removedHomePoints": slot_data_removed_home_points, |
832 | 843 | # "moddedLocationsForUT": self.modded_locations, |
833 | 844 | # "moddedShopsForUT": self.modded_shops, |
834 | 845 | "prefillMap": bool(self.options.fill_full_map.value), |
|
0 commit comments