Combat System - ksami/muddy GitHub Wiki
Basic:
Functions like dice roll D&D, auto-calculate hit chance, damage, and special effects.
When special effects occur, windows might popout for player to type commands for additional effect.
e.g. when crit occurs, player can type poke to increase crit chance/damage
Mechanics:
Hit chance = (Hit Rate - Dodge Rate)%
Damage = Offensive power - Defensive power
Consistency = Concentration - Distraction
How Combat Actions are Calculated:
- If hit chance rolls a miss, then you miss.
- Else rolls a hit, then if damage is 0, "attack is ineffective"
- Else if damage is negative, then "you injure yourself"
- Else if damage is positive, then calculates real damage based on bell curve where:
Real damage = x
Damage = mean
Consistency = standard deviation +-1
Terms and Elaboration:
Tertiary Variable -> hit chance/damage/consistency
Secondary Variable -> hit rate/dodgerate/offensive power/defensive power/concentration/distraction
Primary Variable -> stats, weapons/armour, consumables, skills, environment
-
Primary variables will add/subtract to/from secondary variables either directly, or through a percentage calculation.
E.g. +100 hit rate from weapon, -2% hit rate from rusted weapon, +25 hit rate from Concentration skill, +10% total hit rate from "dangerous environment", = ((98%*100)+25)*110% = 140.3 hit rate. -
Secondary variables interact to give tertiary variables.
E.g. 140.3 hit rate - 50.5 dodge rate = 89.8% hit chance -
Tertiary Variable is used in direct calculation of real damage.