Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- * @plugindesc Adds <BloodMagic>.
- * @author SKOOOOOTTT
- *
- * @param AnimationID
- * @desc The animation to be played when a Blood magic skill is used
- */
- var parameters = PluginManager.parameters('BloodMagic');
- var animationID = Number(parameters['AnimationID'] || 0);
- Game_BattlerBase.prototype.paySkillCost = function (skill) {
- var bloodMagicItems = [];
- if (this.isActor()) {
- bloodMagicItems = this.equips().filter(function (equip) {
- if (!equip) { return; }
- return equip.note.indexOf('<BloodMagic>') !== -1
- });
- }
- if (bloodMagicItems.length || skill.note.indexOf('<BloodMagic>') !== -1) {
- if(animationID){ Game_Battler.prototype.startAnimation.call(this, animationID); }
- this._hp -= this.skillMpCost(skill);
- } else {
- this._mp -= this.skillMpCost(skill);
- }
- this._tp -= this.skillTpCost(skill);
- };
- Game_BattlerBase.prototype.canPaySkillCost = function (skill) {
- var bloodMagicItems = [];
- if (this.isActor()) {
- bloodMagicItems = this.equips().filter(function (equip) {
- if (!equip) { return; }
- return equip.note.indexOf('<BloodMagic>') !== -1
- });
- }
- if (bloodMagicItems.length || skill.note.indexOf('<BloodMagic>') !== -1) {
- return this._hp >= this.skillMpCost(skill);
- } else {
- return this._tp >= this.skillTpCost(skill) && this._mp >= this.skillMpCost(skill);
- }
- };
- var _Game_Battler_startAnimation = Game_Battler.prototype.startAnimation;
- Game_Battler.prototype.startAnimation = function (animationId, mirror, delay) {
- console.log('anim')
- _Game_Battler_startAnimation.call(this, animationId, mirror, delay)
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement