Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- /*:
- * @plugindesc v1.00 (Requires YEP_EquipBattleSkills.js and YEP_X_EquipSkillTiers ) An Extenstion to Yanfly Equip Battle Skills Plugin
- * @author Zarsla
- *
- * @param Minimum Tier 1
- * @type number
- * @min 0
- * @desc The number of skills that must be equipped for Tier 1
- * @default 0
- *
- * @param Minimum Tier 2
- * @type number
- * @min 0
- * @desc The number of skills that must be equipped for Tier 2
- * @default 0
- *
- * @param Minimum Tier 3
- * @type number
- * @min 0
- * @desc The number of skills that must be equipped for Tier 3
- * @default 0
- *
- * @param Minimum Tier 4
- * @type number
- * @min 0
- * @desc The number of skills that must be equipped for Tier 4
- * @default 0
- *
- * @param Minimum Tier 5
- * @type number
- * @min 0
- * @desc The number of skills that must be equipped for Tier 5
- * @default 0
- *
- * @param Minimum Tier 6
- * @type number
- * @min 0
- * @desc The number of skills that must be equipped for Tier 6
- * @default 0
- *
- *
- * @help
- * ============================================================================
- * Introduction
- * ============================================================================
- *
- * This plugin requires YEP_EquipBattleSkills. Make sure this plugin is located
- * under YEP_EquipBattleSkills in the plugin list.
- *
- * This plugin adds Optional Extenstions to Yanfly Equip Battle Skills &
- * Yanfly Equip Battle Skills Tiers
- *
- * Minimum Tier X:
- * Where Tier X has a minimum number of skills that must be equipped.
- * If it's set to 0, then there is no minimum requirement however if it is more
- * 0, that will be the number of skills that must be equipped
- * This Requires YEP_X_EquipSkillTiers
- *
- *
- *
- * Script Calls:
- * replace "actor" with:
- * $gameActors.actor(z) where z is the actor id.
- * $gameParty.members()[y-1] where y is the postion the member is.
- *
- *
- *
- * actor.isSkillEquipped(y)
- * Checks if actor has skill y equipped returns true or false
- *
- * actor.isNotSkillEquipped(y)
- * Checks if actor does not has skill y equipped returns true or false
- *
- *
- * $gameParty.alterMaxTier(x, y)
- * Increase or Decrease the maximum amount of skills that can be be equipped for each tier.
- * Where x is the tier id and y is the amount you want to add or subtract to
- * maximum amount
- * Note the maximum can't go over the maximum number of skills that can be equipped.
- * This Requires YEP_X_EquipSkillTiers
- * Examples:
- * $gameParty.alterMaxTier(1, 2) increases the maximum amount of tier 1 skills that can
- * be equipped by 2.
- * $gameParty.alterMaxTier(3, -2) decreases the maximum amount of tier 3 skills that can
- * be equipped by 2.
- *
- *
- *
- * $gameParty.setMaxTier(x, y)
- * Sets the maximum amount of Tier x slots.
- * For example if the hardcode limit is 10 for tier 1.
- * Use this to set it to 12 or 8.
- * This Requires YEP_X_EquipSkillTiers
- * Examples:
- * $gameParty.setMaxTier(3, 12) sets the maximum amount of skills that can be equipped for Tier 3 to 12.
- * $gameParty.setMaxTier(6, 8) sets the maximum amount of skills that can be equipped for Tier 6 to 8.
- *
- *
- * $gameParty.alterMinTier(x, y)
- * Increase or Decrease the minimum amount of skills that must be equipped for each tier.
- * Where x is the tier id and y is the amount you want to add or subtract to
- * minimum amount
- * Note the minimum can't go over the maximum number of skills that can be equipped.
- * This Requires YEP_X_EquipSkillTiers
- * Examples:
- * $gameParty.alterMinTier(1, 2) increases the minimum amount of tier 1 skills that must
- * be equipped by 2.
- * $gameParty.alterMinTier(3, -2) decreases the minimum amount of tier 3 skills that must
- * be equipped by 2.
- *
- * $gameParty.setMinTier(x, y)
- * Sets the minimum amount of Tier x slots.
- * For example if the hardcode minimum limit is 1 for tier 1.
- * Use this to set it to 0 or 2.
- * This Requires YEP_X_EquipSkillTiers
- * Examples:
- * $gameParty.setMinTier(3, 0) sets the minimum amount of skills that must be equipped for Tier 3 to 0.
- * $gameParty.setMinTier(6, 3) sets the minimum amount of skills that must be equipped for Tier 6 to 3.
- *
- *
- * $gameParty.alterMaxSlots(y)
- * Increase or Decrease the maximum amount of skill slots, of the hardcoded limit.
- * For example if the hardcode limit is 10. Use this to increase it to 12. Or decrease
- * it for 8. Note this is for the entire party not just a single actor.
- * Examples:
- * $gameParty.alterMaxSlots(2) increases the max amount of skills by 2.
- * $gameParty.alterMaxSlots(-2) decreases the max amount of skills by 2.
- *
- *
- * $gameParty.setMaxSlots(y)
- * Sets the maximum amount of skill slots, of the hardcoded limit.
- * For example if the hardcode limit is 10. Use this to set it to 12 or 8.
- * Examples:
- * $gameParty.setMaxSlots(12) sets the max amount of skills to 12.
- * $gameParty.setMaxSlots(8) sets the max amount of skills to 8
- *
- * ============================================================================
- * Changelog
- * ============================================================================
- *
- * Version 1.00:
- * - Finished Plugin!
- */
- //=============================================================================
- var parametersPlugin = PluginManager.parameters('ZE_YEP_EBS');
- Game_Actor.prototype.isSkillEquipped = function(skillId) {
- return this.battleSkills().contains($dataSkills[skillId]);
- };
- Game_Actor.prototype.isNotSkillEquipped = function(skillId) {
- return !this.battleSkills().contains($dataSkills[skillId]);
- };
- Game_Party.prototype.alterMaxSlots = function(amount) {
- var amount = Number(amount);
- amount = amount.clamp(1, amount);
- Yanfly.Param.EBSMaxSlots = Yanfly.Param.EBSMaxSlots.clamp(1, Yanfly.Param.EBSMaxSlots);
- Yanfly.Param.EBSMaxSlots += amount;
- Yanfly.Param.EBSMaxSlots = Yanfly.Param.EBSMaxSlots.clamp(1, Yanfly.Param.EBSMaxSlots);
- };
- Game_Party.prototype.setMaxSlots = function(amount) {
- var amount = Number(amount);
- amount = amount.clamp(1, amount);
- if(Yanfly.Param.EBSMaxSlots > amount){
- var diff = Yanfly.Param.EBSMaxSlots - amount;
- $gameParty.alterMaxSlots(-diff);
- } else if(Yanfly.Param.EBSMaxSlots < amount){
- var diff = amount - Yanfly.Param.EBSMaxSlots;
- $gameParty.alterMaxSlots(diff);
- }
- };
- if (Imported.YEP_X_EquipSkillTiers) {
- var TierMinimum = [];
- for (i = 1; i <= 6; ++i) {
- var line = "Number(parametersPlugin['Minimum Tier " + i + "'])";
- TierMinimum[i] = eval(line);
- TierMinimum[i] = TierMinimum[i].clamp(0, TierMinimum[i]);
- }
- Game_Party.prototype.alterMinTier = function(tier, amount) {
- var tier = tier.clamp(1, tier);
- var amount = Number(amount);
- TierMinimum[tier] += amount;
- TierMinimum[tier] = TierMinimum[tier].clamp(0, TierMinimum[tier]);
- };
- Game_Party.prototype.setMinTier = function(tier, amount) {
- var tier = tier.clamp(1, tier);
- var amount = Number(amount);
- if(TierMinimum[tier] > amount){
- var diffe = TierMinimum[tier];
- diffe -= amount;
- $gameParty.alterMinTier(tier, -diffe);
- } else if(TierMinimum[tier] < amount){
- var diffe = amount;
- diffe -= TierMinimum[tier];
- $gameParty.alterMinTier(tier, diffe);
- }
- };
- Game_Party.prototype.alterMaxTier = function(tier, amount) {
- var tier = tier.clamp(1, tier);
- var amount = Number(amount);
- Yanfly.Param.ESTierMaximum[tier] += amount;
- Yanfly.Param.ESTierMaximum[tier] = Yanfly.Param.ESTierMaximum[tier].clamp(1, Yanfly.Param.ESTierMaximum[tier]);
- };
- Game_Party.prototype.setMaxTier = function(tier, amount) {
- var tier = tier.clamp(1, tier);
- var amount = Number(amount);
- if(TierMinimum[tier] > amount){
- var differs = TierMinimum[tier];
- differs -= amount;
- $gameParty.alterMaxTier(tier, -diffe);
- } else if(TierMinimum[tier] < amount){
- var differs = amount;
- differs -= TierMinimum[tier];
- $gameParty.alterMaxTier(tier, differs);
- }
- };
- Window_SkillEquipStatus.prototype.drawTierInfo = function(tier, dx, dy, dw) {
- var icon = Yanfly.Icon.ESTier[tier];
- var name = Yanfly.Param.ESTierName[tier];
- var ibw = Window_Base._iconWidth + 4;
- this.resetTextColor();
- this.drawIcon(icon, dx + 2, dy + 2);
- this.drawText(name, dx + ibw, dy, dw - ibw);
- var cur = this._actor.getEquipSkillTierCount(tier);
- var max = this._actor.getEquipSkillTierMax(tier);
- var text = cur + '/' + max;
- if (cur > max) {
- this.changeTextColor(this.powerDownColor());
- } else if (cur < TierMinimum[tier] && TierMinimum[tier] > 0) {
- this.changeTextColor(this.powerDownColor());
- } else if (cur === max) {
- this.changeTextColor(this.crisisColor());
- } else {
- this.changeTextColor(this.normalColor());
- }
- this.drawText(text, dx + ibw, dy, dw - ibw, 'right');
- };
- Game_Actor.prototype.equipSkillTiersOk = function() {
- var tiers = $gameSystem.usedSkillTiers();
- for (var i = 0; i < tiers.length; ++i) {
- var tier = tiers[i];
- var cur = this.getEquipSkillTierCount(tier);
- var max = this.getEquipSkillTierMax(tier);
- if (cur > max) return false;
- if (cur < TierMinimum[tier] && TierMinimum[tier] > 0) return false;
- }
- return true;
- };
- }
Add Comment
Please, Sign In to add comment