Skip to content

Repository files navigation

Enchanter-Style Spellcasting for Inform 7

A complete, modular spellcasting system inspired by Infocom's classic Enchanter trilogy.

Features

  • 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

Installation

  1. Copy Spellcasting.i7x to your Inform 7 extensions folder:

    • Mac: ~/Library/Inform/Extensions/Omeros/
    • Windows: My Documents\Inform\Extensions\Omeros\
    • Linux: ~/.local/share/inform7/Extensions/Omeros/
  2. In your game, include the extension:

    Include Spellcasting by Omeros.

Quick Start

"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!

Creating Custom Spells

1. Define the Spell

The zap spell is a spell.
The spell-name is "zap".
The spell-description is "Destroys small objects with lightning."
The difficulty is 3.

2. Define the Effect

A spell-effect rule for the zap spell:
    say "Lightning crackles from your fingers, annihilating the target!"

3. Create a Scroll (Optional)

The lightning scroll is a scroll.
The inscribed-spell is the zap spell.
The description is "A scroll crackling with static electricity."

Player Commands

  • read [scroll] / study [scroll] - Learn a spell from a scroll
  • memorize [spell] - Prepare a spell for casting
  • forget [spell] - Clear a spell from memory
  • cast [spell] / [spell name] - Cast a memorized spell
  • spells - List all known spells and their status

Example: Targeting Spells

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.

Included Example Spells

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.

Running the Example Game

The Example-Game.inform demonstrates the system in action:

  1. Open it in Inform 7
  2. Click "Go" to compile and run
  3. Type test me for an automated playthrough

Advanced Usage

Spell Difficulty Checks

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.

Limited Spell Uses

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.

Spellbooks

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!"

Tips for Game Design

  1. Gate progress with spells: Use specific spells as keys to unlock areas
  2. Limit memorization: Add a cap on simultaneously memorized spells
  3. Spell ingredients: Require consumed items for powerful spells
  4. Puzzle variety: Combine spells in creative ways for solutions
  5. Discovery: Hide scrolls throughout your world for exploration rewards

Credits

Inspired by Infocom's Enchanter, Sorcerer, and Spellbreaker (1983-1985). Created for the Inform 7 community.

License

Free to use and modify for any Inform 7 project!

About

Inform module to support spellcasting

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages