diff options
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 |