This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
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:
- let dodgeRoll := roll(-defender.dodge, attacker.negate-dodge)
- if dodgeRoll <= 0, the defender dodged
- let hitRoll := roll(-defender.negate-hit, attacker.to-hit)
- if -defender.luck <= hitRoll <= 0, the attacker missed
- if hitRoll < -defender.luck, the defender deflected the attack
- let damage := roll(attacker.min-damage, attacker.max-damage)
- let critRoll := roll(1, 10000)
- if critRoll <= attacker.critical-hit, then the attacker got a critical hit
- subtract damage from defender.hp