From bddd44d04115dbf5adcfe68021cfc833d4830b28 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Tue, 29 Oct 2019 17:45:21 +0100 Subject: Dehardcode status effect boss resistance --- src/map/status.c | 52 ++++------------------------------------------------ src/map/status.h | 3 ++- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index 70d2d0219..08363d90b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -10593,55 +10593,10 @@ static bool status_is_boss_resist_sc(enum sc_type type) { if (type >= SC_COMMON_MIN && type <= SC_COMMON_MAX) return true; - switch (type) { - case SC_BLESSING: - case SC_DEC_AGI: - case SC_PROVOKE: - case SC_COMA: - case SC_GRAVITATION: - case SC_NJ_SUITON: - case SC_RICHMANKIM: - case SC_ROKISWEIL: - case SC_FOGWALL: - case SC_FROSTMISTY: - case SC_BURNING: - case SC_MARSHOFABYSS: - case SC_ADORAMUS: - case SC_NEEDLE_OF_PARALYZE: - case SC_DEEP_SLEEP: - case SC_COLD: - - // Exploit prevention - kRO Fix - case SC_PYREXIA: - case SC_DEATHHURT: - case SC_TOXIN: - case SC_PARALYSE: - case SC_VENOMBLEED: - case SC_MAGICMUSHROOM: - case SC_OBLIVIONCURSE: - case SC_LEECHESEND: - - // Ranger Effects - case SC_WUGBITE: - case SC_ELECTRICSHOCKER: - case SC_MAGNETICFIELD: - // Masquerades - case SC__ENERVATION: - case SC__GROOMY: - case SC__LAZINESS: - case SC__UNLUCKY: - case SC__WEAKNESS: - case SC__IGNORANCE: + if (status->get_sc_type(type) & SC_NO_BOSS) + return true; - // Other Effects - case SC_VACUUM_EXTREME: - case SC_NETHERWORLD: - case SC_FRESHSHRIMP: - case SC_SV_ROOTTWIST: - case SC_BITESCAR: - return true; - } return false; } @@ -13510,7 +13465,8 @@ static bool status_read_scdb_libconfig_sub_flag(struct config_setting_t *it, int { "Buff", SC_BUFF }, { "Debuff", SC_DEBUFF }, { "NoMadoReset", SC_MADO_NO_RESET }, - { "NoAllReset", SC_NO_CLEAR } + { "NoAllReset", SC_NO_CLEAR }, + { "NoBoss", SC_NO_BOSS }, }; ARR_FIND(0, ARRAYLENGTH(flags), j, strcmpi(flag, flags[j].name) == 0); diff --git a/src/map/status.h b/src/map/status.h index f10b154ab..495081391 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -61,7 +61,8 @@ typedef enum sc_conf_type { SC_DEBUFF = 0x020, SC_MADO_NO_RESET = 0x040, SC_NO_CLEAR = 0x080, - SC_VISIBLE = 0x100 + SC_VISIBLE = 0x100, + SC_NO_BOSS = 0x200 } sc_conf_type; /** -- cgit v1.2.3-60-g2f50