rpd:defense_mechanic
Differences
This shows you the differences between two versions of the page.
| rpd:defense_mechanic [2025/12/29 09:28] – Update wiki pages: rename files to follow naming convention, add missing pages, fix formatting issues mike | rpd:defense_mechanic [2025/12/29 09:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Defense Mechanic ====== | ||
| + | Defense is a core combat mechanic in Remixed Dungeon that determines the chance to successfully evade incoming attacks. | ||
| + | |||
| + | ==== Defense Skill Formula ==== | ||
| + | |||
| + | The defense skill is calculated in the '' | ||
| + | |||
| + | <code java> | ||
| + | public int defenseSkill(Char enemy) { | ||
| + | |||
| + | int defenseSkill = baseDefenseSkill + lvl(); | ||
| + | |||
| + | final int[] bf = {0}; | ||
| + | forEachBuff(b -> bf[0] += b.defenceSkillBonus(this)); | ||
| + | |||
| + | int bonus = bf[0]; | ||
| + | |||
| + | float evasion = (float) Math.pow(1.2, | ||
| + | if (paralysed) { | ||
| + | evasion /= 2; | ||
| + | } | ||
| + | |||
| + | int aEnc = getItemFromSlot(Belongings.Slot.ARMOR).requiredSTR() - effectiveSTR(); | ||
| + | |||
| + | if (aEnc > 0) { | ||
| + | return (int) (defenseSkill * evasion / Math.pow(1.5, | ||
| + | } else { | ||
| + | |||
| + | if (getHeroClass() == HeroClass.ROGUE) { | ||
| + | |||
| + | if (getCurAction() != null && getSubClass() == HeroSubClass.FREERUNNER && !isStarving()) { | ||
| + | evasion *= 2; | ||
| + | } | ||
| + | |||
| + | return (int) ((defenseSkill - aEnc) * evasion); | ||
| + | } else { | ||
| + | return (int) (defenseSkill * evasion); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Defense Skill Components ==== | ||
| + | |||
| + | ==== Base Defense Skill ==== | ||
| + | * **Definition**: | ||
| + | * **Storage**: | ||
| + | * **Examples**: | ||
| + | * Rat: 3 | ||
| + | * Warrior: 5 (in Hero class) | ||
| + | * Thief: 12 | ||
| + | * Goo: 12 | ||
| + | * King: 25 | ||
| + | * Yog's Heart: 40 | ||
| + | * **Function**: | ||
| + | |||
| + | ==== Level Bonus ==== | ||
| + | * **Formula**: | ||
| + | * **Effect**: Each level increases defense skill by 1 point | ||
| + | * **Implementation**: | ||
| + | |||
| + | ==== Buff Bonuses ==== | ||
| + | * **Mechanism**: | ||
| + | * **Formula**: | ||
| + | * **Examples**: | ||
| + | |||
| + | ==== Paralysis Penalty ==== | ||
| + | * **Condition**: | ||
| + | * **Effect**: Evasion is halved ('' | ||
| + | * **Purpose**: | ||
| + | |||
| + | ==== Armor Encumbrance ==== | ||
| + | * **Calculation**: | ||
| + | * **Effect**: If '' | ||
| + | * **Impact**: Wearing armor that requires more strength than available significantly reduces defense | ||
| + | |||
| + | ==== Class-Specific Mechanics ==== | ||
| + | * **Hero Classes**: Non-rogues use basic formula '' | ||
| + | * **Rogues**: Use modified formula '' | ||
| + | * **Freerunner Subclass**: When not starving and moving, evasion is doubled ('' | ||
| + | |||
| + | ==== Combat Calculation ==== | ||
| + | * **Hit Chance**: The attacker' | ||
| + | * **Calculation**: | ||
| + | * **Result**: If true, the attack hits; if false, the attack misses | ||
| + | |||
| + | ==== Hero Defense Skill Enhancement ==== | ||
| + | The Hero class has a special defense skill calculation: | ||
| + | |||
| + | <code java> | ||
| + | // In Hero.java | ||
| + | public int defenseSkill(Char enemy) { | ||
| + | float skillFactor = 1; | ||
| + | | ||
| + | if (getSubClass() == HeroSubClass.BRIGAND) { | ||
| + | skillFactor *= 1.2; | ||
| + | } | ||
| + | | ||
| + | return (int) (super.defenseSkill(enemy) * skillFactor); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Defense in Combat ==== | ||
| + | * **Evasion**: | ||
| + | * **Hit Calculation**: | ||
| + | * **Result**: If the attacker' | ||
| + | |||
| + | ==== Related String Resource ==== | ||
| + | * '' | ||
| + | |||
| + | ==== Code References ==== | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | |||
| + | ==== Related ==== | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | |||
| + | {{tag> rpd mechanics combat defense skill }} | ||
rpd/defense_mechanic.txt · Last modified: by 127.0.0.1
