From ae49ca0189aeb6ccffa12cdb9e5cd4f2a901f9aa Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Tue, 13 Dec 2022 23:39:13 -0800 Subject: [PATCH] add DISABLE_INTERFERENCE behavior flag --- src/Episode3/CardSpecial.cc | 10 ++++++++++ src/Episode3/DataIndex.hh | 1 + system/config.example.json | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/Episode3/CardSpecial.cc b/src/Episode3/CardSpecial.cc index b917a15d..9a255cd8 100644 --- a/src/Episode3/CardSpecial.cc +++ b/src/Episode3/CardSpecial.cc @@ -3370,6 +3370,11 @@ void CardSpecial::check_for_defense_interference( shared_ptr attacker_card, shared_ptr target_card, int16_t* inout_unknown_p4) { + // Note: This check is not part of the original implementation. + if (this->server()->base()->data_index->behavior_flags & BehaviorFlag::DISABLE_INTERFERENCE) { + return; + } + if (!inout_unknown_p4) { return; } @@ -4319,6 +4324,11 @@ void CardSpecial::unknown_8024A9D8(const ActionState& pa, uint16_t action_card_r } void CardSpecial::check_for_attack_interference(shared_ptr unknown_p2) { + // Note: This check is not part of the original implementation. + if (this->server()->base()->data_index->behavior_flags & BehaviorFlag::DISABLE_INTERFERENCE) { + return; + } + if (unknown_p2->action_chain.chain.damage <= 0) { return; } diff --git a/src/Episode3/DataIndex.hh b/src/Episode3/DataIndex.hh index 3db0ae9d..1b2f8f1f 100644 --- a/src/Episode3/DataIndex.hh +++ b/src/Episode3/DataIndex.hh @@ -33,6 +33,7 @@ enum BehaviorFlag { LOAD_CARD_TEXT = 0x00000020, ENABLE_RECORDING = 0x00000040, DISABLE_MASKING = 0x00000080, + DISABLE_INTERFERENCE = 0x00000100, }; diff --git a/system/config.example.json b/system/config.example.json index ab5012af..15f8aa2b 100644 --- a/system/config.example.json +++ b/system/config.example.json @@ -265,6 +265,8 @@ // 0x00000040 => Enable battle recording (after a battle, players can save the // recording with the $saverec command) // 0x00000080 => Disable command masking during battles + // 0x00000100 => Disable interference (COMs randomly coming to each other's + // rescue) "Episode3BehaviorFlags": 0x00000002, // Episode 3 card auction configuration. CardAuctionPoints specifies how many