Advertisement
jerry2810

MonsterStorageBox

Nov 26th, 2015
1,673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var COLD = COLD || {};
  2.  
  3. COLD.BREED = COLD.BREED || {};
  4.  
  5. COLD.Param = COLD.Param || {};
  6.  
  7.  /*:
  8.  * @plugindesc Makes a monster/actor storage box system.
  9.  * @author Jeremy Cannady
  10.  *
  11.  * @help
  12.  * Version 1.0, This plugin makes a monster/actor storage box system.
  13.  * Plugin command of "openMonsterBox" to initiate.
  14.  *
  15. */
  16.  
  17. (function(){   
  18.     var openMonsterBox_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  19.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  20.         openMonsterBox_pluginCommand.call(this, command, args);
  21.         if (command === "openMonsterBox") {
  22.             SceneManager.push(COLD.BREED.Scene_Breed_Select)
  23.         };
  24.     };
  25.  
  26.     /**
  27.     * Create an array that holds the currently deposited actors.
  28.     * Hook it into the Game_System initialize.
  29.     */
  30.     COLD.BREED.GSytemI = Game_System.prototype.initialize;
  31.     Game_System.prototype.initialize = function() {
  32.         COLD.BREED.GSytemI.call(this);
  33.         this.depositedActors = [];
  34.     };
  35.  
  36.     /**
  37.     * Create window of party members.
  38.     */
  39.     COLD.BREED.partyWindow = function() {
  40.         this.initialize.apply(this, arguments);
  41.     };
  42.  
  43.     COLD.BREED.partyWindow.prototype = Object.create(Window_Selectable.prototype);
  44.     COLD.BREED.partyWindow.prototype.constructor = COLD.BREED.partyWindow;
  45.  
  46.     COLD.BREED.partyWindow.prototype.initialize = function(x, y) {
  47.         Window_Selectable.prototype.initialize.call(this, x, y, this.windowWidth(), this.windowHeight());
  48.         this.preloadImages();
  49.         this.select(0);
  50.     };
  51.    
  52.     COLD.BREED.partyWindow.prototype.preloadImages = function(){
  53.         for(var i = 0; i < $gameParty.members().length; i++){
  54.             var bitmap = ImageManager.loadCharacter($gameParty.members()[i]._characterName);
  55.             bitmap.addLoadListener(function() {this.refresh()}.bind(this));
  56.         };
  57.     };
  58.    
  59.     COLD.BREED.partyWindow.prototype.drawItem = function(index) {
  60.         this.drawActorList(index);
  61.         this.drawWindowTitle();
  62.     };
  63.  
  64.     COLD.BREED.partyWindow.prototype.drawWindowTitle = function(){
  65.         this.drawText("Party", 0, 0, this.windowWidth() - this.standardPadding() * 2, 'center');
  66.     };
  67.    
  68.     COLD.BREED.partyWindow.prototype.drawActorList = function(index) {
  69.         var rect = this.itemRect(index);
  70.         var actor = $gameParty.members()[index];
  71.         this.drawCharacter(actor._characterName, actor._characterIndex, rect.x + 48 / 2, rect.y + 48);
  72.     };
  73.  
  74.     COLD.BREED.partyWindow.prototype.itemRect = function(index) {
  75.         var rect = new Rectangle();
  76.         var maxCols = this.maxCols();
  77.         rect.width = this.itemWidth();
  78.         rect.height = this.itemHeight();
  79.         rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
  80.         rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY + this.lineHeight();
  81.         return rect;
  82.     };
  83.    
  84.     COLD.BREED.partyWindow.prototype.windowWidth = function(){
  85.         return this.standardPadding() * 5 + 48 * this.maxCols();
  86.     };
  87.  
  88.     COLD.BREED.partyWindow.prototype.windowHeight = function(){
  89.         return this.standardPadding() * 5 + 48 * this.numVisibleRows();
  90.     };
  91.  
  92.     COLD.BREED.partyWindow.prototype.maxItems = function() {
  93.         return $gameParty.members().length;
  94.     };
  95.  
  96.     COLD.BREED.partyWindow.prototype.itemHeight = function() {
  97.         return 48 + this.spacing() / 2;
  98.     };
  99.  
  100.     COLD.BREED.partyWindow.prototype.itemWidth = function() {
  101.         return 48 + this.spacing() / 2;
  102.     };
  103.  
  104.     COLD.BREED.partyWindow.prototype.numVisibleRows = function() {
  105.         return 4;
  106.     };
  107.  
  108.     COLD.BREED.partyWindow.prototype.spacing = function() {
  109.         return this.standardPadding() / 2;
  110.     };
  111.  
  112.     COLD.BREED.partyWindow.prototype.maxCols = function() {
  113.         return 4;
  114.     };
  115.  
  116.     COLD.BREED.partyWindow.prototype.selectLast = function() {
  117.         this.select(0);
  118.     };
  119.  
  120.     /**
  121.     * Create the window of deposited actors.
  122.     */
  123.     COLD.BREED.depositedWindow = function() {
  124.         this.initialize.apply(this, arguments);
  125.     };
  126.  
  127.     COLD.BREED.depositedWindow.prototype = Object.create(Window_Selectable.prototype);
  128.     COLD.BREED.depositedWindow.prototype.constructor = COLD.BREED.depositedWindow;
  129.  
  130.     COLD.BREED.depositedWindow.prototype.initialize = function(x, y) {
  131.         Window_Selectable.prototype.initialize.call(this, x, y, this.windowWidth(), this.windowHeight());
  132.         this.preloadImages();
  133.         this.select(0);
  134.        
  135.         this.refresh();
  136.     };
  137.    
  138.     COLD.BREED.depositedWindow.prototype.preloadImages = function(){
  139.         for(var i = 0; i < $gameSystem.depositedActors.length; i++){
  140.             var bitmap = ImageManager.loadCharacter($gameActors.actor($gameSystem.depositedActors[i])._characterName);
  141.             bitmap.addLoadListener(function() {this.refresh()}.bind(this));
  142.         };
  143.     };
  144.  
  145.     COLD.BREED.depositedWindow.prototype.drawItem = function(index) {
  146.         this.drawActorList(index);
  147.         this.drawWindowTitle();
  148.     };
  149.  
  150.     COLD.BREED.depositedWindow.prototype.drawWindowTitle = function(){
  151.         this.drawText("Deposited", 0, 0, this.windowWidth() - 2 * this.standardPadding(), 'center');
  152.     };
  153.    
  154.     COLD.BREED.depositedWindow.prototype.drawActorList = function(index) {
  155.         var rect = this.itemRect(index);
  156.         if($gameSystem.depositedActors.length > 0){
  157.             var actor = $gameActors.actor($gameSystem.depositedActors[index]);
  158.             this.drawCharacter(actor._characterName, actor._characterIndex, rect.x + 48 / 2, rect.y + 48);
  159.         };
  160.     };
  161.  
  162.     COLD.BREED.depositedWindow.prototype.itemRect = function(index) {
  163.         var rect = new Rectangle();
  164.         var maxCols = this.maxCols();
  165.         rect.width = this.itemWidth();
  166.         rect.height = this.itemHeight();
  167.         rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
  168.         rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY + this.lineHeight();
  169.         return rect;
  170.     };
  171.    
  172.     COLD.BREED.depositedWindow.prototype.windowWidth = function(){
  173.         return this.standardPadding() * 5 + 48 * this.maxCols();
  174.     };
  175.  
  176.     COLD.BREED.depositedWindow.prototype.windowHeight = function(){
  177.         return this.standardPadding() * 5 + 48 * this.numVisibleRows();
  178.     };
  179.  
  180.     COLD.BREED.depositedWindow.prototype.maxItems = function() {
  181.         return $gameSystem.depositedActors.length || 1;
  182.     };
  183.  
  184.     COLD.BREED.depositedWindow.prototype.itemHeight = function() {
  185.         return 48 + this.spacing() / 2;
  186.     };
  187.  
  188.     COLD.BREED.depositedWindow.prototype.itemWidth = function() {
  189.         return 48 + this.spacing() / 2;
  190.     };
  191.  
  192.     COLD.BREED.depositedWindow.prototype.numVisibleRows = function() {
  193.         return 4;
  194.     };
  195.  
  196.     COLD.BREED.depositedWindow.prototype.spacing = function() {
  197.         return this.standardPadding() / 2;
  198.     };
  199.  
  200.     COLD.BREED.depositedWindow.prototype.maxCols = function() {
  201.         return 4;
  202.     };
  203.  
  204.     COLD.BREED.depositedWindow.prototype.selectLast = function() {
  205.         this.select(0);
  206.     };
  207.    
  208.     /**
  209.     * Create the details window.
  210.     */
  211.     COLD.BREED.detailsWindow = function(){
  212.         this.initialize.apply(this, arguments);
  213.     }
  214.  
  215.     COLD.BREED.detailsWindow.prototype = Object.create(Window_Selectable.prototype);
  216.     COLD.BREED.detailsWindow.prototype.constructor = COLD.BREED.detailsWindow;
  217.  
  218.     COLD.BREED.detailsWindow.prototype.initialize = function(x, y) {
  219.         Window_Selectable.prototype.initialize.call(this, x, y, this.windowWidth(), this.windowHeight());
  220.         this.preloadImages();
  221.     };
  222.    
  223.     COLD.BREED.detailsWindow.prototype.preloadImages = function(){
  224.         for(var i = 0; i < $gameSystem.depositedActors.length; i++){
  225.             var faceName = $gameActors.actor($gameSystem.depositedActors[i]).faceName();
  226.             var bitmap = ImageManager.loadFace(faceName);
  227.             bitmap.addLoadListener(function() {this.refresh()}.bind(this));
  228.         };
  229.         for(var i = 0; i < $gameParty.members().length; i++){
  230.             var faceName = $gameParty.members()[i].faceName();
  231.             var bitmap = ImageManager.loadFace(faceName);
  232.             bitmap.addLoadListener(function() {this.refresh()}.bind(this));
  233.         };
  234.     };
  235.    
  236.     COLD.BREED.detailsWindow.prototype.windowWidth = function(){
  237.         return 282;
  238.     };
  239.  
  240.     COLD.BREED.detailsWindow.prototype.windowHeight = function(){
  241.         return 282;
  242.     };
  243.    
  244.     COLD.BREED.detailsWindow.prototype.drawAllItems = function() {
  245.         if(this.currentActorId){
  246.             this.drawDetails(this.currentActorId);
  247.         };
  248.     };
  249.    
  250.     COLD.BREED.detailsWindow.prototype.currentActorId = null;
  251.    
  252.     COLD.BREED.detailsWindow.prototype.drawDetails = function(actorId){
  253.         var actor = $gameActors.actor(actorId);
  254.         this.drawText(actor._name, 0, 0, this.windowWidth() - this.standardPadding() * 2, 'center');
  255.         this.drawText($dataClasses[actor._classId].name, 0, this.lineHeight(), this.windowWidth()- this.standardPadding()*2,'center');
  256.         this.drawText($dataSystem.terms.basic[1] + actor._level, 0, this.lineHeight() * 2, this.windowWidth()- this.standardPadding()*2,'center'); 
  257.         this.drawActorFace(actor, (this.windowWidth()-Window_Base._faceWidth)/2 - this.standardPadding(), this.lineHeight() * 3, Window_Base._faceWidth, Window_Base._faceHeight);
  258.     };
  259.    
  260.     /**
  261.     * Create the main menu for selecting:
  262.     * Deposit, withdraw, and cancel commands.
  263.     */
  264.     COLD.BREED.mainMenu = function(){
  265.         this.initialize.apply(this, arguments);
  266.     }
  267.  
  268.     COLD.BREED.mainMenu.prototype = Object.create(Window_Command.prototype);
  269.     COLD.BREED.mainMenu.prototype.constructor = COLD.BREED.mainMenu;
  270.  
  271.     COLD.BREED.mainMenu.prototype.initialize = function(x, y) {
  272.         Window_Command.prototype.initialize.call(this, x, y);
  273.         this.selectLast();
  274.     };
  275.  
  276.     COLD.BREED.mainMenu.prototype._lastCommandSymbol = null;
  277.  
  278.     COLD.BREED.mainMenu.prototype.initCommandPosition = function() {
  279.         this._lastCommandSymbol = null;
  280.     };
  281.  
  282.     COLD.BREED.mainMenu.prototype.windowWidth = function() {
  283.         return 200;
  284.     };
  285.  
  286.     COLD.BREED.mainMenu.prototype.numVisibleRows = function() {
  287.         return this.maxItems();
  288.     };
  289.  
  290.     COLD.BREED.mainMenu.prototype.makeCommandList = function() {
  291.         this.addMainCommands();
  292.     };
  293.  
  294.     COLD.BREED.mainMenu.prototype.addMainCommands = function() {
  295.         this.addCommand('Deposit', 'deposit', ($gameParty.members().length > 1));
  296.         this.addCommand('Withdraw', 'withdraw', ($gameSystem.depositedActors.length > 0));
  297.         this.addCommand('Cancel', ' cancel', true);
  298.     };
  299.  
  300.     COLD.BREED.mainMenu.prototype.processOk = function() {
  301.         COLD.BREED.mainMenu._lastCommandSymbol = this.currentSymbol();
  302.         Window_Command.prototype.processOk.call(this);
  303.     };
  304.  
  305.     COLD.BREED.mainMenu.prototype.selectLast = function() {
  306.         this.selectSymbol(COLD.BREED.mainMenu._lastCommandSymbol);
  307.     };
  308.    
  309.     /**
  310.     * Create the main menu for selecting:
  311.     * Deposit || withdraw, details, and cancel commands.
  312.     */
  313.     COLD.BREED.detailsMenu = function(){
  314.         this.initialize.apply(this, arguments);
  315.     }
  316.  
  317.     COLD.BREED.detailsMenu.prototype = Object.create(Window_Command.prototype);
  318.     COLD.BREED.detailsMenu.prototype.constructor = COLD.BREED.detailsMenu;
  319.  
  320.     COLD.BREED.detailsMenu.prototype.initialize = function(x, y) {
  321.         Window_Command.prototype.initialize.call(this, x, y);
  322.         this.selectLast();
  323.     };
  324.  
  325.     COLD.BREED.detailsMenu.prototype._lastCommandSymbol = null;
  326.  
  327.     COLD.BREED.detailsMenu.prototype.initCommandPosition = function() {
  328.         this._lastCommandSymbol = null;
  329.     };
  330.  
  331.     COLD.BREED.detailsMenu.prototype.windowWidth = function() {
  332.         return 200;
  333.     };
  334.  
  335.     COLD.BREED.detailsMenu.prototype.numVisibleRows = function() {
  336.         return this.maxItems();
  337.     };
  338.  
  339.     COLD.BREED.detailsMenu.prototype.makeCommandList = function() {
  340.         this.addMainCommands();
  341.     };
  342.    
  343.     COLD.BREED.detailsMenu.prototype.command = null;
  344.    
  345.     COLD.BREED.detailsMenu.prototype.addMainCommands = function() {
  346.         if(this.command == 'deposit'){
  347.             this.addCommand('Deposit', 'deposit', ($gameParty.members().length > 1));
  348.         }else if(this.command == 'withdraw'){
  349.             this.addCommand('Withdraw', 'withdraw', ($gameSystem.depositedActors.length > 0));
  350.         }else{
  351.             this.addCommand('Null', 'null', true);
  352.         };
  353.         this.addCommand('Details', 'details', true);
  354.         this.addCommand('Cancel', ' cancel', true);
  355.     };
  356.  
  357.     COLD.BREED.detailsMenu.prototype.processOk = function() {
  358.         COLD.BREED.detailsMenu._lastCommandSymbol = this.currentSymbol();
  359.         Window_Command.prototype.processOk.call(this);
  360.     };
  361.  
  362.     COLD.BREED.detailsMenu.prototype.selectLast = function() {
  363.         this.selectSymbol(COLD.BREED.detailsMenu._lastCommandSymbol);
  364.     };
  365.    
  366.     /**
  367.     * Create a monster storage box
  368.     */
  369.  
  370.     COLD.BREED.Scene_Breed_Select = function() {
  371.         this.initialize.apply(this, arguments);
  372.     }
  373.  
  374.     COLD.BREED.Scene_Breed_Select.prototype = Object.create(Scene_MenuBase.prototype);
  375.     COLD.BREED.Scene_Breed_Select.prototype.constructor = COLD.BREED.Scene_Breed_Select;
  376.  
  377.     COLD.BREED.Scene_Breed_Select.prototype.initialize = function() {
  378.         Scene_MenuBase.prototype.initialize.call(this);
  379.     };
  380.     COLD.BREED.Scene_Breed_Select.prototype.create = function() {
  381.         Scene_MenuBase.prototype.create.call(this);
  382.         this.createWindowLayer();
  383.         this.createAllWindows();
  384.     };
  385.    
  386.     COLD.BREED.Scene_Breed_Select.prototype.createAllWindows = function() {
  387.         this.createMenu();
  388.         this.createDetailsMenu();
  389.         this.createActorWindow();
  390.         this.createDepositedWindow();
  391.         this.createDDetails();
  392.         this.createPDetails();
  393.     };
  394.    
  395.     COLD.BREED.Scene_Breed_Select.prototype.createActorWindow = function() {
  396.         var x = Graphics.width - COLD.BREED.partyWindow.prototype.windowWidth();
  397.         this._actorWindow = new COLD.BREED.partyWindow(x, 0);
  398.         this._actorWindow.setHandler('ok', this.activateDetails.bind(this));
  399.         this._actorWindow.setHandler('cancel', this.onDepositCancel.bind(this));
  400.         this.addWindow(this._actorWindow);
  401.         this._actorWindow.deactivate();
  402.     };
  403.    
  404.     COLD.BREED.Scene_Breed_Select.prototype.createDepositedWindow = function() {
  405.         var x = Graphics.width - COLD.BREED.partyWindow.prototype.windowWidth();
  406.         var y = COLD.BREED.partyWindow.prototype.windowHeight()
  407.         this._depositedWindow = new COLD.BREED.depositedWindow(x, y);
  408.         this._depositedWindow.setHandler('ok', this.activateDetails.bind(this));
  409.         this._depositedWindow.setHandler('cancel', this.onWithdrawCancel.bind(this));
  410.         this.addWindow(this._depositedWindow);
  411.         this._depositedWindow.deactivate();
  412.     };
  413.    
  414.     COLD.BREED.Scene_Breed_Select.prototype.createMenu = function() {
  415.         var x = Graphics.width - COLD.BREED.partyWindow.prototype.windowWidth() - COLD.BREED.mainMenu.prototype.windowWidth();
  416.         this._menuWindow = new COLD.BREED.mainMenu(x, 0);
  417.         this._menuWindow.setHandler('deposit', this.activateDeposit.bind(this));
  418.         this._menuWindow.setHandler('withdraw', this.activateWithdraw.bind(this));
  419.         this._menuWindow.setHandler('cancel', this.onSceneCancel.bind(this));
  420.         this.addWindow(this._menuWindow);
  421.         this._menuWindow.activate();
  422.     };
  423.    
  424.     COLD.BREED.Scene_Breed_Select.prototype.createDetailsMenu = function() {
  425.         var x = Graphics.width - COLD.BREED.partyWindow.prototype.windowWidth() - COLD.BREED.mainMenu.prototype.windowWidth();
  426.         this._detailsMenu = new COLD.BREED.detailsMenu(x, 0);
  427.         this._detailsMenu.setHandler('deposit', this.choseDeposit.bind(this));
  428.         this._detailsMenu.setHandler('withdraw', this.choseWithdraw.bind(this));
  429.         this._detailsMenu.setHandler('details', this.activateDetailsW.bind(this));
  430.         this._detailsMenu.setHandler('cancel', this.cancelDetailsMenu.bind(this));
  431.         this.addWindow(this._detailsMenu);
  432.         this._detailsMenu.deactivate();
  433.         this._detailsMenu.hide();
  434.     };
  435.    
  436.     COLD.BREED.Scene_Breed_Select.prototype.createPDetails = function() {
  437.         var x =Graphics.width - COLD.BREED.partyWindow.prototype.windowWidth();
  438.         var y = 0;
  439.         var width = COLD.BREED.partyWindow.prototype.windowWidth();
  440.         var height = COLD.BREED.partyWindow.prototype.windowHeight();
  441.         this._partyDetails = new COLD.BREED.detailsWindow(x, y, width, height);
  442.         this._partyDetails.setHandler('ok', this.closeDetails.bind(this));
  443.         this._partyDetails.setHandler('cancel', this.closeDetails.bind(this));
  444.         this.addWindow(this._partyDetails);
  445.         this._partyDetails.hide();
  446.         this._partyDetails.deactivate();
  447.     };
  448.    
  449.     COLD.BREED.Scene_Breed_Select.prototype.createDDetails = function() {
  450.         var x = Graphics.width - COLD.BREED.partyWindow.prototype.windowWidth();
  451.         var y = COLD.BREED.partyWindow.prototype.windowHeight();
  452.         var width = COLD.BREED.depositedWindow.prototype.windowWidth();
  453.         var height = COLD.BREED.depositedWindow.prototype.windowHeight();
  454.         this._depositedDetails = new COLD.BREED.detailsWindow(x, y, width, height);
  455.         this._depositedDetails.setHandler('ok', this.closeDetails.bind(this));
  456.         this._depositedDetails.setHandler('cancel', this.closeDetails.bind(this));
  457.         this.addWindow(this._depositedDetails);
  458.         this._depositedDetails.hide();
  459.         this._depositedDetails.deactivate();
  460.     };
  461.    
  462.     COLD.BREED.Scene_Breed_Select.prototype.activateDetails = function(){
  463.         this._detailsMenu.command = this._menuWindow.currentSymbol();
  464.         this._menuWindow.deactivate();
  465.         this._menuWindow.hide();
  466.         this._detailsMenu.refresh();
  467.         this._detailsMenu.activate();
  468.         this._detailsMenu.show();
  469.     };
  470.    
  471.     COLD.BREED.Scene_Breed_Select.prototype.activateDetailsW = function(){
  472.         switch(this._menuWindow.currentSymbol()){
  473.             case 'deposit':
  474.                 this._partyDetails.currentActorId = $gameParty.members()[this._actorWindow.index()]._actorId;
  475.                 this._partyDetails.refresh();
  476.                 this._actorWindow.hide();
  477.                 this._partyDetails.show();
  478.                 this._partyDetails.activate();
  479.                 break;
  480.             case 'withdraw':
  481.                 this._depositedDetails.currentActorId = $gameSystem.depositedActors[this._depositedWindow.index()]
  482.                 this._depositedDetails.refresh();
  483.                 this._depositedWindow.hide();
  484.                 this._depositedDetails.show();
  485.                 this._depositedDetails.activate();
  486.                 break;
  487.         };
  488.     };
  489.    
  490.         COLD.BREED.Scene_Breed_Select.prototype.closeDetails = function(){
  491.         switch(this._menuWindow.currentSymbol()){
  492.             case 'deposit':
  493.                 this._partyDetails.deactivate();
  494.                 this._partyDetails.hide()
  495.                 this._detailsMenu.activate();
  496.                 this._actorWindow.show();
  497.                 break;
  498.             case 'withdraw':
  499.                 this._depositedDetails.deactivate();
  500.                 this._depositedDetails.hide()
  501.                 this._detailsMenu.activate();
  502.                 this._depositedWindow.show();
  503.                 break;
  504.         };
  505.     };
  506.    
  507.     COLD.BREED.Scene_Breed_Select.prototype.cancelDetailsMenu = function(){
  508.         switch(this._menuWindow.currentSymbol()){
  509.             case 'deposit':
  510.                 this._detailsMenu.deactivate();
  511.                 this._detailsMenu.hide();
  512.                 this._menuWindow.show();
  513.                 this._actorWindow.activate();
  514.                 break;
  515.             case 'withdraw':
  516.                 this._detailsMenu.deactivate();
  517.                 this._detailsMenu.hide();
  518.                 this._menuWindow.show();
  519.                 this._depositedWindow.activate();
  520.                 break;
  521.         };
  522.     };
  523.    
  524.     COLD.BREED.Scene_Breed_Select.prototype.activateDeposit = function(){
  525.         this._menuWindow.deactivate();
  526.         this._actorWindow.activate();
  527.     };
  528.    
  529.     COLD.BREED.Scene_Breed_Select.prototype.activateWithdraw = function(){
  530.         this._menuWindow.deactivate();
  531.         this._depositedWindow.activate();
  532.     }
  533.    
  534.     COLD.BREED.Scene_Breed_Select.prototype.onDepositCancel = function(){
  535.         this._menuWindow.activate();
  536.         this._actorWindow.deactivate();
  537.     };
  538.    
  539.     COLD.BREED.Scene_Breed_Select.prototype.onWithdrawCancel = function(){
  540.         this._menuWindow.activate();
  541.         this._menuWindow.refresh();
  542.         this._depositedWindow.deactivate();
  543.     };
  544.    
  545.     COLD.BREED.Scene_Breed_Select.prototype.choseDeposit = function(){
  546.         this._detailsMenu.deactivate();
  547.         this._detailsMenu.hide();
  548.         this._menuWindow.show();
  549.         if($gameParty.members().length > 1){
  550.             $gameSystem.depositedActors.push($gameParty.members()[this._actorWindow.index()]._actorId)
  551.             $gameParty.removeActor($gameParty.members()[this._actorWindow.index()]._actorId);
  552.             this._actorWindow.selectLast();
  553.             this._actorWindow.activate();
  554.         }else{
  555.             this._actorWindow.deactivate();
  556.             this._menuWindow.activate();
  557.         };
  558.         this.refreshAll();
  559.     };
  560.    
  561.     COLD.BREED.Scene_Breed_Select.prototype.choseWithdraw = function(){
  562.         this._detailsMenu.deactivate();
  563.         this._detailsMenu.hide();
  564.         this._menuWindow.show();
  565.         if($gameSystem.depositedActors.length > 0){
  566.             var actorId = $gameSystem.depositedActors[this._depositedWindow.index()];
  567.             $gameParty.addActor(actorId);
  568.             $gameSystem.depositedActors.splice(this._depositedWindow.index(), 1);
  569.             this._depositedWindow.selectLast();
  570.             this._depositedWindow.activate();
  571.         }else{
  572.             this._depositedWindow.deactivate();
  573.             this._menuWindow.activate();
  574.         }
  575.         this.refreshAll();
  576.     };
  577.    
  578.     COLD.BREED.Scene_Breed_Select.prototype.refreshAll = function(){
  579.         this._actorWindow.refresh();
  580.         this._menuWindow.refresh();
  581.         this._depositedWindow.refresh();
  582.     };
  583.    
  584.     COLD.BREED.Scene_Breed_Select.prototype.onSceneCancel = function(){
  585.         this.popScene();
  586.     };
  587.    
  588. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement