Skip to content

Instantly share code, notes, and snippets.

@stevenwithaph
Last active March 31, 2021 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenwithaph/372cd5f9679b55fbdf6f638853928ce6 to your computer and use it in GitHub Desktop.
Save stevenwithaph/372cd5f9679b55fbdf6f638853928ce6 to your computer and use it in GitHub Desktop.
First member of the party only shows on map
/*:
* @target MZ
* @plugindesc Custom Hero
* @author Steven
*
* @help Custom Hero.js
*
*
*/
Game_Party.prototype.battleMembers = function() {
return this.allMembers()
.slice(0, this.maxBattleMembers())
.filter(actor => actor.isAppeared());
};
Game_Party.prototype.allMembers = function() {
return this._actors.slice(1, this._actors.length-1).map(id => $gameActors.actor(id));
};
Game_Party.prototype.leader = function() {
return this._actors.map(id => $gameActors.actor(id))[0];
};
Game_Party.prototype.swapOrder = function(index1, index2) {
index1++;
index2++;
const temp = this._actors[index1];
this._actors[index1] = this._actors[index2];
this._actors[index2] = temp;
$gamePlayer.refresh();
};
Game_Followers.prototype.setup = function() {
this._data = [];
for (let i = 0; i < $gameParty.maxBattleMembers(); i++) {
this._data.push(new Game_Follower(i));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment