Page 1 of 1

Trying to understand strength weight

PostPosted: Tuesday, 22nd January 2013, 17:02
by emeraldemon
I'm looking at the calc_stat_to_hit_base in melee_attack.cc, lines 4942-4952:
  Code:
int melee_attack::calc_stat_to_hit_base()
{
    // towards_str_avg is a variable, whose sign points towards strength,
    // and the magnitude is half the difference (thus, when added directly
    // to you.dex() it gives the average of the two.
    const signed int towards_str_avg = (you.strength() - you.dex()) / 2;

    // dex is modified by strength towards the average, by the
    // weighted amount weapon_str_weight() / 10.
    return (you.dex() + towards_str_avg * player_weapon_str_weight() / 10);
}


Looking at this code, to_hit_base ranges between DEX and (STR+DEX)/2 , but never any closer to strength than that, unless str_weight() goes above 10 somewhere. Is this correct? If str_weight() is 10, we get DEX + (STR-DEX)/2 * 10/10 = (STR+DEX)/2 . I thought 100% strength weight would make it 100% strength, and 50% strength weight would use the average of the two numbers. Do I just not understand what strength weight is supposed to be?

Re: Trying to understand strength weight

PostPosted: Tuesday, 22nd January 2013, 17:27
by emeraldemon
Thanks for the quick reply, that makes sense. Do you say they don't matter because skills matter more? Looking at the code it looks like stats, fighting, and your weapon skill all contribute equally.