I would like something special to happen whenever actor 1 uses an item on himself in battle.
I was looking at this function in Yanfly's Battle Engine core:
BattleManager.startAction = function() {
var subject = this._subject;
if (!subject) return this.endAction();
var action = subject.currentAction();
this._action = action;
if (!this._action) return this.endAction();
if (!this._action.item()) return this.endAction();
var targets = action.makeTargets();
this.setTargets(targets);
this._allTargets = targets.slice();
this._individualTargets = targets.slice();
this._phase = 'phaseChange';
this._phaseSteps = ['setup', 'whole', 'target', 'follow', 'finish'];
this._returnPhase = '';
this._actionList = [];
subject.useItem(this._action.item());
this._action.applyGlobal();
this._logWindow.startAction(this._subject, this._action, this._targets);
};
And there we have for example targets.slice(), but when I ask if it equals 1, it says "object object".
So, is there a way to check which actor was selected for item use in battle?
I was looking at this function in Yanfly's Battle Engine core:
BattleManager.startAction = function() {
var subject = this._subject;
if (!subject) return this.endAction();
var action = subject.currentAction();
this._action = action;
if (!this._action) return this.endAction();
if (!this._action.item()) return this.endAction();
var targets = action.makeTargets();
this.setTargets(targets);
this._allTargets = targets.slice();
this._individualTargets = targets.slice();
this._phase = 'phaseChange';
this._phaseSteps = ['setup', 'whole', 'target', 'follow', 'finish'];
this._returnPhase = '';
this._actionList = [];
subject.useItem(this._action.item());
this._action.applyGlobal();
this._logWindow.startAction(this._subject, this._action, this._targets);
};
And there we have for example targets.slice(), but when I ask if it equals 1, it says "object object".
So, is there a way to check which actor was selected for item use in battle?