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:
parent
969523ee0a
commit
b30a601b4b
2 changed files with 31 additions and 1 deletions
27
src/attrib.c
27
src/attrib.c
|
@ -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]) : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue