diff --git a/CLI.py b/CLI.py index 65807c8..0d9d0d6 100644 --- a/CLI.py +++ b/CLI.py @@ -167,6 +167,8 @@ def run_with_parsed_args(opt_args : argparse.Namespace): stardoor_randomizer.open_level_stardoors() elif opt_args.stardoor_requirements == "random": stardoor_randomizer.shuffle_level_stardoors() + if opt_args.keydoor_requirements is not "vanilla": + stardoor_randomizer.open_keydoors() #stardoor_randomizer diff --git a/Config/randomizeObjects/objects.json b/Config/randomizeObjects/objects.json index 457d301..3153135 100644 --- a/Config/randomizeObjects/objects.json +++ b/Config/randomizeObjects/objects.json @@ -1,39 +1,4 @@ [ - { - "name": "Coins (Line Formation)", - "match": { "behaviour": "0x130008EC", "bparam2": 0 }, - "rules": { - "BOUNDING_BOX": { "length": 1000, "width": 100, "height": 100 } - } - }, - { - "name": "Coins (Upward Coin Formation)", - "match": { "behaviour": "0x130008EC", "bparam2": 1 }, - "rules": { - "BOUNDING_BOX": { "length": 100, "width": 100, "height": 1000 } - } - }, - { - "name": "Coins (Circle)", - "match": { "behaviour": "0x130008EC", "bparam2": 2 }, - "rules": { - "BOUNDING_BOX": { "length": 100, "width": 1000, "height": 1000 } - } - }, - { - "name": "Coins (Ring)", - "match": { "behaviour": "0x130008EC", "bparam2": 3 }, - "rules": { - "BOUNDING_BOX": { "length": 1000, "width": 1000, "height": 100 } - } - }, - { - "name": "Coins (Arrow)", - "match": { "behaviour": "0x130008EC", "bparam2": 4 }, - "rules": { - "BOUNDING_BOX": { "length": 100, "width": 1000, "height": 1000 } - } - }, { "name": "Coin (Type 1)", "match": { "model_id": "0x74" } diff --git a/Config/randomizeObjects/special.json b/Config/randomizeObjects/special.json index 87082ea..dd15cf8 100644 --- a/Config/randomizeObjects/special.json +++ b/Config/randomizeObjects/special.json @@ -17,6 +17,13 @@ "MAX_SLOPE": 0.99 } }, + { + "name": "Warp (Mario Start 2)", + "match": { "behaviour": "0x13002F64", "course_id": "0x06" }, + "rules": { + "DISABLE": true + } + }, { "name": "Warp (Mario Start 1)", "match": { "behaviour": "0x13002F74" }, @@ -108,6 +115,14 @@ "NO_FLOOR_REQUIRED": true } }, + { + "name": "BOB: Disable Coin Formation randomization", + "match": { "behaviour": "0x130008EC", "course_id": "0x09", "bparam2": "0x13" }, + "rules": { + "DISABLE": true + }, + "priority": 15 + }, { "name": "WC: Red Coins Wingcap", "match": { "behaviour": "0x13003EAC", "course_id": "0x1D" }, @@ -149,6 +164,36 @@ }, "priority": 5 }, + { + "name": "WMotR: Red Coins Spawn everywhere", + "match": { "behaviour": "0x13003EAC", "course_id": "0x1F" }, + "rules": { + "MIN_Y": -2500, + "MAX_Y": 4880, + "DISTANCE_TO": { "origin": [0, 1900, 0], "max_distance": 5000 }, + "NO_FLOOR_REQUIRED": true + }, + "priority": 10 + }, + { + "name": "WMotR: Coin Formations Spawn everywhere", + "match": { "behaviour": "0x130008EC", "course_id": "0x1F" }, + "rules": { + "MIN_Y": -2500, + "MAX_Y": 4880, + "DISTANCE_TO": { "origin": [0, 1900, 0], "max_distance": 5000 }, + "NO_FLOOR_REQUIRED": true + }, + "priority": 10 + }, + { + "name": "WMotR: Itembox Disabled", + "match": { "behaviour": "0x13002250", "course_id": "0x1F" }, + "rules": { + "DISABLE": true + }, + "priority": 10 + }, { "name": "JRB: Itembox in Ship can spawn in Water", "match": { "course_id": "0x0C", "area_id": "0x2" }, diff --git a/Enhancements/GameplayEnhancements.py b/Enhancements/GameplayEnhancements.py index 35ef324..08a22ca 100644 --- a/Enhancements/GameplayEnhancements.py +++ b/Enhancements/GameplayEnhancements.py @@ -6,15 +6,16 @@ def __init__(self, rom : 'ROM'): self.tweaking = Tweaking(rom) def disable_all_cutscenes(self): - self.tweaking.add_asm_patch( - [ - (0x6BD4, bytes([0x24, 0x00])), # Peach Cutscene - (0x6D90, bytes([0x24, 0x10, 0x00, 0x00])), # Lakitu Cutscene - (0x4B7C, bytes([0x24, 0x00])), # Level Intros #1 - (0x4924, bytes([0x10, 0x00])), # Level Intros #2 - (0x123F8, bytes([0x10, 0x00])), # Disable "Milestone" Messages - ] - ) + if self.rom.region in ['NORTH_AMERICA', 'EUROPE']: + self.tweaking.add_asm_patch( + [ + (0x6BD4, bytes([0x24, 0x00])), # Peach Cutscene + (0x6D90, bytes([0x24, 0x10, 0x00, 0x00])), # Lakitu Cutscene + (0x4B7C, bytes([0x24, 0x00])), # Level Intros #1 + (0x4924, bytes([0x10, 0x00])), # Level Intros #2 + (0x123F8, bytes([0x10, 0x00])), # Disable "Milestone" Messages + ] + ) def disable_starwarp(self): self.tweaking.add_asm_patch( diff --git a/Parsers/LevelScript.py b/Parsers/LevelScript.py index 8cb0a9b..b480ff4 100644 --- a/Parsers/LevelScript.py +++ b/Parsers/LevelScript.py @@ -390,8 +390,9 @@ def process_macro_objects(self, start, end): else: preset = preset_table[preset_id] position = (self.rom.read_integer(None, 2, True), self.rom.read_integer(None, 2, True), self.rom.read_integer(None, 2, True)) - (bparam1, bparam2) = (self.rom.read_integer(None, 1), self.rom.read_integer(None, 1)) - object3d = Object3D("MACRO_OBJ", self.current_area, preset.model_id, position, self.level, (None, rot_y, None), preset.behaviour_addr, mem_address = cursor, bparams=[bparam1, bparam2]) + bparam1 = self.rom.read_integer(None, 1) + bparam2 = self.rom.read_integer(None, 1) + object3d = Object3D("MACRO_OBJ", self.current_area, preset.model_id, position, self.level, (None, rot_y, None), preset.behaviour_addr, mem_address = cursor, bparams=[bparam1 if bparam1 > 0 else preset.default_b1, bparam2 if bparam2 > 0 else preset.default_b2]) objects_found.append(object3d) macro_table["entries"].append(dict( object3d=object3d, diff --git a/Spoiler.py b/Spoiler.py index 405b1f6..3ed3ddb 100644 --- a/Spoiler.py +++ b/Spoiler.py @@ -12,7 +12,7 @@ def add_entry(module : str, value : str): @staticmethod def output(): - with open('sm64_rando_spoiler.log', 'w') as spoiler_log_file: + with open('sm64_rando_spoiler.log', 'w+') as spoiler_log_file: for module in list(SpoilerLog.entries.keys()): spoiler_log_file.write(module.upper().center(40, '-') + '\n') for entry in SpoilerLog.entries[module]: diff --git a/__version__.py b/__version__.py index f0788a8..fb9b668 100644 --- a/__version__.py +++ b/__version__.py @@ -1 +1 @@ -__version__ = '0.7.1' +__version__ = '0.7.2'