Skip to content

Commit

Permalink
v0.1.0 files
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLX5 committed Apr 5, 2024
1 parent 9a1dbf7 commit f5d7817
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 81 deletions.
150 changes: 86 additions & 64 deletions worlds/mmx3/Client.py

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions worlds/mmx3/Levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,7 @@
LocationName.doppler_lab_3_hp: [0x0C, 0x139, 0x00],

LocationName.bit_defeat: [0xFF, 0x00B, 0x00],
LocationName.byte_defeat: [0xFF, 0x00A, 0x00]
}
LocationName.byte_defeat: [0xFF, 0x00A, 0x00],

LocationName.victory: [0x0C, 0x00E, 0x00],
}
2 changes: 1 addition & 1 deletion worlds/mmx3/Regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def connect_regions(world: World):

# Connect Vile
connect(world, RegionName.blizzard_buffalo_start, RegionName.vile)
connect(world, RegionName.toxic_seahorse_start, RegionName.vile)
connect(world, RegionName.volt_catfish_start, RegionName.vile)
connect(world, RegionName.crush_crawfish_start, RegionName.vile)
connect(world, RegionName.vile, RegionName.vile_before)
connect(world, RegionName.vile_before, RegionName.vile_boss)
Expand Down
9 changes: 5 additions & 4 deletions worlds/mmx3/Rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

HASH_US = 'cfe8c11f0dce19e4fa5f3fd75775e47c'
HASH_LEGACY = 'ff683b75e75e9b59f0c713c7512a016b'
ROM_PLAYER_LIMIT = 65535

weapon_rom_data = {
0xBD000B: [0x1FC8, 0xFF],
Expand Down Expand Up @@ -66,7 +65,6 @@ class MMX3DeltaPatch(APDeltaPatch):
def get_source_data(cls) -> bytes:
return get_base_rom_bytes()


class LocalRom:

def __init__(self, file, patch=True, vanillaRom=None, name=None, hash=None):
Expand Down Expand Up @@ -165,6 +163,9 @@ def patch_rom(world: World, rom, player):

# EnergyLink
rom.write_byte(0x17FFF7, world.options.energy_link.value)

# DeathLink
rom.write_byte(0x17FFF8, world.options.death_link.value)

# Setup starting life count
rom.write_byte(0x0019B1, world.options.starting_life_count.value)
Expand All @@ -185,8 +186,8 @@ def get_base_rom_bytes(file_name: str = "") -> bytes:

basemd5 = hashlib.md5()
basemd5.update(base_rom_bytes)
if basemd5.hexdigest() not in {HASH_US, HASH_LEGACY}:
raise Exception('Supplied Base Rom does not match known MD5 for US or Legacy Collection release. '
if basemd5.hexdigest() not in {HASH_US}:
raise Exception('Supplied Base Rom does not match known MD5 for US or LC release. '
'Get the correct game and version, then dump it')
get_base_rom_bytes.base_rom_bytes = base_rom_bytes
return base_rom_bytes
Expand Down
17 changes: 8 additions & 9 deletions worlds/mmx3/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,31 @@ def set_rules(world: MMX3World):
# Vile entrance rules
vile_open = world.options.vile_open
entrance_blizzard = multiworld.get_entrance(f"{RegionName.blizzard_buffalo_start} -> {RegionName.vile}", player)
entrance_toxic = multiworld.get_entrance(f"{RegionName.volt_catfish_start} -> {RegionName.vile}", player)
entrance_volt = multiworld.get_entrance(f"{RegionName.volt_catfish_start} -> {RegionName.vile}", player)
entrance_crush = multiworld.get_entrance(f"{RegionName.crush_crawfish_start} -> {RegionName.vile}", player)
if vile_open == "multiworld":
set_rule(entrance_blizzard, lambda state: state.has(ItemName.stage_vile, player))
set_rule(entrance_toxic, lambda state: state.has(ItemName.stage_vile, player))
set_rule(entrance_volt, lambda state: state.has(ItemName.stage_vile, player))
set_rule(entrance_crush, lambda state: state.has(ItemName.stage_vile, player))
elif vile_open == "medals":
set_rule(entrance_blizzard, lambda state: state.has(ItemName.maverick_medal, player, world.options.vile_medal_count.value))
set_rule(entrance_toxic, lambda state: state.has(ItemName.maverick_medal, player, world.options.vile_medal_count.value))
set_rule(entrance_volt, lambda state: state.has(ItemName.maverick_medal, player, world.options.vile_medal_count.value))
set_rule(entrance_crush, lambda state: state.has(ItemName.maverick_medal, player, world.options.vile_medal_count.value))
elif vile_open == "weapons":
set_rule(entrance_blizzard, lambda state: state.has_group("Weapons", player, world.options.vile_weapon_count.value))
set_rule(entrance_toxic, lambda state: state.has_group("Weapons", player, world.options.vile_weapon_count.value))
set_rule(entrance_volt, lambda state: state.has_group("Weapons", player, world.options.vile_weapon_count.value))
set_rule(entrance_crush, lambda state: state.has_group("Weapons", player, world.options.vile_weapon_count.value))
elif vile_open == "armor_upgrades":
set_rule(entrance_blizzard, lambda state: state.has_group("Armor Upgrades", player, world.options.vile_upgrade_count.value))
set_rule(entrance_toxic, lambda state: state.has_group("Armor Upgrades", player, world.options.vile_upgrade_count.value))
set_rule(entrance_volt, lambda state: state.has_group("Armor Upgrades", player, world.options.vile_upgrade_count.value))
set_rule(entrance_crush, lambda state: state.has_group("Armor Upgrades", player, world.options.vile_upgrade_count.value))
elif vile_open == "heart_tanks":
set_rule(entrance_blizzard, lambda state: state.has(ItemName.heart_tank, player, world.options.vile_heart_tank_count.value))
set_rule(entrance_toxic, lambda state: state.has(ItemName.heart_tank, player, world.options.vile_heart_tank_count.value))
set_rule(entrance_volt, lambda state: state.has(ItemName.heart_tank, player, world.options.vile_heart_tank_count.value))
set_rule(entrance_crush, lambda state: state.has(ItemName.heart_tank, player, world.options.vile_heart_tank_count.value))
elif vile_open == "sub_tanks":
set_rule(entrance_blizzard, lambda state: state.has(ItemName.sub_tank, player, world.options.vile_sub_tank_count.value))
set_rule(entrance_toxic, lambda state: state.has(ItemName.sub_tank, player, world.options.vile_sub_tank_count.value))
set_rule(entrance_volt, lambda state: state.has(ItemName.sub_tank, player, world.options.vile_sub_tank_count.value))
set_rule(entrance_crush, lambda state: state.has(ItemName.sub_tank, player, world.options.vile_sub_tank_count.value))

# Bit & Byte arena entrance rules
Expand Down Expand Up @@ -124,7 +124,6 @@ def set_rules(world: MMX3World):
lambda state: (
state.has(ItemName.tornado_fang, player) or
state.has(ItemName.ride_chimera, player) or
state.has(ItemName.ride_hawk, player) or
state.has(ItemName.ride_kangaroo, player)
))
set_rule(multiworld.get_location(LocationName.blizzard_buffalo_sub_tank, player),
Expand Down Expand Up @@ -409,7 +408,7 @@ def add_z_saber_logic(world):
add_rule(multiworld.get_location(LocationName.doppler_lab_3_boss, player),
lambda state: state.has(ItemName.z_saber, player))
elif logic_z_saber == 4:
add_rule(multiworld.get_entrance(f"{RegionName.dr_doppler_lab_3} -> {RegionName.dr_doppler_lab_4}", player),
add_rule(multiworld.get_entrance(f"{RegionName.dr_doppler_lab_3_boss} -> {RegionName.dr_doppler_lab_4}", player),
lambda state: state.has(ItemName.z_saber, player))


Expand Down
3 changes: 2 additions & 1 deletion worlds/mmx3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import typing
import math
import settings
import hashlib
import threading

from BaseClasses import Item, MultiWorld, Tutorial, ItemClassification
Expand All @@ -22,7 +23,7 @@ class RomFile(settings.SNESRomPath):
"""File name of the SMW US rom"""
description = "Mega Man X3 (USA) ROM File"
copy_to = "Mega Man X3 (USA).sfc"
md5s = [HASH_US, HASH_LEGACY]
md5s = [HASH_US]

rom_file: RomFile = RomFile(RomFile.copy_to)

Expand Down
Binary file modified worlds/mmx3/data/mmx3_basepatch.bsdiff4
Binary file not shown.
Binary file modified worlds/mmx3/data/mmx3_legacy.bsdiff4
Binary file not shown.

0 comments on commit f5d7817

Please sign in to comment.