Bettonio
Is possibile to know how damage calculation works?
Not the reduction fatctors against armors but the formula of damage.
thx.
Not the reduction fatctors against armors but the formula of damage.
thx.
if hold_time >= 1.1
hold_bonus = 1.2
elif hold_time >= 0.6:
hold_bonus = (1.1 - hold_time) * 0.6 + 1.2
elif hold_time >= 0.5:
hold_bonus = 1.5
else:
hold_bonus = hold_time + 1.0
raw_damage = weapon_damage * (clamp(hold_bonus, 1.0, 2.0) * 0.5 + 0.5)
if weapon_type == 'one_handed' or weapon_type == 'two_handed' or weapon_type == 'polearm':
raw_damage *= math.pow(melee_damage_speed_power, speed_bonus)
elif weapon_type == 'crossbow' or weapon_type == 'bow' or weapon_type == 'throwing':
raw_damage *= math.pow(missile_damage_speed_power, speed_bonus)
if weapon_type == 'crossbow':
if raining:
raw_damage *= 0.75
else:
raw_damage *= proficiency * 0.01 * 0.15 + 0.85
if weapon_type == 'bow':
raw_damage *= min(power_draw, difficulty + 4) * 0.14 + 1
if mounted:
raw_damage *= horse_archery * 0.019 + 0.8
if raining:
raw_damage *= 0.9
elif weapon_type == 'throwing':
raw_damage *= power_throw * 0.1 + 1.0
if mounted:
raw_damage *= horse_archery * 0.019 + 0.8
elif weapon_type == 'one_handed' or weapon_type == 'two_handed' or weapon_type == 'polearm':
raw_damage *= power_strike * 0.08 + 1.0
raw_damage += strength / 5.0
if (weapon_type == 'two_handed' or weapon_type == 'polearm') and (has_shield or mounted):
raw_damage *= 0.85
if weapon_type == 'polearm':
raw_damage *= 0.85
if weapon_flags & itp_two_handed:
raw_damage *= 0.9
raw_damage = clamp(raw_damage, 0, 500)
armor = appropriate_armor_value_for_hit_location
if hit_shield_on_back:
armor += shield_resistance + 10
soak_factor = armor * module.ini_soak_factor_for_damage_type
reduction_factor = armor * module.ini_reduction_factor_for_damage_type
if item_flags & itp_extra_penetration:
soak_factor *= module.ini_extra_penetration_soak_factor
reduction_factor *= module.ini_extra_penetration_reduction_factor
randomized_soak = (random.random() * 0.55 + 0.45) * soak_factor
randomized_damage = (random.random() * 0.1 + 0.9) * raw_damage
soaked_damage = randomized_damage - randomized_soak
if (soaked_damage < 0.0):
soaked_damage = 0.0
randomized_reduction = math.exp((random.random() * 0.55 + 0.45) * reduction_factor * 0.014)
reduced_damage = (1.0 - 1.0 / randomized_reduction) * soaked_damage
if (reduction_factor < 0.00001):
reduced_damage = 0.0
damage_difference = round(reduced_damage + randomized_soak)
effective_damage = randomized_damage - damage_difference
if hit_bone == head:
effective_damage *= 1.2
if item_is_ranged:
effective_damage *= 1.75
elif hit_bone == calf or hit_bone == thigh:
effective_damage *= 0.9
effective_damage = clamp(effective_damage, 0.0, 500.0)
transcription error? said:elif weapon_type == 'crossbow' or weapon_type == 'bow' or weapon_type == 'throwing':
raw_damage *= math.pow(melee_damage_speed_power, speed_bonus)
I'd dig just a simple javascript calculator on a page somewhere, myself, to run numbers through. However, it's something that can go out-of-date very easily, so it's probably a waste of time. I just wanted to see the math to understand some of the calcs I'm doing (basically, the bug-fix Taleworlds did in 1.134 makes a newer, more-accurate Fancy Damage System possible).How many people would like me to try my hand at an app that turns all of this pseudocode into a set of nice charts?