BA

Battle Animations & Timing

Guides the maintenance and addition of battle animations using a data-driven framework.

Install

mkdir -p .claude/skills/battle-animations-timing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14208" && unzip -o skill.zip -d .claude/skills/battle-animations-timing && rm skill.zip

Installs to .claude/skills/battle-animations-timing

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guide for maintaining and adding new battle animations, focusing on specific sequence timing (Entry, Hits, Faints) and the data-driven Animation Framework.
155 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Register and play named animation sequences using AnimFramework
  • Define modular animation definitions in the registry directory
  • Trigger move animations based on damage dealing pipeline
  • Set `skipAnim: true` for unique move animations
  • Utilize various step types for audio, control, and visual effects

How it works

The skill uses a data-driven, registry-based animation system to manage battle animations. It registers and plays named animation sequences, defines modular animations, and triggers them based on the damage dealing pipeline, ensuring specific sequence timings and CSS class interactions.

Inputs & outputs

You give it
New battle animation requirements or existing animation modifications
You get back
Data-driven animation definitions or adjusted animation timings

When to use Battle Animations & Timing

  • Adding new battle animations
  • Adjusting hit sequence timing
  • Registering new elemental moves
  • Debugging animation sequences

About this skill

Battle Animations & Timing Guide

Description

This guide ensures that all battle animations (Entry, Attack hits, Fainting, Switching) maintain the authentic G/S feel by respecting specific sequence timings and CSS class interactions.

Animation Framework Overview

The project uses a data-driven, registry-based animation system spread across three files in js/anim/:

  • AnimFramework (anim_framework.js) — The engine. Registers and plays named animation sequences. Contains the SVG shape library, formation patterns, and sprite movement presets.
  • registry/ — Directory containing modular animation definitions (registered on load):
    • core.js: Basic type effects (fx-fire, etc.), recovery, status, and system animations.
    • elemental.js: Fire, Water, Electric, Grass, and Ice moves.
    • physical.js: Normal, Fighting, Flying, and Poison moves.
    • nature.js: Ground and Rock moves.
    • steel.js: Steel and Metal-themed moves.
    • mystic.js: Psychic, Ghost, Dark, Dragon, and multi-elemental moves.
  • BattleAnims (animations.js) — High-level API the rest of the codebase calls. Delegates to the framework.

[!IMPORTANT] Check the Directory First: Always check docs/ANIMATION_DIRECTORY.json before implementing a new animation to avoid duplicates. Since this file is large, do not read the whole file. Instead, use the grep_search tool to search for the specific elemental type (e.g. "FIRE": {) and only read the relevant section. If you add a new animation, you must manually update this JSON file in the appropriate type category.

How Move Animations are Triggered

When a move deals damage, the pipeline automatically checks for a registered animation:

resolveSingleHit → applyDamage(target, amount, type, moveName)
  → triggerHitAnim(target, type, moveName)
    ① Check (Pre-Anim): Are conditions valid? (Substitute, Status, Type Immunity)
        → If invalid, log "But it failed!" and STOP.
    ② Check: AnimFramework.has(moveName)  → e.g. 'flamethrower'
    ③ Check: AnimFramework.has('fx-'+type) → e.g. 'fx-fire'
    ④ Fallback: classic inline (screen flash + sprite shake)

Move names are auto-normalized: 'FLAMETHROWER''flamethrower', 'ICE BEAM''ice-beam'.

The skipAnim Pattern

If a unique move in MOVE_DEX plays its own animation in onHit (e.g. Explosion), its internal moveData should set skipAnim: true to prevent the pipeline from replaying it.

const moveData = { name: 'EXPLOSION', type: 'normal', power: 250, category: 'physical', skipAnim: true };

Available Step Types (20 total)

Audio & Control

TypeParametersDescription
sfxsound, wait?Play a sound effect
crycry?, target?('attacker'/'defender'), wait?Play a Pokémon cry
waitmsPause execution
callbackfn(ctx)Run arbitrary async function
parallelsteps: [...]Run multiple steps concurrently
sequencesteps: [...]Run multiple steps in order. Essential for nesting inside parallel

Visual Effects (Scene-level)

TypeParametersDescription
screenFxclass, durationApply CSS class to scene (auto-removes). Uses classes like fx-fire, fx-water, etc.
flashcolor, duration, opacity?, parent?Full-scene color overlay that fades out
tiltangle, durationRotate the battle scene and spring back. Great for heavy impacts
bgColorcolor, durationTemporarily flash the background to a solid color (e.g. dark for Ghost moves)
inverttarget('scene'|'attacker'|'defender'), durationInvert colors of the entire scene or a single sprite
waveintensity, duration, speedWavy screen distortion using skew transforms. Psychic/Confusion vibe
cssClassel, class, duration, persist?Toggle any CSS class on any element

Sprite Effects

TypeParametersDescription
spriteShaketarget, duration, flipped?, skipIfInvisible?Shake + flicker a sprite (the classic "hit" reaction)
spriteSilhouettetarget, color, hold?, duration, follow?Solid-color silhouette. Follows sprite moves by default.
spriteGhosttarget, color, hold?, durationStationary silhouette snapshot (ghosting effect).
spriteWavetarget, intensity, duration, speedWiggle/distortion on a specific sprite.
spriteMovetarget, preset OR x,y,duration,easingMove a sprite with preset templates or custom coordinates
spriteMetallictarget, duration, color?Applies a grayscale metallic filter to the sprite and animates a shiny gradient wipe across it. Supports 'gold'/'bronze' tints.
moveel, x, y, duration, easing?, reset?Translate any arbitrary DOM element

Projectiles & Particles

TypeParametersDescription
streamfrom, to, count, interval, spread, travelTime, size, color, outline?, scaleStart?, scaleEnd?, fade?, svgShape?Continuous particle flow. Core system for fire, ice, water moves. Supports SVG shapes as particles
beamfrom, to, className?, duration, width, height, beamStyles?Single projectile from → to
volleyfrom, to, count, interval, travelTime, projectile: {width, height, styles}Rapid-fire pixel projectiles (e.g. Pin Missile)
particlesposition, count, spread, className?, duration, particleStyles?Burst of impact particles at a position

Shapes & Overlays

TypeParametersDescription
overlaytarget, shape, color, outline?, width, height, duration, animation, count?, spread?Render an SVG shape on top of a target with entrance animation
formationtarget, pattern|points, particleSize, color, outline?, shape?, duration, stagger?Spawn particles arranged in a predefined pattern (e.g. Fire Blast 大 kanji)
orbittarget, shape, radiusX, radiusY, count, speed, duration, color, outline?, yOffset?Rotate shapes in an elliptical path around a target. Simulates depth with z-index and scaling.
spawnparent?, className, styles?, tag?, text?, duration, waitAfter?Create a temporary DOM element

Developer Experience: Autocomplete & Types

The project includes a robust JSDoc-based type system in js/types.js and a jsconfig.json file. This provides full IntelliSense for animation sequences in VS Code.

How to use:

When calling AnimFramework.register(name, steps), the steps array is automatically typed.

  • As you type { type: '...' }, VS Code will suggest all 20+ available step types.
  • Once a type is chosen, VS Code will suggest the specific parameters (e.g. sound for sfx, preset for spriteMove).

Key Types:

  • AnimStep: Defines the required/optional fields for every animation step.
  • AnimationEngine: Typed interface for AnimFramework.
  • BattleEngine: Typed interface for the main Battle orchestrator.

SVG Shape Library

13 built-in 8-bit pixel-art shapes available for overlay, formation, and stream steps:

ShapeUse Case
lightningThunderbolt striking down
fireFlame particles, fire overlays
waterWater drop effects
leafGrass/nature moves
starImpact sparks, sparkle effects
clawSlash / claw attack overlays
fistFighting-type punch impacts
skullGhost-type effects
spiralPsychic / confusion effects
birdFlying-type movements / Confusion
duckConfusion effect
rockGround/Rock type impacts
sparkleHealing / Status restore effects
musicSing / Sonic moves
heartAttract / Charm effects
eyeGlare / Mean Look effects
bubbleWater / Sleep effects
zzzSleep status
dropSweat drop / Splash
shieldProtect / Defense effects
wallReflect / Light Screen
angerAnger point / frustration vein pop
jaw-topUpper set of fangs
jaw-bottomLower set of fangs
bite(Deprecated) Combined biting teeth
kickHigh Jump Kick / kicking attacks
poisonToxic sludge drop, poison attacks
snowHail / Blizzard snowflakes
gustWhirlwind / hurricane tornadoes
spikeSpikes / caltrop hazards

Formation Patterns

Predefined point layouts for the formation step. Each is an array of {x, y} offsets from the target's center.

PatternShapeBest For
fireBlast大 kanjiFire Blast's iconic symbol
cross+ shapeCross-shaped impacts
ring○ circleEncircling effects
xShape✕ shapeX-shaped hits

Custom formations — pass your own points array:

{ type: 'formation', target: 'defender',
    points: [{x:0,y:-10}, {x:-10,y:0}, {x:10,y:0}, {x:0,y:10}],
    particleSize: 6, color: '#ff0000', duration: 500
}

Sprite Movement Presets

The spriteMove step provides quick-access movement templates. Direction is automatically adjusted for player vs. enemy side.

PresetMotionDurationBest For
lungeForward toward opponent, back240msPhysical attacks (Tackle, Slash)
dodgeQuick sidestep away160msEvasion, Agility
jumpHop up and down240msBounce, aerial moves
recoilPush backward300msTake-down, recoil damage
chargeRush forward aggressively400msHyper Beam charge, Skull Bash
slamUp then slam down310msBody Slam, Earthquake
floatGentle rise and

Content truncated.

When not to use it

  • When implementing a new animation without checking `docs/ANIMATION_DIRECTORY.json` first
  • When writing inline DOM logic instead of using `AnimFramework.register()`

Limitations

  • Requires checking `docs/ANIMATION_DIRECTORY.json` to avoid duplicates
  • New animations must manually update the JSON file
  • Move names are auto-normalized

How it compares

This approach uses a data-driven, registry-based animation system with specific sequence timings and CSS class interactions to maintain an authentic G/S feel, which is more structured than ad-hoc animation implementations.

Compared to similar skills

Battle Animations & Timing side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
Battle Animations & Timing (this skill)05moNo flagsIntermediate
threejs-skills614moNo flagsIntermediate
3d-graphics336moNo flagsAdvanced
3d-web-experience356moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

threejs-skills

sickn33

Three.js skills for creating 3D elements and interactive experiences

61152

3d-graphics

samhvw8

3D web graphics with Three.js (WebGL/WebGPU). Capabilities: scenes, cameras, geometries, materials, lights, animations, model loading (GLTF/FBX), PBR materials, shadows, post-processing (bloom, SSAO, SSR), custom shaders, instancing, LOD, physics, VR/XR. Actions: create, build, animate, render 3D scenes/models. Keywords: Three.js, WebGL, WebGPU, 3D graphics, scene, camera, geometry, material, light, animation, GLTF, FBX, OrbitControls, PBR, shadow mapping, post-processing, bloom, SSAO, shader, instancing, LOD, WebXR, VR, AR, product configurator, data visualization, architectural walkthrough, interactive 3D, canvas. Use when: creating 3D visualizations, building WebGL/WebGPU apps, loading 3D models, adding animations, implementing VR/XR, creating interactive graphics, building product configurators.

33104

3d-web-experience

davila7

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.

3570

threejs-shaders

CloudAI-X

Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.

430

gsap

martinholovsky

GSAP animations for JARVIS HUD transitions and effects

318

threejs-animation

CloudAI-X

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

57

Search skills

Search the agent skills registry