====== Defense ====== Defense refers to the mechanics that help the hero avoid or reduce damage in Remixed Dungeon. ==== Description ==== Defense encompasses various mechanics that help protect the hero from taking damage. This includes armor that reduces damage taken, evasion that allows dodging attacks entirely, and other protective mechanics. ==== Defense Components ==== * **Armor Rating**: Direct damage reduction from equipped armor * [[en:rpd:evasion|Evasion]]: Chance to completely avoid attacks * **Resistance**: Immunity or reduced effects from special attacks * **Shielding**: Temporary barriers that absorb damage * **Defensive Buffs**: Temporary effects that enhance defense ==== Defense Sources ==== * [[en:rpd:armor_item|Armor]]: Primary source of damage reduction * [[en:rpd:shields|Shields]]: Additional protection for second hand * [[en:rpd:rings|Rings]]: Some rings provide defensive bonuses * [[en:rpd:buffs|Buffs]]: Temporary defensive effects * [[en:rpd:potions|Potions]]: Defensive potions like Potion of Shielding ==== Defense Strategies ==== * **Balanced Approach**: Balance defense with other character improvements * **Equipment Selection**: Choose armor and accessories that enhance defense * **Tactical Positioning**: Use terrain and positioning to reduce incoming damage * **Resource Management**: Balance defensive items with other resources ==== Defense Mechanics ==== * **Damage Calculation**: How armor reduces incoming damage * **Evasion Chance**: How evasion helps avoid attacks entirely * **Resistance System**: How different types of damage are resisted * **Absorption**: How temporary shields absorb damage ==== Code References ==== * Defense System: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java|Char.java]] - How defense is calculated * Armor Effects: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java#L140-L160|Armor reduction code]] - How armor reduces damage * Evasion System: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java|Char.java]] - How evasion is implemented * Hero Mechanics: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java|Hero.java]] - How defense affects the hero * String Resources: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml|strings_all.xml]] - All defense-related text ==== See Also ==== * [[en:rpd:armor_item|Armor]] * [[en:rpd:evasion|Evasion]] * [[en:rpd:shields|Shields]] * [[en:rpd:combat_mechanics|Combat]] {{tag> rpd mechanics defense protection }}