lewd-hypnosis-city-hypnosm/js/plugins/HiddenSkillsCannotUse.js
2026-04-28 07:32:15 -05:00

80 lines
3.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//=============================================================================
// HiddenSkillsCannotUse.js
// ----------------------------------------------------------------------------
// (C)2016 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.3.0 2022/10/02 MZで動作するよう修正
// 1.2.0 2022/10/01 コスト不足無視できるフラグを追加
// 1.0.0 2016/06/16 初版
// ----------------------------------------------------------------------------
// [Blog] : https://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================
/*:
* @plugindesc 使用不可スキルの非表示
* @author トリアコンタン
* @target MZ
* @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/HiddenSkillsCannotUse.js
* @base PluginCommonBase
* @orderAfter PluginCommonBase
* @author トリアコンタン
*
* @param ignoreCost
* @text コスト不足は無視
* @desc コスト不足によって使用できないスキルは本プラグインの対象外(非表示にならない)とします。
* @default false
* @type boolean
*
* @help 戦闘画面のスキル選択ウィンドウにおいて
* 使用できないスキルを非表示にします。
* メニュー画面では通常通り表示されます。
*
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
* 作者に無断で改変、再配布が可能で、利用形態商用、18禁利用等
* についても制限はありません。
* このプラグインはもうあなたのものです。
*/
(()=> {
'use strict';
const script = document.currentScript;
const param = PluginManagerEx.createParameter(script);
//=============================================================================
// Window_BattleSkill
// 使用できないスキルを非表示にします。
//=============================================================================
Window_BattleSkill.prototype.includes = function(item) {
if (param.ignoreCost) {
this._actor.ignoreCost();
}
return Window_SkillList.prototype.includes.call(this, item) && this._actor.canUse(item);
};
//=============================================================================
// Game_BattlerBase
// コスト不足無視できるフラグを追加
//=============================================================================
const _Game_BattlerBase_canPaySkillCost = Game_BattlerBase.prototype.canPaySkillCost;
Game_BattlerBase.prototype.canPaySkillCost = function(skill) {
const result = _Game_BattlerBase_canPaySkillCost.apply(this, arguments);
if (this._ignoreCost) {
this._ignoreCost = false;
return true;
} else {
return result;
}
};
Game_BattlerBase.prototype.ignoreCost = function() {
this._ignoreCost = true;
};
})();