Advertisement
Guest User

Untitled

a guest
May 26th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. Game_BattlerBase.prototype.paySkillCost = function (skill) {
  2. var bloodMagicItems = [];
  3. if (this.isActor()) {
  4. bloodMagicItems = this.equips().filter(function (equip) {
  5. if (!equip) { return; }
  6. return equip.note.indexOf('<BloodMagic>') !== -1
  7. });
  8. }
  9.  
  10. if (bloodMagicItems.length || skill.note.indexOf('<BloodMagic>') !== -1) {
  11. this._hp -= this.skillMpCost(skill);
  12. } else {
  13. this._mp -= this.skillMpCost(skill);
  14. }
  15. this._tp -= this.skillTpCost(skill);
  16. };
  17.  
  18. Game_BattlerBase.prototype.canPaySkillCost = function (skill) {
  19. var bloodMagicItems = [];
  20. if (this.isActor()) {
  21. bloodMagicItems = this.equips().filter(function (equip) {
  22. if (!equip) { return; }
  23. return equip.note.indexOf('<BloodMagic>') !== -1
  24. });
  25. }
  26.  
  27. if (bloodMagicItems.length || skill.note.indexOf('<BloodMagic>') !== -1) {
  28. return this._hp >= this.skillMpCost(skill);
  29. } else {
  30. return this._tp >= this.skillTpCost(skill) && this._mp >= this.skillMpCost(skill);
  31. }
  32. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement