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.
 
 
 

59 lines
879 B

  1. module.exports = {
  2. type: 'smite',
  3. cdMax: 5,
  4. manaCost: 0,
  5. range: 1,
  6. damage: 1,
  7. col: 4,
  8. row: 1,
  9. init: function () {
  10. if (this.range > 1)
  11. this.needLos = true;
  12. },
  13. cast: function (action) {
  14. let target = action.target;
  15. let row = this.row;
  16. let col = this.col;
  17. this.sendAnimation({
  18. id: target.id,
  19. components: [{
  20. type: 'attackAnimation',
  21. new: true,
  22. row: row,
  23. col: col
  24. }]
  25. });
  26. this.sendBump(target);
  27. this.queueCallback(this.explode.bind(this, target), 100);
  28. return true;
  29. },
  30. explode: function (target) {
  31. if ((this.obj.destroyed) || (target.destroyed))
  32. return;
  33. let damage = this.getDamage(target);
  34. target.stats.takeDamage({
  35. damage,
  36. threatMult: this.threatMult,
  37. source: this.obj,
  38. target,
  39. spellName: 'smite'
  40. });
  41. target.effects.addEffect({
  42. type: 'stunned',
  43. ttl: this.stunDuration
  44. });
  45. }
  46. };