Thanks!
I was wondering why the Window_Gold glass used DrawTextEx over DrawText and this a lot of sense!
Thanks!
// add command to actor command window
//
const _Scene_Battle_createActorCommandWindow =
Scene_Battle.prototype.createActorCommandWindow;
Scene_Battle.prototype.createActorCommandWindow = function() {
_Scene_Battle_createActorCommandWindow.call(this);
this._actorCommandWindow.setHandler('equip', this.commandEquip.bind(this));
};
const _Window_ActorCommand_makeCommandList =
Window_ActorCommand.prototype.makeCommandList;
Window_ActorCommand.prototype.makeCommandList = function() {
_Window_ActorCommand_makeCommandList.call(this);
if (this._actor) {
this.addEquipCommand();
}
};
Window_ActorCommand.prototype.addEquipCommand = function() {
this.addCommand(commandName, 'equip');
};
//
const _Window_ActorCommand_makeCommandList =
Window_ActorCommand.prototype.makeCommandList;
Window_ActorCommand.prototype.makeCommandList = function() {
_Window_ActorCommand_makeCommandList.call(this);
if (this._actor) {
this.addCommand(commandName, 'equip');
}
};
Thanks for the reply; Replacing the bit of code in the script I listed with your suggestion indeed doesn't break it and it still works (so all actors are able to use the equip command in battle, as the original code allows), but still seem to be struggling to figure out a way to get it to do it only when certain conditions are met.
_Window_ActorCommand_makeCommandList =
Window_ActorCommand.prototype.makeCommandList;
Window_ActorCommand.prototype.makeCommandList = function() {
_Window_ActorCommand_makeCommandList.call(this);
if (this._actor) {
if (this._actor._states.length > 0) this.addCommand(commandName, 'equip'); // checking if actor has any state
if (this._actor.isStateAffected(x)) this.addCommand(commandName, 'equip'); // checking if actor has state x
}
};
if ($gameActors.actor(2).isStateAffected(5)) this.addCommand(commandName, 'equip'); // checking if actor 2 is poisoned
};
const _Window_ActorCommand_makeCommandList =
Window_ActorCommand.prototype.makeCommandList;
Window_ActorCommand.prototype.makeCommandList = function() {
_Window_ActorCommand_makeCommandList.call(this);
if (this._actor) {
// if (this._actor._states.length > 0) this.addCommand(commandName, 'equip'); // checking if actor has any state
if (this._actor.isStateAffected(x)) this.addCommand(commandName, 'equip'); // checking if actor has state x
}
};
for (i = 0; i < $gameActors._data.length; i++) {
if ($gameActors._data[i]._states.length > 0) this.addCommand(yourCommand, 'nameCommand');
}
var anyStateActive = false;
for (i = 0; i < $gameActors._data.length; i++) {
if ($gameActors._data[i]._states.length > 0) anyStateActive = true;
}
if (anyStateActive) this.addCommand(yourCommand, 'nameCommand');
$gameVariables._data[x] = yourDecimalValue; // x being the variable id
forums.rpgmakerweb.com
I asked this question awhile back and I didn't get an answer anywhere but that doesn't matter anymore for, like a madlad, I've created the Neurotoxin state by combining Yanfly's Custom DoT and Pokemon Paralysis Tips and Tricks with the use of If-Else statement. Just gonna leave the state here for everyone else to see.
Original thread: https://forums.rpgmakerweb.com/threads/javascript-questions-that-dont-deserve-their-own-thread.46341/