Skip to content

Commit

Permalink
Updates for 0.3.4
Browse files Browse the repository at this point in the history
Fixes and further yaml option!
  • Loading branch information
MrsMarinaRose committed Mar 31, 2024
1 parent f01d88b commit d82c77c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
14 changes: 9 additions & 5 deletions worlds/sms/SMSClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def activate_nozzle(id):

def activate_yoshi():
temp = dme.read_byte(addresses.SMS_YOSHI_UNLOCK)
if temp<130:
if temp < 130:
dme.write_byte(addresses.SMS_YOSHI_UNLOCK, 130)
extra_unlocks_needed()

Expand All @@ -490,10 +490,14 @@ def activate_yoshi():


async def handle_stages(ctx):
stage = dme.read_byte(addresses.SMS_CURRENT_STAGE)
if stage == 0x01: # Delfino Plaza
dme.write_byte(addresses.SMS_SHADOW_MARIO_STATE, 0x0)
return
while True:
if dme.is_hooked():
stage = dme.read_byte(addresses.SMS_NEXT_STAGE)
if stage == 0x01: # Delfino Plaza
episode = dme.read_byte(addresses.SMS_NEXT_EPISODE)
if not episode == 0x01:
dme.write_double(addresses.SMS_SHADOW_MARIO_STATE, 0x0)
await asyncio.sleep(0.1)


async def qol_writes():
Expand Down
1 change: 1 addition & 0 deletions worlds/sms/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
SMS_CURRENT_EPISODE = 0x803e970f

SMS_NEXT_STAGE = 0x803e9712
SMS_NEXT_EPISODE = 0x803e9713

SMS_SHADOW_MARIO_STATE = 0x80578A88

Expand Down
9 changes: 9 additions & 0 deletions worlds/sms/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,19 @@ class BlueCoinMaximum(Range):
default = 240


class TradeShineMaximum(Range):
"""The number of Shines from the boathouse trades that will be shuffled. If the Blue Coin Maximum is not enough
to obtain this amount, it will decrease automatically.
Keep in mind that if this value is too high, there is a chance you will have to nearly 100% the game."""
range_start = 0
range_end = 24
default = 12

@dataclass
class SmsOptions(PerGameCommonOptions):
level_access: LevelAccess
enable_coin_shines: EnableCoinShines
corona_mountain_shines: CoronaMountainShines
blue_coin_sanity: BlueCoinSanity
blue_coin_maximum: BlueCoinMaximum
trade_shine_maximum: TradeShineMaximum
4 changes: 3 additions & 1 deletion worlds/sms/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ def make_entrance_lambda(region: SmsRegion, world: "SmsWorld"):
def create_region(region: SmsRegion, world: "SmsWorld"):
new_region = Region(region.name, world.player, world.multiworld)
coin_counter = world.options.blue_coin_maximum.value
shine_limiter = world.options.trade_shine_maximum.value
for shine in region.shines:
if shine.hundred and not world.options.enable_coin_shines.value:
continue
if region.trade:
if world.options.blue_coin_sanity == "no_blue_coins" or coin_counter < 10:
if world.options.blue_coin_sanity == "no_blue_coins" or coin_counter < 10 or shine_limiter < 1:
continue
coin_counter -= 10
shine_limiter -= 1

new_location = SmsLocation(world.player, f"{region.display} - {shine.name}", shine.id, new_region)
new_location.access_rule = make_shine_lambda(shine, world)
Expand Down
4 changes: 2 additions & 2 deletions worlds/sms/static_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SmsRegion(NamedTuple):
ALL_REGIONS: list[SmsRegion] = [
# Delfino Airstrip
SmsRegion(AIRSTRIP, AIRSTRIP, Requirements(), [
Shine("Delfino Airstrip Dilemma", 523086, Requirements([NozzleType.spray]))
Shine("Delfino Airstrip Dilemma", 523086, Requirements([NozzleType.splasher]))
], []),


Expand Down Expand Up @@ -148,7 +148,7 @@ class SmsRegion(NamedTuple):
], parent_region="Bianco Entrance"),

SmsRegion("Bianco 4", BIANCO, Requirements(location="Bianco Hills - The Hillside Cave Secret"), [
Shine("Red Coins of Windmill Village", 52303,
Shine("Red Coins of Windmill Village", 523003,
Requirements([NozzleType.hover | NozzleType.rocket]))], [
BlueCoin("Hillside Pokey", 523178, Requirements([NozzleType.hover])),
BlueCoin("Bridge Underside", 523183)
Expand Down

0 comments on commit d82c77c

Please sign in to comment.