MCPcopy Create free account
hub / github.com/NetHack/NetHack / skill_advance

Function skill_advance

src/weapon.c:1197–1213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195}
1196
1197staticfn void
1198skill_advance(int skill)
1199{
1200 u.weapon_slots -= slots_required(skill);
1201 P_SKILL(skill)++;
1202 u.skill_record[u.skills_advanced++] = skill;
1203 /* subtly change the advance message to indicate no more advancement */
1204 You("are now %s skilled in %s.",
1205 P_SKILL(skill) >= P_MAX_SKILL(skill) ? "most" : "more",
1206 P_NAME(skill));
1207
1208 /* wizards discover spellbook IDs depending on spell 'school' skill limits;
1209 this allows them to successfully write books for unknown spells without
1210 the Luck bias they used to have over other roles */
1211 if (skill >= P_FIRST_SPELL && skill <= P_LAST_SPELL)
1212 skill_based_spellbook_id();
1213}
1214
1215static const struct skill_range {
1216 short first, last;

Callers 1

enhance_weapon_skillFunction · 0.85

Calls 3

slots_requiredFunction · 0.85
YouFunction · 0.85
skill_based_spellbook_idFunction · 0.85

Tested by

no test coverage detected