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.
 
 
 

62 line
945 B

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