Fear3d

LeaderNoBattle

Jul 3rd, 2022 (edited)
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Change the return value to be however many maximum battle members you want
  2. Game_Party.prototype.maxBattleMembers = function() {
  3.     return 4;
  4. };
  5.  
  6. Game_Party.prototype.allBattleMembers = function() {
  7.     return this.allMembers().slice(1, this.maxBattleMembers() + 1);
  8. };
  9.  
  10. Game_Party.prototype.leader = function() {
  11.     return this.allMembers()[0];
  12. };
  13.  
  14. Game_Followers.prototype.setup = function() {
  15.     this._data = [];
  16.     for (let i = 0; i < $gameParty.maxBattleMembers(); i++) {
  17.         this._data.push(new Game_Follower(i));
  18.     }
  19. };
  20.  
  21. Window_MenuStatus.prototype.drawItemImage = function(index) {
  22.     const actor = this.actor(index);
  23.     const rect = this.itemRect(index);
  24.     const width = ImageManager.faceWidth;
  25.     const height = rect.height - 2;
  26.     this.changePaintOpacity(actor.isBattleMember() || actor == $gameParty.leader());
  27.     this.drawActorFace(actor, rect.x + 1, rect.y + 1, width, height);
  28.     this.changePaintOpacity(true);
  29. };
  30.  
  31. Window_MenuStatus.prototype.actor = function(index) {
  32.     return $gameParty.members()[index + 1];
  33. };
  34.  
  35. Window_MenuStatus.prototype.maxItems = function() {
  36.     return $gameParty.size() - 1;
  37. };
  38.  
  39. Window_MenuStatus.prototype.selectLast = function() {
  40.     let index = $gameParty.menuActor().index();
  41.     if (index && index > 0) {
  42.         index--;
  43.     } else {
  44.         index = 0;
  45.     }
  46.     this.smoothSelect(index);
  47. };
  48.  
  49. Scene_Menu.prototype.onFormationOk = function() {
  50.     let index = this._statusWindow.index();
  51.     let pendingIndex = this._statusWindow.pendingIndex();
  52.     if (pendingIndex >= 0) {
  53.         $gameParty.swapOrder(index + 1, pendingIndex + 1);
  54.         this._statusWindow.setPendingIndex(-1);
  55.         this._statusWindow.redrawItem(index);
  56.     } else {
  57.         this._statusWindow.setPendingIndex(index);
  58.     }
  59.     this._statusWindow.activate();
  60. };
Add Comment
Please, Sign In to add comment