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

Function can_advance

src/weapon.c:1155–1169  ·  view source on GitHub ↗

return true if this skill can be advanced */

Source from the content-addressed store, hash-verified

1153
1154/* return true if this skill can be advanced */
1155boolean
1156can_advance(int skill, boolean speedy)
1157{
1158 if (P_RESTRICTED(skill)
1159 || P_SKILL(skill) >= P_MAX_SKILL(skill)
1160 || u.skills_advanced >= P_SKILL_LIMIT)
1161 return FALSE;
1162
1163 if (wizard && speedy)
1164 return TRUE;
1165
1166 return (boolean) ((int) P_ADVANCE(skill)
1167 >= practice_needed_to_advance(P_SKILL(skill))
1168 && u.weapon_slots >= slots_required(skill));
1169}
1170
1171/* return true if this skill could be advanced if more slots were available */
1172staticfn boolean

Callers 5

add_skills_to_menuFunction · 0.85
enhance_weapon_skillFunction · 0.85
use_skillFunction · 0.85
add_weapon_skillFunction · 0.85
weapon_insightFunction · 0.85

Calls 1

slots_requiredFunction · 0.85

Tested by

no test coverage detected