Beispiel #1
0
int skills_bow_current(int sval)
{
    int max = skills_bow_max(sval);
    int cur = p_ptr->weapon_exp[0][sval];

    if (cur > max)
        cur = max;

    return cur;
}
Beispiel #2
0
int skills_weapon_max(int tval, int sval)
{
    assert(TV_WEAPON_BEGIN <= tval && tval <= TV_WEAPON_END);

    if (tval == TV_BOW)
        return skills_bow_max(sval);

    if (mut_present(MUT_WEAPON_SKILLS))
        return WEAPON_EXP_MASTER;

    /* TODO: Add a class_t callback to override the skill tables ... */

    /* Dragon Warlocks are Dragon Riders! */
    if ( warlock_is_(WARLOCK_DRAGONS)
      && tval == TV_POLEARM
      && (sval == SV_LANCE || sval == SV_HEAVY_LANCE) )
    {
        return WEAPON_EXP_MASTER;
    }

    if (warlock_is_(WARLOCK_GIANTS) && tval != TV_BOW)
    {
        int k_idx = lookup_kind(tval, sval);
        if (k_info[k_idx].weight >= 200)
            return WEAPON_EXP_MASTER;
        if (k_info[k_idx].weight <= 100)
            return WEAPON_EXP_BEGINNER;
    }

    /* Edged weapons for priests. I never understood the restriction for evil priests! */
    if (p_ptr->pclass == CLASS_PRIEST && (tval == TV_SWORD || tval == TV_POLEARM))
    {
        if (priest_is_good())
            return WEAPON_EXP_BEGINNER;
        else if (priest_is_evil())
            return WEAPON_EXP_SKILLED;
    }

    return s_info[_class_idx()].w_max[tval-TV_WEAPON_BEGIN][sval];
}
Beispiel #3
0
void skills_bow_gain(int sval)
{
	int max = skills_bow_max(sval);
	int cur = p_ptr->weapon_exp[0][sval];

	if (cur < max)
	{
		int add = 0;
		
		if (cur < WEAPON_EXP_BEGINNER) add = 80;
		else if (cur < WEAPON_EXP_SKILLED) add = 25;
		else if (cur < WEAPON_EXP_EXPERT && p_ptr->lev > 19) add = 10;
		else if (p_ptr->lev > 34) add = 2;

		if (add > 0)
		{
			cur += add;
			if (cur > max)
				cur = max;
			p_ptr->weapon_exp[0][sval] += add;
			p_ptr->update |= (PU_BONUS);
		}
	}
}