def calc_strength_enchantment(self): strength = fetch_strength(self.morgue_file) if strength == 10: return 1 if strength > 10: return (39 + ((one_d(strength - 8) - 1) * 2)) / 39 elif strength < 10: return (39 - ((one_d(12 - strength) - 1) * 3)) / 39
def calc_slay_bonuses(self): eff_enchantment = self.enchantment + 0 if eff_enchantment > 0: return one_d(1 + eff_enchantment) - 1 elif self.enchantment < 0: return -(one_d(1 - eff_enchantment) + 1) else: return 0
def calc_max_damage(self): base_damage = self.calc_base_damage() strength_enchantment = self.calc_strength_enchantment() weapon_skill_enchantment = self.calc_weapon_skill_enchantment() fighting_skill_enchantment = self.calc_fighting_enchantment() slaying_bonuses = self.calc_slay_bonuses() misc_enchantments = 0 base_damage + self.enchantment + strength_enchantment max_damage = ((one_d(base_damage * strength_enchantment + 1) - 1) * weapon_skill_enchantment * fighting_skill_enchantment + misc_enchantments + slaying_bonuses) return round(max_damage, 2)
def calc_fighting_enchantment(self): fighting_skill = fetch_skill(self.morgue_file, "Fighting") return (3999 + one_d(100 * fighting_skill + 1)) / 4000
def calc_weapon_skill_enchantment(self): weapon_skill = fetch_skill(self.morgue_file, self.weapon_type) return (2499 + one_d(100 * weapon_skill + 1)) / 2500