Here's the picture:
I dont want it to look like this:
I just want it to be remove completely. For example actor 2 is on battle but dont have status bar.
// InactiveBattler.js
// Created on 10/8/2018
// Last modified on 10/10/2018 by Yethwhinger
var objYeth = objYeth || {};
var Yanfly = Yanfly || false;
/*:
* @plugindesc This plugin is meant to allow an actor to
* appear in battles but not participate.
* @author Yethwhinger
*
* @help This plugin allows specified actors to appear in the
* battle scene without participating in combat. Such inactive
* battlers are specified with the note <watchBattle> in the
* Note field in the Actors section of the database. These
* inactive battlers will not be able to be healed or attacked
* during combat and will not have their status displayed
* during combat.
*/
//----------------------------
// Changes to Game_Actor
//----------------------------
objYeth.Game_Actor_setupInactBat = Game_Actor.prototype.setup;
Game_Actor.prototype.setup = function (actorId) {
var watchBattle = $dataActors[actorId].meta.watchBattle;
objYeth.Game_Actor_setupInactBat.call(this, actorId);
if (watchBattle) {
this._watchBattle = watchBattle;
}
};
Game_Actor.prototype.actingIndex = function () {
return $gameParty.actingBattleMembers().indexOf(this);
};
if (Yanfly) {
if (Yanfly.BEC) {
objYeth.Game_Actor_isSelectedInactBat = Game_Actor.prototype.isSelected;
Game_Actor.prototype.isSelected = function () {
if (this._watchBattle) {
return false;
}
else {
return objYeth.Game_Actor_isSelectedInactBat.call(this);
}
};
}
}
//--------------------------------
// Changes to Game_Party
//--------------------------------
Game_Party.prototype.actingBattleMembers = function () {
var members = this.battleMembers().slice();
var i;
var nMembers = members.length;
for (i = 0; i < nMembers; i++) {
if (members[i]._watchBattle) {
members.splice(i, 1);
i--;
nMembers--;
}
}
return members;
};
Game_Party.prototype.aliveMembers = function () {
return this.actingBattleMembers().filter(function (member) {
return member.isAlive();
});
};
Game_Party.prototype.smoothTarget = function (index) {
if (index < 0) {
index = 0;
}
var member = this.actingBattleMembers()[index];
return (member && member.isAlive()) ? member : this.aliveMembers()[0];
};
Game_Party.prototype.makeActions = function () {
this.actingBattleMembers().forEach(function (member) {
member.makeActions();
});
};
Game_Party.prototype.selectActing = function (activeMember) {
this.actingBattleMembers().forEach(function (member) {
if (member === activeMember) {
member.select();
} else {
member.deselect();
}
});
};
//--------------------------------
// Changes to Scene_Battle
//--------------------------------
Scene_Battle.prototype.startActorCommandSelection = function () {
this._statusWindow.select(BattleManager.actor().actingIndex());
this._partyCommandWindow.close();
this._actorCommandWindow.setup(BattleManager.actor());
};
//--------------------------------
// Changes to BattleManager
//--------------------------------
BattleManager.allBattleMembers = function () {
return $gameParty.actingBattleMembers().concat($gameTroop.members());
};
BattleManager.makeActionOrders = function () {
var battlers = [];
if (!this._surprise) {
battlers = battlers.concat($gameParty.actingBattleMembers());
}
if (!this._preemptive) {
battlers = battlers.concat($gameTroop.members());
}
battlers.forEach(function (battler) {
battler.makeSpeed();
});
battlers.sort(function (a, b) {
return b.speed() - a.speed();
});
this._actionBattlers = battlers;
};
BattleManager.actor = function () {
return this._actorIndex >= 0 ? $gameParty.actingBattleMembers()[this._actorIndex] : null;
};
BattleManager.selectNextCommand = function () {
var nActing = $gameParty.actingBattleMembers().length;
do {
if (!this.actor() || !this.actor().selectNextCommand()) {
this.changeActor(this._actorIndex + 1, 'waiting');
if (this._actorIndex >= nActing) {
this.startTurn();
break;
}
}
} while (!this.actor().canInput());
};
if (Yanfly) {
if (Yanfly.BEC) {
objYeth.BattleManager_startInputInactBat = BattleManager.startInput;
BattleManager.startInput = function () {
objYeth.BattleManager_startInputInactBat.call(this);
$gameParty.requestMotionRefresh();
};
}
}
//--------------------------------
// Changes to Window_BattleStatus
//--------------------------------
objYeth.Window_BattleStatus_initializeInactBat = Window_BattleStatus.prototype.initialize;
Window_BattleStatus.prototype.initialize = function () {
this.calcMaxItems();
objYeth.Window_BattleStatus_initializeInactBat.call(this);
};
Window_BattleStatus.prototype.calcMaxItems = function () {
this._maxItems = $gameParty.actingBattleMembers().length;
};
Window_BattleStatus.prototype.maxItems = function () {
return this._maxItems;
};
Window_BattleStatus.prototype.drawItem = function (index) {
var actor = $gameParty.actingBattleMembers()[index];
this.drawBasicArea(this.basicAreaRect(index), actor);
this.drawGaugeArea(this.gaugeAreaRect(index), actor);
};
Window_BattleStatus.prototype.drawAllItems = function () {
var topIndex = this.topIndex();
for (var i = 0; i < this.maxPageItems() ; i++) {
var index = topIndex + i;
if (index < this.maxItems()) {
this.drawItem(index);
}
}
};
Window_BattleStatus.prototype.updateStatusRequests = function () {
if (BattleManager._victoryPhase) return;
for (var i = 0; i < this._maxItems; ++i) {
var actor = $gameParty.actingBattleMembers()[i];
if (!actor) continue;
if (actor.isStatusRefreshRequested()) this.processStatusRefresh(i);
}
};
//--------------------------------
// Changes to Window_BattleActor
//--------------------------------
Window_BattleActor.prototype.select = function (index) {
Window_BattleStatus.prototype.select.call(this, index);
$gameParty.selectActing(this.actor());
};
Window_BattleActor.prototype.actor = function () {
return $gameParty.actingBattleMembers()[this.index()];
};
Window_BattleActor.prototype.getClickedActor = function () {
for (var i = 0; i < $gameParty.actingBattleMembers().length; ++i) {
var actor = $gameParty.actingBattleMembers().reverse()[i];
if (!actor) continue;
if (this.isClickedActor(actor)) {
if (this._selectDead && !actor.isDead()) continue;
if (this._inputLock) {
if (this.cursorAll()) {
return this.index();
}
else {
if (actor.actingIndex() !== this.index()) continue;
}
}
return actor.actingIndex();
}
}
return -1;
};
Window_BattleActor.prototype.getMouseOverActor = function () {
for (var i = 0; i < $gameParty.actingBattleMembers().length; ++i) {
var actor = $gameParty.actingBattleMembers().reverse()[i];
if (!actor) continue;
if (this.isMouseOverActor(actor)) {
if (this._selectDead && !actor.isDead()) continue;
if (this._inputLock && actor.actingIndex() !== this.index()) continue;
return actor.actingIndex();
}
}
return -1;
};
Window_BattleActor.prototype.onTouch = function (triggered) {
var lastIndex = this.index();
var x = this.canvasToLocalX(TouchInput.x);
var y = this.canvasToLocalY(TouchInput.y);
var hitIndex = this.hitTest(x, y);
if (hitIndex >= 0) {
if (this.cursorAll() || hitIndex === this.index()) {
if (triggered && this.isTouchOkEnabled()) {
this.processOk();
}
} else if (this.isCursorMovable()) {
this.select(hitIndex);
}
} else if (this._stayCount >= 10 && !this.cursorAll()) {
if (y < this.padding) {
this.cursorUp();
} else if (y >= this.height - this.padding) {
this.cursorDown();
}
}
if (this.index() !== lastIndex) {
SoundManager.playCursor();
}
};// NoBattleStat.js
// Created on 10/15/2018
var objYeth = objYeth || {};
/*:
* @plugindesc This plugin is meant to remove the battle status
* display from an auto-battle actor.
* @author Yethwhinger
*
* @help This plugin removes the battle status display for actors
* who have the Special Flag Auto Battle set. It requires the
* YEP_X_SelectionControl plugin. The auto-battling actor must have
* <Cannot Select: All> placed in the actor's Note field in the
* database.
*/
//----------------------------
// Changes to Game_Actor
//----------------------------
Game_Actor.prototype.userConIndex = function () {
return $gameParty.userBattleMembers().indexOf(this);
};
//--------------------------------
// Changes to Game_Party
//--------------------------------
Game_Party.prototype.userBattleMembers = function () {
var members = this.battleMembers().slice();
var i;
var nMembers = members.length;
for (i = 0; i < nMembers; i++) {
if (members[i].isAutoBattle()) {
members.splice(i, 1);
i--;
nMembers--;
}
}
return members;
};
Game_Party.prototype.selectUserCon = function (userMember) {
this.userBattleMembers().forEach(function (member) {
if (member === userMember) {
member.select();
} else {
member.deselect();
}
});
};
//--------------------------------
// Changes to Scene_Battle
//--------------------------------
Scene_Battle.prototype.startActorCommandSelection = function () {
this._statusWindow.select(BattleManager.actor().userConIndex());
this._partyCommandWindow.close();
this._actorCommandWindow.setup(BattleManager.actor());
};
//--------------------------------
// Changes to Window_BattleStatus
//--------------------------------
objYeth.Window_BattleStatus_initializeNoBatStat = Window_BattleStatus.prototype.initialize;
Window_BattleStatus.prototype.initialize = function () {
this.calcMaxItems();
objYeth.Window_BattleStatus_initializeNoBatStat.call(this);
};
Window_BattleStatus.prototype.calcMaxItems = function () {
this._maxItems = $gameParty.userBattleMembers().length;
};
Window_BattleStatus.prototype.maxItems = function () {
return this._maxItems;
};
Window_BattleStatus.prototype.drawItem = function (index) {
var actor = $gameParty.userBattleMembers()[index];
this.drawBasicArea(this.basicAreaRect(index), actor);
this.drawGaugeArea(this.gaugeAreaRect(index), actor);
};
Window_BattleStatus.prototype.updateStatusRequests = function () {
if (BattleManager._victoryPhase) return;
for (var i = 0; i < this._maxItems; ++i) {
var actor = $gameParty.userBattleMembers()[i];
if (!actor) continue;
if (actor.isStatusRefreshRequested()) this.processStatusRefresh(i);
}
};
Window_BattleStatus.prototype.onInactiveSelectTouch = function () {
var lastIndex = this.index();
var x = this.canvasToLocalX(TouchInput.x);
var y = this.canvasToLocalY(TouchInput.y);
var hitIndex = this.hitTest(x, y);
if (hitIndex >= 0) {
var actor = $gameParty.userBattleMembers()[hitIndex];
var win = this._enemySelectWindow;
if (actor && win) {
var winIndex = win._enemies.indexOf(actor);
if (winIndex >= 0) {
if (winIndex !== win.index()) {
win.select(winIndex);
SoundManager.playCursor();
} else {
win.processOk();
}
}
}
}
};
//--------------------------------
// Changes to Window_BattleEnemy
//--------------------------------
Window_BattleEnemy.prototype.select = function (index) {
$gameTroop.select(null);
$gameParty.select(null);
Yanfly.Sel.Window_BattleEnemy_select.call(this, index);
if (this.enemy() === 'ALL ENEMIES') {
var length = this._enemies.length;
for (var i = 0; i < length; ++i) {
var target = this._enemies[i];
if (!target) continue;
if (typeof target === 'string') continue;
if (target.isEnemy()) target.select();
}
} else if (this.enemy() === 'ALL ALLIES') {
var length = this._enemies.length;
for (var i = 0; i < length; ++i) {
var target = this._enemies[i];
if (!target) continue;
if (typeof target === 'string') continue;
if (target.isActor()) target.select();
}
} else if (this.enemy() && this.enemy().isActor()) {
$gameParty.selectUserCon(this.enemy());
this.actorWindow().select(this.enemy().userConIndex());
}
};