From aa6ad5d34ff31229ad994042e026ccf4756754b0 Mon Sep 17 00:00:00 2001 From: Trevor L <80716066+TRPG0@users.noreply.github.com> Date: Fri, 7 Apr 2023 12:01:26 -0600 Subject: [PATCH] Hylics 2: Update item creation (#1671) --- worlds/hylics2/__init__.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/worlds/hylics2/__init__.py b/worlds/hylics2/__init__.py index b12beaaa..f7b9a263 100644 --- a/worlds/hylics2/__init__.py +++ b/worlds/hylics2/__init__.py @@ -1,5 +1,4 @@ -import random -from typing import Dict, Any +from typing import Dict, List, Any from BaseClasses import Region, Entrance, Location, Item, Tutorial, ItemClassification from worlds.generic.Rules import set_rule from . import Exits, Items, Locations, Options, Rules @@ -73,7 +72,7 @@ class Hylics2World(World): elif i == 3: self.start_location = "Shield Facility" - def generate_basic(self): + def create_items(self): # create item pool pool = [] @@ -88,6 +87,22 @@ class Hylics2World(World): for i, data in Items.party_item_table.items(): pool.append(self.add_item(data["name"], data["classification"], i)) + # handle gesture shuffle + if not self.multiworld.gesture_shuffle[self.player]: # add gestures to pool like normal + for i, data in Items.gesture_item_table.items(): + pool.append(self.add_item(data["name"], data["classification"], i)) + + # add '10 Bones' items if medallion shuffle is enabled + if self.multiworld.medallion_shuffle[self.player]: + for i, data in Items.medallion_item_table.items(): + for j in range(data["count"]): + pool.append(self.add_item(data["name"], data["classification"], i)) + + # add to world's pool + self.multiworld.itempool += pool + + + def pre_fill(self): # handle gesture shuffle options if self.multiworld.gesture_shuffle[self.player] == 2: # vanilla locations gestures = Items.gesture_item_table @@ -135,19 +150,6 @@ class Hylics2World(World): gestures.remove(gest) tvs.remove(tv) - else: # add gestures to pool like normal - for i, data in Items.gesture_item_table.items(): - pool.append(self.add_item(data["name"], data["classification"], i)) - - # add '10 Bones' items if medallion shuffle is enabled - if self.multiworld.medallion_shuffle[self.player]: - for i, data in Items.medallion_item_table.items(): - for j in range(data["count"]): - pool.append(self.add_item(data["name"], data["classification"], i)) - - # add to world's pool - self.multiworld.itempool += pool - def fill_slot_data(self) -> Dict[str, Any]: slot_data: Dict[str, Any] = {