From add493260462a4d3cb5c66e92b967827ad1fcb31 Mon Sep 17 00:00:00 2001 From: Matt Martin Date: Thu, 24 Feb 2022 20:47:45 -0700 Subject: [PATCH 1/2] Adding Controllable Coliseum flag --- args/coliseum.py | 7 +++++++ data/coliseum.py | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/args/coliseum.py b/args/coliseum.py index 6f7d6cfc..bb1620b8 100644 --- a/args/coliseum.py +++ b/args/coliseum.py @@ -29,6 +29,9 @@ def parse(parser): coliseum.add_argument("-cnil", "--coliseum-no-illuminas", action = "store_true", help = "Illuminas will not appear in coliseum") + coliseum.add_argument("-cc", "--coliseum-controllable", action = "store_true", + help = "Make characters controllable in coliseum (except Umaro)") + def process(args): args._process_min_max("coliseum_rewards_visible_random") @@ -56,6 +59,9 @@ def flags(args): if args.coliseum_no_illuminas: flags += " -cnil" + if args.coliseum_controllable: + flags += " -cc" + return flags def options(args): @@ -84,6 +90,7 @@ def options(args): ("Rewards Menu", args.coliseum_rewards_menu), ("No Exp. Eggs", args.coliseum_no_exp_eggs), ("No Illuminas", args.coliseum_no_illuminas), + ("Controllable", args.coliseum_controllable), ] def menu(args): diff --git a/data/coliseum.py b/data/coliseum.py index 095f6a2f..84245479 100644 --- a/data/coliseum.py +++ b/data/coliseum.py @@ -75,6 +75,15 @@ def randomize_rewards_hidden(self): for match_index in hidden_indices: self.matches[match_index].reward_hidden = 1 + def controllable(self): + # Replacing these commands from vanilla with NO-OPS to make Coliseum battles controllable: + # C2/092F: AD 97 3A LDA $3A97 (RAM $3A97 = character are on auto-pilot [colosseum]) + # C2/0932: D0 91 BNE $08C5 (exit if in the Colosseum) + from memory.space import Reserve + import instruction.asm as asm + + space = Reserve(0x02092f, 0x020933, "removing Coliseum check for commands", asm.NOP()) + def mod(self): if self.args.coliseum_opponents_shuffle: self.shuffle_opponents() @@ -91,6 +100,9 @@ def mod(self): if self.args.coliseum_rewards_visible_random: self.randomize_rewards_hidden() + if self.args.coliseum_controllable: + self.controllable() + def log(self): from log import section section("Coliseum", self.formatted_rows(), []) From ffbb3a2546cb1752b7c1a5ae967adf6f0c72eceb Mon Sep 17 00:00:00 2001 From: Matt Martin Date: Sat, 26 Feb 2022 15:27:19 -0700 Subject: [PATCH 2/2] Making Coliseum runnable with -cc flag --- data/coliseum.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/coliseum.py b/data/coliseum.py index 84245479..d9f9e775 100644 --- a/data/coliseum.py +++ b/data/coliseum.py @@ -79,10 +79,15 @@ def controllable(self): # Replacing these commands from vanilla with NO-OPS to make Coliseum battles controllable: # C2/092F: AD 97 3A LDA $3A97 (RAM $3A97 = character are on auto-pilot [colosseum]) # C2/0932: D0 91 BNE $08C5 (exit if in the Colosseum) + + # and runnable... + # C2/5BEC: AD 97 3A LDA $3A97 + # C2/5BEF: D0 29 BNE $5C1A (exit if in Colosseum) from memory.space import Reserve import instruction.asm as asm space = Reserve(0x02092f, 0x020933, "removing Coliseum check for commands", asm.NOP()) + space = Reserve(0x025bec, 0x025bf0, "removing Coliseum no-run", asm.NOP()) def mod(self): if self.args.coliseum_opponents_shuffle: