From 9fd90ee3240e00aa28b6164d15fcf5479d23fa21 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 7 Oct 2023 13:59:48 -0700 Subject: [PATCH] update names used in Ep3 disassembly --- src/Episode3/CardSpecial.cc | 60 ++++++++++++++++++++--------------- src/Episode3/DataIndexes.cc | 62 ++++++++++++++++++------------------- src/Episode3/DataIndexes.hh | 2 +- 3 files changed, 67 insertions(+), 57 deletions(-) diff --git a/src/Episode3/CardSpecial.cc b/src/Episode3/CardSpecial.cc index 60b6ddb2..b78e425f 100644 --- a/src/Episode3/CardSpecial.cc +++ b/src/Episode3/CardSpecial.cc @@ -1448,11 +1448,11 @@ bool CardSpecial::evaluate_effect_arg2_condition( case 'n': switch (atoi(arg2_text + 1)) { - case 0: + case 0: // n00 return true; - case 1: + case 1: // n01 return (!card || (card->get_definition()->def.type == CardType::HUNTERS_SC)); - case 2: + case 2: // n02 for (size_t z = 0; (z < 4 * 9) && (as.target_card_refs[z] != 0xFFFF); z++) { auto target_card = this->server()->card_for_set_card_ref(as.target_card_refs[z]); if (target_card && target_card->check_card_flag(2)) { @@ -1460,7 +1460,7 @@ bool CardSpecial::evaluate_effect_arg2_condition( } } return false; - case 3: + case 3: // n03 for (size_t z = 0; z < 8; z++) { uint16_t action_card_ref = as.action_card_refs[z]; if (action_card_ref != 0xFFFF) { @@ -1471,39 +1471,39 @@ bool CardSpecial::evaluate_effect_arg2_condition( } } return false; - case 4: + case 4: // n04 return card->action_chain.check_flag(0x0001E000); - case 5: + case 5: // n05 return card->action_chain.check_flag(0x00001E00); - case 6: + case 6: // n06 return (card->get_definition()->def.card_class() == CardClass::NATIVE_CREATURE); - case 7: + case 7: // n07 return (card->get_definition()->def.card_class() == CardClass::A_BEAST_CREATURE); - case 8: + case 8: // n08 return (card->get_definition()->def.card_class() == CardClass::MACHINE_CREATURE); - case 9: + case 9: // n09 return (card->get_definition()->def.card_class() == CardClass::DARK_CREATURE); - case 10: + case 10: // n10 return (card->get_definition()->def.card_class() == CardClass::SWORD_ITEM); - case 11: + case 11: // n11 return (card->get_definition()->def.card_class() == CardClass::GUN_ITEM); - case 12: + case 12: // n12 return (card->get_definition()->def.card_class() == CardClass::CANE_ITEM); - case 13: { + case 13: { // n13 auto ce = card->get_definition(); return ((ce->def.card_class() == CardClass::GUARD_ITEM) || (ce->def.card_class() == CardClass::MAG_ITEM) || this->server()->ruler_server->find_condition_on_card_ref( card->get_card_ref(), ConditionType::GUARD_CREATURE, 0, 0, 0)); } - case 14: + case 14: // n14 return card->get_definition()->def.is_sc(); - case 15: + case 15: // n15 return ((card->action_chain.chain.attack_action_card_ref_count == 0) && (card->action_metadata.defense_card_ref_count == 0)); - case 16: + case 16: // n16 return this->server()->ruler_server->card_ref_is_aerial(card->get_card_ref()); - case 17: { + case 17: { // n17 auto sc_card = this->server()->card_for_set_card_ref(sc_card_ref); int16_t this_ap = card->ap; int16_t other_ap = -1; @@ -1517,7 +1517,7 @@ bool CardSpecial::evaluate_effect_arg2_condition( } return (other_ap == this_ap); } - case 18: + case 18: // n18 for (size_t z = 0; (z < 4 * 9) && (as.target_card_refs[z] != 0xFFFF); z++) { auto target_card = this->server()->card_for_set_card_ref(as.target_card_refs[z]); if (target_card && target_card->get_definition()->def.is_sc()) { @@ -1525,20 +1525,20 @@ bool CardSpecial::evaluate_effect_arg2_condition( } } return false; - case 19: + case 19: // n19 return this->server()->ruler_server->find_condition_on_card_ref( card->get_card_ref(), ConditionType::PARALYZE, 0, 0, 0); - case 20: + case 20: // n20 return this->server()->ruler_server->find_condition_on_card_ref( card->get_card_ref(), ConditionType::FREEZE, 0, 0, 0); - case 21: { + case 21: { // n21 uint8_t client_id = client_id_for_card_ref(sc_card_ref); if (client_id != 0xFF) { return card->action_chain.check_flag(0x00002000 << client_id); } return false; } - case 22: { + case 22: { // n22 uint8_t client_id = client_id_for_card_ref(sc_card_ref); if (client_id != 0xFF) { return card->action_chain.check_flag(0x00000200 << client_id); @@ -1739,7 +1739,7 @@ bool CardSpecial::execute_effect( case ConditionType::PIERCE: case ConditionType::UNUSED_0F: case ConditionType::SET_MV_COST_TO_0: - case ConditionType::UNKNOWN_13: + case ConditionType::UNUSED_13: case ConditionType::ACID: case ConditionType::ADD_1_TO_MV_COST: case ConditionType::ABILITY_TRAP: @@ -1930,7 +1930,7 @@ bool CardSpecial::execute_effect( (cond.type == ConditionType::CANNOT_DEFEND) || (cond.type == ConditionType::GUOM) || (cond.type == ConditionType::PARALYZE) || - (cond.type == ConditionType::UNKNOWN_13) || + (cond.type == ConditionType::UNUSED_13) || (cond.type == ConditionType::ACID) || (cond.type == ConditionType::ADD_1_TO_MV_COST) || (cond.type == ConditionType::CURSE) || @@ -2655,6 +2655,16 @@ vector> CardSpecial::get_targeted_cards_for_condition( add_card_refs(ps->get_card_refs_within_range_from_all_players(range, card1_loc, CardType::ITEM)); } } + if (card1) { + auto ce = this->server()->definition_for_card_ref(card_ref); + auto ps = card1->player_state(); + if (ce && ps) { + uint16_t range_card_id = this->get_card_id_with_effective_range(card1, ce->def.card_id, card2); + parray range; + compute_effective_range(range, this->server()->card_index, range_card_id, card1_loc, this->server()->map_and_rules); + add_card_refs(ps->get_all_cards_within_range(range, card1_loc, card1->get_team_id())); + } + } break; case 4: // p04 size_t z; diff --git a/src/Episode3/DataIndexes.cc b/src/Episode3/DataIndexes.cc index ffbc3fce..93dba7f7 100644 --- a/src/Episode3/DataIndexes.cc +++ b/src/Episode3/DataIndexes.cc @@ -342,11 +342,11 @@ static const unordered_map description_for_expr_token({ {"tt", "Physical damage"}, {"lv", "Dice boost"}, {"adm", "SC attack damage"}, - {"ddm", "Defending damage"}, + {"ddm", "Attack bonus"}, {"sat", "Number of Sword-type items on SC\'s team"}, - {"edm", "Defending damage"}, // TODO: How is this different from ddm? - {"ldm", "Unknown: ldm"}, // Unused - {"rdm", "Defending damage"}, // TODO: How is this different from ddm/edm? + {"edm", "Target attack bonus"}, + {"ldm", "Last attack damage before defense"}, // Unused + {"rdm", "Last attack damage"}, {"fdm", "Final damage (after defense)"}, {"ndm", "Unknown: ndm"}, // Unused {"ehp", "Attacker HP"}, @@ -385,7 +385,7 @@ static const vector description_for_n_condition({ /* n04 */ "Attack has Pierce", /* n05 */ "Attack has Rampage", /* n06 */ "Native attribute", - /* n07 */ "A.Beast attribute", + /* n07 */ "Altered Beast attribute", /* n08 */ "Machine attribute", /* n09 */ "Dark attribute", /* n10 */ "Sword-type item", @@ -399,23 +399,23 @@ static const vector description_for_n_condition({ /* n18 */ "Any target is an SC", /* n19 */ "Has Paralyzed condition", /* n20 */ "Has Frozen condition", - /* n21 */ "???", // TODO: This appears related to Pierce/Rampage - /* n22 */ "???", // TODO: This appears related to Pierce/Rampage + /* n21 */ "Target is affected by Pierce", + /* n22 */ "Target is affected by Rampage", }); static const vector description_for_p_target({ - /* p00 */ "Unknown: p00", // Unused; probably invalid + /* p00 */ "(Invalid)", /* p01 */ "SC / FC who set the card", /* p02 */ "Attacking SC / FC", - /* p03 */ "Unknown: p03", // Unused - /* p04 */ "Unknown: p04", // Unused + /* p03 */ "All item FCs from both teams within attack range", // Unused + /* p04 */ "All action cards in the chain after this one", // Unused /* p05 */ "SC / FC who set the card", // Identical to p01 - /* p06 */ "??? (TODO)", - /* p07 */ "??? (TODO; Weakness)", + /* p06 */ "Attacking card, or SC if attacking card is an item", + /* p07 */ "Attacking card", /* p08 */ "FC\'s owner SC", - /* p09 */ "Unknown: p09", // Unused - /* p10 */ "All ally FCs", - /* p11 */ "All ally FCs", // TODO: how is this different from p10? + /* p09 */ "All cards from both teams within attack range", // Unused + /* p10 */ "All ally SCs and FCs", + /* p11 */ "All ally FCs", /* p12 */ "All non-aerial FCs on both teams", /* p13 */ "All FCs on both teams that are Frozen", /* p14 */ "All FCs on both teams with <= 3 HP", @@ -423,29 +423,29 @@ static const vector description_for_p_target({ /* p16 */ "All FCs on both teams with >= 8 HP", /* p17 */ "This card", /* p18 */ "SC who equipped this card", - /* p19 */ "Unknown: p19", // Unused - /* p20 */ "Unknown: p20", // Unused - /* p21 */ "Unknown: p21", // Unused + /* p19 */ "All HU-class SCs", // Unused + /* p20 */ "All RA-class SCs", // Unused + /* p21 */ "All FO-class SCs", // Unused /* p22 */ "All characters (SCs & FCs) including this card", // TODO: But why does Shifta apply only to allies then? /* p23 */ "All characters (SCs & FCs) except this card", /* p24 */ "All FCs on both teams that have Paralysis", - /* p25 */ "Unknown: p25", // Unused - /* p26 */ "Unknown: p26", // Unused - /* p27 */ "Unknown: p27", // Unused - /* p28 */ "Unknown: p28", // Unused - /* p29 */ "Unknown: p29", // Unused - /* p30 */ "Unknown: p30", // Unused - /* p31 */ "Unknown: p31", // Unused - /* p32 */ "Unknown: p32", // Unused - /* p33 */ "Unknown: p33", // Unused - /* p34 */ "Unknown: p34", // Unused + /* p25 */ "All aerial SCs and FCs", // Unused + /* p26 */ "All cards not at maximum HP", // Unused + /* p27 */ "All Native creatures", // Unused + /* p28 */ "All Altered Beast creatures", // Unused + /* p29 */ "All Machine creatures", // Unused + /* p30 */ "All Dark creatures", // Unused + /* p31 */ "All Sword-type items", // Unused + /* p32 */ "All Gun-type items", // Unused + /* p33 */ "All Cane-type items", // Unused + /* p34 */ "All non-SC targets", // Unused /* p35 */ "All characters (SCs & FCs) within range", // Used for Explosion effect /* p36 */ "All ally SCs within range, but not the caster", // Resta - /* p37 */ "All FCs or all opponent FCs (TODO)", // TODO: when to use which selector? is a3 involved here somehow? + /* p37 */ "All opponent FCs", /* p38 */ "All allies except items within range (and not this card)", /* p39 */ "All FCs that cost 4 or more points", /* p40 */ "All FCs that cost 3 or fewer points", - /* p41 */ "Unknown: p41", // Unused + /* p41 */ "All FCs next to attacker, and all of attacker\'s equipped items", // Unused /* p42 */ "Attacker during defense phase", // Only used by TP Defense /* p43 */ "Owner SC of defending FC during attack", /* p44 */ "SC\'s own creature FCs within range", @@ -482,7 +482,7 @@ static const vector description_for_condition_type({ /* 0x10 */ {true, "HEAL", "Increase HP by N"}, /* 0x11 */ {false, "RETURN_TO_HAND", "Return card to hand"}, /* 0x12 */ {false, "SET_MV_COST_TO_0", "Movement costs nothing"}, - /* 0x13 */ {false, "UNKNOWN_13", nullptr}, + /* 0x13 */ {false, "UNUSED_13", nullptr}, /* 0x14 */ {false, "ACID", "Give Acid condition"}, /* 0x15 */ {false, "ADD_1_TO_MV_COST", "Add 1 to move costs"}, /* 0x16 */ {true, "MIGHTY_KNUCKLE", "Temporarily increase AP by N, and set ATK dice to zero"}, diff --git a/src/Episode3/DataIndexes.hh b/src/Episode3/DataIndexes.hh index 44663418..e301b504 100644 --- a/src/Episode3/DataIndexes.hh +++ b/src/Episode3/DataIndexes.hh @@ -196,7 +196,7 @@ enum class ConditionType : uint8_t { HEAL = 0x10, // Increase HP by N RETURN_TO_HAND = 0x11, // Return card to hand SET_MV_COST_TO_0 = 0x12, - UNKNOWN_13 = 0x13, + UNUSED_13 = 0x13, ACID = 0x14, // Give Acid condition ADD_1_TO_MV_COST = 0x15, MIGHTY_KNUCKLE = 0x16, // Temporarily increase AP by N, and set ATK dice to zero