V1.27.0: battles that run themselves: track, targets, hit or miss, saves, auto-rolls

- Turn-order track: names coloured by PC, NPC or monster, this round, a flag
  where it ends, and the next round
- Target by clicking a name on the track, the card, or keys 1-9; whoever is
  on turn and every target show what they have in hand
- Attacks and spells are declared, rolled and applied: type or roll the d20
  and the app says hit, miss or critical; a save spell asks each target for
  its save against the caster's DC; the DM overrules anything and applies
- Critical damage by the campaign's rule; a spell spends its slot; a
  concentration save is called for
- Auto-rolled monster and NPC attacks: aimed (weighted), rolled, and offered
  to the DM to accept, edit or discard; hidden from players until accepted
- Monsters can have named attacks and multiattacks; spells say how they land
- A "What now" line tells the DM (and each player) what the scene waits on

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 09:14:04 +02:00
co-authored by Claude Opus 5.5
parent 8811f14732
commit 9b3637576d
29 changed files with 2693 additions and 38 deletions
+57
View File
@@ -155,4 +155,61 @@ const SPELL_LIBRARY = [
{ key: 'wall-of-stone', name: 'Wall of Stone', level: 5, school: 'Evocation', castingTime: '1 action', range: '120 feet', duration: 'Concentration, up to 10 minutes', description: 'A nonmagical wall of solid stone springs into existence.', classes: ['DRUID', 'SORCERER', 'WIZARD'] },
];
// How each spell lands in a battle (game/combat.js): a spell attack against
// AC, or a saving throw by each target, [ability, half damage on a success].
// A spell in neither list simply takes effect. Written onto the entries
// below, as `attackRoll`, `saveAbility` and `halfOnSave`.
const SPELL_ATTACKS = ['chill-touch', 'eldritch-blast', 'fire-bolt', 'produce-flame', 'ray-of-frost', 'shocking-grasp', 'thorn-whip', 'guiding-bolt', 'witch-bolt', 'scorching-ray', 'spiritual-weapon', 'contagion'];
const SPELL_SAVES = {
'acid-splash': ['DEX', false],
'poison-spray': ['CON', false],
'sacred-flame': ['DEX', false],
'vicious-mockery': ['WIS', false],
'burning-hands': ['DEX', true],
'thunderwave': ['CON', true],
'bane': ['CHA', false],
'charm-person': ['WIS', false],
'command': ['WIS', false],
'entangle': ['STR', false],
'faerie-fire': ['DEX', false],
'animal-friendship': ['WIS', false],
'blindness-deafness': ['CON', false],
'hold-person': ['WIS', false],
'flaming-sphere': ['DEX', true],
'moonbeam': ['CON', true],
'shatter': ['CON', true],
'suggestion': ['WIS', false],
'web': ['DEX', false],
'zone-of-truth': ['CHA', false],
'levitate': ['CON', false],
'gust-of-wind': ['STR', false],
'call-lightning': ['DEX', true],
'fear': ['WIS', false],
'fireball': ['DEX', true],
'lightning-bolt': ['DEX', true],
'sleet-storm': ['DEX', false],
'slow': ['WIS', false],
'spirit-guardians': ['WIS', true],
'stinking-cloud': ['CON', false],
'banishment': ['CHA', false],
'blight': ['CON', true],
'confusion': ['WIS', false],
'ice-storm': ['DEX', true],
'polymorph': ['WIS', false],
'wall-of-fire': ['DEX', true],
'guardian-of-faith': ['DEX', true],
'cloudkill': ['CON', true],
'cone-of-cold': ['CON', true],
'dominate-person': ['WIS', false],
'flame-strike': ['DEX', true],
'hold-monster': ['WIS', false],
'insect-plague': ['CON', true],
};
for (const spell of SPELL_LIBRARY) {
spell.attackRoll = SPELL_ATTACKS.includes(spell.key);
const save = SPELL_SAVES[spell.key];
spell.saveAbility = save ? save[0] : null;
spell.halfOnSave = save ? save[1] : false;
}
module.exports = { SPELL_LIBRARY };