mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
SoE: mark traps as being traps
This commit is contained in:

committed by
Fabian Dill

parent
a6b22d1f41
commit
b599a7607d
@@ -161,10 +161,12 @@ class SoEWorld(World):
|
|||||||
progression = True
|
progression = True
|
||||||
return SoEItem(event, progression, None, self.player)
|
return SoEItem(event, progression, None, self.player)
|
||||||
|
|
||||||
def create_item(self, item: typing.Union[pyevermizer.Item, str], force_progression: bool = False) -> Item:
|
def create_item(self, item: typing.Union[pyevermizer.Item, str]) -> Item:
|
||||||
if type(item) is str:
|
if type(item) is str:
|
||||||
item = self.item_id_to_raw[self.item_name_to_id[item]]
|
item = self.item_id_to_raw[self.item_name_to_id[item]]
|
||||||
return SoEItem(item.name, force_progression or item.progression, self.item_name_to_id[item.name], self.player)
|
res = SoEItem(item.name, item.progression, self.item_name_to_id[item.name], self.player)
|
||||||
|
res.trap = item.type == pyevermizer.CHECK_TRAP
|
||||||
|
return res
|
||||||
|
|
||||||
def create_regions(self):
|
def create_regions(self):
|
||||||
# TODO: generate *some* regions from locations' requirements?
|
# TODO: generate *some* regions from locations' requirements?
|
||||||
@@ -204,7 +206,7 @@ class SoEWorld(World):
|
|||||||
trap_names = {'quake': getattr(self.world, 'trap_chance_quake')[self.player].item_name}
|
trap_names = {'quake': getattr(self.world, 'trap_chance_quake')[self.player].item_name}
|
||||||
trap_chances_total = 1
|
trap_chances_total = 1
|
||||||
|
|
||||||
def create_trap():
|
def create_trap() -> Item:
|
||||||
v = self.world.random.randrange(trap_chances_total)
|
v = self.world.random.randrange(trap_chances_total)
|
||||||
for t, c in trap_chances.items():
|
for t, c in trap_chances.items():
|
||||||
if v < c:
|
if v < c:
|
||||||
|
Reference in New Issue
Block a user