Wizards learn about spellbooks as they enhance their spell skills

Previously, Wizards got a boost to the chance of writing unknown
spellbooks based purely on being a Wizard (with the chance still
luck-based), leading to a very large power spike when the Wizard
gained access to a luckstone and the ability to max out luck.
This had two main issues: this power spike came *after* the major
early-game difficulty spike, often leaving Wizards forced to deal
with it without having appropriate spells; and it promotes
grinding (for Luck and for Magicbane) at an early point in the
game, meaning that the Wizard early game effectively followed a
sequence of extreme difficulty -> grinding -> minimal difficulty,
which isn't very good balance-wise.

With this commit, Wizards lose their advantage to writing unknown
spellbooks by guessing, and instead learn spellbook IDs based on
their spell skills (advancing a skill gives knowledge of higher-
level spellbooks). This means that writing unknown spellbooks
becomes guaranteed with sufficient skill, but has no advantage
over non-Wizards in schools where the Wixard does not have
sufficient skill.

Due to Wizards' skill caps, there are two spells which they can't
ever write guaranteed: create familiar and charm monster. Create
familiar is a fairly niche spell (that doesn't match the Wizard
playstyle that well) and being unable to write it is not a major
problem. The inability to easily write charm monster is
intentional.
This commit is contained in:
Alex Smith
2023-12-02 03:46:55 +00:00
parent a30a205c45
commit 319dfbdaa3
5 changed files with 47 additions and 4 deletions

View File

@@ -831,6 +831,40 @@ spell_skilltype(int booktype)
return objects[booktype].oc_skill;
}
/* Wizards learn what spellbooks look like based on their skill in the
spell's school */
void
skill_based_spellbook_id(void)
{
if (!Role_if(PM_WIZARD))
return;
int booktype;
const uchar spbook_class = (uchar) SPBOOK_CLASS;
for (booktype = gb.bases[spbook_class];
booktype < gb.bases[spbook_class + 1];
booktype++) {
int skill = spell_skilltype(booktype);
if (skill == P_NONE) continue;
int known_up_to_level;
switch (P_SKILL(skill)) {
case P_BASIC:
known_up_to_level = 2; break;
case P_SKILLED:
known_up_to_level = 4; break;
case P_EXPERT: case P_MASTER: case P_GRAND_MASTER:
known_up_to_level = 7; break;
case P_UNSKILLED: default:
known_up_to_level = 0; break;
}
if (objects[booktype].oc_level <= known_up_to_level)
makeknown(booktype);
}
}
static void
cast_protection(void)
{