Creates visual spell animations for a custom RPG system in FoundryVTT using Sequencer. Supports turn-based combat with custom rules, multiple element types, and focus mechanics.
Creates visual spell animations for a custom RPG system in FoundryVTT using the Sequencer module. This skill helps you build RPG-compliant spell macros with proper turn validation, element mechanics, and focus stance support.
This is a **FoundryVTT spell animation collection** for a **custom RPG system** (NOT D&D 5e). All spells must comply with specific custom game rules.
**Combat System:**
**Combat Stances (choose at turn start):**
1. **Offensive**: Maximize all damage dice, -2 Agilité for defense
2. **Defensive**: Can use reactive spells, use spell stats for defense
3. **Focus**: Most spells become free mana cost, -1 Agilité
**Resources:**
**Spell Mechanics:**
**Essential (Pre-installed):**
Before creating spells, review the project documentation:
```javascript
/**
* [Spell Name] - [Brief Description]
*
* RPG-COMPLIANT SPELL for Custom RPG System
*
* Description: [Detailed spell mechanics]
* Damage/Healing: [Formula explanation]
* Mana Cost: X mana (focusable/not focusable)
* Prerequisites: Sequencer, Portal, [other modules]
*/
(async () => {
// 1. Validate requirements
if (!canvas.tokens.controlled.length) {
ui.notifications.error("Please select your character token first!");
return;
}
// 2. Validate turn order
const casterToken = canvas.tokens.controlled[0];
if (!validateSpellCasting(casterToken, "Spell Name")) {
return;
}
// 3. Get user inputs (dialogs for stats, options)
// Use HTML dialogs to collect:
// - Primary stat value (Physique, Esprit, etc.)
// - Stat bonus
// - Element variant (if applicable)
// - Focus stance (if spell is focusable)
// 4. Handle targeting (Portal crosshairs)
// Use Portal.Spawn for crosshair targeting
// Handle single target, multi-target, or self-targeting
// 5. Roll damage/healing for display
// Calculate damage: typically 1d6 + (Stat + bonus)/2
// Use Roll API to generate results
// 6. Create Sequencer animation
// Use JB2A effects with proper timing
// Include: casting effect, projectile/effect, impact, sound
// 7. Display results in chat
// Show spell details, targets, damage/healing, element effects
// 8. Helper functions
function validateSpellCasting(casterToken, spellName) {
const combat = game.combat;
if (!combat?.started) {
ui.notifications.warn(`${spellName} requires active combat`);
return false;
}
const activeCombatant = combat.combatant;
if (activeCombatant?.token?.id !== casterToken.id) {
ui.notifications.warn(`${spellName}: Wait for your turn!`);
return false;
}
return true;
}
})();
```
**Required Elements:**
**Animation Elements:**
**DO NOT Include:**
**Basic Effect:**
```javascript
new Sequence()
.effect()
.file("jb2a.effect.webm")
.atLocation(caster)
.scale(0.8)
.sound()
.file("path/to/sound.wav")
.volume(0.3)
.play();
```
**Projectile Pattern:**
```javascript
new Sequence()
.effect()
.file("jb2a.projectile")
.atLocation(caster)
.stretchTo(target)
.waitUntilFinished(-200)
.effect()
.file("jb2a.explosion")
.atLocation(target)
.play();
```
Map spells to the appropriate RPG stat:
```javascript
const chatContent = `
<div class="spell-result">
<h3>🎯 ${spellName} (${elementType})</h3>
<p><strong>Caster:</strong> ${actor.name}</p>
<p><strong>Targets:</strong> ${targetDescription}</p>
<p><strong>Mana Cost:</strong> ${manaCost}</p>
<hr>
<p><strong>Damage/Healing:</strong> ${result}</p>
<hr>
<p><strong>Element Effect:</strong> ${elementEffect}</p>
</div>
`;
ChatMessage.create({
content: chatContent,
speaker: ChatMessage.getSpeaker({ actor })
});
```
Place spell macros in the appropriate directory:
```
/macros/
├── basic/ # Simple single-effect spells
├── intermediate/ # Multi-step sequences
├── advanced/ # Complex targeting & interactions
├── spells/ # Generic spell animations
├── characters/ # Character-specific RPG-compliant spells
└── utilities/ # Helper functions
```
See `/macros/characters/ora/bubbles.js` for a complete RPG-compliant spell example featuring:
1. **Always ask for stat values** - cannot be auto-retrieved from character sheets
2. **Focus on visual effects** - this is an animation collection, not a game system
3. **Follow RPG rules strictly** - this is NOT generic D&D 5e
4. **Use proper error handling** - validate all user inputs
5. **Include comprehensive documentation** - explain RPG mechanics in comments
6. **Test targeting scenarios** - single target, multi-target, self-target
7. **Consider stance implications** - how spell behaves in different combat stances
When creating a new spell:
1. Start with the template structure
2. Define spell mechanics (damage formula, mana cost, focusability)
3. Implement user input dialogs for stats and options
4. Set up Portal targeting for crosshair selection
5. Create Sequencer animation with appropriate JB2A effects
6. Format and display results in chat with proper RPG information
7. Test in all combat stances and targeting scenarios
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/foundryvtt-rpg-spell-animation-creator/raw