diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-05-22 09:30:30 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-05-22 09:30:30 -0300 |
commit | b9f9183e3a88181dc2888054a67837d255206676 (patch) | |
tree | 7e6f0c06f5b21de6a5b985ba123934ce8b1c41d6 /src/emap/battle.c | |
parent | 5d71662fa210c2b578180a624bb903dbf83847ca (diff) | |
download | evol-hercules-b9f9183e3a88181dc2888054a67837d255206676.tar.gz evol-hercules-b9f9183e3a88181dc2888054a67837d255206676.tar.bz2 evol-hercules-b9f9183e3a88181dc2888054a67837d255206676.tar.xz evol-hercules-b9f9183e3a88181dc2888054a67837d255206676.zip |
Reimplement Infinite Defense Check on Critical Override.
This way, targets with inf. def. like bifs will receive 1 DMG from crits as well
Diffstat (limited to 'src/emap/battle.c')
-rw-r--r-- | src/emap/battle.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/emap/battle.c b/src/emap/battle.c index 2a7b642..7ef8c83 100644 --- a/src/emap/battle.c +++ b/src/emap/battle.c @@ -94,11 +94,24 @@ struct Damage ebattle_calc_weapon_attack_post(struct Damage retVal, uint16 skill_lv __attribute__ ((unused)), int wflag __attribute__ ((unused))) { + // Rebuild Infinite Defense Rule + struct status_data *tstatus = status->get_status_data(target); + int infdef = 0; + infdef = (tstatus->mode&MD_PLANT && skill_id != RA_CLUSTERBOMB?1:0); +#ifdef RENEWAL + if (skill_id == HT_FREEZINGTRAP) + infdef = 0; +#endif + if (!infdef && target->type == BL_SKILL) { + const struct skill_unit *su = BL_UCCAST(BL_SKILL, target); + if (su->group->unit_id == UNT_REVERBERATION) + infdef = 1; // Reverberation takes 1 damage + } + // ML: Crits ignore defense (estimate) // (regardless of source or target) - if (retVal.type == BDT_CRIT) { + if (!infdef && retVal.type == BDT_CRIT) { // Minimum damage for criticals (per ML rule) - // FIXME: Ignore plants/bifs/etc. if (retVal.damage <= 10) retVal.damage=10; /* This needs fixing |