Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created November 9, 2021 23:44
Show Gist options
  • Save triacontane/9bf0975409c928f2a44725866bc575cb to your computer and use it in GitHub Desktop.
Save triacontane/9bf0975409c928f2a44725866bc575cb to your computer and use it in GitHub Desktop.
装備品を解除させられたアクターのIDを保持
/*:
* @plugindesc 装備品を解除させられたアクターのIDを保持
* @target MZ
*/
(()=> {
const variableId = 1;
const _Game_Actor_discardEquip = Game_Actor.prototype.discardEquip;
Game_Actor.prototype.discardEquip = function(item) {
_Game_Actor_discardEquip.apply(this, arguments);
$gameVariables.setValue(variableId, this.actorId());
};
})();
@triacontane
Copy link
Author

装備品を解除させられたアクターのIDを保持します。
イベントコマンド「武器を減らす」などで「装備品を含める」で最後に装備解除したアクターのIDです。
ただし、複数のアクターの装備を解除した場合も最後に解除したアクターのIDしか保持できません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment