Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Battle Calculations

Kyle Kemp edited this page Sep 1, 2014 · 4 revisions

Battle calculations are what calculations are used when determining situations like damage, dodge rate, etc.

When rolling, it is often one roll versus another, so a to-hit roll would look like this: random between -(target negate-hit), attacker to-hit

If you roll between -negate-hit..0, other events can happen, whereas anywhere from 1..to-hit will be a successful hit roll

Calculation Stats
To Hit (rolled by attacker) (DEX + STR) / 2
Negate Hit (rolled by defender) (DEX + AGI + CON) / 6
Dodge (rolled by defender) AGI
Negate Dodge (rolled by attacker) DEX + STR + AGI + WIS + CON + INT
Critical Hit (rolled by attacker) 1 + (LUCK + DEX) / 2
Minimum Damage 1
Maximum Damage maximum(10, STR)

A typical physical attack progresses like so:

  1. let dodgeRoll := roll(-defender.dodge, attacker.negate-dodge)
  2. if dodgeRoll <= 0, the defender dodged
  3. let hitRoll := roll(-defender.negate-hit, attacker.to-hit)
  4. if -defender.luck <= hitRoll <= 0, the attacker missed
  5. if hitRoll < -defender.luck, the defender deflected the attack
  6. let damage := roll(attacker.min-damage, attacker.max-damage)
  7. let critRoll := roll(1, 10000)
  8. if critRoll <= attacker.critical-hit, then the attacker got a critical hit
  9. subtract damage from defender.hp
Clone this wiki locally