Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Dzho_QuestionBattle
  2. // Interrogation Minigame
  3. // Includes Scene_Interrogate, InterrogationManager, and Misc Needed Items
  4.  
  5.  
  6. //-----------------------------------------------------------------------------
  7. // Scene_Interrogate
  8. //
  9. // The scene called when interring an interrogation.
  10.  
  11. function Scene_Interrogate() {
  12.     this.initialize.apply(this, arguments);
  13. }
  14.  
  15. Scene_Interrogate.prototype = Object.create(Scene_Base.prototype);
  16. Scene_Interrogate.prototype.constructor = Scene_Interrogate;
  17.  
  18. Scene_Interrogate.prototype.prepare = function(ai_id){
  19.     this._sceneId = ai_id;
  20. };
  21.  
  22. Scene_Interrogate.prototype.initialize = function() {
  23.     Scene_Base.prototype.initialize.call(this);
  24. };
  25.  
  26. Scene_Interrogate.prototype.create = function() {
  27.     Scene_Base.prototype.create.call(this);
  28.     this.createDisplayObjects();
  29. };
  30.  
  31. Scene_Interrogate.prototype.start = function() {
  32.     Scene_Base.prototype.start.call(this);
  33.     this.getAiData();
  34.     this.startFadeIn(this.fadeSpeed(), false);
  35.     InterrogationManager.playInterrogateBgm();
  36.     InterrogationManager.startInterrogation();
  37. };
  38.  
  39. Scene_Interrogate.prototype.update = function() {
  40.     var active = this.isActive();
  41.     $gameTimer.update(active);
  42.     $gameScreen.update();
  43.     this.updateStatusWindow();
  44.     this.updateWindowPositions();
  45.     if (active && this.isBusy()) {
  46.         this.updateBattleProcess();
  47.     }
  48.     Scene_Base.prototype.update.call(this);
  49. };
  50.  
  51. Scene_Interrogate.prototype.updateBattleProcess = function() {
  52.     if (!this.isAnyInputWindowActive() || InterrogationManager.isAborting() ||
  53.         InterrogationManager.isInterrogationEnd()) {
  54.         InterrogationManager.update();
  55.         this.changeInputWindow();
  56.     }
  57. };
  58.  
  59. Scene_Interrogate.prototype.isAnyInputWindowActive = function() {
  60.     return (this._questionWindow.active);
  61. };
  62.  
  63. Scene_Interrogate.prototype.changeInputWindow = function() {
  64.     if (InterrogationManager.isInputting())
  65.         this.startQuestionSelection();
  66.     else
  67.         this.endQuestionSelection();
  68. };
  69.  
  70. Scene_Interrogate.prototype.stop = function() {
  71.     Scene_Base.prototype.stop.call(this);
  72.     this.startFadeOut(this.fadeSpeed(), false);
  73.     this._statusWindow.close();
  74.     this._questionWindow.close();
  75. };
  76.  
  77. Scene_Interrogate.prototype.terminate = function() {
  78.     Scene_Base.prototype.terminate.call(this);
  79.     $gameParty.onQuestionEnd();
  80.     $gameTroop.onQuestionEnd();
  81.     AudioManager.stopMe();
  82.     ImageManager.clearRequest();
  83. };
  84.  
  85. Scene_Interrogate.prototype.getAiData = function() {
  86.     $gamePersona.getPersona(this._sceneId);
  87. };
  88.  
  89. Scene_Interrogate.prototype.updateStatusWindow = function() {
  90.     if ($gameMessage.isBusy()) {
  91.         this._statusWindow.close();
  92.         this._questionWindow.close();
  93.     }
  94.     else if (this.isActive() && !this._messageWindow.isClosing())
  95.         this._statusWindow.open();
  96. };
  97.  
  98. Scene_Interrogate.prototype.updateWindowPositions = function() {
  99.     var statusX = 0;
  100.     if (InterrogationManager.isInputting())
  101.         statusX = this._questionWindow.width;
  102.     else
  103.         statusX = this._questionWindow.width / 2;
  104.     if (this._statusWindow.x < statusX) {
  105.         this._statusWindow.x += 16;
  106.         if (this._statusWindow.x > statusX)
  107.             this._statusWindow.x = statusX;
  108.     }
  109.     if (this._statusWindow.x > statusX){
  110.         this._statusWindow.x -= 16;
  111.         if (this._statusWindow.x < statusX)
  112.             this._statusWindow.x = statusX;
  113.     }
  114. };
  115.  
  116. Scene_Interrogate.prototype.createDisplayObjects = function() {
  117.     this.createSpriteset();
  118.     this.createWindowLayer();
  119.     this.createAllWindows();
  120.     InterrogationManager.setLogWindow(this._logWindow);
  121.     InterrogationManager.setStatusWindow(this._statusWindow);
  122.     InterrogationManager.setSpriteset(this._spriteset);
  123.     this._logWindow.setSpriteset(this._spriteset);
  124. };
  125.  
  126. Scene_Interrogate.prototype.createSpriteset = function() {
  127.     this._spriteset = new Spriteset_Interrogate();
  128.     this.addChild(this._spriteset);
  129. };
  130.  
  131. Scene_Interrogate.prototype.createAllWindows = function() {
  132.     this.createLogWindow();
  133.     this.createStatusWindow();
  134.     this.createQuestionWindow();
  135.     this.createHelpWindow();
  136.     this.createMessageWindow();
  137.     this.createScrollTextWindow();
  138. };
  139.  
  140. Scene_Interrogate.prototype.createLogWindow = function() {
  141.     this._logWindow = new Window_InterrogateLog();
  142.     this.addWindow(this._logWindow);
  143. };
  144.  
  145. Scene_Interrogate.prototype.createStatusWindow = function() {
  146.     this._statusWindow = new Window_InterrogateStatus();
  147.     this.addWindow(this._statusWindow);
  148. };
  149.  
  150. Scene_Interrogate.prototype.createQuestionWindow = function() {
  151.     this._questionWindow = new Window_InterrogationCommand();
  152.     this._questionWindow.setHandler('who', this.commandWho.bind(this));
  153.     this._questionWindow.setHandler('what', this.commandWhat.bind(this));
  154.     this._questionWindow.setHandler('when', this.commandWhen.bind(this));
  155.     this._questionWindow.setHandler('where', this.commandWhere.bind(this));
  156.     this._questionWindow.setHandler('why', this.commandWhy.bind(this));
  157.     this._questionWindow.setHandler('how', this.commandHow.bind(this));
  158.     this.addWindow(this._questionWindow);
  159. };
  160.  
  161. Scene_Interrogate.prototype.createHelpWindow = function() {
  162.     this._helpWindow = new Window_Help();
  163.     this._helpWindow.visible = false;
  164.     this.addWindow(this._helpWindow);
  165. };
  166.  
  167. Scene_Interrogate.prototype.createMessageWindow = function() {
  168.     this._messageWindow = new Window_Message();
  169.     this.addWindow(this._messageWindow);
  170.     this._messageWindow.subWindows().forEach(function(window) {
  171.         this.addWindow(window);
  172.     }, this);
  173. };
  174.  
  175. Scene_Interrogate.prototype.createScrollTextWindow = function() {
  176.     this._scrollTextWindow = new Window_ScrollText();
  177.     this.addWindow(this._scrollTextWindow);
  178. };
  179.  
  180. Scene_Interrogate.prototype.refreshStatus = function() {
  181.     this._statusWindow.refresh();
  182. };
  183.  
  184. Scene_Interrogate.prototype.startQuestionSelection = function() {
  185.     this.refreshStatus();
  186.     this._statusWindow.deselect();
  187.     this._statusWindow.open();
  188.     this._questionWindow.setup();
  189. };
  190.  
  191. /*
  192. Figure This Out Later
  193. Scene_Interrogate.prototype.commandWho = function() {
  194.  
  195. }
  196. */
  197.  
  198. // May Not Be Necessary
  199. Scene_Interrogate.prototype.selectNextCommand = function() {
  200.     InterrogationManager.selectNextCommand();
  201.     this.changeInputWindow();
  202. };
  203.  
  204. Scene_Interrogate.prototype.selectPreviousCommand = function() {
  205.     InterrogationManager.selectPreviousCommand();
  206.     this.changeInputWindow();
  207. };
  208.  
  209. Scene_Interrogate.prototype.endQuestionSelection = function() {
  210.     this._questionWindow.close();
  211.     this._statusWindow.deselect();
  212. };
  213.  
  214.  
  215.  
  216.  
  217. //-----------------------------------------------------------------------------
  218. // InterrogationManager
  219. //
  220. // Manager handling progression of the Scene_Interrogation.
  221.  
  222. function InterrogationManager() {
  223.     throw new Error('This is a static class');
  224. }
  225.  
  226. InterrogationManager.setup = function(troopId, fileName) {
  227.     this.initMembers();
  228.     this._fileName = fileName;
  229.     //Check
  230.     $gameTroop.setup(troopId);
  231.     $gameScreen.onQuestionStart();
  232. };
  233.  
  234. InterrogationManager.initMembers = function() {
  235.     this._phase = 'init';
  236.     this._interrogationTest = false;
  237.     this._eventCallback = null;
  238.     this._mapBgm = null;
  239.     this._mapBgs = null;
  240.     this._questions = [];
  241.     this._subject = null;
  242.     this._action = null;
  243.     this._logWindow = null;
  244.     this._statusWindow = null;
  245.     this._spriteset = null;
  246.     this._answer = null;
  247.     this._actorIndex = -1;
  248. };
  249.  
  250. InterrogationManager.isInterrogationTest = function() {
  251.     return this._interrogationTest;
  252. };
  253.  
  254. InterrogationManager.setInterrogationTest = function(interrogationTest) {
  255.     this._interrogationTest = interrogationTest;
  256. };
  257.  
  258. InterrogationManager.setEventCallback = function(callback) {
  259.     this._eventCallback = callback;
  260. };
  261.  
  262. InterrogationManager.setLogWindow = function(logWindow) {
  263.     this._logWindow = logWindow;
  264. };
  265.  
  266. InterrogationManager.setStatusWindow = function(statusWindow) {
  267.     this._statusWindow = statusWindow;
  268. };
  269.  
  270. InterrogationManager.setSpriteset = function(spriteset) {
  271.     this._spriteset = spriteset;
  272. };
  273.  
  274. InterrogationManager.onEncounter = function() {
  275. };
  276.  
  277. InterrogationManager.saveBgmAndBgs = function() {
  278.     this._mapBgm = AudioManager.saveBgm();
  279.     this._mapBgs = AudioManager.saveBgs();
  280. };
  281.  
  282. InterrogationManager.playInterrogateBgm = function() {
  283.     AudioManager.playBgm($gameSystem.interrogateBgm());
  284.     AudioManager.stopBgs();
  285. };
  286.  
  287. InterrogationManager.playSuccessMe = function() {
  288.     AudioManager.playMe($gameSystem.successMe());
  289. };
  290.  
  291. InterrogationManager.playFailureMe = function() {
  292.     AudioManager.playMe($gameSystem.failureMe());
  293. };
  294.  
  295. InterrogationManager.replayBgmAndBgs = function() {
  296.     if (this._mapBgm)
  297.         AudioManager.replayBgm(this._mapBgm);
  298.     else
  299.         AudioManager.stopBgm();
  300.     if (this._mapBgs)
  301.         AudioManager.replayBgs(this._mapBgs);
  302. };
  303.  
  304. //Check
  305. InterrogationManager.update = function() {
  306.     if (!this.isBusy() && !this.updateEvent()) {
  307.         switch (this._phase) {
  308.         case 'start':
  309.             this.startInput();
  310.             break;
  311.         case 'turn':
  312.             this.updateTurn();
  313.             break;
  314.         case 'action':
  315.             this.updateAction();
  316.             break;
  317.         case 'turnEnd':
  318.             this.updateTurnEnd();
  319.             break;
  320.         case 'interrogateEnd':
  321.             this.updateInterrogateEnd();
  322.             break;
  323.         }
  324.     }
  325. };
  326.  
  327. //Check
  328. InterrogationManager.updateEvent = function() {
  329.     switch(this._phase) {
  330.         case 'start':
  331.         case 'turn':
  332.         case 'turnEnd':
  333.             if (this.isActionForced()){
  334.                 this.processForcedAction();
  335.                 return true;
  336.             }
  337.             else
  338.                 return this.updateEventMain();
  339.     }
  340.     return this.checkAbort();
  341. };
  342.  
  343. InterrogationManager.updateEventMain = function() {
  344.     $gameTroop.updateInterpreter();
  345.     $gameParty.requestMotionRefresh();
  346.     if ($gameTroop.isEventRunning() || this.checkInterrogationEnd())
  347.         return true;
  348.     $gameTroop.setupInterrogationEvent();
  349.     if ($gameTroop.isEventRunning() || SceneManager.isSceneChanging())
  350.         return true;
  351.     return false;
  352. };
  353.  
  354. InterrogationManager.isBusy = function() {
  355.     return ($gameMessage.isBusy() || this._spriteset.isBusy() ||
  356.         this._logWindow.isBusy());
  357. };
  358.  
  359. InterrogationManager.isInputting = function() {
  360.     return this._phase === 'input';
  361. };
  362.  
  363. InterrogationManager.isInTurn = function() {
  364.     return this._phase === 'turn';
  365. };
  366.  
  367. InterrogationManager.isTurnEnd = function() {
  368.     return this._phase === 'turnEnd';
  369. };
  370.  
  371. InterrogationManager.isAborting = function() {
  372.     return this._phase === 'aborting';
  373. };
  374.  
  375. InterrogationManager.isInterrogationEnd = function() {
  376.     return this._phase === 'interrogateEnd';
  377. };
  378.  
  379. InterrogationManager.actor = function() {
  380.     return this._actorIndex >=0 ? $gameParty.members()[this._actorIndex] : null;
  381. };
  382.  
  383. InterrogationManager.clearActor = function() {
  384.     this.changeActor(-1, '');
  385. };
  386.  
  387. //Check
  388. // I NEED FUNCTIONS FOR MESSAGE AND SUBJECT AND CHOOSING QUESTION
  389.  
  390. InterrogationManager.startInterrogation = function() {
  391.     this._phase = 'start';
  392.     $gameSystem.onQuestionStart();
  393.     $gameParty.onQuestionStart();
  394.     $gameTroop.onQuestionStart();
  395.     this.displayStartMessages();
  396. };
  397.  
  398. //Check
  399. InterrogationManager.startInput = function() {
  400.     this._phase = 'input';
  401.     $gameParty.makeActions();
  402.     $gameTroop.makeActions();
  403.     this.clearActor();
  404.     if (!$gameParty.canInput())
  405.         this.startTurn();
  406. };
  407.  
  408. InterrogationManager.inputtingAction = function() {
  409.     return this.actor() ? this.actor().inputtingAction() : null;
  410. };
  411.  
  412. InterrogationManager.selectNextCommand = function() {
  413.     do {
  414.         if (!this.actor() || !this.actor().selectNextCommand()){
  415.             this.startTurn();
  416.             break;
  417.         }
  418.     } while (!this.actor().canInput());
  419. };
  420.  
  421. InterrogationManager.selectPreviousCommand = function() {
  422.     do {
  423.         if (!this.actor() || !this.actor().selectPreviousCommand()) {
  424.             return;
  425.         }
  426.     } while (!this.actor().canInput());
  427. };
  428.  
  429. InterrogationManager.refreshStatus = function() {
  430.     this._statusWindow.refresh();
  431. };
  432.  
  433. InterrogationManager.startTurn = function() {
  434.     this._phase = 'turn';
  435.     this.clearActor();
  436.     $gameTroop.increaseTurn();
  437.     this.makeActionOrders();
  438.     $gameParty.requestMotionRefresh();
  439.     this._logWindow.startTurn();
  440. };
  441.  
  442. //Check
  443. InterrogationManager.updateTurn = function() {
  444.     $gameParty.requestMotionRefresh();
  445.     if (!this._subject)
  446.         this._subject = this.getNextSubject();
  447.     if (this._subject)
  448.         this.processTurn();
  449.     else
  450.         this.endTurn();
  451. };
  452.  
  453. //Check
  454. InterrogationManager.processTurn = function() {
  455.     var subject = this._subject;
  456.     var action = subject.currentAction();
  457.     if (action) {
  458.         action.prepare();
  459.         if (action.isValid())
  460.             this.startAction();
  461.         subject.removeCurrentAction();
  462.     }
  463.     else {
  464.         subject.onAllActionsEnd();
  465.         this.refreshStatus();
  466.         this._logWindow.displayAutoAffectedStatus(subject);
  467.         this._logWindow.displayCurrentState(subject);
  468.         this._logWindow.displayRegeneration(subject);
  469.         this._subject = this.getNextSubject();
  470.     }
  471. };
  472.  
  473. //Check
  474. InterrogationManager.endTurn = function() {
  475.     this._phase = 'turnEnd';
  476.     battler = this.actor();
  477.     battler.onTurnEnd();
  478.     this.refreshStatus();
  479.     this._logWindow.displayAutoAffectedStatus(battler);
  480.     this._logWindow.displayRegeneration(battler);
  481. };
  482.  
  483. InterrogationManager.updateTurnEnd = function() {
  484.     this.startInput();
  485. };
  486.  
  487. InterrogationManager.abort = function() {
  488.     this._phase = 'aborting';
  489. };
  490.  
  491. InterrogationManager.checkInterrogationEnd = function() {
  492.     if (this._phase){
  493.         if (this.checkAbort())
  494.             return true;
  495.         // SOME VARIABLE FOR CLUE OBTAINED?
  496.         else if (this.obtainedClue){
  497.             this.processVictory();
  498.             return true;
  499.         }
  500.         // VARIABLE FOR DEAD END
  501.         else if (this.deadEnd){
  502.             this.processDefeat();
  503.             return true;
  504.         }
  505.     }
  506.     return false;
  507. };
  508.  
  509. InterrogationManager.checkAbort = function() {
  510.     if ($gameParty.isEmpty() || this.isAborting()){
  511.         this.processAbort();
  512.     }
  513.     return false;
  514. };
  515.  
  516. InterrogationManager.processVictory = function() {
  517.     // SOME VICTORY ANIMATION
  518.     $gameParty.removeBattleStates();
  519.     this.playSuccessMe();
  520.     this.replayBgmAndBgs();
  521.     this.makeRewards();
  522.     this.displayVictoryMessage();
  523.     this.displayRewards();
  524.     this.gainRewards();
  525.     this.endInterrogation(0);
  526. };
  527.  
  528. InterrogationManager.processAbort = function() {
  529.     //Check
  530.     $gameParty.removeBattleStates();
  531.     this.replayBgmAndBgs();
  532.     this.endInterrogation(1);
  533. };
  534.  
  535. InterrogationManager.processDefeat = function() {
  536.     // SOME DEFEAT ANIMATION
  537.     this.displayDefeatMessage();
  538.     this.playFailureMe();
  539.     this.replayBgmAndBgs();
  540.     this.endInterrogation(2);
  541. };
  542.  
  543. InterrogationManager.endBattle = function(result) {
  544.     this._phase = 'interrogateEnd';
  545.     if (this._eventCallback)
  546.         this._eventCallback(result);
  547.     if (result === 0)
  548.         $gameSystem.onQuestionEnd();
  549. };
  550.  
  551. InterrogationManager.updateInterrogateEnd = function() {
  552.     if (this.isInterrogationTest()) {
  553.         AudioManager.stopBgm();
  554.         SceneManager.exit();
  555.     }
  556.     else
  557.         SceneManager.pop();
  558.     this._phase = null;
  559. };
  560.  
  561. InterrogationManager.makeRewards = function() {
  562.     this._rewards = {};
  563.     // THINKING EXP WILL WORK BASED ON YOUR STYLE
  564.     // IF YOU MANIPULATE, MANIPULATION +10
  565.     // IF YOU ARE KIND, KINDNESS +20
  566.     // Etc...
  567.     //Check WORK ON THIS LATER
  568.     this._rewards.manipulationExp = 0;
  569.     this._rewards.kindnessExp = 0;
  570.     this._rewards.clue = null;
  571. };
  572.  
  573. InterrogationManager.displayVictoryMessage = function() {
  574.     $gameMessage.add(TextManager.victory.format($gameParty.name()));
  575. };
  576.  
  577. InterrogationManager.displayDefeatMessage = function() {
  578.     $gameMessage.add(TextManager.defeat.format($gameParty.name()));
  579. };
  580.  
  581. InterrogationManager.displayRewards = function() {
  582.     this.displayExp();
  583.     this.displayClue();
  584. };
  585.  
  586. InterrogationManager.displayExp = function() {
  587.     var manipulationExp = this._rewards.manipulationExp;
  588.     var kindnessExp = this._rewards.kindnessExp;
  589.     if (manipulationExp > 0){
  590.         var text = TextManager.obtainExp.format(manipulationExp, TextManager.exp);
  591.         $gameMessage.add('\\.' + text);
  592.     }
  593.     if (kindnessExp > 0){
  594.         var text = TextManager.obtainExp.format(kindnessExp, TextManager.exp);
  595.         $gameMessage.add('\\.' + text);
  596.     }
  597. };
  598.  
  599. InterrogationManager.displayClue = function() {
  600.     var clue = this._rewards.clue;
  601.     if (clue){
  602.         $gameMessage.newPage();
  603.         $gameMessage.add(TextManager.obtainClue.format(clue.name));
  604.     }
  605. };
  606.  
  607. InterrogationManager.gainRewards = function() {
  608.     this.gainExp();
  609.     this.gainClue();
  610. };
  611.  
  612. InterrogationManager.gainExp = function() {
  613.     var manipulationExp = this._rewards.manipulationExp;
  614.     var kindnessExp = this._rewards.kindnessExp;
  615.     $gameParty.allMembers().forEach(function(actor) {
  616.         actor.gainManipulationExp(manipulationExp);
  617.         actor.gainKindnessExp(kindnessExp);
  618.     });
  619. };
  620.  
  621. InterrogationManager.gainClue = function() {
  622.     var clue = this._rewards.clue;
  623.     $gameParty.gainItem(clue, 1);
  624. };
  625.  
  626.  
  627.  
  628. //-----------------------------------------------------------------------------
  629. // Spriteset_Interrogate
  630. //
  631. // The set of sprites for the interrogation screen.
  632.  
  633. function Spriteset_Interrogate() {
  634.     this.initialize.apply(this, arguments);
  635. }
  636.  
  637. Spriteset_Interrogate.prototype = Object.create(Spriteset_Base.prototype);
  638. Spriteset_Interrogate.prototype.constructor = Spriteset_Interrogate;
  639.  
  640. Spriteset_Interrogate.prototype.initialize = function() {
  641.     Spriteset_Base.prototype.initialize.call(this);
  642.     this._battlebackLocated = false;
  643. };
  644.  
  645. Spriteset_Interrogate.prototype.createLowerLayer = function() {
  646.     Spriteset_Base.prototype.createLowerLayer.call(this);
  647.     this.createBackground();
  648.     this.createBattleField();
  649.     this.createBattleback();
  650.     //Check READD WHEN DONE
  651.     //this.createEnemy();
  652. };
  653.  
  654. Spriteset_Interrogate.prototype.createBackground = function() {
  655.     this._backgroundSprite = new Sprite();
  656.     this. _backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  657.     this._baseSprite.addChild(this._backgroundSprite);
  658. };
  659.  
  660. Spriteset_Interrogate.prototype.update = function() {
  661.     Spriteset_Base.prototype.update.call(this);
  662.     //Check
  663.     //this.updateActors();
  664.     this.updateBattleback();
  665. };
  666.  
  667. Spriteset_Interrogate.prototype.createBattleField = function() {
  668.     var width = Graphics.boxWidth;
  669.     var height = Graphics.boxHeight;
  670.     var x = (Graphics.width - width) / 2;
  671.     var y = (Graphics.height - height) / 2;
  672.     this._battleField = new Sprite();
  673.     this._battleField.setFrame(x, y, width, height);
  674.     this._battleField.x = x;
  675.     this._battleField.y = y;
  676.     this._baseSprite.addChild(this._battleField);
  677. };
  678.  
  679. Spriteset_Interrogate.prototype.createBattleback = function() {
  680.     var margin = 32;
  681.     var x = -this._battleField.x - margin;
  682.     var y = -this._battleField.y - margin;
  683.     var width = Graphics.width + margin * 2;
  684.     var height = Graphics.height + margin * 2;
  685.     this._back1Sprite = new TilingSprite();
  686.     this._back2Sprite = new TilingSprite();
  687.     this._back1Sprite.bitmap = this.battleback1Bitmap();
  688.     this._back2Sprite.bitmap = this.battleback2Bitmap();
  689.     this._back1Sprite.move(x, y, width, height);
  690.     this._back2Sprite.move(x, y ,width, height);
  691.     this._battleField.addChild(this._back1Sprite);
  692.     this._battleField.addChild(this._back2Sprite);
  693. };
  694.  
  695. Spriteset_Interrogate.prototype.updateBattleback = function() {
  696.     if (!this._battlebackLocated){
  697.         this.locateBattleback();
  698.         this._battlebackLocated = true;
  699.     }
  700. };
  701.  
  702. Spriteset_Interrogate.prototype.locateBattleback = function() {
  703.     var width = this._battleField.width;
  704.     var height = this._battleField.height;
  705.     var sprite1 = this._back1Sprite;
  706.     var sprite2 = this._back2Sprite;
  707.     sprite1.origin.x = sprite1.x + (sprite1.bitmap.width - width) / 2;
  708.     sprite2.origin.x = sprite1.y+ (sprite2.bitmap.width - width) / 2;
  709. };
  710.  
  711. Spriteset_Interrogate.prototype.battleback1Bitmap = function() {
  712.     return ImageManager.loadBattleback1(this.battleback1Name());
  713. };
  714.  
  715. Spriteset_Interrogate.prototype.battleback2Bitmap = function() {
  716.     return ImageManager.loadBattleback2(this.battleback2Name());
  717. };
  718.  
  719. Spriteset_Interrogate.prototype.battleback1Name = function() {
  720.     if (InterrogationManager.isInterrogationTest())
  721.         return $dataSystem.battleback1Name;
  722.     else if ($gameMap.battleback1Name())
  723.         return $gameMap.battleback1Name();
  724.     else
  725.         return '';
  726. };
  727.  
  728. Spriteset_Interrogate.prototype.battleback2Name = function() {
  729.     if (InterrogationManager.isInterrogationTest())
  730.         return $dataSystem.battleback2Name;
  731.     else if ($gameMap.battleback2Name())
  732.         return $gameMap.battleback2Name();
  733.     else
  734.         return '';
  735. };
  736.  
  737.  
  738.  
  739.  
  740. //-----------------------------------------------------------------------------
  741. // Window_InterrogateLog
  742. //
  743. // The window for displaying interrogation progress. No frame is displayed, but it is
  744. // handled as a window for convenience.
  745.  
  746. function Window_InterrogateLog() {
  747.     this.initialize.apply(this,arguments);
  748. }
  749.  
  750. Window_InterrogateLog.prototype = Object.create(Window_Selectable.prototype);
  751. Window_InterrogateLog.prototype.constructor = Window_InterrogateLog;
  752.  
  753. Window_InterrogateLog.prototype.initialize = function() {
  754.     var width = this.windowWidth();
  755.     var height = this.windowHeight();
  756.     Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
  757.     this.opacity = 0;
  758.     this._lines = [];
  759.     this._methods = [];
  760.     this._waitCount = 0;
  761.     this._waitMode = '';
  762.     this._baseLineStack = [];
  763.     this._spriteset = null;
  764.     this.createBackBitmap();
  765.     this.createBackSprite();
  766.     this.refresh();
  767. };
  768.  
  769. //BEGIN FROM HERE
  770. //Window_BattleLog.prototype.setSpriteset
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement