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.
 
 
 

49 lines
776 B

  1. define([
  2. ], function(
  3. ) {
  4. return {
  5. type: 'bloodBarrier',
  6. cdMax: 7,
  7. manaCost: 0,
  8. range: 9,
  9. speed: 150,
  10. damage: 1,
  11. row: 3,
  12. col: 0,
  13. needLos: true,
  14. cast: function(action) {
  15. var obj = this.obj;
  16. var target = action.target;
  17. this.sendBump(target);
  18. this.queueCallback(this.explode.bind(this, target), 1, null, target);
  19. return true;
  20. },
  21. explode: function(target) {
  22. if ((this.obj.destroyed) || (target.destroyed))
  23. return;
  24. var amount = this.obj.stats.values.hpMax / 100 * this.drainPercentage;
  25. var damage = {
  26. amount: amount
  27. };
  28. this.obj.stats.takeDamage(damage, 0, this.obj);
  29. amount = amount * this.shieldMultiplier;
  30. var heal = {
  31. amount: amount
  32. };
  33. target.stats.getHp(heal, this.obj);
  34. }
  35. };
  36. });