Skip to content

Commit

Permalink
SMZ3: update to upstream version 11.3.1 and item link fix (Archipelag…
Browse files Browse the repository at this point in the history
  • Loading branch information
lordlou authored Jul 6, 2023
1 parent 81b9564 commit 5f2c226
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion worlds/smz3/TotalSMZ3/Patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class DropPrize(Enum):
class Patch:
Major = 11
Minor = 3
Patch = 1
allWorlds: List[World]
myWorld: World
seedGuid: str
Expand Down Expand Up @@ -615,7 +616,7 @@ def WriteGameTitle(self):
"H" if self.myWorld.Config.SMLogic == Config.SMLogic.Hard else \
"X"

self.title = f"ZSM{Patch.Major}{Patch.Minor}{z3Glitch}{smGlitch}{self.myWorld.Id}{self.seed:08x}".ljust(21)[:21]
self.title = f"ZSM{Patch.Major}{Patch.Minor}{Patch.Patch}{z3Glitch}{smGlitch}{self.myWorld.Id}{self.seed:08x}".ljust(21)[:21]
self.patches.append((Snes(0x00FFC0), bytearray(self.title, 'utf8')))
self.patches.append((Snes(0x80FFC0), bytearray(self.title, 'utf8')))

Expand Down
5 changes: 3 additions & 2 deletions worlds/smz3/TotalSMZ3/Regions/Zelda/GanonsTower.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,16 @@ def CanBeatMoldorm(self, items: Progression):
def CanEnter(self, items: Progression):
return items.MoonPearl and self.world.CanEnter("Dark World Death Mountain East", items) and \
self.world.CanAcquireAtLeast(self.world.TowerCrystals, items, RewardType.AnyCrystal) and \
self.world.CanAcquireAtLeast(self.world.TourianBossTokens * (self.world.TowerCrystals / 7), items, RewardType.AnyBossToken)
self.world.CanAcquireAtLeast((self.world.TourianBossTokens * self.world.TowerCrystals) / 7, items, RewardType.AnyBossToken)

# added for AP completion_condition when TowerCrystals is lower than GanonCrystals
def CanComplete(self, items: Progression):
return self.world.CanAcquireAtLeast(self.world.GanonCrystals, items, RewardType.AnyCrystal)

def CanFill(self, item: Item):
if (self.Config.Multiworld):
if (item.World != self.world or item.Progression):
# item.World will be None for item created by create_item for item links
if (item.World is not None and (item.World != self.world or item.Progression)):
return False
if (self.Config.Keysanity and not ((item.Type == ItemType.BigKeyGT or item.Type == ItemType.KeyGT) and item.World == self.world) and (item.IsKey() or item.IsBigKey() or item.IsKeycard())):
return False
Expand Down
6 changes: 3 additions & 3 deletions worlds/smz3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ def generate_early(self):

self.local_random = random.Random(self.multiworld.random.randint(0, 1000))
self.smz3World = TotalSMZ3World(self.config, self.multiworld.get_player_name(self.player), self.player, self.multiworld.seed_name)
self.smz3World.Setup(WorldState.Generate(self.config, self.multiworld.random))
self.smz3DungeonItems = []
SMZ3World.location_names = frozenset(self.smz3World.locationLookup.keys())

self.multiworld.state.smz3state[self.player] = TotalSMZ3Item.Progression([])

def generate_basic(self):
self.smz3World.Setup(WorldState.Generate(self.config, self.multiworld.random))
def create_items(self):
self.dungeon = TotalSMZ3Item.Item.CreateDungeonPool(self.smz3World)
self.dungeon.reverse()
self.progression = TotalSMZ3Item.Item.CreateProgressionPool(self.smz3World)
Expand Down Expand Up @@ -487,7 +487,7 @@ def create_item(self, name: str) -> Item:
ItemClassification.progression if SMZ3World.isProgression(TotalSMZ3Item.ItemType[name]) else ItemClassification.filler,
TotalSMZ3Item.ItemType[name], self.item_name_to_id[name],
self.player,
TotalSMZ3Item.Item(TotalSMZ3Item.ItemType[name], self))
TotalSMZ3Item.Item(TotalSMZ3Item.ItemType[name], getattr(self, "smz3World", None)))

def pre_fill(self):
from Fill import fill_restrictive
Expand Down

0 comments on commit 5f2c226

Please sign in to comment.