23 lines
842 B
JavaScript
23 lines
842 B
JavaScript
/*:
|
|
* @target MZ MV
|
|
* @plugindesc アイテム・武器・防具を入手した際、自動的に所持数を最大値(99個)にします。
|
|
* @author GameLauncher
|
|
*
|
|
* @help
|
|
* 宝箱、ドロップ、購入、イベント等でアイテムを入手(増加)した際に、
|
|
* 自動的にその所持数を最大値(99個)にします。
|
|
* ※消費や売却には影響しません。
|
|
*/
|
|
(() => {
|
|
'use strict';
|
|
const _Game_Party_gainItem = Game_Party.prototype.gainItem;
|
|
Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
|
|
if (amount > 0 && item) {
|
|
const max = this.maxItems(item);
|
|
const current = this.numItems(item);
|
|
amount = Math.max(0, max - current);
|
|
}
|
|
_Game_Party_gainItem.call(this, item, amount, includeEquip);
|
|
};
|
|
})();
|