Skip to content
Nill edited this page Jan 8, 2021 · 1 revision

Spells are very primitive scripts that are defined in the level layout data and can be triggered at runtime based on various triggers. Spells are used to encode the various room-specific gameplay elements that previously were hard-coded into the original game.

Each spell defined has a location in cell space (which may or may not have meaning, depending on the type of spell), as well as a trigger type (which determines what triggers the spell) and a spell type (which determines what the spell does). The various trigger and spell types each have their own parameters which determine their actual behavior.

  • A spell may have a prerequisite of having an inventory item of a specific type from a specific room
  • A spell may have a prerequisite of a previous spell being invoked (so that several triggers can be required for a specific action)
  • When a spell is invoked it is added to Dana's inventory (as an ExecutedSpell) so it can be referenced/checked in the future
  • A spell can have one of several triggers and action types:

Triggers

Trigger Description
Immediate The spell executes as soon as pre
CastsMagic The spell executes when Dana casts magic on the spell's location
DanaTouches The spell executes when Dana touches the spell's location
Potion The spell executes when Dana ingests a Question Potion
HeadHit The spell executes when Dana hits his head on the block at the spell's location

Types

Spell Type Parameters Behavior Used in NES Rooms
Change Cell Position, Cell Type, Modifier, Animate Changes the layout cell at a specific X/Y to a specific type and modifier. If "Animate" is true, an effect is shown, otherwise the cell is changed without any fanfare. Note that the "FAKECONCRETE" cell type can be used to make a block that Dana can break but still looks gray. Solomon, Princess, Page of Time, Page of Space
Spawn Object Spawn ID Spawns one or more objects from a specific spawn point. You should create a spawn point in Spawns mode that has no timing bits set. 17, 39
Disable Scroll None Disable's Dana's scroll / ability to create fireballs Solomon
Enable Scroll None Re-enables Dana's scroll None
Secret Exit None Change the default room exit to the "secret" exit room number 20, 44
Random Cell Position Pulls a random item from the room's "random list" and changes the cell at the specified position to a Covered block with that item (and removes the entry from the "random list"). If no more items exist in the random list, a normal tan block is used. 52 (Hidden)

Clone this wiki locally