With a default project, this plugin should ensure that, when selecting items in combat, they are only enabled for selection for certain actors if there's a note tag indicating so:
Code:
/*:
* @plugindesc Allows the user to tag items as usable only by a specific actor.
* @author Zevia
*
* @help In the note box of an item, add <actorRestricted: x> where x is the Id
* of the actor that's allowed to use the item.
* Additional actors can be specified with comma separation. For example,
* <actorRestricted: 1, 4> would mean only actors 1 and 4 can use the item.
* If an actor cannot use the item, it will be greyed out in the item menu.
*/
(function(module) {
'use strict';
var Zevia = module.Zevia || {};
Zevia.isItemEnabled = Window_ItemList.prototype.isEnabled;
Window_ItemList.prototype.isEnabled = function(item) {
return Zevia.isItemEnabled.call(this, item) &&
(
!item.meta ||
!item.meta.actorRestricted ||
!BattleManager.actor() ||
item.meta.actorRestricted.split(',').map(function(actorId) {
return parseInt(actorId.replace(/\s+/, ''));
}).indexOf(BattleManager.actor().actorId()) !== -1
);
};
})(window);
Just go to an item's definition in the database and add in the notebox "<actorRestricted: x>" or "<actorRestricted: x, y, z>", where x, y, and z are the Ids of actors you want to restrict the item to.
If the actorRestricted tag is not in the note box, then it's assumed the item should behave as usual.
Won't have any effect on item selection and usage out of combat.
May have compatibility issues with Plugins that significantly change how combat works, specifically where the current character selecting an action is no longer represented by the BattleManager.actor() method.
Example images: