13
13
from worlds .AutoWorld import World , WebWorld
14
14
from worlds .generic .Rules import add_rule , set_rule , forbid_item
15
15
16
+
16
17
class TLoZWeb (WebWorld ):
17
18
theme = "stone"
18
19
setup = Tutorial (
@@ -74,7 +75,7 @@ def __init__(self, world: MultiWorld, player: int):
74
75
self .levels = None
75
76
76
77
def create_item (self , name : str ):
77
- return TLoZItem (name , ItemClassification . progression , self .item_name_to_id [name ], self .player )
78
+ return TLoZItem (name , item_table [ name ]. classification , self .item_name_to_id [name ], self .player )
78
79
79
80
def create_event (self , event : str ):
80
81
return TLoZItem (event , ItemClassification .progression , None , self .player )
@@ -165,9 +166,10 @@ def create_items(self):
165
166
if item_name == starting_weapon : # To remove the extra Sword if that's our weapon
166
167
item_amounts [item_name ] -= 1
167
168
if self .multiworld .TriforceLocations [self .player ] > 0 or item_name != "Triforce Fragment" :
168
- i = 0
169
169
for i in range (0 , item_amounts [item_name ]):
170
170
self .multiworld .itempool .append (self .create_item (item_name ))
171
+ if item_name == "Bomb" :
172
+ self .multiworld .itempool [- 1 ].classification = ItemClassification .progression
171
173
else :
172
174
level = 1
173
175
for i in range (0 , item_amounts [item_name ]):
@@ -177,7 +179,8 @@ def create_items(self):
177
179
).place_locked_item (self .multiworld .create_item (item_name , self .player ))
178
180
level = level + 1
179
181
else :
180
- self .multiworld .itempool .append (self .create_item (item_name ))
182
+ if item_name != starting_weapon :
183
+ self .multiworld .itempool .append (self .create_item (item_name ))
181
184
182
185
def set_rules (self ):
183
186
# Boss events for a nicer spoiler log playthrough
@@ -341,10 +344,6 @@ def set_rules(self):
341
344
lambda state : state .has_group ("candles" , self .player ) or
342
345
state .has ("Bomb" , self .player ))
343
346
344
-
345
- set_rule (self .multiworld .get_region ("Menu" , self .player ), lambda state : True )
346
- set_rule (self .multiworld .get_region ("Overworld" , self .player ), lambda state : True )
347
-
348
347
def generate_basic (self ):
349
348
ganon = self .multiworld .get_location ("Ganon" , self .player )
350
349
ganon .place_locked_item (self .create_event ("Triforce of Power" ))
@@ -356,6 +355,7 @@ def generate_basic(self):
356
355
357
356
self .multiworld .completion_condition [self .player ] = lambda state : state .has ("Rescued Zelda!" , self .player )
358
357
358
+
359
359
def apply_base_patch (self , rom_data ):
360
360
# Remove Triforce check for recorder so you can always warp.
361
361
rom_data [0x60CC :0x60CF ] = bytearray ([0xA9 , 0xFF , 0xEA ])
@@ -498,6 +498,9 @@ def modify_multidata(self, multidata: dict):
498
498
new_name = base64 .b64encode (bytes (self .rom_name )).decode ()
499
499
multidata ["connect_names" ][new_name ] = multidata ["connect_names" ][self .multiworld .player_name [self .player ]]
500
500
501
+ def get_filler_item_name (self ) -> str :
502
+ filler_items = [item for item in item_table if item_table [item ].classification == ItemClassification .filler ]
503
+ return self .multiworld .random .choice (filler_items )
501
504
502
505
class TLoZItem (Item ):
503
506
game = 'The Legend of Zelda'
0 commit comments