Spells
CYBERDEViL edited this page 4 years ago

Spells

A spell can modify the target it's stats.

Target types:

  • 0 Selected
    • Gets target before casting.
    • Only 1 target
    • Can have range.
    • Can have facing angle.
  • 1 Self
    • Get target (self) before casting.
    • Only 1 target
    • Has no range.
    • Has no facing angle.
  • 2 Range
    • Gets target(s) on apply.
    • Can have multiple targets.
    • Must have range.
    • Has no facing angle.

Data structure (spells.json)

index valueType default description
0 castTime float 0.0 Amount of time in seconds it takes to cast this spell.
1 coolDown float 0.0 Amount of time in seconds it takes this spell to cool-down after being casted.
2 methodId int 0 This is meant for extra scripting in the future.
3 targetType int 0 selected, self or range
4 range list [0.0, 0.0] [float min, float max]
5 facingAngle int 0 0 - 359
6 impactPoints int 0 Negative values will do damage, while positive values will heal.
7 energyCost int 0 Energy it will cost the caster to cast this spell.
8 name str "" Display name
9 icon str "" Icon path
10 desc str "" Description

Routine:

  • startCast
  • - check if caster may cast.
  • - - caster is not dead
  • - - caster is not casting
  • - - caster has enough energy
  • - - spell is not cooling
  • - if targetType in [selected, self]
  • - - get target
  • - - do target checks
  • - - - target is not dead
  • - - - caster is facing target
  • - - - caster is in range of target
  • - - - if impactPoints are positive
  • - - - - check if target doesn't have max health
  • - - - if impactPoints are negative
  • - - - - check if target is not caster (cannot attack self)
  • - do casting time
  • - - set casting animation
  • - - set SpellStatus.casting
  • - apply spell and do spell cool-down (after casting time)
  • - - set SpellStatus.fire
  • - - subtract energy from caster
  • - - set casting to False
  • - - if targetType == range
  • - - - get targets in range
  • - - - - do target checks
  • - finalize (after cool-down) ___

Animations and VFX

Nothing of this is implemented yet. Just some idea's/notes.

Casting

  • casting animation
  • casting effects
  • projectile
  • projectile casting effects

Shooting

  • shoot animation
  • shoot effects
  • projectile shoot effects

Impact

  • projectile impact effect
  • target impact animation
  • target impact effect ___

References