Phaser AE

Abilities

Free packv3.0.0-3Arcade

Castable abilities as plain data: costs, targeting, windups, charges, cooldowns and interruption, with effects delivered on time as events. It is the logic behind a spell bar, kept apart from sprites, input and storage.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 19, 2026

Abilities: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

What it does

You create a kit for one caster from a list of ability definitions. Each definition names its resource costs, its range, whether it targets the caster, allies, enemies or anyone, the most targets it may name, its windup, its charges and cooldown, and a list of effects with a delay for each. The caster has a team, resources such as mana or energy, and flags for being alive or disabled.

preview checks a cast without changing anything and returns every reason it would be refused: a dead or disabled caster, a cast already running, no charge ready, not enough of a resource, a target out of range, too many targets, a duplicate, or a target on the wrong team. That list drives button states, tooltips and AI choices. start spends the costs and one charge together. Effects fall due at the windup plus their own delay, in a stable order, and come out of drain as events for your combat to apply. Charges recharge one at a time, never all at once.

interrupt cancels the cast in progress: effects not yet delivered are dropped, the configured fraction of the cost comes back, and the spent charge stays spent. Time moves only in tick, which splits a long step at every due moment so nothing is skipped, and the whole state snapshots and restores, with a check that refuses a saved state that does not fit the definitions.

Features

  • Ability definitions — costs by resource name, range, target filter, target count, windup, charges, cooldown, effects with delays and an interrupt refund.
  • Full previews — every rejection reason at once, read-only.
  • Charges and cooldowns — up to 1,000 charges an ability, recharging one after another.
  • Windups and delayed effects — damage, healing, shields, statuses and cleanses delivered on schedule to every target.
  • Interruption — undelivered effects dropped, a chosen share of the cost refunded, the charge kept spent.
  • Events — started, effect, complete, interrupted and recharged, each with its time.
  • Deterministic state — advanced only by tick, with snapshot, restore and checkAbilityState.

Good for

  • Action RPG skill bars, with mana costs, cooldowns and cast times.
  • Top-down shooters and arena games with charged abilities, such as a dash with three charges.
  • MOBA-style heroes, where casts can be interrupted by a stun and refund part of their cost.
  • Support abilities that heal or shield allies in range, with a cap on targets.
  • Enemy casters, using the same previews to decide what an AI can cast right now.
  • Server or test simulations, since the rules need no renderer or browser.

Make it yours

Everything is in the definitions, so a new ability is new data. Costs can use any resources you name; a cast can be instant or wind up; a single charge with a long cooldown makes a big ultimate, many charges with a short one make a spammable dash; and an interrupt refund from 0 to 1 decides how much a cancelled cast hurts.

Two materially different kits: a mage with a fireball that costs ten mana, winds up for 0.3 seconds and holds two charges, beside a free self-heal on a long cooldown; and a fighter whose whirlwind costs energy, has no windup and hits up to five enemies within a short range, its damage delivered in three pulses half a second apart.

A quick look

A bolt with two charges, cast at an enemy and its effect drained for the combat rules:

import { createAbilities } from '@phaser-ae/abilities';
const kit = createAbilities([{
  id: 'bolt', cost: { mana: 10 }, cooldown: 2, charges: 2, windup: .3,
  range: 250, target: 'enemy', maxTargets: 1, interruptRefund: .5,
  effects: [{ after: 0, effect: { kind: 'damage', amount: 20 } }],
}], { id: 'hero', team: 'party', alive: true, disabled: false, resources: { mana: 50 } });
const targets = [{ id: 'slime', team: 'foes', alive: true, distance: 100 }];
if (kit.preview('bolt', targets).ok) kit.start('bolt', targets);
kit.tick(.3);
const effects = kit.drain();   // deliver to the combat rules

Works with

  • combat-rules — required: the effects abilities deliver, applied to targets with armour, resistances and statuses.
  • melee-combat — for swings with startup, active and recovery frames rather than casts.
  • turn-battle — for turn-based battles rather than real-time casting.

Good to know

  • One kit serves one caster and runs one cast at a time.
  • Targets are observations you supply: a delayed effect does not retarget, refund when its target dies or check line of sight; your game decides those.
  • Resource regeneration belongs to your game, which sets the caster's resources directly.
  • No animation, input binding or button drawing is included.

More Arcade packs

Show all →