1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-05-09 08:45:38 +01:00

Make wizards learn their special spells at XL14

Once learnt, they are never forgotten (except by getting level drained
below 14).  Uses the same handling as spell-granting artifacts.
This commit is contained in:
Ron Nazarov 2024-04-13 02:11:58 +01:00
parent 969523ee0a
commit b30a601b4b
Signed by: noisytoot
GPG key ID: 1D43EF4F4492268B
2 changed files with 31 additions and 1 deletions

View file

@ -1044,9 +1044,34 @@ int oldlevel, newlevel;
message = TRUE;
expert_weapon_skill(i);
}
}
}
if (message) You_feel("like you've unlocked new potential!");
}
if (Role_if(PM_WIZARD) && newlevel >= 14 && oldlevel < 14){
/* Actually learning the spell is handled in update_externally_granted_spells() */
boolean new_spell_role, new_spell_race = FALSE;
if (urole.spelspec) {
for (int i = 0; i < MAXSPELL; i++) {
if (spellid(i) == urole.spelspec && !spl_book[i].sp_know) {
new_spell_role = TRUE;
break;
}
}
}
if (urace.spelspec) {
for (int i = 0; i < MAXSPELL; i++) {
if (spellid(i) == urace.spelspec && !spl_book[i].sp_know) {
new_spell_race = TRUE;
break;
}
}
}
if (new_spell_role || new_spell_race)
You("learn how to cast %s%s%s!",
new_spell_role ? OBJ_NAME(objects[urole.spelspec]) : "",
(new_spell_race && new_spell_role) ? " and " : "",
new_spell_race ? OBJ_NAME(objects[urace.spelspec]) : "");
}
}

View file

@ -1495,6 +1495,11 @@ update_externally_granted_spells()
}
}
}
/* Not externally granted, but it fits here anyway */
if (Role_if(PM_WIZARD) && u.ulevel >= 14){
if (urole.spelspec) exspells[n++] = urole.spelspec;
if (urace.spelspec) exspells[n++] = urace.spelspec;
}
/* mark sp_ext, and add them to the book if necessary */
for (j = 0; j < n; j++) {