[edit] This is all in the mon_take_hit fn in xtra2.c
Issue 1: Referenced Traumaturgy skill value results in 0 or 1 gain, 100% of the time.
src\server\xtra2.c:7348:
s16b skill_trauma = get_skill(p_ptr, SKILL_TRAUMATURGY);
Should be raw value, like so:
u16b skill_trauma = get_skill(p_ptr, SKILL_TRAUMATURGY) * SKILL_STEP; //[edit] see second post
Because later we're comparing it to MAX_SKILL, which is 50000, here:
src\server\xtra2.c:7373:
scale_trauma = (((skill_trauma) * 20) / SKILL_MAX);
and 50*20/50000 = 0, in integer terms. And since later we're taking the lower of scale_trauma, damage/20, and monster HP, it will always be 0.
Issue 2: scale_trauma is never set if you don't have tim_trauma!
So even if we fix the above, it still won't matter to the average user who doesn't have a temp traumaturgy buff.
C:\Users\Foster\Desktop\src\server\xtra2.c:7370:
Code: Select all
/* Trauma boost spell */
if (p_ptr->tim_trauma) {
skill_trauma += (skill_trauma < (SKILL_MAX - (p_ptr->tim_trauma_pow * 1000)) ? (p_ptr->tim_trauma_pow * 1000) : SKILL_MAX - skill_trauma);
scale_trauma = (((skill_trauma) * 20) / SKILL_MAX);
}
/*snip*/
long gain = scale_trauma;
Code: Select all
/* Trauma boost spell */
if (p_ptr->tim_trauma) {
skill_trauma += (skill_trauma < (SKILL_MAX - (p_ptr->tim_trauma_pow * 1000)) ? (p_ptr->tim_trauma_pow * 1000) : SKILL_MAX - skill_trauma);
}
scale_trauma = (((skill_trauma) * 20) / SKILL_MAX);
/*snip*/
long gain = scale_trauma;
Both of these issues result in Traumaturgy gains being 0 or 1, every time, regardless of skill, damage, or monster HP. I don't know what the functional gains are intended to be, but tests after applying both of these fixes results in hits over 200 returning 10 mana with 25 trauma skill. I don't know if that's the intended gain (capped at 40% of skill), but I'm positive that 0 or 1 was not