acutesoftware/virtual-AI-simulator

View on GitHub
vais/data/battle.rules

Summary

Maintainability
Test Coverage
# file: battle.rules
# author: Duncan Murray
# updated: 7/4/2015
# Notes: formulas using stats must have stat defined in ref_stats.csv

# Step 1 - calculate Hit chance
# example, hit = random.randint(hit_min,hit_max)
hit_min = 1
hit_limit = 10
hit_AGI_mult = 0.5
hit_INT_mult = 0.5
hit_AGI_add = 0
hit_INT_add = 0
hit_overall_add = 1

# Step 2 - calculate Damage - OLD equation was 
#      dmg_max = round(((STR * 1.2) + (AGI * 1.2) + (INT * 1.2)) / 6 )
# new rule in code : 
#   dmg_max = round(
#                    ((STR + dmg_STR_add) * dmg_STR_mult) 
#                  + ((AGI + dmg_AGI_add) * dmg_AGI_mult) 
#                  + ((INT + dmg_INT_add) * dmg_INT_mult)
#                  ) * dmg_overall_mult 
#             + dmg_overall_add
dmg_min = 2
#dmg_max = 20
dmg_INT_mult = 0.9
dmg_AGI_mult = 1.2
dmg_STR_mult = 1.2
dmg_INT_add = -.5
dmg_AGI_add = 0
dmg_STR_add = 0
dmg_overall_mult = 0.1667
dmg_overall_add = 0


# Step 3 - calculate Crit chance
# This is based on HIT calc in step 1 above
shot_hit_greater_than = 3
shot_crit_greater_than = 6

# Step 4 - calculate damage multiplier based on Crit/Hit/Miss
dmg_mult_miss = 0.1
dmg_mult_hit = 1.0
dmg_mult_crit = 1.5