查看: 13111|回复: 9

[已经解决] 请教关于MV人物加入队伍和参战人数问题

[复制链接]
梦石
0
星屑
1184
在线时间
20 小时
注册时间
2015-12-31
回帖
12
发表于 2016-8-26 16:02:05 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
各位大神们好,我刚刚接触RMMV,想要自己动手制作一个简单的RPG游戏,现在正在编写剧本中,由于刚刚接触,有很多不懂得地方,有些问题我通过搜索帖子找到了解决的方法,但是有些问题我还是不懂该怎么处理,虽然我提的问题可能有点白痴,但是请原谅一下我这个菜鸟吧?由于我不清楚MV中人物加入队伍是否限制在最多四人,所以在编写剧本上遇到了一些困难。我的问题如下:
游戏中最多可以有所少人加入队伍呢?
战斗中是不是最多只能有四人参战呢?
是否可以有四人以上加入队伍,然后参战人数只能最多四人呢?
希望大神们能够答疑解惑,我在这里先谢谢大家了!
梦石
0
星屑
1184
在线时间
20 小时
注册时间
2015-12-31
回帖
12
 楼主| 发表于 2016-8-26 16:20:26 | 显示全部楼层
我的构想是这样的,通过一个事件可以得到道具,然后在之后的战斗中通过使用该道具可以在队伍中出现一个队友参加战斗,不知道这种想法能不能实现
回复

使用道具 举报

梦石
0
星屑
311
在线时间
204 小时
注册时间
2007-2-4
回帖
1772
发表于 2016-8-26 19:16:06 | 显示全部楼层
1)队伍可加入人数一定大于4个,具体上限是多少忘了,但十几个是肯定可以的。
2)默认是4人参战,但是通过插件可以实现4人以上同场战斗。善用搜索,应该有人发过类似的插件。
3)默认战斗系统就是无论你多少人,排在最前的4人就是参战角色。实际上还有一个战斗不能角色自动退场,后备队员自动顶上的插件,需要的话可以给你找找。
新しい誕生祝いだッ!
回复

使用道具 举报

梦石
0
星屑
311
在线时间
204 小时
注册时间
2007-2-4
回帖
1772
发表于 2016-8-26 19:19:51 | 显示全部楼层
qhsfdx 发表于 2016-8-26 16:20
我的构想是这样的,通过一个事件可以得到道具,然后在之后的战斗中通过使用该道具可以在队伍中出现一个队友 ...

是在战斗中吗?是的话默认好像办不到。因为默认在战斗中是无法控制角色的加减的(没这方面的指令)。
战斗外的话还得必须确定他排在前四位,否则只是光加入不会在战斗中出现的。
新しい誕生祝いだッ!
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-8-26 20:13:24 | 显示全部楼层
本帖最后由 tseyik 于 2016-8-26 20:20 编辑

可决定隊伍待機人員上限,戦鬥人数,戦鬥中交換……
並び替えシーン ver1.07
  1. //
  2. //  並び替えシーン ver1.07
  3. //
  4. // author yana
  5. //

  6. var Imported = Imported || {};
  7. Imported['SceneFormation'] = 1.07;

  8. /*:
  9. * @plugindesc ver1.07/並び替えシーンを追加します。
  10. * @author Yana
  11. *
  12. *
  13. * @param Stand Members Size
  14. * @desc 待機メンバーの最大数です。
  15. * 11を超えると、ウィンドウが2行になります。
  16. * @default 8
  17. *
  18. * @param Max Battle Members Size
  19. * @desc 最大戦闘メンバー人数です。
  20. * 3人以下や、5人以上にも設定できます。
  21. * @default 4
  22. *
  23. * @param Use Menu Formation Scene
  24. * @desc メニューの並び替えの項目を、並び替えシーンに
  25. * 置き換えるかどうかの設定です。true/falseで設定してください。
  26. * @default true
  27. *
  28. * @param Formation Scene Battle Name
  29. * @desc 戦闘メンバーの上に表示されるテキストです。
  30. * @default 戦闘メンバー
  31. *
  32. * @param Formation Scene Stand Name
  33. * @desc 待機メンバーの上に表示されるテキストです。
  34. * @default 待機メンバー
  35. *
  36. * @param Use Battle Formation Switch ID
  37. * @desc 戦闘時にパーティコマンドに並び替えの項目の
  38. * 追加を許可を設定するスイッチのIDです。
  39. * @default 20
  40. *
  41. * @param Battle Command Formation
  42. * @desc 戦闘時にパーティコマンドに追加される
  43. * 並び替えの項目のテキストです。
  44. * @default Formation
  45. *
  46. * @param Status Window Font Size
  47. * @desc ステータスウィンドウの文字サイズです。
  48. * @default 24
  49. *
  50. * @param Status Block Width
  51. * @desc ステータスウィンドウのパラメータ表示部の横幅です。
  52. * @default 372
  53. *
  54. * @help プラグインコマンド
  55. * ※スペースは必ず半角で入力してください。
  56. *
  57. * ・並び替えシーンを呼び出します。
  58. * 並び替えシーン 呼び出し
  59. * SceneFormation call
  60. *
  61. * ・ID番のアクターの並びを固定します。
  62. * 並び替えシーン 固定 ID
  63. * SceneFormation fixed ID
  64. *
  65. * ・ID番のアクターの並びの固定を解除します。
  66. * 並び替えシーン 固定解除 ID
  67. * SceneFormation unpin ID
  68. *
  69. * ・全アクターの並びを固定します。
  70. * 並び替えシーン 全固定
  71. * SceneFormation all_fixed
  72. *
  73. * ・ID番のアクターの並びを固定します。
  74. * 並び替えシーン 全固定解除
  75. * SceneFormation all_unpin
  76. * ------------------------------------------------------
  77. * 利用規約:特になし。素材利用は自己責任でお願いします。
  78. * ------------------------------------------------------
  79. * 更新履歴:
  80. * ver1.07:
  81. * Use Menu Formation Sceneをfalseにするとエラーが発生するバグを修正。
  82. * ver1.06:
  83. * パラメータ表示部の幅を設定する項目を追加。
  84. * 全体の文字サイズを設定する項目を追加。
  85. * ウィンドウ外の領域をクリックすることで、キャンセルとして働くように機能を追加。
  86. * このプラグインより下に入れたプラグインで右クリックが正常に動作しないことのあるバグを修正。
  87. * サイドビューで戦闘中に人数の増減を行った場合、正常に表示されないバグを修正。
  88. * ver1.05:
  89. * Window_FormationのcheckBltがloadFaceしていたバグを修正。
  90. * 待機メンバーで空白を選択した後、戦闘メンバーの最後のアクターを選択できないバグを修正。
  91. * ver1.04:
  92. * Window_FormationNameがWindow_Selectableのinitializeを呼んでいたバグを修正。
  93. * ver1.03:
  94. * 戦闘中、並び替えがアクティブでない時もクリックが可能だったバグを修正。
  95. * ver1.02:
  96. * Stand Members SizeとMax Battle Members Sizeが正常に動作していなかったバグを修正。
  97. * 空欄を選択して空欄で決定するとエラーが発生するバグを修正。
  98. * ver1.01:
  99. * addActorが正常に動作していなかったバグを修正。
  100. * ver1.00:
  101. * 公開
  102. */

  103. function Scene_Formation() {
  104.         this.initialize.apply(this, arguments);
  105. };

  106. (function() {
  107.         var parameters = PluginManager.parameters('SceneFormation');
  108.         var standMembersSize = Number(parameters['Stand Members Size'] || 11);
  109.         var maxBattleMembersSize = Number(parameters['Max Battle Members Size'] || 4);
  110.         var useMenuFormationScene = String(parameters['Use Menu Formation Scene'] || true) == 'true';
  111.         var formationSceneBattleName = String(parameters['Formation Scene Battle Name'] || '戦闘メンバー');
  112.         var formationSceneStandName = String(parameters['Formation Scene Stand Name'] || '待機メンバー');
  113.         var useBattleFormationSwitchId = String(parameters['Use Battle Formation Switch ID'] || 11);
  114.         var battleFormationText = String(parameters['Battle Command Formation'] || 'Formation');
  115.         var statusWindowFontSize = Number(parameters['Status Window Font Size'] || 24);
  116.         var statusBlockWidth = Number(parameters['Status Block Width'] || 372);
  117.        
  118.         var _Form_GInterpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  119.         Game_Interpreter.prototype.pluginCommand = function(command, args) {
  120.                 _Form_GInterpreter_pluginCommand.call(this, command, args);
  121.                 if (command === '並び替えシーン' || command === 'SceneFormation') {
  122.                         switch (args[0]) {
  123.                         case '呼び出し':
  124.                         case 'call':
  125.                                 this.callSceneFormation();
  126.                                 break;
  127.                         case '固定':
  128.                         case 'fixed':
  129.                                 $gameActors.actor(Number(args[1]))._fixed = true;
  130.                                 break;
  131.                         case '固定解除':
  132.                         case 'unpin':
  133.                                 $gameActors.actor(Number(args[1]))._fixed = false;
  134.                                 break;
  135.                         case '全固定':
  136.                         case 'all_fixed':
  137.                                 $gameParty.allMembers.forEach(function(actor){ actor._fixed = true });
  138.                                 break;
  139.                         case '全固定解除':
  140.                         case 'all_unpin':
  141.                                 $gameParty.allMembers.forEach(function(actor){ actor._fixed = false });
  142.                                 break;
  143.                         }
  144.                 }
  145.         };

  146.         Game_Interpreter.prototype.callSceneFormation = function() {
  147.                 SceneManager.push(Scene_Formation);
  148.         };

  149.         Array.prototype.minusArray = function(array) {
  150.                 var result = [];
  151.                 for (var i = 0; i < this.length; i++) {
  152.                         var flag = true;
  153.                         for (var j = 0; j < array.length; j++) {
  154.                                 if (this[i] === array[j]) {
  155.                                         flag = false;
  156.                                 }
  157.                         }
  158.                         if (flag) {
  159.                                 result.push(this[i]);
  160.                         }
  161.                 }
  162.                 return result.compact();
  163.         };

  164.         Array.prototype.compact = function() {
  165.                 var result = [];
  166.                 for (var i = 0; i < this.length; i++) {
  167.                         if (this[i] !== null && this[i] !== undefined) {
  168.                                 result.push(this[i]);
  169.                         }
  170.                 }
  171.                 return result;
  172.         };

  173.         function Window_Formation() {
  174.                 this.initialize.apply(this, arguments);
  175.         };

  176.         Window_Formation.prototype = Object.create(Window_Selectable.prototype);
  177.         Window_Formation.prototype.constructor = Window_Formation;

  178.         Window_Formation.prototype.initialize = function(type, x, y) {
  179.                 this._type = type;
  180.                 this.refreshMembers();
  181.                 var h = 60 * this.maxPageRows() + 32;
  182.                 var w = this._type == 'battle' ? 60 * $gameParty.fullMemberSize() + 24 : this.sw();
  183.                 Window_Selectable.prototype.initialize.call(this, x, y, w, h);
  184.                 this._lockIndex = null;
  185.                 this.refresh();
  186.         };

  187.         Window_Formation.prototype.sw = function() {
  188.                 var w = Graphics.boxWidth;
  189.                 var w1 = standMembersSize * 60 + this.standardPadding() * 2;
  190.                 var w2 = w - 196;
  191.                 return Math.min(w1, w2);
  192.         };

  193.         Window_Formation.prototype.standardPadding = function() {
  194.                 return 12;
  195.         };

  196.         Window_Formation.prototype.maxRows = function() {
  197.                 if (this._type === 'battle') {
  198.                         return 1
  199.                 };
  200.                 return Math.ceil(this.maxItems()/10);
  201.         };

  202.         Window_Formation.prototype.spacing = function() {
  203.                 return 0;
  204.         };

  205.         Window_Formation.prototype.contentsWidth = function() {
  206.                 return this.maxCols() * this.itemWidth();
  207.         };

  208.         Window_Formation.prototype.contentsHeight = function() {
  209.                 return Math.ceil((this.maxItems() / this.colItemNum())) * this.itemHeight();
  210.         };

  211.         Window_Formation.prototype.isTopIndex = function() {
  212.                 return this._index < this.maxCols();
  213.         };

  214.         Window_Formation.prototype.colItemNum = function() {
  215.                 return Math.floor((this.width - this.standardPadding()) / this.itemWidth());
  216.         };

  217.         Window_Formation.prototype.itemRect = function(index) {
  218.                 var rect = Window_Selectable.prototype.itemRect.call(this, index);
  219.                 rect.width = 48;
  220.                 rect.height = 48;
  221.                 rect.x = (index % this.maxCols()) * (this.itemWidth() + this.spacing());
  222.                 rect.y = 9 + (Math.floor(index / this.maxCols()) - this.topRow()) * this.itemHeight();
  223.                 return rect;
  224.         };

  225.         Window_Formation.prototype.itemWidth = function() {
  226.                 return 60;
  227.         };

  228.         Window_Formation.prototype.itemHeight = function() {
  229.                 return 66;
  230.         };

  231.         Window_Formation.prototype.maxCols = function() {
  232.                 var n = (this.width - (this.standardPadding() * 2)) / this.itemWidth();
  233.                 return Math.ceil(n);
  234.         };

  235.         Window_Formation.prototype.maxItems = function() {
  236.                 if (this._type === 'battle') {
  237.                         return Math.min(this._members.length + 1, $gameParty.fullMemberSize());
  238.                 } else {
  239.                         return this._members.length + 1;
  240.                 }
  241.         };
  242.        
  243.         Window_Formation.prototype.maxPageRows = function() {
  244.             return this._type === 'battle' ? 1 : Math.min(Math.ceil(standMembersSize / 10),2);
  245.         };
  246.        
  247.         Window_Formation.prototype.maxPageItems = function() {
  248.             return this.maxPageRows() * this.maxCols();
  249.         };

  250.         Window_Formation.prototype.select = function(index) {
  251.                 var result = Window_Selectable.prototype.select.call(this, index);
  252.                 if (this._statusWindow && this.active) {
  253.                         this._statusWindow._actor = this._members[index];
  254.                         this._statusWindow.refresh();
  255.                 }
  256.                 return result;
  257.         };

  258.         Window_Formation.prototype.processHandling = function() {
  259.                 if (this.isOpenAndActive()) {
  260.                         if (this._type === 'battle' && Input.isTriggered('shift')) {
  261.                                 this.processRelease();
  262.                         } else if (this._type === 'stand' && Input.isTriggered('shift')) {
  263.                                 this.processAdd();
  264.                         } else if (this._type === 'battle' && Input.isTriggered('down')) {
  265.                                 this.processDown();
  266.                         } else {
  267.                                 Window_Selectable.prototype.processHandling.call(this);
  268.                         }
  269.                 }
  270.         };

  271.         Window_Formation.prototype.cursorUp = function(wrap) {
  272.                 if (this._type === 'stand' && this.isTopIndex()) {
  273.                         return this.processUp();
  274.                 }
  275.                 Window_Selectable.prototype.cursorUp.call(this, wrap);
  276.         };

  277.         Window_Formation.prototype.isAliveOk = function() {
  278.                 return $gameParty.aliveBattleMembers().length > 1;
  279.         };

  280.         Window_Formation.prototype.isCurrentItemEnabled = function() {
  281.                 var sIndex = SceneManager._scene._scopeIndex;
  282.                 if (sIndex < 0 && !this.actor()) { return false }
  283.                 var fixed = (this.actor() && !this.actor().isFixed());
  284.                 var alive = (this.actor() && this.actor().isAlive());
  285.                 var flag1 = !this.actor() ? true : fixed;
  286.                 var flag2 = (this.isAliveOk() || !this.actor() || !sIndex || alive );
  287.                 var flag3 = (this.isAliveOk() || sIndex || sIndex === -1 || alive || this._type == 'battle');
  288.                 return flag1 && flag2 && flag3;
  289.         };

  290.         Window_Formation.prototype.processRelease = function() {
  291.                 if (this._members.length > 1 && this.actor() && !this.actor().isFixed() && (this.isAliveOk() || !this.actor().isAlive())) {
  292.                         SoundManager.playOk();
  293.                         this.updateInputData();
  294.                         this.callReleaseHandler();
  295.                 } else {
  296.                         SoundManager.playBuzzer();
  297.                 }
  298.         };

  299.         Window_Formation.prototype.processAdd = function() {
  300.                 var r = ($gameParty.allMembers().length - this._members.length) < $gameParty.fullMemberSize();
  301.                 if (r && this.actor() && !this.actor().isFixed()) {
  302.                         SoundManager.playOk();
  303.                         this.updateInputData();
  304.                         this.callAddHandler();
  305.                 } else {
  306.                         SoundManager.playBuzzer();
  307.                 }
  308.         };

  309.         Window_Formation.prototype.processDown = function() {
  310.                 SoundManager.playCursor();
  311.                 this.updateInputData();
  312.                 this.callHandler('down');
  313.         };

  314.         Window_Formation.prototype.processUp = function() {
  315.                 this.updateInputData();
  316.                 this.callHandler('up');
  317.         };

  318.         Window_Formation.prototype.callReleaseHandler = function() {
  319.                 this.updateInputData();
  320.                 this.callHandler('release');
  321.         };

  322.         Window_Formation.prototype.callAddHandler = function() {
  323.                 this.updateInputData();
  324.                 this.callHandler('add');
  325.         };

  326.         Window_Formation.prototype.refreshMembers = function() {
  327.                 if (this._type === 'battle') {
  328.                         this._members = this.battleMembers();
  329.                 } else if (this._type === 'stand') {
  330.                         this._members = $gameParty.allMembers().minusArray(this.battleMembers()).compact();
  331.                 }
  332.         };

  333.         Window_Formation.prototype.battleMembers = function() {
  334.                 var max = $gameParty.maxBattleMembers();
  335.                 var members = [];
  336.                 var allMembers = $gameParty.allMembers();
  337.                 allMembers.forEach(function(member) {
  338.                         if (member && (member.isAppeared() || member.isEscaped())) {
  339.                                 members.push(member);
  340.                         }
  341.                 })
  342.                 return members.slice(0, max);
  343.         };

  344.         Window_Formation.prototype.refresh = function() {
  345.                 this.refreshMembers();
  346.                 this.createContents();
  347.                 this.checkBlt();
  348.                 this._setRefresh = true;
  349.         };
  350.        
  351.         Window_Formation.prototype.refreshContents = function(){
  352.                 Window_Selectable.prototype.refresh.call(this);
  353.         };
  354.        
  355.         Window_Formation.prototype.drawItem = function(i){
  356.                 var x = this.itemWidth() * Math.floor((i % this.maxCols()));
  357.                 var y = 12 + this.itemHeight() * (Math.floor((i / this.maxCols())) - this.topRow());
  358.                 if (i == this._lockIndex) {
  359.                         this.contents.fillRect(x, y - 3, 48, 48, 'rgba(0,0,0,0.5)')
  360.                 }
  361.                 if (this._members[i]) {
  362.                         if (this._members[i].isFixed()) {
  363.                                 this.contents.fillRect(x, y - 3, 48, 48, 'rgba(128,0,0,0.5)')
  364.                         }
  365.                         this.drawActorCharacter(this._members[i], x + 24, y + 44);
  366.                 } else {
  367.                         this.drawText('-', x, y, 48, 'center');
  368.                 }
  369.         };
  370.        
  371.         Window_Formation.prototype.checkBlt = function(){
  372.                 var bitmap2 = new Bitmap(1,1);
  373.                 $gameParty.allMembers().forEach(function(actor){
  374.                         var bitmap = ImageManager.loadCharacter(actor.characterName());
  375.                         bitmap2.blt(bitmap,0,0,bitmap.width,bitmap.height,0,0);
  376.                 });
  377.                 bitmap = null;
  378.                 bitmap2 = null;
  379.         };

  380.         Window_Formation.prototype.update = function(){
  381.                 Window_Selectable.prototype.update.call(this);
  382.                 if (this._setRefresh){
  383.                         if (ImageManager.isReady()){
  384.                                 this.refreshContents();
  385.                                 this._setRefresh = false;
  386.                         }else{
  387.                                 this.checkBlt();
  388.                         }
  389.                 }
  390.         };

  391.         Window_Formation.prototype.actor = function() {
  392.                 return this._members[this._index];
  393.         };

  394.         Window_Formation.prototype.lockIndex = function() {
  395.                 this._lockIndex = this._index;
  396.                 this.refresh();
  397.         };

  398.         Window_Formation.prototype.releaseIndex = function() {
  399.                 this._lockIndex = null;
  400.                 this.refresh();
  401.         };

  402.         Window_Formation.prototype.onTouch = function(triggered) {
  403.                 if ($gameParty.inBattle() && !BattleManager._formation){ return false }
  404.                 var lastIndex = this.index();
  405.                 var x = this.canvasToLocalX(TouchInput.x);
  406.                 var y = this.canvasToLocalY(TouchInput.y);
  407.                 var hitIndex = this.hitTest(x, y);
  408.                 if (hitIndex >= 0) {
  409.                         if (this._type === 'stand' && !this.active) {
  410.                                 this.activate();
  411.                                 this.callHandler('battleOff');
  412.                         } else if (this._type === 'battle' && !this.active) {
  413.                                 this.activate();
  414.                                 this.callHandler('standOff');
  415.                         }
  416.                         this.select(hitIndex);
  417.                         if (triggered && this.isTouchOkEnabled()) {
  418.                                 this.processOk();
  419.                         }
  420.                 }
  421.         };

  422.         Window_Formation.prototype.processTouch = function() {
  423.                 if (!this.isOpen()){ return }
  424.                 if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
  425.                         this._touching = true;
  426.                         this.onTouch(true);
  427.                 } else if (TouchInput.isCancelled()) {
  428.                         if (this.isCancelEnabled()) {
  429.                                 this.processCancel();
  430.                         }
  431.                 }
  432.                 if (this._touching) {
  433.                         if (TouchInput.isPressed()) {
  434.                                 this.onTouch(false);
  435.                         } else {
  436.                                 this._touching = false;
  437.                         }
  438.                 }
  439.         };

  440.         Window_Formation.prototype.hitTest = function(x, y) {
  441.                 if (this.isContentsArea(x, y)) {
  442.                         var cx = x - this.padding;
  443.                         var cy = y - this.padding;
  444.                         var topIndex = this.topIndex();
  445.                         for (var i = 0; i < this.maxPageItems(); i++) {
  446.                                 var index = topIndex + i;
  447.                                 if (index < this.maxItems()) {
  448.                                         var rect = this.itemRect(index);
  449.                                         var right = rect.x + rect.width;
  450.                                         var bottom = rect.y + rect.height;
  451.                                         if (cx >= rect.x && cy >= rect.y && cx < right && cy < bottom) {
  452.                                                 return index;
  453.                                         }
  454.                                 }
  455.                         }
  456.                 }
  457.                 return -1;
  458.         };

  459.         function Window_FormationStatus() {
  460.                 this.initialize.apply(this, arguments);
  461.         };

  462.         Window_FormationStatus.prototype = Object.create(Window_Base.prototype);
  463.         Window_FormationStatus.prototype.constructor = Window_FormationStatus;

  464.         Window_FormationStatus.prototype.initialize = function() {
  465.                 Window_Base.prototype.initialize.call(this, 0, Graphics.boxHeight - 240, Graphics.boxWidth, 240);
  466.                 this._actor = null
  467.         };

  468.         Window_FormationStatus.prototype.standardPadding = function() {
  469.                 return 8;
  470.         };

  471.         Window_FormationStatus.prototype.refresh = function() {
  472.                 this._setRefresh = true;
  473.                 this.checkBlt();
  474.         };
  475.        
  476.         Window_FormationStatus.prototype.update = function(){
  477.                 Window_Base.prototype.update.call(this);
  478.                 if (this._setRefresh){
  479.                         if (ImageManager.isReady()){
  480.                                 this.refreshContents();
  481.                                 this._setRefresh = false;
  482.                         }else{
  483.                                 this.checkBlt();
  484.                         }
  485.                 }
  486.         };
  487.        
  488.        
  489.         Window_FormationStatus.prototype.checkBlt = function(){
  490.                 var bitmap2 = new Bitmap(1,1)
  491.                 $gameParty.allMembers().forEach(function(actor){
  492.                         var bitmap = ImageManager.loadFace(actor.faceName());
  493.                         bitmap2.blt(bitmap,0,0,bitmap.width,bitmap.height,0,0);
  494.                 });
  495.                 bitmap = null;
  496.                 bitmap2 = null;
  497.         };
  498.        
  499.         Window_FormationStatus.prototype.refreshContents = function(){
  500.                 this.contents.clear();
  501.                 if (this._actor) {
  502.                         this.contents.fontSize = statusWindowFontSize;
  503.                         this.drawActorFace(this._actor, 12, 32);
  504.                         this.drawActorName(this._actor, 6, 0);
  505.                         this.drawActorLevel(this._actor, 144, 0);
  506.                         this.drawActorClass(this._actor, 280, 0);
  507.                         this.drawActorNickname(this._actor, 420, 0);
  508.                            this.drawActorIcons(this._actor, 6, 32);
  509.                         this.drawActorHp(this._actor, 6, 144, 160);
  510.                         this.drawActorMp(this._actor, 6, 180, 160);
  511.                         this.drawParameters(172, 40);
  512.                         this.drawExpInfo(172, 144);
  513.                         this.drawEquipments(180+statusBlockWidth, 32);
  514.                         this.resetFontSettings();
  515.                 }
  516.         };

  517.         Window_FormationStatus.prototype.drawParameters = function(x, y) {
  518.                 var lineHeight = this.lineHeight();
  519.                 var blockWidth = statusBlockWidth / 2 - 6;
  520.                 var paramWidth = blockWidth / 3;
  521.                 for (var i = 0; i < 6; i++) {
  522.                         var paramId = i + 2;
  523.                         var y2 = y + 32 * (i % 3);
  524.                         var x2 = x + Math.floor(i / 3) * blockWidth;
  525.                         this.changeTextColor(this.systemColor());
  526.                         this.drawText(TextManager.param(paramId), x2 + (12 * Math.floor(i / 3)), y2, paramWidth * 2);
  527.                         this.resetTextColor();
  528.                         this.drawText(this._actor.param(paramId), x2 + paramWidth * 2 + (12 * Math.floor(i / 3)), y2, paramWidth, 'right');
  529.                 }
  530.         };

  531.         Window_FormationStatus.prototype.drawExpInfo = function(x, y) {
  532.                 var lineHeight = this.lineHeight();
  533.                 var expTotal = TextManager.expTotal.format(TextManager.exp);
  534.                 var expNext = TextManager.expNext.format(TextManager.level);
  535.                 var value1 = this._actor.currentExp();
  536.                 var value2 = this._actor.nextRequiredExp();
  537.                 if (this._actor.isMaxLevel()) {
  538.                         value1 = '-------';
  539.                         value2 = '-------';
  540.                 }
  541.                 this.changeTextColor(this.systemColor());
  542.                 this.drawText(expTotal, x, y + lineHeight * 0, statusBlockWidth);
  543.                 this.drawText(expNext, x, y + lineHeight * 1, statusBlockWidth);
  544.                 this.resetTextColor();
  545.                 this.drawText(value1, x, y + lineHeight * 0, statusBlockWidth, 'right');
  546.                 this.drawText(value2, x, y + lineHeight * 1, statusBlockWidth, 'right');
  547.         };

  548.         Window_FormationStatus.prototype.drawEquipments = function(x, y) {
  549.                 var equips = this._actor.equips();
  550.                 var count = Math.min(equips.length, this.maxEquipmentLines());
  551.                 var width = this.width - this.standardPadding() * 2 - x - 4;
  552.                 for (var i = 0; i < count; i++) {
  553.                         this.drawItemName(equips[i], x, y + this.lineHeight() * i, width);
  554.                 }
  555.         };

  556.         Window_FormationStatus.prototype.maxEquipmentLines = function() {
  557.                 return 6;
  558.         };

  559.         function Window_FormationName() {
  560.                 this.initialize.apply(this, arguments);
  561.         };

  562.         Window_FormationName.prototype = Object.create(Window_Base.prototype);
  563.         Window_FormationName.prototype.constructor = Window_FormationName;

  564.         Window_FormationName.prototype.initialize = function(x, y, text) {
  565.                 Window_Base.prototype.initialize.call(this, x, y, 216, 56);
  566.                 this.drawText(text, 0, 0, 192, 1);
  567.         };

  568.         Window_FormationName.prototype.standardPadding = function() {
  569.                 return 9;
  570.         }

  571. ////////////////////////////////////////////////////////////////////////////////////

  572.         Scene_Formation.prototype = Object.create(Scene_MenuBase.prototype);
  573.         Scene_Formation.prototype.constructor = Scene_Formation;

  574.         Scene_Formation.prototype.create = function() {
  575.                 Scene_MenuBase.prototype.create.call(this);
  576.                 this.createAllWindows();
  577.                 this._scopeIndex = null;
  578.         };

  579.         Scene_Formation.prototype.createAllWindows = function() {
  580.                 this.createFormationStatusWindow();
  581.                 this.createBattlerWindow();
  582.                 this.createStanderWindow();
  583.                 this.createNameWindow();
  584.         };

  585.         Scene_Formation.prototype.createBattlerWindow = function() {
  586.                 this._battlerWindow = new Window_Formation('battle', 96, 72);
  587.                 this._battlerWindow.setHandler('ok', this.onMemberOk.bind(this));
  588.                 this._battlerWindow.setHandler('cancel', this.onMemberCancel.bind(this));
  589.                 this._battlerWindow.setHandler('release', this.onRelease.bind(this));
  590.                 this._battlerWindow.setHandler('down', this.onDown.bind(this));
  591.                 this._battlerWindow.setHandler('standOff', this.onStandOff.bind(this));
  592.                 this._battlerWindow._statusWindow = this._fStatusWindow;
  593.                 this._battlerWindow.activate();
  594.                 this._battlerWindow.select(0);
  595.                 this._fStatusWindow._actor = this._battlerWindow.actor();
  596.                 this._fStatusWindow.refresh();
  597.                 this.addWindow(this._battlerWindow);
  598.         };

  599.         Scene_Formation.prototype.createStanderWindow = function() {
  600.                 this._standerWindow = new Window_Formation('stand', 96, 264);
  601.                 this._standerWindow.setHandler('ok', this.onStandOk.bind(this));
  602.                 this._standerWindow.setHandler('cancel', this.onStandCancel.bind(this));
  603.                 this._standerWindow.setHandler('add', this.onAdd.bind(this));
  604.                 this._standerWindow.setHandler('up', this.onUp.bind(this));
  605.                 this._standerWindow.setHandler('battleOff', this.onBattleOff.bind(this));
  606.                 this._standerWindow._statusWindow = this._fStatusWindow;
  607.                 this._standerWindow.deactivate();
  608.                 this._standerWindow.deselect
  609.                 var n = this._standerWindow.height + this._standerWindow.y
  610.                 if (n > this._fStatusWindow.y) {
  611.                         this._standerWindow.y = this._fStatusWindow.y - this._standerWindow.height;
  612.                 }
  613.                 this.addWindow(this._standerWindow);

  614.         };

  615.         Scene_Formation.prototype.createFormationStatusWindow = function() {
  616.                 this._fStatusWindow = new Window_FormationStatus();
  617.                 this.addWindow(this._fStatusWindow);
  618.         };

  619.         Scene_Formation.prototype.createNameWindow = function() {
  620.                 this._nameWindow1 = new Window_FormationName(96, this._battlerWindow.y - 48, formationSceneBattleName);
  621.                 this.addWindow(this._nameWindow1);
  622.                 this._nameWindow2 = new Window_FormationName(96, this._standerWindow.y - 48, formationSceneStandName);
  623.                 this.addWindow(this._nameWindow2);
  624.         };

  625.         Scene_Formation.prototype.clearWindows = function() {
  626.                 this._scopeIndex = null;
  627.                 this._battlerWindow.refreshMembers();
  628.                 this._standerWindow.refreshMembers();
  629.                 this._battlerWindow.releaseIndex();
  630.                 this._standerWindow.releaseIndex();
  631.         };
  632.        
  633.         Scene_Formation.prototype.returnScene = function() {
  634.                 this.popScene(this);
  635.         };

  636.         Scene_Formation.prototype.onMemberOk = function() {
  637.                 if (this._scopeIndex !== null && this._scopeIndex !== undefined) {
  638.                         var a = null;
  639.                         if (this._scopeIndex >= 0) {
  640.                                 a = $gameParty._actors[this._scopeIndex];
  641.                                 if (this._battlerWindow.actor()) {
  642.                                         var index = $gameParty.allMembers().indexOf(this._battlerWindow.actor());
  643.                                         $gameParty._actors[this._scopeIndex] = $gameParty._actors[index];
  644.                                         $gameParty._actors[index] = a;
  645.                                         a = null;
  646.                                 } else {
  647.                                         var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  648.                                         ary[0].push(a);
  649.                                         ary[0] = ary[0].concat(ary[1]);
  650.                                         $gameParty._actors = ary[0].compact();
  651.                                         if (this._scopeIndex >= this._battlerWindow._members.length){       
  652.                                                 $gameParty._battleMemberSize = this._battlerWindow._members.length + 1;
  653.                                         }else{
  654.                                                 $gameParty._battleMemberSize = this._battlerWindow._members.length
  655.                                         }
  656.                                         a = null;
  657.                                 }
  658.                         } else if (this._scopeIndex === -2){
  659.                                 if (this._battlerWindow.actor()) {
  660.                                         if (this._battlerWindow._members.length === 1) {
  661.                                                 return
  662.                                         }
  663.                                         a = this._battlerWindow.actor()._actorId;
  664.                                         var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  665.                                         ary[1].push(a);
  666.                                         ary[0] = ary[0].concat(ary[1]);
  667.                                         $gameParty._actors = ary[0].compact();
  668.                                         $gameParty._battleMemberSize = this._battlerWindow._members.length - 1;
  669.                                         a = null;
  670.                                 }
  671.                         } else if (this._scopeIndex === -1){
  672.                                 a = this._battlerWindow.actor()._actorId;
  673.                                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  674.                                 ary[0].push(a);
  675.                                 ary[0] = ary[0].concat(ary[1]);
  676.                                 $gameParty._actors = ary[0].compact();
  677.                         }
  678.                         this.clearWindows();
  679.                         this._battlerWindow.updateInputData();
  680.                         this._battlerWindow.activate();
  681.                         this._battlerWindow.select(this._battlerWindow._index);
  682.                         $gamePlayer.refresh();
  683.                         $gameParty._battleMemberSize = this._battlerWindow._members.length;
  684.                 } else {
  685.                         this._scopeIndex = $gameParty.allMembers().indexOf(this._battlerWindow.actor());
  686.                         if (this._scopeIndex === null || this._scopeIndex === undefined) {
  687.                                 this._scopeIndex = -1
  688.                         }
  689.                         this._battlerWindow.lockIndex();
  690.                         this._battlerWindow.updateInputData();
  691.                         this._battlerWindow.activate();
  692.                 }
  693.         };

  694.         Scene_Formation.prototype.onStandOk = function() {
  695.                 if (this._scopeIndex !== null && this._scopeIndex !== undefined) {
  696.                         var a = null;
  697.                         if (!(this._battlerWindow._members.length === 1 && !this._standerWindow.actor())) {
  698.                                 if (this._scopeIndex >= 0) {
  699.                                         a = $gameParty._actors[this._scopeIndex];
  700.                                         if (this._standerWindow.actor()) {
  701.                                                 var index = $gameParty.allMembers().indexOf(this._standerWindow.actor());
  702.                                                 $gameParty._actors[this._scopeIndex] = $gameParty._actors[index];
  703.                                                 $gameParty._actors[index] = a;
  704.                                                 a = null;
  705.                                         } else {
  706.                                                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  707.                                                 ary[1].push(a);
  708.                                                 ary[0] = ary[0].concat(ary[1]);
  709.                                                 $gameParty._actors = ary[0].compact();
  710.                                                 if (this._scopeIndex < this._battlerWindow._members.length){
  711.                                                         $gameParty._battleMemberSize = this._battlerWindow._members.length - 1;
  712.                                                 }else{
  713.                                                         $gameParty._battleMemberSize = this._battlerWindow._members.length;
  714.                                                 }
  715.                                                 a = null;
  716.                                         }
  717.                                 } else if (this._scopeIndex === -1){
  718.                                         if (this._standerWindow.actor()){
  719.                                                 a = this._standerWindow.actor()._actorId;
  720.                                                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  721.                                                 ary[0].push(a);
  722.                                                 ary[0] = ary[0].concat(ary[1]);
  723.                                                 $gameParty._actors = ary[0].compact();
  724.                                                 $gameParty._battleMemberSize = this._battlerWindow._members.length + 1;
  725.                                                 a = null;
  726.                                         }
  727.                                 } else if (this._scopeIndex === -2){
  728.                                         a = this._standerWindow.actor()._actorId;
  729.                                         var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  730.                                         ary[1].push(a);
  731.                                         ary[0] = ary[0].concat(ary[1]);
  732.                                         $gameParty._actors = ary[0].compact();
  733.                                 } else {
  734.                                        
  735.                                 }
  736.                         }
  737.                         this.clearWindows();
  738.                         this._standerWindow.updateInputData();
  739.                         this._standerWindow.activate();
  740.                         this._standerWindow.select(this._standerWindow._index);
  741.                         $gamePlayer.refresh();
  742.                         $gameParty._battleMemberSize = this._battlerWindow._members.length;
  743.                 } else {
  744.                         this._scopeIndex = $gameParty.allMembers().indexOf(this._standerWindow.actor());
  745.                         if (this._scopeIndex === null || this._scopeIndex === undefined || this._scopeIndex === -1) {
  746.                                 this._scopeIndex = -2
  747.                         }
  748.                         this._standerWindow.lockIndex();
  749.                         this._standerWindow.updateInputData();
  750.                         this._standerWindow.activate();
  751.                 }
  752.         };
  753.        
  754.         Scene_Formation.prototype.getFrontAndStand = function(a, length) {
  755.                 var ary1 = [];
  756.                 var ary2 = [];

  757.                 for (var i = 0; i < $gameParty._actors.length; i++) {
  758.                         if ($gameParty._actors[i] !== a) {
  759.                                 if (i < length) {
  760.                                         ary1.push($gameParty._actors[i]);
  761.                                 } else {
  762.                                         ary2.push($gameParty._actors[i]);
  763.                                 }
  764.                         }
  765.                 }
  766.                 return [ary1, ary2];
  767.         };

  768.         Scene_Formation.prototype.scopeIndex = function() {
  769.                 return this._scopeIndex;
  770.         };

  771.         Scene_Formation.prototype.onMemberCancel = function() {
  772.                 if (this._scopeIndex === null) {
  773.                         this.returnScene();
  774.                 } else {
  775.                         this._scopeIndex = null;
  776.                         this._battlerWindow.releaseIndex();
  777.                         this._standerWindow.releaseIndex();
  778.                         this._battlerWindow.updateInputData();
  779.                         this._battlerWindow.activate();
  780.                 }
  781.         };

  782.         Scene_Formation.prototype.onStandCancel = function() {
  783.                 if (this._scopeIndex === null) {
  784.                         this.returnScene();
  785.                 } else {
  786.                         this._scopeIndex = null;
  787.                         this._battlerWindow.releaseIndex();
  788.                         this._standerWindow.releaseIndex();
  789.                         this._standerWindow.updateInputData();
  790.                         this._standerWindow.activate();
  791.                 }
  792.         };

  793.         Scene_Formation.prototype.onRelease = function() {
  794.                 var actor = this._battlerWindow.actor();
  795.                 var ary = this.getFrontAndStand(actor._actorId, this._battlerWindow._members.length - 1);
  796.                 ary[1].push(actor._actorId);
  797.                 ary[0] = ary[0].concat(ary[1]);
  798.                 $gameParty._actors = ary[0].compact();
  799.                 $gameParty._battleMemberSize = this._battlerWindow._members.length - 1;
  800.                 this.clearWindows();
  801.                 this._battlerWindow.activate();
  802.                 this._battlerWindow.select(this._battlerWindow._index);
  803.                 $gamePlayer.refresh();
  804.         };

  805.         Scene_Formation.prototype.onAdd = function() {
  806.                 var a = this._standerWindow.actor()._actorId;
  807.                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  808.                 ary[0].push(a);
  809.                 ary[0] = ary[0].concat(ary[1]);
  810.                 $gameParty._actors = ary[0].compact();
  811.                 $gameParty._battleMemberSize = this._battlerWindow._members.length + 1;
  812.                 this.clearWindows();
  813.                 this._standerWindow.activate();
  814.                 this._standerWindow.select(this._standerWindow._index);
  815.                 $gamePlayer.refresh();
  816.         };

  817.         Scene_Formation.prototype.onDown = function() {
  818.                 var index = Math.min(this._battlerWindow._index, this._standerWindow.maxItems() - 1);
  819.                 this._battlerWindow.deactivate();
  820.                 this._battlerWindow.deselect();
  821.                 this._standerWindow.activate();
  822.                 this._standerWindow.select(index);
  823.         };

  824.         Scene_Formation.prototype.onUp = function() {
  825.                 var index = Math.min(this._standerWindow._index, this._battlerWindow.maxItems() - 1);
  826.                 this._standerWindow.deactivate();
  827.                 this._standerWindow.deselect();
  828.                 this._battlerWindow.activate();
  829.                 this._battlerWindow.select(index);
  830.         };
  831.        
  832.         Scene_Formation.prototype.onStandOff = function(){
  833.                 this._standerWindow.deactivate();
  834.                 this._standerWindow.deselect();
  835.         };

  836.         Scene_Formation.prototype.onBattleOff = function(){
  837.                 this._battlerWindow.deactivate();
  838.                 this._battlerWindow.deselect();
  839.         };
  840.        
  841.                
  842.         Scene_Formation.prototype.onTouchCancelFormation = function() {
  843.                 if (TouchInput.isTriggered()){
  844.                         var x = TouchInput.x;
  845.                         var y = TouchInput.y;
  846.                         var ax = this._battlerWindow.x;
  847.                         var xw = ax + this._battlerWindow.width;
  848.                         var ay = this._battlerWindow.y;
  849.                         var yh = ay + this._battlerWindow.height;
  850.                         var flag = x >= ax && x <= xw && y >= ay && y <= yh;
  851.                         ax = this._standerWindow.x;
  852.                         xw = ax + this._standerWindow.width;
  853.                         ay = this._standerWindow.y;
  854.                         yh = ay + this._standerWindow.height;
  855.                         return !(flag || (x >= ax && x <= xw && y >= ay && y <= yh));
  856.                 }
  857.                 return false;
  858.         };
  859.        
  860.         Scene_Formation.prototype.update = function() {
  861.                 Scene_MenuBase.prototype.update.call(this);
  862.                 if (this.onTouchCancelFormation()){
  863.                         if (this._battlerWindow.active){
  864.                                 SoundManager.playCancel();
  865.                                 this.onMemberCancel();
  866.                         }else if (this._standerWindow.active){
  867.                                 SoundManager.playCancel();
  868.                                 this.onStandCancel();
  869.                         }
  870.                 }
  871.         };
  872.        
  873. ////////////////////////////////////////////////////////////////////////////////////       
  874.        
  875.         var _Form_SBattle_createAllWindows = Scene_Battle.prototype.createAllWindows;
  876.         Scene_Battle.prototype.createAllWindows = function(){
  877.                 _Form_SBattle_createAllWindows.call(this);
  878.                 this.createFormationStatusWindow();
  879.                 this.createBattlerWindow();
  880.                 this.createStanderWindow();
  881.                 this.createNameWindow();
  882.                 this._scopeIndex = null;
  883.         };

  884.         Scene_Battle.prototype.createBattlerWindow = function() {
  885.                 this._battlerWindow = new Window_Formation('battle', 96, 72);
  886.                 this._battlerWindow.setHandler('ok', this.onMemberOk.bind(this));
  887.                 this._battlerWindow.setHandler('cancel', this.onMemberCancel.bind(this));
  888.                 this._battlerWindow.setHandler('release', this.onRelease.bind(this));
  889.                 this._battlerWindow.setHandler('down', this.onDown.bind(this));
  890.                 this._battlerWindow.setHandler('standOff', this.onStandOff.bind(this));
  891.                 this._battlerWindow._statusWindow = this._fStatusWindow;
  892.                 this._battlerWindow.deactivate();
  893.                 this._battlerWindow.deselect();
  894.                 this._fStatusWindow._actor = this._battlerWindow.actor();
  895.                 this._fStatusWindow.refresh();
  896.                 this.addWindow(this._battlerWindow);
  897.                 this._battlerWindow.openness = 0;
  898.         };

  899.         Scene_Battle.prototype.createStanderWindow = function() {
  900.                 this._standerWindow = new Window_Formation('stand', 96, 264);
  901.                 this._standerWindow.setHandler('ok', this.onStandOk.bind(this));
  902.                 this._standerWindow.setHandler('cancel', this.onStandCancel.bind(this));
  903.                 this._standerWindow.setHandler('add', this.onAdd.bind(this));
  904.                 this._standerWindow.setHandler('up', this.onUp.bind(this));
  905.                 this._standerWindow.setHandler('battleOff', this.onBattleOff.bind(this));
  906.                 this._standerWindow._statusWindow = this._fStatusWindow;
  907.                 this._standerWindow.deactivate();
  908.                 this._standerWindow.deselect
  909.                 var n = this._standerWindow.height + this._standerWindow.y
  910.                 if (n > this._fStatusWindow.y) {
  911.                         this._standerWindow.y = this._fStatusWindow.y - this._standerWindow.height;
  912.                 }
  913.                 this.addWindow(this._standerWindow);
  914.                 this._standerWindow.openness = 0;
  915.         };

  916.         Scene_Battle.prototype.createFormationStatusWindow = function() {
  917.                 this._fStatusWindow = new Window_FormationStatus();
  918.                 this.addWindow(this._fStatusWindow);
  919.                 this._fStatusWindow.openness = 0;
  920.         };

  921.         Scene_Battle.prototype.createNameWindow = function() {
  922.                 this._nameWindow1 = new Window_FormationName(96, this._battlerWindow.y - 48, formationSceneBattleName);
  923.                 this.addWindow(this._nameWindow1);
  924.                 this._nameWindow2 = new Window_FormationName(96, this._standerWindow.y - 48, formationSceneStandName);
  925.                 this.addWindow(this._nameWindow2);
  926.                 this._nameWindow1.openness = 0;
  927.                 this._nameWindow2.openness = 0;
  928.         };

  929.         Scene_Battle.prototype.clearWindows = function() {
  930.                 this._scopeIndex = null;
  931.                 this._battlerWindow.refreshMembers();
  932.                 this._standerWindow.refreshMembers();
  933.                 this._battlerWindow.releaseIndex();
  934.                 this._standerWindow.releaseIndex();
  935.         };

  936.         Scene_Battle.prototype.returnScene = function() {
  937.                 this._battlerWindow.deselect();
  938.                 this._battlerWindow.deactivate();
  939.                 this._standerWindow.deselect();
  940.                 this._standerWindow.deactivate();
  941.                 this._battlerWindow.close();
  942.                 this._standerWindow.close();
  943.                 this._fStatusWindow.close();
  944.                 this._nameWindow1.close();
  945.                 this._nameWindow2.close();
  946.                 this._partyCommandWindow.activate();
  947.                 BattleManager._formation = false;
  948.                 this._statusWindow.refresh();
  949.         };

  950.         Scene_Battle.prototype.onMemberOk = function() {
  951.                 if (this._scopeIndex !== null && this._scopeIndex !== undefined) {
  952.                         var a = null;
  953.                         if (this._scopeIndex >= 0) {
  954.                                 a = $gameParty._actors[this._scopeIndex];
  955.                                 if (this._battlerWindow.actor()) {
  956.                                         var index = $gameParty.allMembers().indexOf(this._battlerWindow.actor());
  957.                                         $gameParty._actors[this._scopeIndex] = $gameParty._actors[index];
  958.                                         $gameParty._actors[index] = a;
  959.                                         a = null;
  960.                                 } else {
  961.                                         var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  962.                                         ary[0].push(a);
  963.                                         ary[0] = ary[0].concat(ary[1]);
  964.                                         $gameParty._actors = ary[0].compact();
  965.                                         if (this._scopeIndex >= this._battlerWindow._members.length){       
  966.                                                 $gameParty._battleMemberSize = this._battlerWindow._members.length + 1;
  967.                                         }else{
  968.                                                 $gameParty._battleMemberSize = this._battlerWindow._members.length
  969.                                         }
  970.                                         a = null;
  971.                                 }
  972.                         } else if (this._scopeIndex === -2){
  973.                                 if (this._battlerWindow.actor()) {
  974.                                         if (this._battlerWindow._members.length === 1) {
  975.                                                 return
  976.                                         }
  977.                                         a = this._battlerWindow.actor()._actorId;
  978.                                         var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  979.                                         ary[1].push(a);
  980.                                         ary[0] = ary[0].concat(ary[1]);
  981.                                         $gameParty._actors = ary[0].compact();
  982.                                         $gameParty._battleMemberSize = this._battlerWindow._members.length - 1;
  983.                                         a = null;
  984.                                 }
  985.                         } else if (this._scopeIndex === -1){
  986.                                 a = this._battlerWindow.actor()._actorId;
  987.                                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  988.                                 ary[0].push(a);
  989.                                 ary[0] = ary[0].concat(ary[1]);
  990.                                 $gameParty._actors = ary[0].compact();
  991.                         }
  992.                         this.clearWindows();
  993.                         this._battlerWindow.updateInputData();
  994.                         this._battlerWindow.activate();
  995.                         this._battlerWindow.select(this._battlerWindow._index);
  996.                         $gamePlayer.refresh();
  997.                         $gameParty._battleMemberSize = this._battlerWindow._members.length;
  998.                 } else {
  999.                         this._scopeIndex = $gameParty.allMembers().indexOf(this._battlerWindow.actor());
  1000.                         if (this._scopeIndex === null || this._scopeIndex === undefined) {
  1001.                                 this._scopeIndex = -1
  1002.                         }
  1003.                         this._battlerWindow.lockIndex();
  1004.                         this._battlerWindow.updateInputData();
  1005.                         this._battlerWindow.activate();
  1006.                 }
  1007.         };

  1008.         Scene_Battle.prototype.onStandOk = function() {
  1009.                 if (this._scopeIndex !== null && this._scopeIndex !== undefined) {
  1010.                         var a = null;
  1011.                         if (!(this._battlerWindow._members.length === 1 && !this._standerWindow.actor())) {
  1012.                                 if (this._scopeIndex >= 0) {
  1013.                                         a = $gameParty._actors[this._scopeIndex];
  1014.                                         if (this._standerWindow.actor()) {
  1015.                                                 var index = $gameParty.allMembers().indexOf(this._standerWindow.actor());
  1016.                                                 $gameParty._actors[this._scopeIndex] = $gameParty._actors[index];
  1017.                                                 $gameParty._actors[index] = a;
  1018.                                                 a = null;
  1019.                                         } else {
  1020.                                                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  1021.                                                 ary[1].push(a);
  1022.                                                 ary[0] = ary[0].concat(ary[1]);
  1023.                                                 $gameParty._actors = ary[0].compact();
  1024.                                                 if (this._scopeIndex < this._battlerWindow._members.length){
  1025.                                                         $gameParty._battleMemberSize = this._battlerWindow._members.length - 1;
  1026.                                                 }else{
  1027.                                                         $gameParty._battleMemberSize = this._battlerWindow._members.length;
  1028.                                                 }
  1029.                                                 a = null;
  1030.                                         }
  1031.                                 } else if (this._scopeIndex === -1){
  1032.                                         if (this._standerWindow.actor()){
  1033.                                                 a = this._standerWindow.actor()._actorId;
  1034.                                                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  1035.                                                 ary[0].push(a);
  1036.                                                 ary[0] = ary[0].concat(ary[1]);
  1037.                                                 $gameParty._actors = ary[0].compact();
  1038.                                                 $gameParty._battleMemberSize = this._battlerWindow._members.length + 1;
  1039.                                                 a = null;
  1040.                                         }
  1041.                                 } else if (this._scopeIndex === -2){
  1042.                                         a = this._standerWindow.actor()._actorId;
  1043.                                         var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  1044.                                         ary[1].push(a);
  1045.                                         ary[0] = ary[0].concat(ary[1]);
  1046.                                         $gameParty._actors = ary[0].compact();
  1047.                                 } else {
  1048.                                        
  1049.                                 }
  1050.                         }
  1051.                         this.clearWindows();
  1052.                         this._standerWindow.updateInputData();
  1053.                         this._standerWindow.activate();
  1054.                         this._standerWindow.select(this._standerWindow._index);
  1055.                         $gamePlayer.refresh();
  1056.                         $gameParty._battleMemberSize = this._battlerWindow._members.length;
  1057.                 } else {
  1058.                         this._scopeIndex = $gameParty.allMembers().indexOf(this._standerWindow.actor());
  1059.                         if (this._scopeIndex === null || this._scopeIndex === undefined || this._scopeIndex === -1) {
  1060.                                 this._scopeIndex = -2
  1061.                         }
  1062.                         this._standerWindow.lockIndex();
  1063.                         this._standerWindow.updateInputData();
  1064.                         this._standerWindow.activate();
  1065.                 }
  1066.         };
  1067.        
  1068.         Scene_Battle.prototype.getFrontAndStand = function(a, length) {
  1069.                 var ary1 = [];
  1070.                 var ary2 = [];

  1071.                 for (var i = 0; i < $gameParty._actors.length; i++) {
  1072.                         if ($gameParty._actors[i] !== a) {
  1073.                                 if (i < length) {
  1074.                                         ary1.push($gameParty._actors[i]);
  1075.                                 } else {
  1076.                                         ary2.push($gameParty._actors[i]);
  1077.                                 }
  1078.                         }
  1079.                 }
  1080.                 return [ary1, ary2];
  1081.         };

  1082.         Scene_Battle.prototype.scopeIndex = function() {
  1083.                 return this._scopeIndex;
  1084.         };

  1085.         Scene_Battle.prototype.onMemberCancel = function() {
  1086.                 if (this._scopeIndex === null) {
  1087.                         this.returnScene();
  1088.                 } else {
  1089.                         this._scopeIndex = null;
  1090.                         this._battlerWindow.releaseIndex();
  1091.                         this._standerWindow.releaseIndex();
  1092.                         this._battlerWindow.updateInputData();
  1093.                         this._battlerWindow.activate();
  1094.                 }
  1095.         };

  1096.         Scene_Battle.prototype.onStandCancel = function() {
  1097.                 if (this._scopeIndex === null) {
  1098.                         this.returnScene();
  1099.                 } else {
  1100.                         this._scopeIndex = null;
  1101.                         this._battlerWindow.releaseIndex();
  1102.                         this._standerWindow.releaseIndex();
  1103.                         this._standerWindow.updateInputData();
  1104.                         this._standerWindow.activate();
  1105.                 }
  1106.         };

  1107.         Scene_Battle.prototype.onRelease = function() {
  1108.                 var actor = this._battlerWindow.actor();
  1109.                 var ary = this.getFrontAndStand(actor._actorId, this._battlerWindow._members.length - 1);
  1110.                 ary[1].push(actor._actorId);
  1111.                 ary[0] = ary[0].concat(ary[1]);
  1112.                 $gameParty._actors = ary[0].compact();
  1113.                 $gameParty._battleMemberSize = this._battlerWindow._members.length - 1;
  1114.                 this.clearWindows();
  1115.                 this._battlerWindow.activate();
  1116.                 this._battlerWindow.select(this._battlerWindow._index);
  1117.                 $gamePlayer.refresh();
  1118.         };

  1119.         Scene_Battle.prototype.onAdd = function() {
  1120.                 var a = this._standerWindow.actor()._actorId;
  1121.                 var ary = this.getFrontAndStand(a, this._battlerWindow._members.length);
  1122.                 ary[0].push(a);
  1123.                 ary[0] = ary[0].concat(ary[1]);
  1124.                 $gameParty._actors = ary[0].compact();
  1125.                 $gameParty._battleMemberSize = this._battlerWindow._members.length + 1;
  1126.                 this.clearWindows();
  1127.                 this._standerWindow.activate();
  1128.                 this._standerWindow.select(this._standerWindow._index);
  1129.                 $gamePlayer.refresh();
  1130.                 $gameMap.requestRefresh();
  1131.         };

  1132.         Scene_Battle.prototype.onDown = function() {
  1133.                 var index = Math.min(this._battlerWindow._index, this._standerWindow.maxItems() - 1);
  1134.                 this._battlerWindow.deactivate();
  1135.                 this._battlerWindow.deselect();
  1136.                 this._standerWindow.activate();
  1137.                 this._standerWindow.select(index);
  1138.         };

  1139.         Scene_Battle.prototype.onUp = function() {
  1140.                 var index = Math.min(this._standerWindow._index, this._battlerWindow.maxItems() - 1);
  1141.                 this._standerWindow.deactivate();
  1142.                 this._standerWindow.deselect();
  1143.                 this._battlerWindow.activate();
  1144.                 this._battlerWindow.select(index);
  1145.         };
  1146.        
  1147.         Scene_Battle.prototype.onStandOff = function(){
  1148.                 this._standerWindow.deactivate();
  1149.                 this._standerWindow.deselect();
  1150.         };

  1151.         Scene_Battle.prototype.onBattleOff = function(){
  1152.                 this._battlerWindow.deactivate();
  1153.                 this._battlerWindow.deselect();
  1154.         };
  1155.        
  1156.         var _Form_SBattle_isAnyInputWindowActive = Scene_Battle.prototype.isAnyInputWindowActive;
  1157.         Scene_Battle.prototype.isAnyInputWindowActive = function() {
  1158.                 return (_Form_SBattle_isAnyInputWindowActive.call(this) || this._battlerWindow.active || this._standerWindow.active );
  1159.     };

  1160.         var _Form_SBattle_changeInputWindow = Scene_Battle.prototype.changeInputWindow;
  1161.         Scene_Battle.prototype.changeInputWindow = function() {
  1162.                 if(!this._battlerWindow.active && !this._standerWindow.active){
  1163.                         _Form_SBattle_changeInputWindow.call(this);
  1164.                 }
  1165.         };
  1166.        
  1167.         var _Form_SBattle_createPartyCommandWindow = Scene_Battle.prototype.createPartyCommandWindow;
  1168.         Scene_Battle.prototype.createPartyCommandWindow = function() {
  1169.                 _Form_SBattle_createPartyCommandWindow.call(this);
  1170.                 if($gameSwitches.value(useBattleFormationSwitchId)) {
  1171.                         this._partyCommandWindow.setHandler('formation', this.commandFormation.bind(this))
  1172.                 }
  1173.         };
  1174.        
  1175.         Scene_Battle.prototype.commandFormation = function() {
  1176.                 this._battlerWindow.activate();
  1177.                 this._battlerWindow.select(0);
  1178.                 this._battlerWindow.refresh();
  1179.                 this._battlerWindow.open();
  1180.                 this._standerWindow.open();
  1181.                 this._standerWindow.refresh();
  1182.                 this._nameWindow1.open();
  1183.                 this._nameWindow2.open();
  1184.                 this._fStatusWindow.open();
  1185.                 this._partyCommandWindow.deactivate();
  1186.                 BattleManager._formation = true;
  1187.         };
  1188.        
  1189.         Scene_Battle.prototype.onTouchCancelFormation = function() {
  1190.                 if (TouchInput.isTriggered()){
  1191.                         var x = TouchInput.x;
  1192.                         var y = TouchInput.y;
  1193.                         var ax = this._battlerWindow.x;
  1194.                         var xw = ax + this._battlerWindow.width;
  1195.                         var ay = this._battlerWindow.y;
  1196.                         var yh = ay + this._battlerWindow.height;
  1197.                         var flag = x >= ax && x <= xw && y >= ay && y <= yh;
  1198.                         ax = this._standerWindow.x;
  1199.                         xw = ax + this._standerWindow.width;
  1200.                         ay = this._standerWindow.y;
  1201.                         yh = ay + this._standerWindow.height;
  1202.                         return !(flag || (x >= ax && x <= xw && y >= ay && y <= yh));
  1203.                 }
  1204.                 return false;
  1205.         };
  1206.        
  1207.         var _Form_SBattle_update = Scene_Battle.prototype.update;
  1208.         Scene_Battle.prototype.update = function() {
  1209.                 _Form_SBattle_update.call(this);
  1210.                 if (this.onTouchCancelFormation()){
  1211.                         if (this._battlerWindow.active){
  1212.                                 this.onMemberCancel();
  1213.                         }else if (this._standerWindow.active){
  1214.                                 this.onStandCancel();
  1215.                         }
  1216.                 }
  1217.         };
  1218.        
  1219. ////////////////////////////////////////////////////////////////////////////////////

  1220.         var _Form_WPartyCommand_makeCommandList = Window_PartyCommand.prototype.makeCommandList;
  1221.         Window_PartyCommand.prototype.makeCommandList = function() {
  1222.                 _Form_WPartyCommand_makeCommandList.call(this);
  1223.                    if($gameSwitches.value(useBattleFormationSwitchId)) {
  1224.                             this.addCommand(battleFormationText,  'formation')
  1225.                    }
  1226.         };
  1227.        
  1228.         // 再定義 パーティ全員のアクションを作成する
  1229.         Game_Party.prototype.makeActions = function() {
  1230.             this.allMembers().forEach(function(member) {
  1231.                 member.makeActions();
  1232.             });
  1233.         };

  1234.        
  1235. ////////////////////////////////////////////////////////////////////////////////////

  1236.         Game_Actor.prototype.isFixed = function() {
  1237.                 if (this._fixed === undefined) {
  1238.                         this._fixed = this.initFixed();
  1239.                 }
  1240.                 return this._fixed === true;
  1241.         };

  1242.         Game_Actor.prototype.initFixed = function() {
  1243.                 return this.actor().note.match(/<並び替え固定>/) !== null;
  1244.         };

  1245.         Game_Actor.prototype.escape = function() {
  1246.                 Game_Battler.prototype.escape.call(this);
  1247.                 this._escaped = true;
  1248.         };

  1249.         Game_Actor.prototype.onBattleStart = function() {
  1250.                 this._escaped = false;
  1251.                 Game_Battler.prototype.onBattleStart.call(this);
  1252.         };

  1253.         Game_Actor.prototype.isEscaped = function() {
  1254.                 return this._escaped;
  1255.         };

  1256.         // 再定義
  1257.         Game_Party.prototype.maxBattleMembers = function() {
  1258.                 return maxBattleMembersSize;
  1259.         };

  1260.         // 再定義したものを更にエイリアス
  1261.         var _Form_GParty_maxBattleMembers = Game_Party.prototype.maxBattleMembers;
  1262.         Game_Party.prototype.maxBattleMembers = function() {
  1263.                 if (!this._battleMemberSize) {
  1264.                         this._battleMemberSize = this.fullMemberSize()
  1265.                 }
  1266.                 return this._battleMemberSize;
  1267.         };

  1268.         Game_Party.prototype.fullMemberSize = function() {
  1269.                 return _Form_GParty_maxBattleMembers.call(this)
  1270.         };

  1271.         var _Form_GParty_initialize = Game_Party.prototype.initialize;
  1272.         Game_Party.prototype.initialize = function() {
  1273.                 this._battleMemberSize = this.fullMemberSize();
  1274.                 _Form_GParty_initialize.call(this);
  1275.         };

  1276.         Game_Party.prototype.aliveBattleMembers = function() {
  1277.                 return this.battleMembers().filter(function(member) {
  1278.                         return member.isAlive()
  1279.                 });
  1280.         };

  1281.         var _Form_GParty_addActor = Game_Party.prototype.addActor;
  1282.         Game_Party.prototype.addActor = function(actorId) {
  1283.                 if (this._battleMemberSize != this.fullMemberSize()) {
  1284.                         this._battleMemberSize = Math.min(this._battleMemberSize + 1, this.fullMemberSize());
  1285.                 }
  1286.                 _Form_GParty_addActor.call(this,actorId);
  1287.                 if (this._battleMemberSize != this.fullMemberSize()) {
  1288.                         var ary1 = this._actors.slice(0, this._battleMemberSize - 1);
  1289.                         var ary2 = this._actors.minusArray(ary1);
  1290.                         delete ary1[ary1.indexOf(actorId)];
  1291.                         delete ary2[ary2.indexOf(actorId)];
  1292.                         ary1 = ary1.compact();
  1293.                         ary2 = ary2.compact();
  1294.                         ary1.push(actorId);
  1295.                         ary1 = ary1.concat(ary2);
  1296.                         this._actors = ary1.compact();
  1297.                         $gamePlayer.refresh();
  1298.                 }
  1299.                 this._actors = this._actors.compact();
  1300.         };

  1301.         var _Form_GParty_onBattleEnd = Game_Party.prototype.onBattleEnd;
  1302.         Game_Party.prototype.onBattleEnd = function() {
  1303.                 _Form_GParty_onBattleEnd.call(this);
  1304.                 $gamePlayer.refresh();
  1305.         };
  1306.        
  1307.         // 再定義 メニューを入れ替え
  1308.         var _Form_SMenu_commandFormation = Scene_Menu.prototype.commandFormation;
  1309.         Scene_Menu.prototype.commandFormation = function() {
  1310.                 if (useMenuFormationScene){
  1311.                         SceneManager.push(Scene_Formation);
  1312.                 }else{
  1313.                         _Form_SMenu_commandFormation.call(this);
  1314.                 }
  1315.     };
  1316.    
  1317.     var _Form_SsBattle_createActors = Spriteset_Battle.prototype.createActors;
  1318.     Spriteset_Battle.prototype.createActors = function() {
  1319.             var n = $gameParty.maxBattleMembers();
  1320.             $gameParty._battleMemberSize = $gameParty.fullMemberSize();
  1321.             _Form_SsBattle_createActors.call(this);
  1322.             $gameParty._battleMemberSize = n;
  1323.         };
  1324.        
  1325.         if (Imported['YEP_BattleEngineCore']){
  1326.                 var _Form_SActor_setActorHome = Sprite_Actor.prototype.setActorHome;
  1327.                 Sprite_Actor.prototype.setActorHome = function(index) {
  1328.                     var n = $gameParty.maxBattleMembers();
  1329.                     $gameParty._battleMemberSize = $gameParty.fullMemberSize();
  1330.                     _Form_SActor_setActorHome.call(this,index);
  1331.                     $gameParty._battleMemberSize = n;
  1332.                 };
  1333.         }
  1334. })();
复制代码
回复

使用道具 举报

梦石
0
星屑
788
在线时间
109 小时
注册时间
2008-2-10
回帖
199
发表于 2016-8-26 22:13:09 | 显示全部楼层
tseyik 发表于 2016-8-26 20:13
可决定隊伍待機人員上限,戦鬥人数,戦鬥中交換……
[fold=並び替えシーン ver1.07]//
//  並び替えシーン ve ...

有么中文说明 ?
h
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-8-27 10:48:13 | 显示全部楼层

就在這(姑且説一下巴,其實找翻譯翻一下不行麼?)
/*:
* @plugindesc ver1.07/並び替えシーンを追加します。
* @author Yana
*
*
* @param Stand Members Size
* @desc 待機同伴最大数。
* 超過11人時、視窗會顯示二行。
* @default 8
*
* @param Max Battle Members Size
* @desc 最大戦鬥人数。
* 可設定小於3人,多於5人。
* @default 4
*
* @param Use Menu Formation Scene
* @desc 在菜單中的排序項,設置是否更換排序的場景。
* 可設置true/falseで。
* @default true
*
* @param Formation Scene Battle Name
* @desc 顯示在戰鬥成員的文本。
* @default 戰鬥成員
*
* @param Formation Scene Stand Name
* @desc  顯示待機成員的文本。
* @default 待機成員
*
* @param Use Battle Formation Switch ID
* @desc 設置戰鬥隊員命令中可否添加項目
* 開關的ID。
* @default 20
*
* @param Battle Command Formation
* @desc 戰鬥隊員命令中的命令名
* 的文本。
* @default Formation
*
* @param Status Window Font Size
* @desc 狀態視窗的文字大小。
* @default 24
*
* @param Status Block Width
* @desc 狀態視窗的參數表示部分的横幅。
* @default 372
*
* @help 插件命令
* ※注意:空白必須為半角。
*
* ・呼叫排序場景。
* 呼叫排序場景
* SceneFormation call
*
* ・ID番のアクターの並びを固定します。
* 並び替えシーン 固定 ID
* SceneFormation fixed ID
*
* ・ID番のアクターの並びの固定を解除します。
* 並び替えシーン 固定解除 ID
* SceneFormation unpin ID
*
* ・全アクターの並びを固定します。
* 並び替えシーン 全固定
* SceneFormation all_fixed
*
* ・ID番のアクターの並びを固定します。
* 並び替えシーン 全固定解除
* SceneFormation all_unpin
* ------------------------------------------------------
* 利用規約:特になし。素材利用は自己責任でお願いします。
* ------------------------------------------------------
回复

使用道具 举报

梦石
0
星屑
326
在线时间
92 小时
注册时间
2012-8-27
回帖
15
发表于 2016-9-13 12:34:17 | 显示全部楼层
tseyik 发表于 2016-8-27 10:48
就在這(姑且説一下巴,其實找翻譯翻一下不行麼?)
/*:
* @plugindesc ver1.07/並び替えシーンを追加します ...

* @param Use Battle Formation Switch ID
* @desc 設置戰鬥隊員命令中可否添加項目
* 開關的ID。
* @default 20

请教怎么样才能在战斗中替换参战队员?
需要把这里的默认值20修改为多少?
回复

使用道具 举报

梦石
0
星屑
311
在线时间
204 小时
注册时间
2007-2-4
回帖
1772
发表于 2016-9-13 14:12:04 | 显示全部楼层
kitarr 发表于 2016-9-13 12:34
* @param Use Battle Formation Switch ID
* @desc 設置戰鬥隊員命令中可否添加項目
* 開關的ID。

这个功能是指关联到编辑器中的『开关』,设为20即表示说『当开关20为ON时起效』,设为1就是『开关1ON时起效』,如此类推。

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 谢谢,完美解决!

查看全部评分

新しい誕生祝いだッ!
回复

使用道具 举报

梦石
0
星屑
326
在线时间
92 小时
注册时间
2012-8-27
回帖
15
发表于 2016-9-13 14:27:14 | 显示全部楼层
玄天 发表于 2016-9-13 14:12
这个功能是指关联到编辑器中的『开关』,设为20即表示说『当开关20为ON时起效』,设为1就是『开关1ON时起 ...

谢谢,完美解决!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部