From cbaf343e8310dd068a04e8a96979e780233d0a9c Mon Sep 17 00:00:00 2001 From: Asheraf Date: Tue, 29 Oct 2019 21:01:58 +0100 Subject: Dehardcode combo skills check --- src/map/skill.c | 30 +++++++++--------------------- src/map/skill.h | 1 + 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index 7451fbf41..ad974c10b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -13962,27 +13962,9 @@ static int skill_isammotype(struct map_session_data *sd, int skill_id) **/ static bool skill_is_combo(int skill_id) { - switch( skill_id ) - { - case MO_CHAINCOMBO: - case MO_COMBOFINISH: - case CH_TIGERFIST: - case CH_CHAINCRUSH: - case MO_EXTREMITYFIST: - case TK_TURNKICK: - case TK_STORMKICK: - case TK_DOWNKICK: - case TK_COUNTER: - case TK_JUMPKICK: - case HT_POWER: - case GC_COUNTERSLASH: - case GC_WEAPONCRUSH: - case SR_FALLENEMPIRE: - case SR_DRAGONCOMBO: - case SR_TIGERCANNON: - case SR_GATEOFHELL: - return true; - } + if (skill->get_inf2(skill_id) & INF2_IS_COMBO_SKILL) + return true; + return false; } @@ -20279,6 +20261,12 @@ static void skill_validate_skillinfo(struct config_setting_t *conf, struct s_ski } else { sk->inf2 &= ~INF2_HIDDEN_TRAP; } + } else if (strcmpi(type, "IsCombo") == 0) { + if (on) { + sk->inf2 |= INF2_IS_COMBO_SKILL; + } else { + sk->inf2 &= ~INF2_IS_COMBO_SKILL; + } } else if (strcmpi(type, "None") != 0) { skilldb_invalid_error(type, config_setting_name(t), sk->nameid); } diff --git a/src/map/skill.h b/src/map/skill.h index 5da37d129..fe5cb6282 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -125,6 +125,7 @@ enum e_skill_inf2 { INF2_SHOW_SKILL_SCALE = 0x20000, INF2_ALLOW_REPRODUCE = 0x40000, INF2_HIDDEN_TRAP = 0x80000, // Traps that are hidden (based on trap_visiblity battle conf) + INF2_IS_COMBO_SKILL = 0x100000, // Sets whether a skill can be used in combos or not }; -- cgit v1.2.3-70-g09d2