You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
811 B

  1. module.exports = {
  2. type: 'singleTargetHeal',
  3. cdMax: 20,
  4. manaCost: 0,
  5. range: 9,
  6. healing: 1,
  7. needLos: true,
  8. targetFriendly: true,
  9. spellType: 'heal',
  10. particleDuration: 10,
  11. cast: function (action) {
  12. const target = action.target;
  13. const { x, y } = target;
  14. const amount = this.getDamage(target, true);
  15. const event = {
  16. heal: amount,
  17. source: this.obj,
  18. target,
  19. spell: this
  20. };
  21. target.stats.getHp(amount, this.obj, event);
  22. const effect = {
  23. x,
  24. y,
  25. components: [{
  26. type: 'particles',
  27. //This ttl is in frames (each frame is roughly 1000 / 60 ms)
  28. ttl: (1000 / 60) * this.particleDuration,
  29. destroyObject: true,
  30. blueprint: this.particles
  31. }]
  32. };
  33. this.obj.instance.syncer.queue('onGetObject', effect, -1);
  34. this.sendBump(target);
  35. return true;
  36. }
  37. };