====== Melee Combat Mechanic ====== {{ rpd:images:item_ShortSword.png|Melee Weapon }} **Melee Combat** is the primary form of combat in Remixed Dungeon, where the hero engages enemies directly in hand-to-hand combat using weapons that require close proximity. ==== Description ==== Melee combat involves direct physical engagement between characters. The attacking character must be adjacent to their target to perform a melee attack. This form of combat is the standard for most weapons and character abilities. ==== Combat Mechanics ==== * **Adjacency Requirement**: Attacker and target must be on adjacent cells (including diagonally) * **Attack Roll**: Attacker's accuracy vs target's evasion determines hit chance * **Damage Calculation**: Weapon damage + random variance, reduced by target's armor * **Attack Speed**: Determined by weapon speed and character bonuses * **Critical Hits**: 5% base chance to deal 2x damage (modified by various factors) ==== Accuracy and Evasion ==== * **Accuracy**: Affected by weapon's accuracy modifier and character's strength * **Evasion**: Based on character's dexterity and armor class * **Penalties**: Various conditions can affect accuracy and evasion (darkness, confusion, etc.) ==== Damage Calculation ==== * **Base Damage**: Weapon damage range (min to max value) * **Damage Reduction**: Target's armor DR (Damage Reduction) mitigates incoming damage * **Final Damage**: (Weapon damage) - (Target armor DR) + randomness factor ==== Special Considerations ==== * **Encumbrance**: Carrying heavy items reduces accuracy and evasion * **Surprise Attacks**: Attacking unaware enemies has increased accuracy * **Environmental Effects**: Terrain, light, and status effects can influence combat * **Weapon Upgrades**: Higher upgrade levels improve both accuracy and damage ==== Related ==== * [[en:rpd:combat|Combat]] - General combat mechanics * [[en:rpd:melee|Melee]] - Close combat overview * [[en:rpd:accuracy|Accuracy]] - Accuracy mechanics * [[en:rpd:evasion|Evasion]] - Evasion mechanics * [[en:rpd:melee_weapons|Melee Weapons]] - Specific weapons for melee * [[en:rpd:weapons|Weapons]] - All weapon types * [[en:rpd:damage|Damage]] - Damage calculation details * [[en:rpd:armor|Armor]] - Armor mechanics and protection ==== Code References ==== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java#L609-L623|actMeleeAttack method]] - Detailed melee attack method implementation * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java#L643|Attack delay calculation]] - How melee attack speed is determined * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Combat.java|Combat.java]] - Detailed combat mechanics including damage calculation * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/weapon/Weapon.java#L108-L115|Weapon accuracy and damage mechanics]] - How weapon stats affect melee combat * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java#L549-L568|Hero attack method]] - How the player character performs melee attacks ==== String References ==== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml#L158-L167|MeleeWeapon strings]] - UI text for melee weapons * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml#L170-L171|Attack strings]] - Attack-related UI text * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml#L168-L169|Hit strings]] - Combat result text {{tag> rpd mechanics combat melee}}