← Updates

A composable spell system

Magic in Nightward began as a small set of individually hardcoded spells: each one was a special case in the code, and adding or changing a spell meant editing the game itself. This update replaces that with a composable spell system, and extends it to monsters, who can now cast the same spells the player does.

Spells as effects

A spell is no longer a single fixed behaviour. It is now a header plus an ordered list of effects, and each effect is one of a handful of building blocks — damage, damage-over-time, healing, concealment, a stat buff, or a control effect such as stun or blind. Effects compose freely, so a spell that deals a burst of damage and then leaves a lingering poison is simply a damage effect followed by a damage-over-time effect, with no new code required.

Around that list sits a small amount of shared configuration: what the spell can target and in what shape, whether it requires a particular weapon to cast, how each effect scales with the caster, and a minimum casting range. All of it is authored in the content tools rather than written in code, and the spellbook, tooltips, and cast resolution all read from the same definition.

The most visible consequence of unifying the cast path is that effects now apply symmetrically. Damage-over-time and control effects that previously only landed on monsters can now land on the player, so a hostile caster can poison, stun, or blind you just as you would them.

Two new effects: buff and blind

The rebuild replaced the old, narrow “shield” effect with a general buff: a timed change to any attribute, skill, or derived stat. Shield of Faith and Iron Skin are now expressed as buffs, and new protective or enhancing spells can be authored without touching the engine.

The new blind control effect has a strong, legible impact in play. A blinded player’s view of the world goes dark and their target list empties — they can still act, but they are fighting without sight. A blinded monster loses track of the player and wanders aimlessly, which turns blind into a genuine escape or crowd-control tool rather than a flat damage modifier.

Monsters that cast

Because player and monster casting now run through the same system, monsters can be given spells directly. A caster monster is assigned attack and healing spells and a casting behaviour, and from there it behaves like a caster should: it warms a spell for a moment before it lands, telegraphing the cast with a chant and a sound; it can be interrupted by a well-timed hit; and when it runs low on mana it falls back to its weapon. A wounded caster may break off its attack to heal itself instead.

Casting is faction-aware — a monster’s spells only affect players, and a player’s only affect monsters — and both sides share the same visual effects and sounds, so a firebolt looks and sounds the same whoever throws it.

Mana during combat

One quieter change matters a great deal to casters: mana now regenerates during combat, at a reduced rate, where before it did not regenerate at all while fighting. Health regeneration remains fully suppressed in combat, so this does not soften melee exchanges — it simply keeps a caster from running dry a few turns into a fight and being left with nothing to do. The in-combat rate is a tunable balance value.

Also in this build

  • Shield Spell aura indicator. Passive protections granted by gear now surface as a single “aura” icon in the active-effects window, with a tooltip naming the aura and the total it provides. A cast Shield spell keeps its own separate, temporary icon.
  • Hotbar spell tooltips. Hotbar slots now show the same tooltips as the spellbook, and a spell you cannot currently afford to cast is dimmed.