Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
356
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. // * Refresh Face Position
  1771. //==============================
  1772. Battle_Hud.prototype.refreshface_position = function() {      
  1773.      if (this._face) {
  1774.          this._face.x = this._pos_x + Moghunter.bhud_face_pos_x;
  1775.          this._face.y = this._pos_y + Moghunter.bhud_face_pos_y;
  1776.      };
  1777.      this._battler._face_pos = [this._face.x,this._face.y];
  1778. };
  1779.  
  1780. //==============================
  1781. // * Set Hud Position
  1782. //==============================
  1783. Battle_Hud.prototype.set_hud_position = function() {
  1784.      this._hud_size = [this._layout.bitmap.width,this._layout.bitmap.height];
  1785.      this._members_max = $gameParty.battleMembers().length;
  1786.      var ps = [Number(Moghunter.bhud_space_x) * this._hud_id,
  1787.                 Number(Moghunter.bhud_space_y) * this._hud_id];
  1788.      if ($gameSystem._bhud_position[this._hud_id]) {
  1789.          this._pos_x = $gameSystem._bhud_position[this._hud_id][0];
  1790.          this._pos_y = $gameSystem._bhud_position[this._hud_id][1];
  1791.      }
  1792.      else {
  1793.         if (Number($gameSystem._bhud_pos_mode) === 0) {
  1794.             var spc = ((Graphics.boxWidth - 14) / this._members_max);
  1795.             var px = (spc / 2) + (spc * this._hud_id);
  1796.             this._pos_x = Moghunter.bhud_pos_x + px + ps[0];
  1797.             this._pos_y = Moghunter.bhud_pos_y + ps[1];
  1798.         }
  1799.         else {
  1800.             var py = (this._hud_size[1] + 5) * this._hud_id;
  1801.             this._pos_x = Moghunter.bhud_pos_x + ps[0];
  1802.             this._pos_y = Moghunter.bhud_pos_y + py + ps[1];
  1803.         };
  1804.      };
  1805.      $gameTemp._bhud_position[this._hud_id] = [this._pos_x,this._pos_y];    
  1806. };
  1807.  
  1808. //==============================
  1809. // * Update
  1810. //==============================
  1811. Battle_Hud.prototype.update = function() {
  1812.     Sprite.prototype.update.call(this);
  1813.     if (this._data_initial_ref[0] < 2) {this._data_initial_ref[0] += 1; return};
  1814.     if (this.need_refreh_bhud()) {this.refresh_bhud()};
  1815.     if (!this._battler) {return};
  1816.     if (!this._layout.bitmap.isReady()) {return};
  1817.     if (this._hud_size[0] === 0) {this.refresh_position();return};
  1818.     this.update_sprites();
  1819. };
  1820.  
  1821. //==============================
  1822. // * Create Base Sprites
  1823. //==============================
  1824. Battle_Hud.prototype.create_base_sprites = function() {
  1825.     this.create_turn();
  1826.     if (Number(Moghunter.bhud_face_priority) === 0) {
  1827.         this.create_face();
  1828.         this.create_layout();}
  1829.     else {
  1830.         this.create_layout();
  1831.         this.create_face();            
  1832.     };
  1833.     if (String(Moghunter.bhud_layoverlay_visible) == "true") {this.create_layoutOverlay()};
  1834. };
  1835.  
  1836. //==============================
  1837. // * Create Sprites
  1838. //==============================
  1839. Battle_Hud.prototype.create_sprites = function() {
  1840.     this.create_hp_meter();
  1841.     this.create_mp_meter();
  1842.     this.create_tp_meter();
  1843.     this.create_at_meter();  
  1844.     this.create_hp_number();   
  1845.     this.create_maxhp_number();
  1846.     this.create_mp_number();   
  1847.     this.create_maxmp_number();
  1848.     this.create_tp_number();
  1849.     this.create_maxtp_number();
  1850.     this.create_states();  
  1851.     this.create_name();
  1852. };
  1853.  
  1854. //==============================
  1855. // * Update Sprites
  1856. //==============================
  1857. Battle_Hud.prototype.update_sprites = function() { 
  1858.     this.update_active();
  1859.     this.update_visible();
  1860.     this.update_turn();
  1861.     this.update_face();
  1862.     this.update_hp();
  1863.     this.update_mp();
  1864.     this.update_tp();
  1865.     this.update_at();    
  1866.     this.update_states();
  1867. };
  1868.  
  1869. //==============================
  1870. // * Update Active
  1871. //==============================
  1872. Battle_Hud.prototype.update_active = function() {  
  1873.    this._active = false
  1874.    if (this._battler == BattleManager.actor()) {this._active = true;
  1875.    $gameTemp._bhud_position_active = $gameTemp._bhud_position[this._hud_id]};
  1876. };
  1877.  
  1878. //==============================
  1879. // * Update visible
  1880. //==============================
  1881. Battle_Hud.prototype.update_visible = function(sprite) {
  1882.     if (this.is_hud_visible()) {this.opacity += 10}  
  1883.     else {this.opacity -= 10};
  1884. };
  1885.  
  1886. //==============================
  1887. // * Is Hud Visible
  1888. //==============================
  1889. Battle_Hud.prototype.is_hud_visible = function(sprite) {
  1890.     if ($gameMessage.isBusy()) {return false};
  1891.     if ($gameTemp._battleEnd) {return false};
  1892.     return true
  1893. };
  1894.  
  1895. //==============================
  1896. // * Update Dif
  1897. //==============================
  1898. Battle_Hud.prototype.update_dif = function(value,real_value,speed) {
  1899.     if (value == real_value) {return value};
  1900.     var dnspeed = 1 + (Math.abs(value - real_value) / speed);
  1901.     if (value > real_value) {value -= dnspeed;
  1902.         if (value < real_value) {value = real_value};}
  1903.     else if (value < real_value) {value  += dnspeed;
  1904.         if (value  > real_value) {value  = real_value};    
  1905.     };
  1906.     return Math.floor(value);
  1907. };
  1908.  
  1909. //==============================
  1910. // * Refresh Meter
  1911. //==============================
  1912. Battle_Hud.prototype.refresh_meter = function(sprite,value,value_max,type) {
  1913.     var ch = sprite.bitmap.height / 2;
  1914.     var meter_rate = sprite.bitmap.width * value / value_max;
  1915.     sprite.setFrame(0,type * ch, meter_rate, ch);
  1916. };
  1917.  
  1918. //==============================
  1919. // * Refresh Flow
  1920. //==============================
  1921. Battle_Hud.prototype.refresh_meter_flow = function(sprite,value,value_max,type,flow) {
  1922.     var cw = sprite.bitmap.width / 3;
  1923.     var ch = sprite.bitmap.height / 2;
  1924.     var meter_rate = cw * value / value_max;
  1925.     sprite.setFrame(flow,type * ch, meter_rate, ch);
  1926. };
  1927.  
  1928. //==============================
  1929. // * Refresh Number
  1930. //==============================
  1931. Battle_Hud.prototype.refresh_number = function(sprites,value,img_data,x,y,type) {
  1932.     numbers = Math.abs(value).toString().split("");  
  1933.     for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  1934.        if (i > numbers.length) {return};
  1935.        var n = Number(numbers[i]);
  1936.        sprites[i].setFrame(n * img_data[2], 0, img_data[2], img_data[1]);
  1937.        sprites[i].visible = true;  
  1938.        if (this._number_align[type] === 0) {
  1939.             var nx = -(img_data[2] * i) + (img_data[2] * numbers.length);
  1940.        } else if (this._number_align[type] === 1) {
  1941.             var nx = -(img_data[2] * i) + ((img_data[2] / 2) * numbers.length);
  1942.        } else if (this._number_align[type] === 2) {
  1943.             var nx = -(img_data[2] * i);
  1944.        } else {
  1945.           var nx = -(img_data[2] * i);
  1946.           var ny = (img_data[3] * i);
  1947.           sprites[i].y = y - ny;           
  1948.        };
  1949.        sprites[i].x = x - nx;
  1950.     };
  1951. };
  1952.  
  1953. //==============================
  1954. // * Need Refresh Parameter
  1955. //==============================
  1956. Battle_Hud.prototype.need_refresh_parameter = function(parameter) {
  1957.   switch (parameter) {
  1958.     case 0:
  1959.          if (this._hp_old[0] != this._battler.hp) {return true};
  1960.          if (this._hp_old[1] != this._battler.mhp) {return true};
  1961.          break;
  1962.     case 1:
  1963.          if (this._mp_old[0] != this._battler.mp) {return true};
  1964.          if (this._mp_old[1] != this._battler.mmp) {return true};
  1965.          break;        
  1966.     case 2:
  1967.          if (this._tp_old != this._battler.tp) {return true};
  1968.          break;                
  1969.   };
  1970.   return false;
  1971. };
  1972.  
  1973. //==============================
  1974. // * Create Layout
  1975. //==============================
  1976. Battle_Hud.prototype.create_layout = function() {
  1977.     this.removeChild(this._layout);
  1978.     if (!this._battler) {return};
  1979.     this._layout = new Sprite(this._layout_img);
  1980.     this.addChild(this._layout);
  1981. };
  1982.  
  1983. //==============================
  1984. // * Create Layout Overlay
  1985. //==============================
  1986. Battle_Hud.prototype.create_layoutOverlay = function() {
  1987.     this.removeChild(this._layout2);
  1988.     if (!this._battler) {return};
  1989.     this._layout2 = new Sprite(this._layout2_img);
  1990.     this.addChild(this._layout2);
  1991. };
  1992.  
  1993. //==============================
  1994. // * Create Turn
  1995. //==============================
  1996. Battle_Hud.prototype.create_turn = function() {
  1997.     if (String(Moghunter.bhud_turn_visible) != "true") {return};
  1998.     this.removeChild(this._turn);  
  1999.     if (!this._battler) {return};
  2000.     this._turn = new Sprite(this._turn_img);
  2001.     this._turn_blink = [0,0]
  2002.     this.addChild(this._turn);
  2003. };
  2004.    
  2005. //==============================
  2006. // * Update Turn
  2007. //==============================
  2008. Battle_Hud.prototype.update_turn = function() {
  2009.     if (!this._turn) {return};
  2010.     if (!this._active) {this._turn.visible = false;return;};
  2011.     this._turn.visible = true;
  2012.     this._turn_blink[0] += 1
  2013.     if (this._turn_blink[0] < 60) {this._turn_blink[1] += 2}
  2014.     else if (this._turn_blink[0] < 120) {this._turn_blink[1] -= 2}
  2015.     else {this._turn_blink = [0,0]};
  2016.     this._turn.opacity = 255 + this._turn_blink[1] // Base is 135, blink is currently desactivated
  2017. }; 
  2018.    
  2019. //==============================
  2020. // * Create Face
  2021. //==============================
  2022. Battle_Hud.prototype.create_face = function() {
  2023.     if (String(Moghunter.bhud_face_visible) != "true") {return};
  2024.     this.removeChild(this._face);
  2025.     if (!this._battler) {return};  
  2026.     this._face = new Sprite(ImageManager.loadBHud("Face_" + this._battler._profile));
  2027. //  this._face = new Sprite(ImageManager.loadBHud("Face_" + this._battler._actorId));
  2028.     this._battler._temp_profile=this._battler._profile;
  2029.     this._face.anchor.x = 0.5;
  2030.     this._face.anchor.y = 0.5;
  2031.     this._face_data = [0,0,false,false,false,-1];
  2032.     if (String(Moghunter.bhud_face_shake) === "true") {this._face_data[2] = true}
  2033.     if (String(Moghunter.bhud_face_animated) === "true") {this._face_data[4] = true}
  2034.     this._battler._bhud_face_data = [0,0,0,0]
  2035.     this.addChild(this._face);
  2036. };
  2037.  
  2038. //==============================
  2039. // * Update Face
  2040. //==============================
  2041. Battle_Hud.prototype.update_face = function() {
  2042.     if (this._battler._temp_profile!==this._battler._profile) {
  2043.         this.create_face();
  2044.         this.refreshface_position(); //Created to just refresh the face
  2045.     };
  2046.         if (!this._face) {return};
  2047.     if (!this._face.bitmap.isReady()) {return};
  2048.     if (this._face_data[4] && this._face_data[5] != this._battler._bhud_face_data[2]) {this.refresh_face();};
  2049.     this.update_face_animation();
  2050.     this.update_face_shake();
  2051.     this.update_face_zoom();
  2052. };
  2053.  
  2054. Battle_Hud.prototype.refresh_face = function() {
  2055.     this._face_data[5] = this._battler._bhud_face_data[2];
  2056.     var cw = this._face.bitmap.width; // 5;
  2057.     var ch = this._face.bitmap.height;
  2058.     this._face.setFrame(cw * this._face_data[5], 0, cw, ch);
  2059. };
  2060.  
  2061.  
  2062. //==============================
  2063. // * Update Face Animation
  2064. //==============================
  2065. Battle_Hud.prototype.update_face_animation = function() {
  2066.     if (this._battler._bhud_face_data[3] > 0) {this._battler._bhud_face_data[3] -= 1;
  2067.         if (this._battler._bhud_face_data[3] === 0) {
  2068.             if (this._battler.isDead()) {this._battler._bhud_face_data[2] = 4}
  2069.             else if (this._battler.hp <= 30 * this._battler.mhp / 100) {this._battler._bhud_face_data[2] = 3}
  2070.             else {this._battler._bhud_face_data[2] = 0};
  2071.             };
  2072.     };
  2073. };
  2074.  
  2075. //==============================
  2076. // * Update Face Zoom
  2077. //==============================
  2078. Battle_Hud.prototype.update_face_zoom = function() {
  2079.     if (this._battler._bhud_face_data[1] > 0) {this._battler._bhud_face_data[1] -= 1;
  2080.         if (this._battler._bhud_face_data[1] == 0) {this._face.scale.x = 1.00}
  2081.         else if (this._battler._bhud_face_data[1] < 20) {this._face.scale.x -= 0.01;
  2082.                  if (this._face.scale.x < 1.00) {this._face.scale.x = 1.00;};  
  2083.         }
  2084.         else if (this._battler._bhud_face_data[1] < 40){this._face.scale.x += 0.01;
  2085.                  if (this._face.scale.x > 1.25) {this._face.scale.x = 1.25;};
  2086.         };
  2087.         this._face.scale.y = this._face.scale.x;
  2088.     };
  2089. };
  2090.  
  2091. //==============================
  2092. // * Update Face Shake
  2093. //==============================
  2094. Battle_Hud.prototype.update_face_shake = function() {
  2095.     this._face.x = this._pos_x + Moghunter.bhud_face_pos_x;
  2096.     if (this._face_data[2] && this._battler._bhud_face_data[0] > 0) {this._battler._bhud_face_data[0] -= 1;
  2097.         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) */
  2098.     };
  2099. };
  2100.  
  2101. //==============================
  2102. // * Create Name
  2103. //==============================
  2104. Battle_Hud.prototype.create_name = function() {
  2105.     if (String(Moghunter.bhud_name_visible) != "true") {return};
  2106.     this.removeChild(this._name);
  2107.     if (!this._battler) {return};  
  2108.     this._name = new Sprite(new Bitmap(300,48));
  2109.     this._name.x = this._pos_x + Moghunter.bhud_name_pos_x;
  2110.     this._name.y = this._pos_y + Moghunter.bhud_name_pos_y;
  2111.     this._name.bitmap.fontSize = Number(Moghunter.bhud_name_font_size);
  2112.     if (String(Moghunter.bhud_name_font_italic) === "true") {this._name.bitmap.fontItalic = true};
  2113.     this._name.bitmap.outlineWidth = Number(Moghunter.bhud_name_font_bold_size);
  2114.     this.addChild(this._name); 
  2115.     this.refresh_name();
  2116. };
  2117.  
  2118. //==============================
  2119. // * Refresh Name
  2120. //==============================
  2121. Battle_Hud.prototype.refresh_name = function() {
  2122.     this._name.bitmap.clear();
  2123.     this._name.bitmap.drawText(this._battler._name, 0, 0, this._name.bitmap.width, this._name.bitmap.height,0);
  2124. };
  2125.  
  2126. //==============================
  2127. // * Create HP Meter
  2128. //==============================
  2129. Battle_Hud.prototype.create_hp_meter = function() {
  2130.     if (String(Moghunter.bhud_hp_meter_visible) != "true") {return};
  2131.     this.removeChild(this._hp_meter_blue);
  2132.     this.removeChild(this._hp_meter_red);
  2133.     if (!this._battler) {return};
  2134.     this._hp_meter_red = new Sprite(this._hp_meter_img);
  2135.     this._hp_meter_red.x = this._pos_x + Moghunter.bhud_hp_meter_pos_x;
  2136.     this._hp_meter_red.y = this._pos_y + Moghunter.bhud_hp_meter_pos_y;
  2137.     this._hp_meter_red.rotation = Moghunter.bhud_hp_meter_rotation;
  2138.     this.addChild(this._hp_meter_red);     
  2139.     this._hp_meter_blue = new Sprite(this._hp_meter_img);
  2140.     this._hp_meter_blue.x = this._hp_meter_red.x;
  2141.     this._hp_meter_blue.y = this._hp_meter_red.y;
  2142.     this._hp_meter_blue.rotation = this._hp_meter_red.rotation;
  2143.     this.addChild(this._hp_meter_blue);
  2144.     if (String(Moghunter.bhud_hp_meter_flow) === "true") {this._hp_flow[0] = true;
  2145.         this._hp_flow[2] = this._hp_meter_img.width / 3;
  2146.         this._hp_flow[3] = this._hp_flow[2] * 2;
  2147.         this._hp_flow[1] = Math.floor(Math.random() * this._hp_flow[2]);
  2148.     };
  2149. };
  2150.  
  2151. //==============================
  2152. // * Create HP Number
  2153. //==============================
  2154. Battle_Hud.prototype.create_hp_number = function() {
  2155.     if (String(Moghunter.bhud_hp_number_visible) != "true") {return};
  2156.     if (this._hp_number) {for (var i = 0; i < this._hp_number.length; i++) {this.removeChild(this._hp_number[i]);}};
  2157.     if (!this._battler) {return};
  2158.     this._hp_number = [];
  2159.     this._hp_img_data = [this._hp_number_img.width,this._hp_number_img.height,
  2160.                           this._hp_number_img.width / 10, this._hp_number_img.height / 2,
  2161.                           this._pos_x + Moghunter.bhud_hp_number_pos_x,
  2162.                           this._pos_y + Moghunter.bhud_hp_number_pos_y,
  2163.                           ];
  2164.     for (var i = 0; i < 5; i++) {
  2165.        this._hp_number[i] = new Sprite(this._hp_number_img);
  2166.        this._hp_number[i].visible = false;
  2167.        this._hp_number[i].x = this._hp_img_data[4];
  2168.        this._hp_number[i].y = this._hp_img_data[5];
  2169.        this.addChild(this._hp_number[i]);
  2170.     }; 
  2171.     this._hp_number_old = this._battler.hp;
  2172.     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);
  2173. };
  2174.  
  2175. //==============================
  2176. // * Create maxHP Number
  2177. //==============================
  2178. Battle_Hud.prototype.create_maxhp_number = function() {
  2179.     if (String(Moghunter.bhud_maxhp_number_visible) != "true") {return};
  2180.     if (this._maxhp_number) {for (var i = 0; i < this._maxhp_number.length; i++) {this.removeChild(this._maxhp_number[i]);}};
  2181.     if (!this._battler) {return};  
  2182.     this._maxhp_number = [];
  2183.     this._maxhp_img_data = [this._maxhp_number_img.width,this._maxhp_number_img.height,
  2184.                           this._maxhp_number_img.width / 10, this._maxhp_number_img.height / 2,
  2185.                           this._pos_x + Moghunter.bhud_maxhp_number_pos_x,
  2186.                           this._pos_y + Moghunter.bhud_maxhp_number_pos_y,
  2187.                           ];
  2188.     for (var i = 0; i < 5; i++) {
  2189.        this._maxhp_number[i] = new Sprite(this._maxhp_number_img);
  2190.        this._maxhp_number[i].visible = false;
  2191.        this._maxhp_number[i].x = this._maxhp_img_data[4];
  2192.        this._maxhp_number[i].y = this._maxhp_img_data[5];
  2193.        this.addChild(this._maxhp_number[i]);
  2194.     };     
  2195.     this._maxhp_number_old = this._battler.mhp;
  2196.     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); 
  2197. };
  2198.  
  2199. //==============================
  2200. // * Update HP
  2201. //==============================
  2202. Battle_Hud.prototype.update_hp = function() {
  2203.     if (this._hp_meter_blue) {
  2204.         if(this._hp_flow[0]) {
  2205.            this.refresh_meter_flow(this._hp_meter_blue,this._battler.hp,this._battler.mhp,0,this._hp_flow[1]);
  2206.            var dif_meter = this.update_dif(this._hp_old_ani[0],this._battler.hp,160)
  2207.            if (this._hp_old_ani[0] != dif_meter) {this._hp_old_ani[0] = dif_meter;
  2208.            this.refresh_meter_flow(this._hp_meter_red,this._hp_old_ani[0],this._battler.mhp,1,this._hp_flow[1]);
  2209.            };
  2210.            this._hp_flow[1] += 1.5;
  2211.            if (this._hp_flow[1] > this._hp_flow[3]) {this._hp_flow[1] = 0};        
  2212.         }
  2213.         else {
  2214.            if (this.need_refresh_parameter(0)) {
  2215.                 this.refresh_meter(this._hp_meter_blue,this._battler.hp,this._battler.mhp,0);
  2216.                 this._hp_old = [this._battler.hp,this._battler.mhp];
  2217.             };
  2218.             var dif_meter = this.update_dif(this._hp_old_ani[0],this._battler.hp,160)
  2219.             if (this._hp_old_ani[0] != dif_meter) {this._hp_old_ani[0] = dif_meter;
  2220.             this.refresh_meter(this._hp_meter_red,this._hp_old_ani[0],this._battler.mhp,1);};      
  2221.         };
  2222.     };
  2223.     if (this._hp_number) {
  2224.         var dif_number = this.update_dif(this._hp_number_old,this._battler.hp,30)
  2225.         if (this._hp_number_old != dif_number) {this._hp_number_old = dif_number;
  2226.         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);};
  2227.     };
  2228.     if (this._maxhp_number) {
  2229.         if (this._maxhp_number_old != this._battler.mhp) {this._maxhp_number_old = this._battler.mhp;
  2230.         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);};
  2231.     };
  2232. };
  2233.  
  2234. //==============================
  2235. // * Create MP Meter
  2236. //==============================
  2237. Battle_Hud.prototype.create_mp_meter = function() {
  2238.     if (String(Moghunter.bhud_mp_meter_visible) != "true") {return};
  2239.     this.removeChild(this._mp_meter_blue);
  2240.     this.removeChild(this._mp_meter_red);
  2241.     if (!this._battler) {return};
  2242.     this._mp_meter_red = new Sprite(this._mp_meter_img);
  2243.     this._mp_meter_red.x = this._pos_x + Moghunter.bhud_mp_meter_pos_x;
  2244.     this._mp_meter_red.y = this._pos_y + Moghunter.bhud_mp_meter_pos_y;
  2245.     this._mp_meter_red.rotation = Moghunter.bhud_mp_meter_rotation;
  2246.     this.addChild(this._mp_meter_red);     
  2247.     this._mp_meter_blue = new Sprite(this._mp_meter_img);
  2248.     this._mp_meter_blue.x = this._mp_meter_red.x;
  2249.     this._mp_meter_blue.y = this._mp_meter_red.y;
  2250.     this._mp_meter_blue.rotation = this._mp_meter_red.rotation;
  2251.     this.addChild(this._mp_meter_blue);
  2252.     if (String(Moghunter.bhud_mp_meter_flow) === "true") {this._mp_flow[0] = true;
  2253.         this._mp_flow[2] = this._mp_meter_img.width / 3;
  2254.         this._mp_flow[3] = this._mp_flow[2] * 2;
  2255.         this._mp_flow[1] = Math.floor(Math.random() * this._mp_flow[2]);
  2256.     };
  2257. };
  2258.  
  2259. //==============================
  2260. // * Create MP Number
  2261. //==============================
  2262. Battle_Hud.prototype.create_mp_number = function() {
  2263.     if (String(Moghunter.bhud_mp_number_visible) != "true") {return};
  2264.     if (this._mp_number) {for (var i = 0; i < this._mp_number.length; i++) {this.removeChild(this._mp_number[i]);}};
  2265.     if (!this._battler) {return};
  2266.     this._mp_number = [];
  2267.     this._mp_img_data = [this._mp_number_img.width,this._mp_number_img.height,
  2268.                           this._mp_number_img.width / 10, this._mp_number_img.height / 2,
  2269.                           this._pos_x + Moghunter.bhud_mp_number_pos_x,
  2270.                           this._pos_y + Moghunter.bhud_mp_number_pos_y,
  2271.                           ];
  2272.     for (var i = 0; i < 5; i++) {
  2273.        this._mp_number[i] = new Sprite(this._mp_number_img);
  2274.        this._mp_number[i].visible = false;
  2275.        this._mp_number[i].x = this._mp_img_data[4];
  2276.        this._mp_number[i].y = this._mp_img_data[5] ;
  2277.        this.addChild(this._mp_number[i]);
  2278.     }; 
  2279.     this._mp_number_old = this._battler.mp;
  2280.     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);
  2281. };
  2282.  
  2283. //==============================
  2284. // * Create MaxMP Number
  2285. //==============================
  2286. Battle_Hud.prototype.create_maxmp_number = function() {
  2287.     if (String(Moghunter.bhud_maxmp_number_visible) != "true") {return};
  2288.     if (this._maxmp_number) {for (var i = 0; i < this._maxmp_number.length; i++) {this.removeChild(this._maxmp_number[i]);}};
  2289.     if (!this._battler) {return};
  2290.     this._maxmp_number = [];
  2291.     this._maxmp_img_data = [this._maxmp_number_img.width,this._maxmp_number_img.height,
  2292.                           this._maxmp_number_img.width / 10, this._maxmp_number_img.height / 2,
  2293.                           this._pos_x + Moghunter.bhud_maxmp_number_pos_x,
  2294.                           this._pos_y + Moghunter.bhud_maxmp_number_pos_y,
  2295.                           ];
  2296.     for (var i = 0; i < 5; i++) {
  2297.        this._maxmp_number[i] = new Sprite(this._maxmp_number_img);
  2298.        this._maxmp_number[i].visible = false;
  2299.        this._maxmp_number[i].x = this._maxmp_img_data[4];
  2300.        this._maxmp_number[i].y = this._maxmp_img_data[5] ;
  2301.        this.addChild(this._maxmp_number[i]);
  2302.     }; 
  2303.     this._maxmp_number_old = this._battler.mmp;
  2304.     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); 
  2305. };
  2306.  
  2307. //==============================
  2308. // * Update MP
  2309. //==============================
  2310. Battle_Hud.prototype.update_mp = function() {
  2311.     if (this._mp_meter_blue) {
  2312.         if(this._mp_flow[0]) {
  2313.            this.refresh_meter_flow(this._mp_meter_blue,this._battler.mp,this._battler.mmp,0,this._mp_flow[1]);
  2314.            var dif_meter = this.update_dif(this._mp_old_ani[0],this._battler.mp,160)
  2315.            if (this._mp_old_ani[0] != dif_meter) {this._mp_old_ani[0] = dif_meter;
  2316.            this.refresh_meter_flow(this._mp_meter_red,this._mp_old_ani[0],this._battler.mmp,1,this._mp_flow[1]);
  2317.            };
  2318.            this._mp_flow[1] += 1.5;
  2319.            if (this._mp_flow[1] > this._mp_flow[3]) {this._mp_flow[1] = 0};        
  2320.         }
  2321.         else {     
  2322.             if (this.need_refresh_parameter(1)) {
  2323.                 this.refresh_meter(this._mp_meter_blue,this._battler.mp,this._battler.mmp,0);
  2324.                 this._mp_old = [this._battler.mp,this._battler.mmp];
  2325.             };
  2326.             var dif_meter = this.update_dif(this._mp_old_ani[0],this._battler.mp,160)
  2327.             if (this._mp_old_ani[0] != dif_meter) {this._mp_old_ani[0] = dif_meter;
  2328.             this.refresh_meter(this._mp_meter_red,this._mp_old_ani[0],this._battler.mmp,1);};
  2329.         };
  2330.     };
  2331.     if (this._mp_number) {
  2332.         var dif_number = this.update_dif(this._mp_number_old,this._battler.mp,30)
  2333.         if (this._mp_number_old != dif_number) {this._mp_number_old = dif_number;
  2334.         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);};
  2335.     };
  2336.     if (this._maxmp_number) {
  2337.         if (this._maxmp_number_old != this._battler.mmp) {this._maxmp_number_old = this._battler.mmp;
  2338.         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);};
  2339.     }; 
  2340.    
  2341. };
  2342.  
  2343. //==============================
  2344. // * Create TP Meter
  2345. //==============================
  2346. Battle_Hud.prototype.create_tp_meter = function() {
  2347.     if (String(Moghunter.bhud_tp_meter_visible) != "true") {return};
  2348.     this.removeChild(this._tp_meter_blue);
  2349.     this.removeChild(this._tp_meter_red);
  2350.     if (!this._battler) {return};
  2351.     this._tp_meter_red = new Sprite(this._tp_meter_img);
  2352.     this._tp_meter_red.x = this._pos_x + Moghunter.bhud_tp_meter_pos_x;
  2353.     this._tp_meter_red.y = this._pos_y + Moghunter.bhud_tp_meter_pos_y;
  2354.     this._tp_meter_red.rotation = Moghunter.bhud_tp_meter_rotation;
  2355.     this.addChild(this._tp_meter_red);     
  2356.     this._tp_meter_blue = new Sprite(this._tp_meter_img);
  2357.     this._tp_meter_blue.x = this._tp_meter_red.x;
  2358.     this._tp_meter_blue.y = this._tp_meter_red.y;
  2359.     this._tp_meter_blue.rotation = this._tp_meter_red.rotation;
  2360.     this.addChild(this._tp_meter_blue);
  2361.     if (String(Moghunter.bhud_tp_meter_flow) === "true") {this._tp_flow[0] = true;
  2362.         this._tp_flow[2] = this._tp_meter_img.width / 3;
  2363.         this._tp_flow[3] = this._tp_flow[2] * 2;
  2364.         this._tp_flow[1] = Math.floor(Math.random() * this._tp_flow[2]);
  2365.     };
  2366. };
  2367.  
  2368. //==============================
  2369. // * Create TP Number
  2370. //==============================
  2371. Battle_Hud.prototype.create_tp_number = function() {
  2372.     if (String(Moghunter.bhud_tp_number_visible) != "true") {return};
  2373.     if (this._tp_number) {for (var i = 0; i < this._tp_number.length; i++) {this.removeChild(this._tp_number[i]);}};
  2374.     if (!this._battler) {return};
  2375.     this._tp_number = [];
  2376.     this._tp_img_data = [this._tp_number_img.width,this._tp_number_img.height,
  2377.                           this._tp_number_img.width / 10, this._tp_number_img.height / 2,
  2378.                           this._pos_x + Moghunter.bhud_tp_number_pos_x,
  2379.                           this._pos_y + Moghunter.bhud_tp_number_pos_y,
  2380.                           ];
  2381.     for (var i = 0; i < 5; i++) {
  2382.        this._tp_number[i] = new Sprite(this._tp_number_img);
  2383.        this._tp_number[i].visible = false;
  2384.        this._tp_number[i].x = this._tp_img_data[4];
  2385.        this._tp_number[i].y = this._tp_img_data[5] ;
  2386.        this.addChild(this._tp_number[i]);
  2387.     }; 
  2388.     this._tp_number_old = this._battler.tp;
  2389.     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);
  2390. };
  2391.  
  2392. //==============================
  2393. // * Create MaxTP Number
  2394. //==============================
  2395. Battle_Hud.prototype.create_maxtp_number = function() {
  2396.     if (String(Moghunter.bhud_maxtp_number_visible) != "true") {return};
  2397.     if (this._maxtp_number) {for (var i = 0; i < this._maxtp_number.length; i++) {this.removeChild(this._maxtp_number[i]);}};
  2398.     if (!this._battler) {return};
  2399.     this._maxtp_number = [];
  2400.     this._maxtp_img_data = [this._maxtp_number_img.width,this._maxtp_number_img.height,
  2401.                           this._maxtp_number_img.width / 10, this._maxtp_number_img.height / 2,
  2402.                           this._pos_x + Moghunter.bhud_maxtp_number_pos_x,
  2403.                           this._pos_y + Moghunter.bhud_maxtp_number_pos_y,
  2404.                           ];
  2405.     for (var i = 0; i < 5; i++) {
  2406.        this._maxtp_number[i] = new Sprite(this._maxtp_number_img);
  2407.        this._maxtp_number[i].visible = false;
  2408.        this._maxtp_number[i].x = this._maxtp_img_data[4];
  2409.        this._maxtp_number[i].y = this._maxtp_img_data[5] ;
  2410.        this.addChild(this._maxtp_number[i]);
  2411.     }; 
  2412.     this._maxtp_number_old = 100;
  2413.     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); 
  2414. };
  2415.  
  2416. //==============================
  2417. // * Update TP
  2418. //==============================
  2419. Battle_Hud.prototype.update_tp = function() {
  2420.     if (this._tp_meter_blue) {
  2421.         if(this._tp_flow[0]) {
  2422.            this.refresh_meter_flow(this._tp_meter_blue,this._battler.tp,100,0,this._tp_flow[1]);
  2423.            var dif_meter = this.update_dif(this._tp_old_ani[0],this._battler.tp,160)
  2424.            if (this._tp_old_ani[0] != dif_meter) {this._tp_old_ani[0] = dif_meter;
  2425.            this.refresh_meter_flow(this._tp_meter_red,this._tp_old_ani[0],100,1,this._tp_flow[1]);
  2426.            };
  2427.            this._tp_flow[1] += 1.5;
  2428.            if (this._tp_flow[1] > this._tp_flow[3]) {this._tp_flow[1] = 0};        
  2429.         }
  2430.         else { 
  2431.             if (this.need_refresh_parameter(2)) {
  2432.                 this.refresh_meter(this._tp_meter_blue,this._battler.tp,100,0);
  2433.                 this._tp_old = [this._battler.tp,100];
  2434.             };
  2435.             var dif_meter = this.update_dif(this._tp_old_ani[0],this._battler.tp,160)
  2436.             if (this._tp_old_ani[0] != dif_meter) {this._tp_old_ani[0] = dif_meter;
  2437.             this.refresh_meter(this._tp_meter_red,this._tp_old_ani[0],100,1);};
  2438.     };
  2439.     };
  2440.     if (this._tp_number) {
  2441.         var dif_number = this.update_dif(this._tp_number_old,this._battler.tp,30)
  2442.         if (this._tp_number_old != dif_number) {this._tp_number_old = dif_number;
  2443.         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);};
  2444.     };
  2445. };
  2446.  
  2447. //==============================
  2448. // * Create AT Meter
  2449. //==============================
  2450. Battle_Hud.prototype.create_at_meter = function() {
  2451.     if (String(Moghunter.bhud_at_meter_visible) != "true") {return};
  2452.     this.removeChild(this._at_meter);
  2453.     if (!this._battler) {return};
  2454.     this._at_meter = new Sprite(this._at_meter_img);
  2455.     this._at_meter.x = this._pos_x + Moghunter.bhud_at_meter_pos_x;
  2456.     this._at_meter.y = this._pos_y + Moghunter.bhud_at_meter_pos_y;
  2457.     this._at_meter.rotation = Moghunter.bhud_at_meter_rotation;
  2458.     this.addChild(this._at_meter); 
  2459.     if (String(Moghunter.bhud_at_meter_flow) === "true") {this._at_flow[0] = true;
  2460.         this._at_flow[2] = this._at_meter_img.width / 3;
  2461.         this._at_flow[3] = this._at_flow[2] * 2;
  2462.         this._at_flow[1] = Math.floor(Math.random() * this._at_flow[2]);
  2463.     };
  2464.     this.check_compatibility_atb();
  2465. };
  2466.  
  2467. //==============================
  2468. // * Check Compatibility ATB
  2469. //==============================
  2470. Battle_Hud.prototype.check_compatibility_atb = function() {
  2471.     if (Imported.Ellye_ATB) {
  2472.         var parameters = $plugins.filter(function(p) {
  2473.             return p.description.contains('<Ellye ATB>');
  2474.         })[0].parameters;
  2475.     this._ellye_max_atb = Number(parameters['Full ATB Gauge'] || 50000);
  2476.     };
  2477. };
  2478.  
  2479. //==============================
  2480. // * Update AT
  2481. //==============================
  2482. Battle_Hud.prototype.update_at = function() {
  2483.     if (this._at_meter) {
  2484.         if (!this.at === -1) {this._at_meter.visible = false; return}
  2485.         else {this._at_meter.visible = true};
  2486.         if(this._at_flow[0]) {
  2487.             if (this.is_casting()){
  2488.                 if (this.is_max_cast()){
  2489.                    this.refresh_at_meter_flow(this._at_meter,this.cast_at(),this.cast_max_at(),3,this._at_flow[1]);}
  2490.                 else {
  2491.                    this.refresh_at_meter_flow(this._at_meter,this.cast_at(),this.cast_max_at(),2,this._at_flow[1]);
  2492.                 };
  2493.             }
  2494.             else if (this.is_max_at()){
  2495.                this.refresh_at_meter_flow(this._at_meter,this.at(),this.max_at(),1,this._at_flow[1]);}
  2496.             else {
  2497.                this.refresh_at_meter_flow(this._at_meter,this.at(),this.max_at(),0,this._at_flow[1]);};
  2498.                
  2499.            this._at_flow[1] += 1.5;
  2500.            if (this._at_flow[1] > this._at_flow[3]) {this._at_flow[1] = 0};        
  2501.         }
  2502.         else { 
  2503.             if (this.is_casting()){
  2504.                 if (this.is_max_cast()){
  2505.                    this.refresh_at_meter(this._at_meter,this.cast_at(),this.cast_max_at(),3);}
  2506.                 else {
  2507.                    this.refresh_at_meter(this._at_meter,this.cast_at(),this.cast_max_at(),2);
  2508.                 };
  2509.             }
  2510.             else if (this.is_max_at()){
  2511.                this.refresh_at_meter(this._at_meter,this.at(),this.max_at(),1);}
  2512.             else {
  2513.                this.refresh_at_meter(this._at_meter,this.at(),this.max_at(),0);};
  2514.         };
  2515.     };
  2516. };
  2517.  
  2518. //==============================
  2519. // * Refresh AT Meter
  2520. //==============================
  2521. Battle_Hud.prototype.refresh_at_meter = function(sprite,value,value_max,type) {
  2522.     var ch = sprite.bitmap.height / 4;
  2523.     var meter_rate = sprite.bitmap.width * value / value_max;
  2524.     sprite.setFrame(0,type * ch, meter_rate, ch);
  2525. };
  2526.  
  2527. //==============================
  2528. // * Refresh AT Meter Flow
  2529. //==============================
  2530. Battle_Hud.prototype.refresh_at_meter_flow = function(sprite,value,value_max,type,flow) {
  2531.     var cw = sprite.bitmap.width / 3;
  2532.     var ch = sprite.bitmap.height / 4;
  2533.     var meter_rate = cw * value / value_max;
  2534.     sprite.setFrame(flow,type * ch, meter_rate, ch);
  2535. };
  2536.  
  2537. //==============================
  2538. // * At
  2539. //==============================
  2540. Battle_Hud.prototype.at = function() {
  2541.  if (Imported.MOG_ATB) {return this._battler._atb};
  2542.  if (Imported.Ellye_ATB) {return this._battler.atb};
  2543.  if (Imported.YEP_X_BattleSysATB) {return Math.abs(this._battler._atbSpeed)};
  2544.   return -1;   
  2545. }
  2546.  
  2547. //==============================
  2548. // * Max At
  2549. //==============================
  2550. Battle_Hud.prototype.max_at = function() {
  2551.   if (Imported.MOG_ATB) {return this._battler._max_atb};
  2552.   if (Imported.Ellye_ATB) {return this._ellye_max_atb};
  2553.   if (Imported.YEP_X_BattleSysATB) {return Math.abs(BattleManager._atbTarget)};
  2554.   return 1;
  2555. };
  2556.  
  2557. //==============================
  2558. // * Cast AT
  2559. //==============================
  2560. Battle_Hud.prototype.cast_at = function() {
  2561.   if (Imported.MOG_ATB) {return this._battler._cast_atb[1]};
  2562.   if (Imported.Ellye_ATB) {return this._battler.current_cast_atb};
  2563.   if (Imported.YEP_X_BattleSysATB) {return Math.abs(this._battler._atbCharge)};
  2564.   return 0;
  2565. };
  2566.  
  2567. //==============================
  2568. // * Cast Max AT
  2569. //==============================
  2570. Battle_Hud.prototype.cast_max_at = function() {
  2571.   if (Imported.MOG_ATB) {return this._battler._cast_atb[2]};
  2572.   if (Imported.Ellye_ATB) {return this._battler.target_cast_atb};
  2573.   if (Imported.YEP_X_BattleSysATB) {return Math.abs(BattleManager._atbCharge)};
  2574.   return 1;
  2575. };
  2576.  
  2577. //==============================
  2578. // * Is Casting
  2579. //==============================
  2580. Battle_Hud.prototype.is_casting = function() {
  2581.   if (Imported.MOG_ATB) {if (this._battler._cast_atb[0]) {return true;}};
  2582.   if (Imported.Ellye_ATB) {if (this._battler.casting_action) {return true;}};
  2583.   if (Imported.YEP_X_BattleSysATB) {if (this._battler._atbCharging) {return true;}} ;
  2584.   return false;
  2585. };
  2586.  
  2587. //==============================
  2588. // * Is Max Atb
  2589. //==============================
  2590. Battle_Hud.prototype.is_max_at = function() {
  2591.     return this.at() >= this.max_at();
  2592. };
  2593.  
  2594. //==============================
  2595. // * Is Max Cast
  2596. //==============================
  2597. Battle_Hud.prototype.is_max_cast = function() {
  2598.     return this.cast_at() >= this.cast_max_at();
  2599. };
  2600.  
  2601. //==============================
  2602. // * Create States
  2603. //==============================
  2604. Battle_Hud.prototype.create_states = function() {
  2605.     if (String(Moghunter.bhud_states_visible) != "true") {return};
  2606.     this.removeChild(this._state_icon);
  2607.     if (!this._battler) {return};
  2608.     this._states_data = [0,0,0];
  2609.     this._state_icon = new Sprite(this._state_img);
  2610.     this._state_icon.x = this._pos_x + Moghunter.bhud_states_pos_x;
  2611.     this._state_icon.y = this._pos_y + Moghunter.bhud_states_pos_y;
  2612.     this._state_icon.visible = false;
  2613.     this.addChild(this._state_icon);
  2614.     this.refresh_states(); 
  2615. };
  2616.  
  2617. //==============================
  2618. // * Create States
  2619. //==============================
  2620. Battle_Hud.prototype.refresh_states = function() {
  2621.     this._states_data[0] = 0;
  2622.     this._states_data[2] = 0;
  2623.     this._state_icon.visible = false;
  2624.     if (this._battler.allIcons().length == 0) {this._states_data[1] = 0;return};
  2625.        if (this._battler.allIcons()[this._states_data[1]]) {   
  2626.         this._states_data[0] = this._battler.allIcons()[this._states_data[1]];
  2627.         this._state_icon.visible = true;
  2628.         var sx = this._states_data[0] % 16 * 32;
  2629.         var sy = Math.floor(this._states_data[0] / 16) * 32;
  2630.         this._state_icon.setFrame(sx, sy, 32, 32);
  2631.         this._battler.need_refresh_bhud_states = false;
  2632.    
  2633.        };
  2634.     this._states_data[1] += 1;
  2635.     if (this._states_data[1] >= this._battler.allIcons().length) {
  2636.         this._states_data[1] = 0
  2637.     };
  2638. };
  2639.  
  2640. //==============================
  2641. // * Update States
  2642. //==============================
  2643. Battle_Hud.prototype.update_states = function() {
  2644.     this._states_data[2] += 1;
  2645.     if (this.need_refresh_states()) {this.refresh_states();};
  2646. };
  2647.  
  2648. //==============================
  2649. // * Need Refresh States
  2650. //==============================
  2651. Battle_Hud.prototype.need_refresh_states = function() {
  2652.     if (this._battler.need_refresh_bhud_states) {return true};
  2653.     if (this._states_data[2] > 60) {return true};
  2654.     return false;
  2655. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement