Brogue uses a simple combat model. First it uses the attacker's accuracy and the defender's defense to determine whether the attacker hits the defender at all. If it does hit, then it rolls the damage done by the attacker; this roll is based exclusively on the attacker's instrinsic or wielded damage stat.
Chance to Hit
The chance to hit is calculated as:
hitProbability = accuracy * 0.987 ^ defense;
If hitProbability is more than 100%, the hit will always land. So long as accuracy is more than 0, though, no amount of defense can guarantee that no hits will ever land.
Targets that are unaware, stuck, paralyzed, etc. will always be hit.
Players have a base accuracy value of 100. Each marginal point of weapon enchantment multiplies your accuracy by 1.065. The player's accuracy is thus:
accuracy = 100 * 1.065^(weapon net enchant)
The player's defense value is the defense value of the equipped armor. The amount displayed in game is 10% of the actual value. The chance of a monster to hit you is
chance to hit = (monster accuracy) * .987^(defense value in game * 10)
A rule of thumb is that for every 5.2 points of armor, monsters' chance to hit you is halved.
For the player, the effect of weakness is more severe when the resulting strength falls below the strength required to wield or wear equipment. Above that threshold, there is an effective penalty of -.25 enchantment levels per level of weakness; below it, there is an effective penalty of -2.5 enchantment levels.
For monsters, the effect of weakness is much simpler: There is always an effective penalty of -2.5 enchantment levels per point of weakness. It is as if monsters were all just strong enough to use their intrinsic equipment.
Damage is expressed as a range and a clumping factor. Damage never falls below the minimum or exceeds the maximum of the range, and the average damage is always the average of the two. The clumping factor controls how central the distribution is: a higher clumping factor produces more values that are close to the average damage. From the source code:
If the range is 0-10 with a clumping factor of 1, it's a uniform distribution. With a clumping factor of 2, it's calculated as 2d5 (with d5 meaning a die numbered from 0 through 5). With 3, it's 3d3, and so on.
For the player, each point of weapon enchantment multiplies damage by 1.065.
Revenants are immune to physical damage as calculated here, but weapon runics still affect them.
This table gives the effective enchantment level (the weapon's natural enchantment level plus the bonus/penalty from strength) required achieve a certain to hit chance against some typically dangerous monsters.
|Ogre \ Wraith||1.75||6.00||8.00||11.00||11.75||12.75|
|Troll \ Dar Blademaster \ Phantom \ Golem||3.75||8.00||10.25||13.00||14.00||14.75|
This table gives the amount of armor, as displayed in the sidebar, required to reduce a monster's chance to hit to a certain value. An armor value of 11.5 means that the sidebar displays 11 armor and you have a strength bonus of +0.5 (or +1.5, or +2.5, etc.).
|Ogre \ Troll||7.00||10.00||12.00||18.75||23.50||28.75|
|Dar Blademaster \ Phantom||9.00||12.00||14.00||20.50||25.25||30.50|
|Golem \ Tentacle Horror||11.50||14.50||16.50||23.25||27.75||33.00|