Advertisement
Kakakadafi

[Overwrite] MOG_Ultima_HUD

Jan 16th, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 155.83 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - Ultima HUD (v1.1) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #==============================================================================
  7. # Sistema avançado de Hud, voltado para artistas gráficos.
  8. # Este script possui uma vasta gama de opções que permitirão o designer gráfico
  9. # criar huds complexas e animadas, visando o máximo desempenho com o mínimo
  10. # de perda no processamento de imagens.
  11. #==============================================================================
  12. # Coloque as imagens da hud na pasta.
  13. #
  14. # Graphics/Huds/Ultima/
  15. #
  16. #==============================================================================
  17. #==============================================================================
  18. # Version History
  19. #==============================================================================
  20. # v1.1 - Corrigido o erro de não ativar o efeito shake em faces não animadas.
  21. #==============================================================================
  22. module MOG_ULTIMA_HUD
  23.  
  24.   REMOVE_PARTS = {
  25.   # ID => [Removed HUD Parts; :exp and/or :stamina]
  26.     1 => [],
  27.     2 => [],
  28.     3 => [],
  29.     4 => [],
  30.     5 => [],
  31.     6 => [],
  32.     7 => [],
  33.     8 => [:exp, :stamina],
  34.   }
  35.  
  36.   #============================================================================
  37.   #============================================================================
  38.   # * VISIBILITY
  39.   #============================================================================
  40.   # Para ativar ou desativar a hud no meio do jogo utilize o código abaixo.
  41.   #
  42.   # hud_visible(true)
  43.   #
  44.   # hud_visible(false)
  45.   #
  46.   #---------------------------------------------------------------------------
  47.   # Deixar a Hud visível ao começar o jogo.
  48.   #---------------------------------------------------------------------------
  49.   INITIAL_VISIBLE = true  
  50.   #---------------------------------------------------------------------------
  51.   # Ocultar a Hud automaticamente ao iniciar o interpretador.
  52.   #---------------------------------------------------------------------------
  53.   AUTO_HIDE_FOR_INTERPRETER = true  
  54.   #============================================================================
  55.   #============================================================================
  56.  
  57.  
  58.   #============================================================================
  59.   #============================================================================
  60.   # * SMART FADE
  61.   #============================================================================
  62.   # Ativar a Hud no modo translucido quando o personagem ficar abaixo da hud.
  63.   #---------------------------------------------------------------------------
  64.   SMART_FADE_EFFECT = true
  65.   #---------------------------------------------------------------------------
  66.   # Definição da área "extra" do alcance do Smart Fade.
  67.   # O alcance é baseado no tamanho da imagem do Layout.
  68.   #---------------------------------------------------------------------------
  69.   SMART_FADE_RANGE_X = [0,0]
  70.   SMART_FADE_RANGE_Y = [0,0]
  71.   #---------------------------------------------------------------------------
  72.   # Limite de transparência da hud
  73.   #---------------------------------------------------------------------------
  74.   SMART_FADE_LIMIT = 90
  75.   #============================================================================
  76.   #============================================================================
  77.  
  78.  
  79.   #============================================================================
  80.   #============================================================================
  81.   # * HUD SPRITE (GENERAL)
  82.   #============================================================================
  83.   # Definição da prioridade da hud.
  84.   #---------------------------------------------------------------------------
  85.   HUD_Z = 305
  86.   #---------------------------------------------------------------------------
  87.   # Para  mudar a posição da HUD no meio do jogo use o código abaixo.
  88.   #
  89.   # hud_position( X , Y)
  90.   #
  91.   #---------------------------------------------------------------------------
  92.   # Definição da posição geral da hud, influência em todos os sprites da hud.
  93.   #---------------------------------------------------------------------------
  94.   HUD_POSITION = [5,12]
  95.   #---------------------------------------------------------------------------
  96.   # Definição da porcentagem do parâmetro baixo, isso influencia na cor
  97.   # do número dos parâmetros de HP, MP e TP.
  98.   #---------------------------------------------------------------------------
  99.   LOW_PARAMETER_PERCENTAGE = 30
  100.   #============================================================================
  101.   #============================================================================
  102.  
  103.  
  104.   #============================================================================
  105.   #============================================================================
  106.   # * NAME SPRITE
  107.   #============================================================================
  108.   # Ativar o Sprite do nome do personagem.
  109.   #---------------------------------------------------------------------------
  110.   NAME_VISIBLE = true
  111.   #---------------------------------------------------------------------------
  112.   # Definição da prioridade do Sprite.
  113.   #---------------------------------------------------------------------------  
  114.   NAME_Z = 5
  115.   #---------------------------------------------------------------------------
  116.   # Definição da posição da Face. [X,Y]
  117.   #---------------------------------------------------------------------------
  118.   NAME_POSITION = [87,-10]
  119.   #---------------------------------------------------------------------------
  120.   # Definição do tipo alinhamento do nome.
  121.   #
  122.   # 0 - Esquerda
  123.   # 1 - Centro
  124.   # 2 - Direita
  125.   #---------------------------------------------------------------------------  
  126.   NAME_ALIGN_TYPE = 0
  127.   #---------------------------------------------------------------------------
  128.   # Definição do nome da fonte.
  129.   #---------------------------------------------------------------------------
  130.   NAME_FONT_NAME = "Georgia"
  131.   #---------------------------------------------------------------------------
  132.   # Definição do tamanho da fonte.
  133.   #---------------------------------------------------------------------------  
  134.   NAME_FONT_SIZE = 16
  135.   #---------------------------------------------------------------------------
  136.   # Ativar Bold.
  137.   #---------------------------------------------------------------------------  
  138.   NAME_FONT_BOLD = true
  139.   #---------------------------------------------------------------------------
  140.   # Ativar Italic.
  141.   #---------------------------------------------------------------------------  
  142.   NAME_FONT_ITALIC = true
  143.   #---------------------------------------------------------------------------
  144.   # Definição da cor da fonte
  145.   #---------------------------------------------------------------------------    
  146.   NAME_FONT_COLOR = Color.new(255,255,255,255)
  147.   #---------------------------------------------------------------------------
  148.   # Ativar Sombra
  149.   #---------------------------------------------------------------------------  
  150.   NAME_FONT_SHADOW = true
  151.   #---------------------------------------------------------------------------
  152.   # Definição da cor da sombra
  153.   #---------------------------------------------------------------------------    
  154.   NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  155.   #---------------------------------------------------------------------------
  156.   # Definição da distância da sombra.
  157.   #---------------------------------------------------------------------------    
  158.   NAME_FONT_SHADOW_POSITION = [2,2]  
  159.   #============================================================================
  160.   #============================================================================
  161.    
  162.  
  163.   #============================================================================
  164.   #============================================================================
  165.   # * FACE SPRITE
  166.   #============================================================================
  167.   # Ativar a face.
  168.   # Será necessário o arquivo.
  169.   #
  170.   # ACTOR_NAME + _Face.png
  171.   #
  172.   # Eric_Face.png
  173.   #
  174.   #---------------------------------------------------------------------------
  175.   FACE_VISIBLE = true
  176.   #---------------------------------------------------------------------------
  177.   # Definição da prioridade do sprite.
  178.   #---------------------------------------------------------------------------  
  179.   FACE_Z = -1
  180.   #---------------------------------------------------------------------------
  181.   # Definição da posição da Face. [X,Y]
  182.   #---------------------------------------------------------------------------
  183.   FACE_POSITION = [-7,-25]
  184.   #---------------------------------------------------------------------------
  185.   # Ativar faces animadas.
  186.   # Será necessário ter uma imagem de 4 faces do personagem no mesmo arquivo.
  187.   #
  188.   # FACE1/FACE2/FACE3/FACE4
  189.   #
  190.   # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  191.   # a imagem será dividida por 1 frame
  192.   #---------------------------------------------------------------------------  
  193.   FACE_ANIMATION = false
  194.   #---------------------------------------------------------------------------
  195.   # Definição do tempo duração da animação da face.
  196.   #---------------------------------------------------------------------------  
  197.   FACE_ANIMATION_DURATION = 40
  198.   #---------------------------------------------------------------------------
  199.   # Ativar o efeito tremor da face quando o personagem sofrer dano.
  200.   #---------------------------------------------------------------------------  
  201.   FACE_SHAKE_EFFECT = false
  202.   #============================================================================
  203.   #============================================================================
  204.  
  205.  
  206.   #============================================================================
  207.   #============================================================================
  208.   # * HP SPRITE
  209.   #============================================================================
  210.   # Ativar o número de HP.
  211.   # Será necessário o arquivo.
  212.   #
  213.   # HP_Number.png
  214.   #
  215.   #---------------------------------------------------------------------------
  216.   HP_NUMBER_VISIBLE = false
  217.   #---------------------------------------------------------------------------
  218.   # Definição da prioridade do Sprite.
  219.   #---------------------------------------------------------------------------    
  220.   HP_NUMBER_Z = 2
  221.   #---------------------------------------------------------------------------
  222.   # Definição da posição do número de HP. [X,Y]
  223.   #---------------------------------------------------------------------------  
  224.   HP_NUMBER_POSITION = [163,14]
  225.   #---------------------------------------------------------------------------  
  226.   # Ativar o número de HP Total.
  227.   # Será necessário o arquivo.
  228.   #
  229.   # HP_Number_Max.png
  230.   #
  231.   #---------------------------------------------------------------------------
  232.   HP_NUMBER_MAX_VISIBLE = false
  233.   #---------------------------------------------------------------------------
  234.   # Definição da posição do número de HP Total. [X,Y]
  235.   #---------------------------------------------------------------------------  
  236.   HP_NUMBER_MAX_POSITION = [165,30]
  237.   #---------------------------------------------------------------------------
  238.   # Definição do tipo alinhamento do número.
  239.   #
  240.   # 0 - Esquerda
  241.   # 1 - Centro
  242.   # 2 - Direita
  243.   #---------------------------------------------------------------------------  
  244.   HP_NUMBER_ALIGN_TYPE = 2
  245.   #---------------------------------------------------------------------------
  246.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  247.   #---------------------------------------------------------------------------
  248.   HP_NUMBER_WAVE_ALIGN_EFFECT = false
  249.   #---------------------------------------------------------------------------
  250.   # Apresentar os números em porcentagem.
  251.   #---------------------------------------------------------------------------    
  252.   HP_NUMBER_PERCENTAGE = false
  253.   #---------------------------------------------------------------------------
  254.   # Ativar números animados ("Rolantes").
  255.   #---------------------------------------------------------------------------  
  256.   HP_NUMBER_ANIMATION = false
  257.   #---------------------------------------------------------------------------
  258.   # Ativar a cor do HP baixo.
  259.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  260.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  261.   #
  262.   # NORMAL_COLOR
  263.   # LOW_PARAMETER_COLOR
  264.   #
  265.   # Caso definir a função como FALSE a imagem será dividida apenas como
  266.   # 1 frame de altura.
  267.   #---------------------------------------------------------------------------  
  268.   HP_NUMBER_LOW_COLOR = false
  269.   #---------------------------------------------------------------------------
  270.   # Ativar o medidor de HP.
  271.   # Será necessário o arquivo.
  272.   #
  273.   # HP_Meter.png
  274.   #  
  275.   #---------------------------------------------------------------------------  
  276.   HP_METER_VISIBLE = true
  277.   #---------------------------------------------------------------------------
  278.   # Definição da prioridade do sprite.
  279.   #---------------------------------------------------------------------------    
  280.   HP_METER_Z = 1
  281.   #---------------------------------------------------------------------------
  282.   # Definição da posição do medidor de HP. [X,Y]
  283.   #---------------------------------------------------------------------------  
  284.   HP_METER_POSITION = [35,24]
  285.   #---------------------------------------------------------------------------
  286.   # Definição do ângulo do medidor.
  287.   #---------------------------------------------------------------------------  
  288.   HP_METER_ANGLE = 0
  289.   #---------------------------------------------------------------------------
  290.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  291.   # inverso.
  292.   #---------------------------------------------------------------------------  
  293.   HP_METER_MIRROR_EFFECT = false
  294.   #---------------------------------------------------------------------------
  295.   # Ativar o efeito animado de dano no medidor.
  296.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  297.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  298.   #
  299.   # NORMAL_COLOR
  300.   # DAMAGE_COLOR
  301.   #
  302.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  303.   #---------------------------------------------------------------------------  
  304.   HP_METER_REDUCTION_ANIMATION = true
  305.   #---------------------------------------------------------------------------
  306.   # Ativar o efeito animado do "medidor fluindo".
  307.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  308.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  309.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  310.   #---------------------------------------------------------------------------  
  311.   HP_METER_GRADIENT_ANIMATION = false
  312.   #---------------------------------------------------------------------------
  313.   # Ativar HP em ícones.
  314.   # Será necessário ter a imagem.
  315.   #
  316.   # HP_Icon.png
  317.   #
  318.   #---------------------------------------------------------------------------
  319.   HP_ICON_VISIBLE = false
  320.   #---------------------------------------------------------------------------
  321.   # Definição da prioridade do Sprite.
  322.   #---------------------------------------------------------------------------    
  323.   HP_ICON_Z = 1
  324.   #---------------------------------------------------------------------------
  325.   # Posição do ícone de HP.
  326.   #---------------------------------------------------------------------------  
  327.   HP_ICON_POSITION = [200,0]
  328.   #---------------------------------------------------------------------------
  329.   # Ativar o sprite EX do ultimo ícone
  330.   # Será necessário ter a imagem.
  331.   #
  332.   # HP_Icon_EX.png
  333.   #
  334.   #---------------------------------------------------------------------------
  335.   HP_ICON_EX_VISIBLE = false
  336.   #---------------------------------------------------------------------------
  337.   # Posição do ícone Animado.
  338.   #---------------------------------------------------------------------------  
  339.   HP_ICON_EX_POSITION = [0,0]
  340.   #---------------------------------------------------------------------------
  341.   # Ativar o efeito de Zoom do Sprite.
  342.   #---------------------------------------------------------------------------
  343.   HP_ICON_EX_ZOOM_EFFECT = true
  344.   #---------------------------------------------------------------------------
  345.   # Espaço entre os ícones.
  346.   #---------------------------------------------------------------------------    
  347.   HP_ICON_SPACE = [-10,-10]
  348.   #---------------------------------------------------------------------------
  349.   # Definição da quantidade maxima de ícones na horizontal.
  350.   #---------------------------------------------------------------------------  
  351.   HP_ICON_COL_MAX = 10
  352.   #---------------------------------------------------------------------------
  353.   # Definição da quantidade maxima de ícones na vertical.
  354.   #---------------------------------------------------------------------------    
  355.   HP_ICON_ROW_MAX = 2
  356.   #---------------------------------------------------------------------------
  357.   # Ativar o número de HP de ícones.
  358.   # Será necessário ter a imagem.
  359.   #
  360.   # HP_Icon_Number.png
  361.   #
  362.   #---------------------------------------------------------------------------
  363.   HP_ICON_NUMBER_VISIBLE = false
  364.   #---------------------------------------------------------------------------
  365.   # Definição da prioridade do sprite.
  366.   #---------------------------------------------------------------------------
  367.   HP_ICON_NUMBER_Z = 4
  368.   #---------------------------------------------------------------------------
  369.   # Posição do número do ícone
  370.   #---------------------------------------------------------------------------  
  371.   HP_ICON_NUMBER_POSITION = [0,0]
  372.   #---------------------------------------------------------------------------
  373.   # Definição do tipo alinhamento do número.
  374.   #
  375.   # 0 - Esquerda
  376.   # 1 - Centro
  377.   # 2 - Direita
  378.   #---------------------------------------------------------------------------  
  379.   HP_ICON_NUMBER_ALIGN_TYPE = 0  
  380.   #============================================================================
  381.   #============================================================================
  382.  
  383.  
  384.   #============================================================================
  385.   #============================================================================
  386.   # * MP SPRITE
  387.   #============================================================================
  388.   # Ativar o número de MP.
  389.   # Será necessário o arquivo.
  390.   #
  391.   # MP_Number.png
  392.   #  
  393.   #---------------------------------------------------------------------------  
  394.   MP_NUMBER_VISIBLE = false
  395.   #---------------------------------------------------------------------------
  396.   # Definição da prioridade do Sprite.
  397.   #---------------------------------------------------------------------------    
  398.   MP_NUMBER_Z = 2  
  399.   #---------------------------------------------------------------------------
  400.   # Definição da posição do número de MP. [X,Y]
  401.   #---------------------------------------------------------------------------  
  402.   MP_NUMBER_POSITION = [187,43]
  403.   #---------------------------------------------------------------------------  
  404.   # Ativar o número de MP Total.
  405.   # Será necessário o arquivo.
  406.   #
  407.   # MP_Number_Max.png
  408.   #
  409.   #---------------------------------------------------------------------------
  410.   MP_NUMBER_MAX_VISIBLE = false
  411.   #---------------------------------------------------------------------------
  412.   # Definição da posição do número de MP Total. [X,Y]
  413.   #---------------------------------------------------------------------------  
  414.   MP_NUMBER_MAX_POSITION = [128,53]
  415.   #---------------------------------------------------------------------------
  416.   # Definição do tipo alinhamento do número.
  417.   #
  418.   # 0 - Esquerda
  419.   # 1 - Centro
  420.   # 2 - Direita
  421.   #---------------------------------------------------------------------------  
  422.   MP_NUMBER_ALIGN_TYPE = 2
  423.   #---------------------------------------------------------------------------
  424.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  425.   #---------------------------------------------------------------------------
  426.   MP_NUMBER_WAVE_ALIGN_EFFECT = false    
  427.   #---------------------------------------------------------------------------
  428.   # Apresentar os números em porcentagem.
  429.   #---------------------------------------------------------------------------    
  430.   MP_NUMBER_PERCENTAGE = false
  431.   #---------------------------------------------------------------------------
  432.   # Ativar números animados ("Rolantes").
  433.   #---------------------------------------------------------------------------  
  434.   MP_NUMBER_ANIMATION = true
  435.   #---------------------------------------------------------------------------
  436.   # Ativar a cor do MP baixo.
  437.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  438.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  439.   #
  440.   # NORMAL_COLOR
  441.   # LOW_PARAMETER_COLOR
  442.   #
  443.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  444.   #---------------------------------------------------------------------------  
  445.   MP_NUMBER_LOW_COLOR = false
  446.   #---------------------------------------------------------------------------
  447.   # Ativar o medidor de MP.
  448.   # Será necessário o arquivo.
  449.   #
  450.   # MP_Meter.png
  451.   #    
  452.   #---------------------------------------------------------------------------  
  453.   MP_METER_VISIBLE = true
  454.   #---------------------------------------------------------------------------
  455.   # Definição da prioridade do sprite.
  456.   #---------------------------------------------------------------------------    
  457.   MP_METER_Z = 1  
  458.   #---------------------------------------------------------------------------
  459.   # Definição da posição do medidor de MP. [X,Y]
  460.   #---------------------------------------------------------------------------  
  461.   MP_METER_POSITION = [19,42]
  462.   #---------------------------------------------------------------------------
  463.   # Definição do ângulo do medidor.
  464.   #---------------------------------------------------------------------------  
  465.   MP_METER_ANGLE = 0
  466.   #---------------------------------------------------------------------------
  467.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  468.   # inverso.
  469.   #---------------------------------------------------------------------------  
  470.   MP_METER_MIRROR_EFFECT = false
  471.   #---------------------------------------------------------------------------
  472.   # Ativar o efeito animado de dano no medidor.
  473.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  474.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  475.   #
  476.   # NORMAL_COLOR
  477.   # DAMAGE_COLOR
  478.   #
  479.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  480.   #---------------------------------------------------------------------------  
  481.   MP_METER_REDUCTION_ANIMATION = true
  482.   #---------------------------------------------------------------------------
  483.   # Ativar o efeito animado do "medidor fluindo".
  484.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  485.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  486.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  487.   #---------------------------------------------------------------------------  
  488.   MP_METER_GRADIENT_ANIMATION = false
  489.   #---------------------------------------------------------------------------
  490.   # Ativar MP em ícones.
  491.   # Será necessário ter a imagem.
  492.   #
  493.   # MP_Icon.png
  494.   #
  495.   #---------------------------------------------------------------------------
  496.   MP_ICON_VISIBLE = false
  497.   #---------------------------------------------------------------------------
  498.   # Definição da prioridade do Sprite.
  499.   #---------------------------------------------------------------------------    
  500.   MP_ICON_Z = 1  
  501.   #---------------------------------------------------------------------------
  502.   # Posição do ícone de MP.
  503.   #---------------------------------------------------------------------------  
  504.   MP_ICON_POSITION = [200,64]
  505.   #---------------------------------------------------------------------------
  506.   # Ativar o sprite EX do ultimo ícone
  507.   # Será necessário ter a imagem.
  508.   #
  509.   # MP_Icon_EX.png
  510.   #
  511.   #---------------------------------------------------------------------------
  512.   MP_ICON_EX_VISIBLE = false
  513.   #---------------------------------------------------------------------------
  514.   # Posição do ícone Animado.
  515.   #---------------------------------------------------------------------------  
  516.   MP_ICON_EX_POSITION = [0,0]
  517.   #---------------------------------------------------------------------------
  518.   # Ativar o efeito de Zoom do Sprite.
  519.   #---------------------------------------------------------------------------
  520.   MP_ICON_EX_ZOOM_EFFECT = false
  521.   #---------------------------------------------------------------------------
  522.   # Espaço entre os ícones.
  523.   #---------------------------------------------------------------------------    
  524.   MP_ICON_SPACE = [-10,-10]
  525.   #---------------------------------------------------------------------------
  526.   # Definição da quantidade maxima de ícones na horizontal.
  527.   #---------------------------------------------------------------------------  
  528.   MP_ICON_COL_MAX = 10
  529.   #---------------------------------------------------------------------------
  530.   # Definição da quantidade maxima de ícones na vertical.
  531.   #---------------------------------------------------------------------------    
  532.   MP_ICON_ROW_MAX = 2
  533.   #---------------------------------------------------------------------------
  534.   # Ativar o número de MP de ícones.
  535.   # Será necessário ter a imagem.
  536.   #
  537.   # MP_Icon_Number.png
  538.   #
  539.   #---------------------------------------------------------------------------
  540.   MP_ICON_NUMBER_VISIBLE = false
  541.   #---------------------------------------------------------------------------
  542.   # Definição da prioridade do sprite.
  543.   #---------------------------------------------------------------------------
  544.   MP_ICON_NUMBER_Z = 4
  545.   #---------------------------------------------------------------------------
  546.   # Posição do número do ícone
  547.   #---------------------------------------------------------------------------  
  548.   MP_ICON_NUMBER_POSITION = [0,64]
  549.   #---------------------------------------------------------------------------
  550.   # Definição do tipo alinhamento do número.
  551.   #
  552.   # 0 - Esquerda
  553.   # 1 - Centro
  554.   # 2 - Direita
  555.   #---------------------------------------------------------------------------  
  556.   MP_ICON_NUMBER_ALIGN_TYPE = 0    
  557.   #============================================================================
  558.   #============================================================================
  559.  
  560.  
  561.   #============================================================================
  562.   #============================================================================
  563.   # * TP SPRITE
  564.   #============================================================================
  565.   # Ativar o número de TP.
  566.   # Será necessário o arquivo.
  567.   #
  568.   # TP_Number.png
  569.   #    
  570.   #---------------------------------------------------------------------------
  571.   TP_NUMBER_VISIBLE = false
  572.   #---------------------------------------------------------------------------
  573.   # Definição da prioridade do sprite.
  574.   #---------------------------------------------------------------------------
  575.   TP_NUMBER_Z = 2  
  576.   #---------------------------------------------------------------------------
  577.   # Definição da posição do número de TP. [X,Y]
  578.   #---------------------------------------------------------------------------  
  579.   TP_NUMBER_POSITION = [190,14]
  580.   #---------------------------------------------------------------------------  
  581.   # Ativar o número de TP Total.
  582.   # Será necessário o arquivo.
  583.   #
  584.   # TP_Number_Max.png
  585.   #
  586.   #---------------------------------------------------------------------------
  587.   TP_NUMBER_MAX_VISIBLE = false
  588.   #---------------------------------------------------------------------------
  589.   # Definição da posição do número de TP Total. [X,Y]
  590.   #---------------------------------------------------------------------------  
  591.   TP_NUMBER_MAX_POSITION = [165,73]
  592.   #---------------------------------------------------------------------------
  593.   # Definição do tipo alinhamento do número.
  594.   #
  595.   # 0 - Esquerda
  596.   # 1 - Centro
  597.   # 2 - Direita
  598.   #---------------------------------------------------------------------------  
  599.   TP_NUMBER_ALIGN_TYPE = 2
  600.   #---------------------------------------------------------------------------
  601.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  602.   #---------------------------------------------------------------------------
  603.   TP_NUMBER_WAVE_ALIGN_EFFECT = false  
  604.   #---------------------------------------------------------------------------
  605.   # Apresentar os números em porcentagem.
  606.   #---------------------------------------------------------------------------    
  607.   TP_NUMBER_PERCENTAGE = false
  608.   #---------------------------------------------------------------------------
  609.   # Ativar números animados ("Rolantes").
  610.   #---------------------------------------------------------------------------  
  611.   TP_NUMBER_ANIMATION = false
  612.   #---------------------------------------------------------------------------
  613.   # Ativar a cor do TP baixo.
  614.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  615.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  616.   #
  617.   # NORMAL_COLOR
  618.   # LOW_PARAMETER_COLOR
  619.   #
  620.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  621.   #---------------------------------------------------------------------------  
  622.   TP_NUMBER_LOW_COLOR = false
  623.   #---------------------------------------------------------------------------
  624.   # Ativar o medidor de TP.
  625.   # Será necessário o arquivo.
  626.   #
  627.   # TP_Meter.png
  628.   #    
  629.   #---------------------------------------------------------------------------  
  630.   TP_METER_VISIBLE = false
  631.   #---------------------------------------------------------------------------
  632.   # Definição da prioridade do sprite.
  633.   #---------------------------------------------------------------------------
  634.   TP_METER_Z = 1  
  635.   #---------------------------------------------------------------------------
  636.   # Definição da posição do medidor de TP. [X,Y]
  637.   #---------------------------------------------------------------------------  
  638.   TP_METER_POSITION = [75,65]
  639.   #---------------------------------------------------------------------------
  640.   # Definição do ângulo do medidor.
  641.   #---------------------------------------------------------------------------  
  642.   TP_METER_ANGLE = 0
  643.   #---------------------------------------------------------------------------
  644.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  645.   # inverso.
  646.   #---------------------------------------------------------------------------  
  647.   TP_METER_MIRROR_EFFECT = false
  648.   #---------------------------------------------------------------------------
  649.   # Ativar o efeito animado de dano no medidor.
  650.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  651.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  652.   #
  653.   # NORMAL_COLOR
  654.   # DAMAGE_COLOR
  655.   #
  656.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  657.   #---------------------------------------------------------------------------  
  658.   TP_METER_REDUCTION_ANIMATION = false
  659.   #---------------------------------------------------------------------------
  660.   # Ativar o efeito animado do "medidor fluindo".
  661.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  662.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  663.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  664.   #---------------------------------------------------------------------------  
  665.   TP_METER_GRADIENT_ANIMATION = false
  666.   #---------------------------------------------------------------------------
  667.   # Ativar TP em ícones.
  668.   # Será necessário ter a imagem.
  669.   #
  670.   # TP_Icon.png
  671.   #
  672.   #---------------------------------------------------------------------------
  673.   TP_ICON_VISIBLE = false
  674.   #---------------------------------------------------------------------------
  675.   # Definição da prioridade do sprite.
  676.   #---------------------------------------------------------------------------
  677.   TP_ICON_Z = 1  
  678.   #---------------------------------------------------------------------------
  679.   # Posição do ícone de TP.
  680.   #---------------------------------------------------------------------------  
  681.   TP_ICON_POSITION = [200,128]
  682.   #---------------------------------------------------------------------------
  683.   # Ativar o sprite EX do ultimo ícone
  684.   # Será necessário ter a imagem.
  685.   #
  686.   # TP_Icon_EX.png
  687.   #
  688.   #---------------------------------------------------------------------------
  689.   TP_ICON_EX_VISIBLE = false
  690.   #---------------------------------------------------------------------------
  691.   # Posição do ícone Animado.
  692.   #---------------------------------------------------------------------------  
  693.   TP_ICON_EX_POSITION = [0,0]
  694.   #---------------------------------------------------------------------------
  695.   # Ativar o efeito de Zoom do Sprite.
  696.   #---------------------------------------------------------------------------
  697.   TP_ICON_EX_ZOOM_EFFECT = false
  698.   #---------------------------------------------------------------------------
  699.   # Espaço entre os ícones.
  700.   #---------------------------------------------------------------------------    
  701.   TP_ICON_SPACE = [-10,-10]
  702.   #---------------------------------------------------------------------------
  703.   # Definição da quantidade maxima de ícones na horizontal.
  704.   #---------------------------------------------------------------------------  
  705.   TP_ICON_COL_MAX = 10
  706.   #---------------------------------------------------------------------------
  707.   # Definição da quantidade maxima de ícones na vertical.
  708.   #---------------------------------------------------------------------------    
  709.   TP_ICON_ROW_MAX = 2
  710.   #---------------------------------------------------------------------------
  711.   # Ativar o número de TP de ícones.
  712.   # Será necessário ter a imagem.
  713.   #
  714.   # TP_Icon_Number.png
  715.   #
  716.   #---------------------------------------------------------------------------
  717.   TP_ICON_NUMBER_VISIBLE = false
  718.   #---------------------------------------------------------------------------
  719.   # Definição da prioridade do sprite.
  720.   #---------------------------------------------------------------------------
  721.   TP_ICON_NUMBER_Z = 4
  722.   #---------------------------------------------------------------------------
  723.   # Posição do número do ícone
  724.   #---------------------------------------------------------------------------  
  725.   TP_ICON_NUMBER_POSITION = [0,128]
  726.   #---------------------------------------------------------------------------
  727.   # Definição do tipo alinhamento do número.
  728.   #
  729.   # 0 - Esquerda
  730.   # 1 - Centro
  731.   # 2 - Direita
  732.   #---------------------------------------------------------------------------  
  733.   TP_ICON_NUMBER_ALIGN_TYPE = 0    
  734.   #============================================================================
  735.   #============================================================================
  736.  
  737.  
  738.   #============================================================================
  739.   #============================================================================
  740.   # * LEVEL / EXP SPRITE
  741.   #============================================================================
  742.   # Ativar o número de Level.
  743.   # Será necessário o arquivo.
  744.   #
  745.   # LV_Number.png
  746.   #    
  747.   #---------------------------------------------------------------------------
  748.   LEVEL_NUMBER_VISIBLE = true
  749.   #---------------------------------------------------------------------------
  750.   # Definição da prioridade do Sprite.
  751.   #---------------------------------------------------------------------------    
  752.   LEVEL_NUMBER_Z = 2
  753.   #---------------------------------------------------------------------------
  754.   # Definição da posição do número do Level. [X,Y]
  755.   #---------------------------------------------------------------------------  
  756.   LEVEL_NUMBER_POSITION = [49,51]
  757.   #---------------------------------------------------------------------------
  758.   # Definição do tipo alinhamento do número.
  759.   #
  760.   # 0 - Esquerda
  761.   # 1 - Centro
  762.   # 2 - Direita
  763.   #---------------------------------------------------------------------------  
  764.   LEVEL_NUMBER_ALIGN_TYPE = 1    
  765.   #---------------------------------------------------------------------------
  766.   # Ativar o medidor de exp.
  767.   # Será necessário o arquivo.
  768.   #
  769.   # LV_Meter.png
  770.   #    
  771.   #---------------------------------------------------------------------------  
  772.   LEVEL_METER_VISIBLE = true
  773.   #---------------------------------------------------------------------------
  774.   # Definição da prioridade do Sprite.
  775.   #---------------------------------------------------------------------------    
  776.   LEVEL_METER_Z = 1  
  777.   #---------------------------------------------------------------------------
  778.   # Definição da posição do medidor de experiência. [X,Y]
  779.   #---------------------------------------------------------------------------  
  780.   LEVEL_METER_POSITION = [5,57]
  781.   #---------------------------------------------------------------------------
  782.   # Definição do ângulo do medidor.
  783.   #---------------------------------------------------------------------------  
  784.   LEVEL_METER_ANGLE = 0  
  785.   #---------------------------------------------------------------------------
  786.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  787.   # inverso.
  788.   #---------------------------------------------------------------------------  
  789.   LEVEL_METER_MIRROR_EFFECT = false
  790.   #---------------------------------------------------------------------------
  791.   # Ativar o número de exp necessário para atingir o level.
  792.   # Será necessário o arquivo.
  793.   #
  794.   # LV_Number_Exp.png
  795.   #    
  796.   #---------------------------------------------------------------------------  
  797.   LEVEL_NUMBER_EXP_VISIBLE = false
  798.   #---------------------------------------------------------------------------
  799.   # Definição da posição do número de experiência. [X,Y]
  800.   #---------------------------------------------------------------------------  
  801.   LEVEL_NUMBER_EXP_POSITION = [180,96]
  802.   #---------------------------------------------------------------------------
  803.   # Definição do tipo alinhamento do número.
  804.   #
  805.   # 0 - Esquerda
  806.   # 1 - Centro
  807.   # 2 - Direita
  808.   #---------------------------------------------------------------------------  
  809.   LEVEL_NUMBER_EXP_ALIGN_TYPE = 2    
  810.   #---------------------------------------------------------------------------
  811.   # Definição do tipo de exp apresentado na HUD.
  812.   #
  813.   # 0 = Exp necessária para atingir o próximo nível. (Next EXP)
  814.   # 1 = Exp total do personagem. (Current EXP)
  815.   #---------------------------------------------------------------------------  
  816.   LEVEL_NUMBER_EXP_TYPE = 0
  817.   #============================================================================
  818.   #============================================================================
  819.  
  820.  
  821.   #============================================================================
  822.   #============================================================================
  823.   # * STATE SPRITE
  824.   #============================================================================
  825.   # Ativar as condições.
  826.   #---------------------------------------------------------------------------  
  827.   STATES_VISIBLE = true
  828.   #---------------------------------------------------------------------------
  829.   # Definição da prioridade do sprite.
  830.   #---------------------------------------------------------------------------    
  831.   STATES_Z = 1
  832.   #---------------------------------------------------------------------------
  833.   # Definição da posição das condições. [X,Y]
  834.   #---------------------------------------------------------------------------  
  835.   STATES_POSITION = [147,60]
  836.   #---------------------------------------------------------------------------
  837.   # Ativar o efeito animado das condições deslizando.
  838.   #---------------------------------------------------------------------------  
  839.   STATES_SCROLLING_ANIMATION = false
  840.   #---------------------------------------------------------------------------
  841.   # Definição do ângulo do sprite.
  842.   #---------------------------------------------------------------------------  
  843.   STATE_ANGLE = 0
  844.   #============================================================================
  845.   #============================================================================
  846.  
  847.   #============================================================================
  848.   #============================================================================
  849.   # * SECOND LAYOUT (Overlayer)
  850.   #============================================================================  
  851.   # Ativar a segunda camada de Layout
  852.   # Será necessário o arquivo.
  853.   #
  854.   # Layout_2.png
  855.   #
  856.   #============================================================================  
  857.   SECOND_LAYOUT = true
  858.   #---------------------------------------------------------------------------
  859.   # Definição da prioridade do sprite.
  860.   #---------------------------------------------------------------------------  
  861.   SECOND_LAYOUT_Z = 10
  862.   #---------------------------------------------------------------------------
  863.   # Definição da posição do sprite.
  864.   #---------------------------------------------------------------------------  
  865.   SECOND_LAYOUT_POSITION = [19,18]
  866.   #============================================================================
  867.   #============================================================================
  868.  
  869.   #============================================================================
  870.   #============================================================================
  871.   # * GOLD HUD
  872.   #============================================================================  
  873.   # Ativar a HUD de ouro. (Dinheiro)
  874.   # Serão necessários os arquivos.
  875.   #
  876.   # Gold_Layout.png
  877.   # Gold_Number.png
  878.   #
  879.   #============================================================================  
  880.   GOLD_VISIBLE = false
  881.   #---------------------------------------------------------------------------
  882.   # Ativar o Smart Fade separado da hud principal.
  883.   #---------------------------------------------------------------------------  
  884.   GOLD_DETACHED_SMART_FADE = true
  885.   #---------------------------------------------------------------------------
  886.   # Definição da área "extra" do alcance do Smart Fade.
  887.   # O alcance é baseado no tamanho da imagem do Layout.
  888.   #---------------------------------------------------------------------------  
  889.   GOLD_SMART_FADE_RANGE_X = [-32,0]
  890.   GOLD_SMART_FADE_RANGE_Y = [0,32]
  891.   #---------------------------------------------------------------------------
  892.   # Definição da prioridade da hud.
  893.   #---------------------------------------------------------------------------  
  894.   GOLD_HUD_Z = 0
  895.   #---------------------------------------------------------------------------
  896.   # Definição da posição geral da hud, influência em todos os sprites da hud.
  897.   #---------------------------------------------------------------------------
  898.   GOLD_POSITION = [5,366]
  899.   #---------------------------------------------------------------------------
  900.   # Definição da posição do número.
  901.   #---------------------------------------------------------------------------    
  902.   GOLD_NUMBER_POSITION = [80,20]
  903.   #---------------------------------------------------------------------------
  904.   # Definição do tipo alinhamento do número.
  905.   #
  906.   # 0 - Esquerda
  907.   # 1 - Centro
  908.   # 2 - Direita
  909.   #---------------------------------------------------------------------------    
  910.   GOLD_NUMBER_ALIGN_TYPE = 1
  911.   #============================================================================
  912.   #============================================================================  
  913.    
  914.  
  915.   #============================================================================
  916.   #============================================================================
  917.   # * EQUIPMENT HUD
  918.   #============================================================================  
  919.   # Ativar a HUD de equipamento.
  920.   # Será necessário o arquivo.
  921.   #
  922.   # Equip_Layout.png
  923.   #
  924.   #============================================================================  
  925.   EQUIPMENT_VISIBLE = true
  926.   #---------------------------------------------------------------------------
  927.   # Ativar o Smart Fade separado da hud principal.
  928.   #---------------------------------------------------------------------------    
  929.   EQUIPMENT_DETACHED_SMART_FADE = true
  930.   #---------------------------------------------------------------------------
  931.   # Definição da área "extra" do alcance do Smart Fade.
  932.   # O alcance é baseado no tamanho da imagem do Layout.
  933.   #---------------------------------------------------------------------------    
  934.   EQUIPMENT_SMART_FADE_RANGE_X = [0,0]
  935.   EQUIPMENT_SMART_FADE_RANGE_Y = [0,32]
  936.   #---------------------------------------------------------------------------
  937.   # Definição da prioridade da hud.
  938.   #---------------------------------------------------------------------------  
  939.   EQUIPMENT_Z = 0
  940.   #---------------------------------------------------------------------------
  941.   # Definição da posição geral da hud, influência em todos os sprites da hud.
  942.   #---------------------------------------------------------------------------
  943.   EQUIPMENT_POSITION = [5,90]
  944.   #---------------------------------------------------------------------------
  945.   # Apresentar o ícone da arma e a definição da posição do ícone.
  946.   #---------------------------------------------------------------------------  
  947.   EQUIPMENT_WEAPON_VISIBLE = true
  948.   EQUIPMENT_WEAPON_POSITION = [8,9]
  949.   #---------------------------------------------------------------------------
  950.   # Apresentar o ícone da escudo e a definição da posição do ícone.
  951.   #---------------------------------------------------------------------------  
  952.   EQUIPMENT_SHIELD_VISIBLE = false
  953.   EQUIPMENT_SHIELD_POSITION = [2,2]  
  954.   #---------------------------------------------------------------------------
  955.   # Apresentar o ícone da capacete e a definição da posição do ícone.
  956.   #---------------------------------------------------------------------------  
  957.   EQUIPMENT_HEAD_VISIBLE = false
  958.   EQUIPMENT_HEAD_POSITION = [2,36]
  959.   #---------------------------------------------------------------------------
  960.   # Apresentar o ícone da armadura e a definição da posição do ícone.
  961.   #---------------------------------------------------------------------------    
  962.   EQUIPMENT_BODY_VISIBLE = false
  963.   EQUIPMENT_BODY_POSITION = [67,2]  
  964.   #---------------------------------------------------------------------------
  965.   # Apresentar o ícone do acessório e a definição da posição do ícone.
  966.   #---------------------------------------------------------------------------    
  967.   EQUIPMENT_ACCESSORY_VISIBLE = true
  968.   EQUIPMENT_ACCESSORY_POSITION = [38,37]  
  969.   #============================================================================
  970.   #============================================================================  
  971.  
  972.  
  973. end
  974. #==============================================================================
  975. #==============================================================================
  976. # ** Ultima Hud
  977. #==============================================================================
  978. #==============================================================================
  979. #==============================================================================
  980. # ** Game System
  981. #==============================================================================
  982. class Game_System
  983.  
  984.   attr_accessor :hud_face
  985.   attr_accessor :hud_visible
  986.   attr_accessor :hud_position
  987.  
  988.   #--------------------------------------------------------------------------
  989.   # * Initialize
  990.   #--------------------------------------------------------------------------  
  991.   alias mog_master_hud_initialize initialize
  992.   def initialize
  993.       @hud_face = [0,0]
  994.       @hud_visible = MOG_ULTIMA_HUD::INITIAL_VISIBLE
  995.       @hud_position = [MOG_ULTIMA_HUD::HUD_POSITION[0],MOG_ULTIMA_HUD::HUD_POSITION[1]]
  996.       mog_master_hud_initialize
  997.   end
  998.  
  999. end
  1000. #==============================================================================
  1001. # ** Game Interpreter
  1002. #==============================================================================
  1003. class Game_Interpreter
  1004.  
  1005.   #--------------------------------------------------------------------------
  1006.   # * Hud Visible
  1007.   #--------------------------------------------------------------------------
  1008.   def hud_visible(value = true)
  1009.       $game_system.hud_visible = value
  1010.   end  
  1011.  
  1012.   #--------------------------------------------------------------------------
  1013.   # * Hud Visible
  1014.   #--------------------------------------------------------------------------
  1015.   def hud_position(x = 0, y = 0)
  1016.       $game_system.hud_position = [x,y]
  1017.       SceneManager.goto(Scene_Refresh_Map)
  1018.   end
  1019.  
  1020.   #--------------------------------------------------------------------------
  1021.   # * Refresh Screen
  1022.   #--------------------------------------------------------------------------  
  1023.   def refresh_screen
  1024.       SceneManager.goto(Scene_Refresh_Map)
  1025.   end
  1026.  
  1027.   #--------------------------------------------------------------------------
  1028.   # * Testing Hud
  1029.   #--------------------------------------------------------------------------    
  1030.   def testing_hud(perc = 15, death = false)
  1031.       return if $game_party.members[0] == nil
  1032.       return if $game_party.members[0].hp == 0
  1033.       actor = $game_party.members[0]
  1034.       hp_per = actor.mhp * perc / 100
  1035.       mp_per = actor.mmp * perc / 100
  1036.       tp_per = actor.max_tp * perc / 100
  1037.       hp_per = perc > 0 ? 1 : -1 if hp_per == 0
  1038.       mp_per = perc > 0 ? 1 : -1 if mp_per == 0
  1039.       tp_per = perc > 0 ? 1 : -1 if tp_per == 0
  1040.       actor.hp -= hp_per
  1041.       actor.hp = 1 if !death and actor.hp == 0
  1042.       actor.mp -= mp_per
  1043.       actor.tp -= tp_per
  1044.   end
  1045.  
  1046.   #--------------------------------------------------------------------------
  1047.   # * Testing Hud Level
  1048.   #--------------------------------------------------------------------------      
  1049.   def testing_hud_level
  1050.       return if $game_party.members[0] == nil
  1051.       actor = $game_party.members[0]
  1052.       actor.change_level(actor.level + 1, false)
  1053.       actor.gain_exp_test
  1054.   end
  1055.  
  1056. end
  1057. #==============================================================================
  1058. # ** Cache
  1059. #==============================================================================
  1060. module Cache
  1061.  
  1062.   #--------------------------------------------------------------------------
  1063.   # * Hud
  1064.   #--------------------------------------------------------------------------
  1065.   def self.ultima_hud(filename)
  1066.       load_bitmap("Graphics/Huds/Ultima/", filename)
  1067.   end
  1068.  
  1069. end
  1070. #==============================================================================
  1071. # ** Game Actor
  1072. #==============================================================================
  1073. class Game_Actor < Game_Battler
  1074.  
  1075.   #--------------------------------------------------------------------------
  1076.   # ● Real Next Level
  1077.   #--------------------------------------------------------------------------  
  1078.   def real_next_level
  1079.       next_level_exp - exp_for_level(level)
  1080.   end
  1081.  
  1082.   #--------------------------------------------------------------------------
  1083.   # ● Remain Exp
  1084.   #--------------------------------------------------------------------------  
  1085.   def remain_exp
  1086.       exp - exp_for_level(level)
  1087.   end
  1088.  
  1089.   #--------------------------------------------------------------------------
  1090.   # ● Gain Exp Test
  1091.   #--------------------------------------------------------------------------
  1092.   def gain_exp_test
  1093.       exp_r = rand(next_level_exp)
  1094.       change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1095.   end    
  1096.  
  1097.   #--------------------------------------------------------------------------
  1098.   # ● Low HP?
  1099.   #--------------------------------------------------------------------------    
  1100.   def low_hp?
  1101.       hp <= (mhp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
  1102.   end
  1103.  
  1104.   #--------------------------------------------------------------------------
  1105.   # ● Low MP?
  1106.   #--------------------------------------------------------------------------    
  1107.   def low_mp?
  1108.       mp <= (mmp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
  1109.   end  
  1110.  
  1111.   #--------------------------------------------------------------------------
  1112.   # ● Low TP?
  1113.   #--------------------------------------------------------------------------    
  1114.   def low_tp?
  1115.       tp <= (max_tp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
  1116.   end  
  1117.    
  1118. end
  1119. #==============================================================================
  1120. # ** Scene Refresh Map
  1121. #==============================================================================
  1122. class Scene_Refresh_Map
  1123.  
  1124.   #--------------------------------------------------------------------------
  1125.   # * Main
  1126.   #--------------------------------------------------------------------------  
  1127.   def main
  1128.       Graphics.transition(10)
  1129.       SceneManager.goto(Scene_Map)
  1130.       Graphics.freeze
  1131.   end
  1132.  
  1133. end
  1134. #==============================================================================
  1135. # ** Spriteset Map
  1136. #==============================================================================
  1137. class Spriteset_Map
  1138.   #--------------------------------------------------------------------------
  1139.   # * Initialize
  1140.   #--------------------------------------------------------------------------
  1141.   alias mog_ultima_hud_initialize initialize
  1142.   def initialize
  1143.       create_ultima_hud
  1144.       mog_ultima_hud_initialize
  1145.   end
  1146.  
  1147.   #--------------------------------------------------------------------------
  1148.   # * Dispose
  1149.   #--------------------------------------------------------------------------  
  1150.   alias mog_ultima_hud_dispose dispose
  1151.   def dispose
  1152.       mog_ultima_hud_dispose
  1153.       dispose_ultima_hud
  1154.   end
  1155.  
  1156.   #--------------------------------------------------------------------------
  1157.   # * Update
  1158.   #--------------------------------------------------------------------------  
  1159.   alias mog_ultima_hud_update update
  1160.   def update
  1161.       mog_ultima_hud_update
  1162.       update_ultima_hud
  1163.   end
  1164.  
  1165.   #--------------------------------------------------------------------------
  1166.   # * Create Ultima Hud
  1167.   #--------------------------------------------------------------------------    
  1168.   def create_ultima_hud
  1169.       return if @mhud != nil
  1170.       @ultima_hud = Ultima_Hud.new
  1171.   end
  1172.  
  1173.   #--------------------------------------------------------------------------
  1174.   # * Dispose Ultima Hud
  1175.   #--------------------------------------------------------------------------  
  1176.   def dispose_ultima_hud
  1177.       return if @ultima_hud == nil
  1178.       @ultima_hud.dispose
  1179.       @ultima_hud = nil
  1180.   end
  1181.  
  1182.   #--------------------------------------------------------------------------
  1183.   # * Update Ultima Hud
  1184.   #--------------------------------------------------------------------------    
  1185.   def update_ultima_hud
  1186.       return if @ultima_hud == nil
  1187.       @ultima_hud.update
  1188.   end
  1189.  
  1190. end
  1191. #==============================================================================
  1192. #==============================================================================
  1193. # ** Ultima Hud (INITIALIZE)
  1194. #==============================================================================
  1195. #==============================================================================
  1196. class Ultima_Hud
  1197.   include MOG_ULTIMA_HUD
  1198.  
  1199.   #--------------------------------------------------------------------------
  1200.   # * Initialize
  1201.   #--------------------------------------------------------------------------  
  1202.   def initialize
  1203.       pre_cache
  1204.       setup
  1205.       create_sprites
  1206.   end
  1207.  
  1208.   #--------------------------------------------------------------------------
  1209.   # * Setup
  1210.   #--------------------------------------------------------------------------    
  1211.   def setup
  1212.       @actor = $game_party.members[0]
  1213.       $game_system.hud_face = [1,0]
  1214.       @hp_icon_max = -1
  1215.       @hp_icon_old = -1
  1216.       @hp_icon_col_max = HP_ICON_COL_MAX
  1217.       @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  1218.       @hp_icon_row_max = HP_ICON_ROW_MAX
  1219.       @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  1220.       @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  1221.       @mp_icon_max = -1
  1222.       @mp_icon_old = -1
  1223.       @mp_icon_col_max = MP_ICON_COL_MAX
  1224.       @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  1225.       @mp_icon_row_max = MP_ICON_ROW_MAX
  1226.       @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  1227.       @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  1228.       @tp_icon_max = -1
  1229.       @tp_icon_old = -1
  1230.       @tp_icon_col_max = TP_ICON_COL_MAX
  1231.       @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  1232.       @tp_icon_row_max = TP_ICON_ROW_MAX
  1233.       @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  1234.       @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  1235.       setup_actor
  1236.   end
  1237.      
  1238.   #--------------------------------------------------------------------------
  1239.   # * Setup Actor
  1240.   #--------------------------------------------------------------------------    
  1241.   def setup_actor
  1242.       return if @actor == nil
  1243.       @hp_number_refresh = true
  1244.       @hp_number2_refresh = true
  1245.       @hp_number_old = @actor.hp
  1246.       @hp_number2_old = @actor.mhp
  1247.       @hp_old_meter = 0      
  1248.       @mp_number_refresh = true
  1249.       @mp_number2_refresh = true
  1250.       @mp_number_old = @actor.mp
  1251.       @mp_number2_old = @actor.mmp
  1252.       @mp_old_meter = 0      
  1253.       @tp_number_refresh = true
  1254.       @tp_number2_refresh = true
  1255.       @tp_number_old = @actor.tp
  1256.       @tp_number2_old = @actor.max_tp  
  1257.       @tp_old_meter = 0      
  1258.   end  
  1259.  
  1260.   #--------------------------------------------------------------------------
  1261.   # * Create Sprites
  1262.   #--------------------------------------------------------------------------    
  1263.   def create_sprites
  1264.       dispose
  1265.       return if @actor == nil
  1266.       create_layout
  1267.       create_layout_2
  1268.       create_name
  1269.       create_face
  1270.       create_hp_number
  1271.       create_hp_number_max
  1272.       create_hp_meter
  1273.       create_hp_icon
  1274.       create_hp_icon_ex
  1275.       create_hp_icon_number
  1276.       create_mp_number
  1277.       create_mp_number_max
  1278.       create_mp_meter
  1279.       create_mp_icon
  1280.       create_mp_icon_ex
  1281.       create_mp_icon_number
  1282.       create_tp_number
  1283.       create_tp_number_max
  1284.       create_tp_meter
  1285.       create_tp_icon
  1286.       create_tp_icon_ex
  1287.       create_tp_icon_number
  1288.       create_level_number
  1289.       create_level_number_exp
  1290.       create_level_meter
  1291.       create_states
  1292.       create_equipment
  1293.       create_gold
  1294.       update
  1295.   end    
  1296.  
  1297. end
  1298. #==============================================================================
  1299. #==============================================================================
  1300. # ** Ultima Hud (PRE CACHE)
  1301. #==============================================================================
  1302. #==============================================================================
  1303. class Ultima_Hud
  1304.   #--------------------------------------------------------------------------
  1305.   # * Pre Cache
  1306.   #--------------------------------------------------------------------------
  1307.   def pre_cache
  1308.       @force_hide = false
  1309.       @force_hide_time = 0
  1310.       @fade_hud = false
  1311.       @fade_hud_gold = false    
  1312.       @fade_hud_equip = false
  1313.       #------------------------------------------------
  1314.       # HP
  1315.       #------------------------------------------------
  1316.       if HP_NUMBER_VISIBLE
  1317.          @hp_number_image = Cache.ultima_hud("HP_Number")
  1318.          @hp_number_cw = @hp_number_image.width / 10
  1319.          if HP_NUMBER_LOW_COLOR
  1320.             @hp_number_ch = @hp_number_image.height / 2
  1321.          else
  1322.             @hp_number_ch = @hp_number_image.height
  1323.          end  
  1324.          @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  1325.          @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number      
  1326.       end
  1327.       if HP_NUMBER_MAX_VISIBLE
  1328.          @hp_number2_image = Cache.ultima_hud("HP_Number_Max")
  1329.          @hp_number2_cw = @hp_number2_image.width / 10
  1330.          @hp_number2_ch = @hp_number2_image.height
  1331.       end
  1332.       if HP_METER_VISIBLE
  1333.          @hp_meter_image = Cache.ultima_hud("HP_Meter")
  1334.          if HP_METER_GRADIENT_ANIMATION
  1335.             @hp_meter_cw = @hp_meter_image.width / 3
  1336.          else  
  1337.             @hp_meter_cw = @hp_meter_image.width
  1338.          end  
  1339.          if HP_METER_REDUCTION_ANIMATION
  1340.             @hp_meter_ch = @hp_meter_image.height / 2
  1341.          else
  1342.             @hp_meter_ch = @hp_meter_image.height
  1343.          end  
  1344.       end
  1345.       if HP_ICON_VISIBLE
  1346.          @hp_icon_image = Cache.ultima_hud("HP_Icon")
  1347.          @hp_icon_cw = @hp_icon_image.width / 2
  1348.          @hp_icon_ch = @hp_icon_image.height
  1349.       end
  1350.       if HP_ICON_EX_VISIBLE
  1351.          @hp_icon2_image = Cache.ultima_hud("HP_Icon_EX")
  1352.          @hp_icon2_cw = @hp_icon2_image.width
  1353.          @hp_icon2_ch = @hp_icon2_image.height        
  1354.       end      
  1355.       if HP_ICON_NUMBER_VISIBLE
  1356.          @hp_icon_number_image = Cache.ultima_hud("HP_Icon_Number")
  1357.          @hp_icon_number_cw = @hp_icon_number_image.width / 10
  1358.          @hp_icon_number_ch = @hp_icon_number_image.height        
  1359.       end
  1360.       #------------------------------------------------
  1361.       # MP
  1362.       #------------------------------------------------
  1363.       if MP_NUMBER_VISIBLE
  1364.          @mp_number_image = Cache.ultima_hud("MP_Number")
  1365.          @mp_number_cw = @mp_number_image.width / 10
  1366.          if MP_NUMBER_LOW_COLOR
  1367.             @mp_number_ch = @mp_number_image.height / 2
  1368.          else
  1369.             @mp_number_ch = @mp_number_image.height
  1370.         end
  1371.         @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  1372.         @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  1373.       end
  1374.       if MP_NUMBER_MAX_VISIBLE
  1375.          @mp_number2_image = Cache.ultima_hud("MP_Number_Max")
  1376.          @mp_number2_cw = @mp_number2_image.width / 10
  1377.          @mp_number2_ch = @mp_number2_image.height
  1378.       end
  1379.       if MP_METER_VISIBLE
  1380.          @mp_meter_image = Cache.ultima_hud("MP_Meter")
  1381.          if MP_METER_GRADIENT_ANIMATION
  1382.             @mp_meter_cw = @mp_meter_image.width / 3
  1383.          else  
  1384.             @mp_meter_cw = @mp_meter_image.width
  1385.          end  
  1386.          if MP_METER_REDUCTION_ANIMATION
  1387.             @mp_meter_ch = @mp_meter_image.height / 2
  1388.          else
  1389.             @mp_meter_ch = @mp_meter_image.height
  1390.          end
  1391.       end
  1392.       if MP_ICON_VISIBLE
  1393.          @mp_icon_image = Cache.ultima_hud("MP_Icon")
  1394.          @mp_icon_cw = @mp_icon_image.width / 2
  1395.          @mp_icon_ch = @mp_icon_image.height
  1396.       end
  1397.       if MP_ICON_EX_VISIBLE
  1398.          @mp_icon2_image = Cache.ultima_hud("MP_Icon_EX")
  1399.          @mp_icon2_cw = @mp_icon2_image.width
  1400.          @mp_icon2_ch = @mp_icon2_image.height        
  1401.       end      
  1402.       if MP_ICON_NUMBER_VISIBLE
  1403.          @mp_icon_number_image = Cache.ultima_hud("MP_Icon_Number")
  1404.          @mp_icon_number_cw = @mp_icon_number_image.width / 10
  1405.          @mp_icon_number_ch = @mp_icon_number_image.height        
  1406.       end
  1407.       #------------------------------------------------
  1408.       # TP
  1409.       #------------------------------------------------
  1410.       if TP_NUMBER_VISIBLE
  1411.          @tp_number_image = Cache.ultima_hud("TP_Number")
  1412.          @tp_number_cw = @tp_number_image.width / 10
  1413.          if TP_NUMBER_LOW_COLOR
  1414.             @tp_number_ch = @tp_number_image.height / 2
  1415.          else
  1416.             @tp_number_ch = @tp_number_image.height
  1417.          end  
  1418.         @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  1419.         @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number      
  1420.       end
  1421.       if TP_NUMBER_MAX_VISIBLE
  1422.          @tp_number2_image = Cache.ultima_hud("TP_Number_Max")
  1423.          @tp_number2_cw = @tp_number2_image.width / 10
  1424.          @tp_number2_ch = @tp_number2_image.height
  1425.       end
  1426.       if TP_METER_VISIBLE
  1427.          @tp_meter_image = Cache.ultima_hud("TP_Meter")
  1428.          if TP_METER_GRADIENT_ANIMATION
  1429.             @tp_meter_cw = @tp_meter_image.width / 3
  1430.          else  
  1431.             @tp_meter_cw = @tp_meter_image.width
  1432.          end  
  1433.          if TP_METER_REDUCTION_ANIMATION
  1434.             @tp_meter_ch = @tp_meter_image.height / 2      
  1435.          else
  1436.             @tp_meter_ch = @tp_meter_image.height
  1437.          end  
  1438.       end        
  1439.       if TP_ICON_VISIBLE
  1440.          @tp_icon_image = Cache.ultima_hud("TP_Icon")
  1441.          @tp_icon_cw = @tp_icon_image.width / 2
  1442.          @tp_icon_ch = @tp_icon_image.height
  1443.       end  
  1444.       if TP_ICON_EX_VISIBLE
  1445.          @tp_icon2_image = Cache.ultima_hud("TP_Icon_EX")
  1446.          @tp_icon2_cw = @tp_icon2_image.width
  1447.          @tp_icon2_ch = @tp_icon2_image.height        
  1448.       end      
  1449.       if TP_ICON_NUMBER_VISIBLE
  1450.          @tp_icon_number_image = Cache.ultima_hud("TP_Icon_Number")
  1451.          @tp_icon_number_cw = @tp_icon_number_image.width / 10
  1452.          @tp_icon_number_ch = @tp_icon_number_image.height        
  1453.       end
  1454.       #------------------------------------------------
  1455.       # LV
  1456.       #------------------------------------------------  
  1457.       if LEVEL_NUMBER_VISIBLE
  1458.          @lv_number_image = Cache.ultima_hud("LV_Number")
  1459.          @lv_number_cw = @lv_number_image.width / 10
  1460.          @lv_number_ch = @lv_number_image.height
  1461.       end      
  1462.       if LEVEL_NUMBER_EXP_VISIBLE
  1463.          @lv_number2_image = Cache.ultima_hud("LV_Number_Exp")
  1464.          @lv_number2_cw = @lv_number2_image.width / 10
  1465.          @lv_number2_ch = @lv_number2_image.height
  1466.       end      
  1467.       if LEVEL_METER_VISIBLE
  1468.          @lv_meter_image = Cache.ultima_hud("LV_Meter")
  1469.          @lv_meter_cw = @lv_meter_image.width
  1470.          @lv_meter_ch = @lv_meter_image.height      
  1471.       end      
  1472.       #------------------------------------------------
  1473.       # ICON
  1474.       #------------------------------------------------  
  1475.       if STATES_VISIBLE or EQUIPMENT_VISIBLE
  1476.          @icon_image = Cache.system("Iconset")
  1477.       end        
  1478.   end
  1479.  
  1480.   #--------------------------------------------------------------------------
  1481.   # * Check Icon Image
  1482.   #--------------------------------------------------------------------------          
  1483.   def check_icon_image
  1484.       if @icon_image == nil or @icon_image.disposed?
  1485.          @icon_image = Cache.system("Iconset")
  1486.       end  
  1487.   end  
  1488.  
  1489. end
  1490. #==============================================================================
  1491. #==============================================================================
  1492. # ** Ultima Hud (SPRITE SYSTEM)
  1493. #==============================================================================
  1494. #==============================================================================
  1495. class Ultima_Hud
  1496.  
  1497.   #--------------------------------------------------------------------------
  1498.   # * Update Number
  1499.   #--------------------------------------------------------------------------    
  1500.   def update_number(type,value)
  1501.       actor_value = @actor.hp if type == 0
  1502.       actor_value = @actor.mp if type == 1
  1503.       actor_value = @actor.tp if type == 2
  1504.       actor_value = @actor.mhp if type == 3
  1505.       actor_value = @actor.mmp if type == 4
  1506.       actor_value = @actor.max_tp if type == 5
  1507.       actor_value = $game_party.gold if type == 6
  1508.       if value < actor_value
  1509.          value += number_refresh_speed(actor_value,value)
  1510.          value = actor_value if value >= actor_value
  1511.          refresh_sprite_number(type,value)
  1512.      elsif value > actor_value
  1513.          value -= number_refresh_speed(actor_value,value)
  1514.          value = actor_value if value <= actor_value
  1515.          refresh_sprite_number(type,value)
  1516.      end  
  1517.   end
  1518.  
  1519.   #--------------------------------------------------------------------------
  1520.   # * Number Refresh Speed
  1521.   #--------------------------------------------------------------------------      
  1522.   def number_refresh_speed(actor_value,value)
  1523.       n =  1 * (actor_value - value).abs / 10
  1524.       return [[n, 99999999].min,1].max    
  1525.   end
  1526.  
  1527.   #--------------------------------------------------------------------------
  1528.   # * Update Number Fix
  1529.   #--------------------------------------------------------------------------      
  1530.   def update_number_fix(type)
  1531.       if type == 0
  1532.          @hp_number_old =  @actor.hp
  1533.          @hp_number_refresh = true
  1534.       elsif type == 1
  1535.          @mp_number_old =  @actor.mp
  1536.          @mp_number_refresh = true
  1537.       elsif type == 2
  1538.          @tp_number_old =  @actor.tp
  1539.          @tp_number_refresh = true  
  1540.       elsif type == 3
  1541.          @hp_number2_old =  @actor.mhp
  1542.          @hp_number2_refresh = true
  1543.       elsif type == 4
  1544.          @mp_number2_old =  @actor.mmp
  1545.          @mp_number2_refresh = true
  1546.       elsif type == 5
  1547.          @tp_number2_old =  @actor.max_tp
  1548.          @tp_number2_refresh = true          
  1549.       end  
  1550.   end  
  1551.  
  1552.   #--------------------------------------------------------------------------
  1553.   # * Refresh Sprite Number
  1554.   #--------------------------------------------------------------------------  
  1555.   def refresh_sprite_number(type,value)    
  1556.       @hp_number_refresh = true if type == 0
  1557.       @hp_number_old = value if type == 0
  1558.       @mp_number_refresh = true if type == 1
  1559.       @mp_number_old = value if type == 1
  1560.       @tp_number_refresh = true if type == 2
  1561.       @tp_number_old = value if type == 2
  1562.       @hp_number2_refresh = true if type == 3
  1563.       @hp_number2_old = value if type == 3
  1564.       @mp_number2_refresh = true if type == 4
  1565.       @mp_number2_old = value if type == 4
  1566.       @tp_number2_refresh = true if type == 5
  1567.       @tp_number2_old = value if type == 5
  1568.       @gold_refresh = true if type == 6
  1569.       @gold_old = value if type == 6      
  1570.   end  
  1571.  
  1572.   #--------------------------------------------------------------------------
  1573.   # * Refresh Number
  1574.   #--------------------------------------------------------------------------    
  1575.   def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  1576.       sprite.bitmap.clear
  1577.       clear_number_refresh(type)
  1578.       number_color = low_number_color(type,number_ch)
  1579.       if type == 0 and HP_NUMBER_PERCENTAGE
  1580.          value_max = @actor.mhp
  1581.          value = value.to_f / value_max.to_f * 100
  1582.          value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  1583.       elsif type == 1 and MP_NUMBER_PERCENTAGE
  1584.          value_max = @actor.mmp
  1585.          value = value.to_f / value_max.to_f * 100
  1586.       elsif type == 2 and TP_NUMBER_PERCENTAGE
  1587.          value_max = @actor.max_tp
  1588.          value = value.to_f / value_max.to_f * 100  
  1589.       elsif type == 3 and HP_NUMBER_PERCENTAGE
  1590.          value = 100
  1591.       elsif type == 4 and MP_NUMBER_PERCENTAGE
  1592.          value = 100
  1593.       elsif type == 5 and TP_NUMBER_PERCENTAGE
  1594.          value = 100
  1595.       end
  1596.       value = 9999999 if value > 9999999
  1597.       number_value = value.truncate.abs.to_s.split(//)
  1598.       wave_h = 0
  1599.       wave_h2 = wave_number ? (number_ch / 3) : 0
  1600.       wave_h3 = number_color != 0 ? wave_h2 : 0
  1601.       for r in 0..number_value.size - 1        
  1602.          number_value_abs = number_value[r].to_i
  1603.          wh = wave_h2 * wave_h
  1604.          wh2 = wave_h == 0 ? wave_h2 : 0
  1605.          nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  1606.          sprite.bitmap.blt(number_cw *  r, wh, image, nsrc_rect)
  1607.          wave_h = wave_h == 0 ? 1 : 0
  1608.       end
  1609.       refresh_number_position(type,number_value.size,number_cw)
  1610.   end
  1611.  
  1612.   #--------------------------------------------------------------------------
  1613.   # * Refresh Number
  1614.   #--------------------------------------------------------------------------    
  1615.   def refresh_number_position(type,number_value,number_cw)
  1616.       cx = number_value * number_cw
  1617.       if type == 0
  1618.          case HP_NUMBER_ALIGN_TYPE
  1619.            when 0; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0]
  1620.            when 1; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  1621.            when 2; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0] - cx
  1622.          end            
  1623.       elsif type == 1
  1624.          case MP_NUMBER_ALIGN_TYPE
  1625.            when 0; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0]
  1626.            when 1; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  1627.            when 2; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0] - cx
  1628.          end    
  1629.       elsif type == 2  
  1630.          case TP_NUMBER_ALIGN_TYPE
  1631.            when 0; @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0]
  1632.            when 1; @tp_number.x = $game_system.hud_position[0]+ TP_NUMBER_POSITION[0] - (cx / 2)
  1633.            when 2; @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0] - cx
  1634.          end          
  1635.       elsif type == 3  
  1636.          case HP_NUMBER_ALIGN_TYPE
  1637.            when 0; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  1638.            when 1; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  1639.            when 2; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  1640.          end          
  1641.       elsif type ==  4
  1642.          case MP_NUMBER_ALIGN_TYPE
  1643.            when 0; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  1644.            when 1; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  1645.            when 2; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  1646.          end          
  1647.       elsif type ==  5
  1648.          case TP_NUMBER_ALIGN_TYPE
  1649.            when 0; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  1650.            when 1; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  1651.            when 2; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  1652.          end
  1653.       elsif type ==  6    
  1654.          case GOLD_NUMBER_ALIGN_TYPE
  1655.            when 0; @gold_number.x = @gold_pos[0]
  1656.            when 1; @gold_number.x = @gold_pos[0] - (cx / 2)
  1657.            when 2; @gold_number.x = @gold_pos[0] - cx
  1658.          end            
  1659.       end  
  1660.   end
  1661.  
  1662.   #--------------------------------------------------------------------------
  1663.   # * Low Number Color
  1664.   #--------------------------------------------------------------------------      
  1665.   def low_number_color(type,number_ch)
  1666.       if type == 0
  1667.          if HP_NUMBER_LOW_COLOR
  1668.             return @actor.low_hp? ? number_ch : 0
  1669.          else
  1670.             return 0
  1671.          end  
  1672.       elsif type == 1
  1673.          if MP_NUMBER_LOW_COLOR    
  1674.             return @actor.low_mp? ? number_ch : 0
  1675.          else
  1676.             return 0
  1677.          end          
  1678.       elsif type == 2
  1679.          if TP_NUMBER_LOW_COLOR
  1680.             return @actor.low_tp? ? number_ch : 0
  1681.          else
  1682.             return 0
  1683.          end
  1684.       else    
  1685.          return 0  
  1686.       end    
  1687.   end
  1688.  
  1689.   #--------------------------------------------------------------------------
  1690.   # * Clear Number Refresh
  1691.   #--------------------------------------------------------------------------      
  1692.   def clear_number_refresh(type)
  1693.       @hp_number_refresh = false if type == 0
  1694.       @mp_number_refresh = false if type == 1
  1695.       @tp_number_refresh = false if type == 2
  1696.       @hp_number2_refresh = false if type == 3
  1697.       @mp_number2_refresh = false if type == 4
  1698.       @tp_number2_refresh = false if type == 5
  1699.       @gold_refresh = false if type == 6
  1700.   end  
  1701.  
  1702.   #--------------------------------------------------------------------------
  1703.   # * Fade Sprite
  1704.   #--------------------------------------------------------------------------
  1705.   def fade_sprite(sprite,fade_hud)
  1706.       if @force_hide
  1707.          sprite.opacity = 0 if @force_hide_time > 5
  1708.       else
  1709.          if fade_hud
  1710.              sprite.opacity -= 15 if sprite.opacity > SMART_FADE_LIMIT
  1711.              sprite.opacity = SMART_FADE_LIMIT if sprite.opacity < SMART_FADE_LIMIT
  1712.          else  
  1713.              sprite.opacity += 15
  1714.          end
  1715.       end
  1716.   end  
  1717.  
  1718.   #--------------------------------------------------------------------------
  1719.   # * Icon Limit
  1720.   #--------------------------------------------------------------------------      
  1721.   def icon_limit(value,value_max)
  1722.       n1 = value / value_max
  1723.       n2 = value - (n1 * value_max)
  1724.       n2 = value_max if (n2 == 0 and value > 0)
  1725.       return n2
  1726.   end  
  1727.  
  1728. end
  1729. #==============================================================================
  1730. #==============================================================================
  1731. # ** Ultima Hud (LAYOUT)
  1732. #==============================================================================
  1733. #==============================================================================
  1734. class Ultima_Hud
  1735.   #--------------------------------------------------------------------------
  1736.   # * Create Layout
  1737.   #--------------------------------------------------------------------------    
  1738.   def create_layout
  1739.       @layout = Sprite.new
  1740.       @layout.bitmap = Cache.ultima_hud("Layout")
  1741.       @layout.z = HUD_Z
  1742.       @layout.x = $game_system.hud_position[0]
  1743.       @layout.y = $game_system.hud_position[1]
  1744.       @layout.opacity = 0 if !$game_system.hud_visible
  1745.       @hud_size_x = [$game_system.hud_position[0] + SMART_FADE_RANGE_X[0], $game_system.hud_position[0] + @layout.bitmap.width + SMART_FADE_RANGE_X[1]]
  1746.       @hud_size_y = [$game_system.hud_position[1] + SMART_FADE_RANGE_Y[0], $game_system.hud_position[1] + @layout.bitmap.height + SMART_FADE_RANGE_Y[1]]
  1747.   end    
  1748.  
  1749.   #--------------------------------------------------------------------------
  1750.   # * Update Layout
  1751.   #--------------------------------------------------------------------------    
  1752.   def update_layout
  1753.       return if @layout == nil
  1754.       fade_sprite(@layout,@fade_hud)
  1755.   end
  1756.  
  1757.   #--------------------------------------------------------------------------
  1758.   # * Create Layout
  1759.   #--------------------------------------------------------------------------    
  1760.   def create_layout_2
  1761.       return if !SECOND_LAYOUT
  1762.       @layout2 = Sprite.new
  1763.       @layout2.bitmap = Cache.ultima_hud("Layout_2")
  1764.       @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  1765.       @layout2.x = $game_system.hud_position[0] + SECOND_LAYOUT_POSITION[0]
  1766.       @layout2.y = $game_system.hud_position[1] + SECOND_LAYOUT_POSITION[1]
  1767.       @layout2.opacity = 0 if !$game_system.hud_visible
  1768.   end    
  1769.  
  1770.   #--------------------------------------------------------------------------
  1771.   # * Update Layout
  1772.   #--------------------------------------------------------------------------    
  1773.   def update_layout_2
  1774.       return if @layout2 == nil
  1775.       fade_sprite(@layout2,@fade_hud)
  1776.   end  
  1777.  
  1778. end
  1779. #==============================================================================
  1780. #==============================================================================
  1781. # ** Ultima Hud (NAME)
  1782. #==============================================================================
  1783. #==============================================================================
  1784. class Ultima_Hud
  1785.  
  1786.   #--------------------------------------------------------------------------
  1787.   # * Create Name
  1788.   #--------------------------------------------------------------------------      
  1789.   def create_name
  1790.       return if !NAME_VISIBLE
  1791.       @name = Sprite.new
  1792.       @name.bitmap = Bitmap.new(160,32)
  1793.       @name.bitmap.font.name = NAME_FONT_NAME
  1794.       @name.bitmap.font.size = NAME_FONT_SIZE
  1795.       @name.bitmap.font.bold = NAME_FONT_BOLD
  1796.       @name.bitmap.font.italic = NAME_FONT_ITALIC
  1797.       @name.bitmap.font.color = NAME_FONT_COLOR
  1798.       @name.z = HUD_Z + NAME_Z
  1799.       @name.x = $game_system.hud_position[0] + NAME_POSITION[0]
  1800.       @name.y = $game_system.hud_position[1] + NAME_POSITION[1]
  1801.       @name.opacity = 0 if !$game_system.hud_visible
  1802.       refresh_name
  1803.   end
  1804.  
  1805.   #--------------------------------------------------------------------------
  1806.   # * Refresh Name
  1807.   #--------------------------------------------------------------------------      
  1808.   def refresh_name
  1809.       return if @name == nil
  1810.       @name.bitmap.clear
  1811.       if NAME_FONT_SHADOW
  1812.          @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  1813.          @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  1814.          @name.bitmap.font.color = NAME_FONT_COLOR
  1815.       end  
  1816.       @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  1817.   end
  1818.  
  1819.   #--------------------------------------------------------------------------
  1820.   # * Update Name
  1821.   #--------------------------------------------------------------------------        
  1822.   def update_name
  1823.       return if @name == nil
  1824.       fade_sprite(@name,@fade_hud)
  1825.   end
  1826.  
  1827. end
  1828. #==============================================================================
  1829. #==============================================================================
  1830. # ** Ultima Hud (HP)
  1831. #==============================================================================
  1832. #==============================================================================
  1833. class Ultima_Hud
  1834.  
  1835.   #--------------------------------------------------------------------------
  1836.   # * Create HP Number
  1837.   #--------------------------------------------------------------------------  
  1838.   def create_hp_number
  1839.       return if !HP_NUMBER_VISIBLE
  1840.       @hp_number = Sprite.new
  1841.       @hp_number.bitmap = Bitmap.new(@hp_number_cw * 4,@hp_number_ch)
  1842.       @hp_number.z = HUD_Z + HP_NUMBER_Z
  1843.       @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0]
  1844.       @hp_number.y = $game_system.hud_position[1] + HP_NUMBER_POSITION[1]
  1845.       @hp_number.opacity = 0 if !$game_system.hud_visible
  1846.   end
  1847.  
  1848.   #--------------------------------------------------------------------------
  1849.   # * Create HP Number Max
  1850.   #--------------------------------------------------------------------------  
  1851.   def create_hp_number_max
  1852.       return if !HP_NUMBER_MAX_VISIBLE
  1853.       @hp_number2 = Sprite.new
  1854.       @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 4,@hp_number2_ch)
  1855.       @hp_number2.z = HUD_Z + HP_NUMBER_Z
  1856.       @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  1857.       @hp_number2.y = $game_system.hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  1858.       @hp_number2.opacity = 0 if !$game_system.hud_visible
  1859.   end  
  1860.  
  1861.   #--------------------------------------------------------------------------
  1862.   # * Create HP Meter
  1863.   #--------------------------------------------------------------------------    
  1864.   def create_hp_meter
  1865.       return if !HP_METER_VISIBLE
  1866.       @hp_flow_max = @hp_meter_cw * 2
  1867.       @hp_flow = rand(@hp_flow_max)
  1868.       @hp_meter = Sprite.new
  1869.       @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  1870.       @hp_meter.z = HUD_Z + HP_METER_Z
  1871.       @hp_meter.x = $game_system.hud_position[0] + HP_METER_POSITION[0]
  1872.       @hp_meter.y = $game_system.hud_position[1] + HP_METER_POSITION[1]
  1873.       @hp_meter.angle = HP_METER_ANGLE
  1874.       @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  1875.       @hp_meter.opacity = 0 if !$game_system.hud_visible
  1876.   end
  1877.  
  1878.   #--------------------------------------------------------------------------
  1879.   # ● Update Flow HP
  1880.   #--------------------------------------------------------------------------            
  1881.   def update_flow_hp
  1882.       @hp_meter.bitmap.clear
  1883.       @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  1884.       meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  1885.       meter_width = 0 if meter_width == nil
  1886.       execute_hp_damage_flow(meter_width)      
  1887.       meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  1888.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)  
  1889.       @hp_flow += 5
  1890.       @hp_flow = 0 if @hp_flow >= @hp_flow_max
  1891.   end  
  1892.    
  1893.   #--------------------------------------------------------------------------
  1894.   # ● Execute HP Damage Flow
  1895.   #--------------------------------------------------------------------------
  1896.   def execute_hp_damage_flow(meter_width)
  1897.       return if !HP_METER_REDUCTION_ANIMATION
  1898.       return if @hp_old_meter == meter_width
  1899.       n = (@hp_old_meter - meter_width).abs * 3 / 100
  1900.       damage_flow = [[n, 2].min,0.5].max
  1901.       @hp_old_meter -= damage_flow
  1902.       @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  1903.       src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  1904.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)      
  1905.   end
  1906.   #--------------------------------------------------------------------------
  1907.   # * Create HP Icon
  1908.   #--------------------------------------------------------------------------  
  1909.   def create_hp_icon
  1910.       return if !HP_ICON_VISIBLE
  1911.       @hp_icon = Sprite.new
  1912.       icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  1913.       icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  1914.       @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  1915.       @hp_icon.z = HUD_Z + HP_ICON_Z
  1916.       @hp_icon.x = $game_system.hud_position[0] + HP_ICON_POSITION[0]
  1917.       @hp_icon.y = $game_system.hud_position[1] + HP_ICON_POSITION[1]
  1918.       @hp_icon.opacity = 0 if !$game_system.hud_visible
  1919.   end
  1920.    
  1921.   #--------------------------------------------------------------------------
  1922.   # * Refresh HP Icon
  1923.   #--------------------------------------------------------------------------    
  1924.   def refresh_hp_icon
  1925.       @hp_icon_old = @actor.hp
  1926.       @hp_icon.bitmap.clear
  1927.       max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  1928.       if @actor.hp > max_value
  1929.          icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  1930.       else  
  1931.          icon_max = @actor.mhp
  1932.       end      
  1933.       for i in 0...icon_max
  1934.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  1935.           rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
  1936.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  1937.           i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  1938.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )      
  1939.       end      
  1940.       icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  1941.       rx = 0
  1942.       ry = 0
  1943.       for i in 0...icon_max
  1944.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  1945.           rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
  1946.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  1947.           i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  1948.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  1949.       end
  1950.       refresh_hp_icon_ex(rx,ry)      
  1951.   end
  1952.  
  1953.   #--------------------------------------------------------------------------
  1954.   # * Create HP Icon EX
  1955.   #--------------------------------------------------------------------------  
  1956.   def create_hp_icon_ex
  1957.       return if !HP_ICON_EX_VISIBLE
  1958.       @hp_icon3_anime_phase = 0
  1959.       @hp_icon3 = Sprite.new
  1960.       @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  1961.       @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  1962.       @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  1963.       @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  1964.       @hp_icon3_org = [$game_system.hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  1965.                        $game_system.hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  1966.       @hp_icon3.x = @hp_icon3_org[0]
  1967.       @hp_icon3.y = @hp_icon3_org[1]
  1968.       @hp_icon3.opacity = 0 if !$game_system.hud_visible
  1969.   end  
  1970.  
  1971.   #--------------------------------------------------------------------------
  1972.   # * Refresh HP Icon EX
  1973.   #--------------------------------------------------------------------------      
  1974.   def refresh_hp_icon_ex(rx,ry)
  1975.       return if @hp_icon3 == nil
  1976.       @hp_icon3.bitmap.clear
  1977.       return if @actor.hp == 0
  1978.       i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  1979.       @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  1980.       @hp_icon3.x = @hp_icon3_org[0] + rx
  1981.       @hp_icon3.y = @hp_icon3_org[1] + ry    
  1982.   end
  1983.  
  1984.   #--------------------------------------------------------------------------
  1985.   # * Update Icon HP EX Anime
  1986.   #--------------------------------------------------------------------------  
  1987.   def update_icon_hp_ex_anime
  1988.       return if !HP_ICON_EX_ZOOM_EFFECT
  1989.       if @hp_icon3_anime_phase == 0
  1990.          @hp_icon3.zoom_x += 0.01
  1991.          if @hp_icon3.zoom_x >= 1.30
  1992.             @hp_icon3.zoom_x = 1.30
  1993.             @hp_icon3_anime_phase = 1
  1994.          end  
  1995.       else
  1996.         @hp_icon3.zoom_x -= 0.01
  1997.         if @hp_icon3.zoom_x <= 1.05
  1998.            @hp_icon3.zoom_x = 1.05
  1999.            @hp_icon3_anime_phase = 0
  2000.         end    
  2001.       end  
  2002.       @hp_icon3.zoom_y = @hp_icon3.zoom_x
  2003.   end
  2004.  
  2005.   #--------------------------------------------------------------------------
  2006.   # * Create HP Icon Nummber
  2007.   #--------------------------------------------------------------------------      
  2008.   def create_hp_icon_number
  2009.       return if !HP_ICON_NUMBER_VISIBLE
  2010.       @hp_icon_number_old = [-1,-1]
  2011.       @hp_icon_number = Sprite.new
  2012.       @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  2013.       @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  2014.       @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  2015.       @hp_icon_number.y = $game_system.hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  2016.       @hp_icon_number.opacity = 0 if !$game_system.hud_visible
  2017.   end
  2018.  
  2019.   #--------------------------------------------------------------------------
  2020.   # * Refresh Icon Number HP
  2021.   #--------------------------------------------------------------------------  
  2022.   def refresh_icon_number_hp
  2023.       @hp_icon_number_old[0] = @actor.hp
  2024.       @hp_icon_number_old[1] = @actor.mhp
  2025.       @hp_icon_number.bitmap.clear
  2026.       value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  2027.       value = 0 if value < 0
  2028.       number_value = value.truncate.abs.to_s.split(//)
  2029.       for r in 0..number_value.size - 1        
  2030.          number_value_abs = number_value[r].to_i
  2031.          nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  2032.          @hp_icon_number.bitmap.blt(@hp_icon_number_cw *  r, 0, @hp_icon_number_image, nsrc_rect)
  2033.       end
  2034.       cx = (number_value.size * @hp_icon_number_cw)
  2035.       case HP_ICON_NUMBER_ALIGN_TYPE
  2036.          when 0; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  2037.          when 1; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  2038.          when 2; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  2039.       end    
  2040.   end
  2041.   #--------------------------------------------------------------------------
  2042.   # * Can Refresh Icon Number HP
  2043.   #--------------------------------------------------------------------------  
  2044.   def can_refresh_icon_number_hp?
  2045.       return true if @hp_icon_number_old[0] != @actor.hp
  2046.       return true if @hp_icon_number_old[1] != @actor.mhp
  2047.       return false
  2048.   end
  2049.  
  2050.   #--------------------------------------------------------------------------
  2051.   # * Update HP
  2052.   #--------------------------------------------------------------------------    
  2053.   def update_hp
  2054.       if @hp_number != nil
  2055.          if HP_NUMBER_ANIMATION
  2056.             update_number(0,@hp_number_old)
  2057.          else  
  2058.             update_number_fix(0) if @hp_number_old != @actor.hp
  2059.          end  
  2060.          refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  2061.          fade_sprite(@hp_number,@fade_hud)
  2062.       end
  2063.       if @hp_number2 != nil
  2064.          if HP_NUMBER_ANIMATION
  2065.             update_number(3,@hp_number2_old)
  2066.          else  
  2067.             update_number_fix(3) if @hp_number2_old != @actor.mhp
  2068.          end  
  2069.          refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  2070.          fade_sprite(@hp_number2,@fade_hud)
  2071.       end
  2072.       if @hp_meter != nil
  2073.          update_flow_hp
  2074.          fade_sprite(@hp_meter,@fade_hud)
  2075.       end  
  2076.       if @hp_icon != nil
  2077.          refresh_hp_icon if @hp_icon_old != @actor.hp
  2078.          fade_sprite(@hp_icon,@fade_hud)
  2079.       end
  2080.       if @hp_icon3 != nil
  2081.          update_icon_hp_ex_anime
  2082.          fade_sprite(@hp_icon3,@fade_hud)
  2083.       end      
  2084.       if @hp_icon_number != nil
  2085.          refresh_icon_number_hp if can_refresh_icon_number_hp?
  2086.          fade_sprite(@hp_icon_number,@fade_hud)
  2087.       end  
  2088.   end  
  2089.    
  2090. end
  2091. #==============================================================================
  2092. #==============================================================================
  2093. # ** Ultima Hud (MP)
  2094. #==============================================================================
  2095. #==============================================================================
  2096. class Ultima_Hud
  2097.  
  2098.   #--------------------------------------------------------------------------
  2099.   # * Create MP Number
  2100.   #--------------------------------------------------------------------------  
  2101.   def create_mp_number
  2102.       return if !MP_NUMBER_VISIBLE
  2103.       @mp_number = Sprite.new
  2104.       @mp_number.bitmap = Bitmap.new(@mp_number_cw * 4, @mp_number_ch)
  2105.       @mp_number.z = HUD_Z + MP_NUMBER_Z
  2106.       @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0]
  2107.       @mp_number.y = $game_system.hud_position[1] + MP_NUMBER_POSITION[1]
  2108.       @mp_number.opacity = 0 if !$game_system.hud_visible
  2109.   end
  2110.  
  2111.   #--------------------------------------------------------------------------
  2112.   # * Create MP Number Max
  2113.   #--------------------------------------------------------------------------  
  2114.   def create_mp_number_max
  2115.       return if !MP_NUMBER_MAX_VISIBLE
  2116.       @mp_number2 = Sprite.new
  2117.       @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 4, @mp_number2_ch)
  2118.       @mp_number2.z = HUD_Z + MP_NUMBER_Z
  2119.       @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  2120.       @mp_number2.y = $game_system.hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  2121.       @mp_number2.opacity = 0 if !$game_system.hud_visible
  2122.   end  
  2123.  
  2124.   #--------------------------------------------------------------------------
  2125.   # * Create MP Meter
  2126.   #--------------------------------------------------------------------------    
  2127.   def create_mp_meter
  2128.       return if !MP_METER_VISIBLE
  2129.       @mp_flow_max = @mp_meter_cw * 2
  2130.       @mp_flow = rand(@mp_flow_max)
  2131.       @mp_meter = Sprite.new
  2132.       @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  2133.       @mp_meter.z = HUD_Z + MP_METER_Z
  2134.       @mp_meter.x = $game_system.hud_position[0] + MP_METER_POSITION[0]
  2135.       @mp_meter.y = $game_system.hud_position[1] + MP_METER_POSITION[1]
  2136.       @mp_meter.angle = MP_METER_ANGLE
  2137.       @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  2138.       @mp_meter.opacity = 0 if !$game_system.hud_visible
  2139.   end
  2140.  
  2141.   #--------------------------------------------------------------------------
  2142.   # ● Update Flow MP
  2143.   #--------------------------------------------------------------------------            
  2144.   def update_flow_mp
  2145.       @mp_meter.bitmap.clear
  2146.       @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  2147.       meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  2148.       meter_width = 0 if meter_width == nil
  2149.       execute_mp_damage_flow(meter_width)      
  2150.       meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  2151.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)  
  2152.       @mp_flow += 5
  2153.       @mp_flow = 0 if @mp_flow >= @mp_flow_max
  2154.   end  
  2155.    
  2156.   #--------------------------------------------------------------------------
  2157.   # ● Execute MP Damage Flow
  2158.   #--------------------------------------------------------------------------
  2159.   def execute_mp_damage_flow(meter_width)
  2160.       return if !MP_METER_REDUCTION_ANIMATION
  2161.       return if @mp_old_meter == meter_width
  2162.       n = (@mp_old_meter - meter_width).abs * 3 / 100
  2163.       damage_flow = [[n, 2].min,0.5].max
  2164.       @mp_old_meter -= damage_flow      
  2165.       @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  2166.       src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  2167.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)      
  2168.   end
  2169.   #--------------------------------------------------------------------------
  2170.   # * Create MP Icon
  2171.   #--------------------------------------------------------------------------  
  2172.   def create_mp_icon
  2173.       return if !MP_ICON_VISIBLE
  2174.       @mp_icon = Sprite.new
  2175.       icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  2176.       icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  2177.       @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  2178.       @mp_icon.z = HUD_Z + MP_ICON_Z
  2179.       @mp_icon.x = $game_system.hud_position[0] + MP_ICON_POSITION[0]
  2180.       @mp_icon.y = $game_system.hud_position[1] + MP_ICON_POSITION[1]
  2181.       @mp_icon.opacity = 0 if !$game_system.hud_visible
  2182.   end
  2183.    
  2184.   #--------------------------------------------------------------------------
  2185.   # * Refresh MP Icon
  2186.   #--------------------------------------------------------------------------    
  2187.   def refresh_mp_icon
  2188.       @mp_icon_old = @actor.mp
  2189.       @mp_icon.bitmap.clear
  2190.       max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  2191.       if @actor.mp > max_value
  2192.          icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  2193.       else  
  2194.          icon_max = @actor.mmp
  2195.       end      
  2196.       for i in 0...icon_max
  2197.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  2198.           rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
  2199.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  2200.           i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  2201.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )      
  2202.       end      
  2203.       icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  2204.       rx = 0
  2205.       ry = 0
  2206.       for i in 0...icon_max
  2207.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  2208.           rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
  2209.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  2210.           i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  2211.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  2212.       end
  2213.       refresh_mp_icon_ex(rx,ry)      
  2214.   end
  2215.  
  2216.   #--------------------------------------------------------------------------
  2217.   # * Create MP Icon EX
  2218.   #--------------------------------------------------------------------------  
  2219.   def create_mp_icon_ex
  2220.       return if !MP_ICON_EX_VISIBLE
  2221.       @mp_icon3_anime_phase = 0
  2222.       @mp_icon3 = Sprite.new
  2223.       @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  2224.       @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  2225.       @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  2226.       @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  2227.       @mp_icon3_org = [$game_system.hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  2228.                        $game_system.hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  2229.       @mp_icon3.x = @mp_icon3_org[0]
  2230.       @mp_icon3.y = @mp_icon3_org[1]
  2231.       @mp_icon3.opacity = 0 if !$game_system.hud_visible
  2232.   end  
  2233.  
  2234.   #--------------------------------------------------------------------------
  2235.   # * Refresh MP Icon EX
  2236.   #--------------------------------------------------------------------------      
  2237.   def refresh_mp_icon_ex(rx,ry)
  2238.       return if @mp_icon3 == nil
  2239.       @mp_icon3.bitmap.clear
  2240.       return if @actor.mp == 0
  2241.       i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  2242.       @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  2243.       @mp_icon3.x = @mp_icon3_org[0] + rx
  2244.       @mp_icon3.y = @mp_icon3_org[1] + ry    
  2245.   end
  2246.  
  2247.   #--------------------------------------------------------------------------
  2248.   # * Update Icon MP EX Anime
  2249.   #--------------------------------------------------------------------------  
  2250.   def update_icon_mp_ex_anime
  2251.       return if !MP_ICON_EX_ZOOM_EFFECT
  2252.       if @mp_icon3_anime_phase == 0
  2253.          @mp_icon3.zoom_x += 0.01
  2254.          if @mp_icon3.zoom_x >= 1.30
  2255.             @mp_icon3.zoom_x = 1.30
  2256.             @mp_icon3_anime_phase = 1
  2257.          end  
  2258.       else
  2259.         @mp_icon3.zoom_x -= 0.01
  2260.         if @mp_icon3.zoom_x <= 1.05
  2261.            @mp_icon3.zoom_x = 1.05
  2262.            @mp_icon3_anime_phase = 0
  2263.         end  
  2264.       end  
  2265.       @mp_icon3.zoom_y = @mp_icon3.zoom_x
  2266.   end  
  2267.  
  2268.   #--------------------------------------------------------------------------
  2269.   # * Create MP Icon Number
  2270.   #--------------------------------------------------------------------------      
  2271.   def create_mp_icon_number
  2272.       return if !MP_ICON_NUMBER_VISIBLE
  2273.       @mp_icon_number_old = [-1,-1]
  2274.       @mp_icon_number = Sprite.new
  2275.       @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  2276.       @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  2277.       @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  2278.       @mp_icon_number.y = $game_system.hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  2279.       @mp_icon_number.opacity = 0 if !$game_system.hud_visible
  2280.   end
  2281.  
  2282.   #--------------------------------------------------------------------------
  2283.   # * Refresh Icon Number MP
  2284.   #--------------------------------------------------------------------------  
  2285.   def refresh_icon_number_mp
  2286.       @mp_icon_number_old[0] = @actor.mp
  2287.       @mp_icon_number_old[1] = @actor.mmp
  2288.       @mp_icon_number.bitmap.clear
  2289.       value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  2290.       value = 0 if value < 0
  2291.       number_value = value.truncate.abs.to_s.split(//)
  2292.       for r in 0..number_value.size - 1        
  2293.          number_value_abs = number_value[r].to_i
  2294.          nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  2295.          @mp_icon_number.bitmap.blt(@mp_icon_number_cw *  r, 0, @mp_icon_number_image, nsrc_rect)
  2296.       end
  2297.       cx = (number_value.size * @mp_icon_number_cw)
  2298.       case MP_ICON_NUMBER_ALIGN_TYPE
  2299.          when 0; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  2300.          when 1; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  2301.          when 2; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  2302.       end        
  2303.   end
  2304.   #--------------------------------------------------------------------------
  2305.   # * Can Refresh Icon Number MP
  2306.   #--------------------------------------------------------------------------  
  2307.   def can_refresh_icon_number_mp?
  2308.       return true if @mp_icon_number_old[0] != @actor.mp
  2309.       return true if @mp_icon_number_old[1] != @actor.mmp
  2310.       return false
  2311.   end    
  2312.  
  2313.   #--------------------------------------------------------------------------
  2314.   # * Update MP
  2315.   #--------------------------------------------------------------------------    
  2316.   def update_mp
  2317.       if @mp_number != nil
  2318.          if MP_NUMBER_ANIMATION
  2319.             update_number(1,@mp_number_old)
  2320.          else
  2321.             update_number_fix(1) if @mp_number_old != @actor.mp
  2322.          end  
  2323.          refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  2324.          fade_sprite(@mp_number,@fade_hud)  
  2325.       end
  2326.       if @mp_number2 != nil
  2327.          if MP_NUMBER_ANIMATION
  2328.             update_number(4,@mp_number2_old)
  2329.          else
  2330.             update_number_fix(4) if @mp_number2_old != @actor.mmp
  2331.          end  
  2332.          refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  2333.          fade_sprite(@mp_number2,@fade_hud)  
  2334.       end      
  2335.       if @mp_meter != nil
  2336.          update_flow_mp
  2337.          fade_sprite(@mp_meter,@fade_hud)
  2338.       end
  2339.       if @mp_icon != nil
  2340.          refresh_mp_icon if @mp_icon_old != @actor.mp
  2341.          fade_sprite(@mp_icon,@fade_hud)
  2342.       end
  2343.       if @mp_icon3 != nil
  2344.          update_icon_mp_ex_anime
  2345.          fade_sprite(@mp_icon3,@fade_hud)
  2346.       end          
  2347.       if @mp_icon_number != nil
  2348.          refresh_icon_number_mp if can_refresh_icon_number_mp?
  2349.          fade_sprite(@mp_icon_number,@fade_hud)
  2350.       end      
  2351.   end  
  2352.  
  2353. end
  2354. #==============================================================================
  2355. #==============================================================================
  2356. # ** Ultima Hud (TP)
  2357. #==============================================================================
  2358. #==============================================================================
  2359. class Ultima_Hud
  2360.  
  2361.   #--------------------------------------------------------------------------
  2362.   # * Create TP Number
  2363.   #--------------------------------------------------------------------------  
  2364.   def create_tp_number
  2365.       return if !TP_NUMBER_VISIBLE
  2366.       @tp_number = Sprite.new
  2367.       @tp_number.bitmap = Bitmap.new(@tp_number_cw * 3, @tp_number_ch)
  2368.       @tp_number.z = HUD_Z + TP_NUMBER_Z
  2369.       @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0]
  2370.       @tp_number.y = $game_system.hud_position[1]+ TP_NUMBER_POSITION[1]
  2371.       @tp_number.opacity = 0 if !$game_system.hud_visible
  2372.   end
  2373.  
  2374.   #--------------------------------------------------------------------------
  2375.   # * Create TP Number MAX
  2376.   #--------------------------------------------------------------------------  
  2377.   def create_tp_number_max
  2378.       return if !TP_NUMBER_MAX_VISIBLE
  2379.       @tp_number2 = Sprite.new
  2380.       @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 3, @tp_number2_ch)
  2381.       @tp_number2.z = HUD_Z + TP_NUMBER_Z
  2382.       @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  2383.       @tp_number2.y = $game_system.hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  2384.       @tp_number2.opacity = 0 if !$game_system.hud_visible
  2385.   end  
  2386.  
  2387.   #--------------------------------------------------------------------------
  2388.   # * Create TP Meter
  2389.   #--------------------------------------------------------------------------    
  2390.   def create_tp_meter
  2391.       return if !TP_METER_VISIBLE
  2392.       @tp_flow_max = @tp_meter_cw * 2
  2393.       @tp_flow = rand(@tp_flow_max)
  2394.       @tp_meter = Sprite.new
  2395.       @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  2396.       @tp_meter.z = HUD_Z + TP_METER_Z
  2397.       @tp_meter.x = $game_system.hud_position[0] + TP_METER_POSITION[0]
  2398.       @tp_meter.y = $game_system.hud_position[1] + TP_METER_POSITION[1]
  2399.       @tp_meter.angle = TP_METER_ANGLE
  2400.       @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  2401.       @tp_meter.opacity = 0 if !$game_system.hud_visible
  2402.   end
  2403.  
  2404.   #--------------------------------------------------------------------------
  2405.   # ● Update Flow TP
  2406.   #--------------------------------------------------------------------------            
  2407.   def update_flow_tp
  2408.       @tp_meter.bitmap.clear      
  2409.       @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  2410.       meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil  
  2411.       meter_width = 0 if meter_width == nil
  2412.       execute_tp_damage_flow(meter_width)      
  2413.       meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  2414.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)  
  2415.       @tp_flow += 5
  2416.       @tp_flow = 0 if @tp_flow >= @tp_flow_max
  2417.   end  
  2418.    
  2419.   #--------------------------------------------------------------------------
  2420.   # ● Execute TP Damage Flow
  2421.   #--------------------------------------------------------------------------
  2422.   def execute_tp_damage_flow(meter_width)
  2423.       return if !TP_METER_REDUCTION_ANIMATION
  2424.       return if @tp_old_meter == meter_width
  2425.       n = (@tp_old_meter - meter_width).abs * 3 / 100
  2426.       damage_flow = [[n, 2].min,0.5].max
  2427.       @tp_old_meter -= damage_flow
  2428.       @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  2429.       src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  2430.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)      
  2431.   end
  2432.   #--------------------------------------------------------------------------
  2433.   # * Create TP Icon
  2434.   #--------------------------------------------------------------------------  
  2435.   def create_tp_icon
  2436.       return if !TP_ICON_VISIBLE
  2437.       @tp_icon = Sprite.new
  2438.       icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  2439.       icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  2440.       @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  2441.       @tp_icon.z = HUD_Z + TP_ICON_Z
  2442.       @tp_icon.x = $game_system.hud_position[0] + TP_ICON_POSITION[0]
  2443.       @tp_icon.y = $game_system.hud_position[1] + TP_ICON_POSITION[1]
  2444.       @tp_icon.opacity = 0 if !$game_system.hud_visible
  2445.   end
  2446.    
  2447.   #--------------------------------------------------------------------------
  2448.   # * Refresh TP Icon
  2449.   #--------------------------------------------------------------------------    
  2450.   def refresh_tp_icon
  2451.       @tp_icon_old = @actor.tp
  2452.       @tp_icon.bitmap.clear
  2453.       max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  2454.       if @actor.mp > max_value
  2455.          icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  2456.       else  
  2457.          icon_max = @actor.max_tp
  2458.       end      
  2459.       for i in 0...icon_max
  2460.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  2461.           rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
  2462.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  2463.           i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  2464.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )      
  2465.       end      
  2466.       icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  2467.       rx = 0
  2468.       ry = 0
  2469.       for i in 0...icon_max
  2470.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  2471.           rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
  2472.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  2473.           i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  2474.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  2475.       end
  2476.       refresh_tp_icon_ex(rx,ry)      
  2477.   end
  2478.  
  2479.   #--------------------------------------------------------------------------
  2480.   # * Create TP Icon EX
  2481.   #--------------------------------------------------------------------------  
  2482.   def create_tp_icon_ex
  2483.       return if !TP_ICON_EX_VISIBLE
  2484.       @tp_icon3_anime_phase = 0
  2485.       @tp_icon3 = Sprite.new
  2486.       @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  2487.       @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  2488.       @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  2489.       @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  2490.       @tp_icon3_org = [$game_system.hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  2491.                        $game_system.hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  2492.       @tp_icon3.x = @tp_icon3_org[0]
  2493.       @tp_icon3.y = @tp_icon3_org[1]
  2494.       @tp_icon3.opacity = 0 if !$game_system.hud_visible
  2495.   end  
  2496.  
  2497.   #--------------------------------------------------------------------------
  2498.   # * Refresh TP Icon EX
  2499.   #--------------------------------------------------------------------------      
  2500.   def refresh_tp_icon_ex(rx,ry)
  2501.       return if @tp_icon3 == nil
  2502.       @tp_icon3.bitmap.clear
  2503.       return if @actor.tp == 0
  2504.       i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  2505.       @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  2506.       @tp_icon3.x = @tp_icon3_org[0] + rx
  2507.       @tp_icon3.y = @tp_icon3_org[1] + ry    
  2508.   end
  2509.  
  2510.   #--------------------------------------------------------------------------
  2511.   # * Update Icon TP EX Anime
  2512.   #--------------------------------------------------------------------------  
  2513.   def update_icon_tp_ex_anime
  2514.       return if !MP_ICON_EX_ZOOM_EFFECT
  2515.       if @tp_icon3_anime_phase == 0
  2516.          @tp_icon3.zoom_x += 0.01
  2517.          if @tp_icon3.zoom_x >= 1.30
  2518.             @tp_icon3.zoom_x = 1.30
  2519.             @tp_icon3_anime_phase = 1
  2520.          end  
  2521.       else
  2522.         @tp_icon3.zoom_x -= 0.01
  2523.         if @tp_icon3.zoom_x <= 1.05
  2524.            @tp_icon3.zoom_x = 1.05
  2525.            @tp_icon3_anime_phase = 0
  2526.         end  
  2527.       end  
  2528.       @tp_icon3.zoom_y = @tp_icon3.zoom_x
  2529.   end    
  2530.  
  2531.   #--------------------------------------------------------------------------
  2532.   # * Create HP Icon Number
  2533.   #--------------------------------------------------------------------------      
  2534.   def create_tp_icon_number
  2535.       return if !TP_ICON_NUMBER_VISIBLE
  2536.       @tp_icon_number_old = [-1,-1]
  2537.       @tp_icon_number = Sprite.new
  2538.       @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  2539.       @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  2540.       @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  2541.       @tp_icon_number.y = $game_system.hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  2542.       @tp_icon_number.opacity = 0 if !$game_system.hud_visible
  2543.   end
  2544.  
  2545.   #--------------------------------------------------------------------------
  2546.   # * Refresh Icon Number TP
  2547.   #--------------------------------------------------------------------------  
  2548.   def refresh_icon_number_tp
  2549.       @tp_icon_number_old[0] = @actor.tp
  2550.       @tp_icon_number_old[1] = @actor.max_tp
  2551.       @tp_icon_number.bitmap.clear
  2552.       value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  2553.       value = 0 if value < 0
  2554.       number_value = value.truncate.abs.to_s.split(//)
  2555.       for r in 0..number_value.size - 1        
  2556.          number_value_abs = number_value[r].to_i
  2557.          nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  2558.          @tp_icon_number.bitmap.blt(@tp_icon_number_cw *  r, 0, @tp_icon_number_image, nsrc_rect)
  2559.       end
  2560.       cx = (number_value.size * @tp_icon_number_cw)
  2561.       case TP_ICON_NUMBER_ALIGN_TYPE
  2562.          when 0; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  2563.          when 1; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  2564.          when 2; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  2565.       end        
  2566.   end
  2567.   #--------------------------------------------------------------------------
  2568.   # * Can Refresh Icon Number TP
  2569.   #--------------------------------------------------------------------------  
  2570.   def can_refresh_icon_number_tp?
  2571.       return true if @tp_icon_number_old[0] != @actor.tp
  2572.       return true if @tp_icon_number_old[1] != @actor.max_tp
  2573.       return false
  2574.   end  
  2575.  
  2576.   #--------------------------------------------------------------------------
  2577.   # * Update TP
  2578.   #--------------------------------------------------------------------------    
  2579.   def update_tp
  2580.       if @tp_number != nil
  2581.          if MP_NUMBER_ANIMATION
  2582.             update_number(2,@tp_number_old)
  2583.          else
  2584.             update_number_fix(2) if @tp_number_old != @actor.tp
  2585.          end          
  2586.          refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh        
  2587.          fade_sprite(@tp_number,@fade_hud)
  2588.       end    
  2589.       if @tp_number2 != nil
  2590.          if MP_NUMBER_ANIMATION
  2591.             update_number(5,@tp_number2_old)
  2592.          else
  2593.             update_number_fix(5) if @tp_number2_old != @actor.max_tp
  2594.          end          
  2595.          refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  2596.          fade_sprite(@tp_number2,@fade_hud)
  2597.       end        
  2598.       if @tp_meter != nil
  2599.          update_flow_tp
  2600.          fade_sprite(@tp_meter,@fade_hud)
  2601.       end
  2602.       if @tp_icon != nil
  2603.          refresh_tp_icon if @tp_icon_old != @actor.tp
  2604.          fade_sprite(@tp_icon,@fade_hud)
  2605.       end
  2606.       if @tp_icon3 != nil
  2607.          update_icon_tp_ex_anime
  2608.          fade_sprite(@tp_icon3,@fade_hud)
  2609.       end        
  2610.       if @tp_icon_number != nil
  2611.          refresh_icon_number_tp if can_refresh_icon_number_tp?
  2612.          fade_sprite(@tp_icon_number,@fade_hud)
  2613.       end  
  2614.   end  
  2615.  
  2616. end
  2617. #==============================================================================
  2618. #==============================================================================
  2619. # ** Ultima Hud (LEVEL)
  2620. #==============================================================================
  2621. #==============================================================================
  2622. class Ultima_Hud
  2623.  
  2624.   #--------------------------------------------------------------------------
  2625.   # * Create Level Number
  2626.   #--------------------------------------------------------------------------    
  2627.   def create_level_number
  2628.       return if !LEVEL_NUMBER_VISIBLE
  2629.       @old_level = -1
  2630.       @lv_number = Sprite.new
  2631.       @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  2632.       @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  2633.       @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0]
  2634.       @lv_number.y = $game_system.hud_position[1] + LEVEL_NUMBER_POSITION[1]
  2635.       @lv_number.opacity = 0 if !$game_system.hud_visible
  2636.   end
  2637.  
  2638.   #--------------------------------------------------------------------------
  2639.   # * Create Level Number EXP
  2640.   #--------------------------------------------------------------------------    
  2641.   def create_level_number_exp
  2642.       return if !LEVEL_NUMBER_EXP_VISIBLE
  2643.       @old_exp = -1
  2644.       @lv_number2 = Sprite.new
  2645.       @lv_number2.bitmap = Bitmap.new(@lv_number2_cw * 7, @lv_number2_ch)
  2646.       @lv_number2.z = HUD_Z + LEVEL_NUMBER_Z
  2647.       @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0]
  2648.       @lv_number2.y = $game_system.hud_position[1] + LEVEL_NUMBER_EXP_POSITION[1]
  2649.       @lv_number2.opacity = 0 if !$game_system.hud_visible
  2650.   end  
  2651.  
  2652.   #--------------------------------------------------------------------------
  2653.   # * Create Level Meter
  2654.   #--------------------------------------------------------------------------
  2655.   def create_level_meter
  2656.       return if !LEVEL_METER_VISIBLE
  2657.       @old_exp_meter = -1
  2658.       @lv_meter = Sprite.new
  2659.       @lv_meter.bitmap = Bitmap.new(@lv_meter_cw,@lv_meter_ch)
  2660.       @lv_meter.z = HUD_Z + LEVEL_METER_Z
  2661.       @lv_meter.x = $game_system.hud_position[0] + LEVEL_METER_POSITION[0]
  2662.       @lv_meter.y = $game_system.hud_position[1] + LEVEL_METER_POSITION[1]  
  2663.       @lv_meter.angle = LEVEL_METER_ANGLE
  2664.       @lv_meter.mirror = LEVEL_METER_MIRROR_EFFECT
  2665.       @lv_meter.opacity = 0 if !$game_system.hud_visible
  2666.   end
  2667.  
  2668.   #--------------------------------------------------------------------------
  2669.   # * Refresh Level Number
  2670.   #--------------------------------------------------------------------------  
  2671.   def refresh_level_number
  2672.       @lv_number.bitmap.clear
  2673.       @old_level = @actor.level      
  2674.       number_value = @actor.level.abs.to_s.split(//)
  2675.       for r in 0..number_value.size - 1        
  2676.          number_value_abs = number_value[r].to_i
  2677.          nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  2678.          @lv_number.bitmap.blt(@lv_number_cw *  r, 0, @lv_number_image, nsrc_rect)
  2679.       end
  2680.       cx = (number_value.size * @lv_number_cw)
  2681.       case LEVEL_NUMBER_ALIGN_TYPE
  2682.            when 0; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0]
  2683.            when 1; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  2684.            when 2; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  2685.       end
  2686.   end
  2687.  
  2688.   #--------------------------------------------------------------------------
  2689.   # * Refresh Level Number EXP
  2690.   #--------------------------------------------------------------------------  
  2691.   def refresh_level_number_exp
  2692.       @lv_number2.bitmap.clear
  2693.       @old_exp = @actor.exp    
  2694.       if LEVEL_NUMBER_EXP_TYPE == 0
  2695.          value = @actor.next_level_exp - @actor.exp
  2696.          value = 0 if @actor.max_level?
  2697.       else  
  2698.          value = @actor.exp
  2699.       end
  2700.       value = 9999999 if value > 9999999
  2701.       number_value = value.abs.to_s.split(//)
  2702.       for r in 0..number_value.size - 1        
  2703.          number_value_abs = number_value[r].to_i
  2704.          nsrc_rect = Rect.new(@lv_number2_cw * number_value_abs, 0, @lv_number2_cw, @lv_number2_ch)
  2705.          @lv_number2.bitmap.blt(@lv_number2_cw *  r, 0, @lv_number2_image, nsrc_rect)
  2706.       end
  2707.       cx = (number_value.size * @lv_number2_cw)
  2708.       case LEVEL_NUMBER_EXP_ALIGN_TYPE
  2709.            when 0; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0]
  2710.            when 1; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0] - (cx / 2)
  2711.            when 2; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0] - cx
  2712.       end      
  2713.      
  2714.   end  
  2715.  
  2716.   #--------------------------------------------------------------------------
  2717.   # * Refresh Level Meter
  2718.   #--------------------------------------------------------------------------    
  2719.   def refresh_level_meter
  2720.       @lv_meter.bitmap.clear
  2721.       @old_exp_meter = @actor.exp
  2722.       new_level = 0
  2723.       lv_width = @lv_meter_cw * @actor.remain_exp / @actor.real_next_level rescue nil
  2724.       lv_width = @lv_meter_cw if lv_width == nil or @actor.level == 99
  2725.       lv_scr = Rect.new(0,0,lv_width,@lv_meter_ch)
  2726.       @lv_meter.bitmap.blt(0,0,@lv_meter_image,lv_scr)
  2727.   end
  2728.  
  2729.   #--------------------------------------------------------------------------
  2730.   # * Update Level
  2731.   #--------------------------------------------------------------------------  
  2732.   def update_level
  2733.       if @lv_number != nil
  2734.          refresh_level_number if @old_level != @actor.level
  2735.          fade_sprite(@lv_number,@fade_hud)
  2736.       end  
  2737.       if @lv_number2 != nil
  2738.          refresh_level_number_exp if @old_exp != @actor.exp
  2739.          fade_sprite(@lv_number2,@fade_hud)
  2740.       end      
  2741.       if @lv_meter != nil
  2742.          refresh_level_meter if @old_exp_meter != @actor.exp
  2743.          fade_sprite(@lv_meter,@fade_hud)
  2744.       end  
  2745.   end
  2746.  
  2747. end
  2748. #==============================================================================
  2749. #==============================================================================
  2750. # ** Ultima Hud (STATES)
  2751. #==============================================================================
  2752. #==============================================================================
  2753. class Ultima_Hud
  2754.  
  2755.   #--------------------------------------------------------------------------
  2756.   # * Create States
  2757.   #--------------------------------------------------------------------------  
  2758.   def create_states
  2759.       return if !STATES_VISIBLE
  2760.       @status_old = nil
  2761.       @status_flow = [-24,0]
  2762.       @status = Sprite.new
  2763.       @status.bitmap = Bitmap.new(24,24)
  2764.       @status.x = $game_system.hud_position[0] + STATES_POSITION[0]
  2765.       @status.y = $game_system.hud_position[1] + STATES_POSITION[1]
  2766.       @status.z = HUD_Z + STATES_Z
  2767.       @status.angle = STATE_ANGLE
  2768.       @status.opacity = 0 if !$game_system.hud_visible
  2769.   end
  2770.  
  2771.   #--------------------------------------------------------------------------
  2772.   # * Refresh States
  2773.   #--------------------------------------------------------------------------        
  2774.   def refresh_states
  2775.       check_icon_image
  2776.       @status_old = @actor.states
  2777.       @status_flow = [0,0]
  2778.       @actor_status.dispose if @actor_status != nil
  2779.       @states_size = @actor.states.size > 0 ? (26 * @actor.states.size) : 24
  2780.       @actor_status = Bitmap.new(@states_size,24)
  2781.       index = 0
  2782.       for i in @actor.states
  2783.          rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  2784.          @actor_status.blt(26 * index , 0, @icon_image, rect)
  2785.          index += 1
  2786.       end
  2787.   end  
  2788.  
  2789.   #--------------------------------------------------------------------------
  2790.   # * Flow_Status
  2791.   #--------------------------------------------------------------------------          
  2792.   def flow_states
  2793.       return if @actor_status == nil
  2794.       @status.bitmap.clear
  2795.       return if @actor.states.size == 0
  2796.       st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  2797.       @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  2798.       if STATES_SCROLLING_ANIMATION
  2799.          @status_flow[0] += 1
  2800.          @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  2801.       else  
  2802.          @status_flow[1] += 1 unless @actor.states.size <= 1
  2803.          if @status_flow[1] > 30
  2804.             @status_flow[1] = 0
  2805.             @status_flow[0] += 26
  2806.             @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  2807.          end  
  2808.      end  
  2809.   end      
  2810.  
  2811.   #--------------------------------------------------------------------------
  2812.   # * Update States
  2813.   #--------------------------------------------------------------------------  
  2814.   def update_states
  2815.       return if @status == nil
  2816.       refresh_states if @status_old != @actor.states
  2817.       flow_states
  2818.       fade_sprite(@status,@fade_hud)
  2819.   end  
  2820.  
  2821. end
  2822. #==============================================================================
  2823. #==============================================================================
  2824. # ** Ultima Hud (FACE)
  2825. #==============================================================================
  2826. #==============================================================================
  2827. class Ultima_Hud
  2828.  
  2829.   #--------------------------------------------------------------------------
  2830.   # * Create Face
  2831.   #--------------------------------------------------------------------------    
  2832.   def create_face
  2833.       return if !FACE_VISIBLE
  2834.       @face_old_hp = @actor.hp
  2835.       @face_old_mp = @actor.mp
  2836.       @face_old_tp = @actor.tp
  2837.       @face_name = ""
  2838.       @face = Sprite.new
  2839.       @face_org = [$game_system.hud_position[0] + FACE_POSITION[0], $game_system.hud_position[1] + FACE_POSITION[1]]
  2840.       @face.x = @face_org[0]
  2841.       @face.y = @face_org[1]
  2842.       @face.z = HUD_Z + FACE_Z
  2843.       @face.opacity = 0 if !$game_system.hud_visible
  2844.       refresh_face_name
  2845.   end
  2846.   #--------------------------------------------------------------------------
  2847.   # * Refresh Face Name
  2848.   #--------------------------------------------------------------------------      
  2849.   def refresh_face_name
  2850.       @face_name = @actor.name
  2851.       @face_image.dispose if @face_image != nil
  2852.       @face.bitmap.dispose if @face.bitmap != nil
  2853.       return if @actor.name == nil or @actor.name == ""
  2854.       @face_image = Cache.ultima_hud(@actor.name + "_Face") rescue nil
  2855.       @face_image = Bitmap.new(32,32) if @face_image == nil
  2856.       @face_cw = FACE_ANIMATION ? @face_image.width / 4 : @face_image.width
  2857.       @face_ch = @face_image.height
  2858.       @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  2859.       refresh_face
  2860.   end
  2861.   #--------------------------------------------------------------------------
  2862.   # * Refresh Face
  2863.   #--------------------------------------------------------------------------  
  2864.   def refresh_face
  2865.       @face_index = $game_system.hud_face[1]
  2866.       @face.bitmap.clear
  2867.       f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  2868.       @face.bitmap.blt(0,0,@face_image,f_scr)
  2869.   end
  2870.    
  2871.   #--------------------------------------------------------------------------
  2872.   # * Update Face Duration
  2873.   #--------------------------------------------------------------------------    
  2874.   def update_face_duration
  2875.       return if $game_system.hud_face[0] == 0
  2876.       $game_system.hud_face[0] -= 1
  2877.       return if $game_system.hud_face[0] > 0
  2878.       $game_system.hud_face[1] = @actor.low_hp? ? 2 : 0
  2879.       refresh_face
  2880.   end
  2881.  
  2882.   #--------------------------------------------------------------------------
  2883.   # * Can Refresh Index MP TP?
  2884.   #--------------------------------------------------------------------------    
  2885.   def can_refresh_index_mp_tp?
  2886.       return true if @face_old_mp != @actor.mp
  2887.       return true if @face_old_tp != @actor.tp
  2888.       return false
  2889.   end
  2890.  
  2891.   #--------------------------------------------------------------------------
  2892.   # * Refresh Face Index HP
  2893.   #--------------------------------------------------------------------------  
  2894.   def refresh_face_index_hp
  2895.       $game_system.hud_face[0] = FACE_ANIMATION_DURATION
  2896.       $game_system.hud_face[1] = @face_old_hp > @actor.hp ? 2 : 1
  2897.       @face_old_hp = @actor.hp
  2898.   end
  2899.  
  2900.   #--------------------------------------------------------------------------
  2901.   # * Refresh Face Index MP TP
  2902.   #--------------------------------------------------------------------------  
  2903.   def refresh_face_index_mp_tp
  2904.       $game_system.hud_face[0] = FACE_ANIMATION_DURATION
  2905.       $game_system.hud_face[1] = @face_old_mp > @actor.mp ? 3 : 1
  2906.       $game_system.hud_face[1] = 3 if @face_old_tp > @actor.tp
  2907.       @face_old_mp = @actor.mp
  2908.       @face_old_tp = @actor.tp
  2909.   end  
  2910.  
  2911.   #--------------------------------------------------------------------------
  2912.   # * Update Face Shake Effect
  2913.   #--------------------------------------------------------------------------  
  2914.   def update_face_shake_effect
  2915.       return if !FACE_SHAKE_EFFECT
  2916.       if FACE_ANIMATION
  2917.          update_shake_animated_face
  2918.       else            
  2919.          update_shake_still_face
  2920.       end  
  2921.   end      
  2922.   #--------------------------------------------------------------------------
  2923.   # * Update Shake Still Effect Face
  2924.   #--------------------------------------------------------------------------    
  2925.   def update_shake_still_face
  2926.       if $game_system.hud_face[0] > 0 and $game_system.hud_face[1] == 2 and @actor.hp > 0
  2927.          $game_system.hud_face[0] -= 1
  2928.          @face.x = @face_org[0] - 4 + rand(8)
  2929.       else
  2930.          @face.x = @face_org[0]
  2931.       end    
  2932.   end
  2933.      
  2934.   #--------------------------------------------------------------------------
  2935.   # * Update Shake Animated Face
  2936.   #--------------------------------------------------------------------------    
  2937.   def update_shake_animated_face
  2938.       if $game_system.hud_face[0] == 0
  2939.          @face.x = @face_org[0]
  2940.          return
  2941.       end
  2942.       if $game_system.hud_face[1] == 2 and @actor.hp > 0
  2943.          @face.x = @face_org[0] - 4 + rand(8)
  2944.       else
  2945.          @face.x = @face_org[0]
  2946.       end        
  2947.   end
  2948.  
  2949.   #--------------------------------------------------------------------------
  2950.   # * Update Face
  2951.   #--------------------------------------------------------------------------  
  2952.   def update_face
  2953.       return if @face == nil
  2954.       fade_sprite(@face,@fade_hud)
  2955.       refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  2956.       update_face_shake_effect
  2957.       return if !FACE_ANIMATION
  2958.       update_face_duration
  2959.       refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  2960.       refresh_face_index_hp if @face_old_hp != @actor.hp
  2961.       refresh_face if @face_index != $game_system.hud_face[1]
  2962.   end  
  2963.  
  2964. end
  2965.  #==============================================================================
  2966. #==============================================================================
  2967. # ** Ultima Hud (STATES)
  2968. #==============================================================================
  2969. #==============================================================================
  2970. class Ultima_Hud
  2971.  
  2972.   #--------------------------------------------------------------------------
  2973.   # * Create Equipment
  2974.   #--------------------------------------------------------------------------  
  2975.   def create_equipment
  2976.       return if !EQUIPMENT_VISIBLE
  2977.       return if @equip_layout != nil
  2978.       create_equipment_layout
  2979.       create_equipment_icons
  2980.   end
  2981.  
  2982.   #--------------------------------------------------------------------------
  2983.   # * Create Equipment Layout
  2984.   #--------------------------------------------------------------------------  
  2985.   def create_equipment_layout
  2986.       @equip_layout = Sprite.new
  2987.       @equip_layout.bitmap = Cache.ultima_hud("Equip_Layout")
  2988.       @equip_layout.z = HUD_Z + EQUIPMENT_Z
  2989.       @equip_layout.x = EQUIPMENT_POSITION[0]
  2990.       @equip_layout.y = EQUIPMENT_POSITION[1]
  2991.       @equip_smart_fade = EQUIPMENT_DETACHED_SMART_FADE
  2992.       @equip_hud_size_x = [EQUIPMENT_POSITION[0] + EQUIPMENT_SMART_FADE_RANGE_X[0], EQUIPMENT_POSITION[0] + @equip_layout.bitmap.width + EQUIPMENT_SMART_FADE_RANGE_X[1]]
  2993.       @equip_hud_size_y = [EQUIPMENT_POSITION[1] + EQUIPMENT_SMART_FADE_RANGE_Y[0], EQUIPMENT_POSITION[1] + @equip_layout.bitmap.height + EQUIPMENT_SMART_FADE_RANGE_Y[1]]
  2994.   end
  2995.  
  2996.   #--------------------------------------------------------------------------
  2997.   # * Create Icon Weapon
  2998.   #--------------------------------------------------------------------------  
  2999.   def create_equipment_icons
  3000.       @equip_icon = Sprite.new
  3001.       icon_cw = @equip_layout.bitmap.width + 48
  3002.       icon_ch = @equip_layout.bitmap.height + 48
  3003.       @equip_icon.bitmap = Bitmap.new(icon_cw,icon_ch)
  3004.       @equip_icon.z = HUD_Z + EQUIPMENT_Z + 1
  3005.       @equip_icon.x = EQUIPMENT_POSITION[0] - 24
  3006.       @equip_icon.y = EQUIPMENT_POSITION[1] - 24
  3007.       refresh_equipment
  3008.   end
  3009.      
  3010.   #--------------------------------------------------------------------------
  3011.   # * Set Equipment
  3012.   #--------------------------------------------------------------------------    
  3013.   def set_equipment
  3014.       @equip_wep = @actor != nil ? @actor.equips : nil
  3015.   end  
  3016.  
  3017.   #--------------------------------------------------------------------------
  3018.   # * Refresh Equipment
  3019.   #--------------------------------------------------------------------------  
  3020.   def refresh_equipment
  3021.       set_equipment
  3022.       return if @equip_layout == nil
  3023.       @equip_icon.bitmap.clear
  3024.       return if @actor == nil
  3025.       check_icon_image
  3026.       if @actor.equips[0] != nil and EQUIPMENT_WEAPON_VISIBLE
  3027.          icon_index = @actor.equips[0].icon_index
  3028.          icon_pos = [EQUIPMENT_WEAPON_POSITION[0],EQUIPMENT_WEAPON_POSITION[1]]
  3029.          draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3030.       end
  3031.       if @actor.equips[1] != nil and EQUIPMENT_SHIELD_VISIBLE
  3032.          icon_index = @actor.equips[1].icon_index
  3033.          icon_pos = [EQUIPMENT_SHIELD_POSITION[0],EQUIPMENT_SHIELD_POSITION[1]]
  3034.          draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3035.       end      
  3036.       if @actor.equips[2] != nil and EQUIPMENT_HEAD_VISIBLE
  3037.          icon_index = @actor.equips[2].icon_index
  3038.          icon_pos = [EQUIPMENT_HEAD_POSITION[0],EQUIPMENT_HEAD_POSITION[1]]
  3039.          draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3040.       end  
  3041.       if @actor.equips[3] != nil and EQUIPMENT_BODY_VISIBLE
  3042.          icon_index = @actor.equips[3].icon_index
  3043.          icon_pos = [EQUIPMENT_BODY_POSITION[0],EQUIPMENT_BODY_POSITION[1]]
  3044.          draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3045.       end        
  3046.       if @actor.equips[4] != nil and EQUIPMENT_ACCESSORY_VISIBLE
  3047.          icon_index = @actor.equips[4].icon_index
  3048.          icon_pos = [EQUIPMENT_ACCESSORY_POSITION[0],EQUIPMENT_ACCESSORY_POSITION[1]]
  3049.          draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3050.       end
  3051.   end
  3052.   #--------------------------------------------------------------------------
  3053.   # * draw_icons
  3054.   #--------------------------------------------------------------------------  
  3055.   def draw_icons(sprite,x,y,icon_index)
  3056.       icon_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  3057.       sprite.bitmap.blt(x, y, @icon_image, icon_rect)      
  3058.   end
  3059.   #--------------------------------------------------------------------------
  3060.   # * Update Equipment
  3061.   #--------------------------------------------------------------------------  
  3062.   def update_equipment
  3063.       return if @equip_layout == nil
  3064.       refresh_equipment if @equip_wep != @actor.equips
  3065.       if @equip_smart_fade
  3066.          fade_sprite(@equip_layout,@fade_hud_equip)
  3067.          fade_sprite(@equip_icon,@fade_hud_equip)
  3068.          #----------------------------------------------------------------------
  3069.          # Kadafi Edit
  3070.          #----------------------------------------------------------------------
  3071.          SceneManager.scene.toolhud.fade_skill_sprite(@force_hide,
  3072.           @force_hide_time, @fade_hud_equip) if SceneManager.scene.spriteset
  3073.          #----------------------------------------------------------------------
  3074.       else
  3075.          fade_sprite(@equip_layout,@fade_hud)
  3076.          fade_sprite(@equip_icon,@fade_hud)  
  3077.          #----------------------------------------------------------------------
  3078.          # Kadafi Edit
  3079.          #----------------------------------------------------------------------
  3080.          SceneManager.scene.toolhud.fade_skill_sprite(@force_hide,
  3081.           @force_hide_time, @fade_hud) if SceneManager.scene.spriteset
  3082.          #----------------------------------------------------------------------
  3083.      end  
  3084.   end  
  3085.  
  3086. end
  3087. #==============================================================================
  3088. #==============================================================================
  3089. # ** Ultima Hud (GOLD)
  3090. #==============================================================================
  3091. #==============================================================================
  3092. class Ultima_Hud
  3093.   #--------------------------------------------------------------------------
  3094.   # * Create Gold
  3095.   #--------------------------------------------------------------------------  
  3096.   def create_gold
  3097.       return if !GOLD_VISIBLE
  3098.       return if @gold != nil
  3099.       create_gold_layout
  3100.       create_gold_number
  3101.   end    
  3102.      
  3103.   #--------------------------------------------------------------------------
  3104.   # * Create Gold Layout
  3105.   #--------------------------------------------------------------------------    
  3106.   def create_gold_layout
  3107.       @gold = Sprite.new
  3108.       @gold.bitmap = Cache.ultima_hud("Gold_Layout")
  3109.       @gold.x = GOLD_POSITION[0]
  3110.       @gold.y = GOLD_POSITION[1]
  3111.       @gold.z = HUD_Z + GOLD_HUD_Z
  3112.       @gold_smart_fade = GOLD_DETACHED_SMART_FADE
  3113.       @gold_hud_size_x = [GOLD_POSITION[0] + GOLD_SMART_FADE_RANGE_X[0], GOLD_POSITION[0] + @gold.bitmap.width + GOLD_SMART_FADE_RANGE_X[1]]
  3114.       @gold_hud_size_y = [GOLD_POSITION[1] + GOLD_SMART_FADE_RANGE_Y[0], GOLD_POSITION[1] + @gold.bitmap.height + GOLD_SMART_FADE_RANGE_Y[1]]      
  3115.   end
  3116.  
  3117.   #--------------------------------------------------------------------------
  3118.   # * Create Gold Number
  3119.   #--------------------------------------------------------------------------  
  3120.   def create_gold_number
  3121.       @gold_old = $game_party.gold
  3122.       @gold_refresh = true
  3123.       @gold_number_image = Cache.ultima_hud("Gold_Number")
  3124.       @gold_cw = @gold_number_image.width / 10
  3125.       @gold_ch = @gold_number_image.height
  3126.       @gold_number = Sprite.new
  3127.       @gold_number.bitmap = Bitmap.new(@gold_cw *  7,@gold_ch)
  3128.       @gold_pos = [GOLD_POSITION[0] + GOLD_NUMBER_POSITION[0],
  3129.                    GOLD_POSITION[1] + GOLD_NUMBER_POSITION[1]]      
  3130.       @gold_number.x = @gold_pos[0]
  3131.       @gold_number.y = @gold_pos[1]
  3132.       @gold_number.z = HUD_Z + GOLD_HUD_Z + 1
  3133.   end
  3134.    
  3135.   #--------------------------------------------------------------------------
  3136.   # * Update Gold
  3137.   #--------------------------------------------------------------------------  
  3138.   def update_gold
  3139.       return if @gold == nil
  3140.       update_number(6,@gold_old)
  3141.       refresh_number(6,@gold_old,@gold_number,@gold_number_image,@gold_cw,@gold_ch,false)
  3142.       if @gold_smart_fade
  3143.          fade_sprite(@gold,@fade_hud_gold)
  3144.          fade_sprite(@gold_number,@fade_hud_gold)
  3145.       else  
  3146.          fade_sprite(@gold,@fade_hud)
  3147.          fade_sprite(@gold_number,@fade_hud)        
  3148.       end  
  3149.   end
  3150.    
  3151. end
  3152. #==============================================================================
  3153. #==============================================================================
  3154. # ** Ultima Hud (DISPOSE)
  3155. #==============================================================================
  3156. #==============================================================================
  3157. class Ultima_Hud
  3158.   #--------------------------------------------------------------------------
  3159.   # * Dispose
  3160.   #--------------------------------------------------------------------------  
  3161.   def dispose
  3162.       dispose_layout
  3163.       dispose_layout_2
  3164.       dispose_name
  3165.       dispose_face
  3166.       dispose_hp_number
  3167.       dispose_hp_number_max
  3168.       dispose_hp_meter
  3169.       dispose_hp_icon
  3170.       dispose_hp_icon_ex
  3171.       dispose_hp_icon_number
  3172.       dispose_mp_number
  3173.       dispose_mp_number_max
  3174.       dispose_mp_meter
  3175.       dispose_mp_icon
  3176.       dispose_mp_icon_ex
  3177.       dispose_mp_icon_number
  3178.       dispose_tp_number
  3179.       dispose_tp_number_max
  3180.       dispose_tp_meter
  3181.       dispose_tp_icon
  3182.       dispose_tp_icon_ex
  3183.       dispose_tp_icon_number
  3184.       dispose_lv_number
  3185.       dispose_lv_number_exp
  3186.       dispose_lv_meter
  3187.       dispose_states
  3188.       dispose_equipment
  3189.       dispose_gold
  3190.   end
  3191.  
  3192.   #--------------------------------------------------------------------------
  3193.   # * Dispose Layout
  3194.   #--------------------------------------------------------------------------  
  3195.   def dispose_layout
  3196.       return if @layout == nil
  3197.       @layout.bitmap.dispose
  3198.       @layout.dispose
  3199.   end
  3200.  
  3201.   #--------------------------------------------------------------------------
  3202.   # * Dispose Layout 2
  3203.   #--------------------------------------------------------------------------  
  3204.   def dispose_layout_2
  3205.       return if @layout2 == nil
  3206.       @layout2.bitmap.dispose
  3207.       @layout2.dispose
  3208.   end  
  3209.  
  3210.   #--------------------------------------------------------------------------
  3211.   # * Dispose Name
  3212.   #--------------------------------------------------------------------------          
  3213.   def dispose_name
  3214.       return if @name == nil
  3215.       @name.bitmap.dispose
  3216.       @name.dispose
  3217.   end  
  3218.  
  3219.   #--------------------------------------------------------------------------
  3220.   # * Dispose Face
  3221.   #--------------------------------------------------------------------------        
  3222.   def dispose_face
  3223.       return if @face == nil
  3224.       @face_image.dispose if @face_image != nil
  3225.       @face.bitmap.dispose if @face.bitmap != nil    
  3226.       @face.dispose
  3227.   end  
  3228.  
  3229.   #--------------------------------------------------------------------------
  3230.   # * Dispose HP Number
  3231.   #--------------------------------------------------------------------------    
  3232.   def dispose_hp_number
  3233.       return if @hp_number == nil
  3234.       @hp_number.bitmap.dispose
  3235.       @hp_number.dispose
  3236.   end
  3237.   #--------------------------------------------------------------------------
  3238.   # * Dispose HP Number Max
  3239.   #--------------------------------------------------------------------------    
  3240.   def dispose_hp_number_max
  3241.       return if @hp_number2 == nil
  3242.       @hp_number2.bitmap.dispose
  3243.       @hp_number2.dispose
  3244.   end    
  3245.  
  3246.   #--------------------------------------------------------------------------
  3247.   # * Dispose HP Meter
  3248.   #--------------------------------------------------------------------------    
  3249.   def dispose_hp_meter
  3250.       return if @hp_meter == nil
  3251.       @hp_meter.bitmap.dispose
  3252.       @hp_meter.dispose
  3253.   end  
  3254.  
  3255.   #--------------------------------------------------------------------------
  3256.   # * Dispose HP Icon
  3257.   #--------------------------------------------------------------------------      
  3258.   def dispose_hp_icon
  3259.       return if @hp_icon == nil
  3260.       @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  3261.       @hp_icon.dispose
  3262.   end    
  3263.  
  3264.   #--------------------------------------------------------------------------
  3265.   # * Dispose HP Icon EX
  3266.   #--------------------------------------------------------------------------      
  3267.   def dispose_hp_icon_ex
  3268.       return if @hp_icon3 == nil
  3269.       @hp_icon3.bitmap.dispose
  3270.       @hp_icon3.dispose      
  3271.   end      
  3272.  
  3273.   #--------------------------------------------------------------------------
  3274.   # * Dispose HP Icon Number
  3275.   #--------------------------------------------------------------------------  
  3276.   def dispose_hp_icon_number
  3277.       return if @hp_icon_number == nil
  3278.       @hp_icon_number.bitmap.dispose
  3279.       @hp_icon_number.dispose
  3280.   end    
  3281.  
  3282.   #--------------------------------------------------------------------------
  3283.   # * Dispose MP Number
  3284.   #--------------------------------------------------------------------------    
  3285.   def dispose_mp_number
  3286.       return if @mp_number == nil
  3287.       @mp_number.bitmap.dispose
  3288.       @mp_number.dispose
  3289.   end    
  3290.  
  3291.   #--------------------------------------------------------------------------
  3292.   # * Dispose MP Number Max
  3293.   #--------------------------------------------------------------------------    
  3294.   def dispose_mp_number_max
  3295.       return if @mp_number2 == nil
  3296.       @mp_number2.bitmap.dispose
  3297.       @mp_number2.dispose
  3298.   end  
  3299.  
  3300.   #--------------------------------------------------------------------------
  3301.   # * Dispose MP Meter
  3302.   #--------------------------------------------------------------------------    
  3303.   def dispose_mp_meter
  3304.       return if @mp_meter == nil
  3305.       @mp_meter.bitmap.dispose
  3306.       @mp_meter.dispose
  3307.   end    
  3308.  
  3309.   #--------------------------------------------------------------------------
  3310.   # * Dispose MP Icon
  3311.   #--------------------------------------------------------------------------      
  3312.   def dispose_mp_icon
  3313.       return if @mp_icon == nil
  3314.       @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  3315.       @mp_icon.dispose
  3316.   end    
  3317.  
  3318.   #--------------------------------------------------------------------------
  3319.   # * Dispose MP Icon EX
  3320.   #--------------------------------------------------------------------------      
  3321.   def dispose_mp_icon_ex
  3322.       return if @mp_icon3 == nil
  3323.       @mp_icon3.bitmap.dispose
  3324.       @mp_icon3.dispose      
  3325.   end        
  3326.  
  3327.   #--------------------------------------------------------------------------
  3328.   # * Dispose MP Icon Number
  3329.   #--------------------------------------------------------------------------  
  3330.   def dispose_mp_icon_number
  3331.       return if @mp_icon_number == nil
  3332.       @mp_icon_number.bitmap.dispose
  3333.       @mp_icon_number.dispose
  3334.   end  
  3335.    
  3336.   #--------------------------------------------------------------------------
  3337.   # * Dispose TP Number
  3338.   #--------------------------------------------------------------------------    
  3339.   def dispose_tp_number
  3340.       return if @tp_number == nil
  3341.       @tp_number.bitmap.dispose
  3342.       @tp_number.dispose
  3343.   end
  3344.  
  3345.   #--------------------------------------------------------------------------
  3346.   # * Dispose TP Number Max
  3347.   #--------------------------------------------------------------------------    
  3348.   def dispose_tp_number_max
  3349.       return if @tp_number2 == nil
  3350.       @tp_number2.bitmap.dispose
  3351.       @tp_number2.dispose
  3352.   end  
  3353.  
  3354.   #--------------------------------------------------------------------------
  3355.   # * Dispose TP Meter
  3356.   #--------------------------------------------------------------------------    
  3357.   def dispose_tp_meter
  3358.       return if @tp_meter == nil
  3359.       @tp_meter.bitmap.dispose
  3360.       @tp_meter.dispose
  3361.   end    
  3362.  
  3363.   #--------------------------------------------------------------------------
  3364.   # * Dispose TP Icon
  3365.   #--------------------------------------------------------------------------      
  3366.   def dispose_tp_icon
  3367.       return if @tp_icon == nil
  3368.       @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  3369.       @tp_icon.dispose
  3370.   end    
  3371.  
  3372.   #--------------------------------------------------------------------------
  3373.   # * Dispose TP Icon EX
  3374.   #--------------------------------------------------------------------------      
  3375.   def dispose_tp_icon_ex
  3376.       return if @tp_icon3 == nil
  3377.       @tp_icon3.bitmap.dispose
  3378.       @tp_icon3.dispose      
  3379.   end  
  3380.  
  3381.   #--------------------------------------------------------------------------
  3382.   # * Dispose TP Icon Number
  3383.   #--------------------------------------------------------------------------  
  3384.   def dispose_tp_icon_number
  3385.       return if @tp_icon_number == nil
  3386.       @tp_icon_number.bitmap.dispose
  3387.       @tp_icon_number.dispose
  3388.   end    
  3389.  
  3390.   #--------------------------------------------------------------------------
  3391.   # * Dispose Lv Number
  3392.   #--------------------------------------------------------------------------    
  3393.   def dispose_lv_number
  3394.       return if @lv_number == nil
  3395.       @lv_number.bitmap.dispose
  3396.       @lv_number.dispose
  3397.   end
  3398.   #--------------------------------------------------------------------------
  3399.   # * Dispose Lv Number EXP
  3400.   #--------------------------------------------------------------------------    
  3401.   def dispose_lv_number_exp
  3402.       return if @lv_number2 == nil
  3403.       @lv_number2.bitmap.dispose
  3404.       @lv_number2.dispose
  3405.   end      
  3406.  
  3407.   #--------------------------------------------------------------------------
  3408.   # * Dispose Lv Meter
  3409.   #--------------------------------------------------------------------------    
  3410.   def dispose_lv_meter
  3411.       return if @lv_meter == nil
  3412.       @lv_meter.bitmap.dispose
  3413.       @lv_meter.dispose
  3414.   end      
  3415.  
  3416.   #--------------------------------------------------------------------------
  3417.   # * Dispose States
  3418.   #--------------------------------------------------------------------------      
  3419.   def dispose_states
  3420.       return if @status == nil
  3421.       @status.bitmap.dispose if @status.bitmap != nil
  3422.       @status.dispose
  3423.       @actor_status.dispose if @actor_status != nil
  3424.   end
  3425.  
  3426.   #--------------------------------------------------------------------------
  3427.   # * Dispose Equipment
  3428.   #--------------------------------------------------------------------------  
  3429.   def dispose_equipment
  3430.       return if @equip_layout == nil
  3431.       @equip_layout.bitmap.dispose
  3432.       @equip_layout.dispose
  3433.       @equip_icon.bitmap.dispose
  3434.       @equip_icon.dispose
  3435.   end
  3436.  
  3437.   #--------------------------------------------------------------------------
  3438.   # * Dispose Gold
  3439.   #--------------------------------------------------------------------------  
  3440.   def dispose_gold
  3441.       return if @gold == nil
  3442.       @gold_number.bitmap.dispose
  3443.       @gold.dispose
  3444.       @gold_number.bitmap.dispose
  3445.       @gold_number.dispose
  3446.   end  
  3447.    
  3448. end
  3449. #==============================================================================
  3450. #==============================================================================
  3451. # ** Ultima Hud (UPDATE)
  3452. #==============================================================================
  3453. #==============================================================================
  3454. class Ultima_Hud
  3455.   #--------------------------------------------------------------------------
  3456.   # * Update
  3457.   #--------------------------------------------------------------------------  
  3458.   def update
  3459.       refresh_actor if @actor != $game_party.members[0]
  3460.       return if @actor == nil
  3461.       update_visible
  3462.       update_layout
  3463.       update_layout_2
  3464.       update_name
  3465.       update_face
  3466.       update_hp
  3467.       update_mp
  3468.       update_tp
  3469.       update_level
  3470.       update_states
  3471.       update_equipment
  3472.       update_gold
  3473.       update_removed_parts
  3474.   end
  3475.  
  3476.   def update_removed_parts
  3477.     if REMOVE_PARTS[@actor.id].include?(:exp)
  3478.       @lv_number.visible = false if @lv_number
  3479.       @lv_number2.visible = false if @lv_number2
  3480.       @lv_meter.visible = false if @lv_meter
  3481.       @layout.bitmap = Cache.ultima_hud("Removed_EXP_Layout") if @layout
  3482.       @layout2.bitmap = Cache.ultima_hud("Removed_EXP_Layout_2") if @layout2
  3483.     else
  3484.       @lv_number.visible = true if @lv_number
  3485.       @lv_number2.visible = true if @lv_number2
  3486.       @lv_meter.visible = true if @lv_meter
  3487.       @layout.bitmap = Cache.ultima_hud("Layout") if @layout
  3488.       @layout2.bitmap = Cache.ultima_hud("Layout_2") if @layout2
  3489.     end
  3490.   end
  3491.  
  3492.   #--------------------------------------------------------------------------
  3493.   # * Update Visible
  3494.   #--------------------------------------------------------------------------    
  3495.   def update_visible
  3496.       update_auto_hide
  3497.       return if !SMART_FADE_EFFECT
  3498.       @fade_hud = smart_fade_in_range?(@hud_size_x,@hud_size_y)
  3499.       update_gold_smart_fade
  3500.       update_equip_smart_fade
  3501.   end
  3502.  
  3503.   #--------------------------------------------------------------------------
  3504.   # * Update Auto Hide
  3505.   #--------------------------------------------------------------------------      
  3506.   def update_auto_hide
  3507.       if can_auto_hide?
  3508.          @force_hide = true
  3509.          @force_hide_time += 1
  3510.       else  
  3511.          @force_hide = false
  3512.          @force_hide_time = 0
  3513.       end    
  3514.   end
  3515.  
  3516.   #--------------------------------------------------------------------------
  3517.   # * Can Auto  Hide
  3518.   #--------------------------------------------------------------------------  
  3519.   def can_auto_hide?
  3520.       return true if !$game_system.hud_visible
  3521.       return false if !AUTO_HIDE_FOR_INTERPRETER
  3522.       return true if $game_map.interpreter.running?
  3523.       return true if $game_message.visible
  3524.       return false
  3525.   end
  3526.   #--------------------------------------------------------------------------
  3527.   # * Smart Fade In Range
  3528.   #--------------------------------------------------------------------------      
  3529.   def smart_fade_in_range?(range_x,range_y)
  3530.       if $game_player.screen_x.between?(range_x[0],range_x[1]) and
  3531.          $game_player.screen_y.between?(range_y[0],range_y[1])
  3532.          return true
  3533.       else  
  3534.          return false      
  3535.       end    
  3536.   end
  3537.  
  3538.   #--------------------------------------------------------------------------
  3539.   # * Update Gold Smart Fade
  3540.   #--------------------------------------------------------------------------      
  3541.   def update_gold_smart_fade
  3542.       return if @gold == nil
  3543.       return if !@gold_smart_fade
  3544.       @fade_hud_gold = smart_fade_in_range?(@gold_hud_size_x,@gold_hud_size_y)
  3545.   end
  3546.    
  3547.   #--------------------------------------------------------------------------
  3548.   # * Update Equip Smart Fade
  3549.   #--------------------------------------------------------------------------        
  3550.   def update_equip_smart_fade
  3551.       return if @equip_layout == nil
  3552.       return if !@equip_smart_fade
  3553.       @fade_hud_equip = smart_fade_in_range?(@equip_hud_size_x,@equip_hud_size_y)
  3554.   end
  3555.  
  3556.   #--------------------------------------------------------------------------
  3557.   # * Refresh Actor
  3558.   #--------------------------------------------------------------------------    
  3559.   def refresh_actor
  3560.       if can_initialize_hud?
  3561.          setup
  3562.          create_sprites
  3563.       end
  3564.       clear_base_parameters
  3565.   end
  3566.  
  3567.   #--------------------------------------------------------------------------
  3568.   # * Clear Base Parameters
  3569.   #--------------------------------------------------------------------------  
  3570.   def clear_base_parameters
  3571.       @actor = $game_party.members[0]
  3572.       $game_system.hud_face = [1,0]
  3573.       @hp_old_meter = 0
  3574.       @mp_old_meter = 0
  3575.       @tp_old_meter = 0
  3576.       refresh_equipment
  3577.       if @actor != nil
  3578.          if @face != nil
  3579.             refresh_face_name rescue nil
  3580.             @face_old_hp = @actor.hp
  3581.             @face_old_mp = @actor.mp
  3582.             @face_old_tp = @actor.tp
  3583.          end
  3584.          if @name != nil
  3585.             refresh_name rescue  nil
  3586.           end
  3587.          update_removed_parts
  3588.       end    
  3589.   end
  3590.      
  3591.   #--------------------------------------------------------------------------
  3592.   # * Can Initialize HUD?
  3593.   #--------------------------------------------------------------------------    
  3594.   def can_initialize_hud?
  3595.       return false if @actor != nil and $game_party.members[0] != nil
  3596.       return true
  3597.   end  
  3598.  
  3599. end
  3600. $mog_rgss3_ultima_hud = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement