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.
 
 
 

72 lines
1.3 KiB

  1. module.exports = {
  2. type: 'bloodBarrier',
  3. cdMax: 7,
  4. manaCost: 0,
  5. range: 9,
  6. speed: 150,
  7. damage: 1,
  8. row: 3,
  9. col: 0,
  10. needLos: true,
  11. autoTargetFollower: true,
  12. targetFriendly: true,
  13. noTargetSelf: true,
  14. cast: function (action) {
  15. const { target } = action;
  16. this.sendBump(target);
  17. this.queueCallback(this.explode.bind(this, action), 1, null, target);
  18. return true;
  19. },
  20. explode: function (action) {
  21. const { obj } = this;
  22. const { target } = action;
  23. if ((obj.destroyed) || (target.destroyed))
  24. return;
  25. let amount = (obj.stats.values.hpMax / 100) * this.drainPercentage;
  26. obj.stats.takeDamage({
  27. damage: { amount },
  28. threatMult: 0,
  29. source: obj,
  30. target: obj,
  31. spellName: 'bloodBarrier'
  32. });
  33. amount = amount * this.shieldMultiplier;
  34. const heal = { amount };
  35. target.stats.getHp({
  36. heal,
  37. source: obj,
  38. target
  39. });
  40. //Only reset the first spell's cooldown if it's an auto attack and not a spell
  41. const firstSpell = target.spellbook.spells[0];
  42. const resetFirstSpell = (
  43. firstSpell &&
  44. firstSpell.isAttack &&
  45. firstSpell.auto
  46. );
  47. if (resetFirstSpell)
  48. target.spellbook.spells[0].cd = 0;
  49. target.effects.addEffect({
  50. type: 'frenzy',
  51. ttl: this.frenzyDuration,
  52. newCd: target.player ? 2 : 0
  53. });
  54. }
  55. };