BlueGit

timfa questward

Files

questward / shared / definitions / spells.js

spells.js

spells.js 997 B Download Raw
1/**
2 * Minimal spell content definitions. Gameplay wiring (casting UI, ECS) comes later.
3 *
4 * @typedef {object} SpellDefinition
5 * @property {string} spellId
6 * @property {string} displayName
7 * @property {number} difficulty Roll contest die size (1..difficulty) rolled against Magic
8 * @property {number} [baseDamage]
9 * @property {import("../combat/magic.js").SpellElement} [element]
10 * @property {string|null} [effectId] Non-damage spells apply this when cast succeeds
11 * @property {number} [rangeTiles]
12 * @property {number} [minMagicLevel]
13 */
14
15export const SpellId = Object.freeze({
16 spark: "spark"
17});
18
19/** @type {Record<string, SpellDefinition>} */
20export const SPELL_DEFINITIONS = Object.freeze({
21 [SpellId.spark]: Object.freeze({
22 spellId: SpellId.spark,
23 displayName: "Spark",
24 difficulty: 4,
25 baseDamage: 2,
26 element: "fire",
27 effectId: null,
28 rangeTiles: 4,
29 minMagicLevel: 1
30 })
31});
32
33export function spellDefinition (spellId)
34{
35 return SPELL_DEFINITIONS[spellId] ?? null;
36}