Super Mario 64: Rework logic for 100 Coins (#4131)

* sm64ex: Rework logic for 100 Coins

* sm64ex: 100 Coins Vanilla Option

* sm64ex: Avoiding raw int comparisons for 100 coin option

* sm64ex: Change 100 coin option from toggle to choice

* sm64ex: use snake_case for 100 coin option

* just use "vanilla" for option comparison (exempt-medic feedback)

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* sm64ex: remove vanilla 100 coins from item pool to remove overfilling stars

* yeah

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* Remove range condition (35 is the min for total stars)

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
josephwhite 2024-12-12 08:50:48 -05:00 committed by GitHub
parent 3acbe9ece1
commit 144d612c52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 4 deletions

View File

@ -3,10 +3,21 @@ from dataclasses import dataclass
from Options import DefaultOnToggle, Range, Toggle, DeathLink, Choice, PerGameCommonOptions, OptionSet, OptionGroup from Options import DefaultOnToggle, Range, Toggle, DeathLink, Choice, PerGameCommonOptions, OptionSet, OptionGroup
from .Items import action_item_table from .Items import action_item_table
class EnableCoinStars(DefaultOnToggle): class EnableCoinStars(Choice):
"""Disable to Ignore 100 Coin Stars. You can still collect them, but they don't do anything. """
Removes 15 locations from the pool.""" Determine logic for 100 Coin Stars.
Off - Removed from pool. You can still collect them, but they don't do anything.
Optimal for ignoring 100 Coin Stars entirely. Removes 15 locations from the pool.
On - Kept in pool, potentially randomized.
Vanilla - Kept in pool, but NOT randomized.
"""
display_name = "Enable 100 Coin Stars" display_name = "Enable 100 Coin Stars"
option_off = 0
option_on = 1
option_vanilla = 2
class StrictCapRequirements(DefaultOnToggle): class StrictCapRequirements(DefaultOnToggle):

View File

@ -104,7 +104,11 @@ class SM64World(World):
# 1Up Mushrooms # 1Up Mushrooms
self.multiworld.itempool += [self.create_item("1Up Mushroom") for i in range(0,self.filler_count)] self.multiworld.itempool += [self.create_item("1Up Mushroom") for i in range(0,self.filler_count)]
# Power Stars # Power Stars
self.multiworld.itempool += [self.create_item("Power Star") for i in range(0,self.number_of_stars)] star_range = self.number_of_stars
# Vanilla 100 Coin stars have to removed from the pool if other max star increasing options are active.
if self.options.enable_coin_stars == "vanilla":
star_range -= 15
self.multiworld.itempool += [self.create_item("Power Star") for i in range(0,star_range)]
# Keys # Keys
if (not self.options.progressive_keys): if (not self.options.progressive_keys):
key1 = self.create_item("Basement Key") key1 = self.create_item("Basement Key")
@ -166,6 +170,23 @@ class SM64World(World):
self.multiworld.get_location("Wing Mario Over the Rainbow 1Up Block", self.player).place_locked_item(self.create_item("1Up Mushroom")) self.multiworld.get_location("Wing Mario Over the Rainbow 1Up Block", self.player).place_locked_item(self.create_item("1Up Mushroom"))
self.multiworld.get_location("Bowser in the Sky 1Up Block", self.player).place_locked_item(self.create_item("1Up Mushroom")) self.multiworld.get_location("Bowser in the Sky 1Up Block", self.player).place_locked_item(self.create_item("1Up Mushroom"))
if (self.options.enable_coin_stars == "vanilla"):
self.multiworld.get_location("BoB: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("WF: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("JRB: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("CCM: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("BBH: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("HMC: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("LLL: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("SSL: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("DDD: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("SL: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("WDW: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("TTM: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("THI: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("TTC: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
self.multiworld.get_location("RR: 100 Coins", self.player).place_locked_item(self.create_item("Power Star"))
def get_filler_item_name(self) -> str: def get_filler_item_name(self) -> str:
return "1Up Mushroom" return "1Up Mushroom"