Skip to content

nddipiazza/robos / games/quest-warrior-dragon/.agents/skills/add-spell

add-spell

Verified

Workflow for defining spell stats in data/v1/spells.json, implementing battle and overworld spell handlers, and testing spell casting.

🪄 Add or Balance a Spell Skill

Use this skill when modifying spell stats, adding new magic spells, or adjusting battle spell effects.

📊 Data Source (data/v1/spells.json)

Spells are loaded at runtime by BattleOverlay.gd via _load_known_spells(spell_ids):

{
  "id": "hurt",
  "name": "HURT",
  "mp_cost": 2,
  "level_learned": 4,
  "target": "enemy",
  "effect": "Deals 5-12 magic damage to one enemy",
  "damage_min": 5,
  "damage_max": 12,
  "blocked_by": "resist_hurt (X/16)"
}

The 10 NES spells (heal, hurt, sleep, radiant, stopspell, outside, return, repel, healmore, hurtmore) are defined in data/v1/spells.json.


⚙️ Where Spell Logic Lives

  • Known Spells: GameState.spells: Array holds unlocked spell IDs (e.g. ["heal", "hurt"]).
  • Battle Spells: BattleOverlay._cast_spell(sp: Dictionary) dispatches damage, healing, status effects, MP deduction, resistance checks (resist_sleep, resist_stopspell, resist_hurt), and spell animations (_show_spell_anim()).
  • Overworld Spells: Non-combat spells (outside, return, repel) require handlers in map scripts' _cmd_spell().

🧪 Testing Spells

Use BattleTest with the --hero-spells debug flag:

./debug.sh --scene BattleTest --monster slime --hero-spells "heal;hurt" --hero-mp 10 --hero-mp-max 10
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall