Advertisement
Mattsuharu1991

Mog Battle Hud

Aug 7th, 2022
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 243.32 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. #
  8. # Coloque as imagens da hud na pasta.
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # Para ocultar ou apresentar a hud de batalha use o código abaixo.
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # ou
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # Para mudar o sprite da face do battler use o código abaixo.
  22. #==============================================================================
  23. #
  24. # battler_face_name( ACTOR_ID, FIlE_NAME )
  25. #
  26. #==============================================================================
  27.  
  28. #==============================================================================
  29. # Atualizações desta versão.
  30. #==============================================================================
  31. # (ver 6.6)
  32. #      - Correção do Crash caso optar por desativar o layout das janelas.
  33. # (ver 6.5)
  34. #      - Melhoria no cálculo da posição Z.
  35. #      - Correção de travar o menu.
  36. # (ver 6.4)
  37. #      - Correção do glitch de aparecer um pedaço da Windowskin quando se
  38. #        usa mais de 4 battlers na batalha.
  39. # (ver 6.3)
  40. #      - Compatibilidade com o MOG Battle Camera.
  41. # (ver 6.2)
  42. #     - Refresh da hud ao trocar a posição dos personagens.
  43. # (ver 6.0)
  44. #     - Adição da camada da tela.
  45. #     - Adição do efeito Slide.
  46. #     - Adição de novas opções referente a fonte.
  47. #==============================================================================
  48.  
  49. $imported = {} if $imported.nil?
  50. $imported[:mog_battle_hud_ex] = true
  51.  
  52. module MOG_BATTLE_HUD_EX
  53.  
  54.   #============================================================================
  55.   #============================================================================
  56.   # * HUD SPRITE (GENERAL)
  57.   #============================================================================
  58.   # Definição da quantidade maxima de personagens na batalha.
  59.   #---------------------------------------------------------------------------
  60.   MAX_BATTLE_MEMBERS = 4
  61.   #---------------------------------------------------------------------------
  62.   # Definição da prioridade da hud.
  63.   #---------------------------------------------------------------------------
  64.   HUD_Z = 110
  65.   #---------------------------------------------------------------------------
  66.   # Definição da posição geral da hud, influência em todos os sprites da hud. 323
  67.   #---------------------------------------------------------------------------
  68.   HUD_POSITION = [0,323]
  69.   #---------------------------------------------------------------------------
  70.   # Definição do espaço entre os membros do grupo.
  71.   # (Use apenas para ajustes)
  72.   #---------------------------------------------------------------------------
  73.   MEMBERS_SPACE = [0,0]
  74.   #---------------------------------------------------------------------------
  75.   # Definição fixa da hud se deseja posicionar a hud em lugares
  76.   # específicos da tela.
  77.   #
  78.   # FIXED_POSITION[INDEX_ID] = [X,Y]
  79.   #
  80.   #---------------------------------------------------------------------------
  81.   FIXED_HUD_POSITION = []
  82.   # FIXED_HUD_POSITION[0] = [10,10]
  83.   # FIXED_HUD_POSITION[1] = [410,10]
  84.   # FIXED_HUD_POSITION[2] = [10,320]
  85.   # FIXED_HUD_POSITION[3] = [410,320]
  86.   #---------------------------------------------------------------------------
  87.   # Definição da posição do comando quando a opção de janelas fixa é ativada.
  88.   #---------------------------------------------------------------------------
  89.   FIXED_COMMAND_POSITION = []
  90.   #FIXED_COMMAND_POSITION[0] = [130,10]
  91.   # FIXED_COMMAND_POSITION[1] = [300,10]
  92.   # FIXED_COMMAND_POSITION[2] = [130,290]
  93.   # FIXED_COMMAND_POSITION[3] = [300,290]
  94.   #---------------------------------------------------------------------------
  95.   # Ocultar a HUD quando a janela de mensagem está ativa.
  96.   #---------------------------------------------------------------------------
  97.   MESSAGE_WINDOW_FADE_HUD = false
  98.   #---------------------------------------------------------------------------
  99.   # Definição da porcentagem do parâmetro baixo, isso influência na cor
  100.   # do número dos parâmetros de HP, MP e TP.
  101.   #---------------------------------------------------------------------------
  102.   LOW_PARAMETER_PERCENTAGE = 30
  103.   #============================================================================
  104.   #============================================================================
  105.  
  106.  
  107.   #============================================================================
  108.   #============================================================================
  109.   # * NAME
  110.   #============================================================================
  111.   # Ativar o Sprite do nome do personagem.
  112.   #---------------------------------------------------------------------------
  113.   NAME_VISIBLE = false
  114.   #---------------------------------------------------------------------------
  115.   # Definição da prioridade do Sprite.
  116.   #---------------------------------------------------------------------------  
  117.   NAME_Z = 5
  118.   #---------------------------------------------------------------------------
  119.   # Definição da posição da Face. [X,Y]
  120.   #---------------------------------------------------------------------------
  121.   NAME_POSITION = [0,-7]
  122.   #---------------------------------------------------------------------------
  123.   # Definição do tipo alinhamento do nome.
  124.   #
  125.   # 0 - Esquerda
  126.   # 1 - Centro
  127.   # 2 - Direita
  128.   #---------------------------------------------------------------------------  
  129.   NAME_ALIGN_TYPE = 1
  130.   #---------------------------------------------------------------------------
  131.   # Definição do nome da fonte.
  132.   #---------------------------------------------------------------------------
  133.   NAME_FONT_NAME = "Georgia"
  134.   #---------------------------------------------------------------------------
  135.   # Definição do tamanho da fonte.
  136.   #---------------------------------------------------------------------------  
  137.   NAME_FONT_SIZE = 16
  138.   #---------------------------------------------------------------------------
  139.   # Ativar Bold.
  140.   #---------------------------------------------------------------------------  
  141.   NAME_FONT_BOLD = true
  142.   #---------------------------------------------------------------------------
  143.   # Ativar Italic.
  144.   #---------------------------------------------------------------------------  
  145.   NAME_FONT_ITALIC = true
  146.   #---------------------------------------------------------------------------
  147.   # Definição da cor da fonte
  148.   #---------------------------------------------------------------------------    
  149.   NAME_FONT_COLOR = Color.new(255,255,255,255)
  150.   #---------------------------------------------------------------------------
  151.   # Ativar Sombra
  152.   #---------------------------------------------------------------------------  
  153.   NAME_FONT_SHADOW = false
  154.   #---------------------------------------------------------------------------
  155.   # Definição da cor da sombra
  156.   #---------------------------------------------------------------------------    
  157.   NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  158.   #---------------------------------------------------------------------------
  159.   # Definição da distância da sombra.
  160.   #---------------------------------------------------------------------------    
  161.   NAME_FONT_SHADOW_POSITION = [2,2]  
  162.   #============================================================================
  163.   #============================================================================
  164.    
  165.  
  166.   #============================================================================
  167.   #============================================================================
  168.   # * FACE
  169.   #============================================================================
  170.   # Ativar a face.
  171.   # Será necessário o arquivo.
  172.   #
  173.   # ACTOR_NAME + _Face.png
  174.   #
  175.   # Eric_Face.png
  176.   #
  177.   #---------------------------------------------------------------------------
  178.   FACE_VISIBLE = true
  179.   # Ativar as Faces representando os battlers.
  180.   # Deixe "false" se tiver problemas de compatibilidade com scripts.
  181.   FACE_BATTLER = true
  182.   #---------------------------------------------------------------------------
  183.   # Definição da prioridade do sprite.
  184.   #---------------------------------------------------------------------------  
  185.   FACE_Z = -1
  186.   #---------------------------------------------------------------------------
  187.   # Definição da posição da Face. [X,Y]
  188.   #---------------------------------------------------------------------------
  189.   FACE_POSITION = [68,5]
  190.   #---------------------------------------------------------------------------
  191.   # Ativar faces animadas.
  192.   # Será necessário ter uma imagem de 5 faces do personagem no mesmo arquivo.
  193.   #
  194.   # FACE1/FACE2/FACE3/FACE4
  195.   #
  196.   # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  197.   # a imagem será dividida por 1 frame
  198.   #---------------------------------------------------------------------------  
  199.   FACE_ANIMATION = true
  200.   #---------------------------------------------------------------------------
  201.   # Ativar o efeito de Zoom quando o personagem usar alguma ação.
  202.   #---------------------------------------------------------------------------
  203.   FACE_ZOOM_ANIMATION = true
  204.   #---------------------------------------------------------------------------
  205.   # Ativar o efeito Mirror na animação de ação do personagem.
  206.   #---------------------------------------------------------------------------
  207.   FACE_ZOOM_MIRROR_EFFECT = false
  208.   #---------------------------------------------------------------------------
  209.   # Definição do tempo duração da animação da face.
  210.   #---------------------------------------------------------------------------  
  211.   FACE_ANIMATION_DURATION = 40
  212.   #---------------------------------------------------------------------------
  213.   # Ativar o efeito tremor da face quando o personagem sofrer dano.
  214.   #---------------------------------------------------------------------------  
  215.   FACE_SHAKE_EFFECT = true
  216.   #============================================================================
  217.   #============================================================================
  218.  
  219.  
  220.   #============================================================================
  221.   #============================================================================
  222.   # * TURN (ACTIVE INDICATOR)
  223.   #============================================================================
  224.   # Ativar o indicador de turno do personagem.
  225.   # Será necessário o arquivo.
  226.   #
  227.   # Turn.png
  228.   #
  229.   #---------------------------------------------------------------------------
  230.   TURN_SPRITE_VISIBLE = true
  231.   #---------------------------------------------------------------------------
  232.   # Definição da prioridade do Sprite.
  233.   #---------------------------------------------------------------------------    
  234.   TURN_SPRITE_Z = 5
  235.   #---------------------------------------------------------------------------
  236.   # Definição da posição do sprite de turno.
  237.   #---------------------------------------------------------------------------  
  238.   TURN_SPRITE_POSITION = [8,-30]
  239.   #---------------------------------------------------------------------------  
  240.   # Ativar o efeito de animação de piscar.
  241.   #---------------------------------------------------------------------------  
  242.   TURN_BLINK_EFFECT = true
  243.   #---------------------------------------------------------------------------  
  244.    
  245.  
  246.   #============================================================================
  247.   #============================================================================
  248.   # * HP
  249.   #============================================================================
  250.   # Ativar o número de HP.
  251.   # Será necessário o arquivo.
  252.   #
  253.   # HP_Number.png
  254.   #
  255.   #---------------------------------------------------------------------------
  256.   HP_NUMBER_VISIBLE = true
  257.   #---------------------------------------------------------------------------
  258.   # Definição da prioridade do Sprite.
  259.   #---------------------------------------------------------------------------    
  260.   HP_NUMBER_Z = 2
  261.   #---------------------------------------------------------------------------
  262.   # Definição da posição do número de HP. [X,Y]
  263.   #---------------------------------------------------------------------------  
  264.   HP_NUMBER_POSITION = [117,26]
  265.   #---------------------------------------------------------------------------  
  266.   # Ativar o número de HP Total.
  267.   # Será necessário o arquivo.
  268.   #
  269.   # HP_Number_Max.png
  270.   #
  271.   #---------------------------------------------------------------------------
  272.   HP_NUMBER_MAX_VISIBLE = false
  273.   #---------------------------------------------------------------------------
  274.   # Definição da posição do número de HP Total. [X,Y]
  275.   #---------------------------------------------------------------------------  
  276.   HP_NUMBER_MAX_POSITION = [165,30]
  277.   #---------------------------------------------------------------------------
  278.   # Definição do tipo alinhamento do número.
  279.   #
  280.   # 0 - Esquerda
  281.   # 1 - Centro
  282.   # 2 - Direita
  283.   #---------------------------------------------------------------------------  
  284.   HP_NUMBER_ALIGN_TYPE = 2
  285.   #---------------------------------------------------------------------------
  286.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  287.   #---------------------------------------------------------------------------
  288.   HP_NUMBER_WAVE_ALIGN_EFFECT = false
  289.   #---------------------------------------------------------------------------
  290.   # Apresentar os números em porcentagem.
  291.   #---------------------------------------------------------------------------    
  292.   HP_NUMBER_PERCENTAGE = false
  293.   #---------------------------------------------------------------------------
  294.   # Ativar números animados ("Rolantes").
  295.   #---------------------------------------------------------------------------  
  296.   HP_NUMBER_ANIMATION = true
  297.   #---------------------------------------------------------------------------
  298.   # Ativar a cor do HP baixo.
  299.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  300.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  301.   #
  302.   # NORMAL_COLOR
  303.   # LOW_PARAMETER_COLOR
  304.   #
  305.   # Caso definir a função como FALSE a imagem será dividida apenas como
  306.   # 1 frame de altura.
  307.   #---------------------------------------------------------------------------  
  308.   HP_NUMBER_LOW_COLOR = false
  309.   #---------------------------------------------------------------------------
  310.   # Ativar o medidor de HP.
  311.   # Será necessário o arquivo.
  312.   #
  313.   # HP_Meter.png
  314.   #  
  315.   #---------------------------------------------------------------------------  
  316.   HP_METER_VISIBLE = true
  317.   #---------------------------------------------------------------------------
  318.   # Definição da prioridade do sprite.
  319.   #---------------------------------------------------------------------------    
  320.   HP_METER_Z = 1
  321.   #---------------------------------------------------------------------------
  322.   # Definição da posição do medidor de HP. [X,Y]
  323.   #---------------------------------------------------------------------------  
  324.   HP_METER_POSITION = [38,39]
  325.   #---------------------------------------------------------------------------
  326.   # Definição do ângulo do medidor.
  327.   #---------------------------------------------------------------------------  
  328.   HP_METER_ANGLE = 0
  329.   #---------------------------------------------------------------------------
  330.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  331.   # inverso.
  332.   #---------------------------------------------------------------------------  
  333.   HP_METER_MIRROR_EFFECT = false
  334.   #---------------------------------------------------------------------------
  335.   # Ativar o efeito animado de dano no medidor.
  336.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  337.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  338.   #
  339.   # NORMAL_COLOR
  340.   # DAMAGE_COLOR
  341.   #
  342.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  343.   #---------------------------------------------------------------------------  
  344.   HP_METER_REDUCTION_ANIMATION = true
  345.   #---------------------------------------------------------------------------
  346.   # Ativar o efeito animado do "medidor fluindo".
  347.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  348.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  349.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  350.   #---------------------------------------------------------------------------  
  351.   HP_METER_GRADIENT_ANIMATION = true
  352.   #---------------------------------------------------------------------------
  353.   # Ativar HP em ícones.
  354.   # Será necessário ter a imagem.
  355.   #
  356.   # HP_Icon.png
  357.   #
  358.   #---------------------------------------------------------------------------
  359.   HP_ICON_VISIBLE = false
  360.   #---------------------------------------------------------------------------
  361.   # Definição da prioridade do Sprite.
  362.   #---------------------------------------------------------------------------    
  363.   HP_ICON_Z = 1
  364.   #---------------------------------------------------------------------------
  365.   # Posição do ícone de HP.
  366.   #---------------------------------------------------------------------------  
  367.   HP_ICON_POSITION = [200,0]
  368.   #---------------------------------------------------------------------------
  369.   # Ativar o sprite EX do ultimo ícone
  370.   # Será necessário ter a imagem.
  371.   #
  372.   # HP_Icon_EX.png
  373.   #
  374.   #---------------------------------------------------------------------------
  375.   HP_ICON_EX_VISIBLE = false
  376.   #---------------------------------------------------------------------------
  377.   # Posição do ícone Animado.
  378.   #---------------------------------------------------------------------------  
  379.   HP_ICON_EX_POSITION = [0,0]
  380.   #---------------------------------------------------------------------------
  381.   # Ativar o efeito de Zoom do Sprite.
  382.   #---------------------------------------------------------------------------
  383.   HP_ICON_EX_ZOOM_EFFECT = true
  384.   #---------------------------------------------------------------------------
  385.   # Espaço entre os ícones.
  386.   #---------------------------------------------------------------------------    
  387.   HP_ICON_SPACE = [-10,-10]
  388.   #---------------------------------------------------------------------------
  389.   # Definição da quantidade maxima de ícones na horizontal.
  390.   #---------------------------------------------------------------------------  
  391.   HP_ICON_COL_MAX = 10
  392.   #---------------------------------------------------------------------------
  393.   # Definição da quantidade maxima de ícones na vertical.
  394.   #---------------------------------------------------------------------------    
  395.   HP_ICON_ROW_MAX = 2
  396.   #---------------------------------------------------------------------------
  397.   # Ativar o número de HP de ícones.
  398.   # Será necessário ter a imagem.
  399.   #
  400.   # HP_Icon_Number.png
  401.   #
  402.   #---------------------------------------------------------------------------
  403.   HP_ICON_NUMBER_VISIBLE = false
  404.   #---------------------------------------------------------------------------
  405.   # Definição da prioridade do sprite.
  406.   #---------------------------------------------------------------------------
  407.   HP_ICON_NUMBER_Z = 4
  408.   #---------------------------------------------------------------------------
  409.   # Posição do número do ícone
  410.   #---------------------------------------------------------------------------  
  411.   HP_ICON_NUMBER_POSITION = [0,0]
  412.   #---------------------------------------------------------------------------
  413.   # Definição do tipo alinhamento do número.
  414.   #
  415.   # 0 - Esquerda
  416.   # 1 - Centro
  417.   # 2 - Direita
  418.   #---------------------------------------------------------------------------  
  419.   HP_ICON_NUMBER_ALIGN_TYPE = 0  
  420.   #============================================================================
  421.   #============================================================================
  422.  
  423.  
  424.   #============================================================================
  425.   #============================================================================
  426.   # * MP
  427.   #============================================================================
  428.   # Ativar o número de MP.
  429.   # Será necessário o arquivo.
  430.   #
  431.   # MP_Number.png
  432.   #  
  433.   #---------------------------------------------------------------------------  
  434.   MP_NUMBER_VISIBLE = true
  435.   #---------------------------------------------------------------------------
  436.   # Definição da prioridade do Sprite.
  437.   #---------------------------------------------------------------------------    
  438.   MP_NUMBER_Z = 2  
  439.   #---------------------------------------------------------------------------
  440.   # Definição da posição do número de MP. [X,Y]
  441.   #---------------------------------------------------------------------------  
  442.   MP_NUMBER_POSITION = [90,44]
  443.   #---------------------------------------------------------------------------  
  444.   # Ativar o número de MP Total.
  445.   # Será necessário o arquivo.
  446.   #
  447.   # MP_Number_Max.png
  448.   #
  449.   #---------------------------------------------------------------------------
  450.   MP_NUMBER_MAX_VISIBLE = false
  451.   #---------------------------------------------------------------------------
  452.   # Definição da posição do número de MP Total. [X,Y]
  453.   #---------------------------------------------------------------------------  
  454.   MP_NUMBER_MAX_POSITION = [128,53]
  455.   #---------------------------------------------------------------------------
  456.   # Definição do tipo alinhamento do número.
  457.   #
  458.   # 0 - Esquerda
  459.   # 1 - Centro
  460.   # 2 - Direita
  461.   #---------------------------------------------------------------------------  
  462.   MP_NUMBER_ALIGN_TYPE = 2
  463.   #---------------------------------------------------------------------------
  464.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  465.   #---------------------------------------------------------------------------
  466.   MP_NUMBER_WAVE_ALIGN_EFFECT = false    
  467.   #---------------------------------------------------------------------------
  468.   # Apresentar os números em porcentagem.
  469.   #---------------------------------------------------------------------------    
  470.   MP_NUMBER_PERCENTAGE = false
  471.   #---------------------------------------------------------------------------
  472.   # Ativar números animados ("Rolantes").
  473.   #---------------------------------------------------------------------------  
  474.   MP_NUMBER_ANIMATION = true
  475.   #---------------------------------------------------------------------------
  476.   # Ativar a cor do MP baixo.
  477.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  478.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  479.   #
  480.   # NORMAL_COLOR
  481.   # LOW_PARAMETER_COLOR
  482.   #
  483.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  484.   #---------------------------------------------------------------------------  
  485.   MP_NUMBER_LOW_COLOR = false
  486.   #---------------------------------------------------------------------------
  487.   # Ativar o medidor de MP.
  488.   # Será necessário o arquivo.
  489.   #
  490.   # MP_Meter.png
  491.   #    
  492.   #---------------------------------------------------------------------------  
  493.   MP_METER_VISIBLE = true
  494.   #---------------------------------------------------------------------------
  495.   # Definição da prioridade do sprite.
  496.   #---------------------------------------------------------------------------    
  497.   MP_METER_Z = 1  
  498.   #---------------------------------------------------------------------------
  499.   # Definição da posição do medidor de MP. [X,Y]
  500.   #---------------------------------------------------------------------------  
  501.   MP_METER_POSITION = [9,56]
  502.   #---------------------------------------------------------------------------
  503.   # Definição do ângulo do medidor.
  504.   #---------------------------------------------------------------------------  
  505.   MP_METER_ANGLE = 0
  506.   #---------------------------------------------------------------------------
  507.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  508.   # inverso.
  509.   #---------------------------------------------------------------------------  
  510.   MP_METER_MIRROR_EFFECT = false
  511.   #---------------------------------------------------------------------------
  512.   # Ativar o efeito animado de dano no medidor.
  513.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  514.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  515.   #
  516.   # NORMAL_COLOR
  517.   # DAMAGE_COLOR
  518.   #
  519.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  520.   #---------------------------------------------------------------------------  
  521.   MP_METER_REDUCTION_ANIMATION = true
  522.   #---------------------------------------------------------------------------
  523.   # Ativar o efeito animado do "medidor fluindo".
  524.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  525.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  526.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  527.   #---------------------------------------------------------------------------  
  528.   MP_METER_GRADIENT_ANIMATION = true
  529.   #---------------------------------------------------------------------------
  530.   # Ativar MP em ícones.
  531.   # Será necessário ter a imagem.
  532.   #
  533.   # MP_Icon.png
  534.   #
  535.   #---------------------------------------------------------------------------
  536.   MP_ICON_VISIBLE = false
  537.   #---------------------------------------------------------------------------
  538.   # Definição da prioridade do Sprite.
  539.   #---------------------------------------------------------------------------    
  540.   MP_ICON_Z = 1  
  541.   #---------------------------------------------------------------------------
  542.   # Posição do ícone de MP.
  543.   #---------------------------------------------------------------------------  
  544.   MP_ICON_POSITION = [200,64]
  545.   #---------------------------------------------------------------------------
  546.   # Ativar o sprite EX do ultimo ícone
  547.   # Será necessário ter a imagem.
  548.   #
  549.   # MP_Icon_EX.png
  550.   #
  551.   #---------------------------------------------------------------------------
  552.   MP_ICON_EX_VISIBLE = false
  553.   #---------------------------------------------------------------------------
  554.   # Posição do ícone Animado.
  555.   #---------------------------------------------------------------------------  
  556.   MP_ICON_EX_POSITION = [0,0]
  557.   #---------------------------------------------------------------------------
  558.   # Ativar o efeito de Zoom do Sprite.
  559.   #---------------------------------------------------------------------------
  560.   MP_ICON_EX_ZOOM_EFFECT = true
  561.   #---------------------------------------------------------------------------
  562.   # Espaço entre os ícones.
  563.   #---------------------------------------------------------------------------    
  564.   MP_ICON_SPACE = [-10,-10]
  565.   #---------------------------------------------------------------------------
  566.   # Definição da quantidade maxima de ícones na horizontal.
  567.   #---------------------------------------------------------------------------  
  568.   MP_ICON_COL_MAX = 10
  569.   #---------------------------------------------------------------------------
  570.   # Definição da quantidade maxima de ícones na vertical.
  571.   #---------------------------------------------------------------------------    
  572.   MP_ICON_ROW_MAX = 2
  573.   #---------------------------------------------------------------------------
  574.   # Ativar o número de MP de ícones.
  575.   # Será necessário ter a imagem.
  576.   #
  577.   # MP_Icon_Number.png
  578.   #
  579.   #---------------------------------------------------------------------------
  580.   MP_ICON_NUMBER_VISIBLE = false
  581.   #---------------------------------------------------------------------------
  582.   # Definição da prioridade do sprite.
  583.   #---------------------------------------------------------------------------
  584.   MP_ICON_NUMBER_Z = 4
  585.   #---------------------------------------------------------------------------
  586.   # Posição do número do ícone
  587.   #---------------------------------------------------------------------------  
  588.   MP_ICON_NUMBER_POSITION = [0,64]
  589.   #---------------------------------------------------------------------------
  590.   # Definição do tipo alinhamento do número.
  591.   #
  592.   # 0 - Esquerda
  593.   # 1 - Centro
  594.   # 2 - Direita
  595.   #---------------------------------------------------------------------------  
  596.   MP_ICON_NUMBER_ALIGN_TYPE = 0    
  597.   #============================================================================
  598.   #============================================================================
  599.  
  600.  
  601.   #============================================================================
  602.   #============================================================================
  603.   # * TP
  604.   #============================================================================
  605.   # Ativar o número de TP.
  606.   # Será necessário o arquivo.
  607.   #
  608.   # TP_Number.png
  609.   #    
  610.   #---------------------------------------------------------------------------
  611.   TP_NUMBER_VISIBLE = true
  612.   #---------------------------------------------------------------------------
  613.   # Definição da prioridade do sprite.
  614.   #---------------------------------------------------------------------------
  615.   TP_NUMBER_Z = 5  
  616.   #---------------------------------------------------------------------------
  617.   # Definição da posição do número de TP. [X,Y]
  618.   #---------------------------------------------------------------------------  
  619.   TP_NUMBER_POSITION = [19,23]
  620.   #---------------------------------------------------------------------------  
  621.   # Ativar o número de TP Total.
  622.   # Será necessário o arquivo.
  623.   #
  624.   # TP_Number_Max.png
  625.   #
  626.   #---------------------------------------------------------------------------
  627.   TP_NUMBER_MAX_VISIBLE = false
  628.   #---------------------------------------------------------------------------
  629.   # Definição da posição do número de TP Total. [X,Y]
  630.   #---------------------------------------------------------------------------  
  631.   TP_NUMBER_MAX_POSITION = [165,73]
  632.   #---------------------------------------------------------------------------
  633.   # Definição do tipo alinhamento do número.
  634.   #
  635.   # 0 - Esquerda
  636.   # 1 - Centro
  637.   # 2 - Direita
  638.   #---------------------------------------------------------------------------  
  639.   TP_NUMBER_ALIGN_TYPE = 1
  640.   #---------------------------------------------------------------------------
  641.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  642.   #---------------------------------------------------------------------------
  643.   TP_NUMBER_WAVE_ALIGN_EFFECT = false  
  644.   #---------------------------------------------------------------------------
  645.   # Apresentar os números em porcentagem.
  646.   #---------------------------------------------------------------------------    
  647.   TP_NUMBER_PERCENTAGE = false
  648.   #---------------------------------------------------------------------------
  649.   # Ativar números animados ("Rolantes").
  650.   #---------------------------------------------------------------------------  
  651.   TP_NUMBER_ANIMATION = true
  652.   #---------------------------------------------------------------------------
  653.   # Ativar a cor do TP baixo.
  654.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  655.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  656.   #
  657.   # NORMAL_COLOR
  658.   # LOW_PARAMETER_COLOR
  659.   #
  660.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  661.   #---------------------------------------------------------------------------  
  662.   TP_NUMBER_LOW_COLOR = false
  663.   #---------------------------------------------------------------------------
  664.   # Ativar o medidor de TP.
  665.   # Será necessário o arquivo.
  666.   #
  667.   # TP_Meter.png
  668.   #    
  669.   #---------------------------------------------------------------------------  
  670.   TP_METER_VISIBLE = false
  671.   #---------------------------------------------------------------------------
  672.   # Definição da prioridade do sprite.
  673.   #---------------------------------------------------------------------------
  674.   TP_METER_Z = 1  
  675.   #---------------------------------------------------------------------------
  676.   # Definição da posição do medidor de TP. [X,Y]
  677.   #---------------------------------------------------------------------------  
  678.   TP_METER_POSITION = [68,74]
  679.   #---------------------------------------------------------------------------
  680.   # Definição do ângulo do medidor.
  681.   #---------------------------------------------------------------------------  
  682.   TP_METER_ANGLE = 0
  683.   #---------------------------------------------------------------------------
  684.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  685.   # inverso.
  686.   #---------------------------------------------------------------------------  
  687.   TP_METER_MIRROR_EFFECT = false
  688.   #---------------------------------------------------------------------------
  689.   # Ativar o efeito animado de dano no medidor.
  690.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  691.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  692.   #
  693.   # NORMAL_COLOR
  694.   # DAMAGE_COLOR
  695.   #
  696.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  697.   #---------------------------------------------------------------------------  
  698.   TP_METER_REDUCTION_ANIMATION = true
  699.   #---------------------------------------------------------------------------
  700.   # Ativar o efeito animado do "medidor fluindo".
  701.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  702.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  703.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  704.   #---------------------------------------------------------------------------  
  705.   TP_METER_GRADIENT_ANIMATION = true
  706.   #---------------------------------------------------------------------------
  707.   # Ativar TP em ícones.
  708.   # Será necessário ter a imagem.
  709.   #
  710.   # TP_Icon.png
  711.   #
  712.   #---------------------------------------------------------------------------
  713.   TP_ICON_VISIBLE = false
  714.   #---------------------------------------------------------------------------
  715.   # Definição da prioridade do sprite.
  716.   #---------------------------------------------------------------------------
  717.   TP_ICON_Z = 1  
  718.   #---------------------------------------------------------------------------
  719.   # Posição do ícone de TP.
  720.   #---------------------------------------------------------------------------  
  721.   TP_ICON_POSITION = [200,128]
  722.   #---------------------------------------------------------------------------
  723.   # Ativar o sprite EX do ultimo ícone
  724.   # Será necessário ter a imagem.
  725.   #
  726.   # TP_Icon_EX.png
  727.   #
  728.   #---------------------------------------------------------------------------
  729.   TP_ICON_EX_VISIBLE = false
  730.   #---------------------------------------------------------------------------
  731.   # Posição do ícone Animado.
  732.   #---------------------------------------------------------------------------  
  733.   TP_ICON_EX_POSITION = [0,0]
  734.   #---------------------------------------------------------------------------
  735.   # Ativar o efeito de Zoom do Sprite.
  736.   #---------------------------------------------------------------------------
  737.   TP_ICON_EX_ZOOM_EFFECT = true
  738.   #---------------------------------------------------------------------------
  739.   # Espaço entre os ícones.
  740.   #---------------------------------------------------------------------------    
  741.   TP_ICON_SPACE = [-10,-10]
  742.   #---------------------------------------------------------------------------
  743.   # Definição da quantidade maxima de ícones na horizontal.
  744.   #---------------------------------------------------------------------------  
  745.   TP_ICON_COL_MAX = 10
  746.   #---------------------------------------------------------------------------
  747.   # Definição da quantidade maxima de ícones na vertical.
  748.   #---------------------------------------------------------------------------    
  749.   TP_ICON_ROW_MAX = 2
  750.   #---------------------------------------------------------------------------
  751.   # Ativar o número de TP de ícones.
  752.   # Será necessário ter a imagem.
  753.   #
  754.   # TP_Icon_Number.png
  755.   #
  756.   #---------------------------------------------------------------------------
  757.   TP_ICON_NUMBER_VISIBLE = false
  758.   #---------------------------------------------------------------------------
  759.   # Definição da prioridade do sprite.
  760.   #---------------------------------------------------------------------------
  761.   TP_ICON_NUMBER_Z = 4
  762.   #---------------------------------------------------------------------------
  763.   # Posição do número do ícone
  764.   #---------------------------------------------------------------------------  
  765.   TP_ICON_NUMBER_POSITION = [0,128]
  766.   #---------------------------------------------------------------------------
  767.   # Definição do tipo alinhamento do número.
  768.   #
  769.   # 0 - Esquerda
  770.   # 1 - Centro
  771.   # 2 - Direita
  772.   #---------------------------------------------------------------------------  
  773.   TP_ICON_NUMBER_ALIGN_TYPE = 0    
  774.   #============================================================================
  775.   #============================================================================
  776.  
  777.   #============================================================================
  778.   #============================================================================
  779.   # * AT
  780.   #============================================================================
  781.   # Ativar o número de AT.
  782.   # Será necessário o arquivo.
  783.   #
  784.   # AT_Number.png
  785.   #
  786.   #---------------------------------------------------------------------------
  787.   AT_NUMBER_VISIBLE = false
  788.   #---------------------------------------------------------------------------
  789.   # Definição da prioridade do Sprite.
  790.   #---------------------------------------------------------------------------    
  791.   AT_NUMBER_Z = 2
  792.   #---------------------------------------------------------------------------
  793.   # Definição da posição do número de AT. [X,Y]
  794.   #---------------------------------------------------------------------------  
  795.   AT_NUMBER_POSITION = [125,-27]
  796.   #---------------------------------------------------------------------------  
  797.   # Ativar o número de AT Total.
  798.   # Será necessário o arquivo.
  799.   #
  800.   # AT_Number_Max.png
  801.   #
  802.   #---------------------------------------------------------------------------
  803.   AT_NUMBER_MAX_VISIBLE = false
  804.   #---------------------------------------------------------------------------
  805.   # Definição da posição do número de AT Total. [X,Y]
  806.   #---------------------------------------------------------------------------  
  807.   AT_NUMBER_MAX_POSITION = [165,-17]
  808.   #---------------------------------------------------------------------------
  809.   # Definição do tipo alinhamento do número.
  810.   #
  811.   # 0 - Esquerda
  812.   # 1 - Centro
  813.   # 2 - Direita
  814.   #---------------------------------------------------------------------------  
  815.   AT_NUMBER_ALIGN_TYPE = 2
  816.   #---------------------------------------------------------------------------
  817.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  818.   #---------------------------------------------------------------------------
  819.   AT_NUMBER_WAVE_ALIGN_EFFECT = false
  820.   #---------------------------------------------------------------------------
  821.   # Apresentar os números em porcentagem.
  822.   #---------------------------------------------------------------------------    
  823.   AT_NUMBER_PERCENTAGE = true
  824.   #---------------------------------------------------------------------------
  825.   # Ativar números animados ("Rolantes").
  826.   #---------------------------------------------------------------------------  
  827.   AT_NUMBER_ANIMATION = false
  828.   #---------------------------------------------------------------------------
  829.   # Ativar o medidor de AT.
  830.   # Será necessário o arquivo.
  831.   #
  832.   # AT_Meter.png
  833.   #  
  834.   #---------------------------------------------------------------------------  
  835.   AT_METER_VISIBLE = false
  836.   #---------------------------------------------------------------------------
  837.   # Definição da prioridade do sprite.
  838.   #---------------------------------------------------------------------------    
  839.   AT_METER_Z = 1
  840.   #---------------------------------------------------------------------------
  841.   # Definição da posição do medidor de AT. [X,Y]
  842.   #---------------------------------------------------------------------------  
  843.   AT_METER_POSITION = [38,76]
  844.   #---------------------------------------------------------------------------
  845.   # Definição do ângulo do medidor.
  846.   #---------------------------------------------------------------------------  
  847.   AT_METER_ANGLE = 0
  848.   #---------------------------------------------------------------------------
  849.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  850.   # inverso.
  851.   #---------------------------------------------------------------------------  
  852.   AT_METER_MIRROR_EFFECT = false
  853.   #---------------------------------------------------------------------------
  854.   # Ativar o efeito animado do "medidor fluindo".
  855.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  856.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  857.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  858.   #---------------------------------------------------------------------------  
  859.   AT_METER_GRADIENT_ANIMATION = true
  860.   #============================================================================
  861.  
  862.  
  863.   #============================================================================
  864.   #============================================================================
  865.   # * LEVEL
  866.   #============================================================================
  867.   # Ativar o número de Level.
  868.   # Será necessário o arquivo.
  869.   #
  870.   # LV_Number.png
  871.   #    
  872.   #---------------------------------------------------------------------------
  873.   LEVEL_NUMBER_VISIBLE = false
  874.   #---------------------------------------------------------------------------
  875.   # Definição da prioridade do Sprite.
  876.   #---------------------------------------------------------------------------    
  877.   LEVEL_NUMBER_Z = 2
  878.   #---------------------------------------------------------------------------
  879.   # Definição da posição do número do Level. [X,Y]
  880.   #---------------------------------------------------------------------------  
  881.   LEVEL_NUMBER_POSITION = [84,0]
  882.   #---------------------------------------------------------------------------
  883.   # Definição do tipo alinhamento do número.
  884.   #
  885.   # 0 - Esquerda
  886.   # 1 - Centro
  887.   # 2 - Direita
  888.   #---------------------------------------------------------------------------  
  889.   LEVEL_NUMBER_ALIGN_TYPE = 1    
  890.   #============================================================================
  891.   #============================================================================
  892.  
  893.  
  894.   #============================================================================
  895.   #============================================================================
  896.   # * STATE
  897.   #============================================================================
  898.   # Ativar as condições.
  899.   #---------------------------------------------------------------------------  
  900.   STATES_VISIBLE = true
  901.   #---------------------------------------------------------------------------
  902.   # Definição da prioridade do sprite.
  903.   #---------------------------------------------------------------------------    
  904.   STATES_Z = 1
  905.   #---------------------------------------------------------------------------
  906.   # Definição da posição das condições. [X,Y]
  907.   #---------------------------------------------------------------------------  
  908.   STATES_POSITION = [7,65]
  909.   #---------------------------------------------------------------------------
  910.   # Ativar o efeito animado das condições deslizando.
  911.   #---------------------------------------------------------------------------  
  912.   STATES_SCROLLING_ANIMATION = false
  913.   #---------------------------------------------------------------------------
  914.   # Definição do ângulo do sprite.
  915.   #---------------------------------------------------------------------------  
  916.   STATE_ANGLE = 0
  917.   #---------------------------------------------------------------------------
  918.   # Definição das condições que serão ocultadas pela hud.
  919.   # EX - HIDE_STATES_ID = [9,10,12,14]
  920.   #---------------------------------------------------------------------------  
  921.   HIDE_STATES_ID = [66,135,138,141,151]
  922.   #============================================================================
  923.   #============================================================================
  924.  
  925.   #============================================================================
  926.   #============================================================================
  927.   # * DECK
  928.   #============================================================================
  929.   # Ativar as condições.
  930.   #---------------------------------------------------------------------------  
  931.   DECK_VISIBLE = true
  932.   #---------------------------------------------------------------------------
  933.   # Definição da prioridade do sprite.
  934.   #---------------------------------------------------------------------------    
  935.   DECK_Z = 5
  936.   #---------------------------------------------------------------------------
  937.   # Definição da posição das condições. [X,Y]
  938.   #---------------------------------------------------------------------------  
  939.   DECK_POSITION = [35,65]
  940.   #---------------------------------------------------------------------------
  941.   # Definição do ângulo do sprite.
  942.   #---------------------------------------------------------------------------  
  943.   DECK_ANGLE = 0
  944.  
  945.   #============================================================================
  946.   #============================================================================
  947.   # * SECOND LAYOUT (Overlayer)
  948.   #============================================================================  
  949.   # Ativar a segunda camada de Layout
  950.   # Será necessário o arquivo.
  951.   #
  952.   # Layout_2.png
  953.   #
  954.   #============================================================================  
  955.   SECOND_LAYOUT = false
  956.   #---------------------------------------------------------------------------
  957.   # Definição da prioridade do sprite.
  958.   #---------------------------------------------------------------------------  
  959.   SECOND_LAYOUT_Z = 4
  960.   #---------------------------------------------------------------------------
  961.   # Definição da posição do sprite.
  962.   #---------------------------------------------------------------------------  
  963.   SECOND_LAYOUT_POSITION = [-5,-10]
  964.   #============================================================================
  965.   #============================================================================
  966.    
  967.   #============================================================================
  968.   #============================================================================
  969.   # * SCREEN LAYOUT
  970.   #============================================================================  
  971.   # Ativar o Layout da tela.
  972.   # Será necessário o arquivo.
  973.   #
  974.   # Layout_Screen.png
  975.   #
  976.   #============================================================================  
  977.   #Ativar o Layout da tela
  978.   SCREEN_LAYOUT = false
  979.   #---------------------------------------------------------------------------
  980.   #Posição do layout
  981.   #---------------------------------------------------------------------------
  982.   SCREEN_LAYOUT_POSITION = [0,0]
  983.   #---------------------------------------------------------------------------
  984.   #Definição da posição Z
  985.   #---------------------------------------------------------------------------
  986.   SCREEN_LAYOUT_Z = -2    
  987.  
  988. end
  989.  
  990. #============================================================================
  991. #============================================================================
  992. # * CUSTOM WINDOWS (GENERAL)
  993. #============================================================================
  994. module MOG_BATTLE_HUD_EX
  995.  
  996.  #============================================================================
  997.  # * Ativar Janelas Customizadas.
  998.  #============================================================================
  999.   ENABLE_CUSTOM_WINDOWS = true
  1000.  
  1001.  #============================================================================
  1002.  # * BATTLE LOG WINDOW
  1003.  #============================================================================
  1004.  #Definição da posição da janela de log.
  1005.   BATTLE_LOG_POSITION = [0,0]
  1006.  #============================================================================
  1007.  
  1008.  #============================================================================
  1009.  # * FONT SETTING
  1010.  #============================================================================
  1011.  #Ativar a configuração da fonte.
  1012.  ENABLE_WINDOW_FONT_SET = false
  1013.  #Definição do nome da fonte.
  1014.  WINDOW_FONT_NAME = nil
  1015.  #Definição do tamanho da fonte.
  1016.  WINDOW_FONT_SIZE = 18
  1017.  #Ativar fonte em bold;
  1018.  WINDOW_FONT_BOLD = true
  1019.  #Ativar fonte em itálico.
  1020.  WINDOW_FONT_ITALIC = false
  1021.  
  1022.  #============================================================================
  1023.  # * SKILL WINDOW
  1024.  #============================================================================
  1025.  #Definição do tamanho da janela.
  1026.   SKILL_WINDOW_SIZE = [Graphics.width, 120]
  1027.  #Definição da posição da janela.
  1028.   SKILL_WINDOW_POSITION = [0,0]
  1029.  #Definição da transparência da janela.
  1030.   SKILL_WINDOW_OPACITY = 0
  1031.  #Ativar a imagem de Layout. ("Layout_Skill.png")
  1032.   SKILL_WINDOW_LAYOUT = true
  1033.  #Definição do layout.
  1034.   SKILL_WINDOW_LAYOUT_POSITION = [0,-7]
  1035.  #Definição da quantidade colunas máxima.
  1036.   SKILL_COL_MAX = 2
  1037.   #Ativar a animação de slide.
  1038.   SKILL_WINDOW_SLIDE_EFFECT = false
  1039.   #Definição da posição do slide.
  1040.   SKILL_WINDOW_SLIDE_POSITION = [150,150]    
  1041.  #============================================================================
  1042.  
  1043.  #============================================================================
  1044.  # * ITEM WINDOW
  1045.  #============================================================================
  1046.  #Definição do tamanho da janela.  
  1047.   ITEM_WINDOW_SIZE = [Graphics.width, 120]
  1048.  #Definição da posição da janela.
  1049.   ITEM_WINDOW_POSITION = [0,0]
  1050.  #Definição da transparência da janela.
  1051.   ITEM_WINDOW_OPACITY = 0
  1052.  #Ativar a imagem de Layout. ("Layout_Item.png")  
  1053.   ITEM_WINDOW_LAYOUT = true
  1054.  #Definição do layout.  
  1055.   ITEM_WINDOW_LAYOUT_POSITION = [0,-7]    
  1056.  #Definição da quantidade colunas máxima.
  1057.   ITEM_COL_MAX = 2
  1058.   #Ativar a animação de slide.
  1059.   ITEM_WINDOW_SLIDE_EFFECT = true
  1060.   #Definição da posição do slide.
  1061.   ITEM_WINDOW_SLIDE_POSITION = [150,150]    
  1062.  #============================================================================
  1063.  
  1064.  #============================================================================
  1065.  # * COMMAND WINDOW
  1066.  #============================================================================
  1067.  #Ajustar automáticamente  
  1068.   AUTO_ADJUST_ACTOR_COMMAND = true
  1069.  #Definição da posição da janela. (Apenas para Ajustes)
  1070.   ACTOR_COMMAND_POSITION = [0,-50]
  1071.  #Definição da transparência da janela.
  1072.   ACTOR_COMMAND_OPACITY = 0
  1073.  #Ativar a imagem de Layout. ("Layout_Command.png")    
  1074.   ACTOR_COMMAND_LAYOUT = true
  1075.  #Definição do layout.  
  1076.   ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
  1077.  #============================================================================
  1078.  
  1079.  #============================================================================
  1080.  # * HELP WINDOW
  1081.  #============================================================================
  1082.  #Definição do tamanho da janela.  
  1083.   HELP_WINDOW_SIZE = [Graphics.width, 72]
  1084.  #Definição do tamanho da janela.
  1085.   HELP_WINDOW_POSITION = [Graphics.width / 2, 0]  
  1086.  #Definição da transparência da janela.
  1087.   HELP_WINDOW_OPACITY = 0
  1088.  #Ativar a imagem de Layout. ("Layout_Help.png")    
  1089.   HELP_WINDOW_LAYOUT = true
  1090.  #Definição do layout.
  1091.   HELP_WINDOW_LAYOUT_POSITION = [0,0]
  1092.   #Ativar a animação de slide.
  1093.   HELP_WINDOW_SLIDE_EFFECT = false
  1094.   #Definição da posição do slide.
  1095.   HELP_WINDOW_SLIDE_POSITION = [0,-150]    
  1096.  #============================================================================
  1097.  
  1098.  #============================================================================
  1099.  # * TARGET ACTOR WINDOW
  1100.  #============================================================================
  1101.  #Definição do tamanho da janela.    
  1102.   ACTOR_WINDOW_SIZE = [Graphics.width, 120]  
  1103.  #Definição do tamanho da janela.
  1104.   ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1105.  #Definição da transparência da janela.  
  1106.   ACTOR_WINDOW_OPACITY = 0
  1107.  #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1108.   ACTOR_WINDOW_LAYOUT = false
  1109.  #Definição do layout.
  1110.   ACTOR_WINDOW_LAYOUT_POSITION = [0,0]
  1111.   #Ativar a animação de slide.
  1112.   ACTOR_WINDOW_SLIDE_EFFECT = false
  1113.   #Definição da posição do slide.
  1114.   ACTOR_WINDOW_SLIDE_POSITION = [0,100]  
  1115.  #============================================================================
  1116.  
  1117.  #============================================================================
  1118.  # * TARGET ENEMY WINDOW
  1119.  #============================================================================
  1120.  #Definição do tamanho da janela.
  1121.   ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  1122.  #Definição do tamanho da janela.  
  1123.   ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1124.  #Definição da transparência da janela.  
  1125.   ENEMY_WINDOW_OPACITY = 0
  1126.  #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1127.   ENEMY_WINDOW_LAYOUT = false
  1128.  #Definição do layout.
  1129.   ENEMY_WINDOW_LAYOUT_POSITION = [0,0]
  1130.   #Ativar a animação de slide.
  1131.   ENEMY_WINDOW_SLIDE_EFFECT = false
  1132.   #Definição da posição do slide.
  1133.   ENEMY_WINDOW_SLIDE_POSITION = [0,100]      
  1134.  #============================================================================
  1135.  
  1136.  #============================================================================
  1137.  # * PARTY WINDOW (Fight/Escape)
  1138.  #============================================================================
  1139.  #Definição do tamanho da janela.  
  1140.   PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  1141.  #Definição da transparência da janela.  
  1142.   PARTY_COMMAND_OPACITY = 0
  1143.  #Ativar a imagem de Layout. ("Layout_Party.png")  
  1144.   PARTY_COMMAND_LAYOUT = false
  1145.  #Definição do layout.  
  1146.   PARTY_COMMAND_LAYOUT_POSITION = [0,0]
  1147.   #Ativar a animação de slide.
  1148.   PARTY_COMMAND_SLIDE_EFFECT = false
  1149.   #Definição da posição do slide.
  1150.   PARTY_COMMAND_SLIDE_POSITION = [0,-150]    
  1151.  #============================================================================
  1152.  
  1153. end
  1154.  
  1155. #==============================================================================
  1156. # ** Cache
  1157. #==============================================================================
  1158. module Cache
  1159.  
  1160.   #--------------------------------------------------------------------------
  1161.   # * Hud
  1162.   #--------------------------------------------------------------------------
  1163.   def self.battle_hud(filename)
  1164.       load_bitmap("Graphics/Huds/Battle/", filename)
  1165.   end
  1166.  
  1167. end
  1168.  
  1169. #==============================================================================
  1170. # ** Game Temp
  1171. #==============================================================================
  1172. class Game_Temp
  1173.  
  1174.   attr_accessor :battler_face_pos
  1175.   attr_accessor :hud_pos
  1176.   attr_accessor :hud_pos_real
  1177.   attr_accessor :com_pos
  1178.   attr_accessor :mbhud_force_refresh
  1179.   attr_accessor :mbhud_window
  1180.   attr_accessor :command_visible
  1181.   attr_accessor :refresh_turn_sprite
  1182.   attr_accessor :battle_hud_visible
  1183.   attr_accessor :battle_hud_visible_refresh
  1184.   attr_accessor :battle_end
  1185.  
  1186.   #--------------------------------------------------------------------------
  1187.   # * Initialize
  1188.   #--------------------------------------------------------------------------    
  1189.   alias mog_monogatari_bhud_initialize initialize
  1190.   def initialize
  1191.       @battler_face_pos = []
  1192.       @hud_pos = []
  1193.       @hud_pos_real = []
  1194.       @com_pos = []
  1195.       @mbhud_force_refresh = false
  1196.       @mbhud_window = [false,false,false,false,false,false,false]
  1197.       @command_visible = false
  1198.       @refresh_turn_sprite = false
  1199.       @battle_hud_visible = true
  1200.       @battle_hud_visible_refresh = [false,false]
  1201.       @battle_end = false      
  1202.       mog_monogatari_bhud_initialize
  1203.   end
  1204.  
  1205.   #--------------------------------------------------------------------------
  1206.   # * Check Screen Xyz
  1207.   #--------------------------------------------------------------------------  
  1208.   def check_screen_xyz_nil
  1209.       return if !SceneManager.face_battler?
  1210.       for actor in $game_party.battle_members
  1211.           actor.screen_x = 0 if actor.screen_x == nil
  1212.           actor.screen_y = 0 if actor.screen_y == nil
  1213.           actor.screen_z = 0 if actor.screen_z == nil
  1214.       end
  1215.   end  
  1216.  
  1217.   #--------------------------------------------------------------------------
  1218.   # ● Sprite Visible
  1219.   #--------------------------------------------------------------------------    
  1220.   def sprite_visible
  1221.       return false if $game_message.visible
  1222.       return false if $game_temp.battle_end
  1223.       return true
  1224.   end  
  1225.  
  1226. end
  1227.  
  1228. #==============================================================================
  1229. # ** Game Interpreter
  1230. #==============================================================================
  1231. class Game_Interpreter
  1232.  
  1233.  #--------------------------------------------------------------------------
  1234.  # * Refresh Battle Hud
  1235.  #--------------------------------------------------------------------------
  1236.  def refresh_battle_hud
  1237.      $game_temp.check_screen_xyz_nil rescue nil
  1238.      $game_temp.mbhud_force_refresh = true
  1239.  end
  1240.  
  1241.  #--------------------------------------------------------------------------
  1242.  # * Battler Face Name
  1243.  #--------------------------------------------------------------------------
  1244.  def battler_face_name(actor_id,face_name = "")
  1245.      for actor in $game_party.members
  1246.          actor.battler_face_name = face_name if actor.id == actor_id
  1247.      end
  1248.      refresh_battle_hud
  1249.  end  
  1250.    
  1251.  #--------------------------------------------------------------------------
  1252.  # * Battler Hud Visible
  1253.  #--------------------------------------------------------------------------
  1254.  def battle_hud_visible(value)
  1255.      $game_temp.battle_hud_visible = value
  1256.  end
  1257.  
  1258.  #--------------------------------------------------------------------------
  1259.  # * Command_129
  1260.  #--------------------------------------------------------------------------
  1261.  alias mog_monogatari_bhud_command_129 command_129
  1262.  def command_129
  1263.      mog_monogatari_bhud_command_129    
  1264.      refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1265.  end
  1266.  
  1267. end
  1268.  
  1269. #==============================================================================
  1270. # ** Game Actor
  1271. #==============================================================================
  1272. class Game_Actor < Game_Battler
  1273.  
  1274.   attr_accessor :face_animation
  1275.   attr_accessor :battler_face_name
  1276.  
  1277.   #--------------------------------------------------------------------------
  1278.   # * Setup
  1279.   #--------------------------------------------------------------------------
  1280.   alias mog_monogatari_face_animation setup
  1281.   def setup(actor_id)
  1282.       mog_monogatari_face_animation(actor_id)
  1283.       @face_animation = [0,0,0]
  1284.       @battler_face_name = "Face_" + actor_id.to_s
  1285.   end    
  1286.  
  1287.   #--------------------------------------------------------------------------
  1288.   # ● Real Next Level
  1289.   #--------------------------------------------------------------------------  
  1290.   def real_next_level
  1291.       next_level_exp - exp_for_level(level)
  1292.   end
  1293.  
  1294.   #--------------------------------------------------------------------------
  1295.   # ● Remain Exp
  1296.   #--------------------------------------------------------------------------  
  1297.   def remain_exp
  1298.       exp - exp_for_level(level)
  1299.   end
  1300.  
  1301.   #--------------------------------------------------------------------------
  1302.   # ● Gain Exp Test
  1303.   #--------------------------------------------------------------------------
  1304.   def gain_exp_test
  1305.       exp_r = rand(next_level_exp)
  1306.       change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1307.   end    
  1308.  
  1309.   #--------------------------------------------------------------------------
  1310.   # ● Low HP?
  1311.   #--------------------------------------------------------------------------    
  1312.   def low_hp?
  1313.       hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1314.   end
  1315.  
  1316.   #--------------------------------------------------------------------------
  1317.   # ● Low MP?
  1318.   #--------------------------------------------------------------------------    
  1319.   def low_mp?
  1320.       mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1321.   end  
  1322.  
  1323.   #--------------------------------------------------------------------------
  1324.   # ● Low TP?
  1325.   #--------------------------------------------------------------------------    
  1326.   def low_tp?
  1327.       tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1328.   end  
  1329.    
  1330. end
  1331.  
  1332. #==============================================================================
  1333. # ** Game Party
  1334. #==============================================================================
  1335. class Game_Party < Game_Unit
  1336.  
  1337.   #--------------------------------------------------------------------------
  1338.   # * Get Maximum Number of Battle Members
  1339.   #--------------------------------------------------------------------------
  1340.   def max_battle_members
  1341.       return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
  1342.   end
  1343.    
  1344.  #--------------------------------------------------------------------------
  1345.  # * Swap Order
  1346.  #--------------------------------------------------------------------------
  1347.  alias mog_bhex_swap_order swap_order
  1348.  def swap_order(index1, index2)
  1349.      mog_bhex_swap_order(index1, index2)
  1350.      if SceneManager.scene_is?(Scene_Battle)  
  1351.      $game_temp.check_screen_xyz_nil rescue nil
  1352.      $game_temp.mbhud_force_refresh = true    
  1353.      end
  1354.  end  
  1355.  
  1356. end
  1357.  
  1358. #==============================================================================
  1359. # ** BattleManager
  1360. #==============================================================================
  1361. module BattleManager
  1362.  
  1363.  #--------------------------------------------------------------------------
  1364.  # * Current Index
  1365.  #--------------------------------------------------------------------------  
  1366.  def self.current_index
  1367.      if $imported[:mog_atb_system]
  1368.         return actor.index if actor
  1369.      end  
  1370.      return 0 if @actor_index == nil
  1371.      return @actor_index != -1 ? @actor_index : 0
  1372.  end
  1373.  
  1374.  #--------------------------------------------------------------------------
  1375.  # * Current Index Real
  1376.  #--------------------------------------------------------------------------  
  1377.  def self.current_index_real
  1378.      return -1 if @actor_index == nil
  1379.      return @actor_index
  1380.  end
  1381.  
  1382.   #--------------------------------------------------------------------------
  1383.   # * Next Actor Avaliable
  1384.   #--------------------------------------------------------------------------
  1385.   def self.next_actor_avaliable?
  1386.       return false if @actor_index == nil
  1387.       next_index = @actor_index + 1
  1388.       return false if next_index >= $game_party.members.size
  1389.       return true
  1390.   end
  1391.  
  1392.   #--------------------------------------------------------------------------
  1393.   # * To Next Command Input
  1394.   #--------------------------------------------------------------------------
  1395.   def self.next_command_avaliable
  1396.     aindex = @actor_index
  1397.     begin      
  1398.       if !actor || !actor.next_command
  1399.         return false if actor == nil
  1400.         aindex += 1
  1401.         return false if aindex >= $game_party.members.size
  1402.       end
  1403.     end until actor.inputable?
  1404.     return true
  1405.   end  
  1406.  
  1407.   #--------------------------------------------------------------------------
  1408.   # * Can Enable Window?
  1409.   #--------------------------------------------------------------------------
  1410.   def self.can_enable_window?
  1411.       max_members = $game_party.members.size
  1412.       index_real = current_index_real + 1
  1413.       return false if index_real > max_members
  1414.       return false if in_turn?
  1415.       return false if $imported[:mog_battle_cursor]
  1416.       return true
  1417.   end
  1418.  
  1419. end
  1420.  
  1421. #==============================================================================
  1422. # ** SceneManager
  1423. #==============================================================================
  1424. module SceneManager
  1425.  
  1426.   #--------------------------------------------------------------------------
  1427.   # * Face Battler
  1428.   #--------------------------------------------------------------------------
  1429.   def self.face_battler?
  1430.       return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1431.       return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
  1432.       return false if $imported[:mog_sprite_actor]
  1433.       return false if $imported[:ve_animated_battle]
  1434.       return false if $imported[:ve_actor_battlers]
  1435.       return false if $imported["YES-BattleSymphony"]
  1436.       return false if $imported["YEA-VisualBattlers"]
  1437.       return false if $imported["Galv_Animated_Battlers"]
  1438.       return false if $imported['KRX-AnimatedBattlers']
  1439.       return false if $imported[:Theo_BasicFuntions]
  1440.       return false if $sv_camera != nil
  1441.       return false if BattleManager.true_surprise != nil rescue nil
  1442.       return false if $imported[:jet][:AnimatedBattlers] rescue nil      
  1443.       return true
  1444.   end
  1445.  
  1446. end
  1447.  
  1448. #==============================================================================
  1449. # ■ Sprite Picture
  1450. #==============================================================================
  1451. class Sprite_Picture < Sprite
  1452.  
  1453.   #--------------------------------------------------------------------------
  1454.   # * Initialize
  1455.   #--------------------------------------------------------------------------
  1456.   alias mog_battle_hud_initialize initialize
  1457.   def initialize(viewport, picture)
  1458.       mog_battle_hud_initialize(viewport, picture)
  1459.       self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
  1460.  
  1461.   end  
  1462.  
  1463.   #--------------------------------------------------------------------------
  1464.   # * Update Position
  1465.   #--------------------------------------------------------------------------
  1466.   alias mog_battle_hud_update_position update_position
  1467.   def update_position
  1468.       mog_battle_hud_update_position
  1469.       self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
  1470.   end
  1471.    
  1472. end
  1473.  
  1474. #==============================================================================
  1475. # ■ Sprite Base
  1476. #==============================================================================
  1477. class Sprite_Base < Sprite
  1478.  
  1479.   #--------------------------------------------------------------------------
  1480.   # * Initialize
  1481.   #--------------------------------------------------------------------------
  1482.   alias mog_bhud_ex_initialize initialize
  1483.   def initialize(viewport = nil)
  1484.       @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
  1485.       mog_bhud_ex_initialize(viewport)
  1486.   end  
  1487.  
  1488.   #--------------------------------------------------------------------------
  1489.   # * Animation Set Sprite
  1490.   #--------------------------------------------------------------------------
  1491.   alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
  1492.   def animation_set_sprites(frame)
  1493.       mog_battle_hud_ex_animation_set_sprites(frame)
  1494.       update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
  1495.   end  
  1496.    
  1497.   #--------------------------------------------------------------------------
  1498.   # * Update Sprite Z Animation
  1499.   #--------------------------------------------------------------------------
  1500.   def update_sprite_z_animation  
  1501.       if $imported[:mog_battle_camera]
  1502.          @ani_sprites.each_with_index do |sprite, i|
  1503.          sprite.z = @ani_x + i end      
  1504.       else
  1505.          @ani_sprites.each_with_index do |sprite, i|
  1506.          sprite.viewport = nil ; sprite.z = @ani_x + i end
  1507.       end  
  1508.   end  
  1509.  
  1510. end
  1511.  
  1512. #==============================================================================
  1513. # ** Spriteset Battle
  1514. #==============================================================================
  1515. class Spriteset_Battle  
  1516.  
  1517.   #--------------------------------------------------------------------------
  1518.   # * Create Actors
  1519.   #--------------------------------------------------------------------------
  1520.   alias mog_battle_hud_create_actors create_actors
  1521.   def create_actors
  1522.       if can_create_max_members?
  1523.          @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  1524.          return
  1525.       end
  1526.       mog_battle_hud_create_actors
  1527.   end
  1528.  
  1529.   #--------------------------------------------------------------------------
  1530.   # * Can Create Max Members
  1531.   #--------------------------------------------------------------------------
  1532.   def can_create_max_members?
  1533.       return false if $imported[:ve_animated_battle]
  1534.       return false if $imported[:ve_actor_battlers]
  1535.       return false if $sv_camera != nil
  1536.       return true
  1537.   end
  1538.  
  1539. end
  1540.  
  1541. #==============================================================================
  1542. # ■ Scene Battle
  1543. #==============================================================================
  1544. class Scene_Battle < Scene_Base
  1545.  
  1546.  #--------------------------------------------------------------------------
  1547.  # ● Clear All Windows
  1548.  #--------------------------------------------------------------------------
  1549.   alias mog_battle_hud_ex_start start
  1550.   def start
  1551.       setup_battle_hud_ex
  1552.       mog_battle_hud_ex_start
  1553.   end
  1554.  
  1555.  #--------------------------------------------------------------------------
  1556.  # ● Setup Battle Hud EX
  1557.  #--------------------------------------------------------------------------
  1558.  def setup_battle_hud_ex
  1559.      @force_clear_duration = 0
  1560.  end
  1561.  
  1562.  #--------------------------------------------------------------------------
  1563.  # ● Clear All Windows
  1564.  #--------------------------------------------------------------------------
  1565.  def clear_all_windows
  1566.      if @actor_window != nil
  1567.         @actor_window.visible = false
  1568.         @actor_window.active = false
  1569.      end  
  1570.      if @status_window != nil
  1571.         @status_window.visible = false
  1572.         @status_window.active = false
  1573.      end  
  1574.      if @actor_command_window != nil
  1575.         @actor_command_window.visible = false
  1576.         @actor_command_window.active = false
  1577.      end
  1578.      if @party_command_window != nil
  1579.         @party_command_window.visible = false
  1580.         @party_command_window.active = false
  1581.      end
  1582.      if @help_window != nil
  1583.         @help_window.visible = false
  1584.      end  
  1585.  end    
  1586.  
  1587.  #--------------------------------------------------------------------------
  1588.  # ● Update
  1589.  #--------------------------------------------------------------------------
  1590.   alias mog_battle_hud_ex_update_main update
  1591.   def update
  1592.       mog_battle_hud_ex_update_main
  1593.       update_battle_hud_ex
  1594.   end
  1595.  
  1596.  #--------------------------------------------------------------------------
  1597.  # ● Update Battle Hud_ex
  1598.  #--------------------------------------------------------------------------
  1599.   def update_battle_hud_ex
  1600.       @status_window.visible = false
  1601.   end
  1602.  
  1603.   if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1604.   #--------------------------------------------------------------------------
  1605.   # * On Skill OK
  1606.   #--------------------------------------------------------------------------
  1607.   alias mog_battle_hud_ex_on_skill_ok on_skill_ok
  1608.   def on_skill_ok
  1609.       @skill = @skill_window.item
  1610.       @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  1611.       mog_battle_hud_ex_on_skill_ok
  1612.   end
  1613.    
  1614.   #--------------------------------------------------------------------------
  1615.   # * On Item OK
  1616.   #--------------------------------------------------------------------------
  1617.   alias mog_battle_hud_on_item_ok on_item_ok
  1618.   def on_item_ok
  1619.       @item = @item_window.item
  1620.       @item_window.hide if @item.for_opponent? or @item.for_friend?
  1621.       mog_battle_hud_on_item_ok
  1622.   end    
  1623.  
  1624.   #--------------------------------------------------------------------------
  1625.   # * On Enemy Cancel
  1626.   #--------------------------------------------------------------------------
  1627.   alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
  1628.   def on_enemy_cancel
  1629.       mog_battle_hud_ex_on_enemy_cancel
  1630.       @skill_window.show if @skill_window.active
  1631.       @item_window.show if @item_window.active      
  1632.   end
  1633.  
  1634.   #--------------------------------------------------------------------------
  1635.   # * On Actor Cancel
  1636.   #--------------------------------------------------------------------------
  1637.   alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
  1638.   def on_actor_cancel
  1639.       mog_battle_hud_ex_on_actor_cancel
  1640.       @skill_window.show if @skill_window.active
  1641.       @item_window.show if @item_window.active
  1642.       mog_battle_hud_ex_on_actor_cancel
  1643.   end  
  1644.   end
  1645.  
  1646. end
  1647.  
  1648. if SceneManager.face_battler?
  1649. #==============================================================================
  1650. # ■ Game_Actor
  1651. #==============================================================================
  1652. class Game_Actor < Game_Battler
  1653.  
  1654.   attr_accessor :screen_x
  1655.   attr_accessor :screen_y
  1656.   attr_accessor :screen_z
  1657.  
  1658.  
  1659.  #--------------------------------------------------------------------------
  1660.  # ● Use Sprite?
  1661.  #--------------------------------------------------------------------------
  1662.   def use_sprite?
  1663.       return true
  1664.   end
  1665.  
  1666. end
  1667.  
  1668. #==============================================================================
  1669. # ■ Sprite_Battler
  1670. #==============================================================================
  1671. class Sprite_Battler < Sprite_Base
  1672.   include MOG_BATTLE_HUD_EX
  1673.  
  1674.   #--------------------------------------------------------------------------
  1675.   # ● Update Collapse
  1676.   #--------------------------------------------------------------------------                          
  1677.    alias mog_battle_hud_update_collapse update_collapse
  1678.    def update_collapse
  1679.        return if face_can_cancel_method?
  1680.        mog_battle_hud_update_collapse
  1681.    end  
  1682.    
  1683.   #--------------------------------------------------------------------------
  1684.   # ● Update Instant Collapse
  1685.   #--------------------------------------------------------------------------                            
  1686.    alias mog_battle_hud_update_instant_collapse update_instant_collapse
  1687.    def update_instant_collapse
  1688.        return if face_can_cancel_method?
  1689.        mog_battle_hud_update_instant_collapse
  1690.    end  
  1691.    
  1692.   #--------------------------------------------------------------------------
  1693.   # ● Face Can Cancel Method
  1694.   #--------------------------------------------------------------------------                                  
  1695.   def face_can_cancel_method?
  1696.       return false if !SceneManager.face_battler?
  1697.       return false if @battler.is_a?(Game_Enemy)
  1698.       self.opacity = 255 ; self.visible = true
  1699.       return true
  1700.   end  
  1701.    
  1702.   #--------------------------------------------------------------------------
  1703.   # ● Update Bitmap
  1704.   #--------------------------------------------------------------------------                                  
  1705.   alias mog_battle_hud_ex_update_bitmap update_bitmap
  1706.   def update_bitmap
  1707.       return if face_can_cancel_method?
  1708.       mog_battle_hud_ex_update_bitmap
  1709.   end  
  1710.  
  1711.   #--------------------------------------------------------------------------
  1712.   # ● Update Position
  1713.   #--------------------------------------------------------------------------                                  
  1714.   alias mog_battle_hud_ex_update_position update_position
  1715.   def update_position
  1716.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  1717.          if !face_sprite_visible? or $game_temp.battle_end
  1718.              self.y = -1000
  1719.              return
  1720.          end
  1721.       end  
  1722.       mog_battle_hud_ex_update_position
  1723.   end  
  1724.    
  1725.   #--------------------------------------------------------------------------
  1726.   # * Sprite Visible
  1727.   #--------------------------------------------------------------------------
  1728.   def face_sprite_visible?
  1729.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  1730.       return false if !$game_temp.battle_hud_visible
  1731.       return true
  1732.   end  
  1733.  
  1734. end
  1735.  
  1736. end
  1737.  
  1738. #==============================================================================
  1739. # ** Window_BattleStatus
  1740. #==============================================================================
  1741. class Window_BattleStatus < Window_Selectable
  1742.  include MOG_BATTLE_HUD_EX
  1743.  
  1744.   #--------------------------------------------------------------------------
  1745.   # * Get Window Width
  1746.   #--------------------------------------------------------------------------
  1747.   def window_width
  1748.       ACTOR_WINDOW_SIZE[0]
  1749.   end
  1750.  
  1751.  #--------------------------------------------------------------------------
  1752.  # * Refresh
  1753.  #--------------------------------------------------------------------------  
  1754.  alias mog_monogatari_refresh refresh
  1755.  def refresh
  1756.      mog_monogatari_refresh
  1757.      self.visible = false
  1758.      self.opacity = 0
  1759.      self.contents_opacity = 0
  1760.      self.y = 1200
  1761.  end  
  1762.  
  1763. end  
  1764.  
  1765. #==============================================================================
  1766. # ** Window Actor Command
  1767. #==============================================================================
  1768. class Window_ActorCommand < Window_Command
  1769.  
  1770.  #--------------------------------------------------------------------------
  1771.  # * Update
  1772.  #--------------------------------------------------------------------------  
  1773.   alias mog_hud_battle_hud_ex_turn_sprite_update update
  1774.   def update
  1775.       mog_hud_battle_hud_ex_turn_sprite_update
  1776.       $game_temp.command_visible = self.visible
  1777.   end
  1778.  
  1779. end
  1780.  
  1781. #==============================================================================
  1782. # ** Window_BattleActor
  1783. #==============================================================================
  1784. class Window_BattleActor < Window_BattleStatus
  1785.  
  1786.   #--------------------------------------------------------------------------
  1787.   # * Refresh
  1788.   #--------------------------------------------------------------------------
  1789.   alias mog_battle_hud_ex_actor_w_refresh refresh
  1790.   def refresh
  1791.       mog_battle_hud_ex_actor_w_refresh
  1792.       self.contents_opacity = 255
  1793.       self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1794.       self.visible = true
  1795.   end
  1796.  
  1797. end  
  1798.  
  1799. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1800.  
  1801. #==============================================================================
  1802. # ** Window BattleLog
  1803. #==============================================================================
  1804. class Window_BattleLog < Window_Selectable
  1805.  
  1806.   include MOG_BATTLE_HUD_EX
  1807.  
  1808.  #--------------------------------------------------------------------------
  1809.  # * Initialize
  1810.  #--------------------------------------------------------------------------    
  1811.   alias mog_battle_hud_ex_log_initialize initialize
  1812.   def initialize
  1813.       mog_battle_hud_ex_log_initialize
  1814.       self.x = BATTLE_LOG_POSITION[0]
  1815.       self.y = BATTLE_LOG_POSITION[1]
  1816.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1817.   end
  1818.  
  1819.  #--------------------------------------------------------------------------
  1820.  # * Create Back Sprite
  1821.  #--------------------------------------------------------------------------    
  1822.   alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
  1823.   def create_back_sprite
  1824.       self.x = BATTLE_LOG_POSITION[0]
  1825.       self.y = BATTLE_LOG_POSITION[1]
  1826.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1827.       mog_battle_hud_ex_log_create_back_sprite
  1828.   end
  1829.  
  1830. end  
  1831.  
  1832. #==============================================================================
  1833. # ** Window Actor Command
  1834. #==============================================================================
  1835. class Window_ActorCommand < Window_Command
  1836.  
  1837.   include MOG_BATTLE_HUD_EX
  1838.  
  1839.  #--------------------------------------------------------------------------
  1840.  # * Initialize
  1841.  #--------------------------------------------------------------------------    
  1842.  alias mog_monogatari_initialize initialize
  1843.  def initialize
  1844.      mog_monogatari_initialize
  1845.      create_layout if $imported[:mog_battle_command_ex] == nil
  1846.  end
  1847.  
  1848.  #--------------------------------------------------------------------------
  1849.  # * Dispose
  1850.  #--------------------------------------------------------------------------
  1851.  alias mog_monogatari_actor_command_dispose dispose
  1852.  def dispose
  1853.      mog_monogatari_actor_command_dispose
  1854.      dispose_layout
  1855.  end
  1856.  
  1857.  #--------------------------------------------------------------------------
  1858.  # * Create Layout
  1859.  #--------------------------------------------------------------------------  
  1860.  def create_layout
  1861.      return if @layout != nil
  1862.      return if !ACTOR_COMMAND_LAYOUT
  1863.      return if $game_temp.mbhud_window[0]
  1864.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1865.      $game_temp.mbhud_window[0] = true
  1866.      @layout = Sprite.new
  1867.      @layout.bitmap = Cache.battle_hud("Layout_Command")
  1868.      @layout.z = self.z - 1
  1869.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1870.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1871.      @layout.visible = false
  1872.  end
  1873.  
  1874.  #--------------------------------------------------------------------------
  1875.  # * Dispose Layout
  1876.  #--------------------------------------------------------------------------
  1877.  def dispose_layout
  1878.      return if @layout == nil
  1879.      @layout.dispose
  1880.      @layout = nil
  1881.  end
  1882.  
  1883.  #--------------------------------------------------------------------------
  1884.  # * Refresh Layout
  1885.  #--------------------------------------------------------------------------
  1886.  def refresh_layout
  1887.      return if @layout == nil
  1888.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1889.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1890.      @layout.visible = self.visible
  1891.      @layout.z = self.z - 1
  1892.  end
  1893.  
  1894.  #--------------------------------------------------------------------------
  1895.  # * Select
  1896.  #--------------------------------------------------------------------------  
  1897.  alias mog_monogatari_select_actor_command select
  1898.  def select(index)
  1899.      mog_monogatari_select_actor_command(index)
  1900.      set_command_position if $imported[:mog_battle_command_ex] == nil
  1901.  end    
  1902.  
  1903.  #--------------------------------------------------------------------------
  1904.  # * Set Command Position
  1905.  #--------------------------------------------------------------------------  
  1906.  def set_command_position
  1907.      self.viewport = nil
  1908.      self.opacity = ACTOR_COMMAND_OPACITY
  1909.      battler_index = BattleManager.current_index rescue nil
  1910.      battler_index = 0 if battler_index == nil    
  1911.      if @actor != nil and $game_temp.hud_pos[battler_index] != nil
  1912.         if FIXED_COMMAND_POSITION[battler_index] != nil
  1913.            self.x = FIXED_COMMAND_POSITION[battler_index][0]
  1914.            self.y = FIXED_COMMAND_POSITION[battler_index][1]              
  1915.         else  
  1916.            self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
  1917.            self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1918.            self.x = 0 if self.x < 0
  1919.            self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
  1920.         end  
  1921.      end      
  1922.      refresh_layout
  1923.  end  
  1924.  
  1925.  #--------------------------------------------------------------------------
  1926.  # * Refresh
  1927.  #--------------------------------------------------------------------------  
  1928.  alias mog_battle_hud_ex_refresh refresh
  1929.  def refresh
  1930.      mog_battle_hud_ex_refresh
  1931.      $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1932.  end
  1933.  
  1934.  #--------------------------------------------------------------------------
  1935.  # * Update
  1936.  #--------------------------------------------------------------------------  
  1937.  alias mog_monogatari_actor_commnand_update update
  1938.  def update    
  1939.      mog_monogatari_actor_commnand_update
  1940.      if $imported[:mog_battle_command_ex] == nil
  1941.      self.visible = self.active
  1942.      if !@layout.nil?
  1943.         refresh_layout if @layout.visible != self.visible
  1944.         @layout.visible = false if !$game_temp.sprite_visible
  1945.      end        
  1946.      self.visible = false if !$game_temp.sprite_visible    
  1947.      end
  1948. end
  1949.  
  1950. end
  1951.  
  1952. #==============================================================================
  1953. # ** Window_PartyCommand
  1954. #==============================================================================
  1955. class Window_PartyCommand < Window_Command
  1956.  
  1957.   include MOG_BATTLE_HUD_EX
  1958.  
  1959.  #--------------------------------------------------------------------------
  1960.  # * Initialize
  1961.  #--------------------------------------------------------------------------  
  1962.   alias mog_monogatari_party_initialize initialize
  1963.   def initialize
  1964.       mog_monogatari_party_initialize
  1965.     #  self.x = @org_position[0] ; self.y = @org_position[1]
  1966.     #  self.opacity = PARTY_COMMAND_OPACITY    
  1967.       create_layout
  1968.   end
  1969.  
  1970.  #--------------------------------------------------------------------------
  1971.  # * Dispose
  1972.  #--------------------------------------------------------------------------
  1973.  alias mog_monogatari_party_window_dispose dispose
  1974.  def dispose
  1975.      mog_monogatari_party_window_dispose
  1976.      dispose_layout
  1977.  end
  1978.  
  1979.  #--------------------------------------------------------------------------
  1980.  # * Create Layout
  1981.  #--------------------------------------------------------------------------  
  1982.  def create_layout
  1983.      return if @layout != nil
  1984.      return if !PARTY_COMMAND_LAYOUT
  1985.      return if $game_temp.mbhud_window[1]
  1986.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1987.      $game_temp.mbhud_window[1] = true
  1988.      @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1989.      @layout = Sprite.new
  1990.      @layout.bitmap = Cache.battle_hud("Layout_Party")
  1991.      @layout.z = self.z - 1
  1992.      refresh_layout
  1993.      @layout.visible = false
  1994.  end
  1995.  
  1996.  #--------------------------------------------------------------------------
  1997.  # * Dispose Layout
  1998.  #--------------------------------------------------------------------------
  1999.  def dispose_layout
  2000.      return if @layout == nil
  2001.      @layout.dispose
  2002.      @layout = nil
  2003.  end
  2004.  
  2005.  #--------------------------------------------------------------------------
  2006.  # * Refresh Layout
  2007.  #--------------------------------------------------------------------------
  2008.  def refresh_layout
  2009.      return if @layout == nil
  2010.      @layout.x = @org_position_2[0]
  2011.      @layout.y = @org_position_2[1]
  2012.      @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  2013.      @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  2014.      @layout.visible = self.visible
  2015.  end        
  2016.  
  2017.  #--------------------------------------------------------------------------
  2018.  # * Select
  2019.  #--------------------------------------------------------------------------  
  2020.  alias mog_monogatari_refresh_partycommand refresh
  2021.  def refresh
  2022.      if @org_position == nil
  2023.       @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  2024.                        PARTY_COMMAND_POSITION[1] - (self.height / 2)]  
  2025.      end                  
  2026.      mog_monogatari_refresh_partycommand
  2027.      
  2028.       self.viewport = nil      
  2029.       self.x = @org_position[0] ; self.y = @org_position[1]
  2030.       if PARTY_COMMAND_SLIDE_EFFECT
  2031.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2032.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2033.  
  2034.       end
  2035.       self.opacity = PARTY_COMMAND_OPACITY    
  2036.  end    
  2037.  
  2038.  def show
  2039.    
  2040.  end
  2041.  
  2042.  #--------------------------------------------------------------------------
  2043.  # * Show
  2044.  #--------------------------------------------------------------------------    
  2045.   alias mog_bg_ex_slide_show_party show
  2046.   def show
  2047.       self.viewport = nil
  2048.       self.x = @org_position[0] ; self.y = @org_position[1]
  2049.       if PARTY_COMMAND_SLIDE_EFFECT
  2050.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2051.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2052.  
  2053.       end
  2054.       self.opacity = PARTY_COMMAND_OPACITY
  2055.       mog_bg_ex_slide_show_party
  2056.   end
  2057.  
  2058.  #--------------------------------------------------------------------------
  2059.  # * Update
  2060.  #--------------------------------------------------------------------------  
  2061.  alias mog_monogatari_party_window_update update
  2062.  def update
  2063.      mog_monogatari_party_window_update  
  2064.      self.visible = self.active
  2065.      if @layout != nil and @layout.visible != self.visible        
  2066.         refresh_layout
  2067.      end
  2068.      execute_slide_effect if self.visible
  2069.  end  
  2070.  
  2071. end
  2072.  
  2073. #==============================================================================
  2074. # ** Window_Help
  2075. #==============================================================================
  2076. class Window_Help < Window_Base
  2077.  
  2078.   include MOG_BATTLE_HUD_EX
  2079.  
  2080.   #--------------------------------------------------------------------------
  2081.   # * Object Initialization
  2082.   #--------------------------------------------------------------------------
  2083.   alias mog_monogatari_battle_help_initialize initialize
  2084.   def initialize(line_number = 2)
  2085.       @battle_phase = false
  2086.       mog_monogatari_battle_help_initialize(line_number)
  2087.       @wait_time = 5
  2088.       if SceneManager.scene_is?(Scene_Battle)
  2089.          @battle_phase = true        
  2090.          self.width = HELP_WINDOW_SIZE[0]
  2091.          self.height = HELP_WINDOW_SIZE[1]      
  2092.          @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2093.                           HELP_WINDOW_POSITION[1]]        
  2094.          self.x = @org_position[0]
  2095.          self.y = @org_position[1]  
  2096.          self.opacity = HELP_WINDOW_OPACITY
  2097.          self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2098.          create_layout
  2099.       end    
  2100.  end
  2101.  
  2102.  #--------------------------------------------------------------------------
  2103.  # * Dispose
  2104.  #--------------------------------------------------------------------------
  2105.  alias mog_monogatari_help_window_dispose dispose
  2106.  def dispose
  2107.      mog_monogatari_help_window_dispose
  2108.      dispose_layout
  2109.  end
  2110.  
  2111.  #--------------------------------------------------------------------------
  2112.  # * Create Layout
  2113.  #--------------------------------------------------------------------------  
  2114.  def create_layout
  2115.      return if @layout != nil
  2116.      return if !HELP_WINDOW_LAYOUT
  2117.      return if $game_temp.mbhud_window[2]
  2118.      return if !SceneManager.scene_is?(Scene_Battle)
  2119.      $game_temp.mbhud_window[2] = true
  2120.      @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2121.      @layout = Sprite.new
  2122.      @layout.bitmap = Cache.battle_hud("Layout_Help")
  2123.      @layout.z = self.z - 1
  2124.      refresh_layout
  2125.      @layout.visible = false
  2126.  end
  2127.  
  2128.  #--------------------------------------------------------------------------
  2129.  # * Dispose Layout
  2130.  #--------------------------------------------------------------------------
  2131.  def dispose_layout
  2132.      return if @layout == nil
  2133.      @layout.dispose
  2134.      @layout = nil
  2135.  end
  2136.  
  2137.  #--------------------------------------------------------------------------
  2138.  # * Refresh Layout
  2139.  #--------------------------------------------------------------------------
  2140.  def refresh_layout
  2141.      return if @layout == nil
  2142.      @layout.x = @org_position_2[0]
  2143.      @layout.y = @org_position_2[1]
  2144.      @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2145.      @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2146.      @layout.visible = self.visible  
  2147.  end    
  2148.  
  2149.  #--------------------------------------------------------------------------
  2150.  # * Show
  2151.  #--------------------------------------------------------------------------    
  2152.   alias mog_bg_ex_slide_show_help show
  2153.   def show
  2154.       if @battle_phase
  2155.       self.viewport = nil
  2156.       self.x = @org_position[0] ; self.y = @org_position[1]
  2157.       if HELP_WINDOW_SLIDE_EFFECT
  2158.          self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2159.          self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2160.       end
  2161.       self.opacity = HELP_WINDOW_OPACITY
  2162.       end
  2163.       mog_bg_ex_slide_show_help
  2164.   end  
  2165.  
  2166.  #--------------------------------------------------------------------------
  2167.  # * Update
  2168.  #--------------------------------------------------------------------------  
  2169.  alias mog_monogatari_help_window_update update
  2170.  def update
  2171.      if @wait_time > 0
  2172.         @wait_time -= 1
  2173.         return
  2174.      end  
  2175.      mog_monogatari_help_window_update
  2176.      if SceneManager.scene_is?(Scene_Battle)
  2177.         if @layout != nil          
  2178.            refresh_layout if @layout.visible != self.visible
  2179.            @layout.visible = self.visible
  2180.         end
  2181.         self.visible = false if !$game_temp.sprite_visible
  2182.         execute_slide_effect if self.visible        
  2183.      end
  2184.  end  
  2185.  
  2186. end
  2187.  
  2188. #==============================================================================
  2189. # ** Window_BattleActor
  2190. #==============================================================================
  2191. class Window_BattleActor < Window_BattleStatus
  2192.  
  2193.   include MOG_BATTLE_HUD_EX
  2194.  
  2195.   #--------------------------------------------------------------------------
  2196.   # * Initialize
  2197.   #--------------------------------------------------------------------------    
  2198.   alias mog_monogatari_battle_actor_initialize initialize
  2199.   def initialize(info_viewport)
  2200.       @force_hide = can_force_hide?
  2201.       mog_monogatari_battle_actor_initialize(info_viewport)
  2202.       self.width = ACTOR_WINDOW_SIZE[0]
  2203.       self.height = ACTOR_WINDOW_SIZE[1]
  2204.       @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2205.                        ACTOR_WINDOW_POSITION[1] - self.height]
  2206.       @org_position[1] = Graphics.height + 64 if @force_hide
  2207.       self.x = @org_position[0]
  2208.       self.y = @org_position[1]
  2209.       self.opacity = ACTOR_WINDOW_OPACITY
  2210.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2211.       self.viewport = nil
  2212.       create_layout
  2213.   end
  2214.  
  2215.   #--------------------------------------------------------------------------
  2216.   # * Can Force Hide?
  2217.   #--------------------------------------------------------------------------    
  2218.   def can_force_hide?
  2219.       return true if $imported[:ve_target_arrow]
  2220.       return true if $imported[:mog_battle_cursor]
  2221.       return false
  2222.   end
  2223.  
  2224.  #--------------------------------------------------------------------------
  2225.  # * Dispose
  2226.  #--------------------------------------------------------------------------
  2227.  alias mog_monogatari_actor_window_dispose dispose
  2228.  def dispose
  2229.      mog_monogatari_actor_window_dispose
  2230.      dispose_layout
  2231.  end
  2232.  
  2233.  #--------------------------------------------------------------------------
  2234.  # * Create Layout
  2235.  #--------------------------------------------------------------------------  
  2236.  def create_layout
  2237.      return if @layout != nil
  2238.      return if !ACTOR_WINDOW_LAYOUT
  2239.      return if $game_temp.mbhud_window[3]
  2240.      $game_temp.mbhud_window[3] = true
  2241.      @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2242.      @layout = Sprite.new
  2243.      @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2244.      @layout.z = self.z - 1
  2245.      refresh_layout
  2246.      @layout.visible = false
  2247.  end
  2248.  
  2249.  #--------------------------------------------------------------------------
  2250.  # * Dispose Layout
  2251.  #--------------------------------------------------------------------------
  2252.  def dispose_layout
  2253.      return if @layout == nil
  2254.      @layout.dispose
  2255.      @layout = nil
  2256.  end
  2257.  
  2258.  #--------------------------------------------------------------------------
  2259.  # * Refresh Layout
  2260.  #--------------------------------------------------------------------------
  2261.  def refresh_layout
  2262.      return if @layout == nil
  2263.      @layout.x = @org_position_2[0]
  2264.      @layout.y = @org_position_2[1]
  2265.      @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2266.      @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2267.      @layout.visible = self.visible
  2268.  end    
  2269.  
  2270.   if $imported[:ve_target_arrow]
  2271.   #--------------------------------------------------------------------------
  2272.   # * New method: show_actor
  2273.   #--------------------------------------------------------------------------
  2274.   alias mog_battle_hud_ex_show_actor show_actor
  2275.   def show_actor
  2276.       return true if SceneManager.face_battler?
  2277.       mog_battle_hud_ex_show_actor
  2278.   end
  2279.   end
  2280.  
  2281.  #--------------------------------------------------------------------------
  2282.  # * Show
  2283.  #--------------------------------------------------------------------------    
  2284.   alias mog_bg_ex_slide_show_actor show
  2285.   def show
  2286.       self.viewport = nil
  2287.       self.x = @org_position[0] ; self.y = @org_position[1]
  2288.       if ACTOR_WINDOW_SLIDE_EFFECT
  2289.          self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2290.          self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2291.       end
  2292.       self.opacity = ACTOR_WINDOW_OPACITY
  2293.       mog_bg_ex_slide_show_actor
  2294.   end  
  2295.  
  2296.  #--------------------------------------------------------------------------
  2297.  # * Update
  2298.  #--------------------------------------------------------------------------  
  2299.  alias mog_monogatari_actor_window_update update
  2300.  def update
  2301.      mog_monogatari_actor_window_update  
  2302.      self.visible = self.active
  2303.      self.visible = false if @force_hide
  2304.      if @layout != nil        
  2305.         refresh_layout if @layout.visible != self.visible        
  2306.      end
  2307.      if !$game_temp.sprite_visible  
  2308.         self.visible = false
  2309.         @layout.visible = self.visible if @layout != nil
  2310.      end  
  2311.      execute_slide_effect if self.visible
  2312.   end  
  2313.  
  2314. end
  2315.  
  2316. #==============================================================================
  2317. # ** Window_BattleEnemy
  2318. #==============================================================================
  2319. class Window_BattleEnemy < Window_Selectable
  2320.  
  2321.   include MOG_BATTLE_HUD_EX
  2322.  
  2323.   #--------------------------------------------------------------------------
  2324.   # * Initialize
  2325.   #--------------------------------------------------------------------------    
  2326.   alias mog_monogatari_battle_enemy_initialize initialize
  2327.   def initialize(info_viewport)
  2328.       @force_hide = can_force_hide?
  2329.       mog_monogatari_battle_enemy_initialize(info_viewport)
  2330.       self.width = ENEMY_WINDOW_SIZE[0]
  2331.       self.height = ENEMY_WINDOW_SIZE[1]      
  2332.       @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2333.                        ENEMY_WINDOW_POSITION[1] - self.height]
  2334.       @org_position[1] = Graphics.height + 64 if @force_hide              
  2335.       self.x = @org_position[0]
  2336.       self.y = @org_position[1]      
  2337.       self.opacity = ENEMY_WINDOW_OPACITY
  2338.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2339.       create_layout
  2340.   end  
  2341.  
  2342.   #--------------------------------------------------------------------------
  2343.   # * Can Force Hide?
  2344.   #--------------------------------------------------------------------------    
  2345.   def can_force_hide?
  2346.       return true if $imported[:ve_target_arrow]
  2347.       return true if $imported[:mog_battle_cursor]
  2348.       return false
  2349.   end    
  2350.  
  2351.  #--------------------------------------------------------------------------
  2352.  # * Dispose
  2353.  #--------------------------------------------------------------------------
  2354.  alias mog_monogatari_enemy_window_dispose dispose
  2355.  def dispose
  2356.      mog_monogatari_enemy_window_dispose
  2357.      dispose_layout
  2358.  end
  2359.  
  2360.  #--------------------------------------------------------------------------
  2361.  # * Create Layout
  2362.  #--------------------------------------------------------------------------  
  2363.  def create_layout
  2364.      return if @layout != nil
  2365.      return if !ENEMY_WINDOW_LAYOUT
  2366.      return if $game_temp.mbhud_window[4]
  2367.      $game_temp.mbhud_window[4] = true    
  2368.      @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2369.      @layout = Sprite.new
  2370.      @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2371.      @layout.z = self.z - 1
  2372.      refresh_layout
  2373.      @layout.visible = false
  2374.  end
  2375.  
  2376.  #--------------------------------------------------------------------------
  2377.  # * Dispose Layout
  2378.  #--------------------------------------------------------------------------
  2379.  def dispose_layout
  2380.      return if @layout == nil
  2381.      @layout.dispose
  2382.      @layout = nil
  2383.  end
  2384.  
  2385.  #--------------------------------------------------------------------------
  2386.  # * Refresh Layout
  2387.  #--------------------------------------------------------------------------
  2388.  def refresh_layout
  2389.      return if @layout == nil
  2390.      @layout.x = @org_position_2[0]
  2391.      @layout.y = @org_position_2[1]
  2392.      @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2393.      @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2394.      @layout.visible = self.visible
  2395.  end      
  2396.  
  2397.  #--------------------------------------------------------------------------
  2398.  # * Show
  2399.  #--------------------------------------------------------------------------    
  2400.   alias mog_bg_ex_slide_show_enemy show
  2401.   def show
  2402.       self.viewport = nil
  2403.       self.x = @org_position[0] ; self.y = @org_position[1]
  2404.       if ENEMY_WINDOW_SLIDE_EFFECT
  2405.          self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2406.          self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2407.       end
  2408.       self.opacity = ENEMY_WINDOW_OPACITY
  2409.       mog_bg_ex_slide_show_enemy
  2410.   end  
  2411.  
  2412.  #--------------------------------------------------------------------------
  2413.  # * Update
  2414.  #--------------------------------------------------------------------------  
  2415.  alias mog_monogatari_enemy_window_update update
  2416.  def update
  2417.      mog_monogatari_enemy_window_update
  2418.      self.visible = false if @force_hide
  2419.      if @layout != nil and @layout.visible != self.visible        
  2420.         refresh_layout
  2421.      end
  2422.      if !$game_temp.sprite_visible  
  2423.         self.visible = false
  2424.         @layout.visible = self.visible if @layout != nil
  2425.      end  
  2426.      execute_slide_effect if self.visible
  2427.   end  
  2428.  
  2429.   if $imported["YEA-BattleEngine"]
  2430.   #--------------------------------------------------------------------------
  2431.   # * Draw Item
  2432.   #--------------------------------------------------------------------------
  2433.   def draw_item(index)
  2434.       change_color(normal_color)
  2435.       name = $game_troop.alive_members[index].name
  2436.       draw_text(item_rect_for_text(index), name)
  2437.   end
  2438.   end
  2439.  
  2440.   #--------------------------------------------------------------------------
  2441.   # * Process Cursor Move
  2442.   #--------------------------------------------------------------------------
  2443.   alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2444.   def process_cursor_move
  2445.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2446.       mog_atb_wenemy_process_cursor_move
  2447.   end
  2448.  
  2449.   #--------------------------------------------------------------------------
  2450.   # * Process Handling
  2451.   #--------------------------------------------------------------------------
  2452.   alias mog_atb_wenemy_process_handling process_handling
  2453.   def process_handling  
  2454.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2455.       mog_atb_wenemy_process_handling
  2456.   end  
  2457.  
  2458. end
  2459.  
  2460. #==============================================================================
  2461. # ** Window_BattleSkill
  2462. #==============================================================================
  2463. class Window_BattleSkill < Window_SkillList
  2464.  include MOG_BATTLE_HUD_EX
  2465.  
  2466.  #--------------------------------------------------------------------------
  2467.  # * Initialize
  2468.  #--------------------------------------------------------------------------  
  2469.  alias mog_monogatari_battle_skill_initialize initialize
  2470.  def initialize(help_window, info_viewport)
  2471.      @force_hide = can_force_hide?
  2472.      @force_hide_active = can_force_hide_active?    
  2473.      mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2474.      self.width = SKILL_WINDOW_SIZE[0]
  2475.      self.height = SKILL_WINDOW_SIZE[1]    
  2476.      @org_position = [SKILL_WINDOW_POSITION[0],
  2477.           Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2478.      self.x = @org_position[0]
  2479.      self.y = @org_position[1]
  2480.      self.opacity = SKILL_WINDOW_OPACITY
  2481.      self.viewport = nil
  2482.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2483.      create_layout
  2484.  end
  2485.  
  2486.  #--------------------------------------------------------------------------
  2487.  # * Col Max
  2488.  #--------------------------------------------------------------------------    
  2489.   def col_max
  2490.       return SKILL_COL_MAX
  2491.   end
  2492.  
  2493.  #--------------------------------------------------------------------------
  2494.  # * Can Force Hide Active?
  2495.  #--------------------------------------------------------------------------    
  2496.  def can_force_hide_active?
  2497.      return true if $imported[:ve_target_arrow]
  2498.      return true if $imported[:mog_battle_cursor] != nil
  2499.      return false
  2500.  end  
  2501.  
  2502.   #--------------------------------------------------------------------------
  2503.   # * Can Force Hide?
  2504.   #--------------------------------------------------------------------------    
  2505.   def can_force_hide?
  2506.       return false
  2507.   end
  2508.  
  2509.  #--------------------------------------------------------------------------
  2510.  # * Dispose
  2511.  #--------------------------------------------------------------------------
  2512.  alias mog_monogatari_skill_window_dispose dispose
  2513.  def dispose
  2514.      mog_monogatari_skill_window_dispose
  2515.      dispose_layout
  2516.  end
  2517.  
  2518.  #--------------------------------------------------------------------------
  2519.  # * Create Layout
  2520.  #--------------------------------------------------------------------------  
  2521.  def create_layout
  2522.      return if @layout != nil
  2523.      return if !SKILL_WINDOW_LAYOUT
  2524.      return if $game_temp.mbhud_window[5]
  2525.      $game_temp.mbhud_window[5] = true
  2526.      @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2527.      @layout = Sprite.new
  2528.      @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2529.      @layout.z = self.z - 1
  2530.      refresh_layout
  2531.      @layout.visible = false
  2532.  end
  2533.  
  2534.  #--------------------------------------------------------------------------
  2535.  # * Dispose Layout
  2536.  #--------------------------------------------------------------------------
  2537.  def dispose_layout
  2538.      return if @layout == nil
  2539.      @layout.dispose
  2540.      @layout = nil
  2541.  end
  2542.  
  2543.  #--------------------------------------------------------------------------
  2544.  # * Refresh Layout
  2545.  #--------------------------------------------------------------------------
  2546.  def refresh_layout
  2547.      return if @layout == nil
  2548.      @layout.x = @org_position_2[0]
  2549.      @layout.y = @org_position_2[1]
  2550.      @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2551.      @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2552.      @layout.visible = self.visible
  2553.  end  
  2554.  
  2555.  #--------------------------------------------------------------------------
  2556.  # * Update
  2557.  #--------------------------------------------------------------------------  
  2558.  alias mog_monogatari_skill_window_update update
  2559.  def update
  2560.      mog_monogatari_skill_window_update
  2561.      self.visible = self.active if @force_hide_active
  2562.      self.visible = false if @force_hide
  2563.      if @layout != nil and @layout.visible != self.visible        
  2564.         refresh_layout
  2565.     end
  2566.     self.visible = false if !$game_temp.sprite_visible
  2567.     execute_slide_effect if self.visible
  2568.  end
  2569.  
  2570. end
  2571.  
  2572. #==============================================================================
  2573. # ** Window_BattleItem
  2574. #==============================================================================
  2575. class Window_BattleItem < Window_ItemList
  2576.   include MOG_BATTLE_HUD_EX
  2577.  
  2578.  #--------------------------------------------------------------------------
  2579.  # * Initialize
  2580.  #--------------------------------------------------------------------------  
  2581.  alias mog_monogatari_battle_item_initialize initialize
  2582.  def initialize(help_window, info_viewport)
  2583.      @force_hide = can_force_hide?
  2584.      @force_hide_active = can_force_hide_active?
  2585.      mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2586.      self.width = ITEM_WINDOW_SIZE[0]
  2587.      self.height = ITEM_WINDOW_SIZE[1]
  2588.      @org_position = [ITEM_WINDOW_POSITION[0],
  2589.           Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2590.      self.x = @org_position[0]
  2591.      self.y = @org_position[1]
  2592.      self.viewport = nil
  2593.      self.opacity = ITEM_WINDOW_OPACITY
  2594.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2595.      create_layout
  2596.  end  
  2597.  
  2598.  #--------------------------------------------------------------------------
  2599.  # * Col Max
  2600.  #--------------------------------------------------------------------------    
  2601.   def col_max
  2602.       return ITEM_COL_MAX
  2603.   end  
  2604.  
  2605.  #--------------------------------------------------------------------------
  2606.  # * Can Force Hide Active?
  2607.  #--------------------------------------------------------------------------    
  2608.  def can_force_hide_active?
  2609.      return true if $imported[:ve_target_arrow]
  2610.      return true if $imported[:mog_battle_cursor] != nil
  2611.      return false
  2612.  end  
  2613.  
  2614.  #--------------------------------------------------------------------------
  2615.  # * Can Force Hide?
  2616.  #--------------------------------------------------------------------------    
  2617.  def can_force_hide?
  2618.      return false
  2619.  end
  2620.  
  2621.  #--------------------------------------------------------------------------
  2622.  # * Dispose
  2623.  #--------------------------------------------------------------------------
  2624.  alias mog_monogatari_item_window_dispose dispose
  2625.  def dispose
  2626.      mog_monogatari_item_window_dispose
  2627.      dispose_layout
  2628.  end
  2629.  
  2630.  #--------------------------------------------------------------------------
  2631.  # * Create Layout
  2632.  #--------------------------------------------------------------------------  
  2633.  def create_layout
  2634.      return if @layout != nil
  2635.      return if !ITEM_WINDOW_LAYOUT
  2636.      return if $game_temp.mbhud_window[6]
  2637.      $game_temp.mbhud_window[6] = true
  2638.      @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2639.      @layout = Sprite.new
  2640.      @layout.bitmap = Cache.battle_hud("Layout_Item")
  2641.      @layout.z = self.z - 1
  2642.      refresh_layout
  2643.      @layout.visible = false
  2644.  end
  2645.  
  2646.  #--------------------------------------------------------------------------
  2647.  # * Dispose Layout
  2648.  #--------------------------------------------------------------------------
  2649.  def dispose_layout
  2650.      return if @layout == nil
  2651.      @layout.dispose
  2652.      @layout = nil
  2653.  end
  2654.  
  2655.  #--------------------------------------------------------------------------
  2656.  # * Refresh Layout
  2657.  #--------------------------------------------------------------------------
  2658.  def refresh_layout
  2659.      return if @layout == nil
  2660.      @layout.x = @org_position_2[0]
  2661.      @layout.y = @org_position_2[1]
  2662.      @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2663.      @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2664.      @layout.visible = self.visible
  2665.  end  
  2666.  
  2667.  #--------------------------------------------------------------------------
  2668.  # * Show
  2669.  #--------------------------------------------------------------------------    
  2670.   alias mog_bg_ex_slide_show_item show
  2671.   def show
  2672.       self.viewport = nil
  2673.       self.x = @org_position[0] ; self.y = @org_position[1]
  2674.       if ITEM_WINDOW_SLIDE_EFFECT
  2675.          self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2676.          self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2677.       end
  2678.       self.opacity = ITEM_WINDOW_OPACITY
  2679.       mog_bg_ex_slide_show_item      
  2680.   end
  2681.  
  2682.  #--------------------------------------------------------------------------
  2683.  # * Update
  2684.  #--------------------------------------------------------------------------  
  2685.  alias mog_monogatari_item_window_update update
  2686.  def update
  2687.      mog_monogatari_item_window_update
  2688.      self.visible = self.active if @force_hide_active
  2689.      self.visible = false if @force_hide
  2690.      if @layout != nil
  2691.         refresh_layout if @layout.visible != self.visible
  2692.      end
  2693.      self.visible = false if !$game_temp.sprite_visible
  2694.      execute_slide_effect if self.visible
  2695.   end  
  2696.  
  2697. end
  2698.  
  2699. end
  2700.  
  2701. #--------------------------------------------------------------------------
  2702. #--------------------------------------------------------------------------
  2703. #################################
  2704. if $imported["YEA-BattleEngine"]
  2705. #################################
  2706.  
  2707. #==============================================================================
  2708. # ** Window_BattleStatusAid
  2709. #==============================================================================
  2710. class Window_BattleStatusAid < Window_BattleStatus
  2711.  
  2712.  #--------------------------------------------------------------------------
  2713.  # * Refresh
  2714.  #--------------------------------------------------------------------------  
  2715.   def refresh
  2716.       contents.clear
  2717.       self.visible = false
  2718.   end
  2719.    
  2720. end
  2721.  
  2722. #==============================================================================
  2723. # ** Window_BattleStatus
  2724. #==============================================================================
  2725. class Window_BattleStatus < Window_Selectable
  2726.  
  2727.  #--------------------------------------------------------------------------
  2728.  # * Update
  2729.  #--------------------------------------------------------------------------
  2730.  alias mog_monogatari_bhud_yf_update update
  2731.  def update
  2732.      mog_monogatari_bhud_yf_update
  2733.      update_visible_yf
  2734.  end
  2735.  
  2736.  #--------------------------------------------------------------------------
  2737.  # * Update Visible Yf
  2738.  #--------------------------------------------------------------------------
  2739.  def update_visible_yf
  2740.      self.visible = self.active
  2741.      self.visible = false if !$game_temp.sprite_visible
  2742.  end
  2743.  
  2744. end  
  2745.  
  2746. #==============================================================================
  2747. # ■ Window ActorCommand
  2748. #==============================================================================
  2749. class Window_ActorCommand < Window_Command
  2750.  
  2751.  #--------------------------------------------------------------------------
  2752.  # * Show
  2753.  #--------------------------------------------------------------------------
  2754.   alias mog_bhud_yf_command_show show
  2755.   def show
  2756.       return if !BattleManager.can_enable_window?
  2757.       mog_bhud_yf_command_show
  2758.   end
  2759.  
  2760.  #--------------------------------------------------------------------------
  2761.  # * Update
  2762.  #--------------------------------------------------------------------------
  2763.  alias mog_monogatari_bhud_yf_actorcommand_update update
  2764.  def update
  2765.      mog_monogatari_bhud_yf_actorcommand_update
  2766.      update_visible_yf
  2767.  end
  2768.  
  2769.  #--------------------------------------------------------------------------
  2770.  # * Update Visible Yf
  2771.  #--------------------------------------------------------------------------
  2772.  def update_visible_yf
  2773.      self.visible = self.active
  2774.      self.visible = false if !$game_temp.sprite_visible
  2775.  end
  2776.  
  2777. end
  2778.  
  2779. #==============================================================================
  2780. # ** Scene Battle
  2781. #==============================================================================
  2782. class Scene_Battle < Scene_Base
  2783.  
  2784.   include MOG_BATTLE_HUD_EX
  2785.  
  2786.   #--------------------------------------------------------------------------
  2787.   # alias method: create_skill_window
  2788.   #--------------------------------------------------------------------------
  2789.   alias mog_yf_scene_battle_create_skill_window create_skill_window
  2790.   def create_skill_window
  2791.       mog_yf_scene_battle_create_skill_window
  2792.       @skill_window.width = SKILL_WINDOW_SIZE[0]
  2793.       @skill_window.height = SKILL_WINDOW_SIZE[1]
  2794.       @skill_window.x = SKILL_WINDOW_POSITION[0]
  2795.       @skill_window.y = SKILL_WINDOW_POSITION[1]
  2796.   end
  2797.  
  2798.   #--------------------------------------------------------------------------
  2799.   # alias method: create_item_window
  2800.   #--------------------------------------------------------------------------
  2801.   alias mog_yf_scene_battle_create_item_window create_item_window
  2802.   def create_item_window
  2803.       mog_yf_scene_battle_create_item_window
  2804.       @item_window.width = ITEM_WINDOW_SIZE[0]
  2805.       @item_window.height = ITEM_WINDOW_SIZE[1]
  2806.       @item_window.x = ITEM_WINDOW_POSITION[0]
  2807.       @item_window.y = ITEM_WINDOW_POSITION[1]
  2808.   end  
  2809.  
  2810.  if !$imported[:mog_atb_system]
  2811.  #--------------------------------------------------------------------------
  2812.  # * Next Command
  2813.  #--------------------------------------------------------------------------
  2814.   def next_command
  2815.     if BattleManager.next_command
  2816.        @status_window.show
  2817.        redraw_current_status
  2818.        @actor_command_window.show
  2819.        @status_aid_window.hide      
  2820.        start_actor_command_selection
  2821.     else
  2822.       turn_start
  2823.     end
  2824.   end
  2825.   end
  2826.  
  2827.  #--------------------------------------------------------------------------
  2828.  # * STW Can Visible
  2829.  #--------------------------------------------------------------------------  
  2830.   def stw_can_visible?
  2831.       return false if !BattleManager.can_enable_window?
  2832.       return false if @item_window.visible
  2833.       return false if @skill_window.visible
  2834.       return true if @actor_window.active
  2835.       return false
  2836.   end
  2837.  
  2838.  if $imported["YEA-CommandEquip"]
  2839.  #--------------------------------------------------------------------------
  2840.  # * Command Equip
  2841.  #--------------------------------------------------------------------------  
  2842.   alias mog_yf_command_equip command_equip
  2843.   def command_equip
  2844.       @actor_command_window.visible = false
  2845.       @actor_command_window.update
  2846.       $game_temp.battle_hud_visible_refresh = [true,false]
  2847.       @spriteset.update_battle_hud_ex
  2848.       @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2849.       mog_yf_command_equip
  2850.       $game_temp.battle_hud_visible_refresh = [true,true]
  2851.   end
  2852.   end
  2853.  
  2854. end
  2855.  
  2856. end
  2857. #--------------------------------------------------------------------------
  2858.  
  2859.  
  2860. ######################################
  2861. if $imported["YEA-EnemyTargetInfo"]
  2862. ######################################
  2863.  
  2864. #==============================================================================
  2865. # ■ Window_Comparison
  2866. #==============================================================================
  2867. class Window_Comparison < Window_Base
  2868.  
  2869.   #--------------------------------------------------------------------------
  2870.   # * Refresh
  2871.   #--------------------------------------------------------------------------    
  2872.   alias mog_battle_hud_ex_yf_refresh refresh
  2873.   def refresh
  2874.       mog_battle_hud_ex_yf_refresh
  2875.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2876.       self.viewport = nil
  2877.   end
  2878.  
  2879. end
  2880.  
  2881. #==============================================================================
  2882. # ■ Window_ComparisonHelp
  2883. #==============================================================================
  2884. class Window_ComparisonHelp < Window_Base
  2885.  
  2886.   #--------------------------------------------------------------------------
  2887.   # * Refresh
  2888.   #--------------------------------------------------------------------------    
  2889.   alias mog_battle_hud_ex_yf_refresh refresh
  2890.   def refresh
  2891.       mog_battle_hud_ex_yf_refresh
  2892.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2893.       self.viewport = nil
  2894.   end
  2895.  
  2896. end
  2897. end
  2898. #--------------------------------------------------------------------------
  2899. #--------------------------------------------------------------------------
  2900.  
  2901.  
  2902. #################################
  2903. if $imported["YEA-EnemyTargetInfo"]
  2904. #################################
  2905. class Window_Comparison < Window_Base
  2906.  
  2907.   #--------------------------------------------------------------------------
  2908.   # initialize
  2909.   #--------------------------------------------------------------------------
  2910.   alias mog_battle_hud_yf_wcomparison_initialize initialize
  2911.   def initialize(type)
  2912.       mog_battle_hud_yf_wcomparison_initialize(type)
  2913.       self.z = 102
  2914.   end  
  2915.  
  2916. end
  2917. end
  2918. #--------------------------------------------------------------------------
  2919. #--------------------------------------------------------------------------
  2920.  
  2921. #--------------------------------------------------------------------------
  2922. #--------------------------------------------------------------------------
  2923. #################################
  2924. if $imported["YSA-CATB"]
  2925. #################################
  2926.  
  2927. #==============================================================================
  2928. # ■ Enemy CATB Gauge Viewport
  2929. #==============================================================================
  2930. class Enemy_CATB_Gauge_Viewport < Viewport
  2931.  
  2932.   #--------------------------------------------------------------------------
  2933.   # initialize
  2934.   #--------------------------------------------------------------------------
  2935.   alias mog_battle_hud_ex_yami_initialize initialize
  2936.   def initialize(battler, sprite, type)
  2937.       mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2938.       self.z = 90
  2939.   end
  2940.  
  2941. end
  2942.  
  2943. #==============================================================================
  2944. # ■ Game_Battler
  2945. #==============================================================================
  2946. class Game_Battler < Game_BattlerBase
  2947.  
  2948.   attr_accessor :catb_value  
  2949.   attr_accessor :max_atb
  2950.  
  2951.   #--------------------------------------------------------------------------
  2952.   # * Max ATB
  2953.   #--------------------------------------------------------------------------    
  2954.   def max_atb
  2955.       return MAX_CATB_VALUE
  2956.       return 1
  2957.   end
  2958.  
  2959. end
  2960.  
  2961. end
  2962. #--------------------------------------------------------------------------
  2963. #--------------------------------------------------------------------------
  2964.  
  2965. #==============================================================================
  2966. # ** Window Base
  2967. #==============================================================================
  2968. class Window_Base < Window
  2969.  
  2970.  #--------------------------------------------------------------------------
  2971.  # * Execute Move W
  2972.  #--------------------------------------------------------------------------      
  2973.  def execute_move_w(sprite,type,cp,np)
  2974.      sp = 6 + ((cp - np).abs / 10)
  2975.      if cp > np ;    cp -= sp ; cp = np if cp < np
  2976.         elsif cp < np ; cp += sp ; cp = np if cp > np
  2977.      end    
  2978.      sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2979.  end
  2980.    
  2981.  #--------------------------------------------------------------------------
  2982.  # * Set BH EX Font
  2983.  #--------------------------------------------------------------------------    
  2984.   def set_bh_ex_font
  2985.       return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2986.       self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2987.       self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2988.       self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2989.       self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2990.   end
  2991.  
  2992.  #--------------------------------------------------------------------------
  2993.  # * Execute Slide Effect
  2994.  #--------------------------------------------------------------------------    
  2995.  def execute_slide_effect
  2996.      return if @org_position == nil
  2997.      execute_move_w(self,0,self.x,@org_position[0])
  2998.      execute_move_w(self,1,self.y,@org_position[1])
  2999.      return if @layout == nil
  3000.      execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  3001.      execute_move_w(@layout,1,@layout.y,@org_position_2[1])    
  3002.  end    
  3003.  
  3004. end
  3005.  
  3006. #==============================================================================
  3007. # ** Window Help
  3008. #==============================================================================
  3009. class Window_Help < Window_Base
  3010.  
  3011.  #--------------------------------------------------------------------------
  3012.  # * Draw Text
  3013.  #--------------------------------------------------------------------------    
  3014.   alias mog_bh_ex_draw_text_help draw_text
  3015.   def draw_text(*args)
  3016.       set_bh_ex_font
  3017.       mog_bh_ex_draw_text_help(*args)
  3018.   end
  3019.  
  3020. end
  3021.  
  3022. #==============================================================================
  3023. # ** Window BattleActor
  3024. #==============================================================================
  3025. class Window_BattleActor < Window_BattleStatus
  3026.  
  3027.  #--------------------------------------------------------------------------
  3028.  # * Draw Item
  3029.  #--------------------------------------------------------------------------    
  3030.   alias mog_bbex_draw_item_actor draw_item
  3031.   def draw_item(index)
  3032.       set_bh_ex_font
  3033.       mog_bbex_draw_item_actor(index)
  3034.   end
  3035.  
  3036. end
  3037.  
  3038. #==============================================================================
  3039. # ** Window BattleEnemy
  3040. #==============================================================================
  3041. class Window_BattleEnemy < Window_Selectable
  3042.  
  3043.  #--------------------------------------------------------------------------
  3044.  # * Draw Item
  3045.  #--------------------------------------------------------------------------    
  3046.   alias mog_bbex_draw_item_enemy draw_item
  3047.   def draw_item(index)
  3048.       set_bh_ex_font
  3049.       mog_bbex_draw_item_enemy(index)
  3050.   end
  3051.  
  3052. end
  3053.  
  3054. #==============================================================================
  3055. # ** Window ItemList
  3056. #==============================================================================
  3057. class Window_ItemList < Window_Selectable
  3058.  
  3059.  #--------------------------------------------------------------------------
  3060.  # * Draw Item Name
  3061.  #--------------------------------------------------------------------------    
  3062.    alias mog_bhex_draw_item_name_item draw_item_name
  3063.    def draw_item_name(item, x, y, enabled = true, width = 172)
  3064.        set_bh_ex_font
  3065.        mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  3066.    end  
  3067.  
  3068. end
  3069.  
  3070. #==============================================================================
  3071. # ** Window SkillList
  3072. #==============================================================================
  3073. class Window_SkillList < Window_Selectable  
  3074.  
  3075.  #--------------------------------------------------------------------------
  3076.  # * Draw Item Name
  3077.  #--------------------------------------------------------------------------    
  3078.    alias mog_bhex_draw_item_name_skill draw_item_name
  3079.    def draw_item_name(item, x, y, enabled = true, width = 172)
  3080.        set_bh_ex_font
  3081.        mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  3082.    end    
  3083.    
  3084. end
  3085.  
  3086. #==============================================================================
  3087. # ** Spriteset_Battle
  3088. #==============================================================================
  3089. class Spriteset_Battle
  3090.  
  3091.   #--------------------------------------------------------------------------
  3092.   # * Initialize
  3093.   #--------------------------------------------------------------------------
  3094.   alias mog_battle_hud_ex_initialize initialize
  3095.   def initialize
  3096.       check_screen_xyz_nil rescue nil
  3097.       mog_battle_hud_ex_initialize
  3098.       create_battle_hud_ex
  3099.   end
  3100.  
  3101.   #--------------------------------------------------------------------------
  3102.   # * Check Screen Xyz
  3103.   #--------------------------------------------------------------------------  
  3104.   def check_screen_xyz_nil
  3105.       return if !SceneManager.face_battler?
  3106.       for actor in $game_party.battle_members
  3107.           actor.screen_x = 0 if actor.screen_x == nil
  3108.           actor.screen_y = 0 if actor.screen_y == nil
  3109.           actor.screen_z = 0 if actor.screen_z == nil
  3110.       end
  3111.   end
  3112.  
  3113.   #--------------------------------------------------------------------------
  3114.   # * Check Screen Xyz after
  3115.   #--------------------------------------------------------------------------    
  3116.   def check_screen_xyz_after
  3117.       return if !SceneManager.face_battler?
  3118.       $game_party.battle_members.each_with_index do |actor, index|
  3119.           actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  3120.           actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  3121.           actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  3122.       end    
  3123.   end
  3124.  
  3125.   #--------------------------------------------------------------------------
  3126.   # * Dispose
  3127.   #--------------------------------------------------------------------------  
  3128.   alias mog_battle_hud_ex_dispose dispose
  3129.   def dispose
  3130.       dispose_battle_hud_ex
  3131.       mog_battle_hud_ex_dispose
  3132.   end
  3133.  
  3134.   #--------------------------------------------------------------------------
  3135.   # * Update
  3136.   #--------------------------------------------------------------------------  
  3137.   alias mog_battle_hud_ex_update update
  3138.   def update
  3139.       mog_battle_hud_ex_update
  3140.       update_battle_hud_ex
  3141.   end
  3142.  
  3143.   #--------------------------------------------------------------------------
  3144.   # * Create Battle Hud EX
  3145.   #--------------------------------------------------------------------------    
  3146.   def create_battle_hud_ex
  3147.       return if @battle_hud_ex != nil
  3148.       $game_temp.battle_hud_visible = true
  3149.       @battle_hud_ex = Monogatari_Bhud.new(nil)
  3150.       check_screen_xyz_after
  3151.   end
  3152.  
  3153.   #--------------------------------------------------------------------------
  3154.   # * Dispose Battle Hud EX
  3155.   #--------------------------------------------------------------------------  
  3156.   def dispose_battle_hud_ex
  3157.       return if @battle_hud_ex == nil
  3158.       @battle_hud_ex.dispose
  3159.       @battle_hud_ex = nil
  3160.       $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3161.   end
  3162.  
  3163.   #--------------------------------------------------------------------------
  3164.   # * Update Battle Hud EX
  3165.   #--------------------------------------------------------------------------    
  3166.   def update_battle_hud_ex
  3167.       refresh_battle_hud if $game_temp.mbhud_force_refresh
  3168.       return if @battle_hud_ex == nil
  3169.       @battle_hud_ex.update
  3170.   end
  3171.  
  3172.   #--------------------------------------------------------------------------
  3173.   # * Refresh Battle Hud
  3174.   #--------------------------------------------------------------------------    
  3175.   def refresh_battle_hud
  3176.       $game_temp.mbhud_force_refresh = false
  3177.       check_screen_xyz_nil rescue nil
  3178.       dispose_battle_hud_ex
  3179.       create_battle_hud_ex
  3180.   end
  3181.  
  3182. end
  3183.  
  3184. #==============================================================================
  3185. # ** Monogatari Bhud
  3186. #==============================================================================
  3187. class Monogatari_Bhud
  3188.  
  3189.   include MOG_BATTLE_HUD_EX
  3190.  
  3191.   #--------------------------------------------------------------------------
  3192.   # * Initialize
  3193.   #--------------------------------------------------------------------------  
  3194.   def initialize(viewport)
  3195.       @battle_hud = [] ; @sprite_visitle_wait = 0
  3196.       $game_party.battle_members.each_with_index do |actor, index|
  3197.       @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3198.       create_turn_sprite(nil)
  3199.       create_screen_layout(nil)      
  3200.   end
  3201.  
  3202.   #--------------------------------------------------------------------------
  3203.   # * Max members
  3204.   #--------------------------------------------------------------------------    
  3205.   def max_members
  3206.       if $game_party.members.size > $game_party.max_battle_members
  3207.          return $game_party.max_battle_members
  3208.       end  
  3209.       return $game_party.members.size
  3210.   end
  3211.  
  3212.   #--------------------------------------------------------------------------
  3213.   # * Dispose
  3214.   #--------------------------------------------------------------------------    
  3215.   def dispose
  3216.       @battle_hud.each {|sprite| sprite.dispose }
  3217.       dispose_turn_sprite
  3218.       dispose_screen_layout
  3219.   end
  3220.  
  3221.   #--------------------------------------------------------------------------
  3222.   # * Update
  3223.   #--------------------------------------------------------------------------  
  3224.   def update
  3225.       @battle_hud.each {|sprite| sprite.update }
  3226.       update_turn_sprite
  3227.       update_screen_layout
  3228.       refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3229.   end
  3230.  
  3231.   #--------------------------------------------------------------------------
  3232.   # * Update
  3233.   #--------------------------------------------------------------------------  
  3234.   def refresh_battle_hud_visible
  3235.       $game_temp.battle_hud_visible_refresh[0] = false
  3236.       @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3237.       @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3238.       @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3239.       @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3240.  end
  3241.  
  3242. end
  3243.  
  3244. #==============================================================================
  3245. # ** Monogatari Bhud
  3246. #==============================================================================
  3247. class Monogatari_Bhud
  3248.  
  3249.  #--------------------------------------------------------------------------
  3250.  # * Can Update Turn Sprite
  3251.  #--------------------------------------------------------------------------
  3252.   def can_refresh_turn_sprite?
  3253.       return true if @turn_sprite.visible != $game_temp.command_visible
  3254.       return true if $game_temp.refresh_turn_sprite
  3255.       return false
  3256.   end
  3257.  
  3258.  #--------------------------------------------------------------------------
  3259.  # * Create Turn Sprite
  3260.  #--------------------------------------------------------------------------
  3261.   def create_turn_sprite(viewport)
  3262.       return if !TURN_SPRITE_VISIBLE
  3263.       return if @turn_sprite != nil
  3264.       @turn_sprite = Sprite.new
  3265.       @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3266.       @turn_sprite.viewport = viewport
  3267.       @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3268.       @turn_sprite.visible = false
  3269.       @turn_sprite_update_time = 5
  3270.       @turn_sprite_blink = [0,0]
  3271.   end
  3272.  
  3273.  #--------------------------------------------------------------------------
  3274.  # * Dispose Turn Sprite
  3275.  #--------------------------------------------------------------------------
  3276.   def dispose_turn_sprite
  3277.       return if @turn_sprite == nil
  3278.       @turn_sprite.dispose
  3279.       @turn_sprite = nil
  3280.   end
  3281.  
  3282.  #--------------------------------------------------------------------------
  3283.  # * Update Turn Sprite
  3284.  #--------------------------------------------------------------------------
  3285.   def update_turn_sprite
  3286.       return if @turn_sprite == nil
  3287.       if @turn_sprite_update_time > 0
  3288.          @turn_sprite_update_time -= 1
  3289.          return
  3290.       end  
  3291.       update_turn_visible
  3292.       update_turn_blink
  3293.   end
  3294.  
  3295.  #--------------------------------------------------------------------------
  3296.  # * Update Turn Visible
  3297.  #--------------------------------------------------------------------------  
  3298.   def update_turn_visible    
  3299.       $game_temp.refresh_turn_sprite = false
  3300.       @turn_sprite.visible = can_turn_sprite_visible?
  3301.       return if BattleManager.actor == nil
  3302.       x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3303.       y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3304.       x = -1000 if x == nil ; y = -1000 if y == nil
  3305.       @turn_sprite.x = x ; @turn_sprite.y = y      
  3306.  end
  3307.  
  3308.  #--------------------------------------------------------------------------
  3309.  # * Can Turn Sprite Visible?
  3310.  #--------------------------------------------------------------------------  
  3311.  def can_turn_sprite_visible?
  3312.      return false if BattleManager.actor == nil
  3313.      return false if $game_temp.battle_end
  3314.      return false if $game_message.visible
  3315.      return true
  3316.  end
  3317.    
  3318.  #--------------------------------------------------------------------------
  3319.  # * Update Turn Blink
  3320.  #--------------------------------------------------------------------------  
  3321.  def update_turn_blink
  3322.      return if !TURN_BLINK_EFFECT
  3323.      return if !@turn_sprite.visible
  3324.      @turn_sprite_blink[0] += 1
  3325.      case @turn_sprite_blink[0]
  3326.        when 0..60
  3327.           @turn_sprite_blink[1] += 3
  3328.        when 61..120
  3329.           @turn_sprite_blink[1] -= 3
  3330.        else
  3331.          @turn_sprite_blink = [0,0]
  3332.      end
  3333.      @turn_sprite.opacity = 160 + @turn_sprite_blink[1]
  3334.  end
  3335.  
  3336.  
  3337. end
  3338.  
  3339. #==============================================================================
  3340. # ** Monogatari Bhud
  3341. #==============================================================================
  3342. class Monogatari_Bhud
  3343.  
  3344.   #--------------------------------------------------------------------------
  3345.   # * Create Screen Layout
  3346.   #--------------------------------------------------------------------------    
  3347.   def create_screen_layout(viewport)
  3348.       return if !SCREEN_LAYOUT
  3349.       @screen_layout = Sprite.new
  3350.       @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3351.       @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3352.       @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3353.       @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3354.       @screen_layout.opacity = 0
  3355.       @screen_layout.viewport = viewport
  3356.    end    
  3357.  
  3358.   #--------------------------------------------------------------------------
  3359.   # * Dispose Screen Layout
  3360.   #--------------------------------------------------------------------------
  3361.    def dispose_screen_layout
  3362.        return if @screen_layout == nil
  3363.        @screen_layout.dispose ; @screen_layout = nil    
  3364.    end
  3365.    
  3366.   #--------------------------------------------------------------------------
  3367.   # * Update Screen Layout
  3368.   #--------------------------------------------------------------------------
  3369.    def update_screen_layout
  3370.        return if @screen_layout == nil
  3371.        @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3372.        sprite_visible(@screen_layout)
  3373.    end
  3374.    
  3375.   #--------------------------------------------------------------------------
  3376.   # * Sprite Visible
  3377.   #--------------------------------------------------------------------------
  3378.   def sprite_visible?
  3379.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3380.       return false if !$game_temp.battle_hud_visible
  3381.       return false if !$game_temp.sprite_visible
  3382.       return true
  3383.   end
  3384.  
  3385.   #--------------------------------------------------------------------------
  3386.   # * Sprite Visible
  3387.   #--------------------------------------------------------------------------
  3388.   def sprite_visible(sprite)      
  3389.       if sprite_visible?
  3390.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3391.       else
  3392.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3393.       end
  3394.   end  
  3395.    
  3396. end
  3397.  
  3398. #==============================================================================
  3399. #==============================================================================
  3400. # ** Battle Hud EX
  3401. #==============================================================================
  3402. #==============================================================================
  3403. class Battle_Hud_EX
  3404.   include MOG_BATTLE_HUD_EX
  3405.  
  3406.   #--------------------------------------------------------------------------
  3407.   # * Initialize
  3408.   #--------------------------------------------------------------------------  
  3409.   def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3410.       pre_cache
  3411.       setup(actor,index,max_members)
  3412.       create_sprites(viewport)
  3413.   end
  3414.  
  3415.   #--------------------------------------------------------------------------
  3416.   # * Setup
  3417.   #--------------------------------------------------------------------------    
  3418.   def setup(actor,index,max_members)
  3419.       $game_temp.battle_end = false
  3420.       @actor = actor
  3421.       @actor_index = index
  3422.       @max_members = max_members
  3423.       @actor.face_animation = [0,0,0]
  3424.       @hp_icon_max = -1
  3425.       @hp_icon_old = -1
  3426.       @hp_icon_col_max = HP_ICON_COL_MAX
  3427.       @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3428.       @hp_icon_row_max = HP_ICON_ROW_MAX
  3429.       @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3430.       @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3431.       @mp_icon_max = -1
  3432.       @mp_icon_old = -1
  3433.       @mp_icon_col_max = MP_ICON_COL_MAX
  3434.       @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3435.       @mp_icon_row_max = MP_ICON_ROW_MAX
  3436.       @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3437.       @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3438.       @tp_icon_max = -1
  3439.       @tp_icon_old = -1
  3440.       @tp_icon_col_max = TP_ICON_COL_MAX
  3441.       @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3442.       @tp_icon_row_max = TP_ICON_ROW_MAX
  3443.       @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3444.       @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3445.       @sprite_visible = true
  3446.       @sprite_visitle_wait = 0
  3447.       setup_actor
  3448.       setup_position
  3449.   end
  3450.      
  3451.   #--------------------------------------------------------------------------
  3452.   # * Setup Actor
  3453.   #--------------------------------------------------------------------------    
  3454.   def setup_actor
  3455.       return if @actor == nil
  3456.       @hp_number_refresh = true
  3457.       @hp_number2_refresh = true
  3458.       @hp_number_old = @actor.hp
  3459.       @hp_number2_old = @actor.mhp
  3460.       @hp_old_meter = 0      
  3461.       @mp_number_refresh = true
  3462.       @mp_number2_refresh = true
  3463.       @mp_number_old = @actor.mp
  3464.       @mp_number2_old = @actor.mmp
  3465.       @mp_old_meter = 0      
  3466.       @tp_number_refresh = true
  3467.       @tp_number2_refresh = true
  3468.       @tp_number_old = @actor.tp
  3469.       @tp_number2_old = @actor.max_tp  
  3470.       @tp_old_meter = 0
  3471.       @at_number_refresh = true
  3472.       @at_number2_refresh = true
  3473.       @at_number_old = actor_at
  3474.       @at_number2_old = actor_max_at
  3475.       @at_old_meter = 0
  3476.       catb = ATB::MAX_AP rescue nil
  3477.       @ccwinter_atb = true if catb != nil
  3478.   end  
  3479.  
  3480.   #--------------------------------------------------------------------------
  3481.   # * Terminate
  3482.   #--------------------------------------------------------------------------    
  3483.   def terminate
  3484.       @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3485.   end
  3486.  
  3487.   #--------------------------------------------------------------------------
  3488.   # * AT
  3489.   #--------------------------------------------------------------------------  
  3490.   def actor_at
  3491.       return @actor.atb if $imported[:mog_atb_system]
  3492.       return @actor.atb if $imported[:ve_active_time_battle]
  3493.       return @actor.catb_value if $imported["YSA-CATB"]
  3494.       return @actor.ap if @ccwinter_atb != nil
  3495.       return 0
  3496.   end
  3497.  
  3498.   #--------------------------------------------------------------------------
  3499.   # * Max AT
  3500.   #--------------------------------------------------------------------------  
  3501.   def actor_max_at
  3502.       return @actor.atb_max if $imported[:mog_atb_system]
  3503.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3504.       return @actor.max_atb if $imported["YSA-CATB"]
  3505.       return ATB::MAX_AP if @ccwinter_atb != nil
  3506.       return 1
  3507.   end
  3508.  
  3509.   #--------------------------------------------------------------------------
  3510.   # ● Actor Cast
  3511.   #--------------------------------------------------------------------------            
  3512.   def actor_cast
  3513.       return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3514.       return @actor.atb if $imported[:ve_active_time_battle]
  3515.       return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3516.       return 0
  3517.   end
  3518.  
  3519.   #--------------------------------------------------------------------------
  3520.   # ● Actor Max Cast
  3521.   #--------------------------------------------------------------------------            
  3522.   def actor_max_cast
  3523.       if $imported[:mog_atb_system]
  3524.          return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3525.          return @actor.atb_cast[0].speed.abs
  3526.       end    
  3527.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3528.       return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3529.       return 1
  3530.   end
  3531.  
  3532.   #--------------------------------------------------------------------------
  3533.   # ● Actor Cast?
  3534.   #--------------------------------------------------------------------------            
  3535.   def actor_cast?  
  3536.       if $imported[:mog_atb_system]
  3537.          return true if !@actor.atb_cast.empty?
  3538.       end  
  3539.       if $imported[:ve_active_time_battle]
  3540.          return true if @actor.cast_action?
  3541.       end      
  3542.       if @ccwinter_atb
  3543.          return true if @actor.chanting?
  3544.       end
  3545.       return false
  3546.   end  
  3547.  
  3548.   #--------------------------------------------------------------------------
  3549.   # * Create Sprites
  3550.   #--------------------------------------------------------------------------    
  3551.   def create_sprites(viewport)
  3552.       dispose
  3553.       return if @actor == nil
  3554.       create_layout(viewport)
  3555.       create_layout_2(viewport)
  3556.       create_name(viewport)
  3557.       create_face(viewport)
  3558.       create_hp_number(viewport)
  3559.       create_hp_number_max(viewport)
  3560.       create_hp_meter(viewport)
  3561.       create_hp_icon(viewport)
  3562.       create_hp_icon_ex(viewport)
  3563.       create_hp_icon_number(viewport)
  3564.       create_mp_number(viewport)
  3565.       create_mp_number_max(viewport)
  3566.       create_mp_meter(viewport)
  3567.       create_mp_icon(viewport)
  3568.       create_mp_icon_ex(viewport)
  3569.       create_mp_icon_number(viewport)
  3570.       create_tp_number(viewport)
  3571.       create_tp_number_max(viewport)
  3572.       create_tp_meter(viewport)
  3573.       create_tp_icon(viewport)
  3574.       create_tp_icon_ex(viewport)
  3575.       create_tp_icon_number(viewport)
  3576.       create_at_number(viewport)
  3577.       create_at_number_max(viewport)
  3578.       create_at_meter(viewport)      
  3579.       create_level_number(viewport)
  3580.       create_states(viewport)
  3581.       update
  3582.   end    
  3583.  
  3584.   #--------------------------------------------------------------------------
  3585.   # * Sprite Visible
  3586.   #--------------------------------------------------------------------------
  3587.   def sprite_visible?
  3588.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3589.       return false if !$game_temp.battle_hud_visible
  3590.       return false if !$game_temp.sprite_visible
  3591.       return true
  3592.   end
  3593.  
  3594.   #--------------------------------------------------------------------------
  3595.   # * Sprite Visible
  3596.   #--------------------------------------------------------------------------
  3597.   def sprite_visible(sprite)
  3598.       if @sprite_visible        
  3599.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3600.       else
  3601.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3602.       end
  3603.   end
  3604.  
  3605. end
  3606.  
  3607. #==============================================================================
  3608. #==============================================================================
  3609. # ** Battle Hud EX
  3610. #==============================================================================
  3611. #==============================================================================
  3612. class Battle_Hud_EX
  3613.  
  3614.   #--------------------------------------------------------------------------
  3615.   # * Setup Position
  3616.   #--------------------------------------------------------------------------
  3617.   def setup_position
  3618.       sprite_width = (Graphics.width - 64) / 4
  3619.       sprite_center = sprite_width / 2  
  3620.       if $game_party.battle_members.size > 4
  3621.          members = $game_party.battle_members.size - 4
  3622.          fx = 32 * members
  3623.        else
  3624.          fx = 0
  3625.       end  
  3626.       space_x = MEMBERS_SPACE[0] - fx
  3627.       space_y = MEMBERS_SPACE[1]      
  3628.       center = Graphics.width / 2
  3629.       members_space = (Graphics.width + space_x) / @max_members
  3630.       members_space2 = (members_space * @actor_index)      
  3631.       members_space3 = ((members_space / 2) * (@max_members - 1))
  3632.       members_space_y = space_y * @actor_index
  3633.       x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3634.       screen_resize_y = 0
  3635.       screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3636.       y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3637.       @hud_position = [x,y]
  3638.       $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3639.       $game_temp.hud_pos_real[@actor_index] = [x,y]
  3640.       x2 = x + sprite_center
  3641.       $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3642.       $game_temp.hud_pos[@actor_index] = [x2,y]
  3643.       if FIXED_HUD_POSITION[@actor_index] != nil    
  3644.          @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3645.          $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3646.          $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3647.          $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]    
  3648.       end      
  3649.   end
  3650.  
  3651. end
  3652.  
  3653. #==============================================================================
  3654. # ** Game Temp
  3655. #==============================================================================
  3656. class Game_Temp
  3657.  
  3658.   attr_accessor :cache_bhud_sprites
  3659.  
  3660.   #--------------------------------------------------------------------------
  3661.   # * Cache Battle Hud
  3662.   #--------------------------------------------------------------------------  
  3663.   def cache_battle_hud      
  3664.       execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3665.   end
  3666.  
  3667.   #--------------------------------------------------------------------------
  3668.   # * Execute Cache Bhud Sprites
  3669.   #--------------------------------------------------------------------------  
  3670.   def execute_cache_bhud_sprites
  3671.       @cache_bhud_sprites = []
  3672.       windows = ["Layout_Command","Layout_Party","Layout_Help",
  3673.       "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3674.       "Layout_Item"]
  3675.       for s in windows
  3676.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3677.       end
  3678.       sprites = ["Layout","Layout_2",
  3679.      "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3680.      "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",  
  3681.      "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",  
  3682.      "LV_Number","Turn","Iconset","Layout_Screen"
  3683.       ]
  3684.       for s in sprites
  3685.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3686.       end      
  3687.   end
  3688.  
  3689. end
  3690.  
  3691. #==============================================================================
  3692. # ** Spriteset_Map
  3693. #==============================================================================
  3694. class Spriteset_Map
  3695.  
  3696.   #--------------------------------------------------------------------------
  3697.   # * Initialize
  3698.   #--------------------------------------------------------------------------
  3699.   alias mog_monogatari_bhud_initialize initialize
  3700.   def initialize
  3701.       $game_temp.cache_battle_hud
  3702.       mog_monogatari_bhud_initialize
  3703.   end
  3704.  
  3705. end
  3706.  
  3707. #==============================================================================
  3708. #==============================================================================
  3709. # ** Battle Hud EX
  3710. #==============================================================================
  3711. #==============================================================================
  3712. class Battle_Hud_EX
  3713.  
  3714.   #--------------------------------------------------------------------------
  3715.   # * Pre Cache
  3716.   #--------------------------------------------------------------------------
  3717.   def pre_cache
  3718.       $game_temp.cache_battle_hud
  3719.       @force_hide = false
  3720.       @force_hide_time = 0
  3721.       @fade_hud = false
  3722.       @fade_hud_gold = false    
  3723.       @fade_hud_equip = false
  3724.       @layout_image = Cache.battle_hud("Layout")
  3725.       @layout_cw = @layout_image.width
  3726.       @layout_ch = @layout_image.height
  3727.       @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3728.       @layout2_cw = @layout2_image.width if @layout2_image != nil
  3729.       @layout2_ch = @layout2_image.height if @layout2_image != nil
  3730.       @layout2_cw = 0 if @layout2_cw == nil      
  3731.       #------------------------------------------------
  3732.       # HP
  3733.       #------------------------------------------------
  3734.       if HP_NUMBER_VISIBLE
  3735.          @hp_number_image = Cache.battle_hud("HP_Number")
  3736.          @hp_number_cw = @hp_number_image.width / 10
  3737.          if HP_NUMBER_LOW_COLOR
  3738.             @hp_number_ch = @hp_number_image.height / 2
  3739.          else
  3740.             @hp_number_ch = @hp_number_image.height
  3741.          end  
  3742.          @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3743.          @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number      
  3744.       end
  3745.       if HP_NUMBER_MAX_VISIBLE
  3746.          @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3747.          @hp_number2_cw = @hp_number2_image.width / 10
  3748.          @hp_number2_ch = @hp_number2_image.height
  3749.       end
  3750.       if HP_METER_VISIBLE
  3751.          @hp_meter_image = Cache.battle_hud("HP_Meter")
  3752.          if HP_METER_GRADIENT_ANIMATION
  3753.             @hp_meter_cw = @hp_meter_image.width / 3
  3754.          else  
  3755.             @hp_meter_cw = @hp_meter_image.width
  3756.          end  
  3757.          if HP_METER_REDUCTION_ANIMATION
  3758.             @hp_meter_ch = @hp_meter_image.height / 2
  3759.          else
  3760.             @hp_meter_ch = @hp_meter_image.height
  3761.          end  
  3762.       end
  3763.       if HP_ICON_VISIBLE
  3764.          @hp_icon_image = Cache.battle_hud("HP_Icon")
  3765.          @hp_icon_cw = @hp_icon_image.width / 2
  3766.          @hp_icon_ch = @hp_icon_image.height
  3767.       end
  3768.       if HP_ICON_EX_VISIBLE
  3769.          @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3770.          @hp_icon2_cw = @hp_icon2_image.width
  3771.          @hp_icon2_ch = @hp_icon2_image.height        
  3772.       end      
  3773.       if HP_ICON_NUMBER_VISIBLE
  3774.          @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3775.          @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3776.          @hp_icon_number_ch = @hp_icon_number_image.height        
  3777.       end
  3778.       #------------------------------------------------
  3779.       # MP
  3780.       #------------------------------------------------
  3781.       if MP_NUMBER_VISIBLE
  3782.          @mp_number_image = Cache.battle_hud("MP_Number")
  3783.          @mp_number_cw = @mp_number_image.width / 10
  3784.          if MP_NUMBER_LOW_COLOR
  3785.             @mp_number_ch = @mp_number_image.height / 2
  3786.          else
  3787.             @mp_number_ch = @mp_number_image.height
  3788.         end
  3789.         @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3790.         @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3791.       end
  3792.       if MP_NUMBER_MAX_VISIBLE
  3793.          @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3794.          @mp_number2_cw = @mp_number2_image.width / 10
  3795.          @mp_number2_ch = @mp_number2_image.height
  3796.       end
  3797.       if MP_METER_VISIBLE
  3798.          @mp_meter_image = Cache.battle_hud("MP_Meter")
  3799.          if MP_METER_GRADIENT_ANIMATION
  3800.             @mp_meter_cw = @mp_meter_image.width / 3
  3801.          else  
  3802.             @mp_meter_cw = @mp_meter_image.width
  3803.          end  
  3804.          if MP_METER_REDUCTION_ANIMATION
  3805.             @mp_meter_ch = @mp_meter_image.height / 2
  3806.          else
  3807.             @mp_meter_ch = @mp_meter_image.height
  3808.          end
  3809.       end
  3810.       if MP_ICON_VISIBLE
  3811.          @mp_icon_image = Cache.battle_hud("MP_Icon")
  3812.          @mp_icon_cw = @mp_icon_image.width / 2
  3813.          @mp_icon_ch = @mp_icon_image.height
  3814.       end
  3815.       if MP_ICON_EX_VISIBLE
  3816.          @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3817.          @mp_icon2_cw = @mp_icon2_image.width
  3818.          @mp_icon2_ch = @mp_icon2_image.height        
  3819.       end      
  3820.       if MP_ICON_NUMBER_VISIBLE
  3821.          @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3822.          @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3823.          @mp_icon_number_ch = @mp_icon_number_image.height        
  3824.       end
  3825.       #------------------------------------------------
  3826.       # TP
  3827.       #------------------------------------------------
  3828.       if TP_NUMBER_VISIBLE
  3829.          @tp_number_image = Cache.battle_hud("TP_Number")
  3830.          @tp_number_cw = @tp_number_image.width / 10
  3831.          if TP_NUMBER_LOW_COLOR
  3832.             @tp_number_ch = @tp_number_image.height / 2
  3833.          else
  3834.             @tp_number_ch = @tp_number_image.height
  3835.          end  
  3836.         @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3837.         @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number      
  3838.       end
  3839.       if TP_NUMBER_MAX_VISIBLE
  3840.          @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3841.          @tp_number2_cw = @tp_number2_image.width / 10
  3842.          @tp_number2_ch = @tp_number2_image.height
  3843.       end
  3844.       if TP_METER_VISIBLE
  3845.          @tp_meter_image = Cache.battle_hud("TP_Meter")
  3846.          if TP_METER_GRADIENT_ANIMATION
  3847.             @tp_meter_cw = @tp_meter_image.width / 3
  3848.          else  
  3849.             @tp_meter_cw = @tp_meter_image.width
  3850.          end  
  3851.          if TP_METER_REDUCTION_ANIMATION
  3852.             @tp_meter_ch = @tp_meter_image.height / 2      
  3853.          else
  3854.             @tp_meter_ch = @tp_meter_image.height
  3855.          end  
  3856.       end        
  3857.       if TP_ICON_VISIBLE
  3858.          @tp_icon_image = Cache.battle_hud("TP_Icon")
  3859.          @tp_icon_cw = @tp_icon_image.width / 2
  3860.          @tp_icon_ch = @tp_icon_image.height
  3861.       end  
  3862.       if TP_ICON_EX_VISIBLE
  3863.          @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3864.          @tp_icon2_cw = @tp_icon2_image.width
  3865.          @tp_icon2_ch = @tp_icon2_image.height        
  3866.       end      
  3867.       if TP_ICON_NUMBER_VISIBLE
  3868.          @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3869.          @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3870.          @tp_icon_number_ch = @tp_icon_number_image.height        
  3871.       end
  3872.       #------------------------------------------------
  3873.       # AT
  3874.       #------------------------------------------------
  3875.       if AT_NUMBER_VISIBLE
  3876.          @at_number_image = Cache.battle_hud("AT_Number")
  3877.          @at_number_cw = @at_number_image.width / 10
  3878.          @at_number_ch = @at_number_image.height
  3879.          @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3880.          @at_number_ch += (@at_number_ch / 2) if @at_wave_number      
  3881.       end
  3882.       if AT_NUMBER_MAX_VISIBLE
  3883.          @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3884.          @at_number2_cw = @at_number2_image.width / 10
  3885.          @at_number2_ch = @at_number2_image.height
  3886.       end
  3887.       if AT_METER_VISIBLE
  3888.          @at_meter_image = Cache.battle_hud("AT_Meter")
  3889.          if AT_METER_GRADIENT_ANIMATION
  3890.             @at_meter_cw = @at_meter_image.width / 3
  3891.          else  
  3892.             @at_meter_cw = @at_meter_image.width
  3893.          end  
  3894.          @at_meter_ch = @at_meter_image.height / 3
  3895.       end
  3896.       #------------------------------------------------
  3897.       # LV
  3898.       #------------------------------------------------  
  3899.       if LEVEL_NUMBER_VISIBLE
  3900.          @lv_number_image = Cache.battle_hud("LV_Number")
  3901.          @lv_number_cw = @lv_number_image.width / 10
  3902.          @lv_number_ch = @lv_number_image.height
  3903.       end      
  3904.       #------------------------------------------------
  3905.       # ICON
  3906.       #------------------------------------------------  
  3907.       if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3908.          @icon_image = Cache.system("Iconset")
  3909.       end        
  3910.   end
  3911.  
  3912.   #--------------------------------------------------------------------------
  3913.   # * Check Icon Image
  3914.   #--------------------------------------------------------------------------          
  3915.   def check_icon_image
  3916.       if @icon_image == nil or @icon_image.disposed?
  3917.          @icon_image = Cache.system("Iconset")
  3918.       end  
  3919.   end  
  3920.  
  3921. end
  3922.  
  3923. #==============================================================================
  3924. #==============================================================================
  3925. # ** Battle Hud EX
  3926. #==============================================================================
  3927. #==============================================================================
  3928. class Battle_Hud_EX
  3929.  
  3930.   #--------------------------------------------------------------------------
  3931.   # * Update Number
  3932.   #--------------------------------------------------------------------------    
  3933.   def update_number(type,value)
  3934.       actor_value = @actor.hp if type == 0
  3935.       actor_value = @actor.mp if type == 1
  3936.       actor_value = @actor.tp if type == 2
  3937.       actor_value = @actor.mhp if type == 3
  3938.       actor_value = @actor.mmp if type == 4
  3939.       actor_value = @actor.max_tp if type == 5
  3940.       actor_value = actor_at if type == 6
  3941.       actor_value = actor_max_at if type == 7
  3942.       if value < actor_value
  3943.          value += number_refresh_speed(actor_value,value)
  3944.          value = actor_value if value >= actor_value
  3945.          refresh_sprite_number(type,value)
  3946.      elsif value > actor_value
  3947.          value -= number_refresh_speed(actor_value,value)
  3948.          value = actor_value if value <= actor_value
  3949.          refresh_sprite_number(type,value)
  3950.      end  
  3951.   end
  3952.  
  3953.   #--------------------------------------------------------------------------
  3954.   # * Number Refresh Speed
  3955.   #--------------------------------------------------------------------------      
  3956.   def number_refresh_speed(actor_value,value)
  3957.       n =  1 * (actor_value - value).abs / 10
  3958.       return [[n, 99999999].min,1].max    
  3959.   end
  3960.  
  3961.   #--------------------------------------------------------------------------
  3962.   # * Update Number Fix
  3963.   #--------------------------------------------------------------------------      
  3964.   def update_number_fix(type)
  3965.       if type == 0
  3966.          @hp_number_old =  @actor.hp
  3967.          @hp_number_refresh = true
  3968.       elsif type == 1
  3969.          @mp_number_old =  @actor.mp
  3970.          @mp_number_refresh = true
  3971.       elsif type == 2
  3972.          @tp_number_old =  @actor.tp
  3973.          @tp_number_refresh = true  
  3974.       elsif type == 3
  3975.          @hp_number2_old =  @actor.mhp
  3976.          @hp_number2_refresh = true
  3977.       elsif type == 4
  3978.          @mp_number2_old =  @actor.mmp
  3979.          @mp_number2_refresh = true
  3980.       elsif type == 5
  3981.          @tp_number2_old =  @actor.max_tp
  3982.          @tp_number2_refresh = true  
  3983.       elsif type == 6
  3984.          @at_number_old =  actor_at
  3985.          @at_number_refresh = true        
  3986.       elsif type == 7
  3987.          @at_number2_old = actor_max_at
  3988.          @at_number2_refresh = true            
  3989.       end  
  3990.   end  
  3991.  
  3992.   #--------------------------------------------------------------------------
  3993.   # * Refresh Sprite Number
  3994.   #--------------------------------------------------------------------------  
  3995.   def refresh_sprite_number(type,value)    
  3996.       @hp_number_refresh = true if type == 0
  3997.       @hp_number_old = value if type == 0
  3998.       @mp_number_refresh = true if type == 1
  3999.       @mp_number_old = value if type == 1
  4000.       @tp_number_refresh = true if type == 2
  4001.       @tp_number_old = value if type == 2
  4002.       @hp_number2_refresh = true if type == 3
  4003.       @hp_number2_old = value if type == 3
  4004.       @mp_number2_refresh = true if type == 4
  4005.       @mp_number2_old = value if type == 4
  4006.       @tp_number2_refresh = true if type == 5
  4007.       @tp_number2_old = value if type == 5
  4008.       @at_number_refresh = true if type == 6
  4009.       @at_number_old = value if type == 6
  4010.       @at_number2_refresh = true if type == 7
  4011.       @at_number2_old = value if type == 7
  4012.   end  
  4013.  
  4014.   #--------------------------------------------------------------------------
  4015.   # * Refresh Number
  4016.   #--------------------------------------------------------------------------    
  4017.   def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  4018.       sprite.bitmap.clear
  4019.       clear_number_refresh(type)
  4020.       number_color = low_number_color(type,number_ch)
  4021.       if type == 0 and HP_NUMBER_PERCENTAGE
  4022.          value_max = @actor.mhp
  4023.          value = value.to_f / value_max.to_f * 100
  4024.          value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  4025.       elsif type == 1 and MP_NUMBER_PERCENTAGE
  4026.          value_max = @actor.mmp
  4027.          value = value.to_f / value_max.to_f * 100
  4028.       elsif type == 2 and TP_NUMBER_PERCENTAGE
  4029.          value_max = @actor.max_tp
  4030.          value = value.to_f / value_max.to_f * 100  
  4031.       elsif type == 3 and HP_NUMBER_PERCENTAGE
  4032.          value = 100
  4033.       elsif type == 4 and MP_NUMBER_PERCENTAGE
  4034.          value = 100
  4035.       elsif type == 5 and TP_NUMBER_PERCENTAGE
  4036.          value = 100
  4037.       elsif type == 6 and AT_NUMBER_PERCENTAGE
  4038.          value_max = actor_max_at
  4039.          value = value.to_f / value_max.to_f * 100
  4040.       elsif type == 7 and AT_NUMBER_PERCENTAGE
  4041.          value = 100        
  4042.       end
  4043.       value = 9999999 if value > 9999999
  4044.       number_value = value.truncate.abs.to_s.split(//)
  4045.       wave_h = 0
  4046.       wave_h2 = wave_number ? (number_ch / 3) : 0
  4047.       wave_h3 = number_color != 0 ? wave_h2 : 0
  4048.       for r in 0..number_value.size - 1        
  4049.          number_value_abs = number_value[r].to_i
  4050.          wh = wave_h2 * wave_h
  4051.          wh2 = wave_h == 0 ? wave_h2 : 0
  4052.          nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  4053.          sprite.bitmap.blt(number_cw *  r, wh, image, nsrc_rect)
  4054.          wave_h = wave_h == 0 ? 1 : 0
  4055.       end
  4056.       refresh_number_position(type,number_value.size,number_cw)
  4057.   end
  4058.  
  4059.   #--------------------------------------------------------------------------
  4060.   # * Refresh Number
  4061.   #--------------------------------------------------------------------------    
  4062.   def refresh_number_position(type,number_value,number_cw)
  4063.       cx = number_value * number_cw
  4064.       if type == 0
  4065.          case HP_NUMBER_ALIGN_TYPE
  4066.            when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4067.            when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  4068.            when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  4069.          end            
  4070.       elsif type == 1
  4071.          case MP_NUMBER_ALIGN_TYPE
  4072.            when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4073.            when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  4074.            when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  4075.          end    
  4076.       elsif type == 2  
  4077.          case TP_NUMBER_ALIGN_TYPE
  4078.            when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4079.            when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  4080.            when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  4081.          end          
  4082.       elsif type == 3  
  4083.          case HP_NUMBER_ALIGN_TYPE
  4084.            when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4085.            when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4086.            when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  4087.          end          
  4088.       elsif type ==  4
  4089.          case MP_NUMBER_ALIGN_TYPE
  4090.            when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4091.            when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4092.            when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  4093.          end          
  4094.       elsif type ==  5
  4095.          case TP_NUMBER_ALIGN_TYPE
  4096.            when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4097.            when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4098.            when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  4099.          end
  4100.       elsif type ==  6    
  4101.          case MP_NUMBER_ALIGN_TYPE
  4102.            when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4103.            when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4104.            when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4105.          end            
  4106.       elsif type ==  7    
  4107.          case AT_NUMBER_ALIGN_TYPE
  4108.            when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4109.            when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4110.            when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4111.          end
  4112.       end  
  4113.   end
  4114.  
  4115.   #--------------------------------------------------------------------------
  4116.   # * Low Number Color
  4117.   #--------------------------------------------------------------------------      
  4118.   def low_number_color(type,number_ch)
  4119.       if type == 0
  4120.          if HP_NUMBER_LOW_COLOR
  4121.             return @actor.low_hp? ? number_ch : 0
  4122.          else
  4123.             return 0
  4124.          end  
  4125.       elsif type == 1
  4126.          if MP_NUMBER_LOW_COLOR    
  4127.             return @actor.low_mp? ? number_ch : 0
  4128.          else
  4129.             return 0
  4130.          end          
  4131.       elsif type == 2
  4132.          if TP_NUMBER_LOW_COLOR
  4133.             return @actor.low_tp? ? number_ch : 0
  4134.          else
  4135.             return 0
  4136.          end
  4137.       else    
  4138.          return 0  
  4139.       end    
  4140.   end
  4141.  
  4142.   #--------------------------------------------------------------------------
  4143.   # * Clear Number Refresh
  4144.   #--------------------------------------------------------------------------      
  4145.   def clear_number_refresh(type)
  4146.       @hp_number_refresh = false if type == 0
  4147.       @mp_number_refresh = false if type == 1
  4148.       @tp_number_refresh = false if type == 2
  4149.       @hp_number2_refresh = false if type == 3
  4150.       @mp_number2_refresh = false if type == 4
  4151.       @tp_number2_refresh = false if type == 5
  4152.       @at_number_refresh = false if type == 6
  4153.       @at_number2_refresh = false if type == 7
  4154.   end  
  4155.  
  4156.   #--------------------------------------------------------------------------
  4157.   # * Icon Limit
  4158.   #--------------------------------------------------------------------------      
  4159.   def icon_limit(value,value_max)
  4160.       n1 = value / value_max
  4161.       n2 = value - (n1 * value_max)
  4162.       n2 = value_max if (n2 == 0 and value > 0)
  4163.       return n2
  4164.   end  
  4165.  
  4166. end
  4167.  
  4168. #==============================================================================
  4169. #==============================================================================
  4170. # ** Battle Hud EX
  4171. #==============================================================================
  4172. #==============================================================================
  4173. class Battle_Hud_EX
  4174.  
  4175.   #--------------------------------------------------------------------------
  4176.   # * Create Layout
  4177.   #--------------------------------------------------------------------------    
  4178.   def create_layout(viewport)
  4179.       @layout = Sprite.new
  4180.       @layout.bitmap = @layout_image
  4181.       @layout.z = HUD_Z
  4182.       @layout.x = @hud_position[0]
  4183.       @layout.y = @hud_position[1]
  4184.       @layout.opacity = 0
  4185.       @layout.viewport = viewport
  4186.   end    
  4187.  
  4188.   #--------------------------------------------------------------------------
  4189.   # * Update Layout
  4190.   #--------------------------------------------------------------------------    
  4191.   def update_layout
  4192.       return if @layout == nil
  4193.       sprite_visible(@layout)
  4194.   end
  4195.  
  4196.   #--------------------------------------------------------------------------
  4197.   # * Create Layout
  4198.   #--------------------------------------------------------------------------    
  4199.   def create_layout_2(viewport)
  4200.       return if !SECOND_LAYOUT
  4201.       @layout2 = Sprite.new
  4202.       @layout2.bitmap = @layout2_image
  4203.       @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4204.       @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4205.       @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4206.       @layout2.opacity = 0
  4207.       @layout2.viewport = viewport
  4208.   end    
  4209.  
  4210.   #--------------------------------------------------------------------------
  4211.   # * Update Layout
  4212.   #--------------------------------------------------------------------------    
  4213.   def update_layout_2
  4214.       return if @layout2 == nil
  4215.       sprite_visible(@layout2)
  4216.   end  
  4217.  
  4218. end
  4219.  
  4220. #==============================================================================
  4221. #==============================================================================
  4222. # ** Battle Hud EX
  4223. #==============================================================================
  4224. #==============================================================================
  4225. class Battle_Hud_EX
  4226.  
  4227.   #--------------------------------------------------------------------------
  4228.   # * Create Name
  4229.   #--------------------------------------------------------------------------      
  4230.   def create_name(viewport)
  4231.       return if !NAME_VISIBLE
  4232.       @name = Sprite.new
  4233.       @name.bitmap = Bitmap.new(160,32)
  4234.       @name.bitmap.font.size = NAME_FONT_SIZE
  4235.       @name.bitmap.font.bold = NAME_FONT_BOLD
  4236.       @name.bitmap.font.italic = NAME_FONT_ITALIC
  4237.       @name.bitmap.font.color = NAME_FONT_COLOR
  4238.       @name.z = HUD_Z + NAME_Z
  4239.       @name.x = @hud_position[0] + NAME_POSITION[0]
  4240.       @name.y = @hud_position[1] + NAME_POSITION[1]
  4241.       @name.viewport = viewport
  4242.       @name.opacity = 0
  4243.       refresh_name
  4244.   end
  4245.  
  4246.   #--------------------------------------------------------------------------
  4247.   # * Refresh Name
  4248.   #--------------------------------------------------------------------------      
  4249.   def refresh_name
  4250.       return if @name == nil
  4251.       @name.bitmap.clear
  4252.       if NAME_FONT_SHADOW
  4253.          @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4254.          @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4255.          @name.bitmap.font.color = NAME_FONT_COLOR
  4256.       end  
  4257.       @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4258.   end
  4259.  
  4260.   #--------------------------------------------------------------------------
  4261.   # * Update Name
  4262.   #--------------------------------------------------------------------------        
  4263.   def update_name
  4264.       return if @name == nil
  4265.       sprite_visible(@name)
  4266.   end
  4267.  
  4268. end
  4269.  
  4270. #==============================================================================
  4271. #==============================================================================
  4272. # ** Battle Hud EX
  4273. #==============================================================================
  4274. #==============================================================================
  4275. class Battle_Hud_EX
  4276.  
  4277.   #--------------------------------------------------------------------------
  4278.   # * Create HP Number
  4279.   #--------------------------------------------------------------------------  
  4280.   def create_hp_number(viewport)
  4281.       return if !HP_NUMBER_VISIBLE
  4282.       @hp_number = Sprite.new
  4283.       @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4284.       @hp_number.z = HUD_Z + HP_NUMBER_Z
  4285.       @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4286.       @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4287.       @hp_number.viewport = viewport
  4288.       @hp_number.opacity = 0
  4289.   end
  4290.  
  4291.   #--------------------------------------------------------------------------
  4292.   # * Create HP Number Max
  4293.   #--------------------------------------------------------------------------  
  4294.   def create_hp_number_max(viewport)
  4295.       return if !HP_NUMBER_MAX_VISIBLE
  4296.       @hp_number2 = Sprite.new
  4297.       @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4298.       @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4299.       @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4300.       @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4301.       @hp_number2.viewport = viewport
  4302.       @hp_number2.opacity = 0
  4303.   end  
  4304.  
  4305.   #--------------------------------------------------------------------------
  4306.   # * Create HP Meter
  4307.   #--------------------------------------------------------------------------    
  4308.   def create_hp_meter(viewport)
  4309.       return if !HP_METER_VISIBLE
  4310.       @hp_flow_max = @hp_meter_cw * 2
  4311.       @hp_flow = rand(@hp_flow_max)
  4312.       @hp_meter = Sprite.new
  4313.       @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4314.       @hp_meter.z = HUD_Z + HP_METER_Z
  4315.       @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4316.       @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4317.       @hp_meter.angle = HP_METER_ANGLE
  4318.       @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4319.       @hp_meter.viewport = viewport
  4320.       @hp_meter.opacity = 0
  4321.   end
  4322.  
  4323.   #--------------------------------------------------------------------------
  4324.   # ● Update Flow HP
  4325.   #--------------------------------------------------------------------------            
  4326.   def update_flow_hp
  4327.       @hp_meter.bitmap.clear
  4328.       @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4329.       meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4330.       meter_width = 0 if meter_width == nil
  4331.       execute_hp_damage_flow(meter_width)      
  4332.       meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4333.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)  
  4334.       @hp_flow += 1
  4335.       @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4336.   end  
  4337.    
  4338.   #--------------------------------------------------------------------------
  4339.   # ● Execute HP Damage Flow
  4340.   #--------------------------------------------------------------------------
  4341.   def execute_hp_damage_flow(meter_width)
  4342.       return if !HP_METER_REDUCTION_ANIMATION
  4343.       return if @hp_old_meter == meter_width
  4344.       n = (@hp_old_meter - meter_width).abs * 3 / 100
  4345.       damage_flow = [[n, 1].min,0.005].max
  4346.       @hp_old_meter -= damage_flow
  4347.       @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4348.       src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4349.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)      
  4350.   end
  4351.  
  4352.   #--------------------------------------------------------------------------
  4353.   # * Create HP Icon
  4354.   #--------------------------------------------------------------------------  
  4355.   def create_hp_icon(viewport)
  4356.       return if !HP_ICON_VISIBLE
  4357.       @hp_icon = Sprite.new
  4358.       icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4359.       icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4360.       @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4361.       @hp_icon.z = HUD_Z + HP_ICON_Z
  4362.       @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4363.       @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4364.       @hp_icon.viewport = viewport
  4365.       @hp_icon.opacity = 0
  4366.   end
  4367.    
  4368.   #--------------------------------------------------------------------------
  4369.   # * Refresh HP Icon
  4370.   #--------------------------------------------------------------------------    
  4371.   def refresh_hp_icon
  4372.       @hp_icon_old = @actor.hp
  4373.       @hp_icon.bitmap.clear
  4374.       max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4375.       if @actor.hp > max_value
  4376.          icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4377.       else  
  4378.          icon_max = @actor.mhp
  4379.       end      
  4380.       for i in 0...icon_max
  4381.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4382.           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)
  4383.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4384.           i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4385.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )      
  4386.       end      
  4387.       icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4388.       rx = 0
  4389.       ry = 0
  4390.       for i in 0...icon_max
  4391.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4392.           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)
  4393.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4394.           i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4395.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4396.       end
  4397.       refresh_hp_icon_ex(rx,ry)      
  4398.   end
  4399.  
  4400.   #--------------------------------------------------------------------------
  4401.   # * Create HP Icon EX
  4402.   #--------------------------------------------------------------------------  
  4403.   def create_hp_icon_ex(viewport)
  4404.       return if !HP_ICON_EX_VISIBLE
  4405.       @hp_icon3_anime_phase = 0
  4406.       @hp_icon3 = Sprite.new
  4407.       @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4408.       @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4409.       @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4410.       @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4411.       @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4412.                        @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4413.       @hp_icon3.x = @hp_icon3_org[0]
  4414.       @hp_icon3.y = @hp_icon3_org[1]
  4415.       @hp_icon3.viewport = viewport
  4416.       @hp_icon3.opacity = 0
  4417.   end  
  4418.  
  4419.   #--------------------------------------------------------------------------
  4420.   # * Refresh HP Icon EX
  4421.   #--------------------------------------------------------------------------      
  4422.   def refresh_hp_icon_ex(rx,ry)
  4423.       return if @hp_icon3 == nil
  4424.       @hp_icon3.bitmap.clear
  4425.       return if @actor.hp == 0
  4426.       i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4427.       @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4428.       @hp_icon3.x = @hp_icon3_org[0] + rx
  4429.       @hp_icon3.y = @hp_icon3_org[1] + ry    
  4430.   end
  4431.  
  4432.   #--------------------------------------------------------------------------
  4433.   # * Update Icon HP EX Anime
  4434.   #--------------------------------------------------------------------------  
  4435.   def update_icon_hp_ex_anime
  4436.       return if !HP_ICON_EX_ZOOM_EFFECT
  4437.       if @hp_icon3_anime_phase == 0
  4438.          @hp_icon3.zoom_x += 0.01
  4439.          if @hp_icon3.zoom_x >= 1.30
  4440.             @hp_icon3.zoom_x = 1.30
  4441.             @hp_icon3_anime_phase = 1
  4442.          end  
  4443.       else
  4444.         @hp_icon3.zoom_x -= 0.01
  4445.         if @hp_icon3.zoom_x <= 1.05
  4446.            @hp_icon3.zoom_x = 1.05
  4447.            @hp_icon3_anime_phase = 0
  4448.         end    
  4449.       end  
  4450.       @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4451.   end
  4452.  
  4453.   #--------------------------------------------------------------------------
  4454.   # * Create HP Icon Nummber
  4455.   #--------------------------------------------------------------------------      
  4456.   def create_hp_icon_number(viewport)
  4457.       return if !HP_ICON_NUMBER_VISIBLE
  4458.       @hp_icon_number_old = [-1,-1]
  4459.       @hp_icon_number = Sprite.new
  4460.       @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4461.       @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4462.       @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4463.       @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4464.       @hp_icon_number.viewport = viewport
  4465.       @hp_icon_number.opacity = 0
  4466.   end
  4467.  
  4468.   #--------------------------------------------------------------------------
  4469.   # * Refresh Icon Number HP
  4470.   #--------------------------------------------------------------------------  
  4471.   def refresh_icon_number_hp
  4472.       @hp_icon_number_old[0] = @actor.hp
  4473.       @hp_icon_number_old[1] = @actor.mhp
  4474.       @hp_icon_number.bitmap.clear
  4475.       value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4476.       value = 0 if value < 0
  4477.       number_value = value.truncate.abs.to_s.split(//)
  4478.       for r in 0..number_value.size - 1        
  4479.          number_value_abs = number_value[r].to_i
  4480.          nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4481.          @hp_icon_number.bitmap.blt(@hp_icon_number_cw *  r, 0, @hp_icon_number_image, nsrc_rect)
  4482.       end
  4483.       cx = (number_value.size * @hp_icon_number_cw)
  4484.       case HP_ICON_NUMBER_ALIGN_TYPE
  4485.          when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4486.          when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4487.          when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4488.       end    
  4489.   end
  4490.  
  4491.   #--------------------------------------------------------------------------
  4492.   # * Can Refresh Icon Number HP
  4493.   #--------------------------------------------------------------------------  
  4494.   def can_refresh_icon_number_hp?
  4495.       return true if @hp_icon_number_old[0] != @actor.hp
  4496.       return true if @hp_icon_number_old[1] != @actor.mhp
  4497.       return false
  4498.   end
  4499.  
  4500.   #--------------------------------------------------------------------------
  4501.   # * Update HP
  4502.   #--------------------------------------------------------------------------    
  4503.   def update_hp
  4504.       if @hp_number != nil
  4505.          if HP_NUMBER_ANIMATION
  4506.             update_number(0,@hp_number_old)
  4507.          else  
  4508.             update_number_fix(0) if @hp_number_old != @actor.hp
  4509.          end
  4510.          sprite_visible(@hp_number)  
  4511.          refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4512.       end
  4513.       if @hp_number2 != nil
  4514.          if HP_NUMBER_ANIMATION
  4515.             update_number(3,@hp_number2_old)
  4516.          else  
  4517.             update_number_fix(3) if @hp_number2_old != @actor.mhp
  4518.          end  
  4519.          refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4520.          sprite_visible(@hp_number2)
  4521.       end
  4522.       if @hp_meter != nil
  4523.          sprite_visible(@hp_meter)
  4524.          update_flow_hp
  4525.       end  
  4526.       if @hp_icon != nil
  4527.          sprite_visible(@hp_icon)
  4528.          refresh_hp_icon if @hp_icon_old != @actor.hp
  4529.       end
  4530.       if @hp_icon3 != nil
  4531.          sprite_visible(@hp_icon3)
  4532.          update_icon_hp_ex_anime
  4533.       end      
  4534.       if @hp_icon_number != nil
  4535.          sprite_visible(@hp_icon_number)
  4536.          refresh_icon_number_hp if can_refresh_icon_number_hp?
  4537.       end  
  4538.   end  
  4539.    
  4540. end
  4541.  
  4542. #==============================================================================
  4543. #==============================================================================
  4544. # ** Battle Hud EX
  4545. #==============================================================================
  4546. #==============================================================================
  4547. class Battle_Hud_EX
  4548.  
  4549.   #--------------------------------------------------------------------------
  4550.   # * Create MP Number
  4551.   #--------------------------------------------------------------------------  
  4552.   def create_mp_number(viewport)
  4553.       return if !MP_NUMBER_VISIBLE
  4554.       @mp_number = Sprite.new
  4555.       @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4556.       @mp_number.z = HUD_Z + MP_NUMBER_Z
  4557.       @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4558.       @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4559.       @mp_number.viewport = viewport
  4560.       @mp_number.opacity = 0
  4561.   end
  4562.  
  4563.   #--------------------------------------------------------------------------
  4564.   # * Create MP Number Max
  4565.   #--------------------------------------------------------------------------  
  4566.   def create_mp_number_max(viewport)
  4567.       return if !MP_NUMBER_MAX_VISIBLE
  4568.       @mp_number2 = Sprite.new
  4569.       @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4570.       @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4571.       @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4572.       @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4573.       @mp_number2.viewport = viewport
  4574.       @mp_number2.opacity = 0
  4575.   end  
  4576.  
  4577.   #--------------------------------------------------------------------------
  4578.   # * Create MP Meter
  4579.   #--------------------------------------------------------------------------    
  4580.   def create_mp_meter(viewport)
  4581.       return if !MP_METER_VISIBLE
  4582.       @mp_flow_max = @mp_meter_cw * 2
  4583.       @mp_flow = rand(@mp_flow_max)
  4584.       @mp_meter = Sprite.new
  4585.       @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4586.       @mp_meter.z = HUD_Z + MP_METER_Z
  4587.       @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4588.       @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4589.       @mp_meter.angle = MP_METER_ANGLE
  4590.       @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4591.       @mp_meter.viewport = viewport
  4592.       @mp_meter.opacity = 0
  4593.   end
  4594.  
  4595.   #--------------------------------------------------------------------------
  4596.   # ● Update Flow MP
  4597.   #--------------------------------------------------------------------------            
  4598.   def update_flow_mp
  4599.       @mp_meter.bitmap.clear
  4600.       @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4601.       meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4602.       meter_width = 0 if meter_width == nil
  4603.       execute_mp_damage_flow(meter_width)      
  4604.       meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4605.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)  
  4606.       @mp_flow += 1
  4607.       @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4608.   end  
  4609.    
  4610.   #--------------------------------------------------------------------------
  4611.   # ● Execute MP Damage Flow
  4612.   #--------------------------------------------------------------------------
  4613.   def execute_mp_damage_flow(meter_width)
  4614.       return if !MP_METER_REDUCTION_ANIMATION
  4615.       return if @mp_old_meter == meter_width
  4616.       n = (@mp_old_meter - meter_width).abs * 3 / 100
  4617.       damage_flow = [[n, 1].min,0.005].max
  4618.       @mp_old_meter -= damage_flow      
  4619.       @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4620.       src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4621.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)      
  4622.   end
  4623.  
  4624.   #--------------------------------------------------------------------------
  4625.   # * Create MP Icon
  4626.   #--------------------------------------------------------------------------  
  4627.   def create_mp_icon(viewport)
  4628.       return if !MP_ICON_VISIBLE
  4629.       @mp_icon = Sprite.new
  4630.       icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4631.       icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4632.       @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4633.       @mp_icon.z = HUD_Z + MP_ICON_Z
  4634.       @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4635.       @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4636.       @mp_icon.viewport = viewport
  4637.       @mp_icon.opacity = 0
  4638.   end
  4639.    
  4640.   #--------------------------------------------------------------------------
  4641.   # * Refresh MP Icon
  4642.   #--------------------------------------------------------------------------    
  4643.   def refresh_mp_icon
  4644.       @mp_icon_old = @actor.mp
  4645.       @mp_icon.bitmap.clear
  4646.       max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4647.       if @actor.mp > max_value
  4648.          icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4649.       else  
  4650.          icon_max = @actor.mmp
  4651.       end      
  4652.       for i in 0...icon_max
  4653.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4654.           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)
  4655.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4656.           i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4657.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )      
  4658.       end      
  4659.       icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4660.       rx = 0
  4661.       ry = 0
  4662.       for i in 0...icon_max
  4663.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4664.           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)
  4665.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4666.           i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4667.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4668.       end
  4669.       refresh_mp_icon_ex(rx,ry)      
  4670.   end
  4671.  
  4672.   #--------------------------------------------------------------------------
  4673.   # * Create MP Icon EX
  4674.   #--------------------------------------------------------------------------  
  4675.   def create_mp_icon_ex(viewport)
  4676.       return if !MP_ICON_EX_VISIBLE
  4677.       @mp_icon3_anime_phase = 0
  4678.       @mp_icon3 = Sprite.new
  4679.       @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4680.       @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4681.       @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4682.       @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4683.       @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4684.                        @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4685.       @mp_icon3.x = @mp_icon3_org[0]
  4686.       @mp_icon3.y = @mp_icon3_org[1]
  4687.       @mp_icon3.viewport = viewport
  4688.       @mp_icon3.opacity = 0
  4689.   end  
  4690.  
  4691.   #--------------------------------------------------------------------------
  4692.   # * Refresh MP Icon EX
  4693.   #--------------------------------------------------------------------------      
  4694.   def refresh_mp_icon_ex(rx,ry)
  4695.       return if @mp_icon3 == nil
  4696.       @mp_icon3.bitmap.clear
  4697.       return if @actor.mp == 0
  4698.       i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4699.       @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4700.       @mp_icon3.x = @mp_icon3_org[0] + rx
  4701.       @mp_icon3.y = @mp_icon3_org[1] + ry    
  4702.   end
  4703.  
  4704.   #--------------------------------------------------------------------------
  4705.   # * Update Icon MP EX Anime
  4706.   #--------------------------------------------------------------------------  
  4707.   def update_icon_mp_ex_anime
  4708.       return if !MP_ICON_EX_ZOOM_EFFECT
  4709.       if @mp_icon3_anime_phase == 0
  4710.          @mp_icon3.zoom_x += 0.01
  4711.          if @mp_icon3.zoom_x >= 1.30
  4712.             @mp_icon3.zoom_x = 1.30
  4713.             @mp_icon3_anime_phase = 1
  4714.          end  
  4715.       else
  4716.         @mp_icon3.zoom_x -= 0.01
  4717.         if @mp_icon3.zoom_x <= 1.05
  4718.            @mp_icon3.zoom_x = 1.05
  4719.            @mp_icon3_anime_phase = 0
  4720.         end  
  4721.       end  
  4722.       @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4723.   end  
  4724.  
  4725.   #--------------------------------------------------------------------------
  4726.   # * Create MP Icon Number
  4727.   #--------------------------------------------------------------------------      
  4728.   def create_mp_icon_number(viewport)
  4729.       return if !MP_ICON_NUMBER_VISIBLE
  4730.       @mp_icon_number_old = [-1,-1]
  4731.       @mp_icon_number = Sprite.new
  4732.       @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4733.       @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4734.       @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4735.       @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4736.       @mp_icon_number.viewport = viewport
  4737.       @mp_icon_number.opacity = 0
  4738.   end
  4739.  
  4740.   #--------------------------------------------------------------------------
  4741.   # * Refresh Icon Number MP
  4742.   #--------------------------------------------------------------------------  
  4743.   def refresh_icon_number_mp
  4744.       @mp_icon_number_old[0] = @actor.mp
  4745.       @mp_icon_number_old[1] = @actor.mmp
  4746.       @mp_icon_number.bitmap.clear
  4747.       value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4748.       value = 0 if value < 0
  4749.       number_value = value.truncate.abs.to_s.split(//)
  4750.       for r in 0..number_value.size - 1        
  4751.          number_value_abs = number_value[r].to_i
  4752.          nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4753.          @mp_icon_number.bitmap.blt(@mp_icon_number_cw *  r, 0, @mp_icon_number_image, nsrc_rect)
  4754.       end
  4755.       cx = (number_value.size * @mp_icon_number_cw)
  4756.       case MP_ICON_NUMBER_ALIGN_TYPE
  4757.          when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4758.          when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4759.          when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4760.       end        
  4761.   end
  4762.  
  4763.   #--------------------------------------------------------------------------
  4764.   # * Can Refresh Icon Number MP
  4765.   #--------------------------------------------------------------------------  
  4766.   def can_refresh_icon_number_mp?
  4767.       return true if @mp_icon_number_old[0] != @actor.mp
  4768.       return true if @mp_icon_number_old[1] != @actor.mmp
  4769.       return false
  4770.   end    
  4771.  
  4772.   #--------------------------------------------------------------------------
  4773.   # * Update MP
  4774.   #--------------------------------------------------------------------------    
  4775.   def update_mp
  4776.       if @mp_number != nil
  4777.          sprite_visible(@mp_number)
  4778.          if MP_NUMBER_ANIMATION
  4779.             update_number(1,@mp_number_old)
  4780.          else
  4781.             update_number_fix(1) if @mp_number_old != @actor.mp
  4782.          end  
  4783.          refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4784.       end
  4785.       if @mp_number2 != nil
  4786.          sprite_visible(@mp_number2)
  4787.          if MP_NUMBER_ANIMATION
  4788.             update_number(4,@mp_number2_old)
  4789.          else
  4790.             update_number_fix(4) if @mp_number2_old != @actor.mmp
  4791.          end  
  4792.          refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4793.       end      
  4794.       if @mp_meter != nil
  4795.          sprite_visible(@mp_meter)
  4796.          update_flow_mp
  4797.       end
  4798.       if @mp_icon != nil
  4799.          sprite_visible(@mp_icon)
  4800.          refresh_mp_icon if @mp_icon_old != @actor.mp
  4801.       end
  4802.       if @mp_icon3 != nil
  4803.          sprite_visible(@mp_icon3)
  4804.          update_icon_mp_ex_anime
  4805.       end          
  4806.       if @mp_icon_number != nil
  4807.          sprite_visible(@mp_icon_number)
  4808.          refresh_icon_number_mp if can_refresh_icon_number_mp?
  4809.       end      
  4810.   end  
  4811.  
  4812. end
  4813.  
  4814. #==============================================================================
  4815. #==============================================================================
  4816. # ** Battle Hud EX
  4817. #==============================================================================
  4818. #==============================================================================
  4819. class Battle_Hud_EX
  4820.  
  4821.   #--------------------------------------------------------------------------
  4822.   # * Create TP Number
  4823.   #--------------------------------------------------------------------------  
  4824.   def create_tp_number(viewport)
  4825.       return if !TP_NUMBER_VISIBLE
  4826.       @tp_number = Sprite.new
  4827.       @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4828.       @tp_number.z = HUD_Z + TP_NUMBER_Z
  4829.       @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4830.       @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4831.       @tp_number.viewport = viewport
  4832.       @tp_number.opacity = 0
  4833.   end
  4834.  
  4835.   #--------------------------------------------------------------------------
  4836.   # * Create TP Number MAX
  4837.   #--------------------------------------------------------------------------  
  4838.   def create_tp_number_max(viewport)
  4839.       return if !TP_NUMBER_MAX_VISIBLE
  4840.       @tp_number2 = Sprite.new
  4841.       @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4842.       @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4843.       @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4844.       @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4845.       @tp_number2.viewport = viewport
  4846.       @tp_number2.opacity = 0
  4847.   end  
  4848.  
  4849.   #--------------------------------------------------------------------------
  4850.   # * Create TP Meter
  4851.   #--------------------------------------------------------------------------    
  4852.   def create_tp_meter(viewport)
  4853.       return if !TP_METER_VISIBLE
  4854.       @tp_flow_max = @tp_meter_cw * 2
  4855.       @tp_flow = rand(@tp_flow_max)
  4856.       @tp_meter = Sprite.new
  4857.       @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4858.       @tp_meter.z = HUD_Z + TP_METER_Z
  4859.       @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4860.       @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4861.       @tp_meter.angle = TP_METER_ANGLE
  4862.       @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4863.       @tp_meter.viewport = viewport
  4864.       @tp_meter.opacity = 0
  4865.   end
  4866.  
  4867.   #--------------------------------------------------------------------------
  4868.   # ● Update Flow TP
  4869.   #--------------------------------------------------------------------------            
  4870.   def update_flow_tp
  4871.       @tp_meter.bitmap.clear      
  4872.       @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4873.       meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil  
  4874.       meter_width = 0 if meter_width == nil
  4875.       execute_tp_damage_flow(meter_width)      
  4876.       meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4877.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)  
  4878.       @tp_flow += 1
  4879.       @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4880.   end  
  4881.    
  4882.   #--------------------------------------------------------------------------
  4883.   # ● Execute TP Damage Flow
  4884.   #--------------------------------------------------------------------------
  4885.   def execute_tp_damage_flow(meter_width)
  4886.       return if !TP_METER_REDUCTION_ANIMATION
  4887.       return if @tp_old_meter == meter_width
  4888.       n = (@tp_old_meter - meter_width).abs * 3 / 100
  4889.       damage_flow = [[n, 2].min,0.5].max
  4890.       @tp_old_meter -= damage_flow
  4891.       @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4892.       src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4893.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)      
  4894.   end
  4895.  
  4896.   #--------------------------------------------------------------------------
  4897.   # * Create TP Icon
  4898.   #--------------------------------------------------------------------------  
  4899.   def create_tp_icon(viewport)
  4900.       return if !TP_ICON_VISIBLE
  4901.       @tp_icon = Sprite.new
  4902.       icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4903.       icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4904.       @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4905.       @tp_icon.z = HUD_Z + TP_ICON_Z
  4906.       @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4907.       @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4908.       @tp_icon.viewport = viewport
  4909.       @tp_icon.opacity = 0
  4910.   end
  4911.    
  4912.   #--------------------------------------------------------------------------
  4913.   # * Refresh TP Icon
  4914.   #--------------------------------------------------------------------------    
  4915.   def refresh_tp_icon
  4916.       @tp_icon_old = @actor.tp
  4917.       @tp_icon.bitmap.clear
  4918.       max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4919.       if @actor.mp > max_value
  4920.          icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4921.       else  
  4922.          icon_max = @actor.max_tp
  4923.       end      
  4924.       for i in 0...icon_max
  4925.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4926.           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)
  4927.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4928.           i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4929.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )      
  4930.       end      
  4931.       icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4932.       rx = 0
  4933.       ry = 0
  4934.       for i in 0...icon_max
  4935.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4936.           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)
  4937.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4938.           i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4939.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4940.       end
  4941.       refresh_tp_icon_ex(rx,ry)      
  4942.   end
  4943.  
  4944.   #--------------------------------------------------------------------------
  4945.   # * Create TP Icon EX
  4946.   #--------------------------------------------------------------------------  
  4947.   def create_tp_icon_ex(viewport)
  4948.       return if !TP_ICON_EX_VISIBLE
  4949.       @tp_icon3_anime_phase = 0
  4950.       @tp_icon3 = Sprite.new
  4951.       @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4952.       @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4953.       @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4954.       @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4955.       @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4956.                        @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4957.       @tp_icon3.x = @tp_icon3_org[0]
  4958.       @tp_icon3.y = @tp_icon3_org[1]
  4959.       @tp_icon3.viewport = viewport
  4960.       @tp_icon3.opacity = 0
  4961.   end  
  4962.  
  4963.   #--------------------------------------------------------------------------
  4964.   # * Refresh TP Icon EX
  4965.   #--------------------------------------------------------------------------      
  4966.   def refresh_tp_icon_ex(rx,ry)
  4967.       return if @tp_icon3 == nil
  4968.       @tp_icon3.bitmap.clear
  4969.       return if @actor.tp == 0
  4970.       i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4971.       @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4972.       @tp_icon3.x = @tp_icon3_org[0] + rx
  4973.       @tp_icon3.y = @tp_icon3_org[1] + ry    
  4974.   end
  4975.  
  4976.   #--------------------------------------------------------------------------
  4977.   # * Update Icon TP EX Anime
  4978.   #--------------------------------------------------------------------------  
  4979.   def update_icon_tp_ex_anime
  4980.       return if !MP_ICON_EX_ZOOM_EFFECT
  4981.       if @tp_icon3_anime_phase == 0
  4982.          @tp_icon3.zoom_x += 0.01
  4983.          if @tp_icon3.zoom_x >= 1.30
  4984.             @tp_icon3.zoom_x = 1.30
  4985.             @tp_icon3_anime_phase = 1
  4986.          end  
  4987.       else
  4988.         @tp_icon3.zoom_x -= 0.01
  4989.         if @tp_icon3.zoom_x <= 1.05
  4990.            @tp_icon3.zoom_x = 1.05
  4991.            @tp_icon3_anime_phase = 0
  4992.         end  
  4993.       end  
  4994.       @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4995.   end    
  4996.  
  4997.   #--------------------------------------------------------------------------
  4998.   # * Create HP Icon Number
  4999.   #--------------------------------------------------------------------------      
  5000.   def create_tp_icon_number(viewport)
  5001.       return if !TP_ICON_NUMBER_VISIBLE
  5002.       @tp_icon_number_old = [-1,-1]
  5003.       @tp_icon_number = Sprite.new
  5004.       @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  5005.       @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  5006.       @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5007.       @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  5008.       @tp_icon_number.viewport = viewport
  5009.       @tp_icon_number.opacity = 0
  5010.   end
  5011.  
  5012.   #--------------------------------------------------------------------------
  5013.   # * Refresh Icon Number TP
  5014.   #--------------------------------------------------------------------------  
  5015.   def refresh_icon_number_tp
  5016.       @tp_icon_number_old[0] = @actor.tp
  5017.       @tp_icon_number_old[1] = @actor.max_tp
  5018.       @tp_icon_number.bitmap.clear
  5019.       value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  5020.       value = 0 if value < 0
  5021.       number_value = value.truncate.abs.to_s.split(//)
  5022.       for r in 0..number_value.size - 1        
  5023.          number_value_abs = number_value[r].to_i
  5024.          nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  5025.          @tp_icon_number.bitmap.blt(@tp_icon_number_cw *  r, 0, @tp_icon_number_image, nsrc_rect)
  5026.       end
  5027.       cx = (number_value.size * @tp_icon_number_cw)
  5028.       case TP_ICON_NUMBER_ALIGN_TYPE
  5029.          when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5030.          when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  5031.          when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  5032.       end        
  5033.   end
  5034.  
  5035.   #--------------------------------------------------------------------------
  5036.   # * Can Refresh Icon Number TP
  5037.   #--------------------------------------------------------------------------  
  5038.   def can_refresh_icon_number_tp?
  5039.       return true if @tp_icon_number_old[0] != @actor.tp
  5040.       return true if @tp_icon_number_old[1] != @actor.max_tp
  5041.       return false
  5042.   end  
  5043.  
  5044.   #--------------------------------------------------------------------------
  5045.   # * Update TP
  5046.   #--------------------------------------------------------------------------    
  5047.   def update_tp
  5048.       if @tp_number != nil
  5049.          sprite_visible(@tp_number)
  5050.          if MP_NUMBER_ANIMATION
  5051.             update_number(2,@tp_number_old)
  5052.          else
  5053.             update_number_fix(2) if @tp_number_old != @actor.tp
  5054.          end          
  5055.          refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh        
  5056.       end    
  5057.       if @tp_number2 != nil
  5058.          sprite_visible(@tp_number2)
  5059.          if MP_NUMBER_ANIMATION
  5060.             update_number(5,@tp_number2_old)
  5061.          else
  5062.             update_number_fix(5) if @tp_number2_old != @actor.max_tp
  5063.          end          
  5064.          refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  5065.       end        
  5066.       if @tp_meter != nil
  5067.          sprite_visible(@tp_meter)
  5068.          update_flow_tp
  5069.       end
  5070.       if @tp_icon != nil
  5071.          sprite_visible(@tp_icon)
  5072.          refresh_tp_icon if @tp_icon_old != @actor.tp
  5073.       end
  5074.       if @tp_icon3 != nil
  5075.          sprite_visible(@tp_icon3)
  5076.          update_icon_tp_ex_anime
  5077.       end        
  5078.       if @tp_icon_number != nil
  5079.          sprite_visible(@tp_icon_number)
  5080.          refresh_icon_number_tp if can_refresh_icon_number_tp?
  5081.       end  
  5082.   end  
  5083.  
  5084. end
  5085.  
  5086. #==============================================================================
  5087. #==============================================================================
  5088. # ** Battle Hud EX
  5089. #==============================================================================
  5090. #==============================================================================
  5091. class Battle_Hud_EX
  5092.  
  5093.   #--------------------------------------------------------------------------
  5094.   # * Create AT Number
  5095.   #--------------------------------------------------------------------------  
  5096.   def create_at_number(viewport)
  5097.       return if !AT_NUMBER_VISIBLE
  5098.       @at_number = Sprite.new
  5099.       @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  5100.       @at_number.z = HUD_Z + AT_NUMBER_Z
  5101.       @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  5102.       @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  5103.       @at_number.viewport = viewport
  5104.       @at_number.opacity = 0
  5105.   end
  5106.  
  5107.   #--------------------------------------------------------------------------
  5108.   # * Create AT Number Max
  5109.   #--------------------------------------------------------------------------  
  5110.   def create_at_number_max(viewport)
  5111.       return if !AT_NUMBER_MAX_VISIBLE
  5112.       @at_number2 = Sprite.new
  5113.       @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  5114.       @at_number2.z = HUD_Z + AT_NUMBER_Z
  5115.       @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  5116.       @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  5117.       @at_number2.viewport = viewport
  5118.       @at_number2.opacity = 0
  5119.   end  
  5120.  
  5121.   #--------------------------------------------------------------------------
  5122.   # * Create AT Meter
  5123.   #--------------------------------------------------------------------------    
  5124.   def create_at_meter(viewport)
  5125.       return if !AT_METER_VISIBLE
  5126.       @at_flow_max = @at_meter_cw * 2
  5127.       @at_flow = rand(@at_flow_max)
  5128.       @at_meter = Sprite.new
  5129.       @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  5130.       @at_meter.z = HUD_Z + AT_METER_Z
  5131.       @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  5132.       @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  5133.       @at_meter.angle = AT_METER_ANGLE
  5134.       @at_meter.mirror = AT_METER_MIRROR_EFFECT
  5135.       @at_meter.viewport = viewport
  5136.       @at_meter.opacity = 0
  5137.   end
  5138.  
  5139.   #--------------------------------------------------------------------------
  5140.   # ● Update Flow AT
  5141.   #--------------------------------------------------------------------------            
  5142.   def update_flow_at
  5143.       @at_meter.bitmap.clear
  5144.       @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  5145.       if actor_cast?
  5146.          meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  5147.          meter_width = 0 if meter_width == nil
  5148.          ch = @at_meter_ch * 2
  5149.       else
  5150.          meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  5151.          meter_width = 0 if meter_width == nil        
  5152.          ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  5153.       end  
  5154.       meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  5155.       @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)  
  5156.       @at_flow += 1
  5157.       @at_flow = 0 if @at_flow >= @at_flow_max
  5158.   end  
  5159.  
  5160.   #--------------------------------------------------------------------------
  5161.   # * Update AT
  5162.   #--------------------------------------------------------------------------    
  5163.   def update_at
  5164.       if @at_number != nil
  5165.          sprite_visible(@at_number)
  5166.          if AT_NUMBER_ANIMATION
  5167.             update_number(6,@at_number_old)
  5168.          else  
  5169.             update_number_fix(6) if @at_number_old != actor_at
  5170.          end  
  5171.          refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5172.       end
  5173.       if @at_number2 != nil
  5174.          sprite_visible(@at_number2)
  5175.          if AT_NUMBER_ANIMATION
  5176.             update_number(7,@at_number2_old)
  5177.          else  
  5178.             update_number_fix(7) if @at_number2_old != actor_max_at
  5179.          end  
  5180.          refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5181.       end
  5182.       if @at_meter != nil
  5183.          sprite_visible(@at_meter)
  5184.          update_flow_at
  5185.       end  
  5186.   end  
  5187.    
  5188. end
  5189.  
  5190. #==============================================================================
  5191. #==============================================================================
  5192. # ** Battle Hud EX
  5193. #==============================================================================
  5194. #==============================================================================
  5195. class Battle_Hud_EX
  5196.  
  5197.   #--------------------------------------------------------------------------
  5198.   # * Create Level Number
  5199.   #--------------------------------------------------------------------------    
  5200.   def create_level_number(viewport)
  5201.       return if !LEVEL_NUMBER_VISIBLE
  5202.       @old_level = -1
  5203.       @lv_number = Sprite.new
  5204.       @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5205.       @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5206.       @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5207.       @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5208.       @lv_number.viewport = viewport
  5209.       @lv_number.opacity = 0
  5210.   end
  5211.  
  5212.   #--------------------------------------------------------------------------
  5213.   # * Refresh Level Number
  5214.   #--------------------------------------------------------------------------  
  5215.   def refresh_level_number
  5216.       @lv_number.bitmap.clear
  5217.       @old_level = @actor.level      
  5218.       number_value = @actor.level.abs.to_s.split(//)
  5219.       for r in 0..number_value.size - 1        
  5220.          number_value_abs = number_value[r].to_i
  5221.          nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5222.          @lv_number.bitmap.blt(@lv_number_cw *  r, 0, @lv_number_image, nsrc_rect)
  5223.       end
  5224.       cx = (number_value.size * @lv_number_cw)
  5225.       case LEVEL_NUMBER_ALIGN_TYPE
  5226.            when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5227.            when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5228.            when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5229.       end
  5230.   end
  5231.  
  5232.   #--------------------------------------------------------------------------
  5233.   # * Update Level
  5234.   #--------------------------------------------------------------------------  
  5235.   def update_level
  5236.       return if @lv_number == nil
  5237.       sprite_visible(@lv_number)
  5238.       refresh_level_number if @old_level != @actor.level
  5239.   end
  5240.  
  5241. end
  5242.  
  5243. #==============================================================================
  5244. #==============================================================================
  5245. # ** Battle Hud EX
  5246. #==============================================================================
  5247. #==============================================================================
  5248. class Battle_Hud_EX
  5249.  
  5250.   #--------------------------------------------------------------------------
  5251.   # * Create States
  5252.   #--------------------------------------------------------------------------  
  5253.   def create_states(viewport)
  5254.       return if !STATES_VISIBLE
  5255.       @status_old = nil
  5256.       @status_flow = [-24,0]
  5257.       @status_size_real = 0
  5258.       @status = Sprite.new
  5259.       @status.bitmap = Bitmap.new(24,24)
  5260.       @status.x = @hud_position[0] + STATES_POSITION[0]
  5261.       @status.y = @hud_position[1] + STATES_POSITION[1]
  5262.       @status.z = HUD_Z + STATES_Z
  5263.       @status.angle = STATE_ANGLE
  5264.       @status.viewport = viewport
  5265.       @status.opacity = 0
  5266.   end
  5267.  
  5268.   #--------------------------------------------------------------------------
  5269.   # * Refresh States
  5270.   #--------------------------------------------------------------------------        
  5271.   def refresh_states
  5272.       check_icon_image
  5273.       @status_size_real = set_real_states_size
  5274.       @status_old = @actor.states
  5275.       @status_flow = [0,0]
  5276.       @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5277.       @actor_status.dispose if @actor_status != nil
  5278.       @actor_status = Bitmap.new(@states_size,24)
  5279.       index = 0
  5280.       for i in @actor.states
  5281.          next if HIDE_STATES_ID.include?(i.id)        
  5282.          rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5283.          @actor_status.blt(26 * index , 0, @icon_image, rect)
  5284.          index += 1
  5285.       end
  5286.   end  
  5287.  
  5288.   #--------------------------------------------------------------------------
  5289.   # * Set Real States Size
  5290.   #--------------------------------------------------------------------------        
  5291.   def set_real_states_size
  5292.       n = 0
  5293.       for i in @actor.states
  5294.           next if HIDE_STATES_ID.include?(i.id)  
  5295.           n += 1
  5296.       end
  5297.       return n
  5298.   end
  5299.  
  5300.   #--------------------------------------------------------------------------
  5301.   # * Flow_Status
  5302.   #--------------------------------------------------------------------------          
  5303.   def flow_states
  5304.       return if @actor_status == nil
  5305.       @status.bitmap.clear
  5306.       return if @actor.states.size == 0
  5307.       st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5308.       @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5309.       if STATES_SCROLLING_ANIMATION
  5310.          @status_flow[0] += 1
  5311.          @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5312.       else  
  5313.          @status_flow[1] += 1 unless @actor.states.size <= 1
  5314.          if @status_flow[1] > 30
  5315.             @status_flow[1] = 0
  5316.             @status_flow[0] += 26
  5317.             @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5318.          end  
  5319.      end  
  5320.   end      
  5321.  
  5322.   #--------------------------------------------------------------------------
  5323.   # * Update States
  5324.   #--------------------------------------------------------------------------  
  5325.   def update_states
  5326.       return if @status == nil
  5327.       sprite_visible(@status)
  5328.       refresh_states if @status_old != @actor.states
  5329.       flow_states
  5330.   end  
  5331.  
  5332. end
  5333. #==============================================================================
  5334. #==============================================================================
  5335. # ** Battle Hud EX
  5336. #==============================================================================
  5337. #==============================================================================
  5338. class Battle_Hud_EX
  5339.  
  5340.   #--------------------------------------------------------------------------
  5341.   # * Create Face
  5342.   #--------------------------------------------------------------------------    
  5343.   def create_face(viewport)
  5344.       return if !FACE_VISIBLE
  5345.       @face_old_hp = @actor.hp
  5346.       @face_old_mp = @actor.mp
  5347.       @face_old_tp = @actor.tp
  5348.       @face_name = ""
  5349.       @face = Sprite.new
  5350.       @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5351.       @face.x = @face_org[0]
  5352.       @face.y = @face_org[1]
  5353.       @face.z = HUD_Z + FACE_Z
  5354.       @face.viewport = viewport
  5355.       @face.opacity = 0
  5356.       refresh_face_name
  5357.   end
  5358.  
  5359.   #--------------------------------------------------------------------------
  5360.   # * Refresh Face Name
  5361.   #--------------------------------------------------------------------------      
  5362.   def refresh_face_name      
  5363.       @face_image.dispose if @face_image != nil
  5364.       @face.bitmap.dispose if @face.bitmap != nil
  5365.       return if @actor == nil or @actor.id == nil
  5366.       @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5367.       @face_image = Bitmap.new(32,32) if @face_image == nil
  5368.       @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5369.       @face_ch = @face_image.height
  5370.       @face.ox = @face_cw / 2
  5371.       @face.oy = @face_ch / 2      
  5372.       @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5373.       @face_org = [@hud_position[0] + FACE_POSITION[0],
  5374.                    @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5375.       if $game_temp.battler_face_pos[@actor_index] == nil
  5376.          $game_temp.battler_face_pos[@actor_index] = []
  5377.       end
  5378.       @face.x = @face_org[0]
  5379.       @face.y = @face_org[1]  
  5380.       limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5381.       fy = @face_org[1]
  5382.       if limit_Y > Graphics.height
  5383.          @face.y = Graphics.height - (@face_image.height - @face.oy)
  5384.          fy = Graphics.height - 16
  5385.          @face_org[1] = @face.y
  5386.       end
  5387.       $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5388.       $game_temp.battler_face_pos[@actor_index][1] = fy
  5389.       $game_temp.battler_face_pos[@actor_index][2] = @face.z    
  5390.       clear_face_index
  5391.   end
  5392.  
  5393.   #--------------------------------------------------------------------------
  5394.   # * Refresh Face
  5395.   #--------------------------------------------------------------------------  
  5396.   def refresh_face
  5397.       @face.mirror = false
  5398.       @face.zoom_x = 1.00
  5399.       @face.zoom_y = 1.00
  5400.       @face_index = @actor.face_animation[1]
  5401.       @face.bitmap.clear
  5402.       if !FACE_ANIMATION
  5403.          f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5404.       else
  5405.          f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5406.       end
  5407.       @face.bitmap.blt(0,0,@face_image,f_scr)
  5408.   end
  5409.    
  5410.   #--------------------------------------------------------------------------
  5411.   # * Update Face Duration
  5412.   #--------------------------------------------------------------------------    
  5413.   def update_face_duration
  5414.       return if @actor.face_animation[0] == 0
  5415.       @actor.face_animation[0] -= 1
  5416.       update_face_shake_effect
  5417.       update_face_zoom if @actor.face_animation[1] == 2
  5418.       return if @actor.face_animation[0] > 0
  5419.       clear_face_index
  5420.   end
  5421.  
  5422.   #--------------------------------------------------------------------------
  5423.   # * Clear Face Index
  5424.   #--------------------------------------------------------------------------      
  5425.   def clear_face_index
  5426.       @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5427.       @actor.face_animation[1] = 4 if @actor.dead?
  5428.       refresh_face
  5429.   end
  5430.      
  5431.   #--------------------------------------------------------------------------
  5432.   # * Update Face Zoom
  5433.   #--------------------------------------------------------------------------      
  5434.   def update_face_zoom
  5435.       return if !FACE_ZOOM_ANIMATION
  5436.       case @actor.face_animation[0]
  5437.          when 30..60
  5438.             @face.zoom_x += 0.01
  5439.             @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5440.             @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5441.          when 1..29
  5442.             @face.zoom_x -= 0.01
  5443.             @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5444.             @face.mirror = false
  5445.          else
  5446.             @face.zoom_x = 1.00
  5447.             @face.mirror = false
  5448.       end
  5449.       @face.zoom_y = @face.zoom_x
  5450.   end
  5451.  
  5452.   #--------------------------------------------------------------------------
  5453.   # * Can Refresh Index MP TP?
  5454.   #--------------------------------------------------------------------------    
  5455.   def can_refresh_index_mp_tp?
  5456.       return true if @face_old_mp != @actor.mp
  5457.       return false
  5458.   end
  5459.  
  5460.   #--------------------------------------------------------------------------
  5461.   # * Refresh Face Index HP
  5462.   #--------------------------------------------------------------------------  
  5463.   def refresh_face_index_hp
  5464.       @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5465.       @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5466.       @face_old_hp = @actor.hp
  5467.   end
  5468.  
  5469.   #--------------------------------------------------------------------------
  5470.   # * Refresh Face Index MP TP
  5471.   #--------------------------------------------------------------------------  
  5472.   def refresh_face_index_mp_tp
  5473.       if @face_old_mp < @actor.mp
  5474.          @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5475.          @actor.face_animation[1] = 1
  5476.       end
  5477.       @face_old_mp = @actor.mp
  5478.       @face_old_tp = @actor.tp
  5479.   end  
  5480.  
  5481.   #--------------------------------------------------------------------------
  5482.   # * Update Face Shake Effect
  5483.   #--------------------------------------------------------------------------  
  5484.   def update_face_shake_effect
  5485.       return if !FACE_SHAKE_EFFECT
  5486.       if FACE_ANIMATION
  5487.          update_shake_animated_face
  5488.       else            
  5489.          update_shake_still_face
  5490.       end  
  5491.   end      
  5492.  
  5493.   #--------------------------------------------------------------------------
  5494.   # * Update Shake Still Effect Face
  5495.   #--------------------------------------------------------------------------    
  5496.   def update_shake_still_face
  5497.       if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5498.          @face.x = @face_org[0] - 4 + rand(8)
  5499.       else
  5500.          @face.x = @face_org[0]
  5501.       end    
  5502.   end
  5503.      
  5504.   #--------------------------------------------------------------------------
  5505.   # * Update Shake Animated Face
  5506.   #--------------------------------------------------------------------------    
  5507.   def update_shake_animated_face
  5508.       if @actor.face_animation[0] == 0
  5509.          @face.x = @face_org[0]
  5510.          return
  5511.       end
  5512.       if @actor.face_animation[1] == 3 and @actor.hp > 0
  5513.          @face.x = @face_org[0] - 4 + rand(8)
  5514.       else
  5515.          @face.x = @face_org[0]
  5516.       end        
  5517.   end
  5518.  
  5519.   #--------------------------------------------------------------------------
  5520.   # * Update Face
  5521.   #--------------------------------------------------------------------------  
  5522.   def update_face
  5523.       return if @face == nil
  5524.       sprite_visible(@face)
  5525.       refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5526.       update_face_duration
  5527.       return if !FACE_ANIMATION
  5528.       refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5529.       refresh_face_index_hp if @face_old_hp != @actor.hp
  5530.       refresh_face if @face_index != @actor.face_animation[1]
  5531.   end  
  5532.  
  5533. end
  5534.  
  5535. #==============================================================================
  5536. # ■ Battle Manager
  5537. #==============================================================================
  5538. class << BattleManager
  5539.  
  5540.   #--------------------------------------------------------------------------
  5541.   # ● Battle End
  5542.   #--------------------------------------------------------------------------                    
  5543.   alias mog_battle_hud_battle_process_victory process_victory
  5544.   def process_victory
  5545.       execute_face_effect_end
  5546.       mog_battle_hud_battle_process_victory
  5547.   end
  5548.  
  5549.   #--------------------------------------------------------------------------
  5550.   # ● Execute Face Effect End
  5551.   #--------------------------------------------------------------------------                  
  5552.   def execute_face_effect_end
  5553.       $game_temp.battle_end = true
  5554.       for i in $game_party.members
  5555.           i.face_animation = [120,1,0] if i.hp > 0  
  5556.       end  
  5557.   end
  5558.  
  5559.   #--------------------------------------------------------------------------
  5560.   # * Display EXP Earned
  5561.   #--------------------------------------------------------------------------
  5562.   alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5563.   def process_defeat
  5564.       $game_temp.battle_end = true
  5565.       mog_battle_hud_ex_message_battle_process_defeat
  5566.   end
  5567.  
  5568.   #--------------------------------------------------------------------------
  5569.   # * Process Abort
  5570.   #--------------------------------------------------------------------------
  5571.   alias mog_battle_hud_ex_process_abort process_abort
  5572.   def process_abort
  5573.       $game_temp.battle_end = true
  5574.       mog_battle_hud_ex_process_abort
  5575.   end  
  5576.  
  5577. end
  5578.  
  5579. #==============================================================================
  5580. # ** Scene Battle
  5581. #==============================================================================
  5582. class Scene_Battle < Scene_Base
  5583.  
  5584.   #--------------------------------------------------------------------------
  5585.   # * Use Item
  5586.   #--------------------------------------------------------------------------      
  5587.   alias mog_monogatari_use_item use_item
  5588.   def use_item
  5589.       execute_face_animation
  5590.       mog_monogatari_use_item
  5591.   end
  5592.  
  5593.   #--------------------------------------------------------------------------
  5594.   # * Execute Face Animation
  5595.   #--------------------------------------------------------------------------  
  5596.   def execute_face_animation
  5597.       return if @subject.is_a?(Game_Enemy)
  5598.       @subject.face_animation = [60 ,2,0]  
  5599.   end
  5600.    
  5601. end
  5602.  
  5603. #==============================================================================
  5604. #==============================================================================
  5605. # ** Battle Hud EX
  5606. #==============================================================================
  5607. #==============================================================================
  5608. class Battle_Hud_EX
  5609.  
  5610.   #--------------------------------------------------------------------------
  5611.   # * Dispose
  5612.   #--------------------------------------------------------------------------  
  5613.   def dispose
  5614.       terminate
  5615.       dispose_layout
  5616.       dispose_layout_2
  5617.       dispose_name
  5618.       dispose_face
  5619.       dispose_hp_number
  5620.       dispose_hp_number_max
  5621.       dispose_hp_meter
  5622.       dispose_hp_icon
  5623.       dispose_hp_icon_ex
  5624.       dispose_hp_icon_number
  5625.       dispose_mp_number
  5626.       dispose_mp_number_max
  5627.       dispose_mp_meter
  5628.       dispose_mp_icon
  5629.       dispose_mp_icon_ex
  5630.       dispose_mp_icon_number
  5631.       dispose_tp_number
  5632.       dispose_tp_number_max
  5633.       dispose_tp_meter
  5634.       dispose_tp_icon
  5635.       dispose_tp_icon_ex
  5636.       dispose_tp_icon_number
  5637.       dispose_at_number
  5638.       dispose_at_number_max
  5639.       dispose_at_meter      
  5640.       dispose_lv_number
  5641.       dispose_states
  5642.   end
  5643.  
  5644.   #--------------------------------------------------------------------------
  5645.   # * Dispose Layout
  5646.   #--------------------------------------------------------------------------  
  5647.   def dispose_layout
  5648.       return if @layout == nil
  5649.       @layout.dispose
  5650.       @layout = nil
  5651.   end
  5652.  
  5653.   #--------------------------------------------------------------------------
  5654.   # * Dispose Layout 2
  5655.   #--------------------------------------------------------------------------  
  5656.   def dispose_layout_2
  5657.       return if @layout2 == nil
  5658.       @layout2.dispose
  5659.       @layout2 = nil
  5660.   end  
  5661.  
  5662.   #--------------------------------------------------------------------------
  5663.   # * Dispose Name
  5664.   #--------------------------------------------------------------------------          
  5665.   def dispose_name
  5666.       return if @name == nil
  5667.       @name.bitmap.dispose
  5668.       @name.dispose
  5669.       @name = nil
  5670.   end  
  5671.  
  5672.   #--------------------------------------------------------------------------
  5673.   # * Dispose Face
  5674.   #--------------------------------------------------------------------------        
  5675.   def dispose_face
  5676.       return if @face == nil      
  5677.       @face.bitmap.dispose if @face.bitmap != nil    
  5678.       @face.dispose
  5679.       @face = nil
  5680.       @face_image.dispose if @face_image != nil
  5681.   end  
  5682.  
  5683.   #--------------------------------------------------------------------------
  5684.   # * Dispose HP Number
  5685.   #--------------------------------------------------------------------------    
  5686.   def dispose_hp_number
  5687.       return if @hp_number == nil
  5688.       @hp_number.bitmap.dispose
  5689.       @hp_number.dispose
  5690.       @hp_number = nil
  5691.   end
  5692.  
  5693.   #--------------------------------------------------------------------------
  5694.   # * Dispose HP Number Max
  5695.   #--------------------------------------------------------------------------    
  5696.   def dispose_hp_number_max
  5697.       return if @hp_number2 == nil
  5698.       @hp_number2.bitmap.dispose
  5699.       @hp_number2.dispose
  5700.       @hp_number2 = nil
  5701.   end    
  5702.  
  5703.   #--------------------------------------------------------------------------
  5704.   # * Dispose HP Meter
  5705.   #--------------------------------------------------------------------------    
  5706.   def dispose_hp_meter
  5707.       return if @hp_meter == nil
  5708.       @hp_meter.bitmap.dispose
  5709.       @hp_meter.dispose
  5710.       @hp_meter = nil
  5711.   end  
  5712.  
  5713.   #--------------------------------------------------------------------------
  5714.   # * Dispose HP Icon
  5715.   #--------------------------------------------------------------------------      
  5716.   def dispose_hp_icon
  5717.       return if @hp_icon == nil
  5718.       @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5719.       @hp_icon.dispose
  5720.       @hp_icon = nil
  5721.   end    
  5722.  
  5723.   #--------------------------------------------------------------------------
  5724.   # * Dispose HP Icon EX
  5725.   #--------------------------------------------------------------------------      
  5726.   def dispose_hp_icon_ex
  5727.       return if @hp_icon3 == nil
  5728.       @hp_icon3.bitmap.dispose
  5729.       @hp_icon3.dispose
  5730.       @hp_icon3 = nil
  5731.   end      
  5732.  
  5733.   #--------------------------------------------------------------------------
  5734.   # * Dispose HP Icon Number
  5735.   #--------------------------------------------------------------------------  
  5736.   def dispose_hp_icon_number
  5737.       return if @hp_icon_number == nil
  5738.       @hp_icon_number.bitmap.dispose
  5739.       @hp_icon_number.dispose
  5740.       @hp_icon_number = nil
  5741.   end    
  5742.  
  5743.   #--------------------------------------------------------------------------
  5744.   # * Dispose MP Number
  5745.   #--------------------------------------------------------------------------    
  5746.   def dispose_mp_number
  5747.       return if @mp_number == nil
  5748.       @mp_number.bitmap.dispose
  5749.       @mp_number.dispose
  5750.       @mp_number = nil
  5751.   end    
  5752.  
  5753.   #--------------------------------------------------------------------------
  5754.   # * Dispose MP Number Max
  5755.   #--------------------------------------------------------------------------    
  5756.   def dispose_mp_number_max
  5757.       return if @mp_number2 == nil
  5758.       @mp_number2.bitmap.dispose
  5759.       @mp_number2.dispose
  5760.       @mp_number2 = nil
  5761.   end  
  5762.  
  5763.   #--------------------------------------------------------------------------
  5764.   # * Dispose MP Meter
  5765.   #--------------------------------------------------------------------------    
  5766.   def dispose_mp_meter
  5767.       return if @mp_meter == nil
  5768.       @mp_meter.bitmap.dispose
  5769.       @mp_meter.dispose
  5770.       @mp_meter = nil
  5771.   end    
  5772.  
  5773.   #--------------------------------------------------------------------------
  5774.   # * Dispose MP Icon
  5775.   #--------------------------------------------------------------------------      
  5776.   def dispose_mp_icon
  5777.       return if @mp_icon == nil
  5778.       @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5779.       @mp_icon.dispose
  5780.       @mp_icon = nil
  5781.   end    
  5782.  
  5783.   #--------------------------------------------------------------------------
  5784.   # * Dispose MP Icon EX
  5785.   #--------------------------------------------------------------------------      
  5786.   def dispose_mp_icon_ex
  5787.       return if @mp_icon3 == nil
  5788.       @mp_icon3.bitmap.dispose
  5789.       @mp_icon3.dispose
  5790.       @mp_icon3 = nil
  5791.   end        
  5792.  
  5793.   #--------------------------------------------------------------------------
  5794.   # * Dispose MP Icon Number
  5795.   #--------------------------------------------------------------------------  
  5796.   def dispose_mp_icon_number
  5797.       return if @mp_icon_number == nil
  5798.       @mp_icon_number.bitmap.dispose
  5799.       @mp_icon_number.dispose
  5800.       @mp_icon_number = nil
  5801.   end  
  5802.    
  5803.   #--------------------------------------------------------------------------
  5804.   # * Dispose TP Number
  5805.   #--------------------------------------------------------------------------    
  5806.   def dispose_tp_number
  5807.       return if @tp_number == nil
  5808.       @tp_number.bitmap.dispose
  5809.       @tp_number.dispose
  5810.       @tp_number = nil
  5811.   end
  5812.  
  5813.   #--------------------------------------------------------------------------
  5814.   # * Dispose TP Number Max
  5815.   #--------------------------------------------------------------------------    
  5816.   def dispose_tp_number_max
  5817.       return if @tp_number2 == nil
  5818.       @tp_number2.bitmap.dispose
  5819.       @tp_number2.dispose
  5820.       @tp_number2 = nil
  5821.   end  
  5822.  
  5823.   #--------------------------------------------------------------------------
  5824.   # * Dispose TP Meter
  5825.   #--------------------------------------------------------------------------    
  5826.   def dispose_tp_meter
  5827.       return if @tp_meter == nil
  5828.       @tp_meter.bitmap.dispose
  5829.       @tp_meter.dispose
  5830.       @tp_meter = nil
  5831.   end    
  5832.  
  5833.   #--------------------------------------------------------------------------
  5834.   # * Dispose TP Icon
  5835.   #--------------------------------------------------------------------------      
  5836.   def dispose_tp_icon
  5837.       return if @tp_icon == nil
  5838.       @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5839.       @tp_icon.dispose
  5840.       @tp_icon = nil
  5841.   end    
  5842.  
  5843.   #--------------------------------------------------------------------------
  5844.   # * Dispose TP Icon EX
  5845.   #--------------------------------------------------------------------------      
  5846.   def dispose_tp_icon_ex
  5847.       return if @tp_icon3 == nil
  5848.       @tp_icon3.bitmap.dispose
  5849.       @tp_icon3.dispose
  5850.       @tp_icon3 = nil
  5851.   end  
  5852.  
  5853.   #--------------------------------------------------------------------------
  5854.   # * Dispose TP Icon Number
  5855.   #--------------------------------------------------------------------------  
  5856.   def dispose_tp_icon_number
  5857.       return if @tp_icon_number == nil
  5858.       @tp_icon_number.bitmap.dispose
  5859.       @tp_icon_number.dispose
  5860.       @tp_icon_numbe = nil
  5861.   end    
  5862.  
  5863.   #--------------------------------------------------------------------------
  5864.   # * Dispose AT Number
  5865.   #--------------------------------------------------------------------------    
  5866.   def dispose_at_number
  5867.       return if @at_number == nil
  5868.       @at_number.bitmap.dispose
  5869.       @at_number.dispose
  5870.       @at_number = nil
  5871.   end
  5872.  
  5873.   #--------------------------------------------------------------------------
  5874.   # * Dispose AT Number Max
  5875.   #--------------------------------------------------------------------------    
  5876.   def dispose_at_number_max
  5877.       return if @at_number2 == nil
  5878.       @at_number2.bitmap.dispose
  5879.       @at_number2.dispose
  5880.       @at_number2 = nil
  5881.   end    
  5882.  
  5883.   #--------------------------------------------------------------------------
  5884.   # * Dispose AT Meter
  5885.   #--------------------------------------------------------------------------    
  5886.   def dispose_at_meter
  5887.       return if @at_meter == nil
  5888.       @at_meter.bitmap.dispose
  5889.       @at_meter.dispose
  5890.       @at_meter = nil
  5891.   end    
  5892.  
  5893.   #--------------------------------------------------------------------------
  5894.   # * Dispose Lv Number
  5895.   #--------------------------------------------------------------------------    
  5896.   def dispose_lv_number
  5897.       return if @lv_number == nil
  5898.       @lv_number.bitmap.dispose
  5899.       @lv_number.dispose
  5900.       @lv_number = nil
  5901.   end
  5902.  
  5903.   #--------------------------------------------------------------------------
  5904.   # * Dispose States
  5905.   #--------------------------------------------------------------------------      
  5906.   def dispose_states
  5907.       return if @status == nil
  5908.       @status.bitmap.dispose if @status.bitmap != nil
  5909.       @status.dispose
  5910.       @actor_status.dispose if @actor_status != nil
  5911.       @status = nil
  5912.     end
  5913.  
  5914. end
  5915.  
  5916. #==============================================================================
  5917. #==============================================================================
  5918. # ** Battle Hud EX
  5919. #==============================================================================
  5920. #==============================================================================
  5921. class Battle_Hud_EX
  5922.  
  5923.  #--------------------------------------------------------------------------
  5924.  # * Refresh Visible
  5925.  #--------------------------------------------------------------------------  
  5926.  def refresh_visible(vis)
  5927.      @layout.visible = vis if @layout
  5928.      @layout2.visible = vis if @layout2
  5929.      @name.visible = vis if @name
  5930.      @lv_number.visible = vis if @lv_number
  5931.      @status.visible = vis if @status
  5932.      @face.visible = vis if @face    
  5933.      @hp_number.visible = vis if @hp_number
  5934.      @hp_number2.visible = vis if @hp_number2
  5935.      @hp_meter.visible = vis if @hp_meter
  5936.      @hp_icon.visible = vis if @hp_icon
  5937.      @hp_icon3.visible = vis if @hp_icon3
  5938.      @hp_icon_number.visible = vis if @hp_icon_number    
  5939.      @mp_number.visible = vis if @mp_number
  5940.      @mp_number2.visible = vis if @mp_number2
  5941.      @mp_meter.visible = vis if @mp_meter
  5942.      @mp_icon.visible = vis if @mp_icon
  5943.      @mp_icon3.visible = vis if @mp_icon3
  5944.      @mp_icon_number.visible = vis if @mp_icon_number
  5945.      @tp_number.visible = vis if @tp_number
  5946.      @tp_number2.visible = vis if @tp_number2
  5947.      @tp_meter.visible = vis if @tp_meter
  5948.      @tp_icon.visible = vis if @tp_icon
  5949.      @tp_icon3.visible = vis if @tp_icon3
  5950.      @tp_icon_number.visible = vis if @tp_icon_number      
  5951.      @at_number.visible = vis if @at_number
  5952.      @at_number2.visible = vis if @at_number2
  5953.      @at_meter.visible = vis if @at_meter    
  5954.   end  
  5955.  
  5956.   #--------------------------------------------------------------------------
  5957.   # * Update
  5958.   #--------------------------------------------------------------------------  
  5959.   def update
  5960.       return if @actor == nil
  5961.       @sprite_visible = sprite_visible?
  5962.       @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5963.       update_layout ; update_layout_2 ; update_name
  5964.       update_face ; update_hp ; update_mp ; update_tp
  5965.       update_at ; update_level ; update_states
  5966.   end
  5967.  
  5968. end
  5969.  
  5970. #==============================================================================
  5971. # ■ Sprite Battler
  5972. #==============================================================================
  5973. class Sprite_Battler < Sprite_Base
  5974.  
  5975.   #--------------------------------------------------------------------------
  5976.   # ● Set AV
  5977.   #--------------------------------------------------------------------------      
  5978.   def set_av(a_viewport)
  5979.       @viewport_cm = a_viewport
  5980.   end
  5981.  
  5982.   #--------------------------------------------------------------------------
  5983.   # ● Dispose
  5984.   #--------------------------------------------------------------------------      
  5985.   alias mog_bc_dispose dispose
  5986.   def dispose
  5987.       mog_bc_dispose
  5988.       @viewport_cm.dispose if @viewport_cm != nil
  5989.   end
  5990.  
  5991.   #--------------------------------------------------------------------------
  5992.   # ● Maker Animation Sprites
  5993.   #--------------------------------------------------------------------------      
  5994.   alias mog_bc_make_animation_sprites make_animation_sprites
  5995.   def make_animation_sprites
  5996.       mog_bc_make_animation_sprites
  5997.       set_cm_viewport if $imported[:mog_battle_camera]
  5998.   end
  5999.  
  6000.   #--------------------------------------------------------------------------
  6001.   # ● Set CM Viewpor
  6002.   #--------------------------------------------------------------------------      
  6003.   def set_cm_viewport
  6004.       return if @viewport_cm == nil
  6005.       return if @ani_sprites == nil
  6006.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  6007.          @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  6008.          return
  6009.       end
  6010.       @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  6011.   end
  6012.    
  6013. end
  6014.  
  6015. #==============================================================================
  6016. # ■ Game Temp
  6017. #==============================================================================
  6018. class Spriteset_Battle
  6019.  
  6020.   #--------------------------------------------------------------------------
  6021.   # ● Initialize
  6022.   #--------------------------------------------------------------------------      
  6023.   alias mog_bc_sp_initialize initialize
  6024.   def initialize
  6025.       mog_bc_sp_initialize
  6026.       if $imported[:mog_battle_camera] and @viewport_cm != nil
  6027.          battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  6028.       end
  6029.   end
  6030.  
  6031.   #--------------------------------------------------------------------------
  6032.   # ● Create Viewports
  6033.   #--------------------------------------------------------------------------      
  6034.   alias mog_bc_create_viewports create_viewports
  6035.   def create_viewports
  6036.       mog_bc_create_viewports
  6037.       if $imported[:mog_battle_camera]
  6038.          @viewport_cm = Viewport.new
  6039.          @viewport_cm.z = 100
  6040.       end  
  6041.   end
  6042.  
  6043.   #--------------------------------------------------------------------------
  6044.   # ● Dispose Viewports
  6045.   #--------------------------------------------------------------------------      
  6046.   alias mog_bc_dispose_viewports dispose_viewports
  6047.   def dispose_viewports
  6048.       mog_bc_dispose_viewports
  6049.       @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  6050.   end
  6051.  
  6052.   #--------------------------------------------------------------------------
  6053.   # ● Update Viewports
  6054.   #--------------------------------------------------------------------------      
  6055.   alias mog_bcf_update_viewports update_viewports
  6056.   def update_viewports
  6057.       mog_bcf_update_viewports
  6058.       update_viewport_cm if $imported[:mog_battle_camera]
  6059.   end
  6060.  
  6061.   #--------------------------------------------------------------------------
  6062.   # ● Update Viewport CM
  6063.   #--------------------------------------------------------------------------      
  6064.   def update_viewport_cm
  6065.       return if @viewport_cm == nil  
  6066.       @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  6067.       @viewport_cm.oy = $game_temp.bc_data[1]
  6068.       @viewport_cm.update
  6069.   end
  6070.    
  6071. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement