void skills_weapon_gain(int tval, int sval) { int max; int cur; assert(TV_WEAPON_BEGIN <= tval && tval <= TV_WEAPON_END); assert(tval != TV_BOW); max = skills_weapon_max(tval, sval); cur = p_ptr->weapon_exp[tval-TV_WEAPON_BEGIN][sval]; if (cur < max) { int add = 0; if (cur < WEAPON_EXP_BEGINNER) add = 80; else if (cur < WEAPON_EXP_SKILLED) add = 10; else if (cur < WEAPON_EXP_EXPERT && p_ptr->lev > 19) add = 1; else if (p_ptr->lev > 34 && one_in_(2)) add = 1; if (add > 0) { int old_bonus = _weapon_calc_bonus_aux(cur); int new_bonus; cur += add; if (cur > max) cur = max; new_bonus = _weapon_calc_bonus_aux(cur); p_ptr->weapon_exp[tval-TV_WEAPON_BEGIN][sval] += add; if (old_bonus != new_bonus) p_ptr->update |= PU_BONUS; } } }
int skills_weapon_current(int tval, int sval) { int max = skills_weapon_max(tval, sval); int cur = p_ptr->weapon_exp[tval-TV_WEAPON_BEGIN][sval]; if (cur > max) cur = max; return cur; }
int skills_bow_current(int sval) { int max = skills_weapon_max(TV_BOW, sval); int cur = p_ptr->weapon_exp[0][sval]; if (cur > max) cur = max; return cur; }
int skills_weapon_current(int tval, int sval) { int max; int cur; assert(TV_WEAPON_BEGIN <= tval && tval <= TV_WEAPON_END); if (tval == TV_BOW) return skills_bow_current(sval); max = skills_weapon_max(tval, sval); cur = p_ptr->weapon_exp[tval-TV_WEAPON_BEGIN][sval]; if (cur > max) cur = max; return cur; }
void skills_weapon_gain(int tval, int sval) { int max = skills_weapon_max(tval, sval); int cur = p_ptr->weapon_exp[tval-TV_WEAPON_BEGIN][sval]; if (cur < max) { int add = 0; if (cur < WEAPON_EXP_BEGINNER) add = 80; else if (cur < WEAPON_EXP_SKILLED) add = 10; else if (cur < WEAPON_EXP_EXPERT && p_ptr->lev > 19) add = 1; else if (p_ptr->lev > 34 && one_in_(2)) add = 1; if (add > 0) { cur += add; if (cur > max) cur = max; p_ptr->weapon_exp[tval-TV_WEAPON_BEGIN][sval] += add; p_ptr->update |= (PU_BONUS); } } }
cptr skills_weapon_describe_current(int tval, int sval) { return _weapon_describe_aux( skills_weapon_current(tval, sval), skills_weapon_max(tval, sval)); }