Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

63 rader
1.2 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. const damage = { amount };
  27. obj.stats.takeDamage(damage, 0, obj);
  28. amount = amount * this.shieldMultiplier;
  29. const heal = { amount };
  30. target.stats.getHp(heal, obj);
  31. //Only reset the first spell's cooldown if it's an auto attack and not a spell
  32. const firstSpell = target.spellbook.spells[0];
  33. const resetFirstSpell = (
  34. firstSpell &&
  35. firstSpell.isAttack &&
  36. firstSpell.auto
  37. );
  38. if (resetFirstSpell)
  39. target.spellbook.spells[0].cd = 0;
  40. target.effects.addEffect({
  41. type: 'frenzy',
  42. ttl: this.frenzyDuration,
  43. newCd: target.player ? 2 : 0
  44. });
  45. }
  46. };