/*: * @plugindesc Make skill cost gold. V 1.2 * Read Help * @author mrcopra * * * @param CostGoldColour * @desc Change The cost colour * @default 17 * * @help Write this in skill's note * // x is the amount of gold */ var parameters = PluginManager.parameters('SkillCostGold'); var CostGoldColour = Number(parameters['CostGoldColour'] || 17); Game_BattlerBase.prototype.canPaySkillCost = function(skill) { //console.log(Number(skill.meta.costGold)) if (skill.meta.costGold){ return $gameParty.gold() >= this.skillGdCost(skill)}else{ return this._tp >= this.skillTpCost(skill) && this._mp >= this.skillMpCost(skill)}; }; Window_Base.prototype.gdCostColor = function() { return this.textColor(CostGoldColour); }; Window_SkillList.prototype.drawSkillCost = function(skill, x, y, width) { if (this._actor.skillGdCost(skill) > 0) { this.changeTextColor(this.gdCostColor()); this.drawText(this._actor.skillGdCost(skill), x, y, width, 'right'); } else if (this._actor.skillTpCost(skill) > 0) { this.changeTextColor(this.tpCostColor()); this.drawText(this._actor.skillTpCost(skill), x, y, width, 'right'); } else if (this._actor.skillMpCost(skill) > 0) { this.changeTextColor(this.mpCostColor()); this.drawText(this._actor.skillMpCost(skill), x, y, width, 'right'); } }; Game_BattlerBase.prototype.skillMpCost = function(skill) { if (skill.meta.costGold){ return Number(skill.meta.costGold); } return Math.floor(skill.mpCost * this.mcr); }; Game_BattlerBase.prototype.skillTpCost = function(skill) { if (skill.meta.costGold){ return Number(skill.meta.costGold); }else{ return skill.tpCost}; }; Game_BattlerBase.prototype.skillGdCost = function(skill) { return Number(skill.meta.costGold); }; Game_BattlerBase.prototype.paySkillCost = function(skill) { this._mp -= this.skillMpCost(skill); this._tp -= this.skillTpCost(skill); if (skill.meta.costGold){ console.log(this.skillGdCost(skill)); $gameParty.loseGold(this.skillGdCost(skill))} ; }; Game_BattlerBase.prototype.meetsSkillConditions = function(skill) { return (this.meetsUsableItemConditions(skill) && this.isSkillWtypeOk(skill) && this.canPaySkillCost(skill) && !this.isSkillSealed(skill.id) && !this.isSkillTypeSealed(skill.stypeId)); };