en:rpd:evasion_mechanic
Table of Contents
Evasion Mechanic
Evasion is a core combat mechanic in Remixed Dungeon that represents the ability to dodge incoming attacks, primarily determined by the character's defense skill.
Evasion Formula
The evasion calculation is part of the defense skill system in the Char.java file:
public int defenseSkill(Char enemy) { // ... base calculation ... final int[] bf = {0}; forEachBuff(b -> bf[0] += b.defenceSkillBonus(this)); int bonus = bf[0]; float evasion = (float) Math.pow(1.2, bonus); if (paralysed) { evasion /= 2; } // ... armor encumbrance calculation ... int aEnc = getItemFromSlot(Belongings.Slot.ARMOR).requiredSTR() - effectiveSTR(); if (aEnc > 0) { return (int) (defenseSkill * evasion / Math.pow(1.5, aEnc)); } else { if (getHeroClass() == HeroClass.ROGUE) { if (getCurAction() != null && getSubClass() == HeroSubClass.FREERUNNER && !isStarving()) { evasion *= 2; } return (int) ((defenseSkill - aEnc) * evasion); } else { return (int) (defenseSkill * evasion); } } }
Evasion Mechanics
Base Evasion
- Calculation:
Math.pow(1.2, bonus)where bonus is the sum of alldefenceSkillBonusfrom buffs - Effect: Each point of defense bonus multiplies evasion by 1.2
- Exponential Growth: The evasion bonus increases exponentially with more defense bonuses
Paralysis Effect
- Penalty: When paralyzed, evasion is halved (
evasion /= 2) - Impact: Reduces the character's ability to dodge attacks significantly
- Implementation:
if (paralysed) { evasion /= 2; }
Armor Encumbrance
- Calculation:
getItemFromSlot(Belongings.Slot.ARMOR).requiredSTR() - effectiveSTR() - Effect: If armor requires more strength than available (
aEnc > 0), evasion is reduced byMath.pow(1.5, aEnc) - Impact: Heavy armor that requires more strength than available reduces evasion significantly
Class-Specific Evasion
- Rogues: Have the potential for additional evasion bonuses
- Freerunner Subclass: When not starving and moving, evasion is doubled (
evasion *= 2) - Non-Rogues: Use standard evasion calculation
Evasion in Combat
- Hit Calculation:
Random.Float(attacker.attackSkill(defender)) > Random.Float(defender.defenseSkill(attacker)) - Success: When the defender's defense skill roll is higher, the attack is evaded
- Result: The attack misses entirely, dealing no damage
Factors Affecting Evasion
- Defense Skill Bonuses: From buffs and equipment
- Paralysis Status: Reduces evasion by 50%
- Armor Encumbrance: Heavy armor reduces evasion when STR is insufficient
- Hero Class: Rogues have special evasion mechanics
- Hero Subclass: Freerunner gets double evasion under specific conditions
Equipment with Evasion Effects
- Ring of Evasion - Provides direct evasion bonuses
- Armor items - May have encumbrance that affects evasion
- Hero subclasses - Some provide evasion bonuses
Related Buffs
- Any buff that implements
defenceSkillBonuswill affect evasion - Ring of Evasion provides such a buff
Code References
Related
en/rpd/evasion_mechanic.txt · Last modified: by 127.0.0.1
