nddipiazza/robos / games/quest-warrior-dragon/.agents/skills/add-spell
add-spell
VerifiedWorkflow 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: Arrayholds 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
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| 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: 196k | Updated | Claude CodeCodex | Verified | Install |