/*:----------------------------------------------------------------------------------- * NUUN_AddStateRateBoost.js * * Copyright (C) 2022 NUUN * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php * ------------------------------------------------------------------------------------- */ /*: @target MZ @url https://github.com/nuun888/MZ @plugindesc State grant rate increase/decrease characteristics @author NUUN @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/NUUN-MZ-plugins ). Original plugin by NUUN. Please check the latest official version at: https://github.com/nuun888/MZ ----- You can set a feature to increase or decrease the state addition rate. Feature-related memo field When this feature is present, the state addition rate increases or decreases by [rate]%. When this feature is present and the state [stateId] is added, the addition rate increases or decreases by [rate]%. [rate]: Probability (percentage). Multiple states are added together. [stateId]: State ID Update History 2022/1/16 Ver. 1.0.0 First Edition */ /*:ja @target MZ @plugindesc ステート付与率増減特徴 @author NUUN @version 1.0.0 @help ステート付加率を増減する特徴を設定できます。 特徴を持つメモ欄 この特徴を持つ場合、ステートの付与率が[rate]%増減します。 この特徴を持ち[stateId]のステートが付加されるとき、付与率が[rate]%増減します。 [rate]:確率(百分率) 複数存在する場合は加算されます。 [stateId]:ステートID 更新履歴 2022/1/16 Ver.1.0.0 初版 */ var Imported = Imported || {}; Imported.NUUN_AddStateRateBoost = true; (() => { const parameters = PluginManager.parameters('NUUN_AddStateRateBoost'); Game_BattlerBase.prototype.getAddStateRate = function(stateId) { return this.traitObjects().reduce((r, trait) => { const tag = 'AddStateRate' + stateId; let rate = 0.0; if (trait.meta[tag]) { rate += Number(trait.meta[tag]) / 100; } if (trait.meta.AddStateRate) { rate += Number(trait.meta.AddStateRate) / 100; } return rate > 0 ? r + rate : r; }, 1.0); }; const _Game_BattlerBase_attackStatesRate = Game_BattlerBase.prototype.attackStatesRate; Game_BattlerBase.prototype.attackStatesRate = function(stateId) { return _Game_BattlerBase_attackStatesRate.call(this, stateId) * this.getAddStateRate(stateId); }; const _Game_Action_itemEffectAddNormalState = Game_Action.prototype.itemEffectAddNormalState; Game_Action.prototype.itemEffectAddNormalState = function(target, effect) { const orgChance = effect.value1; effect.value1 *= this.subject().getAddStateRate(effect.dataId); _Game_Action_itemEffectAddNormalState.call(this, target, effect); effect.value1 = orgChance; }; })();