From 7651922dc9a941fc9391797ab998417da8242a2f Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Fri, 27 Oct 2023 10:58:56 -0700 Subject: [PATCH] add notes about mag effect activation --- src/BattleParamsIndex.hh | 16 ++++++++-------- src/CommandFormats.hh | 6 +++--- src/ItemParameterTable.hh | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/BattleParamsIndex.hh b/src/BattleParamsIndex.hh index 94d25b50..c950ef6c 100644 --- a/src/BattleParamsIndex.hh +++ b/src/BattleParamsIndex.hh @@ -15,14 +15,14 @@ class BattleParamsIndex { public: struct Entry { - le_uint16_t atp; // attack power - le_uint16_t psv; // perseverance (intelligence?) - le_uint16_t evp; // evasion - le_uint16_t hp; // hit points - le_uint16_t dfp; // defense - le_uint16_t ata; // accuracy - le_uint16_t lck; // luck - le_uint16_t esp; // ??? + le_uint16_t atp; + le_uint16_t psv; // Perseverance (intelligence?) + le_uint16_t evp; + le_uint16_t hp; + le_uint16_t dfp; + le_uint16_t ata; + le_uint16_t lck; + le_uint16_t esp; // Unknown parray unknown_a1; le_uint32_t experience; le_uint32_t difficulty; diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 33a88ef5..a7396a5c 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -4376,12 +4376,12 @@ struct G_StandardDropItemRequest_PC_V3_BB_6x60 : G_StandardDropItemRequest_DC_6x le_float unknown_a2; } __packed__; -// 6x61: Feed MAG +// 6x61: Activate MAG effect -struct G_FeedMAG_6x61 { +struct G_ActivateMagEffect_6x61 { G_UnusedHeader header; le_uint32_t mag_item_id; - le_uint32_t fed_item_id; + le_uint32_t effect_number; } __packed__; // 6x62: Unknown diff --git a/src/ItemParameterTable.hh b/src/ItemParameterTable.hh index 22f46acd..015d6935 100644 --- a/src/ItemParameterTable.hh +++ b/src/ItemParameterTable.hh @@ -65,6 +65,21 @@ public: uint8_t on_low_hp; uint8_t on_death; uint8_t on_boss; + // These flags control how likely each effect is to activate. First, the + // game computes step_synchro as follows: + // if synchro in [0, 30], step_synchro = 0 + // if synchro in [31, 60], step_synchro = 15 + // if synchro in [61, 80], step_synchro = 25 + // if synchro in [81, 100], step_synchro = 30 + // if synchro in [101, 120], step_synchro = 35 + // Then, the percent chance of the effect occurring upon its trigger (e.g. + // entering a boss arena) is: + // flag == 0 => activation + // flag == 1 => activation + step_synchro + // flag == 2 => step_synchro + // flag == 3 => activation - 10 + // flag == 4 => step_synchro - 10 + // anything else => 0 (effect never occurs) uint8_t on_pb_full_flag; uint8_t on_low_hp_flag; uint8_t on_death_flag;