设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 849|回复: 2
打印 上一主题 下一主题

[已经过期] 跳舞機插件問題

[复制链接]

Lv2.观梦者

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
帖子
873
跳转到指定楼层
1
发表于 2016-2-18 15:16:40 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 小叮鈴 于 2016-2-18 15:27 编辑

https://atelierrgss.wordpress.com/rmv-theatrhythm/

這個插件 用了半天就是不成功



會出現這情況,怎麼回事?

我也把圖片複製到/ IMG / Theatrhythm /了

然而我發現跟YEP的HP插件有關 貌似血條的問題
http://yanfly.moe/2015/11/21/yep-30-visual-hp-gauges/

但是我把怪物設定為
<Hide HP Gauge>

不顯示血條 依然還是出錯


JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // MOG_Theatrhythm.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc (v1.2) Minigame baseado no jogo Final Fantasy Theatrhythm.
  7.  * @author Moghunter
  8.  *
  9.  * @param >> MAIN ===================
  10.  * @desc
  11.  * @default
  12.  *
  13.  * @param Points Variable ID
  14.  * @desc Definição da variável que ficara guardada a quantidade de Pontos.
  15.  * @default 5
  16.  *
  17.  * @param Result Switch ID
  18.  * @desc Definição da switch que corresponde a vitória ou derrota do minigame.
  19.  * @default 10
  20.  *
  21.  * @param Score Base
  22.  * @desc Definição do valor basico dos pontos.
  23.  * @default 10
  24.  *
  25.  * @param Chain Bonus
  26.  * @desc Definição do valor dos pontos ganhos fazer combos.
  27.  * @default 5
  28.  *
  29.  * @param Critical Bonus Percentage
  30.  * @desc Definição da porcentagem ao fazer danos críticos.
  31.  * @default 1.5  
  32.  *
  33.  * @param Max Chain Bonus Percentage
  34.  * @desc Definição da porcentagem ganho no resultado final.
  35.  * @default 0.01
  36.  *
  37.  * @param Miss Dmg Percentage
  38.  * @desc Definição da porcentagem de dano ao errar ou deixar o botão passar.
  39.  * @default 0
  40.  *
  41.  * @param BP Base Value
  42.  * @desc Definição do valor base do Battle Power.
  43.  * @default 50
  44.  *
  45.  * @param Enemy Atk Animation
  46.  * @desc Definição da animação padrão do ataque inimigo.
  47.  * @default 1
  48.  *
  49.  * @param >> POSITION ===================
  50.  * @desc
  51.  * @default
  52.  *
  53.  * @param Actor X-Axis
  54.  * @desc Definição X-Axis personagem.
  55.  * @default 700  
  56.  *
  57.  * @param Actor Y-Axis
  58.  * @desc Definição Y-Axis personagem.
  59.  * @default 320
  60.  *
  61.  * @param Actor Space Y
  62.  * @desc Definição espaço entre os personagens.
  63.  * @default 80
  64.  *
  65.  * @param Enemy X-Axis
  66.  * @desc Definição da posição X-axis do inimigo.
  67.  * @default 180  
  68.  *
  69.  * @param Enemy Y-Axis
  70.  * @desc Definição da posição Y-axis do inimigo.
  71.  * @default 340
  72.  *
  73.  * @param Button Layout X
  74.  * @desc Definição X-Axis do layout dos botões.
  75.  * @default -62
  76.  *
  77.  * @param Button Layout Y
  78.  * @desc Definição Y-Axis do layout dos botões.
  79.  * @default 5
  80.  *
  81.  * @param Button Flash X
  82.  * @desc Definição X-Axis do flash.
  83.  * @default -140
  84.  *
  85.  * @param Button Flash Y
  86.  * @desc Definição Y-Axis do flash.
  87.  * @default -1
  88.  *
  89.  * @param String X
  90.  * @desc Definição X-Axis das palavras dos botões.
  91.  * @default 130
  92.  *
  93.  * @param String Y
  94.  * @desc Definição Y-Axis das palavras dos botões.
  95.  * @default 0
  96.  *
  97.  * @param Face X
  98.  * @desc Definição X-Axis da face do personagem.
  99.  * @default 420
  100.  *
  101.  * @param Face Y
  102.  * @desc Definição Y-Axis da face do personagem.
  103.  * @default 5     
  104.  *
  105.  * @param Enemy HP Gauge X
  106.  * @desc Definição X-Axis do HP inimigo.
  107.  * @default 17           
  108.  *
  109.  * @param Enemy HP Gauge Y
  110.  * @desc Definição Y-Axis do HP inimigo.
  111.  * @default 600
  112.  *
  113.  * @param Enemy HP Number X
  114.  * @desc Definição Y-Axis do HP inimigo.
  115.  * @default 280
  116.  *
  117.  * @param Enemy HP Number Y
  118.  * @desc Definição Y-Axis do HP inimigo.
  119.  * @default 575
  120.  *
  121.  * @param Party HP Gauge X
  122.  * @desc Definição X-Axis do HP do grupo.
  123.  * @default 573
  124.  *
  125.  * @param Party HP Gauge Y
  126.  * @desc Definição Y-Axis do HP do grupo.
  127.  * @default 30
  128.  *
  129.  * @param Party HP Number X
  130.  * @desc Definição X-Axis do HP do grupo.
  131.  * @default 790
  132.  *
  133.  * @param Party HP Number Y
  134.  * @desc Definição Y-Axis do HP do grupo.
  135.  * @default 32
  136.  *
  137.  * @param Score X
  138.  * @desc Definição X-Axis dos pontos.
  139.  * @default 300
  140.  *
  141.  * @param Score Y
  142.  * @desc Definição Y-Axis dos pontos.
  143.  * @default 10
  144.  *
  145.  * @param Chain X
  146.  * @desc Definição X-Axis do Combo.
  147.  * @default 430
  148.  *
  149.  * @param Chain Y
  150.  * @desc Definição Y-Axis do Combo.
  151.  * @default 130
  152.  *
  153.  * @param Chain Number X
  154.  * @desc Definição X-Axis do numero do Combo.
  155.  * @default 0
  156.  *
  157.  * @param Chain Number Y
  158.  * @desc Definição Y-Axis do numero do Combo.
  159.  * @default 20  
  160.  *
  161.  * @param BP Party X
  162.  * @desc Definição X-axis do BP.
  163.  * @default 615
  164.  *
  165.  * @param BP Party Y
  166.  * @desc Definição Y-axis do BP.
  167.  * @default 95
  168.  *
  169.  * @param BP Enemy X
  170.  * @desc Definição X-axis do BP.
  171.  * @default -70
  172.  *
  173.  * @param BP Enemy Y
  174.  * @desc Definição Y-axis do BP.
  175.  * @default 515
  176.  *
  177.  * @param Phase X
  178.  * @desc Definição X-axis da fase.
  179.  * @default 0
  180.  *
  181.  * @param Phase Y
  182.  * @desc Definição Y-axis da fase.
  183.  * @default 192
  184.  *
  185.  * @param Result X
  186.  * @desc Definição X-axis do resultado.
  187.  * @default 520
  188.  *
  189.  * @param Result Y
  190.  * @desc Definição Y-axis do resultado.
  191.  * @default 240
  192.  *
  193.  * @param Result Font Size
  194.  * @desc Definição do tamanho da fonte.
  195.  * @default 28
  196.  *
  197.  * @param Total X
  198.  * @desc Definição X-axis do total.
  199.  * @default 200  
  200.  *
  201.  * @param Total Y
  202.  * @desc Definição Y-axis do total.
  203.  * @default 330
  204.  *
  205.  * @param Total Font Size
  206.  * @desc Definição do tamanho da fonte.
  207.  * @default 32
  208.  *
  209.  * @param E Name X
  210.  * @desc Definição X-axis do nome do inimigo.
  211.  * @default 300
  212.  *
  213.  * @param E Name Y
  214.  * @desc Definição X-axis do nome do inimigo.
  215.  * @default 575
  216.  *
  217.  * @param E Name Font Size
  218.  * @desc Definição do tamanho da fonte.
  219.  * @default 24
  220.  *
  221.  * @help  
  222.  * =============================================================================
  223.  * +++ MOG - Theatrhythm (v1.2) +++
  224.  * By Moghunter
  225.  * [url]https://atelierrgss.wordpress.com/[/url]
  226.  * =============================================================================
  227.  * Minigame baseado no jogo Final Fantasy Theatrhythm.
  228.  * Os pontos ganhos ao final do mini game serão gravados em uma variável onde
  229.  * poderão posteriormente ser usados durante o jogo.
  230.  * =============================================================================
  231.  * É necessário ter as imagens básicas do sistema gravas na pasta:
  232.  *
  233.  * /img/theatrhythm/
  234.  *
  235.  * =============================================================================
  236.  * Para chamar a cena use o comando abaixo.
  237.  *
  238.  * theatrhythm : EnemyID : Speed
  239.  *
  240.  * Exemplo
  241.  *
  242.  * theatrhythm : 1 : 5
  243.  *
  244.  * =============================================================================
  245.  * Para definir uma animação específica de ataque do inimigo use o comentário
  246.  * abaixo na caixa de notas do inimigo.
  247.  *
  248.  * Theatrhythm Action Animation: X
  249.  *
  250.  * =============================================================================
  251.  * HITSTÓRICO
  252.  * =============================================================================
  253.  * (v1.2) - Correção do Crash relativo as Tags.
  254.  * (v1.1) - Correção de prosseguir os comandos de eventos antes da cena do
  255.  *          Theatrhythm terminar.
  256.  *        - Adicionado a switch de resultado do minigame.
  257.  *
  258.  */
  259.  
  260. //=============================================================================
  261. // ** PLUGIN PARAMETERS
  262. //=============================================================================
  263.   var Imported = Imported || {};
  264.   Imported.MOG_Theatrhythm = true;
  265.   var Moghunter = Moghunter || {};
  266.  
  267.    Moghunter.parameters = PluginManager.parameters('MOG_Theatrhythm');  
  268.         Moghunter.theatrhythm_variable_id = Number(Moghunter.parameters['Points Variable ID'] || 5);
  269.         Moghunter.theatrhythm_base_score = Number(Moghunter.parameters['Score Base'] || 10);
  270.         Moghunter.theatrhythm_chain_bonus = Number(Moghunter.parameters['Chain Bonus'] || 5);       
  271.         Moghunter.theatrhythm_critical_bonus = Number(Moghunter.parameters['Critical Bonus Percentage'] || 1.5);
  272.         Moghunter.theatrhythm_result_chain_bonus = Number(Moghunter.parameters['Max Chain Bonus Percentage'] || 0.01);                   
  273.         Moghunter.theatrhythm_miss_dmg_per = Number(Moghunter.parameters['Miss Dmg Percentage'] || 0);
  274.         Moghunter.theatrhythm_bp_base_value = Number(Moghunter.parameters['BP Base Value'] || 50);
  275.         Moghunter.theatrhythm_enemy_atk_ani = Number(Moghunter.parameters['Enemy Atk Animation'] || 1);  
  276.     Moghunter.theatrhythm_actor_x = Number(Moghunter.parameters['Actor X-Axis'] || 700);
  277.         Moghunter.theatrhythm_actor_y = Number(Moghunter.parameters['Actor Y-Axis'] || 320);
  278.         Moghunter.theatrhythm_actor_spc_y = Number(Moghunter.parameters['Actor Space Y'] || 80);                       
  279.         Moghunter.theatrhythm_enemy_x = Number(Moghunter.parameters['Enemy X-Axis'] || 180);
  280.         Moghunter.theatrhythm_enemy_y = Number(Moghunter.parameters['Enemy Y-Axis'] || 340);                               
  281.         Moghunter.theatrhythm_button_layout_x = Number(Moghunter.parameters['Button Layout X'] || -62);
  282.         Moghunter.theatrhythm_button_layout_y = Number(Moghunter.parameters['Button Layout Y'] || 5);       
  283.     Moghunter.theatrhythm_button_flash_x = Number(Moghunter.parameters['Button Flash X'] || -140);
  284.     Moghunter.theatrhythm_button_flash_y = Number(Moghunter.parameters['Button Flash Y'] || -1);
  285.     Moghunter.theatrhythm_string_x = Number(Moghunter.parameters['String X'] || 130);
  286.         Moghunter.theatrhythm_string_y = Number(Moghunter.parameters['String Y'] || 0);
  287.     Moghunter.theatrhythm_face_x = Number(Moghunter.parameters['Face X'] || 420);
  288.         Moghunter.theatrhythm_face_y = Number(Moghunter.parameters['Face Y'] || 5);               
  289.         Moghunter.theatrhythm_time_meter_x = Number(Moghunter.parameters['Enemy HP Gauge X'] || 17);
  290.         Moghunter.theatrhythm_time_meter_y = Number(Moghunter.parameters['Enemy HP Gauge Y'] || 600);       
  291.         Moghunter.theatrhythm_enemy_hp_number_x = Number(Moghunter.parameters['Enemy HP Number X'] || 280);
  292.         Moghunter.theatrhythm_enemy_hp_number_y = Number(Moghunter.parameters['Enemy HP Number Y'] || 575);       
  293.         Moghunter.theatrhythm_hp_meter_x = Number(Moghunter.parameters['Party HP Gauge X'] || 573);
  294.         Moghunter.theatrhythm_hp_meter_y = Number(Moghunter.parameters['Party HP Gauge Y'] || 30);               
  295.         Moghunter.theatrhythm_actor_hp_number_x = Number(Moghunter.parameters['Party HP Number X'] || 790);
  296.         Moghunter.theatrhythm_actor_hp_number_y = Number(Moghunter.parameters['Party HP Number Y'] || 32);               
  297.         Moghunter.theatrhythm_score_x = Number(Moghunter.parameters['Score X'] || 300);
  298.         Moghunter.theatrhythm_score_y = Number(Moghunter.parameters['Score Y'] || 10);               
  299.         Moghunter.theatrhythm_chain_x = Number(Moghunter.parameters['Chain X'] || 430);
  300.         Moghunter.theatrhythm_chain_y = Number(Moghunter.parameters['Chain Y'] || 130);                       
  301.         Moghunter.theatrhythm_chain_number_x = Number(Moghunter.parameters['Chain Number X'] || 0);
  302.         Moghunter.theatrhythm_chain_number_y = Number(Moghunter.parameters['Chain Number Y'] || 20);       
  303.         Moghunter.theatrhythm_bp_visible = String(Moghunter.parameters['BP Visible'] || true);       
  304.         Moghunter.theatrhythm_bp_party_x = Number(Moghunter.parameters['BP Party X'] || 615);
  305.     Moghunter.theatrhythm_bp_party_y = Number(Moghunter.parameters['BP Party Y'] || 95);
  306.         Moghunter.theatrhythm_bp_enemy_x = Number(Moghunter.parameters['BP Enemy X'] || -70);
  307.     Moghunter.theatrhythm_bp_enemy_y = Number(Moghunter.parameters['BP Enemy Y'] || 515);               
  308.         Moghunter.theatrhythm_phase_x = Number(Moghunter.parameters['Phase X'] || 0);
  309.         Moghunter.theatrhythm_phase_y = Number(Moghunter.parameters['Phase Y'] || 192);               
  310.         Moghunter.theatrhythm_result_x = Number(Moghunter.parameters['Result X'] || 520);
  311.         Moghunter.theatrhythm_result_y = Number(Moghunter.parameters['Result Y'] || 240);
  312.         Moghunter.theatrhythm_result_font_size = Number(Moghunter.parameters['Result Font Size'] || 28);       
  313.         Moghunter.theatrhythm_result_total_x = Number(Moghunter.parameters['Total X'] || 200);
  314.         Moghunter.theatrhythm_result_total_y = Number(Moghunter.parameters['Total Y'] || 330);
  315.         Moghunter.theatrhythm_result_total_font_size = Number(Moghunter.parameters['Total Font Size'] || 32);
  316.         Moghunter.theatrhythm_name_x = Number(Moghunter.parameters['E Name X'] || 300);
  317.         Moghunter.theatrhythm_name_y = Number(Moghunter.parameters['E Name Y'] || 575);
  318.         Moghunter.theatrhythm_name_font_size = Number(Moghunter.parameters['E Name Font Size'] || 24);
  319.         Moghunter.theatrhythm_result_switch_id = Number(Moghunter.parameters['Result Switch ID'] || 10);
  320.  
  321. //=============================================================================
  322. // ** Load Theatrhythm
  323. //=============================================================================       
  324. ImageManager.loadTheatrhythm = function(filename) {
  325.     return this.loadBitmap('img/theatrhythm/', filename, 0, true);
  326. };
  327.  
  328. //=============================================================================
  329. // ** Game_Interpreter
  330. //=============================================================================       
  331.  
  332. //==============================
  333. // * PluginCommand
  334. //==============================
  335. var _alias_mog_Theatrhythm_pluginCommand = Game_Interpreter.prototype.pluginCommand
  336. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  337.         _alias_mog_Theatrhythm_pluginCommand.call(this,command, args)
  338.         if (command === "theatrhythm")  {
  339.                  if (args.length >= 4) {               
  340.                  var enemy_id = Math.min(Math.max(args[1],1),$dataEnemies.length - 1);                 
  341.                      var speed = Math.min(Math.max(args[3],1),20);
  342.                      $gameSystem._theatrhythm_data = [enemy_id,speed];
  343.                          $gameSystem._theatrhythm_start = true;
  344.                          this.wait(10);
  345.             };
  346.     };       
  347.         return true;
  348. };
  349.  
  350. //=============================================================================
  351. // ** Scene Map
  352. //=============================================================================       
  353.  
  354. //==============================
  355. // * update
  356. //==============================
  357. var _alias_mog_theatrhythm_scmap_update = Scene_Map.prototype.update
  358. Scene_Map.prototype.update = function() {
  359.         _alias_mog_theatrhythm_scmap_update.call(this);
  360.         if ($gameSystem._theatrhythm_start) {this.execute_theatrhythm()};
  361. };
  362.  
  363. //==============================
  364. // * execute theatrhythm
  365. //==============================
  366. Scene_Map.prototype.execute_theatrhythm = function() {
  367.                 $gameSystem._theatrhythm_start = false;
  368.                 this.startFadeOut(this.fadeSpeed());
  369.                 $gameSystem.theatrhythm();
  370. };
  371.  
  372. //=============================================================================
  373. // ** Scene_System
  374. //=============================================================================       
  375.  
  376. //==============================
  377. // * Theatrhythm
  378. //==============================
  379. var _alias_mog_theatrhythm_gsy_initialize = Game_System.prototype.initialize
  380. Game_System.prototype.initialize = function() {
  381.     _alias_mog_theatrhythm_gsy_initialize.call(this);       
  382.         this._theatrhythm = false;
  383.         this._theatrhythm_start = false;
  384.         this._theatrhythm_data = [1,1];
  385.         this._theatrhythm_phase = 0;
  386.         this._theatrhythm_miss_dmg = false;
  387.         this._theatrhythm_key_data = [null,0,0,0];
  388.         this._theatrhythm_chain_data = [0,0];
  389.         this._theatrhythm_score_data = [0,0];               
  390.         Input.keyMapper[65] = 'a';
  391.     Input.keyMapper[83] = 's';
  392. };
  393.  
  394. //==============================
  395. // * Theatrhythm
  396. //==============================
  397. Game_System.prototype.theatrhythm = function() {
  398.         if ($gameParty.battleMembers().length === 0) {return};
  399.     SceneManager.push(Scene_Theatrhythm);
  400. };
  401.  
  402. //=============================================================================
  403. // ** Game Battler
  404. //=============================================================================       
  405.  
  406. //==============================
  407. // * Notetags
  408. //==============================
  409. Game_Battler.prototype.notetags = function() {
  410.         if (this.isEnemy()) {return this.enemy().note.split(/[\r\n]+/)};
  411.         if (this.isActor()) {return this.actor().note.split(/[\r\n]+/)};
  412. };
  413.  
  414. //==============================
  415. // ** iniMembers
  416. //==============================
  417. var _alias_mog_theatrhythm_gbattler_initMembers = Game_Battler.prototype.initMembers;
  418. Game_Battler.prototype.initMembers = function() {
  419.         _alias_mog_theatrhythm_gbattler_initMembers.call(this);
  420.         this._motion_damage_duration = 0;
  421.         this._motion_damage_xy = [0,0];
  422.         this._theatrhythm_ani_id = Math.max(Moghunter.theatrhythm_enemy_atk_ani,1);
  423.         this.clear_action_data();
  424. };
  425.  
  426. //==============================
  427. // ** Clear Action Data
  428. //==============================
  429. Game_Battler.prototype.clear_action_data = function() {
  430.         this._motion_action_data = [0,0,0,0];
  431.         this._motion_action_xy = [0,0];
  432.         this._motion_action_scale = [0,0];
  433.         this._motion_action_rotation = 0;
  434. };
  435. //==============================
  436. // ** Motion Shake
  437. //==============================
  438. Game_Battler.prototype.motion_shake = function() {
  439.         this._motion_damage_duration = 30;
  440. };
  441.  
  442. //=============================================================================
  443. // ** Game Actor
  444. //=============================================================================       
  445.  
  446. //==============================
  447. // * isSpriteVisible
  448. //==============================
  449. Game_Actor.prototype.isSpriteVisible = function() {
  450.         if ($gameSystem._theatrhythm) {return true};
  451.    return $gameSystem.isSideView();
  452. };
  453.  
  454. //=============================================================================
  455. // ** Game Enemy
  456. //=============================================================================       
  457.  
  458. //==============================
  459. // * Setup
  460. //==============================
  461. var _alias_mog_theatrhythm_setup = Game_Enemy.prototype.setup;
  462. Game_Enemy.prototype.setup = function(enemyId, x, y) {
  463.         _alias_mog_theatrhythm_setup.call(this,enemyId, x, y);
  464.     this.notetags().forEach(function(note) {
  465.          var note_data = note.split(': ')
  466.                  if (note_data[0].toLowerCase() == "theatrhythm action animation"){
  467.                          var par = note_data[1].split(':');
  468.                      this._theatrhythm_ani_id = Number(par[0]);
  469.                  };
  470.         },this);
  471. };
  472.  
  473. //=============================================================================
  474. // ** Sprite Battler
  475. //=============================================================================       
  476.  
  477. //==============================
  478. // * Update Position
  479. //==============================
  480. var _alias_mog_theatrhythm_sprbtr_updatePosition = Sprite_Battler.prototype.updatePosition;
  481. Sprite_Battler.prototype.updatePosition = function() {
  482.         _alias_mog_theatrhythm_sprbtr_updatePosition.call(this);
  483.         if ( $gameSystem._theatrhythm) {this.update_theatrhythm()};
  484. };
  485.  
  486. //==============================
  487. // * Update Position
  488. //==============================
  489. Sprite_Battler.prototype.update_theatrhythm = function() {               
  490.         if (!Imported.MOG_BattlerMotion) {
  491.                 if (this._battler) {
  492.                         if (this._battler._motion_damage_duration > 0) {this.update_motion_damage()};
  493.                         if (this._battler._motion_action_data[0] === 7) {this.update_action_move_right();};
  494.                         this.x += this._battler._motion_action_xy[0];
  495.                         this.y += this._battler._motion_action_xy[1];
  496.             };
  497.         };
  498.         if (this._battler.isEnemy() && $gameSystem._theatrhythm_phase === 10) {this.opacity -= 5}
  499. };
  500.  
  501. //==============================
  502. // * Update Motion Damage
  503. //==============================
  504. Sprite_Battler.prototype.update_motion_damage = function() {
  505.          this._battler._motion_damage_xy[0] = (Math.random() * 12) - 6;
  506.          this._battler._motion_damage_duration -= 1;
  507.          if (this._battler._motion_damage_duration <= 0) {this._battler._motion_damage_xy = [0,0]};
  508.          this.x += this._battler._motion_damage_xy[0];
  509. };
  510.  
  511. //==============================
  512. // * Update Move Right
  513. //==============================
  514. Sprite_Battler.prototype.update_action_move_right = function() {
  515.       this._battler._motion_action_data[1] += 1
  516.           if (this._battler._motion_action_data[1] < 15) {
  517.                   this._battler._motion_action_xy[0] += 6;
  518.           }       
  519.           else if (this._battler._motion_action_data[1] < 30) {        
  520.                   this._battler._motion_action_xy[0] -= 6;
  521.           }
  522.           else {
  523.               this._battler.clear_action_data();
  524.       };
  525. };
  526.  
  527. //=============================================================================
  528. // ** Scene_Theatrhythm
  529. //=============================================================================       
  530. function Scene_Theatrhythm() {
  531.     this.initialize.apply(this, arguments);
  532. }
  533.  
  534. Scene_Theatrhythm.prototype = Object.create(Scene_Base.prototype);
  535. Scene_Theatrhythm.prototype.constructor = Scene_Theatrhythm;
  536.  
  537. //==============================
  538. // * Initialize
  539. //==============================
  540. Scene_Theatrhythm.prototype.initialize = function() {
  541.     Scene_Base.prototype.initialize.call(this);       
  542.         $gameSystem._theatrhythm = true;
  543.         $gameSystem._theatrhythm_phase = 0;
  544.         $gameSystem._theatrhythm_miss_dmg = false;
  545.         $gameSystem._theatrhythm_key_data = [null,0,0,0];
  546.         $gameSystem._theatrhythm_chain_data[0] = 0;
  547.         $gameSystem._theatrhythm_score_data[0] = 0;
  548.         this._result_data = [0,0];
  549.         BattleManager.saveBgmAndBgs();
  550.         AudioManager.fadeOutBgm(2);
  551.         AudioManager.stopBgs();
  552.         $gameSwitches._data[Moghunter.theatrhythm_result_switch_id] = false;
  553.         if (!$gameVariables._data[Moghunter.theatrhythm_variable_id]) {
  554.              $gameVariables._data[Moghunter.theatrhythm_variable_id] = 0;
  555.         };
  556.         this._battlers = $gameParty.battleMembers()
  557.         for (var i = 0; i <  $gameParty.battleMembers().length; i++) {$gameParty.battleMembers()[i].recoverAll();};
  558.         this._time = [0,3000];
  559.         this._score = [-1,0,0];
  560.         this._chain_dt = [0,0];       
  561.         this._wait_time = 0;
  562.         this._phase = [0,0,0];
  563.         this._target_id = 0;
  564.         this._enemy_ref = false;
  565.     this.createDisplayObjects();
  566.         this.set_battler_parameters();
  567.         this.startFadeIn(60, false);
  568. };
  569.  
  570. //==============================
  571. // * Set Battler Parameters
  572. //==============================
  573. Scene_Theatrhythm.prototype.set_battler_parameters = function() {
  574.         this._enemy_hp = [this._enemy.hp,this._enemy.hp]
  575.         this._enemy_atk = this._enemy.atk + this._enemy.mat;
  576.         this._enemy_def = (this._enemy.def + this._enemy.mdf) / 2;
  577.         this._enemy_bp = Math.floor(((this._enemy_hp[0] / 30) + this._enemy_atk + this._enemy_def) / 3)
  578.         this._enemy_bp *= Moghunter.theatrhythm_bp_base_value;
  579.         this._party_hp = [0,0];
  580.         this._party_atk = 0;
  581.         this._party_def = 0;
  582.         for (var i = 0; i < this._battlers.length; i++) {
  583.                  this._party_hp[0] += this._battlers[i].hp;
  584.                  this._party_hp[1] += this._battlers[i].mhp;
  585.                  this._party_atk += this._battlers[i].atk;
  586.                  this._party_atk += this._battlers[i].mat;
  587.                  this._party_def += this._battlers[i].def / 2;
  588.                  this._party_def += this._battlers[i].mdf / 2;
  589.         };
  590.         this._party_hp[0] /= this._battlers.length;
  591.         this._party_hp[1] /= this._battlers.length;
  592.         this._party_atk /= this._battlers.length;
  593.         this._party_def /= this._battlers.length;
  594.         this._party_bp = Math.floor(((this._party_hp[0] / 10) + this._party_atk + this._party_def) / 3)
  595.         this._party_bp *= Moghunter.theatrhythm_bp_base_value;
  596. };
  597.  
  598. //==============================
  599. // * Load Images
  600. //==============================
  601. Scene_Theatrhythm.prototype.load_images = function() {
  602.          this._buttons_img = ImageManager.loadTheatrhythm("Theatrhythm_A");       
  603.          this._layout_buttons_img = ImageManager.loadTheatrhythm("Theatrhythm_B");
  604.      this._layout_buttons_img2 = ImageManager.loadTheatrhythm("Theatrhythm_C");
  605.          this._string_img = ImageManager.loadTheatrhythm("Theatrhythm_D");
  606.          this._layout_img = ImageManager.loadTheatrhythm("Theatrhythm_E");
  607.          this._time_meter_img = ImageManager.loadTheatrhythm("Theatrhythm_F");
  608.          this._hp_meter_img = ImageManager.loadTheatrhythm("Theatrhythm_G");
  609.          this._score_img = ImageManager.loadTheatrhythm("Theatrhythm_H");
  610.          this._chain_img = ImageManager.loadTheatrhythm("Theatrhythm_I");
  611.          this._chain_number_img = ImageManager.loadTheatrhythm("Theatrhythm_J");
  612.          this._hp_number_1_img = ImageManager.loadTheatrhythm("Theatrhythm_L");
  613.          this._phase_img = ImageManager.loadTheatrhythm("Theatrhythm_M");
  614.          this._damage_img = ImageManager.loadTheatrhythm("Theatrhythm_N");
  615. };
  616.  
  617. //==============================
  618. // * CreateDisplayObjects
  619. //==============================
  620. Scene_Theatrhythm.prototype.createDisplayObjects = function() {
  621.         this.load_images();
  622.         this._spriteField = new Sprite();       
  623.         this.addChild(this._spriteField);
  624.         this._spriteHudBase = new Sprite();
  625.         this.addChild(this._spriteHudBase);
  626.     this.createScenario();
  627.         this.createActors();
  628.         this.createEnemy();
  629.         this.createLayoutBase();
  630.         this.createLayoutButtons();       
  631.         this.createLayout();
  632.         this.createFace();
  633.         this.createTimeMeter();
  634.         this.createEnemyHpNumber();
  635.         this.createHpMeter();
  636.         this.createActorHpNumber();
  637.         this.createEnemyName();
  638.         this.createScore();
  639.         this.createChain();
  640.         this.createBattlePower();
  641.         this.createDamage();
  642.         this.createPhaseSprite();
  643.         this.createText();
  644. };
  645.  
  646. //==============================
  647. // * createLayout
  648. //==============================
  649. Scene_Theatrhythm.prototype.createLayout = function() {       
  650.      this._layout = new Sprite(this._layout_img);
  651.          this._spriteHudBase.addChild(this._layout);       
  652. };
  653.  
  654. //==============================
  655. // * createPhaseSprite
  656. //==============================
  657. Scene_Theatrhythm.prototype.createPhaseSprite = function() {       
  658.      this._phase_sprite_data = [-1,-1]
  659.      this._phase_sprite = new Sprite(this._phase_img);
  660.          this._phase_sprite.x = Moghunter.theatrhythm_phase_x;
  661.          this._phase_sprite.y = Moghunter.theatrhythm_phase_y;
  662.          this._phase_sprite.anchor.x = 0.5;
  663.          this._phase_sprite.anchor.y = 0.5;
  664.          this._phase_sprite.opacity = 0;
  665.          this.refresh_phase_sprite(0);
  666.          this._spriteHudBase.addChild(this._phase_sprite);       
  667. };
  668.  
  669. //==============================
  670. // * Refresh Phase Sprite
  671. //==============================
  672. Scene_Theatrhythm.prototype.refresh_phase_sprite = function(type) {
  673.          this._phase_sprite.opacity = 0;
  674.          this._phase_sprite.scale.x = 2;
  675.          this._phase_sprite.scale.y = 2;
  676.          this._phase_sprite.setFrame(0,type * this._phase_sprite_data[1],this._phase_sprite_data[0],this._phase_sprite_data[1]);
  677. };
  678.  
  679. //==============================
  680. // * createText
  681. //==============================
  682. Scene_Theatrhythm.prototype.createText = function() {       
  683.      this._text_sprite = new Sprite(new Bitmap(200,160));
  684.          this._text_sprite.anchor.x = 0.5;
  685.          this._text_sprite.anchor.y = 0.5;
  686.          this._text_sprite.x = Moghunter.theatrhythm_result_x + 100;
  687.          this._text_sprite.y = Moghunter.theatrhythm_result_y + 50;
  688.          this._text_sprite.bitmap.fontSize = Moghunter.theatrhythm_result_font_size;
  689.          this._spriteHudBase.addChild(this._text_sprite);
  690.      this._text2_sprite = new Sprite(new Bitmap(200,100));
  691.          this._text2_sprite.anchor.x = 0.5;
  692.          this._text2_sprite.anchor.y = 0.5;
  693.          this._text2_sprite.x = Moghunter.theatrhythm_result_total_x + 100;
  694.          this._text2_sprite.y = Moghunter.theatrhythm_result_total_y + 50;
  695.          this._text2_sprite.bitmap.fontSize = Moghunter.theatrhythm_result_total_font_size;
  696.          this._spriteHudBase.addChild(this._text2_sprite);                 
  697. };
  698.  
  699. //==============================
  700. // * createBattlePower
  701. //==============================
  702. Scene_Theatrhythm.prototype.createBattlePower = function() {       
  703.     this._bp_visible = false;
  704.     if (Moghunter.theatrhythm_bp_visible === "true") {this._bp_visible = true};
  705.     this._battlePower = [];
  706.         for (var i = 0; i < 2; i++) {
  707.                  this._battlePower[i] = new Sprite(new Bitmap(250,32));                 
  708.                  this._battlePower[i].bitmap.fontSize = 20;
  709.                  this._spriteHudBase.addChild(this._battlePower[i]);
  710.         };
  711.         this._battlePower[0].x = Moghunter.theatrhythm_bp_enemy_x;
  712.         this._battlePower[0].y = Moghunter.theatrhythm_bp_enemy_y;
  713.         this._battlePower[1].x = Moghunter.theatrhythm_bp_party_x;
  714.         this._battlePower[1].y = Moghunter.theatrhythm_bp_party_y;
  715. };
  716.  
  717. //==============================
  718. // * createEnemyName
  719. //==============================
  720. Scene_Theatrhythm.prototype.createEnemyName = function() {       
  721.     this._enemyName = new Sprite(new Bitmap(200,32))
  722.         this._enemyName.x = Moghunter.theatrhythm_name_x;
  723.         this._enemyName.y = Moghunter.theatrhythm_name_y;
  724.         this._enemyName.bitmap.fontSize = Moghunter.theatrhythm_name_font_size;
  725.         this._enemyName.bitmap.drawText(this._enemySprite._enemy.name(),0,0,200,32,"left")
  726.         this._spriteHudBase.addChild(this._enemyName);
  727. };
  728.  
  729. //==============================
  730. // * createScore
  731. //==============================
  732. Scene_Theatrhythm.prototype.createScore = function() {       
  733.      this._point = [];
  734.          this._point_data = [-1,-1];
  735.      for (var i = 0; i < 7; i++) {
  736.            this._point[i] = new Sprite(this._score_img);
  737.            this._point[i].visible = false;
  738.            this._point[i].y = Moghunter.theatrhythm_score_y;
  739.            this._spriteHudBase.addChild(this._point[i]);
  740.          };
  741. };
  742.  
  743. //==============================
  744. // * Update Dif
  745. //==============================
  746. Scene_Theatrhythm.prototype.update_dif = function(value,real_value,speed) {
  747.         if (value == real_value) {return value};
  748.         var dnspeed = 1 + (Math.abs(value - real_value) / speed);
  749.         if (value > real_value) {value -= dnspeed;
  750.             if (value < real_value) {value = real_value};}
  751.     else if (value < real_value) {value  += dnspeed;
  752.             if (value  > real_value) {value  = real_value};               
  753.     };
  754.         return Math.floor(value);
  755. };
  756.  
  757. //==============================
  758. // * Refresh Number
  759. //==============================
  760. Scene_Theatrhythm.prototype.refresh_number = function(sprites,value,img_data,x) {
  761.         if (value > 9999999) {value = 9999999};
  762.     numbers = Math.abs(value).toString().split("");  
  763.            for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  764.            sprites[i].visible = true;
  765.            if (i < numbers.length) {
  766.                    var n = Number(numbers[i]);
  767.                    sprites[i].setFrame(n * img_data[0], 0, img_data[0], img_data[1]);
  768.                    var nx = -(img_data[0] * i) + (img_data[0] *  numbers.length);
  769.                    sprites[i].x = x - nx;
  770.            } else {
  771.                   var n = 0;
  772.                   sprites[i].setFrame(n * img_data[0], 0, img_data[0], img_data[1]);
  773.                   var nx = -(img_data[0] * i) + (img_data[0] *  (sprites.length + numbers.length));
  774.                   sprites[i].x = x - nx;
  775.            };
  776.     };
  777. };
  778.  
  779. //==============================
  780. // * Update Score
  781. //==============================
  782. Scene_Theatrhythm.prototype.update_score = function() {       
  783.         var dif_number = this.update_dif(this._score[0],this._score[1],20)
  784.         if (this._score[0] != dif_number) {this._score[0] = dif_number;
  785.         this.refresh_number(this._point,this._score[0] ,this._point_data,this._point_data[2]);};
  786. };
  787.  
  788. //==============================
  789. // * createEnemyHPNumber
  790. //==============================
  791. Scene_Theatrhythm.prototype.createEnemyHpNumber = function() {       
  792.      this._enemyHp_Old = 0;
  793.      this._enemyHpNumber = [];
  794.          this._enemyHpNumber_data = [-1,-1];
  795.      for (var i = 0; i < 6; i++) {
  796.            this._enemyHpNumber[i] = new Sprite(this._hp_number_1_img);
  797.            this._enemyHpNumber[i].visible = false;
  798.            this._enemyHpNumber[i].x = Moghunter.theatrhythm_enemy_hp_number_x;
  799.            this._enemyHpNumber[i].y = Moghunter.theatrhythm_enemy_hp_number_y;
  800.            this._spriteHudBase.addChild(this._enemyHpNumber[i]);
  801.          };
  802. };
  803.  
  804. //==============================
  805. // * Update EnemyHpNumber
  806. //==============================
  807. Scene_Theatrhythm.prototype.update_enemyHpNumber = function() {       
  808.         var dif_number = this.update_dif(this._enemyHp_Old,this._enemy_hp[0],20)
  809.         if (this._enemyHp_Old != dif_number) {this._enemyHp_Old = dif_number;
  810.         this.refresh_number(this._enemyHpNumber,this._enemyHp_Old ,this._enemyHpNumber_data,this._enemyHpNumber_data[2]);};
  811. };
  812.  
  813. //==============================
  814. // * createDamage
  815. //==============================
  816. Scene_Theatrhythm.prototype.createDamage = function() {
  817.      this._damages = [[],[]];
  818.          this._damage_data = [-1,-1];
  819.      for (var i = 0; i < 2; i++) {
  820.            for (var n = 0; n < 4; n++) {
  821.               this._damages[i][n] = new Sprite(this._damage_img);
  822.               this._damages[i][n].visible = false;       
  823.           this._spriteHudBase.addChild(this._damages[i][n]);
  824.            };
  825.          };
  826. };
  827.  
  828. //==============================
  829. // * Refresh Damage
  830. //==============================
  831. Scene_Theatrhythm.prototype.refresh_damage = function(i,value) {
  832.         if (value > 9999) {value = 9999};
  833.         if (i === 1 && this._party_hp <= 0) {return};
  834.         if (i === 1 && !this._actorSprites[this._target_id]) {return};
  835.     numbers = Math.abs(value).toString().split("");         
  836.         for (var r = 0; r < this._damages[i].length; r++) {
  837.             this._damages[i][r].visible = false;
  838.             if (r >= numbers.length) {return};
  839.                 this._damages[i][r].visible = true;
  840.                 this._damages[i][r].opacity = 255;
  841.                 var n = Number(numbers[r]);
  842.                 this._damages[i][r].setFrame(n * this._damage_data[0], 0, this._damage_data[0], this._damage_data[1]);
  843.                 var nx = -(this._damage_data[0] * r) + ((this._damage_data[0]  / 2) *  numbers.length);
  844.                 if (i === 0) {
  845.                     this._damages[i][r].x = this._enemySprite.x - nx;               
  846.                     this._damages[i][r].y = this._enemySprite.y - (this._enemySprite.bitmap.height / 2);
  847.                 } else {       
  848.                         this._damages[i][r].x = this._actorSprites[this._target_id].x - nx;
  849.                         this._damages[i][r].y = this._actorSprites[this._target_id].y - 24;
  850.                 };
  851.         };
  852. };
  853.  
  854. //==============================
  855. // * Update Damage
  856. //==============================
  857. Scene_Theatrhythm.prototype.update_damage = function(i,value) {
  858.          for (var i = 0; i < 2; i++) {
  859.            for (var n = 0; n < 4; n++) {
  860.               if (this._damages[i][n].opacity > 0) {
  861.                    this._damages[i][n].opacity -= 3;
  862.                       this._damages[i][n].y -= 2;
  863.                   };
  864.            };
  865.          };
  866. };
  867.  
  868. //==============================
  869. // * createActorHPNumber
  870. //==============================
  871. Scene_Theatrhythm.prototype.createActorHpNumber = function() {       
  872.      this._actorHp_Old = 0;
  873.      this._actorHpNumber = [];
  874.          this._actorHpNumber_data = [-1,-1];
  875.      for (var i = 0; i < 5; i++) {
  876.            this._actorHpNumber[i] = new Sprite(this._hp_number_1_img);
  877.            this._enemyHpNumber[i].visible = false;
  878.            this._actorHpNumber[i].x = Moghunter.theatrhythm_actor_hp_number_x;
  879.            this._actorHpNumber[i].y = Moghunter.theatrhythm_actor_hp_number_y;
  880.            this._spriteHudBase.addChild(this._actorHpNumber[i]);
  881.          };
  882. };
  883.  
  884. //==============================
  885. // * Update ActorHpNumber
  886. //==============================
  887. Scene_Theatrhythm.prototype.update_actorHpNumber = function() {
  888.         var dif_number = this.update_dif(this._actorHp_Old,this._party_hp[0],20)
  889.         if (this._actorHp_Old != dif_number) {this._actorHp_Old = dif_number;
  890.         this.refresh_number(this._actorHpNumber,this._actorHp_Old ,this._actorHpNumber_data,this._actorHpNumber_data[2]);};
  891. };
  892.  
  893. //==============================
  894. // * createLayout
  895. //==============================
  896. Scene_Theatrhythm.prototype.createChain = function() {       
  897.      this._chain = new Sprite(this._chain_img);
  898.          this._chain_data = [-1,-1];
  899.          this._chain.x = Moghunter.theatrhythm_chain_x;
  900.          this._chain.y = Moghunter.theatrhythm_chain_y;
  901.          this._chain.anchor.x = 0.5;
  902.          this._chain.anchor.y = 0.5;
  903.          this._chain.opacity = 0;
  904.          this._spriteHudBase.addChild(this._chain);
  905.          this._chain_number = [];
  906.          this._chain_number_data = [-1,-1];
  907.          for (var i = 0; i < 3; i++) {
  908.                   this._chain_number[i] = new Sprite(this._chain_number_img);
  909.                   this._chain_number[i].anchor.x = 0.5;
  910.                   this._chain_number[i].anchor.y = 0.5;                 
  911.                   this._chain_number[i].opacity = 0;
  912.                   this._spriteHudBase.addChild(this._chain_number[i]);
  913.          };
  914. };
  915.  
  916. //==============================
  917. // * Refresh Chain
  918. //==============================
  919. Scene_Theatrhythm.prototype.refresh_chain = function(sprites,value,img_data,x) {
  920.         if (value > 999) {value = 999};
  921.         this._chain_dt[0] = value;
  922.         if (this._chain_dt[0] > this._chain_dt[1]) {this._chain_dt[1] = this._chain_dt[0]};
  923.     numbers = Math.abs(value).toString().split("");  
  924.            for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  925.            if (i < numbers.length) {
  926.                    sprites[i].visible = true;
  927.                    sprites[i].opacity = 255;
  928.                    var n = Number(numbers[i]);
  929.                    sprites[i].setFrame(n * img_data[0], 0, img_data[0], img_data[1]);
  930.                    var nx = -(img_data[0] * i) + (img_data[0] *  numbers.length);
  931.                    sprites[i].x = (x - nx)
  932.            };
  933.     };
  934. };
  935.  
  936. //==============================
  937. // * Update Chain
  938. //==============================
  939. Scene_Theatrhythm.prototype.update_chain = function() {
  940.          if (this._chain_dt[0]  != $gameSystem._theatrhythm_chain_data[0])        {
  941.                  this._chain_dt[0] = $gameSystem._theatrhythm_chain_data[0];
  942.                  if (this._chain_dt[0] > 0) {
  943.                          this._chain.scale.x = 2.0;
  944.                          this._chain.scale.y = this._chain.scale.x;
  945.                          this._chain.opacity = 255;
  946.              this.refresh_chain(this._chain_number,this._chain_dt[0],this._chain_number_data,this._chain_number_data[2]);
  947.                  };
  948.          };
  949.           if (this._chain_dt[0] === 0 || $gameSystem._theatrhythm_phase != 1) {this._chain.opacity -= 15};
  950.           if (this._chain.scale.x > 1.00) {this._chain.scale.x -= 0.1};         
  951.           this._chain.scale.y = this._chain.scale.x;
  952.       for (var i = 0; i < this._chain_number.length ; i++) {
  953.              this._chain_number[i].opacity = this._chain.opacity;
  954.                  this._chain_number[i].scale.x = this._chain.scale.x;
  955.                  this._chain_number[i].scale.y = this._chain_number[i].scale.x;
  956.           };
  957. };
  958.  
  959. //==============================
  960. // * createTimeMeter
  961. //==============================
  962. Scene_Theatrhythm.prototype.createHpMeter = function() {       
  963.      this._hp_meter = new Sprite(this._hp_meter_img);
  964.          this._hp_meter_data = [-1,-1,0,0];
  965.          this._hp_meter.x = Moghunter.theatrhythm_hp_meter_x;
  966.          this._hp_meter.y = Moghunter.theatrhythm_hp_meter_y;
  967.          this._hp_meter.visible = false;
  968.          this._spriteHudBase.addChild(this._hp_meter);       
  969. };
  970.  
  971. //==============================
  972. // * createTimeMeter
  973. //==============================
  974. Scene_Theatrhythm.prototype.update_hp_meter = function() {
  975.         this._hp_meter_data[2] += 3;
  976.         if (this._hp_meter_data[2]  > this._hp_meter_data[3]) {this._hp_meter_data[2] = 0};
  977.     var meter_rate = this._hp_meter_data[0] * this._party_hp[0] / this._party_hp[1];
  978.         this._hp_meter.setFrame(this._hp_meter_data[2],0, meter_rate, this._hp_meter_data[1]);
  979. };
  980.  
  981. //==============================
  982. // * createTimeMeter
  983. //==============================
  984. Scene_Theatrhythm.prototype.createTimeMeter = function() {       
  985.      this._meter = new Sprite(this._time_meter_img);
  986.          this._meter_data = [-1,-1,0,0];
  987.          this._meter.x = Moghunter.theatrhythm_time_meter_x;
  988.          this._meter.y = Moghunter.theatrhythm_time_meter_y;
  989.          this._meter.visible = false;
  990.          this._spriteHudBase.addChild(this._meter);       
  991. };
  992.  
  993. //==============================
  994. // * createTimeMeter
  995. //==============================
  996. Scene_Theatrhythm.prototype.update_time_meter = function() {
  997.         this._meter_data[2] += 15;
  998.         if (this._meter_data[2]  > this._meter_data[3]) {this._meter_data[2] = 0};
  999.     var meter_rate = this._meter_data[0] * this._enemy_hp[0] / this._enemy_hp[1];
  1000.         this._meter.setFrame(this._meter_data[2],0, meter_rate, this._meter_data[1]);
  1001. };
  1002.  
  1003. //==============================
  1004. // * createFace
  1005. //==============================
  1006. Scene_Theatrhythm.prototype.createFace = function() {       
  1007.      this._face_img = ImageManager.loadFace(this._battlers[0].faceName())
  1008.      this._face = new Sprite(this._face_img);
  1009.          this._face.x = Moghunter.theatrhythm_face_x;
  1010.          this._face.y = Moghunter.theatrhythm_face_y;
  1011.      var pw = Window_Base._faceWidth;
  1012.      var ph = Window_Base._faceHeight;       
  1013.      var sx = this._battlers[0].faceIndex() % 4 * pw;
  1014.      var sy = Math.floor(this._battlers[0].faceIndex() / 4) * ph;         
  1015.          this._face.setFrame(sx,sy,pw,ph);
  1016.          this._face.scale.x = 64 / Window_Base._faceWidth;
  1017.          this._face.scale.y = this._face.scale.x;
  1018.          this._spriteHudBase.addChild(this._face);
  1019. };
  1020.  
  1021. //==============================
  1022. // * createStrings
  1023. //==============================
  1024. Scene_Theatrhythm.prototype.createStrings = function() {                 
  1025.          this._strings = [];
  1026.          this._strings_data =  [this._string_img.width,this._string_img.height / 3];
  1027.          for (var i = 0; i < this._layout_buttons2.length; i++) {
  1028.                   this._strings[i] = new Sprite(this._string_img);
  1029.                   this._strings[i].x = this._layout_buttons2[i].x + Moghunter.theatrhythm_string_x;
  1030.                   this._strings[i].y = this._layout_buttons2[i].y + Moghunter.theatrhythm_string_y;
  1031.                   this._strings[i].anchor.x = 0.5;
  1032.                   this._strings[i].anchor.y = 0.5;
  1033.                   this._spriteHudBase.addChild(this._strings[i]);       
  1034.                   this.refresh_string(i,-1);
  1035.          };
  1036. };
  1037.  
  1038. //==============================
  1039. // * refresh String
  1040. //==============================
  1041. Scene_Theatrhythm.prototype.refresh_string = function(i,type) {       
  1042.        this._strings[i].opacity = 255;
  1043.            this._strings[i].scale.x = 1.00;
  1044.            this._strings[i].scale.y = 1.00;
  1045.        this._strings[i].setFrame(0,this._strings_data[1] * type,this._strings_data[0],this._strings_data[1])
  1046. };
  1047.  
  1048. //==============================
  1049. // * createLayoutBase
  1050. //==============================
  1051. Scene_Theatrhythm.prototype.createLayoutBase = function() {
  1052.      this._layoutBase = new Sprite();
  1053.          this._spriteHudBase.addChild(this._layoutBase);
  1054. };
  1055.  
  1056. //==============================
  1057. // * createLayoutButtons
  1058. //==============================
  1059. Scene_Theatrhythm.prototype.createLayoutButtons = function() {
  1060.          this._buttons_position = [[],[],[],[]];
  1061.      this._layout_buttons = [];
  1062.          this._layout_buttons2 = [];
  1063.          this._layout_buttons_data = [-1,-1,-1,-1]
  1064.      for (var i = 0; i < this._actorSprites.length; i++) {
  1065.          this._layout_buttons[i] = new Sprite(this._layout_buttons_img2);
  1066.                  this._layout_buttons[i].anchor.x = 0.5;
  1067.                  this._layout_buttons[i].anchor.y = 0.5;
  1068.                  this._layout_buttons[i].blendMode = 1;
  1069.                  this._layout_buttons[i].opacity = 0;
  1070.                  this._layout_buttons[i].visible = false;
  1071.              this._spriteHudBase.addChild(this._layout_buttons[i]);
  1072.          this._layout_buttons2[i] = new Sprite(this._layout_buttons_img);
  1073.                  this._layout_buttons2[i].anchor.x = 0.5;
  1074.                  this._layout_buttons2[i].anchor.y = 0.5;
  1075.                  this._layout_buttons2[i].opacity = 0;
  1076.                  this._layout_buttons2[i].visible = false;
  1077.              this._spriteHudBase.addChild(this._layout_buttons2[i]);                 
  1078.          };
  1079. };
  1080.  
  1081. //==============================
  1082. // * createLayoutButtons
  1083. //==============================
  1084. Scene_Theatrhythm.prototype.update_layout_buttons = function() {
  1085.     for (var i = 0; i < this._layout_buttons.length; i++) {
  1086.        if ($gameSystem._theatrhythm_phase != 1) {this._layout_buttons2[i].opacity -= 10;
  1087.            } else {this._layout_buttons2[i].opacity += 10};
  1088.         };
  1089. };
  1090.  
  1091. //==============================
  1092. // * createLayoutButtons
  1093. //==============================
  1094. Scene_Theatrhythm.prototype.createButtons = function() {
  1095.      this._sprite_buttons = new Sprite_TKeys(this._buttons_img,this._buttons_position);
  1096.          this._spriteHudBase.addChild(this._sprite_buttons);
  1097. };
  1098.  
  1099. //==============================
  1100. // * getSpriteData
  1101. //==============================
  1102. Scene_Theatrhythm.prototype.getSpriteData = function() {
  1103.           this._layout_buttons_data[0] = this._layout_buttons_img.width / 2;
  1104.           this._layout_buttons_data[1] = this._layout_buttons_img.height / 2;
  1105.           this._layout_buttons_data[2] = Moghunter.theatrhythm_actor_x + Moghunter.theatrhythm_button_layout_x - this._layout_buttons_data[0];
  1106.           this._layout_buttons_data[3] = Moghunter.theatrhythm_actor_y + Moghunter.theatrhythm_button_layout_y - this._layout_buttons_data[1];
  1107.           for (var i = 0; i < this._layout_buttons.length; i++) {
  1108.              this._layout_buttons[i].x = this._layout_buttons_data[2] + Moghunter.theatrhythm_button_flash_x;
  1109.              this._layout_buttons[i].y = this._layout_buttons_data[3]  + (Moghunter.theatrhythm_actor_spc_y * i) + Moghunter.theatrhythm_button_flash_y;
  1110.                  this._layout_buttons[i].visible = true;
  1111.              this._layout_buttons2[i].x = this._layout_buttons_data[2];
  1112.              this._layout_buttons2[i].y = this._layout_buttons_data[3]  + (Moghunter.theatrhythm_actor_spc_y * i);
  1113.                  this._layout_buttons2[i].visible = true;                 
  1114.  
  1115.                  this._buttons_position[i] = [this._layout_buttons2[i].x,this._layout_buttons2[i].y]
  1116.           };
  1117.       this._meter_data = [this._meter.bitmap.width / 3,this._meter.bitmap.height,0,(this._meter.bitmap.width / 3) * 2];
  1118.           this._meter.visible = true;
  1119.       this._hp_meter_data = [this._hp_meter.bitmap.width / 3,this._hp_meter.bitmap.height,0,(this._hp_meter.bitmap.width / 3) * 2];
  1120.           this._hp_meter.visible = true;
  1121.       this._point_data = [this._score_img.width / 10,this._score_img.height,Moghunter.theatrhythm_score_x];
  1122.           this._enemyHpNumber_data = [this._hp_number_1_img.width / 10,this._hp_number_1_img.height,Moghunter.theatrhythm_enemy_hp_number_x];
  1123.           this._actorHpNumber_data = [this._hp_number_1_img.width / 10,this._hp_number_1_img.height,Moghunter.theatrhythm_actor_hp_number_x];
  1124.           this._chain_data = [this._chain_img.width,this._chain_img.height];          
  1125.           this._chain.x = Moghunter.theatrhythm_chain_x + this._chain_data[0] / 2;
  1126.           this._chain.y = Moghunter.theatrhythm_chain_y + this._chain_data[1] / 2;
  1127.       this._chain_number_data = [this._chain_number_img.width / 10, this._chain_number_img.height,
  1128.       Moghunter.theatrhythm_chain_x + Moghunter.theatrhythm_chain_number_x,Moghunter.theatrhythm_chain_y + Moghunter.theatrhythm_chain_number_y];          
  1129.           for (var i = 0; i < this._chain_number.length; i++) {
  1130.                    this._chain_number[i].x = this._chain_number_data[2];
  1131.                   this._chain_number[i].y = this._chain_number_data[3];
  1132.             };         
  1133.           if (this._bp_visible) {
  1134.           this._battlePower[0].bitmap.drawText(this._enemy_bp,0,0,250,32,"center");
  1135.               this._battlePower[1].bitmap.drawText(this._party_bp,0,0,250,32,"center")        ;
  1136.           };
  1137.       this._phase_sprite_data = [this._phase_img.width,this._phase_img.height / 4]
  1138.           this._phase_sprite.x += this._phase_sprite_data[0] / 2;
  1139.           this._phase_sprite.y += this._phase_sprite_data[1] / 2;
  1140.           this._damage_data = [this._damage_img.width / 10,this._damage_img.height];
  1141.           this.createButtons();
  1142.           this.createStrings();
  1143. };
  1144.  
  1145. //==============================
  1146. // * createSpriteset
  1147. //==============================
  1148. Scene_Theatrhythm.prototype.createScenario = function() {
  1149.     this._back1Sprite = new TilingSprite();
  1150.         this._back1Sprite.move(0, 0, Graphics.width, Graphics.height);
  1151.         this._back1Sprite.anchor.x = 0.5;
  1152.         this._back1Sprite.anchor.y = 0.5;
  1153.         this._spriteField.addChild(this._back1Sprite);       
  1154.     this._back2Sprite = new TilingSprite();
  1155.         this._back2Sprite.anchor.x = 0.5;
  1156.         this._back2Sprite.anchor.y = 0.5;       
  1157.         this._spriteField.addChild(this._back2Sprite);
  1158.     this._back2Sprite.move(0, 0, Graphics.width, Graphics.height);
  1159.         this.refresh_background();
  1160. };
  1161.  
  1162. //==============================
  1163. // * RefreshBackground
  1164. //==============================
  1165. Scene_Theatrhythm.prototype.refresh_background = function() {
  1166.         this._back1Sprite.bitmap = ImageManager.loadBattleback1($gameMap.battleback1Name());
  1167.         this._back2Sprite.bitmap = ImageManager.loadBattleback2($gameMap.battleback2Name());
  1168.         this._back1Sprite.x = Graphics.width / 2;
  1169.         this._back1Sprite.y = Graphics.height / 2;
  1170.         this._back2Sprite.x = Graphics.width / 2;
  1171.         this._back2Sprite.y = Graphics.height / 2;
  1172. };
  1173.  
  1174. //==============================
  1175. // * Create Actors
  1176. //==============================
  1177. Scene_Theatrhythm.prototype.createActors = function() {
  1178.     this._actorSprites = [];
  1179.         this._actorSprites_Data = [-1,-1,-1,-1]
  1180.     for (var i = 0; i < this._battlers.length; i++) {
  1181.         this._actorSprites[i] = new Sprite_Actor();
  1182.         this._spriteField.addChild(this._actorSprites[i]);
  1183.     };
  1184. };
  1185.  
  1186. //==============================
  1187. // * Create Enemy
  1188. //==============================
  1189. Scene_Theatrhythm.prototype.createEnemy = function() {
  1190.         if (Imported.MOG_BattlerMotion) {
  1191.             this._sprite_shadow = new SpriteBattlerShadow();       
  1192.             this._spriteField.addChild(this._sprite_shadow);
  1193.         };
  1194.     this._enemy = new Game_Enemy($gameSystem._theatrhythm_data[0],Moghunter.theatrhythm_enemy_x, Moghunter.theatrhythm_enemy_y);               
  1195.     this._enemySprite = new Sprite_Enemy(this._enemy);
  1196.         this._spriteField.addChild(this._enemySprite);
  1197.         if (Imported.MOG_BattlerMotion) {           
  1198.             this._enemySprite.add_shadow(this._sprite_shadow);
  1199.         };
  1200. };
  1201.  
  1202. //==============================
  1203. // * Update Actors
  1204. //==============================
  1205. Scene_Theatrhythm.prototype.updateActors = function() {
  1206.     for (var i = 0; i < this._actorSprites.length; i++) {               
  1207.         this._actorSprites[i].setBattler(this._battlers[i]);                       
  1208.     };
  1209. };
  1210.  
  1211. //==============================
  1212. // * Update Actors
  1213. //==============================
  1214. Scene_Theatrhythm.prototype.update_commands = function() {
  1215.         if (Input.isTriggered("a")) {this.check_key(0)}
  1216.         else if (Input.isTriggered("s")) {this.check_key(1)}
  1217.         else if (Input.isTriggered("ok")) {this.check_key(2)}
  1218.         else if (Input.isTriggered("cancel")) {this.check_key(3)}
  1219.         else if (Input.isTriggered("up")) {this.check_key(4)}
  1220.         else if (Input.isTriggered("right")) {this.check_key(5)}
  1221.         else if (Input.isTriggered("left")) {this.check_key(6)}
  1222.         else if (Input.isTriggered("down")) {this.check_key(7)};
  1223. };
  1224.  
  1225. //==============================
  1226. // * Check Key
  1227. //==============================
  1228. Scene_Theatrhythm.prototype.check_key = function(key) {
  1229.         SoundManager.playCursor();
  1230.         this._sprite_buttons.keyisValid(key);
  1231.         if ($gameSystem._theatrhythm_key_data[0] != null) {this.refresh_effect();};
  1232. };
  1233.  
  1234. //==============================
  1235. // * Refresh Effect
  1236. //==============================
  1237. Scene_Theatrhythm.prototype.refresh_effect = function() {
  1238.          var pos_id = $gameSystem._theatrhythm_key_data[0];
  1239.          var string_id = $gameSystem._theatrhythm_key_data[1];
  1240.          if (!this._layout_buttons[pos_id]) {
  1241.                  $gameSystem._theatrhythm_key_data[0] = null;
  1242.                  $gameSystem._theatrhythm_key_data[1] = 0;                 
  1243.                  return;
  1244.          };
  1245.      this._layout_buttons[pos_id].opacity = 255;
  1246.          this.refresh_string(pos_id, string_id);         
  1247.          if (string_id != 0) {this.execute_hit_enemy(pos_id, string_id)}
  1248.          else {this.execute_missed()};
  1249.          $gameSystem._theatrhythm_key_data[0] = null;
  1250.      $gameSystem._theatrhythm_key_data[1] = 0;
  1251. };
  1252.  
  1253. //==============================
  1254. // * Execute Hit Enemy
  1255. //==============================
  1256. Scene_Theatrhythm.prototype.execute_hit_enemy = function(pos_id, string_id) {
  1257.          var ani_id = this._battlers[pos_id].attackAnimationId1();
  1258.          this._enemySprite._enemy.startAnimation(ani_id, false, 0);
  1259.          this._enemySprite._enemy.motion_shake();
  1260.          $gameSystem._theatrhythm_chain_data[0] += 1;
  1261.          if ($gameSystem._theatrhythm_chain_data[1] < $gameSystem._theatrhythm_chain_data[0]) {
  1262.                  $gameSystem._theatrhythm_chain_data[1] = $gameSystem._theatrhythm_chain_data[0]};
  1263.          if (this._result_data[0] < $gameSystem._theatrhythm_chain_data[0]) {this._result_data[0] = $gameSystem._theatrhythm_chain_data[0]};         
  1264.          this.add_score();
  1265.          this.execute_damage(0);
  1266. };
  1267.  
  1268. //==============================
  1269. // * Execute Hit Actor
  1270. //==============================
  1271. Scene_Theatrhythm.prototype.execute_hit_actor = function(pos_id, string_id) {       
  1272.          if (this._enemySprite._enemy._motion_action_data[0] != 0) { return };
  1273.      this._enemySprite._enemy.clear_action_data();
  1274.      this._enemySprite._enemy._motion_action_data[0] = 7;         
  1275.          if (this._party_hp[0] > 0) {
  1276.              this._target_id = Math.randomInt(this._battlers.length);
  1277.        this._battlers[this._target_id].startAnimation(this._enemySprite._enemy._theatrhythm_ani_id, false, 0);
  1278.          this._battlers[this._target_id].motion_shake();
  1279.       } else {
  1280.                   for (var i = 0; i < this._battlers.length; i++) {
  1281.             this._battlers[i].startAnimation(this._enemySprite._enemy._theatrhythm_ani_id, false, 0);
  1282.               this._battlers[i].motion_shake();                          
  1283.                   };
  1284.           };
  1285.           this.execute_damage(1);
  1286. };
  1287.  
  1288. //==============================
  1289. // * Execute Missed
  1290. //==============================
  1291. Scene_Theatrhythm.prototype.execute_missed = function(pos_id, string_id) {
  1292.          $gameSystem._theatrhythm_chain_data[0] = 0;
  1293.      this.execute_miss_damage();
  1294. };
  1295.  
  1296. //==============================
  1297. // * Execute Miss Damage
  1298. //==============================
  1299. Scene_Theatrhythm.prototype.execute_miss_damage = function(pos_id, string_id) {
  1300.          if ($gameSystem._theatrhythm_phase != 1) {return};
  1301.          $gameSystem._theatrhythm_miss_dmg = false;
  1302.          var dmg = this._party_hp[1] * Math.abs(Moghunter.theatrhythm_miss_dmg_per) / 100
  1303.          this._party_hp[0] -= dmg;
  1304.          this.execute_hit_actor()
  1305.          if (this._party_hp[0] <= 0) {this._party_hp[0] = 0;this.battle_end(11)};
  1306. };
  1307.  
  1308. //==============================
  1309. // * Execute Damage
  1310. //==============================
  1311. Scene_Theatrhythm.prototype.execute_damage = function(target) {
  1312.         if ($gameSystem._theatrhythm_phase != 1) {return};
  1313.     if (target === 0) {
  1314.                 var dmg = Math.max((this._party_atk - this._enemy_def),1);
  1315.                 if ($gameSystem._theatrhythm_key_data[1] == 2) {dmg *= Moghunter.theatrhythm_critical_bonus};
  1316.                 this._enemy_hp[0] -= Math.floor(dmg);
  1317.                 if (this._enemy_hp[0] <= 0) {this._enemy_hp[0] = 0; this._enemySprite._enemy.performCollapse();this.battle_end(10)};
  1318.         } else {
  1319.                 var dmg = Math.max((this._enemy_atk - this._party_def),1);
  1320.                 this._party_hp[0] -= Math.floor(dmg);
  1321.                 if (this._party_hp[0] <= 0) {this._party_hp[0] = 0;this.battle_end(11)};
  1322.         };
  1323.         this.refresh_damage(target,Math.floor(dmg));
  1324. };
  1325.  
  1326. //==============================
  1327. // * Battle_End
  1328. //==============================
  1329. Scene_Theatrhythm.prototype.battle_end = function(type) {
  1330.         if ($gameSystem._theatrhythm_phase != 1) {return};
  1331.         if (type === 10) {
  1332.              $gameSwitches._data[Moghunter.theatrhythm_result_switch_id] = true;
  1333.         } else {
  1334.                 $gameSwitches._data[Moghunter.theatrhythm_result_switch_id] = false;
  1335.         };               
  1336.         $gameSystem._theatrhythm_phase = type;
  1337.         if (type === 10) {
  1338.                 for (var i = 0; i < this._battlers.length; i++) {               
  1339.                 this._battlers[i].performVictory();}
  1340.         } else {
  1341.                 $gameParty.requestMotionRefresh();
  1342.         };
  1343. };
  1344.  
  1345. //==============================
  1346. // * Add Score
  1347. //==============================
  1348. Scene_Theatrhythm.prototype.add_score = function() {
  1349.         var value = Moghunter.theatrhythm_base_score + (Moghunter.theatrhythm_chain_bonus * $gameSystem._theatrhythm_chain_data[0])
  1350.         if ($gameSystem._theatrhythm_key_data[1] == 2) {value *= Moghunter.theatrhythm_critical_bonus};
  1351.     this._score[1] += Math.floor(value);
  1352.         if ($gameSystem._theatrhythm_score_data[1] < this.score()) {$gameSystem._theatrhythm_score_data[1] = this.score()};
  1353. };
  1354.  
  1355. //==============================
  1356. // * Chain Bonus
  1357. //==============================
  1358. Scene_Theatrhythm.prototype.chainBonus = function() {
  1359.          return Math.floor((this._result_data[0] * Moghunter.theatrhythm_result_chain_bonus) * this.score())
  1360. };
  1361.  
  1362. //==============================
  1363. // * Score
  1364. //==============================
  1365. Scene_Theatrhythm.prototype.score = function() {
  1366.         return Math.floor(this._score[1])
  1367. };
  1368.  
  1369. //==============================
  1370. // * Set Total
  1371. //==============================
  1372. Scene_Theatrhythm.prototype.set_total = function() {
  1373.         var n = this.score() + this._enemy_bp + this.chainBonus();
  1374.         return Math.floor(n);
  1375. };
  1376.  
  1377. //==============================
  1378. // * Update Phase
  1379. //==============================
  1380. Scene_Theatrhythm.prototype.update_phase = function() {
  1381.     switch ($gameSystem._theatrhythm_phase) {
  1382.                 case 0:
  1383.             this.update_start_phase();
  1384.             break;
  1385.                 case 10:
  1386.             this.update_victory_phase();
  1387.             break;
  1388.                 case 11:
  1389.             this.update_defeat_phase();
  1390.             break;       
  1391.    };   
  1392.    this._phase_sprite.scale.y = this._phase_sprite.scale.x;
  1393. };
  1394.  
  1395. //==============================
  1396. // * Update Start Phase
  1397. //==============================
  1398. Scene_Theatrhythm.prototype.update_start_phase = function() {
  1399.     switch (this._phase[0]) {
  1400.                 case 0:
  1401.                 this.refresh_phase_sprite(0);
  1402.                         this._phase[0] = 1;
  1403.                  break;
  1404.                 case 1:
  1405.                 this._phase_sprite.opacity += 3;
  1406.                         if (this._phase_sprite.scale.x > 1.00) {this._phase_sprite.scale.x -= 0.02};
  1407.                     if (this._phase_sprite.opacity >= 255) {this._phase[0] = 2};
  1408.                 break;
  1409.                 case 2:
  1410.                     if (Input.isTriggered("ok") || Input.isTriggered("cancel") || TouchInput.isTriggered()) {
  1411.                                 SoundManager.playCursor();this._phase[0] = 3;BattleManager.playBattleBgm()};
  1412.                     break;        
  1413.                 case 3:
  1414.                         this._phase_sprite.opacity -= 3;
  1415.                         this._phase_sprite.scale.x += 0.02;
  1416.                         if (this._phase_sprite.opacity <= 0) {$gameSystem._theatrhythm_phase = 1;this._phase[0] = 4};
  1417.                     break;                                
  1418.         };
  1419. };
  1420.  
  1421. //==============================
  1422. // * Update Victory Phase
  1423. //==============================
  1424. Scene_Theatrhythm.prototype.update_victory_phase = function() {
  1425.    switch (this._phase[1]) {
  1426.                 case 0:
  1427.                 this.refresh_phase_sprite(1);
  1428.                         this._phase[1] = 1;
  1429.                         AudioManager.fadeOutBgm(1);
  1430.                  break;
  1431.                 case 1:
  1432.                 this._phase_sprite.opacity += 3;
  1433.                         if (this._phase_sprite.scale.x > 1.00) {this._phase_sprite.scale.x -= 0.02}
  1434.                     if (this._phase_sprite.opacity >= 255) {this._phase[1] = 3;BattleManager.playVictoryMe()};
  1435.                 break;
  1436.                 case 2:
  1437.                     if (Input.isTriggered("ok") || Input.isTriggered("cancel") || TouchInput.isTriggered()) {
  1438.                                 SoundManager.playCursor();this._phase[1] = 3};
  1439.                     break;        
  1440.                 case 3:
  1441.                     this._phase_sprite.opacity -= 3;
  1442.                         this._phase_sprite.scale.x += 0.02;       
  1443.                         if (this._phase_sprite.opacity <= 0) {this.display_result()};       
  1444.                         break;                       
  1445.                 case 4:
  1446.                 this._phase_sprite.opacity += 3;                       
  1447.                         if (this._phase_sprite.scale.x > 1.00) {this._phase_sprite.scale.x -= 0.02}
  1448.                     if (this._phase_sprite.opacity >= 255) {this._phase[1] = 5};
  1449.                 break;                       
  1450.                 case 5:
  1451.                     if (Input.isTriggered("ok") || Input.isTriggered("cancel") || TouchInput.isTriggered()) {
  1452.                                 SoundManager.playCursor();this._phase[1] = 6};
  1453.                     break;                       
  1454.                 case 6:       
  1455.                         this._phase_sprite.opacity -= 3;                       
  1456.                         if (this._phase_sprite.opacity <= 0) {this.fadeOutAll();$gameSystem._theatrhythm_phase = 12;this._phase[1] = 7;SceneManager.pop()};
  1457.                     break;                                
  1458.         };
  1459.         this._text_sprite.opacity = this._phase_sprite.opacity;       
  1460.         this._text_sprite.scale.x = this._phase_sprite.scale.x;
  1461.         this._text_sprite.scale.y = this._phase_sprite.scale.y;
  1462.         this._text2_sprite.opacity = this._phase_sprite.opacity;
  1463.         this._text2_sprite.scale.x = this._phase_sprite.scale.x;
  1464.         this._text2_sprite.scale.y = this._phase_sprite.scale.y;               
  1465. };
  1466.  
  1467. //==============================
  1468. // * Display Result
  1469. //==============================
  1470. Scene_Theatrhythm.prototype.display_result = function() {
  1471.         this._phase[1] = 4;
  1472.         this.refresh_phase_sprite(3);
  1473.         this.gain_rewards();
  1474.     this.draw_result();
  1475. };
  1476.  
  1477. //==============================
  1478. // * Gain Rewards
  1479. //==============================
  1480. Scene_Theatrhythm.prototype.gain_rewards = function() {
  1481.    $gameVariables._data[Moghunter.theatrhythm_variable_id] += this.set_total();
  1482. };
  1483.  
  1484. //==============================
  1485. // * Draw Result
  1486. //==============================
  1487. Scene_Theatrhythm.prototype.draw_result = function() {
  1488.         this._text_sprite.bitmap.drawText(this.score(),0,0,200,32,"right");
  1489.         this._text_sprite.bitmap.drawText("(" + String(this._result_data[0]) + ") " + String(this.chainBonus()),0,32,200,32,"right");
  1490.         this._text_sprite.bitmap.drawText(this._enemy_bp,0,64,200,32,"right");
  1491.         this._text_sprite.bitmap.drawText(this.set_total(),0,96,200,32,"right");
  1492.         this._text2_sprite.bitmap.drawText($gameVariables._data[Moghunter.theatrhythm_variable_id],0,0,200,100,"left");
  1493. };
  1494.  
  1495. //==============================
  1496. // * Update Defeat Phase
  1497. //==============================
  1498. Scene_Theatrhythm.prototype.update_defeat_phase = function() {
  1499.     switch (this._phase[2]) {
  1500.                 case 0:
  1501.                 this.refresh_phase_sprite(2);
  1502.                         this._phase[2] = 1;
  1503.                         AudioManager.fadeOutBgm(2);
  1504.                  break;
  1505.                 case 1:
  1506.                 this._phase_sprite.opacity += 3;
  1507.                         if (this._phase_sprite.scale.x > 1.00) {this._phase_sprite.scale.x -= 0.02};
  1508.                     if (this._phase_sprite.opacity >= 255) {this._phase[2] = 2};
  1509.                 break;
  1510.                 case 2:
  1511.                     if (Input.isTriggered("ok") || Input.isTriggered("cancel") || TouchInput.isTriggered()) {
  1512.                                 SoundManager.playCursor();this._phase[2] = 3};
  1513.                     break;        
  1514.                 case 3:
  1515.                         this._phase_sprite.opacity -= 3;
  1516.                         this._phase_sprite.scale.x += 0.02;
  1517.                         if (this._phase_sprite.opacity <= 0) {this.fadeOutAll();$gameSystem._theatrhythm_phase = 12;this._phase[2] = 4;SceneManager.pop();}
  1518.                     break;                                
  1519.         };
  1520. };
  1521.  
  1522. //==============================
  1523. // * Refresh Enemy Position
  1524. //==============================
  1525. Scene_Theatrhythm.prototype.refresh_enemy_position = function() {
  1526.       this._enemySprite._homeY += this._enemySprite.bitmap.height / 2;
  1527.           this._enemy_ref = true;
  1528. };
  1529.  
  1530. //==============================
  1531. // * Terminate
  1532. //==============================
  1533. Scene_Theatrhythm.prototype.terminate = function() {
  1534.         Scene_Base.prototype.terminate.call(this);
  1535.         BattleManager.replayBgmAndBgs();
  1536.         $gameSystem._theatrhythm = false;
  1537. };
  1538.  
  1539. //==============================
  1540. // * Update
  1541. //==============================
  1542. Scene_Theatrhythm.prototype.update = function() {
  1543.     Scene_Base.prototype.update.call(this);
  1544.     this.updateActors();       
  1545.         if (this._layout_buttons_data[0] === -1) {
  1546.                 if (this._layout_buttons_img.isReady()) {this.getSpriteData()};
  1547.                 return;
  1548.         };
  1549.         this.update_layout_buttons();
  1550.         for (var i = 0; i < this._layout_buttons.length; i++) {
  1551.                 this._layout_buttons[i].opacity -= 5;
  1552.                 this._strings[i].opacity -= 10;
  1553.                 if (this._strings[i].opacity > 0) {this._strings[i].scale.x += 0.05}
  1554.                 this._strings[i].scale.y = this._strings[i].scale.x;
  1555.         };
  1556.          if (!this._enemy_ref && this._enemySprite.bitmap.isReady()) {this.refresh_enemy_position()};
  1557.         if (this._meter_data[0] != -1) {this.update_time_meter()};
  1558.         if (this._hp_meter_data[0] != -1) {this.update_hp_meter()};
  1559.         if (this._point_data[0] != -1) {this.update_score();};
  1560.         if (this._enemyHpNumber_data[0] != -1) {this.update_enemyHpNumber()};
  1561.         if (this._actorHpNumber_data[0] != -1) {this.update_actorHpNumber()};
  1562.         if (this._chain_data[0] != -1) {this.update_chain();};
  1563.         if (this._damage_data[0] != -1) {this.update_damage()};
  1564.         if ($gameSystem._theatrhythm_phase === 1) {this.update_commands();};
  1565.         if ($gameSystem._theatrhythm_miss_dmg) {this.execute_miss_damage();};
  1566.         this.update_phase();
  1567. };
  1568.  
  1569. //=============================================================================
  1570. // ** Sprite TKeys
  1571. //=============================================================================       
  1572. function Sprite_TKeys() {
  1573.     this.initialize.apply(this, arguments);
  1574. }
  1575.  
  1576. Sprite_TKeys.prototype = Object.create(Sprite_Base.prototype);
  1577. Sprite_TKeys.prototype.constructor = Sprite_TKeys;
  1578.  
  1579. //==============================
  1580. // * Initialize
  1581. //==============================
  1582. Sprite_TKeys.prototype.initialize = function(img,pos) {
  1583.     Sprite_Base.prototype.initialize.call(this);
  1584.         this._image = img;
  1585.         this._cw = this._image.width  / 8;
  1586.         this._ch =  this._image.height;
  1587.         this._positions = pos;
  1588.         this._keys_speed = $gameSystem._theatrhythm_data[1];
  1589.         this._button_ok= null;
  1590.         this._batlers = $gameParty.battleMembers();
  1591.         this._limit = [this._positions[0][0] + this._cw + (this._cw / 4),
  1592.                        this._positions[0][0] + (this._cw * 3),
  1593.                                    this._positions[0][0] + this._cw + (this._cw),
  1594.                                    this._positions[0][0] + (this._cw * 2) + (this._cw / 3),
  1595.                                    Graphics.boxWidth + this._cw,
  1596.                                    ];
  1597.         this.create_keys();
  1598. };
  1599.  
  1600. //==============================
  1601. // * Create Keys
  1602. //==============================
  1603. Sprite_TKeys.prototype.create_keys = function() {
  1604.    this._keys = [];   
  1605.    this._keys_c = [];
  1606.    this._keys_f = [];
  1607.    this._keys_i = [];
  1608.    this._keys_h = [];
  1609.    this._keys_r = [];
  1610.    this._keys_s = [];
  1611.    for (var i = 0; i < 6; i++) {
  1612.              this._keys_c[i] = 0;
  1613.                  this._keys_f[i] = false;
  1614.                  this._keys_h[i] = 0;
  1615.                  this._keys_i[i] = this.key_space(i);
  1616.                  this._keys_r[i] = false;
  1617.                  this._keys_s[i] = false;
  1618.              this._keys[i] = new Sprite(this._image)
  1619.                  this._keys[i].x = this._limit[4];
  1620.                  this._keys[i].anchor.x = 0.5;
  1621.                  this._keys[i].anchor.y = 0.5;
  1622.                  this._keys[i].opacity = 0;
  1623.                  this.addChild(this._keys[i]);                 
  1624.    };
  1625. };
  1626.  
  1627. //==============================
  1628. // * Key Space
  1629. //==============================
  1630. Sprite_TKeys.prototype.key_space = function(i) {
  1631.          return ((this._cw +  Graphics.boxWidth / 4) / this._keys_speed) * i;
  1632. };
  1633.  
  1634. //==============================
  1635. // * Refresh Keys
  1636. //==============================
  1637. Sprite_TKeys.prototype.refresh_keys = function(i) {
  1638.         this._keysX = [];
  1639.         for (var e = 0; e < this._keys.length; e++) {this._keysX.push(this._keys[e].x);};
  1640.         this._keysX.sort(function(a, b){return a-b});
  1641.         var difX = (this._keys[i].x - this._limit[4]);
  1642.         this._keys_f[i] = false;
  1643.         this._keys_c[i] = Math.randomInt(8);
  1644.         this._keys_h[i] = Math.randomInt(this._batlers.length);
  1645.         this._keys_r[i] = true;
  1646.         this._keys_s[i] = false;
  1647.         var h = this._positions[this._keys_h[i]][1];
  1648.         this._keys[i].setFrame(this._cw * this._keys_c[i],0,this._cw,this._ch)
  1649.         this._keys[i].x = -(this._cw + this._keys_i[i] - difX);
  1650.         this._keys[i].y = h;
  1651.         this._keys[i].scale.x = 1.00;
  1652.         this._keys[i].scale.y = 1.00;
  1653.         this._keys[i].opacity = 0;
  1654.         if (this._keys[i].x > (this._keysX[0] - (this._cw +  Graphics.boxWidth / 6)) ) {this._keys[i].x = (this._keysX[0] - (this._cw +  Graphics.boxWidth / 6))};
  1655. };
  1656.  
  1657. //==============================
  1658. // * KeysisValid
  1659. //==============================
  1660. Sprite_TKeys.prototype.keyisValid = function(key) {
  1661.         for (var i = 0; i < this._keys.length; i++) {
  1662.              if (this.checkKey(key,i,0)) {this.execute_ok(i,key)};
  1663.         };
  1664.         if ($gameSystem._theatrhythm_key_data[0] == null) {
  1665.                 for (var i = 0; i < this._keys.length; i++) {
  1666.                    this.execute_miss(key,i);
  1667.                 };
  1668.     };
  1669. };
  1670.  
  1671. //==============================
  1672. // * Execute Miss
  1673. //==============================
  1674. Sprite_TKeys.prototype.execute_miss = function(key,i) {
  1675.         if ($gameSystem._theatrhythm_key_data[0] != null) {return};
  1676.         var keys_temp = [];
  1677.         for (var e = 0; e < this._keys.length; e++) {
  1678.                 if (this._keys[e].x <= this._limit[1]) {keys_temp.push([this._keys[e].x,this._keys_h[e]]);};
  1679.         };
  1680.         keys_temp.sort(function(a, b){return b[0]-a[0]});
  1681.         $gameSystem._theatrhythm_key_data[0] = keys_temp[0][1];
  1682.         $gameSystem._theatrhythm_key_data[1] = 0;
  1683. };
  1684.  
  1685. //==============================
  1686. // * Execute OK
  1687. //==============================
  1688. Sprite_TKeys.prototype.execute_ok = function(i,key) {
  1689.         if (!this._batlers[this._keys_h[i]]) {return};
  1690.     this._batlers[this._keys_h[i]].performAttack();
  1691.         $gameSystem._theatrhythm_key_data[0] = this._keys_h[i];
  1692.          if (this.checkKey(key,i,1)) {$gameSystem._theatrhythm_key_data[1] = 2}
  1693.          else {$gameSystem._theatrhythm_key_data[1] = 1};
  1694.          this._keys_f[i] = true;
  1695. };
  1696.  
  1697. //==============================
  1698. // * checkKey
  1699. //==============================
  1700. Sprite_TKeys.prototype.checkKey = function(key,i,type) {
  1701.         if (this._keys_f[i]) {return false};
  1702.         if (key != this._keys_c[i]) {return false};
  1703.         if (type === 0) {
  1704.             if (this._keys[i].x < this._limit[0]) {return false};
  1705.             if (this._keys[i].x > this._limit[1]) {return false};
  1706.         } else {
  1707.             if (this._keys[i].x < this._limit[2]) {return false};
  1708.             if (this._keys[i].x > this._limit[3]) {return false};        
  1709.         };
  1710.     return true;
  1711. };
  1712.  
  1713. //==============================
  1714. // * Update
  1715. //==============================
  1716. Sprite_TKeys.prototype.update = function(i) {
  1717.     Sprite_Base.prototype.update.call(this);
  1718.         for (var i = 0; i < this._keys.length; i++) {this.update_keys(i)};
  1719. };
  1720.  
  1721. //==============================
  1722. // * Update Keys
  1723. //==============================
  1724. Sprite_TKeys.prototype.update_keys = function(i) {
  1725.         if (this._keys_i[i] > 0) {this._keys_i[i] -= 1;return};
  1726.         if ($gameSystem._theatrhythm_phase != 1) {this._keys[i].opacity -= 10; return;};
  1727.         if (this._keys_f[i]) {this.update_fade(i);}
  1728.         else {this.update_position(i)                  
  1729.         };
  1730.         if (this.need_reset_key(i)) {this.refresh_keys(i)};       
  1731. };       
  1732.  
  1733. //==============================
  1734. // * Update Keys
  1735. //==============================
  1736. Sprite_TKeys.prototype.update_position = function(i) {
  1737.         this._keys[i].x += this._keys_speed;
  1738.         if (this._keys[i].x > this._limit[1] && this._keys[i].opacity > 0) {this._keys[i].opacity -= 7;
  1739.              if (!this._keys_s[i] && this._keys_r[i]) {this.slow_pressed(i);}
  1740.         }
  1741.         else {
  1742.              this._keys[i].opacity += 25;
  1743.         };
  1744. };
  1745.  
  1746. //==============================
  1747. // * Update Keys
  1748. //==============================
  1749. Sprite_TKeys.prototype.update_fade = function(i) {
  1750.         this._keys[i].scale.x += 0.05;
  1751.         this._keys[i].scale.y = this._keys[i].scale.x;
  1752.         this._keys[i].opacity -= 25;
  1753. };
  1754.  
  1755. //==============================
  1756. // * Slow Pressed
  1757. //==============================
  1758. Sprite_TKeys.prototype.slow_pressed = function(i) {       
  1759.    this._keys_s[i] = true;
  1760.    $gameSystem._theatrhythm_chain_data[0] = 0;
  1761.    $gameSystem._theatrhythm_miss_dmg = true;
  1762. };
  1763.  
  1764. //==============================
  1765. // * Update Keys
  1766. //==============================
  1767. Sprite_TKeys.prototype.need_reset_key = function(i) {
  1768.         if (this._keys[i].x > this._limit[4]) {return true};
  1769.         if (this._keys[i].opacity === 0) {return true};
  1770.         return false;
  1771. };
  1772.  
  1773. //=============================================================================
  1774. // ** Sprite Actor
  1775. //=============================================================================       
  1776. var _alias_mog_Theatrhythm_updateTargetPosition = Sprite_Actor.prototype.updateTargetPosition;
  1777. Sprite_Actor.prototype.updateTargetPosition = function() {
  1778.         if ($gameSystem._theatrhythm) {return};
  1779.         _alias_mog_Theatrhythm_updateTargetPosition.call(this);
  1780. };
  1781.  
  1782. //==============================
  1783. // * setActorHome
  1784. //==============================
  1785. var _alias_mog_Theatrhythm_setActorHome = Sprite_Actor.prototype.setActorHome;
  1786. Sprite_Actor.prototype.setActorHome = function(index) {
  1787.     if ($gameSystem._theatrhythm) {this.setHome(Moghunter.theatrhythm_actor_x, Moghunter.theatrhythm_actor_y + index * Moghunter.theatrhythm_actor_spc_y);return};
  1788.         _alias_mog_Theatrhythm_setActorHome.call(this,index);
  1789. };
  1790.  
  1791. //==============================
  1792. // * refreshMotion
  1793. //==============================
  1794. var _alias_mog_Theatrhythm_refreshMotion = Sprite_Actor.prototype.refreshMotion;
  1795. Sprite_Actor.prototype.refreshMotion = function() {
  1796.         if ($gameSystem._theatrhythm) {this.refreshMotion_Theatrhythm();return};
  1797.         _alias_mog_Theatrhythm_refreshMotion.call(this);
  1798. };
  1799.  
  1800. //==============================
  1801. // * refreshMotion_Theatrhythm
  1802. //==============================
  1803. Sprite_Actor.prototype.refreshMotion_Theatrhythm = function() {       
  1804.     var actor = this._actor;
  1805.     if (actor) {
  1806.                  if ($gameSystem._theatrhythm_phase === 11) {
  1807.             this.startMotion('dead');
  1808.          } else {
  1809.             this.startMotion('walk');
  1810.          };
  1811.     };
  1812. };

Lv1.梦旅人

梦石
0
星屑
245
在线时间
219 小时
注册时间
2015-9-24
帖子
166
2
发表于 2016-2-18 16:56:15 | 只看该作者
不是有demo吗
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
帖子
873
3
 楼主| 发表于 2016-2-18 17:17:50 | 只看该作者
chenyilindzh 发表于 2016-2-18 16:56
不是有demo吗

甚麼demo? 不懂?
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-11 12:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表