I’m trying to write a game where the player can cast spells at certain items. And I’ve run into problems.
The player begins with a spell called WARM, which can either be cast on its own (to warm up the current location) or at various items (to warm them up). The first part works fine, the second doesn’t. As it stands, the game won’t even compile if the text relating to the spell being cast at items is included.
[code] “Spell Breaker” by David Whyld
To say i – beginning say_i – running on: (- style underline; -).
To say /i – ending say_i – running on: (- style roman; -).
To say b – beginning say_b – running on: (- style bold; -).
To say /b – ending say_b – running on: (- style roman; -).
To say aa – running on: say “[paragraph break]”.
To say a – running on: say “[line break]”.
Use VERBOSE room descriptions. Use no scoring. Maximum score is 0. Include Basic Screen Effects by Emily Short. The story genre is “Fantasy”.
Your Own Little Bedchamber is a room. “Your bedchamber. You can see a torch.”
the torch is scenery in your own little bedchamber.
understand “cast warm” as casting warm. casting warm is an action out of world. carry out casting warm:
if spell-power is less than 3, say “You don’t have enough spell power to cast this spell.”;
if spell-power is greater than 2:
decrease spell-power by 3;
say “You cast WARM, briefly heating the air around you.”
understand “cast warm at [something]” or “cast warm at [someone]” or “cast warm at [torch]” as casting warmly. casting warmly is an action applying to one visible thing.
instead of casting warmly:
if spell-power is less than 3, say “You don’t have enough spell power to cast this spell.”;
if spell-power is greater than 2:
decrease spell-power by 3;
say “You cast WARM at the [noun], but nothing much happens.”
instead of casting warmly at torch:
if spell-power is less than 3, say “You don’t have enough spell power to cast this spell.”;
if spell-power is greater than 2:
decrease spell-power by 3;
increase cast-warm by 1;
if lit-torch is 1:
say “You cast WARM at the torch again, which causes it to flicker momentarily.”;
if lit-torch is 0:
change lit-torch to 1;
say “You cast WARM at the torch, lighting it![aa]From inside your bedchamber, you hear the sound of stone grinding upon stone.”
spell-power is a number variable. spell-power is 10.[/code]
This causes the following error message:
Can anyone tell me what I’m doing wrong? I tried Googling possible solutions and found a spell system from Graham Nelson’s Reliques of Tolti-Alph but copying the relevant parts into my game just threw up more error messages than I already had.