I tried a few things but I get “the noun did not make sense in that context error.” Doing a quick research, I found how to change this. Still, I wonder why this error is not prevented by the check rule:
Check casting:
if the noun is not a spell, say "You can only cast spells." instead;
Here is the full code, below. Not a spoiler, but I don’t know how to hide longer code with style.
[spoiler][code]
“Spells Test” by “Giannis G. Georgiou”
A spell is a kind of thing. A spell is always proper-named.
Lightning Bolt is a spell.
Cold Sweat is a spell.
Happy Feet is a spell.
Casting is an action applying to one visible thing.
Understand “cast [any spell]” as casting.
Understand “[any spell]” as casting.
Casting it on is an action applying to two visible things.
Understand “cast [any spell] on/at [something]” as casting it on.
Understand “[any spell] [something]” as casting it on.
Check casting:
if the noun is not a spell, say “You can only cast spells.” instead;
if the noun is not a spell listed in the Table of Player Spells, say “You don’t know how to cast the [noun] spell.” instead;
Carry out casting something:
say “With a flourish, you cast the [noun] spell.”
Carry out casting something on something:
say “With a flourish, you cast the [noun] spell on [the second noun].”
Listing the spells is an action applying to nothing.
Understand “spells” or “list spells” or “check spells” as listing the spells.
Check listing the spells:
if the number of filled rows in the Table of Player Spells is 0, say “Your spellbook contains no spells.” instead.
Carry out listing the spells:
say “Your spellbook contains the following spells:”;
repeat through the Table of Player Spells:
say “[line break][Spell entry]”;
say paragraph break.
Rule for printing a parser error when the latest parser error is the noun did not make sense in that context error:
say “You are a wizard, but still unable to perform such kind of magic.”
A book is a kind of thing. A spellbook is a kind of book.
A spellbook called The Sorcerer’s Handbook is carried by the player. The description of the Sorcerer’s Handbook is “You have found this spellbook in the attic of your late uncle Clarens[first time].[paragraph break]To list the contents of this spellbook, try SPELLS or LIST SPELLS[only].”
Table of Player Spells
Spell
Lightning Bolt
Happy Feet
with 60 blank rows
Test chamber is a room. A target is in the test chamber.[/code][/spoiler]