A complete, modular spellcasting system inspired by Infocom's classic Enchanter trilogy.
- Spell Learning: Study scrolls and spellbooks to learn new spells
- Memorization: Spells must be memorized before casting (just like D&D!)
- Flexible Casting: Cast spells by name or with "cast [spell]"
- Easy Extensibility: Add new spells with simple, declarative syntax
- Modular Design: Drop the extension into any Inform 7 game
-
Copy
Spellcasting.i7xto your Inform 7 extensions folder:- Mac:
~/Library/Inform/Extensions/Omeros/ - Windows:
My Documents\Inform\Extensions\Omeros\ - Linux:
~/.local/share/inform7/Extensions/Omeros/
- Mac:
-
In your game, include the extension:
Include Spellcasting by Omeros.
"My Magic Adventure"
Include Spellcasting by Omeros.
The Lab is a room.
The player carries the tattered scroll.Then play:
> read scroll
You study the tattered scroll carefully and learn the spell frotz!
Causes things to give off light.
> spells
Spells you know:
frotz
> memorize frotz
You concentrate and commit frotz to memory.
> cast frotz
You cast frotz on the tattered scroll, which begins to glow brightly!
The zap spell is a spell.
The spell-name is "zap".
The spell-description is "Destroys small objects with lightning."
The difficulty is 3.A spell-effect rule for the zap spell:
say "Lightning crackles from your fingers, annihilating the target!"The lightning scroll is a scroll.
The inscribed-spell is the zap spell.
The description is "A scroll crackling with static electricity."read [scroll]/study [scroll]- Learn a spell from a scrollmemorize [spell]- Prepare a spell for castingforget [spell]- Clear a spell from memorycast [spell]/[spell name]- Cast a memorized spellspells- List all known spells and their status
The fireball spell is a spell.
The spell-name is "fireball".
The spell-description is "Hurls a ball of flame at a target."
Casting it at is an action applying to one thing and one visible thing.
Understand "cast [something] at [something]" as casting it at.
Check casting it at:
if the noun is not a spell, say "That's not a spell." instead;
if the noun is forgotten, say "You haven't memorized that spell." instead.
Instead of casting it at when the noun is the fireball spell:
say "A roaring ball of flame engulfs [the second noun]!";
remove the second noun from play.The extension comes with five classic Enchanter spells:
- frotz - Makes things glow with light
- rezrov - Opens locked objects
- gnusto - Copies spells to spellbooks
- lesoch - Turns objects into liquid
- blorb - Creates a protective sphere
You can use these as-is or customize their effects for your game.
The Example-Game.inform demonstrates the system in action:
- Open it in Inform 7
- Click "Go" to compile and run
- Type
test mefor an automated playthrough
Check casting:
let the skill be a random number between 1 and 10;
if the skill is less than the difficulty of the noun:
say "The spell fizzles - it's too difficult!" instead.A spell has a number called uses-remaining. The uses-remaining of a spell is usually 3.
Check casting:
if the uses-remaining of the noun is 0:
say "You've exhausted that spell's power." instead.
Carry out casting:
decrease the uses-remaining of the noun by 1;
continue the action.The ancient tome is a spellbook in the Library.
After studying the ancient tome:
repeat with magic running through unknown spells:
now magic is known;
say "You've learned [spell-name of magic]!";
say "The ancient tome contains all the fundamental spells!"- Gate progress with spells: Use specific spells as keys to unlock areas
- Limit memorization: Add a cap on simultaneously memorized spells
- Spell ingredients: Require consumed items for powerful spells
- Puzzle variety: Combine spells in creative ways for solutions
- Discovery: Hide scrolls throughout your world for exploration rewards
Inspired by Infocom's Enchanter, Sorcerer, and Spellbreaker (1983-1985). Created for the Inform 7 community.
Free to use and modify for any Inform 7 project!