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.
 
 
 

55 lines
814 B

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