Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // MOG_BattleHud.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc (v2.7) Permite customizar o layout de batalha.
  7.  * @author Moghunter
  8.  *
  9.  * @param Hud X-Axis
  10.  * @desc Definição da posição X-Axis da Hud.
  11.  * @default -90
  12.  *
  13.  * @param Hud Y-Axis
  14.  * @desc Definição da posição Y-Axis da Hud.
  15.  * @default 460
  16.  *
  17.  * @param Hud Space X
  18.  * @desc Define o espaço na horizontal entre as huds.
  19.  * @default 0
  20.  *
  21.  * @param Hud Space Y
  22.  * @desc Define o espaço na vertical entre as huds.
  23.  * @default 0
  24.  *
  25.  * @param Vertical Mode
  26.  * @desc Deixar a Hud na posição vertical.
  27.  * @default false
  28.  *
  29.  * @param Command Auto Adjust
  30.  * @desc Ativar ajuste automático baseado na posição
  31.  * da Hud. (false - Define a posição fixa.)
  32.  * @default true
  33.  *
  34.  * @param Max Battle Members
  35.  * @desc Quantidade de maxima de battler na batalha.
  36.  * @default 4
  37.  *
  38.  * @param >> LAYOUT OVERLAY =========
  39.  *
  40.  * @param Layout2 Visible
  41.  * @desc Ativar o segunda imagem do layout, esta imagem
  42.  * ficará acima das faces e medidores.
  43.  * @default false
  44.  *
  45.  * @param Layout2 X-Axis
  46.  * @desc Definição da posição X-Axis da Hud.
  47.  * @default 0
  48.  *
  49.  * @param Layout2 Y-Axis
  50.  * @desc Definição da posição Y-Axis da Hud.
  51.  * @default 0
  52.  *
  53.  * @param >> TURN ===================
  54.  * @desc
  55.  * @default  
  56.  *
  57.  * @param Turn Visible
  58.  * @desc Apresentar a imagem do turno.
  59.  * @default true
  60.  *
  61.  * @param Turn X-Axis
  62.  * @desc Definição da posição X-Axis do turno.
  63.  * @default 0
  64.  *
  65.  * @param Turn Y-Axis
  66.  * @desc Definição da posição Y-Axis do turno.
  67.  * @default 0
  68.  *
  69.  * @param >> FACE ===================
  70.  * @desc
  71.  * @default  
  72.  *
  73.  * @param Face Visible
  74.  * @desc Apresentar a imagem da face.
  75.  * @default true
  76.  *
  77.  * @param Face X-Axis
  78.  * @desc Definição da posição X-Axis da face.
  79.  * @default 44
  80.  *
  81.  * @param Face Y-Axis
  82.  * @desc Definição da posição Y-Axis da face.
  83.  * @default 72
  84.  *
  85.  * @param Face Shake Animation
  86.  * @desc Ativar animação de tremer da face.
  87.  * @default true
  88.  *
  89.  * @param Face Zoom Animation
  90.  * @desc Ativar animação de zoom de ação.
  91.  * @default true
  92.  *
  93.  * @param Face Frame Animation
  94.  * @desc Ativar animação por frames.
  95.  *       É necessário dividir a imagem por 5.
  96.  * @default false
  97.  *
  98.  * @param Face Priority
  99.  * @desc Prioridade da Face. (0 Low - 1 High)
  100.  * @default 0
  101.  *
  102.  * @param >> NAME ===================
  103.  * @desc
  104.  * @default
  105.  *
  106.  * @param Name Visible
  107.  * @desc Apresentar o nome do personagem.
  108.  * @default true
  109.  *
  110.  * @param Name X-Axis
  111.  * @desc Definição da posição X-Axis do nome.
  112.  * @default 0
  113.  *
  114.  * @param Name Y-Axis
  115.  * @desc Definição da posição Y-Axis do nome.
  116.  * @default -20
  117.  *
  118.  * @param Name Font Size
  119.  * @desc Definição do tamanho da fonte do nome.
  120.  * @default 20
  121.  *
  122.  * @param Name Bold Size
  123.  * @desc Definição do tamanho do contorno.
  124.  * @default 4
  125.  *
  126.  * @param Name Font Italic
  127.  * @desc Ativar fonte em itálico.
  128.  * @default false
  129.  *
  130.  * @param >> HP ===================
  131.  * @desc
  132.  * @default
  133.  *
  134.  * @param HP Meter Visible
  135.  * @desc Apresentar o medidor de HP
  136.  * @default true  
  137.  *
  138.  * @param HP Meter X-Axis
  139.  * @desc Definição da posição X-Axis do medidor de HP.
  140.  * @default 113
  141.  *
  142.  * @param HP Meter Y-Axis
  143.  * @desc Definição da posição Y-Axis do medidor de HP.
  144.  * @default 39
  145.  *
  146.  * @param HP Meter Angle
  147.  * @desc Ángulo do medidor.
  148.  * @default 0
  149.  *
  150.  * @param HP Meter Flow Anime
  151.  * @desc Ativar animação de gradiente no medidor.
  152.  * É necessário que a imagem tenha 3x a largura do medidor.
  153.  * @default false
  154.  *
  155.  * @param HP Number Visible
  156.  * @desc Apresentar o numero de HP
  157.  * @default true
  158.  *
  159.  * @param HP Number Align type
  160.  * @desc Definição do tipo de alinhamento dos números.
  161.  * (0 - right 1) (Center 2 - Left) (3 - Diagonal)
  162.  * @default 0    
  163.  *
  164.  * @param HP Number X-Axis
  165.  * @desc Definição da posição X-Axis do numero de HP.
  166.  * @default 175
  167.  *
  168.  * @param HP Number Y-Axis
  169.  * @desc Definição da posição Y-Axis do numero de HP.
  170.  * @default 23
  171.  *
  172.  * @param MaxHP Number Visible
  173.  * @desc Apresentar o numero de HP maximo.
  174.  * @default false
  175.  *
  176.  * @param MaxHP Number X-Axis
  177.  * @desc Definição da posição X-Axis do numero de HP maximo.
  178.  * @default 185
  179.  *
  180.  * @param MaxHP Number Y-Axis
  181.  * @desc Definição da posição Y-Axis do numero de HP maximo.
  182.  * @default 40
  183.  *
  184.  * @param >> MP ===================
  185.  * @desc
  186.  * @default  
  187.  *
  188.  * @param MP Meter Visible
  189.  * @desc Apresentar o medidor de MP
  190.  * @default true  
  191.  *
  192.  * @param MP Meter X-Axis
  193.  * @desc Definição da posição X-Axis do medidor de MP.
  194.  * @default 125
  195.  *
  196.  * @param MP Meter Y-Axis
  197.  * @desc Definição da posição Y-Axis do medidor de MP.
  198.  * @default 77
  199.  *
  200.  * @param MP Meter Angle
  201.  * @desc Ángulo do medidor.
  202.  * @default 0
  203.  *
  204.  * @param MP Meter Flow Anime
  205.  * @desc Ativar animação de gradiente no medidor.
  206.  * É necessário que a imagem tenha 3x a largura do medidor.
  207.  * @default false
  208.  *
  209.  * @param MP Number Visible
  210.  * @desc Apresentar o numero de MP
  211.  * @default true
  212.  *
  213.  * @param MP Number Align type
  214.  * @desc Definição do tipo de alinhamento dos números.
  215.  * (0 - right 1) (Center 2 - Left) (3 - Diagonal)
  216.  * @default 0
  217.  *
  218.  * @param MP Number X-Axis
  219.  * @desc Definição da posição X-Axis do numero de MP.
  220.  * @default 186
  221.  *
  222.  * @param MP Number Y-Axis
  223.  * @desc Definição da posição Y-Axis do numero de MP.
  224.  * @default 61
  225.  *
  226.  * @param MaxMP Number Visible
  227.  * @desc Apresentar o numero de MP maximo.
  228.  * @default false
  229.  *
  230.  * @param MaxMP Number X-Axis
  231.  * @desc Definição da posição X-Axis do numero de MP maximo.
  232.  * @default 196
  233.  *
  234.  * @param MaxMP Number Y-Axis
  235.  * @desc Definição da posição Y-Axis do numero de MP maximo.
  236.  * @default 78
  237.  *
  238.  * @param >> TP ===================
  239.  * @desc
  240.  * @default  
  241.  *
  242.  * @param TP Meter Visible
  243.  * @desc Apresentar o medidor de TP
  244.  * @default true  
  245.  *
  246.  * @param TP Meter X-Axis
  247.  * @desc Definição da posição X-Axis do medidor de TP.
  248.  * @default 113
  249.  *
  250.  * @param TP Meter Y-Axis
  251.  * @desc Definição da posição Y-Axis do medidor de TP.
  252.  * @default 115
  253.  *
  254.  * @param TP Meter Angle
  255.  * @desc Ángulo do medidor.
  256.  * @default 0
  257.  *
  258.  * @param TP Meter Flow Anime
  259.  * @desc Ativar animação de gradiente no medidor.
  260.  * É necessário que a imagem tenha 3x a largura do medidor.
  261.  * @default false
  262.  *
  263.  * @param TP Number Visible
  264.  * @desc Apresentar o numero de TP.
  265.  * @default true  
  266.  *
  267.  * @param TP Number Align type
  268.  * @desc Definição do tipo de alinhamento dos números.
  269.  * (0 - right 1) (Center 2 - Left) (3 - Diagonal)
  270.  * @default 0
  271.  *
  272.  * @param TP Number X-Axis
  273.  * @desc Definição da posição X-Axis do numero de TP.
  274.  * @default 175
  275.  *
  276.  * @param TP Number Y-Axis
  277.  * @desc Definição da posição Y-Axis do numero de TP.
  278.  * @default 99
  279.  *
  280.  * @param MaxTP Number Visible
  281.  * @desc Apresentar o numero de TP maximo.
  282.  * @default false
  283.  *
  284.  * @param MaxTP Number X-Axis
  285.  * @desc Definição da posição X-Axis do numero de TP maximo.
  286.  * @default 185
  287.  *
  288.  * @param MaxTP Number Y-Axis
  289.  * @desc Definição da posição Y-Axis do numero de TP maximo.
  290.  * @default 116
  291.  *
  292.  * @param >> ATB ===================
  293.  * @desc
  294.  * @default  
  295.  *
  296.  * @param ATB Meter Visible
  297.  * @desc Apresentar o medidor de TP
  298.  * @default true  
  299.  *
  300.  * @param ATB Meter X-Axis
  301.  * @desc Definição da posição X-Axis do medidor de ATB.
  302.  * @default 80
  303.  *
  304.  * @param ATB Meter Y-Axis
  305.  * @desc Definição da posição Y-Axis do medidor de ATB.
  306.  * @default 140
  307.  *
  308.  * @param ATB Meter Angle
  309.  * @desc Ángulo do medidor.
  310.  * @default 0
  311.  *
  312.  * @param ATB Meter Flow Anime
  313.  * @desc Ativar animação de gradiente no medidor.
  314.  * É necessário que a imagem tenha 3x a largura do medidor.
  315.  * @default false
  316.  *
  317.  * @param >> STATES ===================
  318.  * @desc
  319.  * @default
  320.  *
  321.  * @param States Visible
  322.  * @desc Apresentar o numero as condições.
  323.  * @default true  
  324.  *
  325.  * @param States X-Axis
  326.  * @desc Definição da posição X-Axis das condições.
  327.  * @default 10
  328.  *
  329.  * @param States Y-Axis
  330.  * @desc Definição da posição Y-Axis das condições.
  331.  * @default 120
  332.  *
  333.  * @param >> W COMMAND ===================
  334.  * @desc
  335.  * @default
  336.  *
  337.  * @param W Command X-Axis
  338.  * @desc Definição do posição X-axis do comando.
  339.  * @default 0    
  340.  *
  341.  * @param W Command Y-Axis
  342.  * @desc Definição do posição Y-axis do comando.
  343.  * @default -15
  344.  *
  345.  * @param W Command Width
  346.  * @desc Definição da largura da janela.
  347.  * @default 192
  348.  *
  349.  * @param W Command Height
  350.  * @desc Definição da altura da janela.
  351.  * @default 180
  352.  *
  353.  * @param Layout Command
  354.  * @desc Ativar a imagem de layout.
  355.  * @default true
  356.  *
  357.  * @param L Command X-Axis
  358.  * @desc Definição do posição X-axis do layout.
  359.  * @default -25  
  360.  *
  361.  * @param L Command Y-Axis
  362.  * @desc Definição do posição Y-axis do layout.
  363.  * @default -35
  364.  *
  365.  * @param >> W PARTY ===================
  366.  * @desc
  367.  * @default  
  368.  *
  369.  * @param W Party X-Axis
  370.  * @desc Definição do posição X-axis da janela.
  371.  * @default 325    
  372.  *
  373.  * @param W Party Y-Axis
  374.  * @desc Definição do posição Y-axis do janela.
  375.  * @default 170
  376.  *
  377.  * @param W Party Width
  378.  * @desc Definição da largura da janela.
  379.  * @default 192
  380.  *
  381.  * @param W Party Height
  382.  * @desc Definição da altura da janela.
  383.  * @default 110
  384.  *
  385.  * @param Layout Party
  386.  * @desc Ativar a imagem de layout.
  387.  * @default true
  388.  *
  389.  * @param L Party X-Axis
  390.  * @desc Definição do posição X-axis do layout.
  391.  * @default -325  
  392.  *
  393.  * @param L Party Y-Axis
  394.  * @desc Definição do posição Y-axis do layout.
  395.  * @default -42
  396.  *
  397.  * @param >> W HELP ===================
  398.  * @desc
  399.  * @default  
  400.  *
  401.  * @param W Help X-Axis
  402.  * @desc Definição do posição X-axis da janela.
  403.  * @default 0    
  404.  *
  405.  * @param W Help Y-Axis
  406.  * @desc Definição do posição Y-axis do janela.
  407.  * @default 0
  408.  *
  409.  * @param W Help Width
  410.  * @desc Definição da largura da janela.
  411.  * @default 816
  412.  *
  413.  * @param W Help Height
  414.  * @desc Definição da altura da janela.
  415.  * @default 108
  416.  *
  417.  * @param Layout Help
  418.  * @desc Ativar a imagem de layout.
  419.  * @default true
  420.  *
  421.  * @param L Help X-Axis
  422.  * @desc Definição do posição X-axis do layout.
  423.  * @default 0  
  424.  *
  425.  * @param L Help Y-Axis
  426.  * @desc Definição do posição Y-axis do layout.
  427.  * @default 0
  428.  *
  429.  * @param >> W SKILL ===================
  430.  * @desc
  431.  * @default  
  432.  *
  433.  * @param W Skill X-Axis
  434.  * @desc Definition of X-axis position of the window.
  435.  * @default 0    
  436.  *
  437.  * @param W Skill Y-Axis
  438.  * @desc Setting the Y-axis position of the window.
  439.  * @default 444
  440.  *
  441.  * @param W Skill Width
  442.  * @desc window width setting.
  443.  * @default 816
  444.  *
  445.  * @param W Skill Height
  446.  * @desc Setting the window height.
  447.  * @default 180
  448.  *
  449.  * @param W Skill maxCols
  450.  * @desc Definition of the amount of window columns.
  451.  * @default 2
  452.  *
  453.  * @param Layout Skill
  454.  * @desc Enable the layout image.
  455.  * @default true
  456.  *
  457.  * @param L Skill X-Axis
  458.  * @desc Definition of X-axis position of the layout.
  459.  * @default 0  
  460.  *
  461.  * @param L Skill Y-Axis
  462.  * @desc Setting the Y-axis position of the layout.
  463.  * @default -67
  464.  *
  465.  * @param >> W ITEM ===================
  466.  * @desc
  467.  * @default  
  468.  *
  469.  * @param W Item X-Axis
  470.  * @desc Definition of X-axis position of the window.
  471.  * @default 0    
  472.  *
  473.  * @param W Item Y-Axis
  474.  * @desc Setting the Y-axis position of the window.
  475.  * @default 444
  476.  *
  477.  * @param W Item Width
  478.  * @desc window width setting.
  479.  * @default 816
  480.  *
  481.  * @param W Item Height
  482.  * @desc Setting the window height.
  483.  * @default 180
  484.  *
  485.  * @param W Item maxCols
  486.  * @desc Definition of the amount of window columns.
  487.  * @default 2
  488.  *
  489.  * @param Layout Item
  490.  * @desc Enable the layout image.
  491.  * @default true
  492.  *
  493.  * @param L Item X-Axis
  494.  * @desc Definition of X-axis position of the layout.
  495.  * @default 0  
  496.  *
  497.  * @param L Item Y-Axis
  498.  * @desc Setting the Y-axis position of the layout.
  499.  * @default -67
  500.  *
  501.  * @param >> W ACTOR ===================
  502.  * @desc
  503.  * @default  
  504.  *
  505.  * @param W Actor X-Axis
  506.  * @desc Definição do posição X-axis da janela.
  507.  * @default 0    
  508.  *
  509.  * @param W Actor Y-Axis
  510.  * @desc Definição do posição Y-axis do janela.
  511.  * @default 444
  512.  *
  513.  * @param W Actor Width
  514.  * @desc Definição da largura da janela.
  515.  * @default 816
  516.  *
  517.  * @param W Actor Height
  518.  * @desc Definição da altura da janela.
  519.  * @default 180
  520.  *
  521.  * @param W Actor maxCols
  522.  * @desc Definição da quantidade de colunas da janela.
  523.  * @default 1
  524.  *
  525.  * @param Layout Actor
  526.  * @desc Ativar a imagem de layout.
  527.  * @default true
  528.  *
  529.  * @param L Actor X-Axis
  530.  * @desc Definição do posição X-axis do layout.
  531.  * @default 0  
  532.  *
  533.  * @param L Actor Y-Axis
  534.  * @desc Definição do posição Y-axis do layout.
  535.  * @default -67  
  536.  *
  537.  * @param >> W ENEMY ===================
  538.  * @desc
  539.  * @default  
  540.  *
  541.  * @param W Enemy X-Axis
  542.  * @desc Definição do posição X-axis da janela.
  543.  * @default 0    
  544.  *
  545.  * @param W Enemy Y-Axis
  546.  * @desc Definição do posição Y-axis do janela.
  547.  * @default 444
  548.  *
  549.  * @param W Enemy Width
  550.  * @desc Definição da largura da janela.
  551.  * @default 816
  552.  *
  553.  * @param W Enemy Height
  554.  * @desc Definição da altura da janela.
  555.  * @default 180
  556.  *
  557.  * @param W Enemy maxCols
  558.  * @desc Definição da quantidade de colunas da janela.
  559.  * @default 2
  560.  *
  561.  * @param Layout Enemy
  562.  * @desc Ativar a imagem de layout.
  563.  * @default true
  564.  *
  565.  * @param L Enemy X-Axis
  566.  * @desc Definição do posição X-axis do layout.
  567.  * @default 0
  568.  *
  569.  * @param L Enemy Y-Axis
  570.  * @desc Definição do posição Y-axis do layout.
  571.  * @default -67
  572.  *
  573.  * @param >> SCREEN LAYOUT ===================
  574.  * @desc
  575.  * @default
  576.  *
  577.  * @param Screen Layout
  578.  * @desc Ativar o Layout da tela.
  579.  * @default true
  580.  *
  581.  * @param Screen X-Axis
  582.  * @desc Definição do posição X-axis da imagem.
  583.  * @default 0
  584.  *
  585.  * @param Screen Y-Axis
  586.  * @desc Definição do posição Y-axis da imagem.
  587.  * @default 0
  588.  *
  589.  * @param >> CUSTOM POSITION ===================
  590.  * @desc
  591.  * @default  
  592.  *
  593.  * @param Custom Position 1
  594.  * @desc Definição da posição da hud.
  595.  * Ex -     200,200
  596.  * @default
  597.  *
  598.  * @param Custom Position 2
  599.  * @desc Definição da posição da hud.
  600.  * Ex -     200,200
  601.  * @default
  602.  *
  603.  * @param Custom Position 3
  604.  * @desc Definição da posição da hud.
  605.  * Ex -     200,200
  606.  * @default
  607.  *
  608.  * @param Custom Position 4
  609.  * @desc Definição da posição da hud.
  610.  * Ex -     200,200
  611.  * @default
  612.  *
  613.  * @param Custom Position 5
  614.  * @desc Definição da posição da hud.
  615.  * Ex -     200,200
  616.  * @default
  617.  *
  618.  * @param Custom Position 6
  619.  * @desc Definição da posição da hud.
  620.  * Ex -     200,200
  621.  * @default  
  622.  *
  623.  * @param Custom Position 7
  624.  * @desc Definição da posição da hud.
  625.  * Ex -     200,200
  626.  * @default
  627.  *
  628.  * @param Custom Position 8
  629.  * @desc Definição da posição da hud.
  630.  * Ex -     200,200
  631.  * @default  
  632.  *
  633.  * @help  
  634.  * =============================================================================
  635.  * +++ MOG_BattleHud (v2.7) +++
  636.  * By Moghunter
  637.  * https://atelierrgss.wordpress.com/
  638.  * =============================================================================
  639.  * O plugin permite customizar o layout de batalha.
  640.  * Serão necessários os arquivos. (img/battlehud/)
  641.  *
  642.  * HP_Meter.png
  643.  * HP_Number.png
  644.  * MP_Meter.png
  645.  * MP_Number.png
  646.  * TP_Meter.png
  647.  * TP_Number.png
  648.  * ATB_Meter.png
  649.  * Layout.png
  650.  * Layout_Actor.png
  651.  * Layout_Command.png
  652.  * Layout_Enemy.png
  653.  * Layout_Help.png
  654.  * Layout_Item.png
  655.  * Layout_Party.png
  656.  * Layout_Screen.png
  657.  * Layout_Skill.png
  658.  * Turn.png
  659.  *
  660.  * =============================================================================
  661.  * Para nomear as faces dos battlers basta nomear da seguinte forma.
  662.  *
  663.  * Face_ + ACTOR_ID.png
  664.  *
  665.  * Ex
  666.  *
  667.  * Face_1.png
  668.  * Face_2.png
  669.  * Face_3.png
  670.  * ...
  671.  *
  672.  * =============================================================================
  673.  * HISTÓRICO
  674.  * =============================================================================
  675.  * (2.7) - Correção de alguns plugins parameters.  
  676.  * (2.6) - Correção do parâmetro do Screen Layout Y não funcionar.
  677.  * (2.5) - Correção de alguns plugins parameters não funcionarem.
  678.  * (2.4) - Correção de não apresentar os ícones de Buff e Debuff.
  679.  * (2.3) - Melhoria na codificação.
  680.  * (2.2) - Adição da opção do alinhamento dos números.
  681.  *       - Adição do layout Overlay.
  682.  * (2.1) - Compatibilidade com MOG Battle Cursor no modo Front View.
  683.  * (2.0) - Faces como actors no modo Frontview.
  684.  *       - Opção de definir a quantidade battlers na batalha.
  685.  * (1.5) - Correção no setup do ângulo dos medidores.
  686.  * (1.4) - Correção na prioridade do layout Screen.
  687.  * (1.3) - Correção na posição do plugin do template.
  688.  * (1.2) - Adição do modo hud na vertical.
  689.  *       - Opção de definir o espaço entre as huds.
  690.  *       - Opção de definir uma posição absoluta para a janela de comando.
  691.  *       - Opção de definir posições especificas das huds.
  692.  *       - Função de faces animadas por frames.
  693.  *       - Opção da animação em gradiente do medidor.
  694.  * (1.1) - Opção de poder definir a prioridade da face.
  695.  *               (0 - Abaixo do layout. 1 - Acima do layout.)
  696.  *       - Opção de definir a quantidade de colunas da janela.
  697.  *       - Correção da posição das condições através do setup.
  698.  *
  699.  */
  700.  
  701. //=============================================================================
  702. // ** PLUGIN PARAMETERS
  703. //=============================================================================
  704.  
  705. //=============================================================================
  706. // ** PLUGIN PARAMETERS
  707. //=============================================================================
  708.   var Imported = Imported || {};
  709.   Imported.MOG_BattleHud = true;
  710.   var Moghunter = Moghunter || {};
  711.  
  712.    Moghunter.parameters = PluginManager.parameters('MOG_BattleHud');
  713.    
  714.     // HUD POSITION
  715.     Moghunter.bhud_pos_x = Number(Moghunter.parameters['Hud X-Axis'] || -90);
  716.     Moghunter.bhud_pos_y = Number(Moghunter.parameters['Hud Y-Axis'] || 460);
  717.     Moghunter.bhud_space_x = Number(Moghunter.parameters['Hud Space X'] || 0);
  718.     Moghunter.bhud_space_y  = Number(Moghunter.parameters['Hud Space Y'] || 0);
  719.     Moghunter.bhud_pos_mode = String(Moghunter.parameters['Vertical Mode'] || false);
  720.     Moghunter.bhud_max_battle_members = Number(Moghunter.parameters['Max Battle Members'] || 4);
  721.    
  722.     // Layout Overlay
  723.     Moghunter.bhud_layoverlay_visible = String(Moghunter.parameters['Layout2 Visible'] || "false");
  724.     Moghunter.bhud_layoverlay_x = Number(Moghunter.parameters['Layout2 X-Axis'] || 0);
  725.     Moghunter.bhud_layoverlay_y = Number(Moghunter.parameters['Layout2 Y-Axis'] || 0); 
  726.    
  727.     // Screen Layout
  728.     Moghunter.bhud_screen_layout = String(Moghunter.parameters['Screen Layout'] || true);
  729.     Moghunter.bhud_screen_layout_x = Number(Moghunter.parameters['Screen X-Axis'] || 0);
  730.     Moghunter.bhud_screen_layout_y = Number(Moghunter.parameters['Screen Y-Axis'] || 0);
  731.        
  732.     // TURN POSITION
  733.     Moghunter.bhud_turn_visible = String(Moghunter.parameters['Turn Visible'] || true);
  734.     Moghunter.bhud_turn_pos_x = Number(Moghunter.parameters['Turn X-Axis'] || 0);
  735.     Moghunter.bhud_turn_pos_y = Number(Moghunter.parameters['Turn Y-Axis'] || 0);      
  736.    
  737.     // FACE POSITION
  738.     Moghunter.bhud_face_visible = String(Moghunter.parameters['Face Visible'] || true);
  739.     Moghunter.bhud_face_shake = String(Moghunter.parameters['Face Shake Animation'] || true);
  740.     Moghunter.bhud_face_zoom = String(Moghunter.parameters['Face Zoom Animation'] || true);
  741.     Moghunter.bhud_face_animated = String(Moghunter.parameters['Face Frame Animation'] || false);
  742.     Moghunter.bhud_face_pos_x = Number(Moghunter.parameters['Face X-Axis'] || 44);
  743.     Moghunter.bhud_face_pos_y = Number(Moghunter.parameters['Face Y-Axis'] || 72);
  744.     Moghunter.bhud_face_priority = Number(Moghunter.parameters['Face Priority'] || 0);
  745.    
  746.     // NAME POSITION
  747.     Moghunter.bhud_name_visible = String(Moghunter.parameters['Name Visible'] || true);
  748.     Moghunter.bhud_name_font_size = Number(Moghunter.parameters['Name Font Size'] || 20);
  749.     Moghunter.bhud_name_font_bold_size = Number(Moghunter.parameters['Name Bold Size'] || 4);
  750.     Moghunter.bhud_name_font_italic = String(Moghunter.parameters['Name Font Italic'] || false);   
  751.     Moghunter.bhud_name_pos_x = Number(Moghunter.parameters['Name X-Axis'] || 0);
  752.     Moghunter.bhud_name_pos_y = Number(Moghunter.parameters['Name Y-Axis'] || -20);
  753.        
  754.     // HP METER POSITION
  755.     Moghunter.bhud_hp_meter_visible = String(Moghunter.parameters['HP Meter Visible'] || true);
  756.     Moghunter.bhud_hp_meter_pos_x = Number(Moghunter.parameters['HP Meter X-Axis'] || 113);
  757.     Moghunter.bhud_hp_meter_pos_y = Number(Moghunter.parameters['HP Meter Y-Axis'] || 39);
  758.     Moghunter.bhud_hp_meter_rotation = Number(Moghunter.parameters['HP Meter Angle'] || 0);
  759.     Moghunter.bhud_hp_meter_flow = String(Moghunter.parameters['HP Meter Flow Anime'] || false);
  760.    
  761.     // HP NUMBER POSITION
  762.     Moghunter.bhud_hp_number_visible  = String(Moghunter.parameters['HP Number Visible'] || true);
  763.     Moghunter.bhud_hp_number_pos_x  = Number(Moghunter.parameters['HP Number X-Axis'] || 175);
  764.     Moghunter.bhud_hp_number_pos_y  = Number(Moghunter.parameters['HP Number Y-Axis'] || 23);
  765.     Moghunter.bhud_maxhp_number_visible  = String(Moghunter.parameters['MaxHP Number Visible'] || false);
  766.     Moghunter.bhud_maxhp_number_pos_x  = Number(Moghunter.parameters['MaxHP Number X-Axis'] || 185);
  767.     Moghunter.bhud_maxhp_number_pos_y  = Number(Moghunter.parameters['MaxHP Number Y-Axis'] || 40);
  768.     Moghunter.bhud_hp_align_type  = Number(Moghunter.parameters['HP Number Align type'] || 0);
  769.    
  770.     // MP METER POSITION
  771.     Moghunter.bhud_mp_meter_visible = String(Moghunter.parameters['MP Meter Visible'] || true);
  772.     Moghunter.bhud_mp_meter_pos_x = Number(Moghunter.parameters['MP Meter X-Axis'] || 125);
  773.     Moghunter.bhud_mp_meter_pos_y = Number(Moghunter.parameters['MP Meter Y-Axis'] || 77); 
  774.     Moghunter.bhud_mp_meter_rotation = Number(Moghunter.parameters['MP Meter Angle'] || 0);
  775.     Moghunter.bhud_mp_meter_flow = String(Moghunter.parameters['MP Meter Flow Anime'] || false);
  776.    
  777.     // MP NUMBER POSITION
  778.     Moghunter.bhud_mp_number_visible  = String(Moghunter.parameters['MP Number Visible'] || true);
  779.     Moghunter.bhud_mp_number_pos_x  = Number(Moghunter.parameters['MP Number X-Axis'] || 186);
  780.     Moghunter.bhud_mp_number_pos_y  = Number(Moghunter.parameters['MP Number Y-Axis'] || 61);
  781.     Moghunter.bhud_maxmp_number_visible  = String(Moghunter.parameters['MaxMP Number Visible'] || false);
  782.     Moghunter.bhud_maxmp_number_pos_x  = Number(Moghunter.parameters['MaxMP Number X-Axis'] || 196);
  783.     Moghunter.bhud_maxmp_number_pos_y  = Number(Moghunter.parameters['MaxMP Number Y-Axis'] || 78);
  784.     Moghunter.bhud_mp_align_type  = Number(Moghunter.parameters['MP Number Align type'] || 0);
  785.    
  786.     // TP METER POSITION
  787.     Moghunter.bhud_tp_meter_visible = String(Moghunter.parameters['TP Meter Visible'] || true);
  788.     Moghunter.bhud_tp_meter_pos_x = Number(Moghunter.parameters['TP Meter X-Axis'] || 113);
  789.     Moghunter.bhud_tp_meter_pos_y = Number(Moghunter.parameters['TP Meter Y-Axis'] || 115);
  790.     Moghunter.bhud_tp_meter_rotation = Number(Moghunter.parameters['TP Meter Angle'] || 0);
  791.     Moghunter.bhud_tp_meter_flow = String(Moghunter.parameters['TP Meter Flow Anime'] || false);
  792.    
  793.     // TP NUMBER POSITION
  794.     Moghunter.bhud_tp_number_visible  = String(Moghunter.parameters['TP Number Visible'] || true);
  795.     Moghunter.bhud_tp_number_pos_x  = Number(Moghunter.parameters['TP Number X-Axis'] || 175);
  796.     Moghunter.bhud_tp_number_pos_y  = Number(Moghunter.parameters['TP Number Y-Axis'] || 99);
  797.     Moghunter.bhud_maxtp_number_visible  = String(Moghunter.parameters['MaxTP Number Visible'] || false);
  798.     Moghunter.bhud_maxtp_number_pos_x  = Number(Moghunter.parameters['MaxTP Number X-Axis'] || 185);
  799.     Moghunter.bhud_maxtp_number_pos_y  = Number(Moghunter.parameters['MaxTP Number Y-Axis'] || 116);   
  800.     Moghunter.bhud_tp_align_type  = Number(Moghunter.parameters['TP Number Align type'] || 0);
  801.    
  802.     // AT METER POSITION
  803.     Moghunter.bhud_at_meter_visible = String(Moghunter.parameters['ATB Meter Visible'] || true);
  804.     Moghunter.bhud_at_meter_pos_x = Number(Moghunter.parameters['ATB Meter X-Axis'] || 80);
  805.     Moghunter.bhud_at_meter_pos_y = Number(Moghunter.parameters['ATB Meter Y-Axis'] || 140);   
  806.     Moghunter.bhud_at_meter_rotation = Number(Moghunter.parameters['ATB Meter Angle'] || 0);
  807.     Moghunter.bhud_at_meter_flow = String(Moghunter.parameters['ATB Meter Flow Anime'] || false);
  808.    
  809.     // STATES POSITION
  810.     Moghunter.bhud_states_visible = String(Moghunter.parameters['States Visible'] || true);
  811.     Moghunter.bhud_states_pos_x = Number(Moghunter.parameters['States X-Axis'] || 10);
  812.     Moghunter.bhud_states_pos_y = Number(Moghunter.parameters['States Y-Axis'] || 120);
  813.  
  814.     // COMMAND WINDOWS
  815.     Moghunter.bhud_auto_pos = String(Moghunter.parameters['Command Auto Adjust'] || true);
  816.     Moghunter.bhud_com_x = Number(Moghunter.parameters['W Command X-Axis'] || 0);
  817.     Moghunter.bhud_com_y = Number(Moghunter.parameters['W Command Y-Axis'] || -15);
  818.     Moghunter.bhud_com_layout = String(Moghunter.parameters['Layout Command'] || true);
  819.     Moghunter.bhud_com_lay_x = Number(Moghunter.parameters['L Command X-Axis'] || -25);
  820.     Moghunter.bhud_com_lay_y = Number(Moghunter.parameters['L Command Y-Axis'] || -35);
  821.     Moghunter.bhud_com_width =  Number(Moghunter.parameters['W Command Width'] || 192);
  822.     Moghunter.bhud_com_height =  Number(Moghunter.parameters['W Command Height'] || 180);      
  823.    
  824.     // PARTY WINDOWS
  825.     Moghunter.bhud_party_x = Number(Moghunter.parameters['W Party X-Axis'] || 325);
  826.     Moghunter.bhud_party_y = Number(Moghunter.parameters['W Party Y-Axis'] || 170);
  827.     Moghunter.bhud_party_layout = String(Moghunter.parameters['Layout Party'] || true);
  828.     Moghunter.bhud_party_lay_x = Number(Moghunter.parameters['L Party X-Axis'] || -325);
  829.     Moghunter.bhud_party_lay_y = Number(Moghunter.parameters['L Party Y-Axis'] || -42);
  830.     Moghunter.bhud_party_width =  Number(Moghunter.parameters['W Party Width'] || 192);
  831.     Moghunter.bhud_party_height =  Number(Moghunter.parameters['W Party Height'] || 110);  
  832.        
  833.     // HELP WINDOW
  834.     Moghunter.bhud_help_x = Number(Moghunter.parameters['W Help X-Axis'] || 0);
  835.     Moghunter.bhud_help_y = Number(Moghunter.parameters['W Help Y-Axis'] || 0);
  836.     Moghunter.bhud_help_layout = String(Moghunter.parameters['Layout Help'] || true);
  837.     Moghunter.bhud_help_lay_x = Number(Moghunter.parameters['L Help X-Axis'] || 0);
  838.     Moghunter.bhud_help_lay_y = Number(Moghunter.parameters['L Help Y-Axis'] || 0);
  839.     Moghunter.bhud_help_width = Number(Moghunter.parameters['W Help Width'] || 816);
  840.     Moghunter.bhud_help_height = Number(Moghunter.parameters['W Help Height'] || 108);
  841.        
  842.     // SKILL WINDOW
  843.     Moghunter.bhud_skill_x =  Number(Moghunter.parameters['W Skill X-Axis'] || 0);
  844.     Moghunter.bhud_skill_y =  Number(Moghunter.parameters['W Skill Y-Axis'] || 444);
  845.     Moghunter.bhud_skill_layout = String(Moghunter.parameters['Layout Skill'] || true);
  846.     Moghunter.bhud_skill_lay_x =  Number(Moghunter.parameters['L Skill X-Axis'] || 0);
  847.     Moghunter.bhud_skill_lay_y =  Number(Moghunter.parameters['L Skill Y-Axis'] || -67);
  848.     Moghunter.bhud_skill_width =  Number(Moghunter.parameters['W Skill Width'] || 816);
  849.     Moghunter.bhud_skill_height =  Number(Moghunter.parameters['W Skill Height'] || 180);
  850.     Moghunter.bhud_skill_maxcols = Number(Moghunter.parameters['W Skill maxCols'] || 2);   
  851.    
  852.     // ITEM WINDOW
  853.     Moghunter.bhud_item_x =  Number(Moghunter.parameters['W Item X-Axis'] || 390);
  854.     Moghunter.bhud_item_y =  Number(Moghunter.parameters['W Item Y-Axis'] || 282);
  855.     Moghunter.bhud_item_layout = String(Moghunter.parameters['Layout Item'] || true);
  856.     Moghunter.bhud_item_lay_x =  Number(Moghunter.parameters['L Item X-Axis'] || 0);
  857.     Moghunter.bhud_item_lay_y =  Number(Moghunter.parameters['L Item Y-Axis'] || -67);
  858.     Moghunter.bhud_item_width =  Number(Moghunter.parameters['W Item Width'] || 816);
  859.     Moghunter.bhud_item_height =  Number(Moghunter.parameters['W Item Height'] || 180);
  860.     Moghunter.bhud_item_maxcols = Number(Moghunter.parameters['W Item maxCols'] || 2);
  861.    
  862.     // ACTOR WINDOWS
  863.     Moghunter.bhud_actor_x = Number(Moghunter.parameters['W Actor X-Axis'] || 0);
  864.     Moghunter.bhud_actor_y = Number(Moghunter.parameters['W Actor Y-Axis'] || 444);
  865.     Moghunter.bhud_actor_layout = String(Moghunter.parameters['Layout Actor'] || true);
  866.     Moghunter.bhud_actor_lay_x = Number(Moghunter.parameters['L Actor X-Axis'] || 0);
  867.     Moghunter.bhud_actor_lay_y = Number(Moghunter.parameters['L Actor Y-Axis'] || -67);
  868.     Moghunter.bhud_actor_width =  Number(Moghunter.parameters['W Actor Width'] || 816);
  869.     Moghunter.bhud_actor_height =  Number(Moghunter.parameters['W Actor Height'] || 180);  
  870.     Moghunter.bhud_actor_maxcols = Number(Moghunter.parameters['W Actor maxCols'] || 1);
  871.    
  872.     // ENEMY WINDOWS
  873.     Moghunter.bhud_enemy_x = Number(Moghunter.parameters['W Enemy X-Axis'] || 0);
  874.     Moghunter.bhud_enemy_y = Number(Moghunter.parameters['W Enemy Y-Axis'] || 444);
  875.     Moghunter.bhud_enemy_layout = String(Moghunter.parameters['Layout Enemy'] || true);
  876.     Moghunter.bhud_enemy_lay_x = Number(Moghunter.parameters['L Enemy X-Axis'] || 0);
  877.     Moghunter.bhud_enemy_lay_y = Number(Moghunter.parameters['L Enemy Y-Axis'] || -67);
  878.     Moghunter.bhud_enemy_width =  Number(Moghunter.parameters['W Enemy Width'] || 816);
  879.     Moghunter.bhud_enemy_height =  Number(Moghunter.parameters['W Enemy Height'] || 180);          
  880.     Moghunter.bhud_enemy_maxcols = Number(Moghunter.parameters['W Enemy maxCols'] || 2);
  881.    
  882.     // Custom Position
  883.     Moghunter.bhud_custom_pos = [];
  884.     for (var i = 0; i < 8; i++) {
  885.         Moghunter.bhud_custom_pos[i] = (Moghunter.parameters['Custom Position ' + String(i + 1)] || null);
  886.     };
  887.  
  888. //=============================================================================
  889. // ** ImageManager
  890. //=============================================================================
  891.  
  892. //==============================
  893. // * BHud
  894. //==============================
  895. ImageManager.loadBHud = function(filename) {
  896.     return this.loadBitmap('img/battlehud/', filename, 0, true);
  897. };     
  898.    
  899. //=============================================================================
  900. // ** Game_Temp
  901. //=============================================================================
  902.  
  903. //==============================
  904. // * Initialize
  905. //==============================
  906. var _alias_mog_bhud_temp_initialize = Game_Temp.prototype.initialize;
  907. Game_Temp.prototype.initialize = function() {
  908.     _alias_mog_bhud_temp_initialize.call(this);
  909.     this._bhud_position = [];  
  910.     this._bhud_position_active = null;
  911.     this._battleEnd = false;
  912.     this._bhud_dp = false;
  913.     this._refreshBhud = false;
  914. };
  915.  
  916. //=============================================================================
  917. // ** Game_System
  918. //=============================================================================
  919.  
  920. //==============================
  921. // * Initialize
  922. //==============================
  923. var _alias_mog_bhud_sys_initialize = Game_System.prototype.initialize;
  924. Game_System.prototype.initialize = function() {
  925.     _alias_mog_bhud_sys_initialize.call(this);
  926.     this._bhud_position = [];
  927.     for (var i = 0; i < 8; i++) {
  928.         this._bhud_position[i] = this.set_hudcp(Moghunter.bhud_custom_pos[i]);
  929.     };
  930.     this._bhud_auto_com = false;
  931.     this._bhud_pos_mode = 0;
  932.     if (String(Moghunter.bhud_pos_mode) === "true") {this._bhud_pos_mode = 1};
  933.     if (String(Moghunter.bhud_auto_pos) === "true") {this._bhud_auto_com = true};
  934. };
  935.  
  936. //==============================
  937. // * set Hudcp
  938. //==============================
  939. Game_System.prototype.set_hudcp = function(value) {
  940.     if (!value) {return null};
  941.     var s = value.split(',');
  942.     if (!s[0] || !s[1]) {return null};
  943.     return  [Number(s[0]),Number(s[1])];
  944. }
  945.  
  946. //=============================================================================
  947. // ** Game Interpreter
  948. //=============================================================================
  949.  
  950. //==============================
  951. // * Command129
  952. //==============================
  953. var _alias_mog_bhud_command129 = Game_Interpreter.prototype.command129;
  954. Game_Interpreter.prototype.command129 = function() {   
  955.     _alias_mog_bhud_command129.call(this); 
  956.     $gameTemp._refresh_Bhud = true;
  957.     return true;
  958. };
  959.  
  960. //=============================================================================
  961. // ** Game Party
  962. //=============================================================================
  963.  
  964. //==============================
  965. // * max Battle Members
  966. //==============================
  967. Game_Party.prototype.maxBattleMembers = function() {
  968.     return Math.max(Moghunter.bhud_max_battle_members,1);
  969. };
  970.  
  971. //=============================================================================
  972. // ** BattleManager
  973. //=============================================================================
  974.  
  975. //==============================
  976. // * processVictory
  977. //==============================
  978. var _alias_mog_bhud_processVictory = BattleManager.processVictory;
  979. BattleManager.processVictory = function() {
  980.      $gameTemp._battleEnd = true;
  981.      _alias_mog_bhud_processVictory.call(this);  
  982. };
  983.  
  984. //==============================
  985. // * processAbort
  986. //==============================
  987. var _alias_mog_bhud_processAbort = BattleManager.processAbort;
  988. BattleManager.processAbort = function() {
  989.      $gameTemp._battleEnd = true;
  990.      _alias_mog_bhud_processAbort.call(this);    
  991. };
  992.  
  993. //==============================
  994. // * processDefeat
  995. //==============================
  996. var _alias_mog_bhud_processDefeat = BattleManager.processDefeat;
  997. BattleManager.processDefeat = function() {
  998.      $gameTemp._battleEnd = true;
  999.      _alias_mog_bhud_processDefeat.call(this);   
  1000. };
  1001.  
  1002.  
  1003. //=============================================================================
  1004. // ** Game BattlerBase
  1005. //=============================================================================
  1006.  
  1007. //==============================
  1008. // * Initialize
  1009. //==============================
  1010. var _alias_mog_bhud_gbat_initMembers = Game_BattlerBase.prototype.initMembers
  1011. Game_BattlerBase.prototype.initMembers = function() {
  1012.     _alias_mog_bhud_gbat_initMembers.call(this);
  1013.     this.need_refresh_bhud_states = false;
  1014.     this._bhud_face_data = [0,0,0,0];
  1015.     this._face_pos = [0,0];
  1016. };
  1017.  
  1018. //==============================
  1019. // * addNewState
  1020. //==============================
  1021. var _alias_mog_bhud_addNewState = Game_BattlerBase.prototype.addNewState
  1022. Game_BattlerBase.prototype.addNewState = function(stateId) {
  1023.     _alias_mog_bhud_addNewState.call(this,stateId);
  1024.     this.need_refresh_bhud_states = true;
  1025. };
  1026.  
  1027. //==============================
  1028. // * eraseState
  1029. //==============================
  1030. var _alias_mog_bhud_eraseState = Game_BattlerBase.prototype.eraseState
  1031. Game_BattlerBase.prototype.eraseState = function(stateId) {
  1032.     _alias_mog_bhud_eraseState.call(this,stateId);
  1033.     this.need_refresh_bhud_states = true;
  1034. };
  1035.  
  1036. //=============================================================================
  1037. // ** Game Action
  1038. //=============================================================================
  1039.  
  1040. //==============================
  1041. // * Apply
  1042. //==============================
  1043. var _alias_mog_bhud_apply = Game_Action.prototype.apply;
  1044. Game_Action.prototype.apply = function(target) {
  1045.      var oldhp = target.hp
  1046.      _alias_mog_bhud_apply.call(this,target);
  1047.      if (target.isActor()) {
  1048.          if (oldhp > target.hp) {target._bhud_face_data = [30,20,3,30]}
  1049.          else if (oldhp < target.hp) {target._bhud_face_data = [0,20,1,30]};
  1050.      };
  1051. };
  1052.  
  1053. //==============================
  1054. // * Prepare
  1055. //==============================
  1056. var _alias_mog_bmhud_action_prepare = Game_Action.prototype.prepare
  1057. Game_Action.prototype.prepare = function() {   
  1058.     _alias_mog_bmhud_action_prepare.call(this);
  1059.     if (this.subject().isActor() && String(Moghunter.bhud_face_zoom) === "true"){this.subject()._bhud_face_data = [0,40,2,40];};
  1060. };
  1061.  
  1062. //=============================================================================
  1063. // ** Game Actor
  1064. //=============================================================================
  1065.  
  1066. //==============================
  1067. // * Gain HP
  1068. //==============================
  1069. var _alias_mog_bhud_gainHp =Game_Actor.prototype.gainHp;
  1070. Game_Actor.prototype.gainHp = function(value) {
  1071.     _alias_mog_bhud_gainHp.call(this,value);
  1072.     this._bhud_face_data[3] += 1;
  1073. };
  1074.  
  1075. //==============================
  1076. // * Recover All
  1077. //==============================
  1078. var _alias_mog_bhud_recoverAll = Game_Actor.prototype.recoverAll;
  1079. Game_Actor.prototype.recoverAll = function() {
  1080.     _alias_mog_bhud_recoverAll.call(this);
  1081.     this._bhud_face_data[3] += 1;
  1082. };
  1083.  
  1084. //=============================================================================
  1085. // ** Window_BattleStatus
  1086. //=============================================================================
  1087.  
  1088. //==============================
  1089. // * Initialize
  1090. //==============================
  1091. var _alias_mog_bhud_initialize = Window_BattleStatus.prototype.initialize
  1092. Window_BattleStatus.prototype.initialize = function() {
  1093.     _alias_mog_bhud_initialize.call(this);
  1094.     this.visible = false
  1095. };
  1096.  
  1097. //=============================================================================
  1098. // ** Window_BattleSkill
  1099. //=============================================================================
  1100.  
  1101. //==============================
  1102. // * windowWidth
  1103. //==============================
  1104. Window_BattleSkill.prototype.windowWidth = function() {
  1105.    return Moghunter.bhud_skill_width;
  1106. };
  1107.  
  1108. //==============================
  1109. // * maxCols
  1110. //==============================
  1111. Window_BattleSkill.prototype.maxCols = function() {
  1112.     return Moghunter.bhud_skill_maxcols;
  1113. };
  1114.  
  1115. //=============================================================================
  1116. // ** Window_BattleItem
  1117. //=============================================================================
  1118.  
  1119. //==============================
  1120. // * windowWidth
  1121. //==============================
  1122. Window_BattleItem.prototype.windowWidth = function() {
  1123.    return Moghunter.bhud_item_width;
  1124. };
  1125.  
  1126. //==============================
  1127. // * maxCols
  1128. //==============================
  1129. Window_BattleItem.prototype.maxCols = function() {
  1130.     return Moghunter.bhud_item_maxcols;
  1131. };
  1132.  
  1133. //=============================================================================
  1134. // ** Window_BattleActor
  1135. //=============================================================================
  1136.  
  1137. //==============================
  1138. // * Initialize
  1139. //==============================
  1140. Window_BattleActor.prototype.windowWidth = function() {
  1141.     return Moghunter.bhud_actor_width;
  1142. };
  1143.  
  1144. //==============================
  1145. // * maxCols
  1146. //==============================
  1147. Window_BattleActor.prototype.maxCols = function() {
  1148.     return Moghunter.bhud_actor_maxcols;
  1149. };
  1150.  
  1151. //=============================================================================
  1152. // ** Window_BattleEnemy
  1153. //=============================================================================
  1154.  
  1155. //==============================
  1156. // * windowWidth
  1157. //==============================
  1158. Window_BattleEnemy.prototype.windowWidth = function() {
  1159.    return Moghunter.bhud_enemy_width;
  1160. };
  1161.  
  1162. //==============================
  1163. // * maxCols
  1164. //==============================
  1165. Window_BattleEnemy.prototype.maxCols = function() {
  1166.     return Moghunter.bhud_enemy_maxcols;
  1167. };
  1168.  
  1169. //=============================================================================
  1170. // ** Window Actor Command
  1171. //=============================================================================
  1172.  
  1173. //==============================
  1174. // * initialize
  1175. //==============================
  1176. var _alias_mog_bhud_wActCom_initialize = Window_ActorCommand.prototype.initialize;
  1177. Window_ActorCommand.prototype.initialize = function() {
  1178.     _alias_mog_bhud_wActCom_initialize.call(this);
  1179.     this._com_mode = Number($gameSystem._bhud_pos_mode)
  1180.     this._force_hide_duration = 0;
  1181. };
  1182.  
  1183. //==============================
  1184. // * initialize
  1185. //==============================
  1186. var _alias_mog_bhud_wActCom_refresh = Window_ActorCommand.prototype.activate;
  1187. Window_ActorCommand.prototype.activate = function() {
  1188.     _alias_mog_bhud_wActCom_refresh.call(this);
  1189.     if (String(Moghunter.bhud_com_layout) === "true") {this._force_hide_duration = 1};
  1190. };
  1191.  
  1192. //==============================
  1193. // * Update
  1194. //==============================
  1195. var _alias_mog_bhud_wcom_update = Window_ActorCommand.prototype.update;
  1196. Window_ActorCommand.prototype.update = function() {
  1197.     _alias_mog_bhud_wcom_update.call(this);
  1198.     if ($gameTemp._bhud_position_active) {
  1199.         this.visible = this.active;
  1200.         if ($gameSystem._bhud_auto_com) {
  1201.             this.x = $gameTemp._bhud_position_active[0] + Moghunter.bhud_com_x;
  1202.             if (this._com_mode === 0) {
  1203.                 this.y = $gameTemp._bhud_position_active[1] + Moghunter.bhud_com_y - this.height;}
  1204.             else {this.y = $gameTemp._bhud_position_active[1] + Moghunter.bhud_com_y};  }
  1205.         else {
  1206.             this.x = Moghunter.bhud_com_x;
  1207.             this.y = Moghunter.bhud_com_y;
  1208.         };
  1209.     };
  1210.     if (this._force_hide_duration > 0) {this._force_hide_duration -= 1;this.visible = false};
  1211. };
  1212.  
  1213. //=============================================================================
  1214. // ** Window Party Command
  1215. //=============================================================================
  1216.  
  1217. //==============================
  1218. // * Update
  1219. //==============================
  1220. var _alias_mog_bhud_wparty_update = Window_PartyCommand.prototype.update;
  1221. Window_PartyCommand.prototype.update = function() {
  1222.     _alias_mog_bhud_wparty_update.call(this);
  1223.     this.x = Moghunter.bhud_party_x;
  1224.     this.y = Moghunter.bhud_party_y;
  1225. };
  1226.  
  1227. //=============================================================================
  1228. // ** Sprite Actor
  1229. //=============================================================================
  1230.  
  1231. //==============================
  1232. // * Initialize
  1233. //==============================
  1234. var _alias_bhud_sprt_actor_initialize = Sprite_Actor.prototype.initialize
  1235. Sprite_Actor.prototype.initialize = function(battler) {
  1236.     _alias_bhud_sprt_actor_initialize.call(this,battler);
  1237.     this._sprite_face = false;
  1238.     if (String(Moghunter.bhud_face_visible) === "true") {this._sprite_face = true};
  1239. };
  1240.  
  1241. //==============================
  1242. // * Damage Offset X
  1243. //==============================
  1244. Sprite_Actor.prototype.damageOffsetX = function() {
  1245.     if (!$gameSystem.isSideView() && this._sprite_face) {return 0};
  1246.     return -32;
  1247. };
  1248.  
  1249. //==============================
  1250. // * update Position
  1251. //==============================
  1252. var _alias_mog_bhud_sprt_actor_updatePosition = Sprite_Battler.prototype.updatePosition;
  1253. Sprite_Battler.prototype.updatePosition = function() {
  1254.     if (!$gameSystem.isSideView() && this._sprite_face) {
  1255.         if (this._battler && $gameTemp._bhud_position[this._battler.index()]) {
  1256.            this.x = $gameTemp._bhud_position[this._battler.index()][0] + Moghunter.bhud_face_pos_x;
  1257.            this.y = $gameTemp._bhud_position[this._battler.index()][1] + Moghunter.bhud_face_pos_y;
  1258.            return;
  1259.         };
  1260.     }; 
  1261.     _alias_mog_bhud_sprt_actor_updatePosition.call(this);
  1262. };
  1263.  
  1264. //==============================
  1265. // * Setup Animation
  1266. //==============================
  1267. var _alias_mog_bhud_sprt_actor_setupAnimation = Sprite_Battler.prototype.setupAnimation;
  1268. Sprite_Actor.prototype.setupAnimation = function() {
  1269.     if (!$gameSystem.isSideView() && this._sprite_face) {
  1270.     while (this._battler.isAnimationRequested()) {
  1271.         var data = this._battler.shiftAnimation();
  1272.         var animation = $dataAnimations[data.animationId];
  1273.         var mirror = data.mirror;
  1274.         var delay = animation.position === 3 ? 0 : data.delay;
  1275.         this.startAnimation(animation, mirror, delay);
  1276.         for (var i = 0; i < this._animationSprites.length; i++) {
  1277.             var sprite = this._animationSprites[i];
  1278.             sprite.visible = true;
  1279.         }
  1280.     }
  1281.     return;
  1282.     };
  1283.     _alias_mog_bhud_sprt_actor_setupAnimation.call(this);
  1284. };
  1285.  
  1286. //==============================
  1287. // * Setup Damage Popup
  1288. //==============================
  1289. var _alias_mog_bhud_sprt_actor_setupDamagePopup = Sprite_Battler.prototype.setupDamagePopup
  1290. Sprite_Actor.prototype.setupDamagePopup = function() {
  1291.     if (!$gameSystem.isSideView() && this._sprite_face) {
  1292.         if (this._battler.isDamagePopupRequested()) {
  1293.             var sprite = new Sprite_Damage();
  1294.             sprite.x = this.x + this.damageOffsetX();
  1295.             sprite.y = this.y + this.damageOffsetY();
  1296.             sprite.setup(this._battler);
  1297.             this._damages.push(sprite);
  1298.             this.parent.addChild(sprite);
  1299.             this._battler.clearDamagePopup();
  1300.             this._battler.clearResult();
  1301.         };
  1302.     return;
  1303.     };
  1304.     _alias_mog_bhud_sprt_actor_setupDamagePopup.call(this);
  1305. };
  1306.  
  1307. //=============================================================================
  1308. // ** Scene Battle
  1309. //=============================================================================
  1310.  
  1311. //==============================
  1312. // ** createWindowLayer
  1313. //==============================
  1314. var _alias_mog_bhud_createUpperLayer = Spriteset_Battle.prototype.createUpperLayer
  1315. Spriteset_Battle.prototype.createUpperLayer = function() {
  1316.     this.create_battle_hud()    
  1317.     _alias_mog_bhud_createUpperLayer.call(this);
  1318.     if (!$gameSystem.isSideView()) {this.createActorsF()};
  1319. };
  1320.  
  1321. //==============================
  1322. // ** createActorsF
  1323. //==============================
  1324. Spriteset_Battle.prototype.createActorsF = function() {
  1325.     if (this._actorSprites) {
  1326.         for (var i = 0; i < this._actorSprites.length; i++) {
  1327.             this._battleField.removeChild(this._actorSprites[i]);
  1328.         };
  1329.     };
  1330.     this._actorSprites = [];
  1331.     for (var i = 0; i < $gameParty.maxBattleMembers(); i++) {
  1332.         this._actorSprites[i] = new Sprite_Actor();
  1333.         this.addChild(this._actorSprites[i]);
  1334.     };
  1335. };
  1336.  
  1337. //==============================
  1338. // ** create Battle Hud
  1339. //==============================
  1340. Spriteset_Battle.prototype.create_battle_hud = function() {
  1341.     if (String(Moghunter.bhud_screen_layout) === "true") {this.create_screen_layout();};
  1342.     $gameTemp.refresh_Bhud = false;
  1343.     $gameTemp._battleEnd = false;
  1344.     this._com_mode = Number($gameSystem._bhud_pos_mode)
  1345.     this._battle_hud = [];
  1346.     for (var i = 0; i < $gameParty.maxBattleMembers(); i++) {
  1347.         this._battle_hud[i] = new Battle_Hud(i);
  1348.         this.addChild(this._battle_hud[i]);
  1349.     }; 
  1350. };
  1351.  
  1352. //==============================
  1353. // * Create Screen Layout
  1354. //==============================
  1355. Spriteset_Battle.prototype.create_screen_layout = function() { 
  1356.     this._screen_layout = new Sprite(ImageManager.loadBHud("Layout_Screen"));
  1357.     this._screen_layout.opacity = 0;
  1358.     this._screen_layout.x = Moghunter.bhud_screen_layout_x;
  1359.     this._screen_layout.y = Moghunter.bhud_screen_layout_y;
  1360.     this.addChild(this._screen_layout);
  1361. };
  1362.  
  1363. //==============================
  1364. // * Update Hud visible
  1365. //==============================
  1366. Spriteset_Battle.prototype.update_hud_visible = function() {
  1367.     if (this.is_hud_visible()) {this._screen_layout.opacity += 10}   
  1368.     else {this._screen_layout.opacity -= 10};
  1369. };
  1370.  
  1371. //==============================
  1372. // * Is Hud Visible
  1373. //==============================
  1374. Spriteset_Battle.prototype.is_hud_visible = function() {
  1375.     if ($gameMessage.isBusy()) {return false};
  1376.     if ($gameTemp._battleEnd) {return false};
  1377.     return true
  1378. };
  1379.  
  1380. //==============================
  1381. // ** Update
  1382. //==============================
  1383. var _alias_mog_bhud_scbat_update = Spriteset_Battle.prototype.update
  1384. Spriteset_Battle.prototype.update = function() {
  1385.     _alias_mog_bhud_scbat_update.call(this);
  1386.     if (this._screen_layout) {this.update_hud_visible()};
  1387.     if ($gameTemp._refresh_Bhud) {this.refresh_battle_hud()};
  1388. }
  1389.  
  1390. //==============================
  1391. // ** Refresh Battle Hud
  1392. //==============================
  1393. Spriteset_Battle.prototype.refresh_battle_hud = function() {
  1394.     if (!this._battle_hud) {return};
  1395.     $gameTemp._refresh_Bhud = false;
  1396.     for (var i = 0; i < $gameParty.maxBattleMembers(); i++) {
  1397.         this._battle_hud[i].refresh_bhud();
  1398.     };     
  1399. };
  1400.  
  1401. //==============================
  1402. // ** createWindowLayer
  1403. //==============================
  1404. var _alias_mog_bhud_createWindowLayer = Scene_Battle.prototype.createWindowLayer
  1405. Scene_Battle.prototype.createWindowLayer = function() {
  1406.     this.create_layout_window();   
  1407.     _alias_mog_bhud_createWindowLayer.call(this);
  1408. };
  1409.  
  1410. //==============================
  1411. // ** createAllWindows
  1412. //==============================
  1413. var _alias_mog_bhud_createAllWindows = Scene_Battle.prototype.createAllWindows;
  1414. Scene_Battle.prototype.createAllWindows = function() {
  1415.     _alias_mog_bhud_createAllWindows.call(this);
  1416.    
  1417.     this._actorCommandWindow.x = Moghunter.bhud_com_x;
  1418.     this._actorCommandWindow.y = Moghunter.bhud_com_y;
  1419.     this._actorCommandWindow_org = [Moghunter.bhud_com_x,Moghunter.bhud_com_y];
  1420.     this._actorCommandWindow.width = Moghunter.bhud_com_width;
  1421.     this._actorCommandWindow.height = Moghunter.bhud_com_height;       
  1422.     if (String(Moghunter.bhud_com_layout) === "true") {this._actorCommandWindow.opacity = 0};
  1423.    
  1424.     this._partyCommandWindow.x = Moghunter.bhud_party_x;
  1425.     this._partyCommandWindow.y = Moghunter.bhud_party_y;
  1426.     this._partyCommandWindow_org = [Moghunter.bhud_party_x,Moghunter.bhud_party_y];
  1427.     this._partyCommandWindow.width = Moghunter.bhud_party_width;
  1428.     this._partyCommandWindow.height = Moghunter.bhud_party_height;     
  1429.     if (String(Moghunter.bhud_party_layout) === "true") {this._partyCommandWindow.opacity = 0};
  1430.    
  1431.     this._helpWindow.x = Moghunter.bhud_help_x;
  1432.     this._helpWindow.y = Moghunter.bhud_help_y;
  1433.     this._helpWindow_org = [this._helpWindow.x,this._helpWindow.y];
  1434.     this._helpWindow.width = Moghunter.bhud_help_width;
  1435.     this._helpWindow.height = Moghunter.bhud_help_height;  
  1436.     if (String(Moghunter.bhud_help_layout) === "true") {this._helpWindow.opacity = 0};
  1437.    
  1438.     this._skillWindow.x = Moghunter.bhud_skill_x;
  1439.     this._skillWindow.y = Moghunter.bhud_skill_y;
  1440.     this._skillWindow_org = [Moghunter.bhud_skill_x,Moghunter.bhud_skill_y];
  1441.     this._skillWindow.width = Moghunter.bhud_skill_width;
  1442.     this._skillWindow.height = Moghunter.bhud_skill_height;
  1443.     if (String(Moghunter.bhud_skill_layout) === "true") {this._skillWindow.opacity = 0};
  1444.    
  1445.     this._itemWindow.x = Moghunter.bhud_item_x;
  1446.     this._itemWindow.y = Moghunter.bhud_item_y;
  1447.     this._itemWindow_org = [this._itemWindow.x,this._itemWindow.y]  ;
  1448.     this._itemWindow.width = Moghunter.bhud_item_width;
  1449.     this._itemWindow.height = Moghunter.bhud_item_height;  
  1450.     if (String(Moghunter.bhud_item_layout) === "true") {this._itemWindow.opacity = 0};
  1451.    
  1452.     this._actorWindow.x = Moghunter.bhud_actor_x;
  1453.     this._actorWindow.y = Moghunter.bhud_actor_y;
  1454.     this._actorWindow_org = [this._actorWindow.x,this._actorWindow.y];
  1455.     this._actorWindow.width = Moghunter.bhud_actor_width;
  1456.     this._actorWindow.height = Moghunter.bhud_actor_height;
  1457.     if (String(Moghunter.bhud_actor_layout) === "true") {this._actorWindow.opacity = 0};
  1458.    
  1459.     this._enemyWindow.x = Moghunter.bhud_enemy_x;
  1460.     this._enemyWindow.y = Moghunter.bhud_enemy_y;
  1461.     this._enemyWindow_org = [Moghunter.bhud_enemy_x,Moghunter.bhud_enemy_y];
  1462.     this._enemyWindow.width = Moghunter.bhud_enemy_width;
  1463.     this._enemyWindow.height = Moghunter.bhud_enemy_height;
  1464.     if (String(Moghunter.bhud_enemy_layout) === "true") {this._enemyWindow.opacity = 0};
  1465. };
  1466.  
  1467. //==============================
  1468. // ** create Layout Window
  1469. //==============================
  1470. Scene_Battle.prototype.create_layout_window = function() {
  1471.     if (String(Moghunter.bhud_com_layout) === "true") {
  1472.         this._com_layout = new Sprite(ImageManager.loadBHud("Layout_Command"))
  1473.         this._com_layout.x = Moghunter.bhud_com_lay_x;
  1474.         this._com_layout.y = Moghunter.bhud_com_lay_y;
  1475.         this._com_layout.visible = false;
  1476.         this.addChild(this._com_layout);
  1477.     };
  1478.     if (String(Moghunter.bhud_party_layout) === "true") {
  1479.         this._party_layout = new Sprite(ImageManager.loadBHud("Layout_Party"))
  1480.         this._party_layout.x = Moghunter.bhud_party_lay_x;
  1481.         this._party_layout.y = Moghunter.bhud_party_lay_y;
  1482.         this._party_layout.visible = false;
  1483.         this.addChild(this._party_layout);
  1484.     };
  1485.     if (String(Moghunter.bhud_help_layout) === "true") {
  1486.         this._help_layout = new Sprite(ImageManager.loadBHud("Layout_Help"))
  1487.         this._help_layout.x = Moghunter.bhud_help_lay_x;
  1488.         this._help_layout.y = Moghunter.bhud_help_lay_y;
  1489.         this._help_layout.visible = false;
  1490.         this.addChild(this._help_layout);
  1491.     }; 
  1492.     if (String(Moghunter.bhud_skill_layout) === "true") {
  1493.  
  1494.         this._skill_layout = new Sprite(ImageManager.loadBHud("Layout_Skill"))
  1495.         this._skill_layout.x = Moghunter.bhud_skill_lay_x;
  1496.         this._skill_layout.y = Moghunter.bhud_skill_lay_y;
  1497.         this._skill_layout.visible = false;
  1498.         this.addChild(this._skill_layout);
  1499.     };
  1500.     if (String(Moghunter.bhud_item_layout) === "true") {
  1501.         this._item_layout = new Sprite(ImageManager.loadBHud("Layout_Item"))
  1502.         this._item_layout.x = Moghunter.bhud_item_lay_x;
  1503.         this._item_layout.y = Moghunter.bhud_item_lay_y;
  1504.         this._item_layout.visible = false;
  1505.         this.addChild(this._item_layout);
  1506.     };     
  1507.     if (String(Moghunter.bhud_actor_layout) === "true") {
  1508.         this._actor_layout = new Sprite(ImageManager.loadBHud("Layout_Actor"))
  1509.         this._actor_layout.x = Moghunter.bhud_actor_lay_x;
  1510.         this._actor_layout.y = Moghunter.bhud_actor_lay_y;
  1511.         this._actor_layout.visible = false;
  1512.         this.addChild(this._actor_layout);
  1513.     };
  1514.     if (String(Moghunter.bhud_enemy_layout) === "true") {
  1515.         this._enemy_layout = new Sprite(ImageManager.loadBHud("Layout_Enemy"))
  1516.         this._enemy_layout.x = Moghunter.bhud_enemy_lay_x;
  1517.         this._enemy_layout.y = Moghunter.bhud_enemy_lay_y;
  1518.         this._enemy_layout.visible = false;
  1519.         this.addChild(this._enemy_layout);
  1520.     }; 
  1521. };
  1522.  
  1523. //==============================
  1524. // ** update
  1525. //==============================
  1526. var _alias_mog_bhud_scnbattle_update = Scene_Battle.prototype.update
  1527. Scene_Battle.prototype.update = function() {
  1528.     _alias_mog_bhud_scnbattle_update.call(this);
  1529.     //this.updateWindowSlideEffect()
  1530.     this.updateLayoutWindow();
  1531. };
  1532.  
  1533. //==============================
  1534. // ** Set Actor Command Pos
  1535. //==============================
  1536. Scene_Battle.prototype.set_actor_command_pos = function() {
  1537.         if ($gameTemp._bhud_position_active) {
  1538.         if ($gameSystem._bhud_auto_com) {
  1539.             this.nx = $gameTemp._bhud_position_active[0] + Moghunter.bhud_com_x;
  1540.             if (this._com_mode === 0) {
  1541.                 this.ny = $gameTemp._bhud_position_active[1] + Moghunter.bhud_com_y - this._actorCommandWindow.height;}
  1542.             else {this.ny = $gameTemp._bhud_position_active[1] + Moghunter.bhud_com_y}; }
  1543.         else {
  1544.             this.nx = Moghunter.bhud_com_x;
  1545.             this.ny = Moghunter.bhud_com_y;
  1546.         };
  1547.         }
  1548.         else {
  1549.             this.nx = -this._actorCommandWindow.width//Graphics.width / 2;
  1550.             this.ny = Graphics.height / 2;
  1551.     };
  1552.     this._actorCommandWindow_org = [this.nx,this.ny]
  1553.     if (!this._actorCommandWindow.visible) {this._actorCommandWindow_org = [this.nx -100,this.ny]};
  1554.     if (!BattleManager.actor()) {this._actorCommandWindow_org = [this.nx = -this._actorCommandWindow.width,this.ny = Graphics.height / 2]}
  1555. };
  1556.  
  1557. //==============================
  1558. // ** updateWindowSlideEffect
  1559. //==============================
  1560. Scene_Battle.prototype.updateWindowSlideEffect = function() {
  1561.      var slide_speed = 10;
  1562.      this.set_actor_command_pos();
  1563.      this._actorCommandWindow.x = this.sprite_move_to(this._actorCommandWindow.x,this._actorCommandWindow_org[0],slide_speed);
  1564.      this._actorCommandWindow.y = this.sprite_move_to(this._actorCommandWindow.y,this._actorCommandWindow_org[1],slide_speed);
  1565.      this._partyCommandWindow.x = this.sprite_move_to(this._partyCommandWindow.x,this._partyCommandWindow_org[0],slide_speed);
  1566.      this._partyCommandWindow.y = this.sprite_move_to(this._partyCommandWindow.y,this._partyCommandWindow_org[1],slide_speed);
  1567.      this._helpWindow.x = this.sprite_move_to(this._helpWindow.x,this._helpWindow_org[0],slide_speed);
  1568.      this._helpWindow.y = this.sprite_move_to(this._helpWindow.y,this._helpWindow_org[1],slide_speed);
  1569.      this._skillWindow.x = this.sprite_move_to(this._skillWindow.x,this._skillWindow_org[0],slide_speed);
  1570.      this._skillWindow.y = this.sprite_move_to(this._skillWindow.y,this._skillWindow_org[1],slide_speed);
  1571.      this._itemWindow.x = this.sprite_move_to(this._itemWindow.x,this._itemWindow_org[0],slide_speed);
  1572.      this._itemWindow.y = this.sprite_move_to(this._itemWindow.y,this._itemWindow_org[1],slide_speed);
  1573.      this._actorWindow.x = this.sprite_move_to(this._actorWindow.x,this._actorWindow_org[0],slide_speed);
  1574.      this._actorWindow.y = this.sprite_move_to(this._actorWindow.y,this._actorWindow_org[1],slide_speed);
  1575.      this._enemyWindow.x = this.sprite_move_to(this._enemyWindow.x,this._enemyWindow_org[0],slide_speed);
  1576.      this._enemyWindow.y = this.sprite_move_to(this._enemyWindow.y,this._enemyWindow_org[1],slide_speed);
  1577. };   
  1578.      
  1579. //==============================
  1580. // ** updateLayoutWindows
  1581. //==============================
  1582. Scene_Battle.prototype.updateLayoutWindow = function() {
  1583.     if (this._com_layout) {
  1584.         this._com_layout.x = Moghunter.bhud_com_lay_x + this._actorCommandWindow.x;
  1585.         this._com_layout.y = Moghunter.bhud_com_lay_y + this._actorCommandWindow.y;
  1586.         this._com_layout.visible = this._actorCommandWindow.active;
  1587.         if (!this._actorCommandWindow.visible) {this._com_layout.visible = false};
  1588.     }; 
  1589.     if (this._party_layout) {
  1590.         this._partyCommandWindow.deactivate();
  1591.         this._party_layout.visible = this._partyCommandWindow.active;
  1592.         if (!this._partyCommandWindow.visible) {this._party_layout.visible = false};
  1593.     };
  1594.     if (this._help_layout) {
  1595.         this._help_layout.x = Moghunter.bhud_help_lay_x + this._helpWindow.x;
  1596.         this._help_layout.y = Moghunter.bhud_help_lay_y + this._helpWindow.y;
  1597.         this._help_layout.visible = this._helpWindow.visible;
  1598.     }; 
  1599.     if (this._skill_layout) {
  1600.         this._skill_layout.x = Moghunter.bhud_skill_lay_x + this._skillWindow.x;
  1601.         this._skill_layout.y = Moghunter.bhud_skill_lay_y + this._skillWindow.y;
  1602.         this._skill_layout.visible = this._skillWindow.active;
  1603.         if (!this._skillWindow.visible) {this._skill_layout.visible = false};
  1604.     }; 
  1605.     if (this._item_layout) {
  1606.         this._item_layout.x = Moghunter.bhud_item_lay_x + this._itemWindow.x;
  1607.         this._item_layout.y = Moghunter.bhud_item_lay_y + this._itemWindow.y;
  1608.         this._item_layout.visible = this._itemWindow.active;
  1609.         if (!this._itemWindow.visible) {this._item_layout.visible = false};
  1610.     }; 
  1611.     if (this._actor_layout) {
  1612.         this._actor_layout.x = Moghunter.bhud_actor_lay_x + this._actorWindow.x;
  1613.         this._actor_layout.y = Moghunter.bhud_actor_lay_y + this._actorWindow.y;
  1614.         this._actor_layout.visible = this._actorWindow.active;
  1615.         if (!this._actorWindow.visible) {this._actor_layout.visible = false};
  1616.     }; 
  1617.     if (this._enemy_layout) {
  1618.         this._enemy_layout.x = Moghunter.bhud_enemy_lay_x + this._enemyWindow.x;
  1619.         this._enemy_layout.y = Moghunter.bhud_enemy_lay_y + this._enemyWindow.y;
  1620.         this._enemy_layout.visible = this._enemyWindow.active;
  1621.         if (!this._enemyWindow.visible) {this._enemy_layout.visible = false};
  1622.     };     
  1623. };
  1624.  
  1625. //=============================================================================
  1626. // * Scene_Base
  1627. //=============================================================================
  1628.  
  1629. //==============================
  1630. // * Sprite Move To
  1631. //==============================
  1632. Scene_Base.prototype.sprite_move_to = function(value,real_value,speed) {
  1633.     if (value == real_value) {return value};
  1634.     var dnspeed = 5 + (Math.abs(value - real_value) / speed);
  1635.     if (value > real_value) {value -= dnspeed;
  1636.         if (value < real_value) {value = real_value};}
  1637.     else if (value < real_value) {value  += dnspeed;
  1638.         if (value  > real_value) {value  = real_value};    
  1639.     };
  1640.     return Math.floor(value);
  1641. };
  1642.  
  1643. //=============================================================================
  1644. // * Battle_Hud
  1645. //=============================================================================
  1646. function Battle_Hud() {
  1647.     this.initialize.apply(this, arguments);
  1648. };
  1649.  
  1650. Battle_Hud.prototype = Object.create(Sprite.prototype);
  1651. Battle_Hud.prototype.constructor = Battle_Hud;
  1652.  
  1653. //==============================
  1654. // * Initialize
  1655. //==============================
  1656. Battle_Hud.prototype.initialize = function(hud_id) {
  1657.     Sprite.prototype.initialize.call(this);
  1658.     this._data_initial_ref = [0,true];
  1659.     this._hud_id = hud_id;
  1660.     this._hud_size = [0,0];
  1661.     this.base_parameter_clear();
  1662.     this.load_img();
  1663.     this.opacity = 0;
  1664.     $gameTemp._bhud_position_active = null;
  1665.     $gameTemp._battleEnd = false;
  1666. };
  1667.  
  1668. //==============================
  1669. // * Load Img
  1670. //==============================
  1671. Battle_Hud.prototype.load_img = function() {
  1672.     this._layout_img = ImageManager.loadBHud("Layout");
  1673.     if (String(Moghunter.bhud_layoverlay_visible) == "true") {this._layout2_img = ImageManager.loadBHud("Layout2");;};
  1674.     this._turn_img = ImageManager.loadBHud("Turn");
  1675.     this._state_img = ImageManager.loadSystem("IconSet");
  1676.     if (String(Moghunter.bhud_hp_meter_visible) == "true") {this._hp_meter_img = ImageManager.loadBHud("HP_Meter");};
  1677.     if (String(Moghunter.bhud_mp_meter_visible) == "true") {this._mp_meter_img = ImageManager.loadBHud("MP_Meter");};
  1678.     if (String(Moghunter.bhud_tp_meter_visible) == "true") {this._tp_meter_img = ImageManager.loadBHud("TP_Meter");};
  1679.     if (String(Moghunter.bhud_at_meter_visible) == "true") {this._at_meter_img = ImageManager.loadBHud("ATB_Meter");};
  1680.     if (String(Moghunter.bhud_hp_number_visible) == "true") {this._hp_number_img = ImageManager.loadBHud("HP_Number");};
  1681.     if (String(Moghunter.bhud_mp_number_visible) == "true") {this._mp_number_img = ImageManager.loadBHud("MP_Number");};
  1682.     if (String(Moghunter.bhud_tp_number_visible) == "true") {this._tp_number_img = ImageManager.loadBHud("TP_Number");};
  1683.     if (String(Moghunter.bhud_maxhp_number_visible) == "true") {this._maxhp_number_img = ImageManager.loadBHud("HP_Number2");};
  1684.     if (String(Moghunter.bhud_maxmp_number_visible) == "true") {this._maxmp_number_img = ImageManager.loadBHud("MP_Number2");};
  1685.     if (String(Moghunter.bhud_maxtp_number_visible) == "true") {this._maxtp_number_img = ImageManager.loadBHud("TP_Number2");};
  1686. };
  1687.  
  1688. //==============================
  1689. // * Base Parameter Clear
  1690. //==============================
  1691. Battle_Hud.prototype.base_parameter_clear = function() {
  1692.      this._hp_old = [-1,-1];
  1693.      this._maxhp_old = [-1,-1];
  1694.      this._hp_old_ani = [-1,-1];
  1695.      this._hp_flow = [false,0,0,0];
  1696.      this._mp_old = [-1,-1];
  1697.      this._maxmp_old = [-1,-1];
  1698.      this._mp_old_ani = [-1,-1];
  1699.      this._mp_flow = [false,0,0,0];
  1700.      this._tp_old = [-1,-1];
  1701.      this._maxtp_old = [-1,-1];
  1702.      this._tp_old_ani = -1;
  1703.      this._tp_flow = [false,0,0,0];
  1704.      this._at_flow = [false,0,0,0];
  1705.      this._hp_number_old = -1;
  1706.      this._mp_number_old = -1;
  1707.      this._hp_number_old = -1;
  1708.      this._number_align = [];
  1709.      this._number_align[0] = Moghunter.bhud_hp_align_type;
  1710.      this._number_align[1] = Moghunter.bhud_mp_align_type;
  1711.      this._number_align[2] = Moghunter.bhud_tp_align_type;
  1712.      this._diagonal_number = [];
  1713.      this._diagonal_number[0] = Moghunter.bhud_hp_diagonal_number;
  1714.      this._diagonal_number[1] = Moghunter.bhud_mp_diagonal_number;
  1715.      this._diagonal_number[2] = Moghunter.bhud_tp_diagonal_number;
  1716.      this._hp_img_data = [0,0,0];
  1717.      this._mp_img_data = [0,0,0];
  1718.      this._tp_img_data = [0,0,0];
  1719.      this._states_old = [];
  1720.      this._states_data = [0,0,0];
  1721.      this._active = false;
  1722.      this._hud_size = [0,0];
  1723. };
  1724.  
  1725. //==============================
  1726. // * Need Refresh Bhud
  1727. //==============================
  1728. Battle_Hud.prototype.need_refreh_bhud = function() {
  1729.     if (this._data_initial_ref[1]) {return true};
  1730.     if (this._battler != $gameParty.battleMembers()[this._hud_id]) {return true};
  1731.     return false;
  1732. };
  1733.  
  1734. //==============================
  1735. // * Refresh Bhud
  1736. //==============================
  1737. Battle_Hud.prototype.refresh_bhud = function() {
  1738.      this._data_initial_ref[1] = false;
  1739.      this._battler = $gameParty.battleMembers()[this._hud_id];
  1740.      this.opacity = 0;
  1741.      this._hud_size = [0,0];
  1742.      this.base_parameter_clear();
  1743.      this.create_base_sprites();
  1744. };
  1745.  
  1746. //==============================
  1747. // * Refresh Position
  1748. //==============================
  1749. Battle_Hud.prototype.refresh_position = function() {
  1750.      this.set_hud_position();        
  1751.      this.create_sprites();
  1752.      this._layout.x = this._pos_x;
  1753.      this._layout.y = this._pos_y;
  1754.      if (this._face) {
  1755.          this._face.x = this._pos_x + Moghunter.bhud_face_pos_x;
  1756.          this._face.y = this._pos_y + Moghunter.bhud_face_pos_y;
  1757.      };
  1758.      if (this._turn) {
  1759.         this._turn.x = this._pos_x + Moghunter.bhud_turn_pos_x;
  1760.         this._turn.y = this._pos_y + Moghunter.bhud_turn_pos_y;
  1761.      };
  1762.      if (this._layout2) {
  1763.          this._layout2.x = this._pos_x + Moghunter.bhud_layoverlay_x;
  1764.          this._layout2.y = this._pos_y + Moghunter.bhud_layoverlay_y;
  1765.      };
  1766.      this._battler._face_pos = [this._face.x,this._face.y];
  1767. };
  1768.  
  1769. //==============================
  1770. // * Set Hud Position
  1771. //==============================
  1772. Battle_Hud.prototype.set_hud_position = function() {
  1773.      this._hud_size = [this._layout.bitmap.width,this._layout.bitmap.height];
  1774.      this._members_max = $gameParty.battleMembers().length;
  1775.      var ps = [Number(Moghunter.bhud_space_x) * this._hud_id,
  1776.                 Number(Moghunter.bhud_space_y) * this._hud_id];
  1777.      if ($gameSystem._bhud_position[this._hud_id]) {
  1778.          this._pos_x = $gameSystem._bhud_position[this._hud_id][0];
  1779.          this._pos_y = $gameSystem._bhud_position[this._hud_id][1];
  1780.      }
  1781.      else {
  1782.         if (Number($gameSystem._bhud_pos_mode) === 0) {
  1783.             var spc = ((Graphics.boxWidth - 14) / this._members_max);
  1784.             var px = (spc / 2) + (spc * this._hud_id);
  1785.             this._pos_x = Moghunter.bhud_pos_x + px + ps[0];
  1786.             this._pos_y = Moghunter.bhud_pos_y + ps[1];
  1787.         }
  1788.         else {
  1789.             var py = (this._hud_size[1] + 5) * this._hud_id;
  1790.             this._pos_x = Moghunter.bhud_pos_x + ps[0];
  1791.             this._pos_y = Moghunter.bhud_pos_y + py + ps[1];
  1792.         };
  1793.      };
  1794.      $gameTemp._bhud_position[this._hud_id] = [this._pos_x,this._pos_y];    
  1795. };
  1796.  
  1797. //==============================
  1798. // * Update
  1799. //==============================
  1800. Battle_Hud.prototype.update = function() {
  1801.     Sprite.prototype.update.call(this);
  1802.     if (this._data_initial_ref[0] < 2) {this._data_initial_ref[0] += 1; return};
  1803.     if (this.need_refreh_bhud()) {this.refresh_bhud()};
  1804.     if (!this._battler) {return};
  1805.     if (!this._layout.bitmap.isReady()) {return};
  1806.     if (this._hud_size[0] === 0) {this.refresh_position();return};
  1807.     this.update_sprites();
  1808. };
  1809.  
  1810. //==============================
  1811. // * Create Base Sprites
  1812. //==============================
  1813. Battle_Hud.prototype.create_base_sprites = function() {
  1814.     this.create_turn();
  1815.     if (Number(Moghunter.bhud_face_priority) === 0) {
  1816.         this.create_face();
  1817.         this.create_layout();}
  1818.     else {
  1819.         this.create_layout();
  1820.         this.create_face();            
  1821.     };
  1822.     if (String(Moghunter.bhud_layoverlay_visible) == "true") {this.create_layoutOverlay()};
  1823. };
  1824.  
  1825. //==============================
  1826. // * Create Sprites
  1827. //==============================
  1828. Battle_Hud.prototype.create_sprites = function() {
  1829.     this.create_hp_meter();
  1830.     this.create_mp_meter();
  1831.     this.create_tp_meter();
  1832.     this.create_at_meter();  
  1833.     this.create_hp_number();   
  1834.     this.create_maxhp_number();
  1835.     this.create_mp_number();   
  1836.     this.create_maxmp_number();
  1837.     this.create_tp_number();
  1838.     this.create_maxtp_number();
  1839.     this.create_states();  
  1840.     this.create_name();
  1841. };
  1842.  
  1843. //==============================
  1844. // * Update Sprites
  1845. //==============================
  1846. Battle_Hud.prototype.update_sprites = function() { 
  1847.     this.update_active();
  1848.     this.update_visible();
  1849.     this.update_turn();
  1850.     this.update_face();
  1851.     this.update_hp();
  1852.     this.update_mp();
  1853.     this.update_tp();
  1854.     this.update_at();    
  1855.     this.update_states();
  1856. };
  1857.  
  1858. //==============================
  1859. // * Update Active
  1860. //==============================
  1861. Battle_Hud.prototype.update_active = function() {  
  1862.    this._active = false
  1863.    if (this._battler == BattleManager.actor()) {this._active = true;
  1864.    $gameTemp._bhud_position_active = $gameTemp._bhud_position[this._hud_id]};
  1865. };
  1866.  
  1867. //==============================
  1868. // * Update visible
  1869. //==============================
  1870. Battle_Hud.prototype.update_visible = function(sprite) {
  1871.     if (this.is_hud_visible()) {this.opacity += 10}  
  1872.     else {this.opacity -= 10};
  1873. };
  1874.  
  1875. //==============================
  1876. // * Is Hud Visible
  1877. //==============================
  1878. Battle_Hud.prototype.is_hud_visible = function(sprite) {
  1879.     if ($gameMessage.isBusy()) {return false};
  1880.     if ($gameTemp._battleEnd) {return false};
  1881.     return true
  1882. };
  1883.  
  1884. //==============================
  1885. // * Update Dif
  1886. //==============================
  1887. Battle_Hud.prototype.update_dif = function(value,real_value,speed) {
  1888.     if (value == real_value) {return value};
  1889.     var dnspeed = 1 + (Math.abs(value - real_value) / speed);
  1890.     if (value > real_value) {value -= dnspeed;
  1891.         if (value < real_value) {value = real_value};}
  1892.     else if (value < real_value) {value  += dnspeed;
  1893.         if (value  > real_value) {value  = real_value};    
  1894.     };
  1895.     return Math.floor(value);
  1896. };
  1897.  
  1898. //==============================
  1899. // * Refresh Meter
  1900. //==============================
  1901. Battle_Hud.prototype.refresh_meter = function(sprite,value,value_max,type) {
  1902.     var ch = sprite.bitmap.height / 2;
  1903.     var meter_rate = sprite.bitmap.width * value / value_max;
  1904.     sprite.setFrame(0,type * ch, meter_rate, ch);
  1905. };
  1906.  
  1907. //==============================
  1908. // * Refresh Flow
  1909. //==============================
  1910. Battle_Hud.prototype.refresh_meter_flow = function(sprite,value,value_max,type,flow) {
  1911.     var cw = sprite.bitmap.width / 3;
  1912.     var ch = sprite.bitmap.height / 2;
  1913.     var meter_rate = cw * value / value_max;
  1914.     sprite.setFrame(flow,type * ch, meter_rate, ch);
  1915. };
  1916.  
  1917. //==============================
  1918. // * Refresh Number
  1919. //==============================
  1920. Battle_Hud.prototype.refresh_number = function(sprites,value,img_data,x,y,type) {
  1921.     numbers = Math.abs(value).toString().split("");  
  1922.     for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  1923.        if (i > numbers.length) {return};
  1924.        var n = Number(numbers[i]);
  1925.        sprites[i].setFrame(n * img_data[2], 0, img_data[2], img_data[1]);
  1926.        sprites[i].visible = true;  
  1927.        if (this._number_align[type] === 0) {
  1928.             var nx = -(img_data[2] * i) + (img_data[2] * numbers.length);
  1929.        } else if (this._number_align[type] === 1) {
  1930.             var nx = -(img_data[2] * i) + ((img_data[2] / 2) * numbers.length);
  1931.        } else if (this._number_align[type] === 2) {
  1932.             var nx = -(img_data[2] * i);
  1933.        } else {
  1934.           var nx = -(img_data[2] * i);
  1935.           var ny = (img_data[3] * i);
  1936.           sprites[i].y = y - ny;           
  1937.        };
  1938.        sprites[i].x = x - nx;
  1939.     };
  1940. };
  1941.  
  1942. //==============================
  1943. // * Need Refresh Parameter
  1944. //==============================
  1945. Battle_Hud.prototype.need_refresh_parameter = function(parameter) {
  1946.   switch (parameter) {
  1947.     case 0:
  1948.          if (this._hp_old[0] != this._battler.hp) {return true};
  1949.          if (this._hp_old[1] != this._battler.mhp) {return true};
  1950.          break;
  1951.     case 1:
  1952.          if (this._mp_old[0] != this._battler.mp) {return true};
  1953.          if (this._mp_old[1] != this._battler.mmp) {return true};
  1954.          break;        
  1955.     case 2:
  1956.          if (this._tp_old != this._battler.tp) {return true};
  1957.          break;                
  1958.   };
  1959.   return false;
  1960. };
  1961.  
  1962. //==============================
  1963. // * Create Layout
  1964. //==============================
  1965. Battle_Hud.prototype.create_layout = function() {
  1966.     this.removeChild(this._layout);
  1967.     if (!this._battler) {return};
  1968.     this._layout = new Sprite(this._layout_img);
  1969.     this.addChild(this._layout);
  1970. };
  1971.  
  1972. //==============================
  1973. // * Create Layout Overlay
  1974. //==============================
  1975. Battle_Hud.prototype.create_layoutOverlay = function() {
  1976.     this.removeChild(this._layout2);
  1977.     if (!this._battler) {return};
  1978.     this._layout2 = new Sprite(this._layout2_img);
  1979.     this.addChild(this._layout2);
  1980. };
  1981.  
  1982. //==============================
  1983. // * Create Turn
  1984. //==============================
  1985. Battle_Hud.prototype.create_turn = function() {
  1986.     if (String(Moghunter.bhud_turn_visible) != "true") {return};
  1987.     this.removeChild(this._turn);  
  1988.     if (!this._battler) {return};
  1989.     this._turn = new Sprite(this._turn_img);
  1990.     this._turn_blink = [0,0]
  1991.     this.addChild(this._turn);
  1992. };
  1993.    
  1994. //==============================
  1995. // * Update Turn
  1996. //==============================
  1997. Battle_Hud.prototype.update_turn = function() {
  1998.     if (!this._turn) {return};
  1999.     if (!this._active) {this._turn.visible = false;return;};
  2000.     this._turn.visible = true;
  2001.     this._turn_blink[0] += 1
  2002.     if (this._turn_blink[0] < 60) {this._turn_blink[1] += 2}
  2003.     else if (this._turn_blink[0] < 120) {this._turn_blink[1] -= 2}
  2004.     else {this._turn_blink = [0,0]};
  2005.     this._turn.opacity = 135 + this._turn_blink[1]
  2006. }; 
  2007.    
  2008. //==============================
  2009. // * Create Face
  2010. //==============================
  2011. Battle_Hud.prototype.create_face = function() {
  2012.     if (String(Moghunter.bhud_face_visible) != "true") {return};
  2013.     this.removeChild(this._face);
  2014.     if (!this._battler) {return};  
  2015.     this._face = new Sprite(ImageManager.loadBHud("Face_" + this._battler._profile));
  2016. //  this._face = new Sprite(ImageManager.loadBHud("Face_" + this._battler._actorId));
  2017.     this._face.anchor.x = 0.5;
  2018.     this._face.anchor.y = 0.5;
  2019.     this._face_data = [0,0,false,false,false,-1];
  2020.     if (String(Moghunter.bhud_face_shake) === "true") {this._face_data[2] = true}
  2021.     if (String(Moghunter.bhud_face_animated) === "true") {this._face_data[4] = true}
  2022.     this._battler._bhud_face_data = [0,0,0,0]
  2023.     this.addChild(this._face);
  2024. };
  2025.  
  2026. //==============================
  2027. // * Update Face
  2028. //==============================
  2029. Battle_Hud.prototype.update_face = function() {
  2030.     if (!this._face) {return};
  2031.     if (!this._face.bitmap.isReady()) {return};
  2032.     if (this._face_data[4] && this._face_data[5] != this._battler._bhud_face_data[2]) {this.refresh_face();};
  2033.     this.update_face_animation();
  2034.     this.update_face_shake();
  2035.     this.update_face_zoom();
  2036. };
  2037.  
  2038. //==============================
  2039. // * Refresh Face
  2040. //==============================
  2041. Battle_Hud.prototype.refresh_face = function() {
  2042.     this._face_data[5] = this._battler._bhud_face_data[2];
  2043.     var cw = this._face.bitmap.width / 5;
  2044.     var ch = this._face.bitmap.height;
  2045.     this._face.setFrame(cw * this._face_data[5], 0, cw, ch);
  2046. };
  2047.  
  2048. //==============================
  2049. // * Update Face Animation
  2050. //==============================
  2051. Battle_Hud.prototype.update_face_animation = function() {
  2052.     if (this._battler._bhud_face_data[3] > 0) {this._battler._bhud_face_data[3] -= 1;
  2053.         if (this._battler._bhud_face_data[3] === 0) {
  2054.             if (this._battler.isDead()) {this._battler._bhud_face_data[2] = 4}
  2055.             else if (this._battler.hp <= 30 * this._battler.mhp / 100) {this._battler._bhud_face_data[2] = 3}
  2056.             else {this._battler._bhud_face_data[2] = 0};
  2057.             };
  2058.     };
  2059. };
  2060.  
  2061. //==============================
  2062. // * Update Face Zoom
  2063. //==============================
  2064. Battle_Hud.prototype.update_face_zoom = function() {
  2065.     if (this._battler._bhud_face_data[1] > 0) {this._battler._bhud_face_data[1] -= 1;
  2066.         if (this._battler._bhud_face_data[1] == 0) {this._face.scale.x = 1.00}
  2067.         else if (this._battler._bhud_face_data[1] < 20) {this._face.scale.x -= 0.01;
  2068.                  if (this._face.scale.x < 1.00) {this._face.scale.x = 1.00;};  
  2069.         }
  2070.         else if (this._battler._bhud_face_data[1] < 40){this._face.scale.x += 0.01;
  2071.                  if (this._face.scale.x > 1.25) {this._face.scale.x = 1.25;};
  2072.         };
  2073.         this._face.scale.y = this._face.scale.x;
  2074.     };
  2075. };
  2076.  
  2077. //==============================
  2078. // * Update Face Shake
  2079. //==============================
  2080. Battle_Hud.prototype.update_face_shake = function() {
  2081.     this._face.x = this._pos_x + Moghunter.bhud_face_pos_x;
  2082.     if (this._face_data[2] && this._battler._bhud_face_data[0] > 0) {this._battler._bhud_face_data[0] -= 1;
  2083.         this._face.x = this._pos_x + Moghunter.bhud_face_pos_x + ((Math.random() * 12) - 6);        this._face.x = this._pos_x + Moghunter.bhud_face_pos_x + ((Math.random() * 3) - 1); /* Old Values : ((Math.random() * 12) - 6) */
  2084.     };
  2085. };
  2086.  
  2087. //==============================
  2088. // * Create Name
  2089. //==============================
  2090. Battle_Hud.prototype.create_name = function() {
  2091.     if (String(Moghunter.bhud_name_visible) != "true") {return};
  2092.     this.removeChild(this._name);
  2093.     if (!this._battler) {return};  
  2094.     this._name = new Sprite(new Bitmap(300,48));
  2095.     this._name.x = this._pos_x + Moghunter.bhud_name_pos_x;
  2096.     this._name.y = this._pos_y + Moghunter.bhud_name_pos_y;
  2097.     this._name.bitmap.fontSize = Number(Moghunter.bhud_name_font_size);
  2098.     if (String(Moghunter.bhud_name_font_italic) === "true") {this._name.bitmap.fontItalic = true};
  2099.     this._name.bitmap.outlineWidth = Number(Moghunter.bhud_name_font_bold_size);
  2100.     this.addChild(this._name); 
  2101.     this.refresh_name();
  2102. };
  2103.  
  2104. //==============================
  2105. // * Refresh Name
  2106. //==============================
  2107. Battle_Hud.prototype.refresh_name = function() {
  2108.     this._name.bitmap.clear();
  2109.     this._name.bitmap.drawText(this._battler._name, 0, 0, this._name.bitmap.width, this._name.bitmap.height,0);
  2110. };
  2111.  
  2112. //==============================
  2113. // * Create HP Meter
  2114. //==============================
  2115. Battle_Hud.prototype.create_hp_meter = function() {
  2116.     if (String(Moghunter.bhud_hp_meter_visible) != "true") {return};
  2117.     this.removeChild(this._hp_meter_blue);
  2118.     this.removeChild(this._hp_meter_red);
  2119.     if (!this._battler) {return};
  2120.     this._hp_meter_red = new Sprite(this._hp_meter_img);
  2121.     this._hp_meter_red.x = this._pos_x + Moghunter.bhud_hp_meter_pos_x;
  2122.     this._hp_meter_red.y = this._pos_y + Moghunter.bhud_hp_meter_pos_y;
  2123.     this._hp_meter_red.rotation = Moghunter.bhud_hp_meter_rotation;
  2124.     this.addChild(this._hp_meter_red);     
  2125.     this._hp_meter_blue = new Sprite(this._hp_meter_img);
  2126.     this._hp_meter_blue.x = this._hp_meter_red.x;
  2127.     this._hp_meter_blue.y = this._hp_meter_red.y;
  2128.     this._hp_meter_blue.rotation = this._hp_meter_red.rotation;
  2129.     this.addChild(this._hp_meter_blue);
  2130.     if (String(Moghunter.bhud_hp_meter_flow) === "true") {this._hp_flow[0] = true;
  2131.         this._hp_flow[2] = this._hp_meter_img.width / 3;
  2132.         this._hp_flow[3] = this._hp_flow[2] * 2;
  2133.         this._hp_flow[1] = Math.floor(Math.random() * this._hp_flow[2]);
  2134.     };
  2135. };
  2136.  
  2137. //==============================
  2138. // * Create HP Number
  2139. //==============================
  2140. Battle_Hud.prototype.create_hp_number = function() {
  2141.     if (String(Moghunter.bhud_hp_number_visible) != "true") {return};
  2142.     if (this._hp_number) {for (var i = 0; i < this._hp_number.length; i++) {this.removeChild(this._hp_number[i]);}};
  2143.     if (!this._battler) {return};
  2144.     this._hp_number = [];
  2145.     this._hp_img_data = [this._hp_number_img.width,this._hp_number_img.height,
  2146.                           this._hp_number_img.width / 10, this._hp_number_img.height / 2,
  2147.                           this._pos_x + Moghunter.bhud_hp_number_pos_x,
  2148.                           this._pos_y + Moghunter.bhud_hp_number_pos_y,
  2149.                           ];
  2150.     for (var i = 0; i < 5; i++) {
  2151.        this._hp_number[i] = new Sprite(this._hp_number_img);
  2152.        this._hp_number[i].visible = false;
  2153.        this._hp_number[i].x = this._hp_img_data[4];
  2154.        this._hp_number[i].y = this._hp_img_data[5];
  2155.        this.addChild(this._hp_number[i]);
  2156.     }; 
  2157.     this._hp_number_old = this._battler.hp;
  2158.     this.refresh_number(this._hp_number,this._hp_number_old,this._hp_img_data,this._hp_img_data[4],this._hp_img_data[5],0);
  2159. };
  2160.  
  2161. //==============================
  2162. // * Create maxHP Number
  2163. //==============================
  2164. Battle_Hud.prototype.create_maxhp_number = function() {
  2165.     if (String(Moghunter.bhud_maxhp_number_visible) != "true") {return};
  2166.     if (this._maxhp_number) {for (var i = 0; i < this._maxhp_number.length; i++) {this.removeChild(this._maxhp_number[i]);}};
  2167.     if (!this._battler) {return};  
  2168.     this._maxhp_number = [];
  2169.     this._maxhp_img_data = [this._maxhp_number_img.width,this._maxhp_number_img.height,
  2170.                           this._maxhp_number_img.width / 10, this._maxhp_number_img.height / 2,
  2171.                           this._pos_x + Moghunter.bhud_maxhp_number_pos_x,
  2172.                           this._pos_y + Moghunter.bhud_maxhp_number_pos_y,
  2173.                           ];
  2174.     for (var i = 0; i < 5; i++) {
  2175.        this._maxhp_number[i] = new Sprite(this._maxhp_number_img);
  2176.        this._maxhp_number[i].visible = false;
  2177.        this._maxhp_number[i].x = this._maxhp_img_data[4];
  2178.        this._maxhp_number[i].y = this._maxhp_img_data[5];
  2179.        this.addChild(this._maxhp_number[i]);
  2180.     };     
  2181.     this._maxhp_number_old = this._battler.mhp;
  2182.     this.refresh_number(this._maxhp_number,this._maxhp_number_old,this._maxhp_img_data,this._maxhp_img_data[4],this._maxhp_img_data[5],0); 
  2183. };
  2184.  
  2185. //==============================
  2186. // * Update HP
  2187. //==============================
  2188. Battle_Hud.prototype.update_hp = function() {
  2189.     if (this._hp_meter_blue) {
  2190.         if(this._hp_flow[0]) {
  2191.            this.refresh_meter_flow(this._hp_meter_blue,this._battler.hp,this._battler.mhp,0,this._hp_flow[1]);
  2192.            var dif_meter = this.update_dif(this._hp_old_ani[0],this._battler.hp,160)
  2193.            if (this._hp_old_ani[0] != dif_meter) {this._hp_old_ani[0] = dif_meter;
  2194.            this.refresh_meter_flow(this._hp_meter_red,this._hp_old_ani[0],this._battler.mhp,1,this._hp_flow[1]);
  2195.            };
  2196.            this._hp_flow[1] += 1.5;
  2197.            if (this._hp_flow[1] > this._hp_flow[3]) {this._hp_flow[1] = 0};        
  2198.         }
  2199.         else {
  2200.            if (this.need_refresh_parameter(0)) {
  2201.                 this.refresh_meter(this._hp_meter_blue,this._battler.hp,this._battler.mhp,0);
  2202.                 this._hp_old = [this._battler.hp,this._battler.mhp];
  2203.             };
  2204.             var dif_meter = this.update_dif(this._hp_old_ani[0],this._battler.hp,160)
  2205.             if (this._hp_old_ani[0] != dif_meter) {this._hp_old_ani[0] = dif_meter;
  2206.             this.refresh_meter(this._hp_meter_red,this._hp_old_ani[0],this._battler.mhp,1);};      
  2207.         };
  2208.     };
  2209.     if (this._hp_number) {
  2210.         var dif_number = this.update_dif(this._hp_number_old,this._battler.hp,30)
  2211.         if (this._hp_number_old != dif_number) {this._hp_number_old = dif_number;
  2212.         this.refresh_number(this._hp_number,this._hp_number_old,this._hp_img_data,this._hp_img_data[4],this._hp_img_data[5],0);};
  2213.     };
  2214.     if (this._maxhp_number) {
  2215.         if (this._maxhp_number_old != this._battler.mhp) {this._maxhp_number_old = this._battler.mhp;
  2216.         this.refresh_number(this._maxhp_number,this._maxhp_number_old,this._maxhp_img_data,this._maxhp_img_data[4],this._maxhp_img_data[5],0);};
  2217.     };
  2218. };
  2219.  
  2220. //==============================
  2221. // * Create MP Meter
  2222. //==============================
  2223. Battle_Hud.prototype.create_mp_meter = function() {
  2224.     if (String(Moghunter.bhud_mp_meter_visible) != "true") {return};
  2225.     this.removeChild(this._mp_meter_blue);
  2226.     this.removeChild(this._mp_meter_red);
  2227.     if (!this._battler) {return};
  2228.     this._mp_meter_red = new Sprite(this._mp_meter_img);
  2229.     this._mp_meter_red.x = this._pos_x + Moghunter.bhud_mp_meter_pos_x;
  2230.     this._mp_meter_red.y = this._pos_y + Moghunter.bhud_mp_meter_pos_y;
  2231.     this._mp_meter_red.rotation = Moghunter.bhud_mp_meter_rotation;
  2232.     this.addChild(this._mp_meter_red);     
  2233.     this._mp_meter_blue = new Sprite(this._mp_meter_img);
  2234.     this._mp_meter_blue.x = this._mp_meter_red.x;
  2235.     this._mp_meter_blue.y = this._mp_meter_red.y;
  2236.     this._mp_meter_blue.rotation = this._mp_meter_red.rotation;
  2237.     this.addChild(this._mp_meter_blue);
  2238.     if (String(Moghunter.bhud_mp_meter_flow) === "true") {this._mp_flow[0] = true;
  2239.         this._mp_flow[2] = this._mp_meter_img.width / 3;
  2240.         this._mp_flow[3] = this._mp_flow[2] * 2;
  2241.         this._mp_flow[1] = Math.floor(Math.random() * this._mp_flow[2]);
  2242.     };
  2243. };
  2244.  
  2245. //==============================
  2246. // * Create MP Number
  2247. //==============================
  2248. Battle_Hud.prototype.create_mp_number = function() {
  2249.     if (String(Moghunter.bhud_mp_number_visible) != "true") {return};
  2250.     if (this._mp_number) {for (var i = 0; i < this._mp_number.length; i++) {this.removeChild(this._mp_number[i]);}};
  2251.     if (!this._battler) {return};
  2252.     this._mp_number = [];
  2253.     this._mp_img_data = [this._mp_number_img.width,this._mp_number_img.height,
  2254.                           this._mp_number_img.width / 10, this._mp_number_img.height / 2,
  2255.                           this._pos_x + Moghunter.bhud_mp_number_pos_x,
  2256.                           this._pos_y + Moghunter.bhud_mp_number_pos_y,
  2257.                           ];
  2258.     for (var i = 0; i < 5; i++) {
  2259.        this._mp_number[i] = new Sprite(this._mp_number_img);
  2260.        this._mp_number[i].visible = false;
  2261.        this._mp_number[i].x = this._mp_img_data[4];
  2262.        this._mp_number[i].y = this._mp_img_data[5] ;
  2263.        this.addChild(this._mp_number[i]);
  2264.     }; 
  2265.     this._mp_number_old = this._battler.mp;
  2266.     this.refresh_number(this._mp_number,this._mp_number_old,this._mp_img_data,this._mp_img_data[4],this._mp_img_data[5],1);
  2267. };
  2268.  
  2269. //==============================
  2270. // * Create MaxMP Number
  2271. //==============================
  2272. Battle_Hud.prototype.create_maxmp_number = function() {
  2273.     if (String(Moghunter.bhud_maxmp_number_visible) != "true") {return};
  2274.     if (this._maxmp_number) {for (var i = 0; i < this._maxmp_number.length; i++) {this.removeChild(this._maxmp_number[i]);}};
  2275.     if (!this._battler) {return};
  2276.     this._maxmp_number = [];
  2277.     this._maxmp_img_data = [this._maxmp_number_img.width,this._maxmp_number_img.height,
  2278.                           this._maxmp_number_img.width / 10, this._maxmp_number_img.height / 2,
  2279.                           this._pos_x + Moghunter.bhud_maxmp_number_pos_x,
  2280.                           this._pos_y + Moghunter.bhud_maxmp_number_pos_y,
  2281.                           ];
  2282.     for (var i = 0; i < 5; i++) {
  2283.        this._maxmp_number[i] = new Sprite(this._maxmp_number_img);
  2284.        this._maxmp_number[i].visible = false;
  2285.        this._maxmp_number[i].x = this._maxmp_img_data[4];
  2286.        this._maxmp_number[i].y = this._maxmp_img_data[5] ;
  2287.        this.addChild(this._maxmp_number[i]);
  2288.     }; 
  2289.     this._maxmp_number_old = this._battler.mmp;
  2290.     this.refresh_number(this._maxmp_number,this._maxmp_number_old,this._maxmp_img_data,this._maxmp_img_data[4],this._maxmp_img_data[5],1); 
  2291. };
  2292.  
  2293. //==============================
  2294. // * Update MP
  2295. //==============================
  2296. Battle_Hud.prototype.update_mp = function() {
  2297.     if (this._mp_meter_blue) {
  2298.         if(this._mp_flow[0]) {
  2299.            this.refresh_meter_flow(this._mp_meter_blue,this._battler.mp,this._battler.mmp,0,this._mp_flow[1]);
  2300.            var dif_meter = this.update_dif(this._mp_old_ani[0],this._battler.mp,160)
  2301.            if (this._mp_old_ani[0] != dif_meter) {this._mp_old_ani[0] = dif_meter;
  2302.            this.refresh_meter_flow(this._mp_meter_red,this._mp_old_ani[0],this._battler.mmp,1,this._mp_flow[1]);
  2303.            };
  2304.            this._mp_flow[1] += 1.5;
  2305.            if (this._mp_flow[1] > this._mp_flow[3]) {this._mp_flow[1] = 0};        
  2306.         }
  2307.         else {     
  2308.             if (this.need_refresh_parameter(1)) {
  2309.                 this.refresh_meter(this._mp_meter_blue,this._battler.mp,this._battler.mmp,0);
  2310.                 this._mp_old = [this._battler.mp,this._battler.mmp];
  2311.             };
  2312.             var dif_meter = this.update_dif(this._mp_old_ani[0],this._battler.mp,160)
  2313.             if (this._mp_old_ani[0] != dif_meter) {this._mp_old_ani[0] = dif_meter;
  2314.             this.refresh_meter(this._mp_meter_red,this._mp_old_ani[0],this._battler.mmp,1);};
  2315.         };
  2316.     };
  2317.     if (this._mp_number) {
  2318.         var dif_number = this.update_dif(this._mp_number_old,this._battler.mp,30)
  2319.         if (this._mp_number_old != dif_number) {this._mp_number_old = dif_number;
  2320.         this.refresh_number(this._mp_number,this._mp_number_old,this._mp_img_data,this._mp_img_data[4],this._mp_img_data[5],1);};
  2321.     };
  2322.     if (this._maxmp_number) {
  2323.         if (this._maxmp_number_old != this._battler.mmp) {this._maxmp_number_old = this._battler.mmp;
  2324.         this.refresh_number(this._maxmp_number,this._maxmp_number_old,this._maxmp_img_data,this._maxmp_img_data[4],this._maxmp_img_data[5],1);};
  2325.     }; 
  2326.    
  2327. };
  2328.  
  2329. //==============================
  2330. // * Create TP Meter
  2331. //==============================
  2332. Battle_Hud.prototype.create_tp_meter = function() {
  2333.     if (String(Moghunter.bhud_tp_meter_visible) != "true") {return};
  2334.     this.removeChild(this._tp_meter_blue);
  2335.     this.removeChild(this._tp_meter_red);
  2336.     if (!this._battler) {return};
  2337.     this._tp_meter_red = new Sprite(this._tp_meter_img);
  2338.     this._tp_meter_red.x = this._pos_x + Moghunter.bhud_tp_meter_pos_x;
  2339.     this._tp_meter_red.y = this._pos_y + Moghunter.bhud_tp_meter_pos_y;
  2340.     this._tp_meter_red.rotation = Moghunter.bhud_tp_meter_rotation;
  2341.     this.addChild(this._tp_meter_red);     
  2342.     this._tp_meter_blue = new Sprite(this._tp_meter_img);
  2343.     this._tp_meter_blue.x = this._tp_meter_red.x;
  2344.     this._tp_meter_blue.y = this._tp_meter_red.y;
  2345.     this._tp_meter_blue.rotation = this._tp_meter_red.rotation;
  2346.     this.addChild(this._tp_meter_blue);
  2347.     if (String(Moghunter.bhud_tp_meter_flow) === "true") {this._tp_flow[0] = true;
  2348.         this._tp_flow[2] = this._tp_meter_img.width / 3;
  2349.         this._tp_flow[3] = this._tp_flow[2] * 2;
  2350.         this._tp_flow[1] = Math.floor(Math.random() * this._tp_flow[2]);
  2351.     };
  2352. };
  2353.  
  2354. //==============================
  2355. // * Create TP Number
  2356. //==============================
  2357. Battle_Hud.prototype.create_tp_number = function() {
  2358.     if (String(Moghunter.bhud_tp_number_visible) != "true") {return};
  2359.     if (this._tp_number) {for (var i = 0; i < this._tp_number.length; i++) {this.removeChild(this._tp_number[i]);}};
  2360.     if (!this._battler) {return};
  2361.     this._tp_number = [];
  2362.     this._tp_img_data = [this._tp_number_img.width,this._tp_number_img.height,
  2363.                           this._tp_number_img.width / 10, this._tp_number_img.height / 2,
  2364.                           this._pos_x + Moghunter.bhud_tp_number_pos_x,
  2365.                           this._pos_y + Moghunter.bhud_tp_number_pos_y,
  2366.                           ];
  2367.     for (var i = 0; i < 5; i++) {
  2368.        this._tp_number[i] = new Sprite(this._tp_number_img);
  2369.        this._tp_number[i].visible = false;
  2370.        this._tp_number[i].x = this._tp_img_data[4];
  2371.        this._tp_number[i].y = this._tp_img_data[5] ;
  2372.        this.addChild(this._tp_number[i]);
  2373.     }; 
  2374.     this._tp_number_old = this._battler.tp;
  2375.     this.refresh_number(this._tp_number,this._tp_number_old,this._tp_img_data,this._tp_img_data[4],this._tp_img_data[5],2);
  2376. };
  2377.  
  2378. //==============================
  2379. // * Create MaxTP Number
  2380. //==============================
  2381. Battle_Hud.prototype.create_maxtp_number = function() {
  2382.     if (String(Moghunter.bhud_maxtp_number_visible) != "true") {return};
  2383.     if (this._maxtp_number) {for (var i = 0; i < this._maxtp_number.length; i++) {this.removeChild(this._maxtp_number[i]);}};
  2384.     if (!this._battler) {return};
  2385.     this._maxtp_number = [];
  2386.     this._maxtp_img_data = [this._maxtp_number_img.width,this._maxtp_number_img.height,
  2387.                           this._maxtp_number_img.width / 10, this._maxtp_number_img.height / 2,
  2388.                           this._pos_x + Moghunter.bhud_maxtp_number_pos_x,
  2389.                           this._pos_y + Moghunter.bhud_maxtp_number_pos_y,
  2390.                           ];
  2391.     for (var i = 0; i < 5; i++) {
  2392.        this._maxtp_number[i] = new Sprite(this._maxtp_number_img);
  2393.        this._maxtp_number[i].visible = false;
  2394.        this._maxtp_number[i].x = this._maxtp_img_data[4];
  2395.        this._maxtp_number[i].y = this._maxtp_img_data[5] ;
  2396.        this.addChild(this._maxtp_number[i]);
  2397.     }; 
  2398.     this._maxtp_number_old = 100;
  2399.     this.refresh_number(this._maxtp_number,this._maxtp_number_old,this._maxtp_img_data,this._maxtp_img_data[4],this._maxtp_img_data[5],2); 
  2400. };
  2401.  
  2402. //==============================
  2403. // * Update TP
  2404. //==============================
  2405. Battle_Hud.prototype.update_tp = function() {
  2406.     if (this._tp_meter_blue) {
  2407.         if(this._tp_flow[0]) {
  2408.            this.refresh_meter_flow(this._tp_meter_blue,this._battler.tp,100,0,this._tp_flow[1]);
  2409.            var dif_meter = this.update_dif(this._tp_old_ani[0],this._battler.tp,160)
  2410.            if (this._tp_old_ani[0] != dif_meter) {this._tp_old_ani[0] = dif_meter;
  2411.            this.refresh_meter_flow(this._tp_meter_red,this._tp_old_ani[0],100,1,this._tp_flow[1]);
  2412.            };
  2413.            this._tp_flow[1] += 1.5;
  2414.            if (this._tp_flow[1] > this._tp_flow[3]) {this._tp_flow[1] = 0};        
  2415.         }
  2416.         else { 
  2417.             if (this.need_refresh_parameter(2)) {
  2418.                 this.refresh_meter(this._tp_meter_blue,this._battler.tp,100,0);
  2419.                 this._tp_old = [this._battler.tp,100];
  2420.             };
  2421.             var dif_meter = this.update_dif(this._tp_old_ani[0],this._battler.tp,160)
  2422.             if (this._tp_old_ani[0] != dif_meter) {this._tp_old_ani[0] = dif_meter;
  2423.             this.refresh_meter(this._tp_meter_red,this._tp_old_ani[0],100,1);};
  2424.     };
  2425.     };
  2426.     if (this._tp_number) {
  2427.         var dif_number = this.update_dif(this._tp_number_old,this._battler.tp,30)
  2428.         if (this._tp_number_old != dif_number) {this._tp_number_old = dif_number;
  2429.         this.refresh_number(this._tp_number,this._tp_number_old,this._tp_img_data,this._tp_img_data[4],this._tp_img_data[5],2);};
  2430.     };
  2431. };
  2432.  
  2433. //==============================
  2434. // * Create AT Meter
  2435. //==============================
  2436. Battle_Hud.prototype.create_at_meter = function() {
  2437.     if (String(Moghunter.bhud_at_meter_visible) != "true") {return};
  2438.     this.removeChild(this._at_meter);
  2439.     if (!this._battler) {return};
  2440.     this._at_meter = new Sprite(this._at_meter_img);
  2441.     this._at_meter.x = this._pos_x + Moghunter.bhud_at_meter_pos_x;
  2442.     this._at_meter.y = this._pos_y + Moghunter.bhud_at_meter_pos_y;
  2443.     this._at_meter.rotation = Moghunter.bhud_at_meter_rotation;
  2444.     this.addChild(this._at_meter); 
  2445.     if (String(Moghunter.bhud_at_meter_flow) === "true") {this._at_flow[0] = true;
  2446.         this._at_flow[2] = this._at_meter_img.width / 3;
  2447.         this._at_flow[3] = this._at_flow[2] * 2;
  2448.         this._at_flow[1] = Math.floor(Math.random() * this._at_flow[2]);
  2449.     };
  2450.     this.check_compatibility_atb();
  2451. };
  2452.  
  2453. //==============================
  2454. // * Check Compatibility ATB
  2455. //==============================
  2456. Battle_Hud.prototype.check_compatibility_atb = function() {
  2457.     if (Imported.Ellye_ATB) {
  2458.         var parameters = $plugins.filter(function(p) {
  2459.             return p.description.contains('<Ellye ATB>');
  2460.         })[0].parameters;
  2461.     this._ellye_max_atb = Number(parameters['Full ATB Gauge'] || 50000);
  2462.     };
  2463. };
  2464.  
  2465. //==============================
  2466. // * Update AT
  2467. //==============================
  2468. Battle_Hud.prototype.update_at = function() {
  2469.     if (this._at_meter) {
  2470.         if (!this.at === -1) {this._at_meter.visible = false; return}
  2471.         else {this._at_meter.visible = true};
  2472.         if(this._at_flow[0]) {
  2473.             if (this.is_casting()){
  2474.                 if (this.is_max_cast()){
  2475.                    this.refresh_at_meter_flow(this._at_meter,this.cast_at(),this.cast_max_at(),3,this._at_flow[1]);}
  2476.                 else {
  2477.                    this.refresh_at_meter_flow(this._at_meter,this.cast_at(),this.cast_max_at(),2,this._at_flow[1]);
  2478.                 };
  2479.             }
  2480.             else if (this.is_max_at()){
  2481.                this.refresh_at_meter_flow(this._at_meter,this.at(),this.max_at(),1,this._at_flow[1]);}
  2482.             else {
  2483.                this.refresh_at_meter_flow(this._at_meter,this.at(),this.max_at(),0,this._at_flow[1]);};
  2484.                
  2485.            this._at_flow[1] += 1.5;
  2486.            if (this._at_flow[1] > this._at_flow[3]) {this._at_flow[1] = 0};        
  2487.         }
  2488.         else { 
  2489.             if (this.is_casting()){
  2490.                 if (this.is_max_cast()){
  2491.                    this.refresh_at_meter(this._at_meter,this.cast_at(),this.cast_max_at(),3);}
  2492.                 else {
  2493.                    this.refresh_at_meter(this._at_meter,this.cast_at(),this.cast_max_at(),2);
  2494.                 };
  2495.             }
  2496.             else if (this.is_max_at()){
  2497.                this.refresh_at_meter(this._at_meter,this.at(),this.max_at(),1);}
  2498.             else {
  2499.                this.refresh_at_meter(this._at_meter,this.at(),this.max_at(),0);};
  2500.         };
  2501.     };
  2502. };
  2503.  
  2504. //==============================
  2505. // * Refresh AT Meter
  2506. //==============================
  2507. Battle_Hud.prototype.refresh_at_meter = function(sprite,value,value_max,type) {
  2508.     var ch = sprite.bitmap.height / 4;
  2509.     var meter_rate = sprite.bitmap.width * value / value_max;
  2510.     sprite.setFrame(0,type * ch, meter_rate, ch);
  2511. };
  2512.  
  2513. //==============================
  2514. // * Refresh AT Meter Flow
  2515. //==============================
  2516. Battle_Hud.prototype.refresh_at_meter_flow = function(sprite,value,value_max,type,flow) {
  2517.     var cw = sprite.bitmap.width / 3;
  2518.     var ch = sprite.bitmap.height / 4;
  2519.     var meter_rate = cw * value / value_max;
  2520.     sprite.setFrame(flow,type * ch, meter_rate, ch);
  2521. };
  2522.  
  2523. //==============================
  2524. // * At
  2525. //==============================
  2526. Battle_Hud.prototype.at = function() {
  2527.  if (Imported.MOG_ATB) {return this._battler._atb};
  2528.  if (Imported.Ellye_ATB) {return this._battler.atb};
  2529.  if (Imported.YEP_X_BattleSysATB) {return Math.abs(this._battler._atbSpeed)};
  2530.   return -1;   
  2531. }
  2532.  
  2533. //==============================
  2534. // * Max At
  2535. //==============================
  2536. Battle_Hud.prototype.max_at = function() {
  2537.   if (Imported.MOG_ATB) {return this._battler._max_atb};
  2538.   if (Imported.Ellye_ATB) {return this._ellye_max_atb};
  2539.   if (Imported.YEP_X_BattleSysATB) {return Math.abs(BattleManager._atbTarget)};
  2540.   return 1;
  2541. };
  2542.  
  2543. //==============================
  2544. // * Cast AT
  2545. //==============================
  2546. Battle_Hud.prototype.cast_at = function() {
  2547.   if (Imported.MOG_ATB) {return this._battler._cast_atb[1]};
  2548.   if (Imported.Ellye_ATB) {return this._battler.current_cast_atb};
  2549.   if (Imported.YEP_X_BattleSysATB) {return Math.abs(this._battler._atbCharge)};
  2550.   return 0;
  2551. };
  2552.  
  2553. //==============================
  2554. // * Cast Max AT
  2555. //==============================
  2556. Battle_Hud.prototype.cast_max_at = function() {
  2557.   if (Imported.MOG_ATB) {return this._battler._cast_atb[2]};
  2558.   if (Imported.Ellye_ATB) {return this._battler.target_cast_atb};
  2559.   if (Imported.YEP_X_BattleSysATB) {return Math.abs(BattleManager._atbCharge)};
  2560.   return 1;
  2561. };
  2562.  
  2563. //==============================
  2564. // * Is Casting
  2565. //==============================
  2566. Battle_Hud.prototype.is_casting = function() {
  2567.   if (Imported.MOG_ATB) {if (this._battler._cast_atb[0]) {return true;}};
  2568.   if (Imported.Ellye_ATB) {if (this._battler.casting_action) {return true;}};
  2569.   if (Imported.YEP_X_BattleSysATB) {if (this._battler._atbCharging) {return true;}} ;
  2570.   return false;
  2571. };
  2572.  
  2573. //==============================
  2574. // * Is Max Atb
  2575. //==============================
  2576. Battle_Hud.prototype.is_max_at = function() {
  2577.     return this.at() >= this.max_at();
  2578. };
  2579.  
  2580. //==============================
  2581. // * Is Max Cast
  2582. //==============================
  2583. Battle_Hud.prototype.is_max_cast = function() {
  2584.     return this.cast_at() >= this.cast_max_at();
  2585. };
  2586.  
  2587. //==============================
  2588. // * Create States
  2589. //==============================
  2590. Battle_Hud.prototype.create_states = function() {
  2591.     if (String(Moghunter.bhud_states_visible) != "true") {return};
  2592.     this.removeChild(this._state_icon);
  2593.     if (!this._battler) {return};
  2594.     this._states_data = [0,0,0];
  2595.     this._state_icon = new Sprite(this._state_img);
  2596.     this._state_icon.x = this._pos_x + Moghunter.bhud_states_pos_x;
  2597.     this._state_icon.y = this._pos_y + Moghunter.bhud_states_pos_y;
  2598.     this._state_icon.visible = false;
  2599.     this.addChild(this._state_icon);
  2600.     this.refresh_states(); 
  2601. };
  2602.  
  2603. //==============================
  2604. // * Create States
  2605. //==============================
  2606. Battle_Hud.prototype.refresh_states = function() {
  2607.     this._states_data[0] = 0;
  2608.     this._states_data[2] = 0;
  2609.     this._state_icon.visible = false;
  2610.     if (this._battler.allIcons().length == 0) {this._states_data[1] = 0;return};
  2611.        if (this._battler.allIcons()[this._states_data[1]]) {   
  2612.         this._states_data[0] = this._battler.allIcons()[this._states_data[1]];
  2613.         this._state_icon.visible = true;
  2614.         var sx = this._states_data[0] % 16 * 32;
  2615.         var sy = Math.floor(this._states_data[0] / 16) * 32;
  2616.         this._state_icon.setFrame(sx, sy, 32, 32);
  2617.         this._battler.need_refresh_bhud_states = false;
  2618.    
  2619.        };
  2620.     this._states_data[1] += 1;
  2621.     if (this._states_data[1] >= this._battler.allIcons().length) {
  2622.         this._states_data[1] = 0
  2623.     };
  2624. };
  2625.  
  2626. //==============================
  2627. // * Update States
  2628. //==============================
  2629. Battle_Hud.prototype.update_states = function() {
  2630.     this._states_data[2] += 1;
  2631.     if (this.need_refresh_states()) {this.refresh_states();};
  2632. };
  2633.  
  2634. //==============================
  2635. // * Need Refresh States
  2636. //==============================
  2637. Battle_Hud.prototype.need_refresh_states = function() {
  2638.     if (this._battler.need_refresh_bhud_states) {return true};
  2639.     if (this._states_data[2] > 60) {return true};
  2640.     return false;
  2641. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement