build-elemental-spells
Implement fireballs, chain lightning and frost bolts that hit enemies and react to the world. Use when a playable spell needs targeting, travel, contact, elemental effects and synchronized damage in a real-time 3D game.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: build-elemental-spellsdescription: Implement fireballs, chain lightning and frost bolts that hit enemies and react to the world. Use when a playable spell needs targeting, travel, contact, elemental effects and synchronized damage in a real-time 3D game.Build elemental spells
Start with a moving enemy, a second enemy behind a column, and a patch of ground. Cast from both sides of the column. The impact, damage, sound and visible obstacle should agree on what the spell hit.
Resolve one cast
- Give the cast an ID, element, release marker, reach and effect lifetime. Commit cost and cooldown at the game's chosen action point. Consume release once. Clear pending markers on cancellation, death and scene change.
- Resolve aim from the player's sight line, then test the path from the physical casting origin. For a moving projectile, sweep its radius from its previous to next simulation position and take the earliest solid hit. Include moving hurt volumes where targets can cross its path between ticks. An impact on a wall ends the projectile there.
- Publish a contact event carrying the cast ID, target or surface, position, normal and simulation time. Damage, surface reaction, hit sound and VFX consume that event. Track direct hits per target per cast. Give ongoing burns their own bounded tick schedule.
- Drive the visuals through charge, release, travel, contact and decay. Orient the impact to the surface normal. Keep the release anchored to the palm until it leaves, then let it travel in world space as the camera turns.
Give each element a different silhouette
| Element | What travels | What the hit leaves |
|---|---|---|
| Fire | A compact hot core with a torn orange shell. Shed slower embers behind it and let the tail lag through changes of direction. A short-range light catches the hand on release. | Flatten the first flame against the struck surface. Let smoke and flame rise against gravity. Ignite materials tagged as fuel and taper the local light as the flame dies. |
| Lightning | Join actual contact anchors with a thin white filament and a softer blue corona. Seed the bends once per discharge. Use short, tapered side forks and a delayed restrike along the same main path. | Flare at each reached anchor in hop order. Briefly light nearby bark or armor. End the arc at the last valid target and let the eye recover between discharges. |
| Frost | A narrow, faceted shard with a bright leading edge, a darker blue core and a short wake of cold air. Align the long axis to velocity. | Split into outward splinters and let frost spread across the struck surface. Keep the strongest contrast at the origin. Drive slow or freeze duration from the gameplay effect. |
For chain lightning, select the first contact along the cast. Search for each following target from the previous hit, allow a bounded jump radius, test line of sight and record visited IDs. Decorative branches deal no damage. The chain planner takes a first target, candidates, and a visibility callback. Feed its ordered targets to both the damage scheduler and the renderer. For delayed hops, recheck life, range and obstruction at discharge time if the game allows a target to escape.
Keep the fight readable
Check sunrise and night with the same seed and enemy spacing. Preserve a distinct core through bloom and smoke. Depth-test the bolt and its opaque contacts against the scene. Cap active local lights and pooled particles. Reduced-effects mode can drop forks, embers, shake and pulse intensity while retaining the main trajectory and contact cue. Return lights, decals and pooled effects when their lifetime ends or the encounter restarts.
Check a long shot at a moving target, a close wall, a miss, and two enemies on opposite sides of cover. With three visible enemies, inspect the ordered target IDs and count the damage events. Repeat with overlapping targets, an interrupted wind-up and a frame hitch. Watch the same moments at normal speed with audio to judge whether each element reads before its HUD label appears.