Demo Spell Examples
These demo spells showcase different features of the modular spell system, from projectile mechanics to channeling and area effects.- Burning Blast
- Collapse
- Empowered Pull
Burning Blast
A channeled projectile spell that forms and unleashes a burning ball of magma. Upon impact, it deals 250% damage and ignites all targets in a small radius.Key Features
- Channeling system with warmup period
- Projectile retargeting during channel phase
- Visual effects that evolve during flight
- Area of effect damage on impact
- Damage scaling at 250% base damage
How It Works
1. Spell Registration
1. Spell Registration
The spell is registered with the spell system, defining its cooldown, warmup, and channel behaviors:
spellcd=3: 3 second cooldownwarmup=0.6: 0.6 second channel timeonChannelTick: Applies slowness while channeling
2. Projectile Launch
2. Projectile Launch
Once channeling completes, the spell fires a projectile:
- Uses
DISPLAYentity withmagmamaterial - Starts slow (
velocity=0.1) then accelerates - Tracks origin location for retargeting
3. Retargeting During Channel
3. Retargeting During Channel
While channeling, the projectile follows your cursor:Only retargets when
fired=0 (during channel phase)4. Impact & Damage
4. Impact & Damage
On hit or at the end of flight, deals area damage:
- Multiplies damage by 2.5x
- Ignites targets for 4 seconds (80 ticks)
- Hits all enemies within 3 blocks at impact location
Full Code
Common Patterns
These demo spells illustrate several reusable patterns:Channeling System
All spells use theskill:Spell wrapper with channel callbacks:
onChannelStart: Initial setuponChannelTick: Continuous effectsonInterrupt: Cleanup and cooldown
Variable Management
Spells use variables for state tracking:setvarandsetvarlocfor storage<skill.var.name|default>for retrieval with defaultsvarequalsconditions for state checks
Damage Scaling
Thedamage-ability skill provides:
damageModfor scaling (e.g.,x*2.5for 250%)immunefor hit immunity framesonHitfor additional effects
Visual Effects
Consistent particle effect patterns:e:pfor particle effectse:prfor particle rings- Color coding with
reddustparticles - Sound effects synchronized with actions
Next Steps
Weapon Combos
Learn how to create combo systems for weapons
Custom Items
Build custom items that integrate with spells
Spell System
Understand the core spell system mechanics
Skill Reference
Browse all available skill mechanics