Index: src/attack.c =================================================================== --- src/attack.c (revision 694) +++ src/attack.c (working copy) @@ -189,7 +189,25 @@ } +/* + * Adjust the input damage based on how many times the character has + * killed a given monster. + * + * + */ +static int learned_slay_adj(int base_damage, const monster_type *m_ptr) +{ + monster_lore *l_ptr = &l_list[m_ptr->r_idx]; + + if(l_ptr->pkills >= 0 && l_ptr->pkills <= 1000){ + return base_damage + (( base_damage * 10 * l_ptr->pkills) / 1000 ) / 10; + } else { + return base_damage + (( 2 * base_damage * 10 * l_ptr->pkills) / 10000 ) / 10; + } + +} + /* * Extract the "multiplier" from a given object hitting a given monster. * @@ -393,7 +411,6 @@ } } - /* Return the multiplier */ return (mult); } @@ -407,7 +424,7 @@ */ void py_attack(int y, int x) { - int num = 0, k, bonus, chance; + int num = 0, k, old_k, bonus, chance; monster_type *m_ptr; monster_race *r_ptr; @@ -491,13 +508,20 @@ /* Apply the player damage bonuses */ k += p_ptr->to_d; + /* apply the player learned slay bonus */ + if (p_ptr->wizard) + { + old_k = k; + } + k = learned_slay_adj(k, m_ptr); + /* No negative damage */ if (k < 0) k = 0; /* Complex message */ if (p_ptr->wizard) { - msg_format("You do %d (out of %d) damage.", k, m_ptr->hp); + msg_format("You do %d[%d] (out of %d) damage.", k, old_k, m_ptr->hp); } /* Damage, check for fear and death */