Advertisement
Guest User

Untitled

a guest
May 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. /*:
  2. * @plugindesc Adds <BloodMagic>.
  3. * @author SKOOOOOTTT
  4. *
  5. * @param AnimationID
  6. * @desc The animation to be played when a Blood magic skill is used
  7. */
  8.  
  9.  
  10. var parameters = PluginManager.parameters('BloodMagic');
  11. var animationID = Number(parameters['AnimationID'] || 0);
  12.  
  13. Game_BattlerBase.prototype.paySkillCost = function (skill) {
  14. var bloodMagicItems = [];
  15. if (this.isActor()) {
  16. bloodMagicItems = this.equips().filter(function (equip) {
  17. if (!equip) { return; }
  18. return equip.note.indexOf('<BloodMagic>') !== -1
  19. });
  20. }
  21.  
  22. if (bloodMagicItems.length || skill.note.indexOf('<BloodMagic>') !== -1) {
  23.  
  24. if(animationID){ Game_Battler.prototype.startAnimation.call(this, animationID); }
  25.  
  26. this._hp -= this.skillMpCost(skill);
  27. } else {
  28. this._mp -= this.skillMpCost(skill);
  29. }
  30. this._tp -= this.skillTpCost(skill);
  31. };
  32.  
  33. Game_BattlerBase.prototype.canPaySkillCost = function (skill) {
  34. var bloodMagicItems = [];
  35. if (this.isActor()) {
  36. bloodMagicItems = this.equips().filter(function (equip) {
  37. if (!equip) { return; }
  38. return equip.note.indexOf('<BloodMagic>') !== -1
  39. });
  40. }
  41.  
  42. if (bloodMagicItems.length || skill.note.indexOf('<BloodMagic>') !== -1) {
  43. return this._hp >= this.skillMpCost(skill);
  44. } else {
  45. return this._tp >= this.skillTpCost(skill) && this._mp >= this.skillMpCost(skill);
  46. }
  47. };
  48.  
  49. var _Game_Battler_startAnimation = Game_Battler.prototype.startAnimation;
  50.  
  51. Game_Battler.prototype.startAnimation = function (animationId, mirror, delay) {
  52. console.log('anim')
  53. _Game_Battler_startAnimation.call(this, animationId, mirror, delay)
  54. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement