Guest User

Moghunter Actor HuD

a guest
Oct 19th, 2020 (edited)
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // MOG_ActorHud.js           (Template - 01)
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc (v2.0 *) Adiciona uma Hud com os parâmetros do personagem.
  7.  * @author Moghunter
  8.  *
  9.  * @param -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  10.  * @desc
  11.  *  
  12.  * @param Initial Visible
  13.  * @desc Ativar a Hud no inicio do jogo.
  14.  * @default true
  15.  * @type boolean
  16.  * @on Visible From Start
  17.  * @off Hide
  18.  * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  19.  *
  20.  * @param Hud X-Axis
  21.  * @desc Definição da posição X-Axis da Hud.
  22.  * @default 0
  23.  * @type number
  24.  * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  25.  *
  26.  * @param Hud Y-Axis
  27.  * @desc Definição da posição Y-Axis da Hud.
  28.  * @default 440
  29.  * @type number
  30.  * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  31.  *
  32.  * @param Smart Fade
  33.  * @desc Ativa transparência na hud quando a hud estiver acima do personagem.
  34.  * @default true
  35.  * @type boolean
  36.  * @on Overlapping Character
  37.  * @off Always Visible
  38.  * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  39.  *
  40.  * @param Auto Fade
  41.  * @desc Oculta na hud quando a janela de messagem estiver ativada.
  42.  * @default true
  43.  * @type boolean
  44.  * @on Window Message
  45.  * @off Always Visible
  46.  * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  47.  *
  48.  * @param
  49.  *
  50.  * @param -> LAYOUT 2 <<<<<<<<<<<<<<<<<<<<<<<
  51.  * @desc
  52.  *
  53.  * @param Layout Overlay Visible
  54.  * @desc Apresentar o segundo layout acima dos medidores e face.
  55.  * @default false
  56.  * @type boolean
  57.  * @on Show
  58.  * @off Hide
  59.  * @parent -> LAYOUT 2 <<<<<<<<<<<<<<<<<<<<<<<
  60.  *
  61.  * @param Layout Overlay X-Axis
  62.  * @desc Definição da posição X-Axis da face.
  63.  * @default 0
  64.  * @type number
  65.  * @parent -> LAYOUT 2 <<<<<<<<<<<<<<<<<<<<<<<
  66.  *
  67.  * @param Layout Overlay Y-Axis
  68.  * @desc Definição da posição Y-Axis da face.
  69.  * @default 0
  70.  * @type number
  71.  * @parent -> LAYOUT 2 <<<<<<<<<<<<<<<<<<<<<<<
  72.  *
  73.  *
  74.  * @param
  75.  *
  76.  * @param -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  77.  * @desc
  78.  *
  79.  * @param Face Visible
  80.  * @desc Apresentar a imagem da face.
  81.  * @default true
  82.  * @type boolean
  83.  * @on Show
  84.  * @off Hide
  85.  * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  86.  *
  87.  * @param Face X-Axis
  88.  * @desc Definição da posição X-Axis da face.
  89.  * @default 55
  90.  * @type number
  91.  * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  92.  *
  93.  * @param Face Y-Axis
  94.  * @desc Definição da posição Y-Axis da face.
  95.  * @default 100
  96.  * @type number
  97.  * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  98.  *
  99.  * @param Face Priority
  100.  * @desc Prioridade da Face. (0 Low - 1 High)
  101.  * @default 1
  102.  * @type select
  103.  * @option (0) Below the Layout
  104.  * @value 0
  105.  * @option (1) Above the Layout
  106.  * @value 1
  107.  * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  108.  *
  109.  * @param
  110.  *
  111.  * @param -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  112.  * @desc
  113.  *
  114.  * @param Name Visible
  115.  * @desc Apresentar o nome do personagem.
  116.  * @default true
  117.  * @type boolean
  118.  * @on Show
  119.  * @off Hide
  120.  * @parent -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  121.  *
  122.  * @param Name X-Axis
  123.  * @desc Definição da posição X-Axis do nome.
  124.  * @default 5
  125.  * @type number
  126.  * @parent -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  127.  *
  128.  * @param Name Y-Axis
  129.  * @desc Definição da posição Y-Axis do nome.
  130.  * @default 20
  131.  * @type number
  132.  * @parent -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  133.  *
  134.  * @param Name Font Size
  135.  * @desc Definição do tamanho da fonte do nome.
  136.  * @default 20
  137.  * @type number
  138.  * @parent -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  139.  *
  140.  * @param Name Bold Size
  141.  * @desc Definição do tamanho do contorno.
  142.  * @default 4
  143.  * @type number
  144.  * @parent -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  145.  *
  146.  * @param Name Font Italic
  147.  * @desc Ativar fonte em itálico.
  148.  * @default false
  149.  * @type boolean
  150.  * @on Enable
  151.  * @off Disable
  152.  * @parent -> NAME <<<<<<<<<<<<<<<<<<<<<<<
  153.  *
  154.  * @param
  155.  *
  156.  * @param -> HP <<<<<<<<<<<<<<<<<<<<<<<
  157.  * @desc
  158.  *
  159.  * @param HP Meter Visible
  160.  * @text Gauge Visible
  161.  * @desc Apresentar o medidor de HP
  162.  * @default true
  163.  * @type boolean
  164.  * @on Show
  165.  * @off Hide
  166.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  167.  *
  168.  * @param HP Meter X-Axis
  169.  * @text Gauge X-Axis
  170.  * @desc Definição da posição X-Axis do medidor de HP.
  171.  * @default 143
  172.  * @type number
  173.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  174.  *
  175.  * @param HP Meter Y-Axis
  176.  * @text Gauge Y-Axis
  177.  * @desc Definição da posição Y-Axis do medidor de HP.
  178.  * @default 85
  179.  * @type number
  180.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  181.  *
  182.  * @param HP Meter Angle
  183.  * @text Gauge Angle  
  184.  * @desc Ángulo do medidor.
  185.  * @default 0
  186.  * @type number
  187.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  188.  *
  189.  * @param HP Meter Flow Anime
  190.  * @text Gauge Gradient Animation
  191.  * @desc Ativar animação de gradiente no medidor.
  192.  * É necessário que a imagem tenha 3x a largura do medidor.
  193.  * @default true
  194.  * @type boolean
  195.  * @on Enable
  196.  * @off Disable
  197.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  198.  *
  199.  * @param HP Meter Flow Speed
  200.  * @text Gauge Gradient Speed  
  201.  * @desc Define a velocidade de animação do gradient.
  202.  * É necessário que a imagem tenha 3x a largura do medidor.
  203.  * @default 4
  204.  * @type number
  205.  * @min 1
  206.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  207.  *
  208.  * @param HP Number Visible
  209.  * @desc Apresentar o numero de HP
  210.  * @default true
  211.  * @type boolean
  212.  * @on Show
  213.  * @off Hide
  214.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  215.  *
  216.  * @param HP Number Align
  217.  * @desc Definição do alinhamento dos números.
  218.  * 0 - Espquerda     1 - Centro       2 - Direita
  219.  * @default 0
  220.  * @type select
  221.  * @option Left
  222.  * @value 0
  223.  * @option Center
  224.  * @value 1
  225.  * @option Right
  226.  * @value 2  
  227.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  228.  *  
  229.  * @param HP Number X-Axis
  230.  * @desc Definição da posição X-Axis do numero de HP.
  231.  * @default 270
  232.  * @type number
  233.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  234.  *
  235.  * @param HP Number Y-Axis
  236.  * @desc Definição da posição Y-Axis do numero de HP.
  237.  * @default 70
  238.  * @type number
  239.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  240.  *
  241.  * @param MaxHP Number Visible
  242.  * @desc Apresentar o numero de HP maximo.
  243.  * @default false
  244.  * @type boolean
  245.  * @on Show
  246.  * @off Hide
  247.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  248.  *
  249.  * @param MaxHP Number X-Axis
  250.  * @desc Definição da posição X-Axis do numero de HP maximo.
  251.  * @default 185
  252.  * @type number
  253.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  254.  *
  255.  * @param MaxHP Number Y-Axis
  256.  * @desc Definição da posição Y-Axis do numero de HP maximo.
  257.  * @default 40
  258.  * @type number
  259.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  260.  *
  261.  * @param HP Icon Visible
  262.  * @desc Apresentar o ícone de HP.
  263.  * @default false
  264.  * @type boolean
  265.  * @on Show
  266.  * @off Hide
  267.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  268.  *
  269.  * @param HP Icon Half Mode
  270.  * @desc Um ícone equivale a 2 pontos de HP.
  271.  * @default false
  272.  * @type boolean
  273.  * @on Enable (Zelda Style)
  274.  * @off Disable
  275.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  276.  *
  277.  * @param HP Icon Max Colors
  278.  * @desc Quantidade de cores do ícone.
  279.  * A imagem será dividida pelo número de cores.
  280.  * @default 2
  281.  * @type number
  282.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  283.  *
  284.  * @param HP Icon Max Rows
  285.  * @desc Quantidade de ícones por linha.
  286.  * @default 10
  287.  * @type number
  288.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  289.  *
  290.  * @param HP Icon Max Columns
  291.  * @desc Quantidade de linhas.
  292.  * @default 2
  293.  * @type number
  294.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  295.  *
  296.  * @param HP Icon X-Axis
  297.  * @desc Quantidade X-Axis dos ícones.
  298.  * @default 143
  299.  * @type number
  300.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  301.  *
  302.  * @param HP Icon Y-Axis
  303.  * @desc Quantidade Y-Axis dos ícones.
  304.  * @default 85
  305.  * @type number
  306.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  307.  *
  308.  * @param HP Icon Space X
  309.  * @desc Definição do espaço entre os ícones na horizontal.
  310.  * @default 0
  311.  * @type number
  312.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  313.  *
  314.  * @param HP Icon Space Y
  315.  * @desc Definição do espaço entre os ícones na vertical.
  316.  * @default 0
  317.  * @type number
  318.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  319.  *
  320.  * @param HP Icon Zoom Anime
  321.  * @desc Ativar a animação de zoom no último ícone.
  322.  * @type boolean
  323.  * @on Enable
  324.  * @off Disable  
  325.  * @default true
  326.  
  327.  * @parent -> HP <<<<<<<<<<<<<<<<<<<<<<<
  328.  *
  329.  * @param
  330.  *
  331.  * @param -> MP <<<<<<<<<<<<<<<<<<<<<<<
  332.  * @desc
  333.  *
  334.  * @param MP Meter Visible
  335.  * @text Gauge Visible
  336.  * @desc Apresentar o medidor de MP
  337.  * @default true
  338.  * @type boolean
  339.  * @on Show
  340.  * @off Hide
  341.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  342.  *
  343.  * @param MP Meter X-Axis
  344.  * @text Gauge X-Axis
  345.  * @desc Definição da posição X-Axis do medidor de MP.
  346.  * @default 160
  347.  * @type number
  348.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  349.  *
  350.  * @param MP Meter Y-Axis
  351.  * @text Gauge Y-Axis
  352.  * @desc Definição da posição Y-Axis do medidor de MP.
  353.  * @default 115
  354.  * @type number
  355.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  356.  *
  357.  * @param MP Meter Angle
  358.  * @text Gauge Angle
  359.  * @desc Ángulo do medidor.
  360.  * @default 0
  361.  * @type number
  362.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  363.  *
  364.  * @param MP Meter Flow Anime
  365.  * @text Gauge Gradient Animation  
  366.  * @desc Ativar animação de gradiente no medidor.
  367.  * É necessário que a imagem tenha 3x a largura do medidor.
  368.  * @default true
  369.  * @type boolean
  370.  * @on Enable
  371.  * @off Disable
  372.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  373.  *
  374.  * @param MP Meter Flow Speed
  375.  * @text Gauge Gradient Speed  
  376.  * @desc Define a velocidade de animação do gradient.
  377.  * É necessário que a imagem tenha 3x a largura do medidor.
  378.  * @default 4
  379.  * @type number
  380.  * @min 1
  381.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  382.  *
  383.  * @param MP Number Visible
  384.  * @desc Apresentar o numero de MP
  385.  * @default true
  386.  * @type boolean
  387.  * @on Show
  388.  * @off Hide
  389.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  390.  *
  391.  * @param MP Number Align
  392.  * @desc Definição do alinhamento dos números.
  393.  * 0 - Espquerda     1 - Centro       2 - Direita
  394.  * @default 0
  395.  * @type select
  396.  * @option Left
  397.  * @value 0
  398.  * @option Center
  399.  * @value 1
  400.  * @option Right
  401.  * @value 2  
  402.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  403.  *  
  404.  * @param MP Number X-Axis
  405.  * @desc Definição da posição X-Axis do numero de MP.
  406.  * @default 287
  407.  * @type number
  408.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  409.  *
  410.  * @param MP Number Y-Axis
  411.  * @desc Definição da posição Y-Axis do numero de MP.
  412.  * @default 100
  413.  * @type number
  414.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  415.  *
  416.  * @param MaxMP Number Visible
  417.  * @desc Apresentar o numero de MP maximo.
  418.  * @default false
  419.  * @type boolean
  420.  * @on Show
  421.  * @off Hide
  422.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  423.  *
  424.  * @param MaxMP Number X-Axis
  425.  * @desc Definição da posição X-Axis do numero de MP maximo.
  426.  * @default 196
  427.  * @type number
  428.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  429.  *
  430.  * @param MaxMP Number Y-Axis
  431.  * @desc Definição da posição Y-Axis do numero de MP maximo.
  432.  * @default 78
  433.  * @type number
  434.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  435.  *
  436.  * @param MP Icon Visible
  437.  * @desc Apresentar o ícone de MP.
  438.  * @default false
  439.  * @type boolean
  440.  * @on Show
  441.  * @off Hide
  442.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  443.  *
  444.  * @param MP Icon Half Mode
  445.  * @desc Um ícone equivale a 2 pontos de MP.
  446.  * @default false
  447.  * @type boolean
  448.  * @on Enable (Zelda Style)
  449.  * @off Disable
  450.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  451.  *
  452.  * @param MP Icon Max Colors
  453.  * @desc Quantidade de cores do ícone.
  454.  * A imagem será dividida pelo número de cores.
  455.  * @default 2
  456.  * @type number
  457.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  458.  *
  459.  * @param MP Icon Max Rows
  460.  * @desc Quantidade de ícones por linha.
  461.  * @default 10
  462.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  463.  *
  464.  * @param MP Icon Max Columns
  465.  * @desc Quantidade de linhas.
  466.  * @default 2
  467.  * @type number
  468.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  469.  *
  470.  * @param MP Icon X-Axis
  471.  * @desc Quantidade X-Axis dos ícones.
  472.  * @default 143
  473.  * @type number
  474.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  475.  *
  476.  * @param MP Icon Y-Axis
  477.  * @desc Quantidade Y-Axis dos ícones.
  478.  * @default 120
  479.  * @type number
  480.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  481.  *
  482.  * @param MP Icon Space X
  483.  * @desc Definição do espaço entre os ícones na horizontal.
  484.  * @default 0
  485.  * @type number
  486.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  487.  *
  488.  * @param MP Icon Space Y
  489.  * @desc Definição do espaço entre os ícones na vertical.
  490.  * @default 0
  491.  * @type number
  492.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  493.  *
  494.  * @param MP Icon Zoom Anime
  495.  * @desc Ativar a animação de zoom no último ícone.
  496.  * @default true
  497.  * @type boolean
  498.  * @on Enable
  499.  * @off Disable
  500.  * @parent -> MP <<<<<<<<<<<<<<<<<<<<<<<
  501.  *
  502.  * @param
  503.  *
  504.  * @param -> TP <<<<<<<<<<<<<<<<<<<<<<<
  505.  * @desc
  506.  *
  507.  * @param TP Meter Visible
  508.  * @text Gauge Visible  
  509.  * @desc Apresentar o medidor de TP
  510.  * @default true
  511.  * @type boolean
  512.  * @on Show
  513.  * @off Hide
  514.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  515.  *
  516.  * @param TP Meter X-Axis
  517.  * @text Gauge X-Axis
  518.  * @desc Definição da posição X-Axis do medidor de TP.
  519.  * @default 143
  520.  * @type number
  521.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  522.  *
  523.  * @param TP Meter Y-Axis
  524.  * @text Gauge Y-Axis
  525.  * @desc Definição da posição Y-Axis do medidor de TP.
  526.  * @default 145
  527.  * @type number
  528.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  529.  *
  530.  * @param TP Meter Angle
  531.  * @text Gauge Angle
  532.  * @desc Ángulo do medidor.
  533.  * @default 0
  534.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  535.  *
  536.  * @param TP Meter Flow Anime
  537.  * @text Gauge Gradient Animation
  538.  * @desc Ativar animação de gradiente no medidor.
  539.  * É necessário que a imagem tenha 3x a largura do medidor.
  540.  * @default true
  541.  * @type boolean
  542.  * @on Enable
  543.  * @off Disable
  544.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  545.  *
  546.  * @param TP Meter Flow Speed
  547.  * @text Gauge Gradient Speed  
  548.  * @desc Define a velocidade de animação do gradient.
  549.  * É necessário que a imagem tenha 3x a largura do medidor.
  550.  * @default 4
  551.  * @type number
  552.  * @min 1
  553.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  554.  *
  555.  * @param TP Number Visible
  556.  * @desc Apresentar o numero de TP.
  557.  * @default true  
  558.  * @type boolean
  559.  * @on Show
  560.  * @off Hide
  561.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  562.  *
  563.  * @param TP Number Align
  564.  * @desc Definição do alinhamento dos números.
  565.  * 0 - Espquerda     1 - Centro       2 - Direita
  566.  * @default 0
  567.  * @type select
  568.  * @option Left
  569.  * @value 0
  570.  * @option Center
  571.  * @value 1
  572.  * @option Right
  573.  * @value 2  
  574.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  575.  *
  576.  * @param TP Number X-Axis
  577.  * @desc Definição da posição X-Axis do numero de TP.
  578.  * @default 270
  579.  * @type number
  580.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  581.  *
  582.  * @param TP Number Y-Axis
  583.  * @desc Definição da posição Y-Axis do numero de TP.
  584.  * @default 130
  585.  * @type number
  586.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  587.  *
  588.  * @param MaxTP Number Visible
  589.  * @desc Apresentar o numero de TP maximo.
  590.  * @default false
  591.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  592.  *
  593.  * @param MaxTP Number X-Axis
  594.  * @desc Definição da posição X-Axis do numero de TP maximo.
  595.  * @default 185
  596.  * @type number
  597.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  598.  *
  599.  * @param MaxTP Number Y-Axis
  600.  * @desc Definição da posição Y-Axis do numero de TP maximo.
  601.  * @default 116
  602.  * @type number
  603.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  604.  *
  605.  * @param TP Icon Visible
  606.  * @desc Apresentar o ícone de TP.
  607.  * @default false
  608.  * @type boolean
  609.  * @on Show
  610.  * @off Hide
  611.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  612.  *
  613.  * @param TP Icon Half Mode
  614.  * @desc Um ícone equivale a 2 pontos de TP.
  615.  * @default false
  616.  * @type boolean
  617.  * @on Enable (Zelda Style)
  618.  * @off Disable
  619.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  620.  *
  621.  * @param TP Icon Max Colors
  622.  * @desc Quantidade de cores do ícone.
  623.  * A imagem será dividida pelo número de cores.
  624.  * @default 2
  625.  * @type number
  626.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  627.  *
  628.  * @param TP Icon Max Rows
  629.  * @desc Quantidade de ícones por linha.
  630.  * @default 10
  631.  * @type number
  632.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  633.  *
  634.  * @param TP Icon Max Columns
  635.  * @desc Quantidade de linhas.
  636.  * @default 2
  637.  * @type number
  638.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  639.  *
  640.  * @param TP Icon X-Axis
  641.  * @desc Quantidade X-Axis dos ícones.
  642.  * @default 143
  643.  * @type number
  644.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  645.  *
  646.  * @param TP Icon Y-Axis
  647.  * @desc Quantidade Y-Axis dos ícones.
  648.  * @default 50
  649.  * @type number
  650.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  651.  *
  652.  * @param TP Icon Space X
  653.  * @desc Definição do espaço entre os ícones na horizontal.
  654.  * @default 0
  655.  * @type number
  656.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  657.  *
  658.  * @param TP Icon Space Y
  659.  * @desc Definição do espaço entre os ícones na vertical.
  660.  * @default 0
  661.  * @type number
  662.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  663.  *
  664.  * @param TP Icon Zoom Anime
  665.  * @desc Ativar a animação de zoom no último ícone.
  666.  * @default true
  667.  * @type boolean
  668.  * @on Enable
  669.  * @off Disable
  670.  * @parent -> TP <<<<<<<<<<<<<<<<<<<<<<<
  671.  *
  672.  * @param
  673.  *
  674.  * @param -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  675.  * @desc
  676.  *
  677.  * @param EXP Meter Visible
  678.  * @desc Apresentar o medidor de EXP
  679.  * @default true
  680.  * @type boolean
  681.  * @on Show
  682.  * @off Hide
  683.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  684.  *
  685.  * @param EXP Meter X-Axis
  686.  * @desc Definição da posição X-Axis do medidor de EXP.
  687.  * @default 127
  688.  * @type number
  689.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  690.  *
  691.  * @param EXP Meter Y-Axis
  692.  * @desc Definição da posição Y-Axis do medidor de EXP.
  693.  * @default 173
  694.  * @type number
  695.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  696.  *
  697.  * @param EXP Meter Angle
  698.  * @desc Ángulo do medidor.
  699.  * @default 0
  700.  * @type number
  701.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  702.  *
  703.  * @param Level Number Visible
  704.  * @desc Apresentar o numero de Level.
  705.  * @default true
  706.  * @type boolean
  707.  * @on Show
  708.  * @off Hide
  709.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  710.  *
  711.  * @param Level Number Align
  712.  * @desc Definição do alinhamento dos números.
  713.  * 0 - Espquerda     1 - Centro       2 - Direita
  714.  * @default 1
  715.  * @type select
  716.  * @option Left
  717.  * @value 0
  718.  * @option Center
  719.  * @value 1
  720.  * @option Right
  721.  * @value 2
  722.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  723.  *
  724.  * @param Level Number X-Axis
  725.  * @desc Definição da posição X-Axis do numero de Level.
  726.  * @default 65
  727.  * @type number
  728.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  729.  *
  730.  * @param Level Number Y-Axis
  731.  * @desc Definição da posição Y-Axis do numero de Level.
  732.  * @default 153
  733.  * @type number
  734.  * @parent -> EXP <<<<<<<<<<<<<<<<<<<<<<<
  735.  *
  736.  * @param
  737.  *
  738.  * @param -> STATES <<<<<<<<<<<<<<<<<<<<<<<
  739.  * @desc
  740.  *
  741.  * @param States Visible
  742.  * @desc Apresentar o numero as condições.
  743.  * @default true
  744.  * @type boolean
  745.  * @on Show
  746.  * @off Hide
  747.  * @parent -> STATES <<<<<<<<<<<<<<<<<<<<<<<
  748.  *
  749.  * @param States X-Axis
  750.  * @desc Definição da posição X-Axis das condições.
  751.  * @default 5
  752.  * @type number
  753.  * @parent -> STATES <<<<<<<<<<<<<<<<<<<<<<<
  754.  *
  755.  * @param States Y-Axis
  756.  * @desc Definição da posição Y-Axis das condições.
  757.  * @default 64
  758.  * @type number
  759.  * @parent -> STATES <<<<<<<<<<<<<<<<<<<<<<<
  760.  *
  761.  * @help  
  762.  * =============================================================================
  763.  * +++ MOG Actor Hud (v2.0) +++
  764.  * By Moghunter
  765.  * https://atelierrgss.wordpress.com/
  766.  * =============================================================================
  767.  * Adiciona uma Hud com os parâmetros do personagem.
  768.  *
  769.  * =============================================================================
  770.  * - REQUIRED FILES
  771.  * =============================================================================
  772.  * Serão necessários os arquivos. (img/actorhud/)
  773.  *
  774.  * HP_Meter.png
  775.  * HP_Number.png
  776.  * MP_Meter.png
  777.  * MP_Number.png
  778.  * TP_Meter.png
  779.  * TP_Number.png
  780.  * Layout.png
  781.  * LV_Number.png
  782.  * EXP_Meter.png
  783.  *
  784.  * =============================================================================
  785.  * Para nomear as faces dos battlers basta nomear da seguinte forma.
  786.  *
  787.  * Face_ + ACTOR_ID.png
  788.  *
  789.  * Face_1.png
  790.  * Face_2.png
  791.  * Face_3.png
  792.  * ...
  793.  *
  794.  * =============================================================================
  795.  * - PLUGIN COMMANDS
  796.  * =============================================================================
  797.  * Para ocultar ou apresentar a hud use os códigos abaixo.
  798.  *
  799.  * hide_actor_hud
  800.  * show_actor_hud
  801.  *
  802.  * ============================================================================
  803.  * - WHAT'S  NEW (version 2.0)
  804.  * ============================================================================
  805.  * - (NEW) - Plugins parameters compatíveis com RM1.5+
  806.  * - (NEW) - Adição da segunda camada de Layout (Overlay).
  807.  * - (NEW) - Possibilidade de mudar a velocidade de animação do gradient.
  808.  * - (BUG FIX) - Correção de resetar a animação de gradiente ao voltar do menu.
  809.  * - (BUG FIX) - Correção de resetar a transparência ao voltar do menu.    
  810.  */
  811.  
  812. //=============================================================================
  813. // ** PLUGIN PARAMETERS
  814. //=============================================================================
  815.   var Imported = Imported || {};
  816.   Imported.MOG_ActorHud = true;
  817.   var Moghunter = Moghunter || {};
  818.  
  819.    Moghunter.parameters = PluginManager.parameters('MOG_ActorHud');
  820.    
  821.     // HUD POSITION
  822.     Moghunter.ahud_pos_x = Number(Moghunter.parameters['Hud X-Axis'] || 0);
  823.     Moghunter.ahud_pos_y = Number(Moghunter.parameters['Hud Y-Axis'] || 440);
  824.     Moghunter.ahud_fade_limit = Number(Moghunter.parameters['Fade Max'] || 90);
  825.     Moghunter.ahud_layout2_visible = String(Moghunter.parameters['Layout Overlay Visible'] || true);
  826.     Moghunter.ahud_layout2_x = Number(Moghunter.parameters['Layout Overlay X-Axis'] || 0);
  827.     Moghunter.ahud_layout2_y = Number(Moghunter.parameters['Layout Overlay Y-Axis'] || 0);
  828.    
  829.     // FACE POSITION
  830.     Moghunter.ahud_face_visible = String(Moghunter.parameters['Face Visible'] || true);
  831.     Moghunter.ahud_face_shake = String(Moghunter.parameters['Face Shake Animation'] || true);
  832.     Moghunter.ahud_face_zoom = String(Moghunter.parameters['Face Zoom Animation'] || true);
  833.     Moghunter.ahud_face_animated = String(Moghunter.parameters['Face Frame Animation'] || false);
  834.     Moghunter.ahud_face_pos_x = Number(Moghunter.parameters['Face X-Axis'] || 55);
  835.     Moghunter.ahud_face_pos_y = Number(Moghunter.parameters['Face Y-Axis'] || 100);
  836.     Moghunter.ahud_face_priority = Number(Moghunter.parameters['Face Priority'] || 1);
  837.    
  838.     // NAME POSITION
  839.     Moghunter.ahud_name_visible = String(Moghunter.parameters['Name Visible'] || true);
  840.     Moghunter.ahud_name_font_size = Number(Moghunter.parameters['Name Font Size'] || 20);
  841.     Moghunter.ahud_name_font_bold_size = Number(Moghunter.parameters['Name Bold Size'] || 4);
  842.     Moghunter.ahud_name_font_italic = String(Moghunter.parameters['Name Font Italic'] || false);   
  843.     Moghunter.ahud_name_pos_x = Number(Moghunter.parameters['Name X-Axis'] || 5);
  844.     Moghunter.ahud_name_pos_y = Number(Moghunter.parameters['Name Y-Axis'] || 20); 
  845.    
  846.     // HP ICON POSITION
  847.     Moghunter.ahud_hp_icon_visible = String(Moghunter.parameters['HP Icon Visible'] || 'false');
  848.     Moghunter.ahud_hp_icon_halfMode = String(Moghunter.parameters['HP Icon Half Mode'] || 'false');
  849.     Moghunter.ahud_hp_icon_colorMax = Number(Moghunter.parameters['HP Icon Max Colors'] || 2);   
  850.     Moghunter.ahud_hp_icon_rows = Number(Moghunter.parameters['HP Icon Max Rows'] || 10);
  851.     Moghunter.ahud_hp_icon_cols = Number(Moghunter.parameters['HP Icon Max Columns'] || 2);
  852.     Moghunter.ahud_hp_icon_pos_x = Number(Moghunter.parameters['HP Icon X-Axis'] || 143);
  853.     Moghunter.ahud_hp_icon_pos_y = Number(Moghunter.parameters['HP Icon Y-Axis'] || 85);   
  854.     Moghunter.ahud_hp_icon_space_x = Number(Moghunter.parameters['HP Icon Space X'] || 0);
  855.     Moghunter.ahud_hp_icon_space_y = Number(Moghunter.parameters['HP Icon Space Y'] || 0); 
  856.     Moghunter.ahud_hp_icon_zoomAnime = String(Moghunter.parameters['HP Icon Zoom Anime'] || 'true');   
  857.    
  858.     // MP ICON POSITION
  859.     Moghunter.ahud_mp_icon_visible = String(Moghunter.parameters['MP Icon Visible'] || 'false');
  860.     Moghunter.ahud_mp_icon_halfMode = String(Moghunter.parameters['MP Icon Half Mode'] || 'false');
  861.     Moghunter.ahud_mp_icon_colorMax = Number(Moghunter.parameters['MP Icon Max Colors'] || 2);   
  862.     Moghunter.ahud_mp_icon_rows = Number(Moghunter.parameters['MP Icon Max Rows'] || 10);
  863.     Moghunter.ahud_mp_icon_cols = Number(Moghunter.parameters['MP Icon Max Columns'] || 2);
  864.     Moghunter.ahud_mp_icon_pos_x = Number(Moghunter.parameters['MP Icon X-Axis'] || 143);
  865.     Moghunter.ahud_mp_icon_pos_y = Number(Moghunter.parameters['MP Icon Y-Axis'] || 125);  
  866.     Moghunter.ahud_mp_icon_space_x = Number(Moghunter.parameters['MP Icon Space X'] || 0);
  867.     Moghunter.ahud_mp_icon_space_y = Number(Moghunter.parameters['MP Icon Space Y'] || 0); 
  868.     Moghunter.ahud_mp_icon_zoomAnime = String(Moghunter.parameters['MP Icon Zoom Anime'] || 'true');   
  869.  
  870.     // TP ICON POSITION
  871.     Moghunter.ahud_tp_icon_visible = String(Moghunter.parameters['TP Icon Visible'] || 'false');
  872.     Moghunter.ahud_tp_icon_halfMode = String(Moghunter.parameters['TP Icon Half Mode'] || 'false');
  873.     Moghunter.ahud_tp_icon_colorMax = Number(Moghunter.parameters['TP Icon Max Colors'] || 2);   
  874.     Moghunter.ahud_tp_icon_rows = Number(Moghunter.parameters['TP Icon Max Rows'] || 10);
  875.     Moghunter.ahud_tp_icon_cols = Number(Moghunter.parameters['TP Icon Max Columns'] || 2);
  876.     Moghunter.ahud_tp_icon_pos_x = Number(Moghunter.parameters['TP Icon X-Axis'] || 143);
  877.     Moghunter.ahud_tp_icon_pos_y = Number(Moghunter.parameters['TP Icon Y-Axis'] || 50);   
  878.     Moghunter.ahud_tp_icon_space_x = Number(Moghunter.parameters['TP Icon Space X'] || 0);
  879.     Moghunter.ahud_tp_icon_space_y = Number(Moghunter.parameters['TP Icon Space Y'] || 0); 
  880.     Moghunter.ahud_tp_icon_zoomAnime = String(Moghunter.parameters['TP Icon Zoom Anime'] || 'true');   
  881.    
  882.     // HP METER POSITION
  883.     Moghunter.ahud_hp_meter_visible = String(Moghunter.parameters['HP Meter Visible'] || true);
  884.     Moghunter.ahud_hp_meter_pos_x = Number(Moghunter.parameters['HP Meter X-Axis'] || 143);
  885.     Moghunter.ahud_hp_meter_pos_y = Number(Moghunter.parameters['HP Meter Y-Axis'] || 85);
  886.     Moghunter.ahud_hp_meter_rotation = Number(Moghunter.parameters['HP Meter Angle'] || 0);
  887.     Moghunter.ahud_hp_meter_flow = String(Moghunter.parameters['HP Meter Flow Anime'] || true);
  888.     Moghunter.ahud_hp_flowSpd = Number(Moghunter.parameters['HP Meter Flow Speed'] || 2);
  889.    
  890.     // HP NUMBER POSITION
  891.     Moghunter.ahud_hp_number_visible  = String(Moghunter.parameters['HP Number Visible'] || true);
  892.     Moghunter.ahud_hp_number_align  = Number(Moghunter.parameters['HP Number Align'] || 0);
  893.     Moghunter.ahud_hp_number_pos_x  = Number(Moghunter.parameters['HP Number X-Axis'] || 270);
  894.     Moghunter.ahud_hp_number_pos_y  = Number(Moghunter.parameters['HP Number Y-Axis'] || 70);
  895.     Moghunter.ahud_maxhp_number_visible  = String(Moghunter.parameters['MaxHP Number Visible'] || false);
  896.     Moghunter.ahud_maxhp_number_pos_x  = Number(Moghunter.parameters['MaxHP Number X-Axis'] || 125);
  897.     Moghunter.ahud_maxhp_number_pos_y  = Number(Moghunter.parameters['MaxHP Number Y-Axis'] || 13);
  898.  
  899.     // MP METER POSITION
  900.     Moghunter.ahud_mp_meter_visible = String(Moghunter.parameters['MP Meter Visible'] || true);
  901.     Moghunter.ahud_mp_meter_pos_x = Number(Moghunter.parameters['MP Meter X-Axis'] || 160);
  902.     Moghunter.ahud_mp_meter_pos_y = Number(Moghunter.parameters['MP Meter Y-Axis'] || 115);
  903.     Moghunter.ahud_mp_meter_rotation = Number(Moghunter.parameters['MP Meter Angle'] || 0);
  904.     Moghunter.ahud_mp_meter_flow = String(Moghunter.parameters['MP Meter Flow Anime'] || true);
  905.     Moghunter.ahud_mp_flowSpd = Number(Moghunter.parameters['MP Meter Flow Speed'] || 2);
  906.    
  907.     // MP NUMBER POSITION
  908.     Moghunter.ahud_mp_number_visible  = String(Moghunter.parameters['MP Number Visible'] || true);
  909.     Moghunter.ahud_mp_number_align  = Number(Moghunter.parameters['MP Number Align'] || 0);
  910.     Moghunter.ahud_mp_number_pos_x  = Number(Moghunter.parameters['MP Number X-Axis'] || 287);
  911.     Moghunter.ahud_mp_number_pos_y  = Number(Moghunter.parameters['MP Number Y-Axis'] || 100);
  912.     Moghunter.ahud_maxmp_number_visible  = String(Moghunter.parameters['MaxMP Number Visible'] || false);
  913.     Moghunter.ahud_maxmp_number_pos_x  = Number(Moghunter.parameters['MaxMP Number X-Axis'] || 196);
  914.     Moghunter.ahud_maxmp_number_pos_y  = Number(Moghunter.parameters['MaxMP Number Y-Axis'] || 78);
  915.  
  916.     // TP METER POSITION
  917.     Moghunter.ahud_tp_meter_visible = String(Moghunter.parameters['TP Meter Visible'] || true);
  918.     Moghunter.ahud_tp_meter_pos_x = Number(Moghunter.parameters['TP Meter X-Axis'] || 143);
  919.     Moghunter.ahud_tp_meter_pos_y = Number(Moghunter.parameters['TP Meter Y-Axis'] || 145);
  920.     Moghunter.ahud_tp_meter_rotation = Number(Moghunter.parameters['TP Meter Angle'] || 0);
  921.     Moghunter.ahud_tp_meter_flow = String(Moghunter.parameters['TP Meter Flow Anime'] || false);
  922.     Moghunter.ahud_tp_flowSpd = Number(Moghunter.parameters['TP Meter Flow Speed'] || 2);
  923.    
  924.     // TP NUMBER POSITION
  925.     Moghunter.ahud_tp_number_visible  = String(Moghunter.parameters['TP Number Visible'] || true);
  926.     Moghunter.ahud_tp_number_align  = Number(Moghunter.parameters['TP Number Align'] || 0);
  927.     Moghunter.ahud_tp_number_pos_x  = Number(Moghunter.parameters['TP Number X-Axis'] || 270);
  928.     Moghunter.ahud_tp_number_pos_y  = Number(Moghunter.parameters['TP Number Y-Axis'] || 130);
  929.     Moghunter.ahud_maxtp_number_visible  = String(Moghunter.parameters['MaxTP Number Visible'] || false);
  930.     Moghunter.ahud_maxtp_number_pos_x  = Number(Moghunter.parameters['MaxTP Number X-Axis'] || 185);
  931.     Moghunter.ahud_maxtp_number_pos_y  = Number(Moghunter.parameters['MaxTP Number Y-Axis'] || 116);   
  932.  
  933.     // Level NUMBER POSITION
  934.     Moghunter.ahud_level_number_visible  = String(Moghunter.parameters['Level Number Visible'] || true);
  935.     Moghunter.ahud_level_number_align  = Number(Moghunter.parameters['Level Number Align'] || 1);  
  936.     Moghunter.ahud_level_number_pos_x  = Number(Moghunter.parameters['Level Number X-Axis'] || 65);
  937.     Moghunter.ahud_level_number_pos_y  = Number(Moghunter.parameters['Level Number Y-Axis'] || 153);
  938.  
  939.     // EXP METER POSITION
  940.     Moghunter.ahud_exp_meter_visible = String(Moghunter.parameters['EXP Meter Visible'] || true);
  941.     Moghunter.ahud_exp_meter_pos_x = Number(Moghunter.parameters['EXP Meter X-Axis'] || 127);
  942.     Moghunter.ahud_exp_meter_pos_y = Number(Moghunter.parameters['EXP Meter Y-Axis'] || 173);  
  943.     Moghunter.ahud_exp_meter_rotation = Number(Moghunter.parameters['EXP Meter Angle'] || 0);
  944.    
  945.     // STATES POSITION
  946.     Moghunter.ahud_states_visible = String(Moghunter.parameters['States Visible'] || true);
  947.     Moghunter.ahud_states_pos_x = Number(Moghunter.parameters['States X-Axis'] || 5);
  948.     Moghunter.ahud_states_pos_y = Number(Moghunter.parameters['States Y-Axis'] || 64); 
  949.  
  950.     Moghunter.ahud_hudvisible = String(Moghunter.parameters['Initial Visible'] || "false");
  951.     Moghunter.ahud_smartFade = String(Moghunter.parameters['Smart Fade'] || "true");   
  952.     Moghunter.ahud_autoFade = String(Moghunter.parameters['Auto Fade'] || "true");
  953.        
  954. //=============================================================================
  955. // ** ImageManager
  956. //=============================================================================
  957.  
  958. //==============================
  959. // * Actor Hud
  960. //==============================
  961. ImageManager.loadAHud = function(filename) {
  962.     return this.loadBitmap('img/actorhud/', filename, 0, true);
  963. };         
  964.  
  965. //=============================================================================
  966. // ** Game_System
  967. //=============================================================================
  968.  
  969. //==============================
  970. // * Initialize
  971. //==============================
  972. var _alias_mog_ahud_sys_initialize = Game_System.prototype.initialize;
  973. Game_System.prototype.initialize = function() {
  974.     _alias_mog_ahud_sys_initialize.call(this);
  975.     this._ahud_position = [0,0];
  976.     this._ahud_visible = String(Moghunter.ahud_hudvisible) === "true" ? true : false;
  977.     this._ahud_smartFade = String(Moghunter.ahud_smartFade) === "true" ? true : false;
  978.     this._ahud_autoFade = String(Moghunter.ahud_autoFade) === "true" ? true : false;
  979.     this._ahud_opacity = 0;
  980.     this._ahud_flowData = [0,0,0];
  981. };
  982.  
  983. //=============================================================================
  984. // ** Game BattlerBase
  985. //=============================================================================
  986.  
  987. //==============================
  988. // * Initialize
  989. //==============================
  990. var _alias_mog_ahud_gbat_initMembers = Game_BattlerBase.prototype.initMembers
  991. Game_BattlerBase.prototype.initMembers = function() {
  992.     _alias_mog_ahud_gbat_initMembers.call(this);
  993.     this._ahud_face_data = [0,0,0,0];
  994. };
  995.  
  996. //=============================================================================
  997. // ** Game Actor
  998. //=============================================================================
  999.  
  1000. //==============================
  1001. // * Current EXP R
  1002. //==============================
  1003. Game_Actor.prototype.current_exp_r = function() {
  1004.     return this.nextLevelExp() - this.nextRequiredExp() - this.expForLevel(this._level);
  1005. };
  1006.  
  1007. //==============================
  1008. // * Next Level EXP R
  1009. //==============================
  1010. Game_Actor.prototype.nextLevelExp_r = function() {
  1011.     return this.expForLevel(this._level + 1) - this.expForLevel(this._level) ;
  1012. };
  1013.  
  1014. //=============================================================================
  1015. // ** Game Character Base
  1016. //=============================================================================
  1017.  
  1018. //==============================
  1019. // * Screen RealX
  1020. //==============================
  1021. Game_CharacterBase.prototype.screen_realX = function() {
  1022.     return this.scrolledX() * $gameMap.tileWidth();
  1023. };
  1024.  
  1025. //==============================
  1026. // * Screen RealY
  1027. //==============================
  1028. Game_CharacterBase.prototype.screen_realY = function() {
  1029.     return this.scrolledY() * $gameMap.tileHeight();
  1030. };
  1031.  
  1032. //=============================================================================
  1033. // ** Game_Interpreter
  1034. //=============================================================================
  1035.  
  1036. //==============================
  1037. // * PluginCommand
  1038. //==============================
  1039. var _alias_mog_actorhud_pluginCommand = Game_Interpreter.prototype.pluginCommand
  1040. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  1041.     _alias_mog_actorhud_pluginCommand.call(this,command, args)
  1042.     if (command === "show_actor_hud")  { $gameSystem._ahud_visible = true};
  1043.     if (command === "hide_actor_hud")  { $gameSystem._ahud_visible = false;};
  1044.     return true;
  1045. };
  1046.  
  1047. //=============================================================================
  1048. // ** Scene Base
  1049. //=============================================================================
  1050.  
  1051. //==============================
  1052. // ** create Hud Field
  1053. //==============================
  1054. Scene_Base.prototype.createHudField = function() {
  1055.     this._hudField = new Sprite();
  1056.     this._hudField.z = 10;
  1057.     this.addChild(this._hudField);
  1058. };
  1059.  
  1060. //==============================
  1061. // ** sort MZ
  1062. //==============================
  1063. Scene_Base.prototype.sortMz = function() {
  1064.    this._hudField.children.sort(function(a, b){return a.mz-b.mz});
  1065. };
  1066.  
  1067. //=============================================================================
  1068. // ** Scene Map
  1069. //=============================================================================
  1070.  
  1071. //==============================
  1072. // ** create Spriteset
  1073. //==============================
  1074. var _mog_actorHud_sMap_createSpriteset = Scene_Map.prototype.createSpriteset;
  1075. Scene_Map.prototype.createSpriteset = function() {
  1076.     _mog_actorHud_sMap_createSpriteset.call(this);
  1077.     if (!this._hudField) {this.createHudField()};
  1078.     this.createActorHud();
  1079.     this.sortMz();
  1080. };
  1081.  
  1082. //==============================
  1083. // * Create Actor Hud
  1084. //==============================
  1085. Scene_Map.prototype.createActorHud = function() {
  1086.     this._actorHud = new Actor_Hud();
  1087.     this._actorHud.mz = 101;
  1088.     this._hudField.addChild(this._actorHud);   
  1089. };
  1090.  
  1091. //=============================================================================
  1092. // * Actor_Hud
  1093. //=============================================================================
  1094. function Actor_Hud() {
  1095.     this.initialize.apply(this, arguments);
  1096. };
  1097.  
  1098. Actor_Hud.prototype = Object.create(Sprite.prototype);
  1099. Actor_Hud.prototype.constructor = Actor_Hud;
  1100.  
  1101. //==============================
  1102. // * Initialize
  1103. //==============================
  1104. Actor_Hud.prototype.initialize = function(hud_id) {
  1105.     Sprite.prototype.initialize.call(this);
  1106.     this.visible = false;  
  1107.     this._data_initial_ref = [0,true];
  1108.     this._hud_id = hud_id;
  1109.     this._hud_size = [-1,-1,-1,-1];
  1110.     this.base_parameter_clear();
  1111.     this.load_img();
  1112.     if (!$gameSystem._ahud_visible) {
  1113.         $gameSystem._ahud_opacity = 0;
  1114.         this.opacity = 0
  1115.     };
  1116.     this.opacity = $gameSystem._ahud_opacity;
  1117.     this.update();
  1118. };
  1119.  
  1120. //==============================
  1121. // * Load Img
  1122. //==============================
  1123. Actor_Hud.prototype.load_img = function() {
  1124.     this._layout_img = ImageManager.loadAHud("Layout");
  1125.     this._state_img = ImageManager.loadSystem("IconSet");
  1126.     if (String(Moghunter.ahud_layout2_visible) == "true") {this._layout2_img = ImageManager.loadAHud("Layout2")};
  1127.     if (String(Moghunter.ahud_hp_meter_visible) == "true") {this._hp_meter_img = ImageManager.loadAHud("HP_Meter")};
  1128.     if (String(Moghunter.ahud_mp_meter_visible) == "true") {this._mp_meter_img = ImageManager.loadAHud("MP_Meter")};
  1129.     if (String(Moghunter.ahud_tp_meter_visible) == "true") {this._tp_meter_img = ImageManager.loadAHud("TP_Meter")};   
  1130.     if (String(Moghunter.ahud_hp_icon_visible) == "true") {this._hp_icon_img = ImageManager.loadAHud("HP_Icon")};
  1131.     if (String(Moghunter.ahud_mp_icon_visible) == "true") {this._mp_icon_img = ImageManager.loadAHud("MP_Icon")};
  1132.     if (String(Moghunter.ahud_tp_icon_visible) == "true") {this._tp_icon_img = ImageManager.loadAHud("TP_Icon")};  
  1133.     if (String(Moghunter.ahud_exp_meter_visible) == "true") {this._exp_meter_img = ImageManager.loadAHud("EXP_Meter")};
  1134.     if (String(Moghunter.ahud_hp_number_visible) == "true") {this._hp_number_img = ImageManager.loadAHud("HP_Number")};
  1135.     if (String(Moghunter.ahud_mp_number_visible) == "true") {this._mp_number_img = ImageManager.loadAHud("MP_Number")};
  1136.     if (String(Moghunter.ahud_tp_number_visible) == "true") {this._tp_number_img = ImageManager.loadAHud("TP_Number")};
  1137.     if (String(Moghunter.ahud_level_number_visible) == "true") {this._level_number_img = ImageManager.loadAHud("LV_Number")};
  1138.     if (String(Moghunter.ahud_maxhp_number_visible) == "true") {this._maxhp_number_img = ImageManager.loadAHud("HP_Number2")};
  1139.     if (String(Moghunter.ahud_maxmp_number_visible) == "true") {this._maxmp_number_img = ImageManager.loadAHud("MP_Number2")};
  1140.     if (String(Moghunter.ahud_maxtp_number_visible) == "true") {this._maxtp_number_img = ImageManager.loadAHud("TP_Number2")}; 
  1141. };
  1142.  
  1143. //==============================
  1144. // * Base Parameter Clear
  1145. //==============================
  1146. Actor_Hud.prototype.base_parameter_clear = function() {
  1147.      this._hp_old = [-1,-1];
  1148.      this._maxhp_old = [-1,-1];
  1149.      this._hp_old_ani = [-1,-1];
  1150.      this._hp_flow = [false,0,0,0];
  1151.      this._mp_old = [-1,-1];
  1152.      this._maxmp_old = [-1,-1];
  1153.      this._mp_old_ani = [-1,-1];
  1154.      this._mp_flow = [false,0,0,0];
  1155.      this._tp_old = [-1,-1];
  1156.      this._maxtp_old = [-1,-1];
  1157.      this._tp_old_ani = -1;
  1158.      this._tp_flow = [false,0,0,0];
  1159.      this._exp_old = [-1,-1];
  1160.      this._exp_flow = [false,0,0,0];   
  1161.      this._hp_number_old = -1;
  1162.      this._mp_number_old = -1;
  1163.      this._hp_number_old = -1;   
  1164.      this._hp_icon_old = [-1,-1];
  1165.      this._mp_icon_old = [-1,-1];
  1166.      this._tp_icon_old = [-1,-1];
  1167.      this._hp_img_data = [0,0,0];
  1168.      this._mp_img_data = [0,0,0];
  1169.      this._tp_img_data = [0,0,0];
  1170.      this._states_old = [];
  1171.      this._states_data = [0,0,0];
  1172.      this._active = false;
  1173.      this._hp_flow_speed = Moghunter.ahud_hp_flowSpd * 0.1;
  1174.      this._mp_flow_speed = Moghunter.ahud_mp_flowSpd * 0.1;
  1175.      this._tp_flow_speed = Moghunter.ahud_tp_flowSpd * 0.1;
  1176.      this._hud_size = [0,0];
  1177. };
  1178.  
  1179. //==============================
  1180. // * Need Refresh Bhud
  1181. //==============================
  1182. Actor_Hud.prototype.need_refreh_bhud = function() {
  1183.     if (this._data_initial_ref[1]) {return true};
  1184.     if (this._battler != $gameParty.members()[0]) {return true};
  1185.     return false;
  1186. };
  1187.  
  1188. //==============================
  1189. // * Refresh Bhud
  1190. //==============================
  1191. Actor_Hud.prototype.refresh_bhud = function() {
  1192.      this._data_initial_ref[1] = false;
  1193.      this._battler = $gameParty.members()[0];
  1194.      this._hud_size = [0,0];
  1195.      this.base_parameter_clear();
  1196.      this.create_base_sprites();
  1197. };
  1198.  
  1199. //==============================
  1200. // * Refresh Position
  1201. //==============================
  1202. Actor_Hud.prototype.refresh_position = function() {
  1203.      this.set_hud_position();    
  1204.      this.visible = true;    
  1205.      this.create_sprites();
  1206.      this._layout.x = this._pos_x;
  1207.      this._layout.y = this._pos_y;
  1208.      if (this._face) {
  1209.          this._face.x = this._pos_x + Moghunter.ahud_face_pos_x;
  1210.          this._face.y = this._pos_y + Moghunter.ahud_face_pos_y;
  1211.          this._battler._face_pos = [this._face.x,this._face.y];
  1212.      };
  1213. };
  1214.  
  1215. //==============================
  1216. // * Set Hud Position
  1217. //==============================
  1218. Actor_Hud.prototype.set_hud_position = function() {
  1219.      this._hud_size[0] = Moghunter.ahud_pos_x - ($gameMap.tileWidth() / 2);
  1220.      this._hud_size[1] = Moghunter.ahud_pos_y - ($gameMap.tileHeight() / 2);
  1221.      this._hud_size[2] = Moghunter.ahud_pos_x + this._layout.bitmap.width - $gameMap.tileWidth();
  1222.      this._hud_size[3] = Moghunter.ahud_pos_y + this._layout.bitmap.height;  
  1223.      this._pos_x = Moghunter.ahud_pos_x;
  1224.      this._pos_y = Moghunter.ahud_pos_y;
  1225. };
  1226.  
  1227. //==============================
  1228. // * Update
  1229. //==============================
  1230. Actor_Hud.prototype.update = function() {
  1231.     Sprite.prototype.update.call(this);
  1232.     if (this.need_refreh_bhud()) {this.refresh_bhud()};
  1233.     if (!this._battler) {this.visible = false;return};
  1234.     if (!this._layout_img.isReady()) {return};
  1235.     if (this._hud_size[0] === 0) {this.refresh_position();return};
  1236.     this.update_sprites();
  1237. };
  1238.  
  1239. //==============================
  1240. // * Create Base Sprites
  1241. //==============================
  1242. Actor_Hud.prototype.create_base_sprites = function() {
  1243.     if (Number(Moghunter.ahud_face_priority) === 0) {
  1244.         this.create_face();
  1245.         this.create_layout();}
  1246.     else {
  1247.         this.create_layout();
  1248.         this.create_face();            
  1249.     };
  1250. };
  1251.  
  1252. //==============================
  1253. // * Create Sprites
  1254. //==============================
  1255. Actor_Hud.prototype.create_sprites = function() {
  1256.     this.create_hp_meter();
  1257.     this.create_mp_meter();
  1258.     this.create_tp_meter();
  1259.     this.create_hp_icon();
  1260.     this.create_mp_icon();
  1261.     this.create_tp_icon();
  1262.     this.create_exp_meter();
  1263.     if (this._layout2_img) {this.create_layout2()};
  1264.     this.create_hp_number();
  1265.     this.create_maxhp_number();
  1266.     this.create_mp_number();   
  1267.     this.create_maxmp_number();
  1268.     this.create_tp_number();
  1269.     this.create_level_number();
  1270.     this.create_maxtp_number();
  1271.     this.create_states();  
  1272.     this.create_name();
  1273. };
  1274.  
  1275. //==============================
  1276. // * Update Sprites
  1277. //==============================
  1278. Actor_Hud.prototype.update_sprites = function() {  
  1279.     this.update_visible();
  1280.     this.update_face();
  1281.     this.update_hp();
  1282.     this.update_mp();
  1283.     this.update_tp();
  1284.     this.update_states();
  1285.     this.update_exp();
  1286. };
  1287.  
  1288. //==============================
  1289. // * Need Hide
  1290. //==============================
  1291. Actor_Hud.prototype.needHide = function(start) {
  1292.     if (Imported.MOG_ChronoEngine && $gameSystem.isChronoMode()) {return true};
  1293.     if (!this._battler) {return true}; 
  1294.     if (!$gameSystem._ahud_visible) {return true};
  1295.     if (!$gameSystem._ahud_autoFade) {return false};
  1296.     if ($gameMessage.isBusy()) {return true};
  1297.     return false
  1298. };
  1299.  
  1300. //==============================
  1301. // * Update visible
  1302. //==============================
  1303. Actor_Hud.prototype.update_visible = function() {
  1304.      this.visible = true;
  1305.      if (this.needHide(false)) {
  1306.          this.opacity -= 15;
  1307.      } else {          
  1308.         if (this.needFade()) {
  1309.             if (this.opacity > Moghunter.ahud_fade_limit) {
  1310.                 this.opacity -= 10;
  1311.                 if (this.opacity < Moghunter.ahud_fade_limit) {this.opacity = Moghunter.ahud_fade_limit};
  1312.              };
  1313.         } else {
  1314.                  this.opacity += 10;
  1315.         };     
  1316.      };
  1317.      $gameSystem._ahud_opacity = this.opacity;
  1318. };
  1319.  
  1320. //==============================
  1321. // * Need Fade
  1322. //==============================
  1323. Actor_Hud.prototype.needFade = function() {
  1324.     if (this._hud_size[0] === -1) {return false};
  1325.     if (!this._battler) {return false};
  1326.     if (!$gameSystem._ahud_smartFade) {return false};
  1327.     if ($gamePlayer.screen_realX() < this._hud_size[0]) {return false};
  1328.     if ($gamePlayer.screen_realX() > this._hud_size[2]) {return false};
  1329.     if ($gamePlayer.screen_realY() < this._hud_size[1]) {return false};
  1330.     if ($gamePlayer.screen_realY() > this._hud_size[3]) {return false};
  1331.     return true;
  1332. };
  1333.  
  1334.  
  1335. //==============================
  1336. // * Update Dif
  1337. //==============================
  1338. Actor_Hud.prototype.update_dif = function(value,real_value,speed) {
  1339.     if (value == real_value) {return value};
  1340.     var dnspeed = 1 + (Math.abs(value - real_value) / speed);
  1341.     if (value > real_value) {value -= dnspeed;
  1342.         if (value < real_value) {value = real_value};}
  1343.     else if (value < real_value) {value  += dnspeed;
  1344.         if (value  > real_value) {value  = real_value};    
  1345.     };
  1346.     return Math.floor(value);
  1347. };
  1348.  
  1349. //==============================
  1350. // * Refresh Meter
  1351. //==============================
  1352. Actor_Hud.prototype.refresh_meter = function(sprite,value,value_max,type,div) {
  1353.     var ch = sprite.bitmap.height / div;
  1354.     var meter_rate = sprite.bitmap.width * value / value_max;
  1355.     sprite.setFrame(0,type * ch, meter_rate, ch);
  1356. };
  1357.  
  1358. //==============================
  1359. // * Refresh Flow
  1360. //==============================
  1361. Actor_Hud.prototype.refresh_meter_flow = function(sprite,value,value_max,type,flow) {
  1362.     var cw = sprite.bitmap.width / 3;
  1363.     var ch = sprite.bitmap.height / 2;
  1364.     var meter_rate = cw * value / value_max;
  1365.     sprite.setFrame(flow,type * ch, meter_rate, ch);
  1366. };
  1367.  
  1368. //==============================
  1369. // * Refresh Number
  1370. //==============================
  1371. Actor_Hud.prototype.refresh_number = function(sprites,value,img_data,x,center) {
  1372.     numbers = Math.abs(value).toString().split("");  
  1373.     for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
  1374.        if (i > numbers.length) {return};
  1375.        var n = Number(numbers[i]);
  1376.        sprites[i].setFrame(n * img_data[2], 0, img_data[2], img_data[1]);
  1377.        sprites[i].visible = true;
  1378.        var nx = -(img_data[2] * i) + (img_data[2] * numbers.length);
  1379.        if (sprites.align === 1) {
  1380.           var xi = (img_data[2] * numbers.length) / 2;         
  1381.            sprites[i].x = x + xi - nx;
  1382.        } else if (sprites.align === 2) {
  1383.            var xi = img_data[2] * numbers.length;          
  1384.            sprites[i].x = x + xi - nx;
  1385.        } else {
  1386.            sprites[i].x = x - nx;
  1387.        };
  1388.     };
  1389. };
  1390.  
  1391. //==============================
  1392. // * Need Refresh Parameter
  1393. //==============================
  1394. Actor_Hud.prototype.need_refresh_parameter = function(parameter) {
  1395.   switch (parameter) {
  1396.     case 0:
  1397.          if (this._hp_old[0] != this._battler.hp) {return true};
  1398.          if (this._hp_old[1] != this._battler.mhp) {return true};
  1399.          break;
  1400.     case 1:
  1401.          if (this._mp_old[0] != this._battler.mp) {return true};
  1402.          if (this._mp_old[1] != this._battler.mmp) {return true};
  1403.          break;        
  1404.     case 2:
  1405.          if (this._tp_old[0] != this._battler.tp) {return true};         
  1406.          if (this._tp_old[1] != this._battler.maxTp()) {return true};
  1407.          break;
  1408.     case 3:
  1409.          if (this._exp_old != this._battler.currentExp()) {return true};
  1410.          break;                        
  1411.   };
  1412.   return false;
  1413. };
  1414.  
  1415. //==============================
  1416. // * Create Layout
  1417. //==============================
  1418. Actor_Hud.prototype.create_layout = function() {
  1419.     this.removeChild(this._layout);
  1420.     if (!this._battler) {return};
  1421.     this._layout = new Sprite(this._layout_img);
  1422.     this.addChild(this._layout);
  1423. };
  1424.  
  1425. //==============================
  1426. // * Create Layout 2
  1427. //==============================
  1428. Actor_Hud.prototype.create_layout2 = function() {
  1429.     this.removeChild(this._layout2);
  1430.     if (!this._battler) {return};
  1431.     this._layout2 = new Sprite(this._layout2_img);
  1432.     this._layout2.x = Moghunter.ahud_layout2_x;
  1433.     this._layout2.y = Moghunter.ahud_layout2_y;
  1434.     this.addChild(this._layout2);
  1435. };
  1436.    
  1437. //==============================
  1438. // * Create Face
  1439. //==============================
  1440. Actor_Hud.prototype.create_face = function() {
  1441.     if (String(Moghunter.ahud_face_visible) != "true") {return};
  1442.     this.removeChild(this._face);
  1443.     if (!this._battler) {return};  
  1444.     this._face = new Sprite(ImageManager.loadAHud("Face_" + this._battler._actorId));
  1445.     this._face.anchor.x = 0.5;
  1446.     this._face.anchor.y = 0.5;
  1447.     this._face_data = [0,0,false,false,false,-1];
  1448.     if (String(Moghunter.ahud_face_shake) === "true") {this._face_data[2] = true}
  1449.     if (String(Moghunter.ahud_face_animated) === "true") {this._face_data[4] = true}
  1450.     this._battler._ahud_face_data = [0,0,0,0]
  1451.     this.addChild(this._face);
  1452. };
  1453.  
  1454. //==============================
  1455. // * Update Face
  1456. //==============================
  1457. Actor_Hud.prototype.update_face = function() {
  1458.     if (!this._face) {return};
  1459.     if (!this._face.bitmap.isReady()) {return};
  1460.     if (this._face_data[4] && this._face_data[5] != this._battler._ahud_face_data[2]) {this.refresh_face();};
  1461.     this.update_face_animation();
  1462.     this.update_face_shake();
  1463.     this.update_face_zoom();
  1464. };
  1465.  
  1466. //==============================
  1467. // * Refresh Face
  1468. //==============================
  1469. Actor_Hud.prototype.refresh_face = function() {
  1470.     this._face_data[5] = this._battler._ahud_face_data[2];
  1471.     var cw = this._face.bitmap.width / 5;
  1472.     var ch = this._face.bitmap.height;
  1473.     this._face.setFrame(cw * this._face_data[5], 0, cw, ch);
  1474. };
  1475.  
  1476. //==============================
  1477. // * Update Face Animation
  1478. //==============================
  1479. Actor_Hud.prototype.update_face_animation = function() {
  1480.     if (this._battler._ahud_face_data[3] > 0) {this._battler._ahud_face_data[3] -= 1;
  1481.         if (this._battler._ahud_face_data[3] === 0) {
  1482.             if (this._battler.isDead()) {this._battler._ahud_face_data[2] = 4}
  1483.             else if (this._battler.hp <= 30 * this._battler.mhp / 100) {this._battler._ahud_face_data[2] = 3}
  1484.             else {this._battler._ahud_face_data[2] = 0};
  1485.             };
  1486.     };
  1487. };
  1488.  
  1489. //==============================
  1490. // * Update Face Zoom
  1491. //==============================
  1492. Actor_Hud.prototype.update_face_zoom = function() {
  1493.     if (this._battler._ahud_face_data[1] > 0) {this._battler._ahud_face_data[1] -= 1;
  1494.         if (this._battler._ahud_face_data[1] == 0) {this._face.scale.x = 1.00}
  1495.         else if (this._battler._ahud_face_data[1] < 20) {this._face.scale.x -= 0.01;
  1496.                  if (this._face.scale.x < 1.00) {this._face.scale.x = 1.00;};  
  1497.         }
  1498.         else if (this._battler._ahud_face_data[1] < 40){this._face.scale.x += 0.01;
  1499.                  if (this._face.scale.x > 1.25) {this._face.scale.x = 1.25;};
  1500.         };
  1501.         this._face.scale.y = this._face.scale.x;
  1502.     };
  1503. };
  1504.  
  1505. //==============================
  1506. // * Update Face Shake
  1507. //==============================
  1508. Actor_Hud.prototype.update_face_shake = function() {
  1509.     this._face.x = this._pos_x + Moghunter.ahud_face_pos_x;
  1510.     if (this._face_data[2] && this._battler._ahud_face_data[0] > 0) {this._battler._ahud_face_data[0] -= 1;
  1511.         this._face.x = this._pos_x + Moghunter.ahud_face_pos_x + ((Math.random() * 12) - 6);
  1512.     };
  1513. };
  1514.  
  1515. //==============================
  1516. // * Create Name
  1517. //==============================
  1518. Actor_Hud.prototype.create_name = function() {
  1519.     if (String(Moghunter.ahud_name_visible) != "true") {return};
  1520.     this.removeChild(this._name);
  1521.     if (!this._battler) {return};  
  1522.     this._name = new Sprite(new Bitmap(300,48));
  1523.     this._name.x = this._pos_x + Moghunter.ahud_name_pos_x;
  1524.     this._name.y = this._pos_y + Moghunter.ahud_name_pos_y;
  1525.     this._name.bitmap.fontSize = Number(Moghunter.ahud_name_font_size);
  1526.     if (String(Moghunter.ahud_name_font_italic) === "true") {this._name.bitmap.fontItalic = true};
  1527.     this._name.bitmap.outlineWidth = Number(Moghunter.ahud_name_font_bold_size);
  1528.     this.addChild(this._name); 
  1529.     this.refresh_name();
  1530. };
  1531.  
  1532. //==============================
  1533. // * Refresh Name
  1534. //==============================
  1535. Actor_Hud.prototype.refresh_name = function() {
  1536.     this._name.bitmap.clear();
  1537.     this._name.bitmap.drawText(this._battler._name, 0, 0, this._name.bitmap.width, this._name.bitmap.height,0);
  1538. };
  1539.  
  1540. //==============================
  1541. // * Create HP Meter
  1542. //==============================
  1543. Actor_Hud.prototype.create_hp_meter = function() {
  1544.     if (String(Moghunter.ahud_hp_meter_visible) != "true") {return};
  1545.     this.removeChild(this._hp_meter_blue);
  1546.     this.removeChild(this._hp_meter_red);
  1547.     if (!this._battler) {return};
  1548.     this._hp_meter_red = new Sprite(this._hp_meter_img);
  1549.     this._hp_meter_red.x = this._pos_x + Moghunter.ahud_hp_meter_pos_x;
  1550.     this._hp_meter_red.y = this._pos_y + Moghunter.ahud_hp_meter_pos_y;
  1551.     this._hp_meter_red.rotation = Moghunter.ahud_hp_meter_rotation * Math.PI / 180;
  1552.     this._hp_meter_red.setFrame(0,0,0,0);
  1553.     this.addChild(this._hp_meter_red);     
  1554.     this._hp_meter_blue = new Sprite(this._hp_meter_img);
  1555.     this._hp_meter_blue.x = this._hp_meter_red.x;
  1556.     this._hp_meter_blue.y = this._hp_meter_red.y;
  1557.     this._hp_meter_blue.rotation = this._hp_meter_red.rotation * Math.PI / 180;
  1558.     this._hp_meter_blue.setFrame(0,0,0,0);
  1559.     this.addChild(this._hp_meter_blue);
  1560.     this._hp_old_ani[0] = this._battler.hp - 1;
  1561.     if (String(Moghunter.ahud_hp_meter_flow) === "true") {this._hp_flow[0] = true;
  1562.         this._hp_flow[2] = this._hp_meter_img.width / 3;
  1563.         this._hp_flow[3] = this._hp_flow[2] * 2;
  1564.         this._hp_flow[1] = Math.floor(Math.random() * this._hp_flow[2]);
  1565.     };
  1566. };
  1567.  
  1568. //==============================
  1569. // * Create HP icon
  1570. //==============================
  1571. Actor_Hud.prototype.create_hp_icon = function() {
  1572.    if (String(Moghunter.ahud_hp_icon_visible) != "true") {return};
  1573.     if (this._hp_icons) {
  1574.         for (var i = 0; i < this._hp_icons.length; i++) {
  1575.             this.removeChild(this._hp_icons[i]);
  1576.         };
  1577.         for (var i = 0; i < this._hp_iconsB.length; i++) {
  1578.             this.removeChild(this._hp_iconsB[i]);
  1579.         };
  1580.     }; 
  1581.     if (!this._battler) {return};  
  1582.     var n_icons = Moghunter.ahud_hp_icon_rows * Moghunter.ahud_hp_icon_cols;
  1583.     this._hp_icons = [];
  1584.     this._hp_icons.iconMode = String(Moghunter.ahud_hp_icon_halfMode) == "true" ? true : false;
  1585.     this._hp_iconsB = [];
  1586.  
  1587.     this._hp_iconsB.iconMode = this._hp_icons.iconMode;
  1588.     this._hp_IconZoomAnime = String(Moghunter.ahud_hp_icon_zoomAnime) == "true" ? true : false;
  1589.     var colors = Math.max(Moghunter.ahud_hp_icon_colorMax, 2)
  1590.     var cw = this._hp_icon_img.width / colors;
  1591.     var ch = this._hp_icon_img.height / 2;
  1592.     for (var i = 0; i < n_icons; i++) {
  1593.          this._hp_iconsB[i] = new Sprite(this._hp_icon_img);
  1594.          this._hp_iconsB[i].colorMax = colors;
  1595.          this._hp_iconsB[i].anchor.x = 0.5;
  1596.          this._hp_iconsB[i].anchor.y = 0.5;
  1597.          this._hp_iconsB[i].rows = Moghunter.ahud_hp_icon_rows;
  1598.          this._hp_iconsB[i].cols = Moghunter.ahud_hp_icon_cols;
  1599.          this._hp_iconsB[i].org = [this._pos_x + Moghunter.ahud_hp_icon_pos_x - cw,this._pos_y + Moghunter.ahud_hp_icon_pos_y - ch];
  1600.          this._hp_iconsB[i].spc = [Moghunter.ahud_hp_icon_space_x,Moghunter.ahud_hp_icon_space_y];
  1601.          this._hp_iconsB[i].zoomA = this._hp_IconZoomAnime;
  1602.          this._hp_iconsB[i].zoomData = [0,0,0,1.00];
  1603.          this._hp_iconsB[i].visible = false;
  1604.          this._hp_iconsB[i].enabled = false;
  1605.          this.addChild(this._hp_iconsB[i]);
  1606.     };     
  1607.     for (var i = 0; i < n_icons; i++) {
  1608.          this._hp_icons[i] = new Sprite(this._hp_icon_img);
  1609.          this._hp_icons[i].colorMax = Math.max(Moghunter.ahud_hp_icon_colorMax, 2);
  1610.          this._hp_icons[i].anchor.x = 0.5;
  1611.          this._hp_icons[i].anchor.y = 0.5;       
  1612.          this._hp_icons[i].rows = Moghunter.ahud_hp_icon_rows;
  1613.          this._hp_icons[i].cols = Moghunter.ahud_hp_icon_cols;
  1614.          this._hp_icons[i].org = [this._pos_x + Moghunter.ahud_hp_icon_pos_x - cw,this._pos_y + Moghunter.ahud_hp_icon_pos_y - ch];
  1615.          this._hp_icons[i].spc = [Moghunter.ahud_hp_icon_space_x,Moghunter.ahud_hp_icon_space_y];
  1616.          this._hp_icons[i].zoomA = this._hp_IconZoomAnime;
  1617.          this._hp_icons[i].zoomData = [0,0,0,1.00];  
  1618.          this._hp_icons[i].visible = false;
  1619.          this._hp_icons[i].enabled = false;
  1620.          this.addChild(this._hp_icons[i]);
  1621.     };
  1622. };
  1623.  
  1624. //==============================
  1625. // * Create MP icon
  1626. //==============================
  1627. Actor_Hud.prototype.create_mp_icon = function() {
  1628.    if (String(Moghunter.ahud_mp_icon_visible) != "true") {return};
  1629.     if (this._mp_icons) {
  1630.         for (var i = 0; i < this._mp_icons.length; i++) {
  1631.             this.removeChild(this._mp_icons[i]);
  1632.         };
  1633.         for (var i = 0; i < this._mp_iconsB.length; i++) {
  1634.             this.removeChild(this._mp_iconsB[i]);
  1635.         };
  1636.     }; 
  1637.     if (!this._battler) {return};  
  1638.     var n_icons = Moghunter.ahud_mp_icon_rows * Moghunter.ahud_mp_icon_cols;
  1639.     this._mp_icons = [];
  1640.     this._mp_icons.iconMode = String(Moghunter.ahud_mp_icon_halfMode) == "true" ? true : false;
  1641.     this._mp_iconsB = [];
  1642.     this._mp_iconsB.iconMode = 0;
  1643.     this._mp_IconZoomAnime = String(Moghunter.ahud_mp_icon_zoomAnime) == "true" ? true : false
  1644.     var colors = Math.max(Moghunter.ahud_mp_icon_colorMax, 2);
  1645.     var cw = this._mp_icon_img.width / colors;
  1646.     var ch = this._mp_icon_img.height / 2;
  1647.     for (var i = 0; i < n_icons; i++) {
  1648.          this._mp_iconsB[i] = new Sprite(this._mp_icon_img);
  1649.          this._mp_iconsB[i].colorMax = colors;
  1650.          this._mp_iconsB[i].anchor.x = 0.5;
  1651.          this._mp_iconsB[i].anchor.y = 0.5;
  1652.          this._mp_iconsB[i].rows = Moghunter.ahud_mp_icon_rows;
  1653.          this._mp_iconsB[i].cols = Moghunter.ahud_mp_icon_cols;
  1654.          this._mp_iconsB[i].org = [this._pos_x + Moghunter.ahud_mp_icon_pos_x - cw,this._pos_y + Moghunter.ahud_mp_icon_pos_y - ch];
  1655.          this._mp_iconsB[i].spc = [Moghunter.ahud_mp_icon_space_x,Moghunter.ahud_mp_icon_space_y];
  1656.          this._mp_iconsB[i].zoomA = this._mp_IconZoomAnime;
  1657.          this._mp_iconsB[i].zoomData = [0,0,0,1.00];
  1658.          this._mp_iconsB[i].visible = false;
  1659.          this._mp_iconsB[i].enabled = false;
  1660.          this.addChild(this._mp_iconsB[i]);
  1661.     };     
  1662.     for (var i = 0; i < n_icons; i++) {
  1663.          this._mp_icons[i] = new Sprite(this._mp_icon_img);
  1664.          this._mp_icons[i].colorMax = Math.max(Moghunter.ahud_mp_icon_colorMax, 2);
  1665.          this._mp_icons[i].anchor.x = 0.5;
  1666.          this._mp_icons[i].anchor.y = 0.5;       
  1667.          this._mp_icons[i].rows = Moghunter.ahud_mp_icon_rows;
  1668.  
  1669.          this._mp_icons[i].cols = Moghunter.ahud_mp_icon_cols;
  1670.          this._mp_icons[i].org = [this._pos_x + Moghunter.ahud_mp_icon_pos_x - cw,this._pos_y + Moghunter.ahud_mp_icon_pos_y - ch];
  1671.          this._mp_icons[i].spc = [Moghunter.ahud_mp_icon_space_x,Moghunter.ahud_mp_icon_space_y];
  1672.          this._mp_icons[i].zoomA = this._mp_IconZoomAnime;
  1673.          this._mp_icons[i].zoomData = [0,0,0,1.00];  
  1674.          this._mp_icons[i].visible = false;
  1675.          this._mp_icons[i].enabled = false;
  1676.          this.addChild(this._mp_icons[i]);
  1677.     }; 
  1678. };
  1679.  
  1680. //==============================
  1681. // * Create TP icon
  1682. //==============================
  1683. Actor_Hud.prototype.create_tp_icon = function() {
  1684.    if (String(Moghunter.ahud_tp_icon_visible) != "true") {return};
  1685.     if (this._tp_icons) {
  1686.         for (var i = 0; i < this._tp_icons.length; i++) {
  1687.             this.removeChild(this._tp_icons[i]);
  1688.         };
  1689.         for (var i = 0; i < this._tp_iconsB.length; i++) {
  1690.             this.removeChild(this._tp_iconsB[i]);
  1691.         };
  1692.     }; 
  1693.     if (!this._battler) {return};  
  1694.     var n_icons = Moghunter.ahud_tp_icon_rows * Moghunter.ahud_tp_icon_cols;
  1695.     this._tp_icons = [];
  1696.     this._tp_icons.iconMode = String(Moghunter.ahud_tp_icon_halfMode) == "true" ? true : false;
  1697.     this._tp_iconsB = [];
  1698.     this._tp_iconsB.iconMode = this._tp_icons.iconMode;
  1699.     this._tp_IconZoomAnime = String(Moghunter.ahud_tp_icon_zoomAnime) == "true" ? true : false;
  1700.     var colors = Math.max(Moghunter.ahud_tp_icon_colorMax, 2);
  1701.     var cw = this._tp_icon_img.width / colors;
  1702.     var ch = this._tp_icon_img.height / 2;
  1703.     for (var i = 0; i < n_icons; i++) {
  1704.          this._tp_iconsB[i] = new Sprite(this._tp_icon_img);
  1705.          this._tp_iconsB[i].colorMax = colors;
  1706.          this._tp_iconsB[i].anchor.x = 0.5;
  1707.          this._tp_iconsB[i].anchor.y = 0.5;
  1708.          this._tp_iconsB[i].rows = Moghunter.ahud_tp_icon_rows;
  1709.          this._tp_iconsB[i].cols = Moghunter.ahud_tp_icon_cols;
  1710.          this._tp_iconsB[i].org = [this._pos_x + Moghunter.ahud_tp_icon_pos_x - cw,this._pos_y + Moghunter.ahud_tp_icon_pos_y - ch];
  1711.          this._tp_iconsB[i].spc = [Moghunter.ahud_tp_icon_space_x,Moghunter.ahud_tp_icon_space_y];
  1712.          this._tp_iconsB[i].zoomA = this._tp_IconZoomAnime;
  1713.          this._tp_iconsB[i].zoomData = [0,0,0,1.00];
  1714.          this._tp_iconsB[i].visible = false;
  1715.          this._tp_iconsB[i].enabled = false;
  1716.          this.addChild(this._tp_iconsB[i]);
  1717.     };     
  1718.     for (var i = 0; i < n_icons; i++) {
  1719.          this._tp_icons[i] = new Sprite(this._tp_icon_img);
  1720.          this._tp_icons[i].colorMax = Math.max(Moghunter.ahud_tp_icon_colorMax, 2);
  1721.          this._tp_icons[i].anchor.x = 0.5;
  1722.          this._tp_icons[i].anchor.y = 0.5;       
  1723.          this._tp_icons[i].rows = Moghunter.ahud_tp_icon_rows;
  1724.          this._tp_icons[i].cols = Moghunter.ahud_tp_icon_cols;
  1725.          this._tp_icons[i].org = [this._pos_x + Moghunter.ahud_tp_icon_pos_x - cw,this._pos_y + Moghunter.ahud_tp_icon_pos_y - ch];
  1726.          this._tp_icons[i].spc = [Moghunter.ahud_tp_icon_space_x,Moghunter.ahud_tp_icon_space_y];
  1727.          this._tp_icons[i].zoomA = this._tp_IconZoomAnime;
  1728.          this._tp_icons[i].zoomData = [0,0,0,1.00];  
  1729.          this._tp_icons[i].visible = false;
  1730.          this._tp_icons[i].enabled = false;
  1731.          this.addChild(this._tp_icons[i]);
  1732.     };     
  1733. };
  1734.  
  1735.  
  1736. //==============================
  1737. // * setFrameIcon
  1738. //==============================
  1739. Actor_Hud.prototype.setFrameIcon = function(icon,image,i,hp,cw,ch) {   
  1740.     var sX = cw + 2 + icon.spc[0];
  1741.     var sY = ch + 2 + icon.spc[1];
  1742.     var lX = sX * icon.rows;
  1743.     var lines = Math.floor(i / icon.rows);
  1744.     icon.scale.y = icon.scale.x;
  1745.     icon.setFrame(hp,0,cw,ch);
  1746.     icon.x = icon.org[0] + (sX * i) - (lX * lines);
  1747.     icon.y = icon.org[1] + (sY * lines);
  1748. };
  1749.  
  1750. //==============================
  1751. // * is Icon Visible
  1752. //==============================
  1753. Actor_Hud.prototype.isIconVisible = function(i,mode,par,par_max,realvalue,isMaxValue,colorIndex,colorIndex2,realvalue2,icon,maxvalue) {
  1754.     icon.opacity = 255;
  1755.     icon.blendMode = 0;
  1756.     if (mode === 0) {
  1757.         if (i >= par_max) {return false};
  1758.         return true;
  1759.     };
  1760.     if (par === 0) {return false};
  1761.     if (par > maxvalue) {
  1762.         icon.opacity = 155;
  1763.         icon.blendMode = 1;
  1764.         return true;
  1765.     };
  1766.     if (isMaxValue) {return true};
  1767.     if (colorIndex > 0 && colorIndex2 >= colorIndex) {
  1768.         icon.opacity = i >= realvalue ? 0 : 255;
  1769.         icon.blendMode = i >= realvalue ? 1 : 0;
  1770.         if (colorIndex2 > colorIndex) {return true};
  1771.         if (i >= realvalue2) {return false};
  1772.     } else {
  1773.       if (i >= realvalue) {return false};
  1774.     };
  1775.     return true;
  1776. };
  1777.  
  1778. //==============================
  1779. // * set Color Index
  1780. //==============================
  1781. Actor_Hud.prototype.setColorIndex = function(i,mode,par,par_max,realvalue,isMaxValue,colorIndex,colorMax,maxvalue) {   
  1782.      if (par === 0) {return 0};
  1783.      if (colorIndex >= colorMax || par > maxvalue) {return colorMax - 1}
  1784.      if (mode === 0) {return colorIndex};
  1785.      if (mode === 1) {
  1786.          if (realvalue === 0) {return colorIndex};
  1787.          return colorIndex + 1;
  1788.      };
  1789.      return 0;
  1790. };
  1791.  
  1792. //==============================
  1793. // * is Icon Enabled
  1794. //==============================
  1795. Actor_Hud.prototype.isIconEnabled = function(i,mode,par,par_max,realvalue,iconMax,colorIndex,colorMax,maxvalue) {  
  1796.      if (mode === 0) {return false};
  1797.      if (par === 0) {return false};
  1798.      if (colorIndex >= colorMax || par > maxvalue) {return true}
  1799.      if (realvalue != 0 && i === (realvalue - 1)) {return true};
  1800.      if (realvalue === 0 && i === (iconMax - 1)) {return true};
  1801.      return false
  1802. };
  1803.  
  1804. //==============================
  1805. // * refresh Icons
  1806. //==============================
  1807. Actor_Hud.prototype.refresh_icons = function(sprites,image,par,par_max,mode) { 
  1808.     if (sprites.iconMode) {
  1809.         this.refreshIconHalfMode(sprites,image,par,par_max,mode);
  1810.     } else {
  1811.         this.refreshIconNormalMode(sprites,image,par,par_max,mode);
  1812.     };
  1813. };
  1814.  
  1815. //==============================
  1816. // * refresh Icon Normal Mode
  1817. //==============================
  1818. Actor_Hud.prototype.refreshIconNormalMode = function(sprites,image,par,par_max,mode) { 
  1819.     for (var i = 0; i < sprites.length; i++) {
  1820.        var icon = sprites[i];
  1821.        var cw = image.width / icon.colorMax;
  1822.        var ch = image.height;      
  1823.        var iconMax = icon.rows;
  1824.        var colorIndex = Math.floor(par / iconMax);
  1825.        var colorMax = icon.colorMax;
  1826.        var avaliableValue = Math.floor(colorIndex * iconMax)
  1827.        var realvalue = par - avaliableValue;
  1828.        var isMaxValue = par === avaliableValue ? true : false;
  1829.        var colorIndex2 = Math.floor(par_max / iconMax);
  1830.        var avaliableValue2 = Math.floor(colorIndex2 * iconMax)
  1831.        var realvalue2 = par_max - avaliableValue2;
  1832.        var maxvalue = iconMax * (colorMax - 1);
  1833.        var hp = cw * this.setColorIndex(i,mode,par,par_max,realvalue,isMaxValue,colorIndex,colorMax,maxvalue);
  1834.        icon.visible = this.isIconVisible(i,mode,par,par_max,realvalue,isMaxValue,colorIndex,colorIndex2,realvalue2,icon,maxvalue);
  1835.        icon.enable = this.isIconEnabled(i,mode,par,par_max,realvalue,iconMax,colorIndex,colorMax,maxvalue);
  1836.        icon.scale.x = 1.00;
  1837.        icon.zoomData = [0,0,0,icon.scale.x];
  1838.        this.setFrameIcon(icon,image,i,hp,cw,ch);
  1839.     };
  1840. };
  1841.  
  1842. //==============================
  1843. // * refresh Icon Half Mode
  1844. //==============================
  1845. Actor_Hud.prototype.refreshIconHalfMode = function(sprites,image,par,par_max,mode) {   
  1846.     var halfpar = Math.floor(par / 2);
  1847.     var parOdd1 = par%2;
  1848.     var parOdd2 = parOdd1 == 0 ? true : false;
  1849.     var prepar = par;
  1850.     par = sprites.iconMode ? (halfpar + parOdd1) : par;
  1851.     var prepar2 = par;
  1852.     var halfmaxpar = Math.floor(par_max / 2);
  1853.     var parmaxOdd1 = par_max%2;
  1854.     var parmaxOdd2 = parmaxOdd1 == 0 ? true : false;
  1855.     var preparmax = par_max;
  1856.     par_max = sprites.iconMode ? (halfmaxpar + parmaxOdd1) : par_max;
  1857.     var preparmax2 = par_max;  
  1858.     if (mode === 1 && par > sprites.length) {
  1859.  
  1860.             var mx_g = Math.floor(par / sprites.length);
  1861.             var mx_l = sprites.length * mx_g;
  1862.             var par = par - mx_l;
  1863.             if (par === 0) {par = sprites.length};
  1864.     };
  1865.     for (var i = 0; i < sprites.length; i++) {
  1866.         var icon = sprites[i];
  1867.         icon.visible = false;
  1868.         icon.opacity = 255;
  1869.         icon.enable = (prepar2 > 0 && i === (prepar2 - 1) && mode === 1) ? true : false;
  1870.         var cw = image.width / icon.colorMax;
  1871.         var ch = image.height;
  1872.         if (par > 0 && icon.colorMax > 2) {
  1873.             var lines  = Math.floor((prepar - 1) / sprites.length) + 1;
  1874.             if (lines >= icon.colorMax - 1) {
  1875.                 var hp = (icon.colorMax - 1) * cw;
  1876.                 if (mode === 1) {icon.opacity = 0};
  1877.             } else {
  1878.               if (mode === 0 && lines > 0) {lines--};
  1879.               var hp = lines * cw; 
  1880.             };
  1881.         } else {
  1882.             if (mode === 1 && prepar2 > sprites.length) {
  1883.                 par = prepar;
  1884.                 icon.enable = false;
  1885.             };     
  1886.             var hp = mode === 1 ? cw : 0;
  1887.         };
  1888.         var sX = cw + 2 + icon.spc[0];
  1889.         var sY = ch + 2 + icon.spc[1];
  1890.         var lX = sX * icon.rows;
  1891.         var lines = Math.floor(i / icon.rows);
  1892.         if (sprites.iconMode) {
  1893.             if (mode === 0) {
  1894.                 icon.scale.x = 1.00;
  1895.                 if (par_max <= sprites.length && i == par_max - 1) {
  1896.                     icon.scale.x = !parmaxOdd2 ? 0.5 : 1.00;
  1897.                 };
  1898.             } else  {
  1899.                 if (prepar2 - 1 === i) {
  1900.                     icon.scale.x = parOdd2 ? 1.00 : 0.50;
  1901.                 } else {
  1902.                     icon.scale.x = 1.00;
  1903.                 };     
  1904.             };
  1905.         } else {
  1906.             icon.scale.x = 1.00;
  1907.         };
  1908.         icon.scale.y = icon.scale.x;
  1909.         icon.zoomData = [0,0,0,icon.scale.x];
  1910.         icon.visible = true
  1911.         if (par_max < sprites.length && i > (par_max - 1)) {icon.visible = false};
  1912.         if (mode === 1) {
  1913.             icon.visible = i > prepar2 - 1 ? false : true
  1914.         };
  1915.         icon.setFrame(hp,0,cw,ch);
  1916.         icon.x = icon.org[0] + (sX * i) - (lX * lines);
  1917.         icon.y = icon.org[1] + (sY * lines);
  1918.     };
  1919. };
  1920.  
  1921. //==============================
  1922. // * update Icon Zoom Anime
  1923. //==============================
  1924. Actor_Hud.prototype.updateIconZoomAnime = function(sprites) {
  1925.     for (var i = 0; i < sprites.length; i++) {
  1926.          var icon = sprites[i];
  1927.          if (icon.enable) {
  1928.              icon.zoomData[1]++;
  1929.              if (icon.zoomData[1] > 2) {
  1930.                  icon.zoomData[1] = 0;
  1931.                  icon.zoomData[2]++;
  1932.                  if (icon.zoomData[2] < 15) {
  1933.                      icon.zoomData[0] += 0.02;
  1934.                  } else if (icon.zoomData[2] < 30) {
  1935.                      icon.zoomData[0] -= 0.02;
  1936.                  } else {
  1937.                      icon.zoomData[0] = 0;
  1938.                      icon.zoomData[2] = 0;
  1939.                  };
  1940.                  icon.scale.x = icon.zoomData[3] + icon.zoomData[0];
  1941.                  icon.scale.y = icon.scale.x;
  1942.              };
  1943.          };
  1944.     };
  1945. };
  1946.  
  1947. //==============================
  1948. // * Create HP Number
  1949. //==============================
  1950. Actor_Hud.prototype.create_hp_number = function() {
  1951.     if (String(Moghunter.ahud_hp_number_visible) != "true") {return};
  1952.     if (this._hp_number) {for (var i = 0; i < this._hp_number.length; i++) {this.removeChild(this._hp_number[i]);}};
  1953.     if (!this._battler) {return};
  1954.     this._hp_number = [];
  1955.     this._hp_number.align = Number(Moghunter.ahud_hp_number_align);
  1956.     this._hp_img_data = [this._hp_number_img.width,this._hp_number_img.height,
  1957.                           this._hp_number_img.width / 10, this._hp_number_img.height / 2,
  1958.                           this._pos_x + Moghunter.ahud_hp_number_pos_x,
  1959.                           this._pos_y + Moghunter.ahud_hp_number_pos_y,
  1960.                           ];
  1961.     for (var i = 0; i < 5; i++) {
  1962.        this._hp_number[i] = new Sprite(this._hp_number_img);
  1963.        this._hp_number[i].visible = false;
  1964.        this._hp_number[i].x = this._hp_img_data[4];
  1965.        this._hp_number[i].y = this._hp_img_data[5];
  1966.        this.addChild(this._hp_number[i]);
  1967.     }; 
  1968.     this._hp_number_old = this._battler.hp;
  1969.     this.refresh_number(this._hp_number,this._hp_number_old,this._hp_img_data,this._hp_img_data[4],0); 
  1970. };
  1971.  
  1972. //==============================
  1973. // * Create maxHP Number
  1974. //==============================
  1975. Actor_Hud.prototype.create_maxhp_number = function() {
  1976.     if (String(Moghunter.ahud_maxhp_number_visible) != "true") {return};
  1977.     if (this._maxhp_number) {for (var i = 0; i < this._maxhp_number.length; i++) {this.removeChild(this._maxhp_number[i]);}};
  1978.     if (!this._battler) {return};  
  1979.     this._maxhp_number = [];
  1980.     this._maxhp_number.align = Number(Moghunter.ahud_hp_number_align);
  1981.     this._maxhp_img_data = [this._maxhp_number_img.width,this._maxhp_number_img.height,
  1982.                           this._maxhp_number_img.width / 10, this._maxhp_number_img.height / 2,
  1983.                           this._pos_x + Moghunter.ahud_maxhp_number_pos_x,
  1984.                           this._pos_y + Moghunter.ahud_maxhp_number_pos_y,
  1985.                           ];
  1986.     for (var i = 0; i < 5; i++) {
  1987.        this._maxhp_number[i] = new Sprite(this._maxhp_number_img);
  1988.        this._maxhp_number[i].visible = false;
  1989.        this._maxhp_number[i].x = this._maxhp_img_data[4];
  1990.        this._maxhp_number[i].y = this._maxhp_img_data[5];
  1991.        this.addChild(this._maxhp_number[i]);
  1992.     };     
  1993.     this._maxhp_number_old = this._battler.mhp;
  1994.     this.refresh_number(this._maxhp_number,this._maxhp_number_old,this._maxhp_img_data,this._maxhp_img_data[4],0); 
  1995. };
  1996.  
  1997. //==============================
  1998. // * Update HP
  1999. //==============================
  2000. Actor_Hud.prototype.update_hp = function() {
  2001.     if (this._hp_meter_blue) {
  2002.         if(this._hp_flow[0]) {
  2003.            if (this._hp_old[1] != this._battler.mhp) {
  2004.                this._hp_old = [this._battler.hp,this._battler.mhp];
  2005.                this.refresh_meter_flow(this._hp_meter_red,this._battler.hp,this._battler.mhp,1,$gameSystem._ahud_flowData[0]);
  2006.            };                  
  2007.            this.refresh_meter_flow(this._hp_meter_blue,this._battler.hp,this._battler.mhp,0,$gameSystem._ahud_flowData[0]);
  2008.            var dif_meter = this.update_dif(this._hp_old_ani[0],this._battler.hp,160)
  2009.            if (this._hp_old_ani[0] != dif_meter) {this._hp_old_ani[0] = dif_meter;
  2010.            this.refresh_meter_flow(this._hp_meter_red,this._hp_old_ani[0],this._battler.mhp,1,$gameSystem._ahud_flowData[0]);
  2011.            };
  2012.            $gameSystem._ahud_flowData[0] += this._hp_flow_speed;
  2013.            if ($gameSystem._ahud_flowData[0] > this._hp_flow[3]) {$gameSystem._ahud_flowData[0] = 0};
  2014.         }
  2015.         else {
  2016.            if (this.need_refresh_parameter(0)) {
  2017.                 this.refresh_meter(this._hp_meter_blue,this._battler.hp,this._battler.mhp,0,2,0);
  2018.                 this._hp_old = [this._battler.hp,this._battler.mhp];
  2019.             };
  2020.             var dif_meter = this.update_dif(this._hp_old_ani[0],this._battler.hp,160)
  2021.             if (this._hp_old_ani[0] != dif_meter) {this._hp_old_ani[0] = dif_meter;
  2022.             this.refresh_meter(this._hp_meter_red,this._hp_old_ani[0],this._battler.mhp,1,2,0);};      
  2023.         };
  2024.     };
  2025.     if (this._hp_number) {
  2026.         var dif_number = this.update_dif(this._hp_number_old,this._battler.hp,30)
  2027.         if (this._hp_number_old != dif_number) {this._hp_number_old = dif_number;
  2028.         this.refresh_number(this._hp_number,this._hp_number_old,this._hp_img_data,this._hp_img_data[4],0);};
  2029.     };
  2030.     if (this._maxhp_number) {
  2031.         if (this._maxhp_number_old != this._battler.mhp) {this._maxhp_number_old = this._battler.mhp;
  2032.         this.refresh_number(this._maxhp_number,this._maxhp_number_old,this._maxhp_img_data,this._maxhp_img_data[4],0);};
  2033.     };
  2034.     if (this._hp_icons) {
  2035.         if (this._hp_icon_old[0] != this._battler.hp || this._hp_icon_old[1] != this._battler.mhp) {
  2036.             this._hp_icon_old[0] = this._battler.hp;
  2037.             this._hp_icon_old[1] = this._battler.mhp;
  2038.             this.refresh_icons(this._hp_iconsB,this._hp_icon_img,this._battler.hp,this._battler.mhp,0);
  2039.             this.refresh_icons(this._hp_icons,this._hp_icon_img,this._battler.hp,this._battler.mhp,1);
  2040.         };
  2041.         if (this._hp_IconZoomAnime) {this.updateIconZoomAnime(this._hp_icons)};
  2042.     };
  2043. };
  2044.  
  2045. //==============================
  2046. // * Create MP Meter
  2047. //==============================
  2048. Actor_Hud.prototype.create_mp_meter = function() {
  2049.     if (String(Moghunter.ahud_mp_meter_visible) != "true") {return};
  2050.     this.removeChild(this._mp_meter_blue);
  2051.     this.removeChild(this._mp_meter_red);
  2052.     if (!this._battler) {return};
  2053.     this._mp_meter_red = new Sprite(this._mp_meter_img);
  2054.     this._mp_meter_red.x = this._pos_x + Moghunter.ahud_mp_meter_pos_x;
  2055.     this._mp_meter_red.y = this._pos_y + Moghunter.ahud_mp_meter_pos_y;
  2056.     this._mp_meter_red.rotation = Moghunter.ahud_mp_meter_rotation * Math.PI / 180;
  2057.     this._mp_meter_red.setFrame(0,0,0,0);
  2058.     this.addChild(this._mp_meter_red);     
  2059.     this._mp_meter_blue = new Sprite(this._mp_meter_img);
  2060.     this._mp_meter_blue.x = this._mp_meter_red.x;
  2061.     this._mp_meter_blue.y = this._mp_meter_red.y;
  2062.     this._mp_meter_blue.rotation = this._mp_meter_red.rotation * Math.PI / 180;
  2063.     this._mp_meter_blue.setFrame(0,0,0,0);
  2064.     this.addChild(this._mp_meter_blue);
  2065.     this._mp_old_ani[0] = this._battler.mp - 1;
  2066.     if (String(Moghunter.ahud_mp_meter_flow) === "true") {this._mp_flow[0] = true;
  2067.         this._mp_flow[2] = this._mp_meter_img.width / 3;
  2068.         this._mp_flow[3] = this._mp_flow[2] * 2;
  2069.         this._mp_flow[1] = Math.floor(Math.random() * this._mp_flow[2]);
  2070.     };
  2071. };
  2072.  
  2073. //==============================
  2074. // * Create MP Number
  2075. //==============================
  2076. Actor_Hud.prototype.create_mp_number = function() {
  2077.     if (String(Moghunter.ahud_mp_number_visible) != "true") {return};
  2078.     if (this._mp_number) {for (var i = 0; i < this._mp_number.length; i++) {this.removeChild(this._mp_number[i]);}};
  2079.     if (!this._battler) {return};
  2080.     this._mp_number = [];
  2081.     this._mp_number.align = Number(Moghunter.ahud_mp_number_align);
  2082.     this._mp_img_data = [this._mp_number_img.width,this._mp_number_img.height,
  2083.                           this._mp_number_img.width / 10, this._mp_number_img.height / 2,
  2084.                           this._pos_x + Moghunter.ahud_mp_number_pos_x,
  2085.                           this._pos_y + Moghunter.ahud_mp_number_pos_y,
  2086.                           ];
  2087.     for (var i = 0; i < 5; i++) {
  2088.        this._mp_number[i] = new Sprite(this._mp_number_img);
  2089.        this._mp_number[i].visible = false;
  2090.        this._mp_number[i].x = this._mp_img_data[4];
  2091.        this._mp_number[i].y = this._mp_img_data[5] ;
  2092.        this.addChild(this._mp_number[i]);
  2093.     }; 
  2094.     this._mp_number_old = this._battler.mp;
  2095.     this.refresh_number(this._mp_number,this._mp_number_old,this._mp_img_data,this._mp_img_data[4],0); 
  2096. };
  2097.  
  2098. //==============================
  2099. // * Create MaxMP Number
  2100. //==============================
  2101. Actor_Hud.prototype.create_maxmp_number = function() {
  2102.     if (String(Moghunter.ahud_maxmp_number_visible) != "true") {return};
  2103.     if (this._maxmp_number) {for (var i = 0; i < this._maxmp_number.length; i++) {this.removeChild(this._maxmp_number[i]);}};
  2104.     if (!this._battler) {return};
  2105.     this._maxmp_number = [];
  2106.     this._maxmp_number.align = Number(Moghunter.ahud_mp_number_align);
  2107.     this._maxmp_img_data = [this._maxmp_number_img.width,this._maxmp_number_img.height,
  2108.                           this._maxmp_number_img.width / 10, this._maxmp_number_img.height / 2,
  2109.                           this._pos_x + Moghunter.ahud_maxmp_number_pos_x,
  2110.                           this._pos_y + Moghunter.ahud_maxmp_number_pos_y,
  2111.                           ];
  2112.     for (var i = 0; i < 5; i++) {
  2113.        this._maxmp_number[i] = new Sprite(this._maxmp_number_img);
  2114.        this._maxmp_number[i].visible = false;
  2115.        this._maxmp_number[i].x = this._maxmp_img_data[4];
  2116.        this._maxmp_number[i].y = this._maxmp_img_data[5] ;
  2117.        this.addChild(this._maxmp_number[i]);
  2118.     }; 
  2119.     this._maxmp_number_old = this._battler.mmp;
  2120.     this.refresh_number(this._maxmp_number,this._maxmp_number_old,this._maxmp_img_data,this._maxmp_img_data[4],0); 
  2121. };
  2122.  
  2123. //==============================
  2124. // * Update MP
  2125. //==============================
  2126. Actor_Hud.prototype.update_mp = function() {
  2127.     if (this._mp_meter_blue) {
  2128.         if(this._mp_flow[0]) {
  2129.            if (this._mp_old[1] != this._battler.mmp) {
  2130.                this._mp_old = [this._battler.mp,this._battler.mmp];
  2131.                this.refresh_meter_flow(this._mp_meter_red,this._battler.mp,this._battler.mmp,1,$gameSystem._ahud_flowData[1]);
  2132.            };          
  2133.            this.refresh_meter_flow(this._mp_meter_blue,this._battler.mp,this._battler.mmp,0,$gameSystem._ahud_flowData[1]);
  2134.            var dif_meter = this.update_dif(this._mp_old_ani[0],this._battler.mp,160);
  2135.            if (this._mp_old_ani[0] != dif_meter) {this._mp_old_ani[0] = dif_meter;
  2136.            this.refresh_meter_flow(this._mp_meter_red,this._mp_old_ani[0],this._battler.mmp,1,$gameSystem._ahud_flowData[1]);
  2137.            };
  2138.            $gameSystem._ahud_flowData[1] += this._mp_flow_speed;
  2139.            if ($gameSystem._ahud_flowData[1] > this._mp_flow[3]) {$gameSystem._ahud_flowData[1] = 0};          
  2140.         }
  2141.         else {     
  2142.             if (this.need_refresh_parameter(1)) {
  2143.                 this.refresh_meter(this._mp_meter_blue,this._battler.mp,this._battler.mmp,0,2,0);
  2144.                 this._mp_old = [this._battler.mp,this._battler.mmp];
  2145.             };
  2146.             var dif_meter = this.update_dif(this._mp_old_ani[0],this._battler.mp,160)
  2147.             if (this._mp_old_ani[0] != dif_meter) {this._mp_old_ani[0] = dif_meter;
  2148.             this.refresh_meter(this._mp_meter_red,this._mp_old_ani[0],this._battler.mmp,1,2,0);};
  2149.         };
  2150.     };
  2151.     if (this._mp_number) {
  2152.         var dif_number = this.update_dif(this._mp_number_old,this._battler.mp,30)
  2153.         if (this._mp_number_old != dif_number) {this._mp_number_old = dif_number;
  2154.         this.refresh_number(this._mp_number,this._mp_number_old,this._mp_img_data,this._mp_img_data[4],0);};
  2155.     };
  2156.     if (this._maxmp_number) {
  2157.         if (this._maxmp_number_old != this._battler.mmp) {this._maxmp_number_old = this._battler.mmp;
  2158.         this.refresh_number(this._maxmp_number,this._maxmp_number_old,this._maxmp_img_data,this._maxmp_img_data[4],0);};
  2159.     };
  2160.     if (this._mp_icons) {
  2161.         if (this._mp_icon_old[0] != this._battler.mp || this._mp_icon_old[1] != this._battler.mmp) {
  2162.             this._mp_icon_old[0] = this._battler.mp;
  2163.             this._mp_icon_old[1] = this._battler.mmp;
  2164.             this.refresh_icons(this._mp_iconsB,this._mp_icon_img,this._battler.mp,this._battler.mmp,0);
  2165.             this.refresh_icons(this._mp_icons,this._mp_icon_img,this._battler.mp,this._battler.mmp,1);
  2166.         };
  2167.         if (this._mp_IconZoomAnime) {this.updateIconZoomAnime(this._mp_icons)};
  2168.     }; 
  2169. };
  2170.  
  2171. //==============================
  2172. // * Create TP Meter
  2173. //==============================
  2174. Actor_Hud.prototype.create_tp_meter = function() {
  2175.     if (String(Moghunter.ahud_tp_meter_visible) != "true") {return};
  2176.     this.removeChild(this._tp_meter_blue);
  2177.     this.removeChild(this._tp_meter_red);
  2178.     if (!this._battler) {return};
  2179.     this._tp_meter_red = new Sprite(this._tp_meter_img);
  2180.     this._tp_meter_red.x = this._pos_x + Moghunter.ahud_tp_meter_pos_x;
  2181.     this._tp_meter_red.y = this._pos_y + Moghunter.ahud_tp_meter_pos_y;
  2182.     this._tp_meter_red.rotation = Moghunter.ahud_tp_meter_rotation * Math.PI / 180;
  2183.     this._tp_meter_red.setFrame(0,0,0,0);
  2184.     this.addChild(this._tp_meter_red);     
  2185.     this._tp_meter_blue = new Sprite(this._tp_meter_img);
  2186.     this._tp_meter_blue.x = this._tp_meter_red.x;
  2187.     this._tp_meter_blue.y = this._tp_meter_red.y;
  2188.     this._tp_meter_blue.rotation = this._tp_meter_red.rotation * Math.PI / 180;
  2189.     this._tp_meter_blue.setFrame(0,0,0,0);
  2190.     this.addChild(this._tp_meter_blue);
  2191.     this._tp_old_ani[0] = this._battler.tp - 1;
  2192.     if (String(Moghunter.ahud_tp_meter_flow) === "true") {this._tp_flow[0] = true;
  2193.         this._tp_flow[2] = this._tp_meter_img.width / 3;
  2194.         this._tp_flow[3] = this._tp_flow[2] * 2;
  2195.         this._tp_flow[1] = Math.floor(Math.random() * this._tp_flow[2]);
  2196.     };
  2197. };
  2198.  
  2199. //==============================
  2200. // * Create TP Number
  2201. //==============================
  2202. Actor_Hud.prototype.create_tp_number = function() {
  2203.     if (String(Moghunter.ahud_tp_number_visible) != "true") {return};
  2204.     if (this._tp_number) {for (var i = 0; i < this._tp_number.length; i++) {this.removeChild(this._tp_number[i]);}};
  2205.     if (!this._battler) {return};
  2206.     this._tp_number = [];
  2207.     this._tp_number.align = Number(Moghunter.ahud_tp_number_align);
  2208.     this._tp_img_data = [this._tp_number_img.width,this._tp_number_img.height,
  2209.                           this._tp_number_img.width / 10, this._tp_number_img.height / 2,
  2210.                           this._pos_x + Moghunter.ahud_tp_number_pos_x,
  2211.                           this._pos_y + Moghunter.ahud_tp_number_pos_y,
  2212.                           ];
  2213.     for (var i = 0; i < 5; i++) {
  2214.        this._tp_number[i] = new Sprite(this._tp_number_img);
  2215.        this._tp_number[i].visible = false;
  2216.        this._tp_number[i].x = this._tp_img_data[4];
  2217.        this._tp_number[i].y = this._tp_img_data[5] ;
  2218.        this.addChild(this._tp_number[i]);
  2219.     }; 
  2220.     this._tp_number_old = this._battler.tp;
  2221.     this.refresh_number(this._tp_number,this._tp_number_old,this._tp_img_data,this._tp_img_data[4],0); 
  2222. };
  2223.  
  2224. //==============================
  2225. // * Create MaxTP Number
  2226. //==============================
  2227. Actor_Hud.prototype.create_maxtp_number = function() {
  2228.     if (String(Moghunter.ahud_maxtp_number_visible) != "true") {return};
  2229.     if (this._maxtp_number) {for (var i = 0; i < this._maxtp_number.length; i++) {this.removeChild(this._maxtp_number[i]);}};
  2230.     if (!this._battler) {return};
  2231.     this._maxtp_number = [];
  2232.     this._maxtp_number.align = Number(Moghunter.ahud_tp_number_align);
  2233.     this._maxtp_img_data = [this._maxtp_number_img.width,this._maxtp_number_img.height,
  2234.                           this._maxtp_number_img.width / 10, this._maxtp_number_img.height / 2,
  2235.                           this._pos_x + Moghunter.ahud_maxtp_number_pos_x,
  2236.                           this._pos_y + Moghunter.ahud_maxtp_number_pos_y,
  2237.                           ];
  2238.     for (var i = 0; i < 5; i++) {
  2239.        this._maxtp_number[i] = new Sprite(this._maxtp_number_img);
  2240.        this._maxtp_number[i].visible = false;
  2241.        this._maxtp_number[i].x = this._maxtp_img_data[4];
  2242.        this._maxtp_number[i].y = this._maxtp_img_data[5] ;
  2243.        this.addChild(this._maxtp_number[i]);
  2244.     }; 
  2245.     this._maxtp_number_old = 100;
  2246.     this.refresh_number(this._maxtp_number,this._maxtp_number_old,this._maxtp_img_data,this._maxtp_img_data[4],0); 
  2247. };
  2248.  
  2249. //==============================
  2250. // * Update TP
  2251. //==============================
  2252. Actor_Hud.prototype.update_tp = function() {
  2253.     if (this._tp_meter_blue) {
  2254.         if(this._tp_flow[0]) {
  2255.            if (this._tp_old[1] != this._battler.maxTp()) {
  2256.                this._tp_old = [this._battler.tp,this._battler.maxTp()];
  2257.                this.refresh_meter_flow(this._tp_meter_red,this._battler.tp,this._battler.maxTp(),1,$gameSystem._ahud_flowData[2]);
  2258.            };              
  2259.            this.refresh_meter_flow(this._tp_meter_blue,this._battler.tp,this._battler.maxTp(),0,$gameSystem._ahud_flowData[2]);
  2260.            var dif_meter = this.update_dif(this._tp_old_ani[0],this._battler.tp,160)
  2261.            if (this._tp_old_ani[0] != dif_meter) {this._tp_old_ani[0] = dif_meter;
  2262.            this.refresh_meter_flow(this._tp_meter_red,this._tp_old_ani[0],this._battler.maxTp(),1,$gameSystem._ahud_flowData[2]);
  2263.            };
  2264.            $gameSystem._ahud_flowData[2] += this._tp_flow_speed;
  2265.            if ($gameSystem._ahud_flowData[2] > this._tp_flow[3]) {$gameSystem._ahud_flowData[2] = 0};          
  2266.         }
  2267.         else { 
  2268.             if (this.need_refresh_parameter(2)) {
  2269.                 this.refresh_meter(this._tp_meter_blue,this._battler.tp,this._battler.maxTp(),0,2,0);
  2270.                 this._tp_old = [this._battler.tp,this._battler.maxTp()];
  2271.             };
  2272.             var dif_meter = this.update_dif(this._tp_old_ani[0],this._battler.tp,160)
  2273.             if (this._tp_old_ani[0] != dif_meter) {this._tp_old_ani[0] = dif_meter;
  2274.             this.refresh_meter(this._tp_meter_red,this._tp_old_ani[0],this._battler.maxTp(),1,2,0);};
  2275.     };
  2276.     };
  2277.     if (this._tp_number) {
  2278.         var dif_number = this.update_dif(this._tp_number_old,this._battler.tp,30)
  2279.         if (this._tp_number_old != dif_number) {this._tp_number_old = dif_number;
  2280.         this.refresh_number(this._tp_number,this._tp_number_old,this._tp_img_data,this._tp_img_data[4],0);};
  2281.     };
  2282.     if (this._tp_icons) {
  2283.         if (this._tp_icon_old[0] != this._battler.tp || this._tp_icon_old[1] != this._battler.maxTp()) {
  2284.             this._tp_icon_old[0] = this._battler.tp;
  2285.             this._tp_icon_old[1] = this._battler.maxTp();
  2286.             this.refresh_icons(this._tp_iconsB,this._tp_icon_img,this._battler.tp,this._battler.maxTp(),0);
  2287.             this.refresh_icons(this._tp_icons,this._tp_icon_img,this._battler.tp,this._battler.maxTp(),1);
  2288.         };
  2289.         if (this._tp_IconZoomAnime) {this.updateIconZoomAnime(this._tp_icons)};
  2290.     }; 
  2291. };
  2292.  
  2293.  
  2294. //==============================
  2295. // * Create Exp Meter
  2296. //==============================
  2297. Actor_Hud.prototype.create_exp_meter = function() {
  2298. if (String(Moghunter.ahud_exp_meter_visible) != "true") {return};
  2299.     this.removeChild(this._exp_meter);
  2300.     if (!this._battler) {return};
  2301.     this._exp_meter = new Sprite(this._exp_meter_img);
  2302.     this._exp_meter.x = this._pos_x + Moghunter.ahud_exp_meter_pos_x;
  2303.     this._exp_meter.y = this._pos_y + Moghunter.ahud_exp_meter_pos_y;
  2304.     this._exp_meter.rotation = this._exp_meter.rotation * Math.PI / 180;
  2305.     this.addChild(this._exp_meter);
  2306.     if (String(Moghunter.ahud_exp_meter_flow) === "true") {this._exp_flow[0] = true;
  2307.         this._exp_flow[2] = this._exp_meter_img.width / 3;
  2308.         this._exp_flow[3] = this._exp_flow[2] * 2;
  2309.         this._exp_flow[1] = Math.floor(Math.random() * this._exp_flow[2]);
  2310.     };
  2311.     this._exp_meter.setFrame(0,0,0,0);
  2312. };
  2313.  
  2314. //==============================
  2315. // * Create Level Number
  2316. //==============================
  2317. Actor_Hud.prototype.create_level_number = function() {
  2318.     if (String(Moghunter.ahud_level_number_visible) != "true") {return};
  2319.     if (this._level_number) {for (var i = 0; i < this._level_number.length; i++) {this.removeChild(this._level_number[i]);}};
  2320.     if (!this._battler) {return};
  2321.     this._level_number = [];
  2322.     this._level_number.align = Number(Moghunter.ahud_level_number_align);
  2323.     this._level_img_data = [this._level_number_img.width,this._level_number_img.height,
  2324.                           this._level_number_img.width / 10, this._level_number_img.height / 2,
  2325.                           this._pos_x + Moghunter.ahud_level_number_pos_x,
  2326.                           this._pos_y + Moghunter.ahud_level_number_pos_y,
  2327.                           ];
  2328.     for (var i = 0; i < 3; i++) {
  2329.        this._level_number[i] = new Sprite(this._level_number_img);
  2330.        this._level_number[i].visible = false;
  2331.        this._level_number[i].x = this._level_img_data[4];
  2332.        this._level_number[i].y = this._level_img_data[5];
  2333.        this.addChild(this._level_number[i]);
  2334.     }; 
  2335.     this._level_number_old = this._battler.level;
  2336.     this.refresh_number(this._level_number,this._level_number_old,this._level_img_data,this._level_img_data[4],1); 
  2337. };
  2338.  
  2339. //==============================
  2340. // * Update Exp
  2341. //==============================
  2342. Actor_Hud.prototype.update_exp = function() {
  2343.     if (this._exp_meter) {
  2344.         if (this.need_refresh_parameter(3)) {
  2345.             if (this._battler.isMaxLevel()) {
  2346.                 this.refresh_meter(this._exp_meter,1,1,0,1,1);
  2347.             } else {
  2348.                 this.refresh_meter(this._exp_meter,this._battler.current_exp_r(),this._battler.nextLevelExp_r(),0,1,1);
  2349.             };
  2350.             this._exp_old = this._battler.currentExp();
  2351.         };
  2352.     };
  2353.     if (this._level_number) {
  2354.         var dif_number = this.update_dif(this._level_number_old,this._battler.level,30)
  2355.         if (this._level_number_old != dif_number) {this._level_number_old = dif_number;
  2356.             if (this._hp_old_ani) {this._hp_old_ani[0] = 0};
  2357.             if (this._mp_old_ani) {this._mp_old_ani[0] = 0};
  2358.             if (this._tp_old_ani) {this._tp_old_ani[0] = 0};
  2359.             this.refresh_number(this._level_number,this._level_number_old,this._level_img_data,this._level_img_data[4],1);};
  2360.     };
  2361. };
  2362.  
  2363. //==============================
  2364. // * Create States
  2365. //==============================
  2366. Actor_Hud.prototype.create_states = function() {
  2367.     if (String(Moghunter.ahud_states_visible) != "true") {return};
  2368.     this.removeChild(this._state_icon);
  2369.     if (!this._battler) {return};
  2370.     this._states_data = [0,0,0];
  2371.     this._state_icon = new Sprite(this._state_img);
  2372.     this._state_icon.x = this._pos_x + Moghunter.ahud_states_pos_x;
  2373.     this._state_icon.y = this._pos_y + Moghunter.ahud_states_pos_y;
  2374.     this._state_icon.visible = false;
  2375.     this.addChild(this._state_icon);
  2376.     this.refresh_states(); 
  2377. };
  2378.  
  2379. //==============================
  2380. // * Refresh States
  2381. //==============================
  2382. Actor_Hud.prototype.refresh_states = function() {
  2383.     this._states_data[0] = 0;
  2384.     this._states_data[2] = 0;
  2385.     this._state_icon.visible = false;
  2386.     if (this._battler.allIcons().length == 0) {this._states_data[1] = 0;return};
  2387.        if (this._battler.allIcons()[this._states_data[1]]) {   
  2388.         this._states_data[0] = this._battler.allIcons()[this._states_data[1]];
  2389.         this._state_icon.visible = true;
  2390.         var sx = this._states_data[0] % 16 * 32;
  2391.         var sy = Math.floor(this._states_data[0] / 16) * 32;
  2392.         this._state_icon.setFrame(sx, sy, 32, 32);
  2393.         this._battler.need_refresh_bhud_states = false;
  2394.    
  2395.        };
  2396.     this._states_data[1] += 1;
  2397.     if (this._states_data[1] >= this._battler.allIcons().length) {
  2398.         this._states_data[1] = 0
  2399.     };
  2400. };
  2401.  
  2402. //==============================
  2403. // * Update States
  2404. //==============================
  2405. Actor_Hud.prototype.update_states = function() {
  2406.     if (!this._state_icon) {return};
  2407.     this._states_data[2] += 1;
  2408.     if (this.need_refresh_states()) {this.refresh_states();};
  2409. };
  2410.  
  2411. //==============================
  2412. // * Need Refresh States
  2413. //==============================
  2414. Actor_Hud.prototype.need_refresh_states = function() {
  2415.     if (this._battler.need_refresh_bhud_states) {return true};
  2416.     if (this._states_data[2] > 60) {return true};
  2417.     return false;
  2418. };
Add Comment
Please, Sign In to add comment