查看: 1334|回复: 5

[已经过期] 关于特定状态下更改角色战斗图

[复制链接]
梦石
0
星屑
1618
在线时间
267 小时
注册时间
2019-1-18
回帖
129
发表于 2019-9-12 17:22:26 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 造小梦 于 2019-9-13 11:10 编辑

如题,我想做一个“变身”技能,使用后赋予角色一个【变身】状态,当角色处于这个状态时战斗图像改变,状态解除后又变回去,这种效果该怎么实现?我不想用战斗事件,太废时间了,求大佬指点。
显示战斗图的脚本如下:
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  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. # Atualizações desta versão.
  29. #==============================================================================
  30. # (ver 6.6)
  31. #      - Correção do Crash caso optar por desativar o layout das janelas.
  32. # (ver 6.5)
  33. #      - Melhoria no cálculo da posição Z.
  34. #      - Correção de travar o menu.
  35. # (ver 6.4)
  36. #      - Correção do glitch de aparecer um pedaço da Windowskin quando se
  37. #        usa mais de 4 battlers na batalha.
  38. # (ver 6.3)
  39. #      - Compatibilidade com o MOG Battle Camera.
  40. # (ver 6.2)
  41. #     - Refresh da hud ao trocar a posição dos personagens.
  42. # (ver 6.0)
  43. #     - Adição da camada da tela.
  44. #     - Adição do efeito Slide.
  45. #     - Adição de novas opções referente a fonte.
  46. #==============================================================================

  47. $imported = {} if $imported.nil?
  48. $imported[:mog_battle_hud_ex] = true

  49. module MOG_BATTLE_HUD_EX
  50.   
  51.   #============================================================================
  52.   #============================================================================
  53.   # * HUD SPRITE (GENERAL)
  54.   #============================================================================
  55.   # Definição da quantidade maxima de personagens na batalha.
  56.   #---------------------------------------------------------------------------
  57.   MAX_BATTLE_MEMBERS = 4
  58.   #---------------------------------------------------------------------------
  59.   # Definição da prioridade da hud.
  60.   #---------------------------------------------------------------------------
  61.   HUD_Z = 90
  62.   #---------------------------------------------------------------------------
  63.   # Definição da posição geral da hud, influência em todos os sprites da hud.
  64.   #---------------------------------------------------------------------------
  65.   HUD_POSITION = [8,350]
  66.   #---------------------------------------------------------------------------
  67.   # Definição do espaço entre os membros do grupo.
  68.   # (Use apenas para ajustes)
  69.   #---------------------------------------------------------------------------
  70.   MEMBERS_SPACE = [-50,0]
  71.   #---------------------------------------------------------------------------
  72.   # Definição fixa da hud se deseja posicionar a hud em lugares
  73.   # específicos da tela.
  74.   #
  75.   # FIXED_POSITION[INDEX_ID] = [X,Y]
  76.   #
  77.   #---------------------------------------------------------------------------
  78.   FIXED_HUD_POSITION = []
  79.   #FIXED_HUD_POSITION[0] = [220,300]
  80.   #FIXED_HUD_POSITION[1] = [220 + 26,300 + 28]
  81.   #FIXED_HUD_POSITION[2] = [220 + 26 * 2,300 + 28 * 2]
  82.   #FIXED_HUD_POSITION[3] = [220 + 26 * 3 ,300 +28 * 3]  
  83.   
  84.   #---------------------------------------------------------------------------
  85.   # Definição da posição do comando quando a opção de janelas fixa é ativada.
  86.   #---------------------------------------------------------------------------
  87.   FIXED_COMMAND_POSITION = []
  88.   #FIXED_COMMAND_POSITION[0] = [130,10]
  89.   # FIXED_COMMAND_POSITION[1] = [300,10]
  90.   # FIXED_COMMAND_POSITION[2] = [130,290]
  91.   # FIXED_COMMAND_POSITION[3] = [300,290]
  92.   #---------------------------------------------------------------------------
  93.   # Ocultar a HUD quando a janela de mensagem está ativa.
  94.   #---------------------------------------------------------------------------
  95.   MESSAGE_WINDOW_FADE_HUD = true
  96.   #---------------------------------------------------------------------------
  97.   # Definição da porcentagem do parâmetro baixo, isso influência na cor
  98.   # do número dos parâmetros de HP, MP e TP.
  99.   #---------------------------------------------------------------------------
  100.   LOW_PARAMETER_PERCENTAGE = 30
  101.   #============================================================================
  102.   #============================================================================
  103.   
  104.   
  105.   #============================================================================
  106.   #============================================================================
  107.   # * NAME
  108.   #============================================================================
  109.   # Ativar o Sprite do nome do personagem.
  110.   #---------------------------------------------------------------------------
  111.   NAME_VISIBLE = true
  112.   #---------------------------------------------------------------------------
  113.   # Definição da prioridade do Sprite.
  114.   #---------------------------------------------------------------------------  
  115.   NAME_Z = 5
  116.   #---------------------------------------------------------------------------
  117.   # Definição da posição da Face. [X,Y]
  118.   #---------------------------------------------------------------------------
  119.   NAME_POSITION = [-2,-22]
  120.   #---------------------------------------------------------------------------
  121.   # Definição do tipo alinhamento do nome.
  122.   #
  123.   # 0 - Esquerda
  124.   # 1 - Centro
  125.   # 2 - Direita
  126.   #---------------------------------------------------------------------------  
  127.   NAME_ALIGN_TYPE = 0
  128.   #---------------------------------------------------------------------------
  129.   # Definição do tamanho da fonte.
  130.   #---------------------------------------------------------------------------   
  131.   NAME_FONT_SIZE = 17
  132.   #---------------------------------------------------------------------------
  133.   # Ativar Bold.
  134.   #---------------------------------------------------------------------------   
  135.   NAME_FONT_BOLD = false
  136.   #---------------------------------------------------------------------------
  137.   # Ativar Italic.
  138.   #---------------------------------------------------------------------------   
  139.   NAME_FONT_ITALIC = false
  140.   #---------------------------------------------------------------------------
  141.   # Definição da cor da fonte
  142.   #---------------------------------------------------------------------------     
  143.   NAME_FONT_COLOR = Color.new(255,255,255,255)
  144.   #---------------------------------------------------------------------------
  145.   # Ativar Sombra
  146.   #---------------------------------------------------------------------------  
  147.   NAME_FONT_SHADOW = true
  148.   #---------------------------------------------------------------------------
  149.   # Definição da cor da sombra
  150.   #---------------------------------------------------------------------------   
  151.   NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  152.   #---------------------------------------------------------------------------
  153.   # Definição da distância da sombra.
  154.   #---------------------------------------------------------------------------   
  155.   NAME_FONT_SHADOW_POSITION = [1,1]  
  156.   #============================================================================
  157.   #============================================================================
  158.    
  159.   
  160.   #============================================================================
  161.   #============================================================================
  162.   # * FACE
  163.   #============================================================================
  164.   # Ativar a face.
  165.   # Será necessário o arquivo.
  166.   #
  167.   # ACTOR_NAME + _Face.png
  168.   #
  169.   # Eric_Face.png
  170.   #
  171.   #---------------------------------------------------------------------------
  172.   FACE_VISIBLE = true
  173.   # Ativar as Faces representando os battlers.
  174.   # Deixe "false" se tiver problemas de compatibilidade com scripts.
  175.   FACE_BATTLER = true
  176.   #---------------------------------------------------------------------------
  177.   # Definição da prioridade do sprite.
  178.   #---------------------------------------------------------------------------  
  179.   FACE_Z = 2
  180.   #---------------------------------------------------------------------------
  181.   # Definição da posição da Face. [X,Y]
  182.   #---------------------------------------------------------------------------
  183.   FACE_POSITION = [25,0]
  184.   #---------------------------------------------------------------------------
  185.   # Ativar faces animadas.
  186.   # Será necessário ter uma imagem de 5 faces do personagem no mesmo arquivo.
  187.   #
  188.   # FACE1/FACE2/FACE3/FACE4
  189.   #
  190.   # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  191.   # a imagem será dividida por 1 frame
  192.   #---------------------------------------------------------------------------  
  193.   FACE_ANIMATION = false
  194.   #---------------------------------------------------------------------------
  195.   # Ativar o efeito de Zoom quando o personagem usar alguma ação.
  196.   #---------------------------------------------------------------------------
  197.   FACE_ZOOM_ANIMATION = false
  198.   #---------------------------------------------------------------------------
  199.   # Ativar o efeito Mirror na animação de ação do personagem.
  200.   #---------------------------------------------------------------------------
  201.   FACE_ZOOM_MIRROR_EFFECT = false
  202.   #---------------------------------------------------------------------------
  203.   # Definição do tempo duração da animação da face.
  204.   #---------------------------------------------------------------------------  
  205.   FACE_ANIMATION_DURATION = 40
  206.   #---------------------------------------------------------------------------
  207.   # Ativar o efeito tremor da face quando o personagem sofrer dano.
  208.   #---------------------------------------------------------------------------  
  209.   FACE_SHAKE_EFFECT = true
  210.   #============================================================================
  211.   #============================================================================
  212.   
  213.   
  214.   #============================================================================
  215.   #============================================================================
  216.   # * TURN (ACTIVE INDICATOR)
  217.   #============================================================================
  218.   # Ativar o indicador de turno do personagem.
  219.   # Será necessário o arquivo.
  220.   #
  221.   # Turn.png
  222.   #
  223.   #---------------------------------------------------------------------------
  224.   TURN_SPRITE_VISIBLE = true
  225.   #---------------------------------------------------------------------------
  226.   # Definição da prioridade do Sprite.
  227.   #---------------------------------------------------------------------------   
  228.   TURN_SPRITE_Z = 1
  229.   #---------------------------------------------------------------------------
  230.   # Definição da posição do sprite de turno.
  231.   #---------------------------------------------------------------------------  
  232.   TURN_SPRITE_POSITION = [0,0]
  233.   #---------------------------------------------------------------------------  
  234.   # Ativar o efeito de animação de piscar.
  235.   #---------------------------------------------------------------------------  
  236.   TURN_BLINK_EFFECT = true
  237.   #---------------------------------------------------------------------------  
  238.    
  239.   
  240.   #============================================================================
  241.   #============================================================================
  242.   # * HP
  243.   #============================================================================
  244.   # Ativar o número de HP.
  245.   # Será necessário o arquivo.
  246.   #
  247.   # HP_Number.png
  248.   #
  249.   #---------------------------------------------------------------------------
  250.   HP_NUMBER_VISIBLE = true
  251.   #---------------------------------------------------------------------------
  252.   # Definição da prioridade do Sprite.
  253.   #---------------------------------------------------------------------------   
  254.   HP_NUMBER_Z = 5
  255.   #---------------------------------------------------------------------------
  256.   # Definição da posição do número de HP. [X,Y]
  257.   #---------------------------------------------------------------------------  
  258.   HP_NUMBER_POSITION = [115,1]
  259.   #---------------------------------------------------------------------------  
  260.   # Ativar o número de HP Total.
  261.   # Será necessário o arquivo.
  262.   #
  263.   # HP_Number_Max.png
  264.   #
  265.   #---------------------------------------------------------------------------
  266.   HP_NUMBER_MAX_VISIBLE = false
  267.   #---------------------------------------------------------------------------
  268.   # Definição da posição do número de HP Total. [X,Y]
  269.   #---------------------------------------------------------------------------  
  270.   HP_NUMBER_MAX_POSITION = [165,30]
  271.   #---------------------------------------------------------------------------
  272.   # Definição do tipo alinhamento do número.
  273.   #
  274.   # 0 - Esquerda
  275.   # 1 - Centro
  276.   # 2 - Direita
  277.   #---------------------------------------------------------------------------  
  278.   HP_NUMBER_ALIGN_TYPE = 2
  279.   #---------------------------------------------------------------------------
  280.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  281.   #---------------------------------------------------------------------------
  282.   HP_NUMBER_WAVE_ALIGN_EFFECT = false
  283.   #---------------------------------------------------------------------------
  284.   # Apresentar os números em porcentagem.
  285.   #---------------------------------------------------------------------------   
  286.   HP_NUMBER_PERCENTAGE = false
  287.   #---------------------------------------------------------------------------
  288.   # Ativar números animados ("Rolantes").
  289.   #---------------------------------------------------------------------------  
  290.   HP_NUMBER_ANIMATION = true
  291.   #---------------------------------------------------------------------------
  292.   # Ativar a cor do HP baixo.
  293.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  294.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  295.   #
  296.   # NORMAL_COLOR
  297.   # LOW_PARAMETER_COLOR
  298.   #
  299.   # Caso definir a função como FALSE a imagem será dividida apenas como
  300.   # 1 frame de altura.
  301.   #---------------------------------------------------------------------------  
  302.   HP_NUMBER_LOW_COLOR = false
  303.   #---------------------------------------------------------------------------
  304.   # Ativar o medidor de HP.
  305.   # Será necessário o arquivo.
  306.   #
  307.   # HP_Meter.png
  308.   #  
  309.   #---------------------------------------------------------------------------  
  310.   HP_METER_VISIBLE = true
  311.   #---------------------------------------------------------------------------
  312.   # Definição da prioridade do sprite.
  313.   #---------------------------------------------------------------------------   
  314.   HP_METER_Z = 4
  315.   #---------------------------------------------------------------------------
  316.   # Definição da posição do medidor de HP. [X,Y]
  317.   #---------------------------------------------------------------------------  
  318.   HP_METER_POSITION = [34,13]
  319.   #---------------------------------------------------------------------------
  320.   # Definição do ângulo do medidor.
  321.   #---------------------------------------------------------------------------  
  322.   HP_METER_ANGLE = 0
  323.   #---------------------------------------------------------------------------
  324.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  325.   # inverso.
  326.   #---------------------------------------------------------------------------  
  327.   HP_METER_MIRROR_EFFECT = false
  328.   #---------------------------------------------------------------------------
  329.   # Ativar o efeito animado de dano no medidor.
  330.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  331.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  332.   #
  333.   # NORMAL_COLOR
  334.   # DAMAGE_COLOR
  335.   #
  336.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  337.   #---------------------------------------------------------------------------  
  338.   HP_METER_REDUCTION_ANIMATION = true
  339.   #---------------------------------------------------------------------------
  340.   # Ativar o efeito animado do "medidor fluindo".
  341.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  342.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  343.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  344.   #---------------------------------------------------------------------------  
  345.   HP_METER_GRADIENT_ANIMATION = true
  346.   #---------------------------------------------------------------------------
  347.   # Ativar HP em ícones.
  348.   # Será necessário ter a imagem.
  349.   #
  350.   # HP_Icon.png
  351.   #
  352.   #---------------------------------------------------------------------------
  353.   HP_ICON_VISIBLE = false
  354.   #---------------------------------------------------------------------------
  355.   # Definição da prioridade do Sprite.
  356.   #---------------------------------------------------------------------------   
  357.   HP_ICON_Z = 1
  358.   #---------------------------------------------------------------------------
  359.   # Posição do ícone de HP.
  360.   #---------------------------------------------------------------------------  
  361.   HP_ICON_POSITION = [60,10]
  362.   #---------------------------------------------------------------------------
  363.   # Ativar o sprite EX do ultimo ícone
  364.   # Será necessário ter a imagem.
  365.   #
  366.   # HP_Icon_EX.png
  367.   #
  368.   #---------------------------------------------------------------------------
  369.   HP_ICON_EX_VISIBLE = false
  370.   #---------------------------------------------------------------------------
  371.   # Posição do ícone Animado.
  372.   #---------------------------------------------------------------------------  
  373.   HP_ICON_EX_POSITION = [0,0]
  374.   #---------------------------------------------------------------------------
  375.   # Ativar o efeito de Zoom do Sprite.
  376.   #---------------------------------------------------------------------------
  377.   HP_ICON_EX_ZOOM_EFFECT = true
  378.   #---------------------------------------------------------------------------
  379.   # Espaço entre os ícones.
  380.   #---------------------------------------------------------------------------   
  381.   HP_ICON_SPACE = [-10,-10]
  382.   #---------------------------------------------------------------------------
  383.   # Definição da quantidade maxima de ícones na horizontal.
  384.   #---------------------------------------------------------------------------  
  385.   HP_ICON_COL_MAX = 10
  386.   #---------------------------------------------------------------------------
  387.   # Definição da quantidade maxima de ícones na vertical.
  388.   #---------------------------------------------------------------------------   
  389.   HP_ICON_ROW_MAX = 2
  390.   #---------------------------------------------------------------------------
  391.   # Ativar o número de HP de ícones.
  392.   # Será necessário ter a imagem.
  393.   #
  394.   # HP_Icon_Number.png
  395.   #
  396.   #---------------------------------------------------------------------------
  397.   HP_ICON_NUMBER_VISIBLE = false
  398.   #---------------------------------------------------------------------------
  399.   # Definição da prioridade do sprite.
  400.   #---------------------------------------------------------------------------
  401.   HP_ICON_NUMBER_Z = 4
  402.   #---------------------------------------------------------------------------
  403.   # Posição do número do ícone
  404.   #---------------------------------------------------------------------------  
  405.   HP_ICON_NUMBER_POSITION = [33,22]
  406.   #---------------------------------------------------------------------------
  407.   # Definição do tipo alinhamento do número.
  408.   #
  409.   # 0 - Esquerda
  410.   # 1 - Centro
  411.   # 2 - Direita
  412.   #---------------------------------------------------------------------------  
  413.   HP_ICON_NUMBER_ALIGN_TYPE = 1  
  414.   #============================================================================
  415.   #============================================================================
  416.   
  417.   
  418.   #============================================================================
  419.   #============================================================================
  420.   # * MP
  421.   #============================================================================
  422.   # Ativar o número de MP.
  423.   # Será necessário o arquivo.
  424.   #
  425.   # MP_Number.png
  426.   #  
  427.   #---------------------------------------------------------------------------  
  428.   MP_NUMBER_VISIBLE = true
  429.   #---------------------------------------------------------------------------
  430.   # Definição da prioridade do Sprite.
  431.   #---------------------------------------------------------------------------   
  432.   MP_NUMBER_Z = 5  
  433.   #---------------------------------------------------------------------------
  434.   # Definição da posição do número de MP. [X,Y]
  435.   #---------------------------------------------------------------------------  
  436.   MP_NUMBER_POSITION = [115,17]
  437.   #---------------------------------------------------------------------------  
  438.   # Ativar o número de MP Total.
  439.   # Será necessário o arquivo.
  440.   #
  441.   # MP_Number_Max.png
  442.   #
  443.   #---------------------------------------------------------------------------
  444.   MP_NUMBER_MAX_VISIBLE = false
  445.   #---------------------------------------------------------------------------
  446.   # Definição da posição do número de MP Total. [X,Y]
  447.   #---------------------------------------------------------------------------  
  448.   MP_NUMBER_MAX_POSITION = [128,53]
  449.   #---------------------------------------------------------------------------
  450.   # Definição do tipo alinhamento do número.
  451.   #
  452.   # 0 - Esquerda
  453.   # 1 - Centro
  454.   # 2 - Direita
  455.   #---------------------------------------------------------------------------  
  456.   MP_NUMBER_ALIGN_TYPE = 2
  457.   #---------------------------------------------------------------------------
  458.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  459.   #---------------------------------------------------------------------------
  460.   MP_NUMBER_WAVE_ALIGN_EFFECT = false   
  461.   #---------------------------------------------------------------------------
  462.   # Apresentar os números em porcentagem.
  463.   #---------------------------------------------------------------------------   
  464.   MP_NUMBER_PERCENTAGE = false
  465.   #---------------------------------------------------------------------------
  466.   # Ativar números animados ("Rolantes").
  467.   #---------------------------------------------------------------------------  
  468.   MP_NUMBER_ANIMATION = true
  469.   #---------------------------------------------------------------------------
  470.   # Ativar a cor do MP baixo.
  471.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  472.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  473.   #
  474.   # NORMAL_COLOR
  475.   # LOW_PARAMETER_COLOR
  476.   #
  477.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  478.   #---------------------------------------------------------------------------  
  479.   MP_NUMBER_LOW_COLOR = false
  480.   #---------------------------------------------------------------------------
  481.   # Ativar o medidor de MP.
  482.   # Será necessário o arquivo.
  483.   #
  484.   # MP_Meter.png
  485.   #   
  486.   #---------------------------------------------------------------------------  
  487.   MP_METER_VISIBLE = true
  488.   #---------------------------------------------------------------------------
  489.   # Definição da prioridade do sprite.
  490.   #---------------------------------------------------------------------------   
  491.   MP_METER_Z = 4  
  492.   #---------------------------------------------------------------------------
  493.   # Definição da posição do medidor de MP. [X,Y]
  494.   #---------------------------------------------------------------------------  
  495.   MP_METER_POSITION = [34,30]
  496.   #---------------------------------------------------------------------------
  497.   # Definição do ângulo do medidor.
  498.   #---------------------------------------------------------------------------  
  499.   MP_METER_ANGLE = 0
  500.   #---------------------------------------------------------------------------
  501.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  502.   # inverso.
  503.   #---------------------------------------------------------------------------  
  504.   MP_METER_MIRROR_EFFECT = false
  505.   #---------------------------------------------------------------------------
  506.   # Ativar o efeito animado de dano no medidor.
  507.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  508.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  509.   #
  510.   # NORMAL_COLOR
  511.   # DAMAGE_COLOR
  512.   #
  513.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  514.   #---------------------------------------------------------------------------  
  515.   MP_METER_REDUCTION_ANIMATION = true
  516.   #---------------------------------------------------------------------------
  517.   # Ativar o efeito animado do "medidor fluindo".
  518.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  519.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  520.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  521.   #---------------------------------------------------------------------------  
  522.   MP_METER_GRADIENT_ANIMATION = true
  523.   #---------------------------------------------------------------------------
  524.   # Ativar MP em ícones.
  525.   # Será necessário ter a imagem.
  526.   #
  527.   # MP_Icon.png
  528.   #
  529.   #---------------------------------------------------------------------------
  530.   MP_ICON_VISIBLE = false
  531.   #---------------------------------------------------------------------------
  532.   # Definição da prioridade do Sprite.
  533.   #---------------------------------------------------------------------------   
  534.   MP_ICON_Z = 1  
  535.   #---------------------------------------------------------------------------
  536.   # Posição do ícone de MP.
  537.   #---------------------------------------------------------------------------  
  538.   MP_ICON_POSITION = [92,30]
  539.   #---------------------------------------------------------------------------
  540.   # Ativar o sprite EX do ultimo ícone
  541.   # Será necessário ter a imagem.
  542.   #
  543.   # MP_Icon_EX.png
  544.   #
  545.   #---------------------------------------------------------------------------
  546.   MP_ICON_EX_VISIBLE = false
  547.   #---------------------------------------------------------------------------
  548.   # Posição do ícone Animado.
  549.   #---------------------------------------------------------------------------  
  550.   MP_ICON_EX_POSITION = [0,0]
  551.   #---------------------------------------------------------------------------
  552.   # Ativar o efeito de Zoom do Sprite.
  553.   #---------------------------------------------------------------------------
  554.   MP_ICON_EX_ZOOM_EFFECT = true
  555.   #---------------------------------------------------------------------------
  556.   # Espaço entre os ícones.
  557.   #---------------------------------------------------------------------------   
  558.   MP_ICON_SPACE = [3,3]
  559.   #---------------------------------------------------------------------------
  560.   # Definição da quantidade maxima de ícones na horizontal.
  561.   #---------------------------------------------------------------------------  
  562.   MP_ICON_COL_MAX = 15
  563.   #---------------------------------------------------------------------------
  564.   # Definição da quantidade maxima de ícones na vertical.
  565.   #---------------------------------------------------------------------------   
  566.   MP_ICON_ROW_MAX = 1
  567.   #---------------------------------------------------------------------------
  568.   # Ativar o número de MP de ícones.
  569.   # Será necessário ter a imagem.
  570.   #
  571.   # MP_Icon_Number.png
  572.   #
  573.   #---------------------------------------------------------------------------
  574.   MP_ICON_NUMBER_VISIBLE = false
  575.   #---------------------------------------------------------------------------
  576.   # Definição da prioridade do sprite.
  577.   #---------------------------------------------------------------------------
  578.   MP_ICON_NUMBER_Z = 4
  579.   #---------------------------------------------------------------------------
  580.   # Posição do número do ícone
  581.   #---------------------------------------------------------------------------  
  582.   MP_ICON_NUMBER_POSITION = [75,65]
  583.   #---------------------------------------------------------------------------
  584.   # Definição do tipo alinhamento do número.
  585.   #
  586.   # 0 - Esquerda
  587.   # 1 - Centro
  588.   # 2 - Direita
  589.   #---------------------------------------------------------------------------  
  590.   MP_ICON_NUMBER_ALIGN_TYPE = 1  
  591.   #============================================================================
  592.   #============================================================================
  593.   
  594.   
  595.   #============================================================================
  596.   #============================================================================
  597.   # * TP
  598.   #============================================================================
  599.   # Ativar o número de TP.
  600.   # Será necessário o arquivo.
  601.   #
  602.   # TP_Number.png
  603.   #   
  604.   #---------------------------------------------------------------------------
  605.   TP_NUMBER_VISIBLE = true
  606.   #---------------------------------------------------------------------------
  607.   # Definição da prioridade do sprite.
  608.   #---------------------------------------------------------------------------
  609.   TP_NUMBER_Z = 5  
  610.   #---------------------------------------------------------------------------
  611.   # Definição da posição do número de TP. [X,Y]
  612.   #---------------------------------------------------------------------------  
  613.   TP_NUMBER_POSITION = [115,36]
  614.   #---------------------------------------------------------------------------  
  615.   # Ativar o número de TP Total.
  616.   # Será necessário o arquivo.
  617.   #
  618.   # TP_Number_Max.png
  619.   #
  620.   #---------------------------------------------------------------------------
  621.   TP_NUMBER_MAX_VISIBLE = false
  622.   #---------------------------------------------------------------------------
  623.   # Definição da posição do número de TP Total. [X,Y]
  624.   #---------------------------------------------------------------------------  
  625.   TP_NUMBER_MAX_POSITION = [160,73]
  626.   #---------------------------------------------------------------------------
  627.   # Definição do tipo alinhamento do número.
  628.   #
  629.   # 0 - Esquerda
  630.   # 1 - Centro
  631.   # 2 - Direita
  632.   #---------------------------------------------------------------------------  
  633.   TP_NUMBER_ALIGN_TYPE = 2
  634.   #---------------------------------------------------------------------------
  635.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  636.   #---------------------------------------------------------------------------
  637.   TP_NUMBER_WAVE_ALIGN_EFFECT = false   
  638.   #---------------------------------------------------------------------------
  639.   # Apresentar os números em porcentagem.
  640.   #---------------------------------------------------------------------------   
  641.   TP_NUMBER_PERCENTAGE = false
  642.   #---------------------------------------------------------------------------
  643.   # Ativar números animados ("Rolantes").
  644.   #---------------------------------------------------------------------------  
  645.   TP_NUMBER_ANIMATION = true
  646.   #---------------------------------------------------------------------------
  647.   # Ativar a cor do TP baixo.
  648.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  649.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  650.   #
  651.   # NORMAL_COLOR
  652.   # LOW_PARAMETER_COLOR
  653.   #
  654.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  655.   #---------------------------------------------------------------------------  
  656.   TP_NUMBER_LOW_COLOR = false
  657.   #---------------------------------------------------------------------------
  658.   # Ativar o medidor de TP.
  659.   # Será necessário o arquivo.
  660.   #
  661.   # TP_Meter.png
  662.   #   
  663.   #---------------------------------------------------------------------------  
  664.   TP_METER_VISIBLE = true
  665.   #---------------------------------------------------------------------------
  666.   # Definição da prioridade do sprite.
  667.   #---------------------------------------------------------------------------
  668.   TP_METER_Z = 4  
  669.   #---------------------------------------------------------------------------
  670.   # Definição da posição do medidor de TP. [X,Y]
  671.   #---------------------------------------------------------------------------  
  672.   TP_METER_POSITION = [61,48]
  673.   #---------------------------------------------------------------------------
  674.   # Definição do ângulo do medidor.
  675.   #---------------------------------------------------------------------------  
  676.   TP_METER_ANGLE = 0
  677.   #---------------------------------------------------------------------------
  678.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  679.   # inverso.
  680.   #---------------------------------------------------------------------------  
  681.   TP_METER_MIRROR_EFFECT = false
  682.   #---------------------------------------------------------------------------
  683.   # Ativar o efeito animado de dano no medidor.
  684.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  685.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  686.   #
  687.   # NORMAL_COLOR
  688.   # DAMAGE_COLOR
  689.   #
  690.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  691.   #---------------------------------------------------------------------------  
  692.   TP_METER_REDUCTION_ANIMATION = true
  693.   #---------------------------------------------------------------------------
  694.   # Ativar o efeito animado do "medidor fluindo".
  695.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  696.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  697.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  698.   #---------------------------------------------------------------------------  
  699.   TP_METER_GRADIENT_ANIMATION = true
  700.   #---------------------------------------------------------------------------
  701.   # Ativar TP em ícones.
  702.   # Será necessário ter a imagem.
  703.   #
  704.   # TP_Icon.png
  705.   #
  706.   #---------------------------------------------------------------------------
  707.   TP_ICON_VISIBLE = false
  708.   #---------------------------------------------------------------------------
  709.   # Definição da prioridade do sprite.
  710.   #---------------------------------------------------------------------------
  711.   TP_ICON_Z = 1  
  712.   #---------------------------------------------------------------------------
  713.   # Posição do ícone de TP.
  714.   #---------------------------------------------------------------------------  
  715.   TP_ICON_POSITION = [200,128]
  716.   #---------------------------------------------------------------------------
  717.   # Ativar o sprite EX do ultimo ícone
  718.   # Será necessário ter a imagem.
  719.   #
  720.   # TP_Icon_EX.png
  721.   #
  722.   #---------------------------------------------------------------------------
  723.   TP_ICON_EX_VISIBLE = false
  724.   #---------------------------------------------------------------------------
  725.   # Posição do ícone Animado.
  726.   #---------------------------------------------------------------------------  
  727.   TP_ICON_EX_POSITION = [0,0]
  728.   #---------------------------------------------------------------------------
  729.   # Ativar o efeito de Zoom do Sprite.
  730.   #---------------------------------------------------------------------------
  731.   TP_ICON_EX_ZOOM_EFFECT = true
  732.   #---------------------------------------------------------------------------
  733.   # Espaço entre os ícones.
  734.   #---------------------------------------------------------------------------   
  735.   TP_ICON_SPACE = [-10,-10]
  736.   #---------------------------------------------------------------------------
  737.   # Definição da quantidade maxima de ícones na horizontal.
  738.   #---------------------------------------------------------------------------  
  739.   TP_ICON_COL_MAX = 10
  740.   #---------------------------------------------------------------------------
  741.   # Definição da quantidade maxima de ícones na vertical.
  742.   #---------------------------------------------------------------------------   
  743.   TP_ICON_ROW_MAX = 2
  744.   #---------------------------------------------------------------------------
  745.   # Ativar o número de TP de ícones.
  746.   # Será necessário ter a imagem.
  747.   #
  748.   # TP_Icon_Number.png
  749.   #
  750.   #---------------------------------------------------------------------------
  751.   TP_ICON_NUMBER_VISIBLE = false
  752.   #---------------------------------------------------------------------------
  753.   # Definição da prioridade do sprite.
  754.   #---------------------------------------------------------------------------
  755.   TP_ICON_NUMBER_Z = 4
  756.   #---------------------------------------------------------------------------
  757.   # Posição do número do ícone
  758.   #---------------------------------------------------------------------------  
  759.   TP_ICON_NUMBER_POSITION = [0,128]
  760.   #---------------------------------------------------------------------------
  761.   # Definição do tipo alinhamento do número.
  762.   #
  763.   # 0 - Esquerda
  764.   # 1 - Centro
  765.   # 2 - Direita
  766.   #---------------------------------------------------------------------------  
  767.   TP_ICON_NUMBER_ALIGN_TYPE = 0   
  768.   #============================================================================
  769.   #============================================================================
  770.   
  771.   #============================================================================
  772.   #============================================================================
  773.   # * AT
  774.   #============================================================================
  775.   # Ativar o número de AT.
  776.   # Será necessário o arquivo.
  777.   #
  778.   # AT_Number.png
  779.   #
  780.   #---------------------------------------------------------------------------
  781.   AT_NUMBER_VISIBLE = false
  782.   #---------------------------------------------------------------------------
  783.   # Definição da prioridade do Sprite.
  784.   #---------------------------------------------------------------------------   
  785.   AT_NUMBER_Z = 2
  786.   #---------------------------------------------------------------------------
  787.   # Definição da posição do número de AT. [X,Y]
  788.   #---------------------------------------------------------------------------  
  789.   AT_NUMBER_POSITION = [125,-27]
  790.   #---------------------------------------------------------------------------  
  791.   # Ativar o número de AT Total.
  792.   # Será necessário o arquivo.
  793.   #
  794.   # AT_Number_Max.png
  795.   #
  796.   #---------------------------------------------------------------------------
  797.   AT_NUMBER_MAX_VISIBLE = false
  798.   #---------------------------------------------------------------------------
  799.   # Definição da posição do número de AT Total. [X,Y]
  800.   #---------------------------------------------------------------------------  
  801.   AT_NUMBER_MAX_POSITION = [165,-17]
  802.   #---------------------------------------------------------------------------
  803.   # Definição do tipo alinhamento do número.
  804.   #
  805.   # 0 - Esquerda
  806.   # 1 - Centro
  807.   # 2 - Direita
  808.   #---------------------------------------------------------------------------  
  809.   AT_NUMBER_ALIGN_TYPE = 2
  810.   #---------------------------------------------------------------------------
  811.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  812.   #---------------------------------------------------------------------------
  813.   AT_NUMBER_WAVE_ALIGN_EFFECT = false
  814.   #---------------------------------------------------------------------------
  815.   # Apresentar os números em porcentagem.
  816.   #---------------------------------------------------------------------------   
  817.   AT_NUMBER_PERCENTAGE = false
  818.   #---------------------------------------------------------------------------
  819.   # Ativar números animados ("Rolantes").
  820.   #---------------------------------------------------------------------------  
  821.   AT_NUMBER_ANIMATION = false
  822.   #---------------------------------------------------------------------------
  823.   # Ativar o medidor de AT.
  824.   # Será necessário o arquivo.
  825.   #
  826.   # AT_Meter.png
  827.   #  
  828.   #---------------------------------------------------------------------------  
  829.   AT_METER_VISIBLE = false
  830.   #---------------------------------------------------------------------------
  831.   # Definição da prioridade do sprite.
  832.   #---------------------------------------------------------------------------   
  833.   AT_METER_Z = 1
  834.   #---------------------------------------------------------------------------
  835.   # Definição da posição do medidor de AT. [X,Y]
  836.   #---------------------------------------------------------------------------  
  837.   AT_METER_POSITION = [38,76]
  838.   #---------------------------------------------------------------------------
  839.   # Definição do ângulo do medidor.
  840.   #---------------------------------------------------------------------------  
  841.   AT_METER_ANGLE = 0
  842.   #---------------------------------------------------------------------------
  843.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  844.   # inverso.
  845.   #---------------------------------------------------------------------------  
  846.   AT_METER_MIRROR_EFFECT = false
  847.   #---------------------------------------------------------------------------
  848.   # Ativar o efeito animado do "medidor fluindo".
  849.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  850.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  851.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  852.   #---------------------------------------------------------------------------  
  853.   AT_METER_GRADIENT_ANIMATION = true
  854.   #============================================================================
  855.   
  856.   
  857.   #============================================================================
  858.   #============================================================================
  859.   # * LEVEL
  860.   #============================================================================
  861.   # Ativar o número de Level.
  862.   # Será necessário o arquivo.
  863.   #
  864.   # LV_Number.png
  865.   #   
  866.   #---------------------------------------------------------------------------
  867.   LEVEL_NUMBER_VISIBLE = false
  868.   #---------------------------------------------------------------------------
  869.   # Definição da prioridade do Sprite.
  870.   #---------------------------------------------------------------------------   
  871.   LEVEL_NUMBER_Z = 2
  872.   #---------------------------------------------------------------------------
  873.   # Definição da posição do número do Level. [X,Y]
  874.   #---------------------------------------------------------------------------  
  875.   LEVEL_NUMBER_POSITION = [84,0]
  876.   #---------------------------------------------------------------------------
  877.   # Definição do tipo alinhamento do número.
  878.   #
  879.   # 0 - Esquerda
  880.   # 1 - Centro
  881.   # 2 - Direita
  882.   #---------------------------------------------------------------------------  
  883.   LEVEL_NUMBER_ALIGN_TYPE = 1     
  884.   #============================================================================
  885.   #============================================================================
  886.   
  887.   
  888.   #============================================================================
  889.   #============================================================================
  890.   # * STATE
  891.   #============================================================================
  892.   # Ativar as condições.
  893.   #---------------------------------------------------------------------------  
  894.   STATES_VISIBLE = true
  895.   #---------------------------------------------------------------------------
  896.   # Definição da prioridade do sprite.
  897.   #---------------------------------------------------------------------------   
  898.   STATES_Z = 5
  899.   #---------------------------------------------------------------------------
  900.   # Definição da posição das condições. [X,Y]
  901.   #---------------------------------------------------------------------------  
  902.   STATES_POSITION = [34,36]
  903.   #---------------------------------------------------------------------------
  904.   # Ativar o efeito animado das condições deslizando.
  905.   #---------------------------------------------------------------------------  
  906.   STATES_SCROLLING_ANIMATION = false
  907.   #---------------------------------------------------------------------------
  908.   # Definição do ângulo do sprite.
  909.   #---------------------------------------------------------------------------   
  910.   STATE_ANGLE = 0
  911.   #---------------------------------------------------------------------------
  912.   # Definição das condições que serão ocultadas pela hud.
  913.   # EX - HIDE_STATES_ID = [9,10,12,14]
  914.   #---------------------------------------------------------------------------   
  915.   HIDE_STATES_ID = [9,28,29,52,26,27,28,48,56,57,68,76,77,109,110,111,130,131,132,138,141,154,156,160,161,162,163,164,167]
  916.   #============================================================================
  917.   #============================================================================

  918.   #============================================================================
  919.   #============================================================================
  920.   # * SECOND LAYOUT (Overlayer)
  921.   #============================================================================  
  922.   # Ativar a segunda camada de Layout
  923.   # Será necessário o arquivo.
  924.   #
  925.   # Layout_2.png
  926.   #
  927.   #============================================================================  
  928.   SECOND_LAYOUT = true
  929.   #---------------------------------------------------------------------------
  930.   # Definição da prioridade do sprite.
  931.   #---------------------------------------------------------------------------  
  932.   SECOND_LAYOUT_Z = 3
  933.   #---------------------------------------------------------------------------
  934.   # Definição da posição do sprite.
  935.   #---------------------------------------------------------------------------   
  936.   SECOND_LAYOUT_POSITION = [0,0]
  937.   #============================================================================
  938.   #============================================================================
  939.    
  940.   #============================================================================
  941.   #============================================================================
  942.   # * SCREEN LAYOUT
  943.   #============================================================================  
  944.   # Ativar o Layout da tela.
  945.   # Será necessário o arquivo.
  946.   #
  947.   # Layout_Screen.png
  948.   #
  949.   #============================================================================  
  950.   #Ativar o Layout da tela
  951.   SCREEN_LAYOUT = false
  952.   #---------------------------------------------------------------------------
  953.   #Posição do layout
  954.   #---------------------------------------------------------------------------
  955.   SCREEN_LAYOUT_POSITION = [0,0]
  956.   #---------------------------------------------------------------------------
  957.   #Definição da posição Z
  958.   #---------------------------------------------------------------------------
  959.   SCREEN_LAYOUT_Z = -2   
  960.   
  961. end

  962. #============================================================================
  963. #============================================================================
  964. # * CUSTOM WINDOWS (GENERAL)
  965. #============================================================================
  966. module MOG_BATTLE_HUD_EX
  967.   
  968. #============================================================================
  969. # * Ativar Janelas Customizadas.
  970. #============================================================================
  971.   ENABLE_CUSTOM_WINDOWS = true
  972.   
  973. #============================================================================
  974. # * BATTLE LOG WINDOW
  975. #============================================================================
  976. #Definição da posição da janela de log.
  977.   BATTLE_LOG_POSITION = [0,0]
  978. #============================================================================
  979.   
  980. #============================================================================
  981. # * FONT SETTING
  982. #============================================================================
  983. #Ativar a configuração da fonte.
  984. ENABLE_WINDOW_FONT_SET = false
  985. #Definição do nome da fonte.
  986. WINDOW_FONT_NAME = nil
  987. #Definição do tamanho da fonte.
  988. WINDOW_FONT_SIZE = 18
  989. #Ativar fonte em bold;
  990. WINDOW_FONT_BOLD = false
  991. #Ativar fonte em itálico.
  992. WINDOW_FONT_ITALIC = false
  993.   
  994. #============================================================================
  995. # * SKILL WINDOW
  996. #============================================================================
  997. #Definição do tamanho da janela.
  998.   SKILL_WINDOW_SIZE = [Graphics.width, 120]
  999. #Definição da posição da janela.
  1000.   SKILL_WINDOW_POSITION = [0, 0]
  1001. #Definição da transparência da janela.
  1002.   SKILL_WINDOW_OPACITY = 0
  1003. #Ativar a imagem de Layout. ("Layout_Skill.png")
  1004.   SKILL_WINDOW_LAYOUT = true
  1005. #Definição do layout.
  1006.   SKILL_WINDOW_LAYOUT_POSITION = [0,-7]
  1007. #Definição da quantidade colunas máxima.
  1008.   SKILL_COL_MAX = 2
  1009.   #Ativar a animação de slide.
  1010.   SKILL_WINDOW_SLIDE_EFFECT = false
  1011.   #Definição da posição do slide.
  1012.   SKILL_WINDOW_SLIDE_POSITION = [150,0]   
  1013. #============================================================================
  1014.   
  1015. #============================================================================
  1016. # * ITEM WINDOW
  1017. #============================================================================
  1018. #Definição do tamanho da janela.  
  1019.   ITEM_WINDOW_SIZE = [Graphics.width, 120]
  1020. #Definição da posição da janela.
  1021.   ITEM_WINDOW_POSITION = [0,0]
  1022. #Definição da transparência da janela.
  1023.   ITEM_WINDOW_OPACITY = 0
  1024. #Ativar a imagem de Layout. ("Layout_Item.png")   
  1025.   ITEM_WINDOW_LAYOUT = true
  1026. #Definição do layout.  
  1027.   ITEM_WINDOW_LAYOUT_POSITION = [0,-7]   
  1028. #Definição da quantidade colunas máxima.
  1029.   ITEM_COL_MAX = 2
  1030.   #Ativar a animação de slide.
  1031.   ITEM_WINDOW_SLIDE_EFFECT = false
  1032.   #Definição da posição do slide.
  1033.   ITEM_WINDOW_SLIDE_POSITION = [150,0]  
  1034. #============================================================================

  1035. #============================================================================
  1036. # * COMMAND WINDOW
  1037. #============================================================================
  1038. #Ajustar automáticamente   
  1039.   AUTO_ADJUST_ACTOR_COMMAND = true
  1040. #Definição da posição da janela. (Apenas para Ajustes)
  1041.   ACTOR_COMMAND_POSITION = [-14,-20]
  1042. #Definição da transparência da janela.
  1043.   ACTOR_COMMAND_OPACITY = 0
  1044. #Ativar a imagem de Layout. ("Layout_Command.png")   
  1045.   ACTOR_COMMAND_LAYOUT = true
  1046. #Definição do layout.   
  1047.   ACTOR_COMMAND_LAYOUT_POSITION = [1,-6]
  1048. #============================================================================

  1049. #============================================================================
  1050. # * HELP WINDOW
  1051. #============================================================================
  1052. #Definição do tamanho da janela.   
  1053.   HELP_WINDOW_SIZE = [Graphics.width, 72]
  1054. #Definição do tamanho da janela.
  1055.   HELP_WINDOW_POSITION = [Graphics.width / 2, 0]  
  1056. #Definição da transparência da janela.
  1057.   HELP_WINDOW_OPACITY = 0
  1058. #Ativar a imagem de Layout. ("Layout_Help.png")   
  1059.   HELP_WINDOW_LAYOUT = true
  1060. #Definição do layout.
  1061.   HELP_WINDOW_LAYOUT_POSITION = [0,0]
  1062.   #Ativar a animação de slide.
  1063.   HELP_WINDOW_SLIDE_EFFECT = false
  1064.   #Definição da posição do slide.
  1065.   HELP_WINDOW_SLIDE_POSITION = [0,-150]   
  1066. #============================================================================

  1067. #============================================================================
  1068. # * TARGET ACTOR WINDOW
  1069. #============================================================================
  1070. #Definição do tamanho da janela.   
  1071.   ACTOR_WINDOW_SIZE = [Graphics.width, 120]  
  1072. #Definição do tamanho da janela.
  1073.   ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1074. #Definição da transparência da janela.  
  1075.   ACTOR_WINDOW_OPACITY = 0
  1076. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1077.   ACTOR_WINDOW_LAYOUT = true
  1078. #Definição do layout.
  1079.   ACTOR_WINDOW_LAYOUT_POSITION = [0,-7]
  1080.   #Ativar a animação de slide.
  1081.   ACTOR_WINDOW_SLIDE_EFFECT = false
  1082.   #Definição da posição do slide.
  1083.   ACTOR_WINDOW_SLIDE_POSITION = [0,100]      
  1084. #============================================================================

  1085. #============================================================================
  1086. # * TARGET ENEMY WINDOW
  1087. #============================================================================
  1088. #Definição do tamanho da janela.
  1089.   ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  1090. #Definição do tamanho da janela.  
  1091.   ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1092. #Definição da transparência da janela.   
  1093.   ENEMY_WINDOW_OPACITY = 0
  1094. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1095.   ENEMY_WINDOW_LAYOUT = true
  1096. #Definição do layout.
  1097.   ENEMY_WINDOW_LAYOUT_POSITION = [0,-7]
  1098.   #Ativar a animação de slide.
  1099.   ENEMY_WINDOW_SLIDE_EFFECT = false
  1100.   #Definição da posição do slide.
  1101.   ENEMY_WINDOW_SLIDE_POSITION = [0,100]   
  1102. #============================================================================

  1103. #============================================================================
  1104. # * PARTY WINDOW (Fight/Escape)
  1105. #============================================================================
  1106. #Definição do tamanho da janela.  
  1107.   PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  1108. #Definição da transparência da janela.   
  1109.   PARTY_COMMAND_OPACITY = 0
  1110. #Ativar a imagem de Layout. ("Layout_Party.png")  
  1111.   PARTY_COMMAND_LAYOUT = true
  1112. #Definição do layout.  
  1113.   PARTY_COMMAND_LAYOUT_POSITION = [-256,-6]
  1114.   #Ativar a animação de slide.
  1115.   PARTY_COMMAND_SLIDE_EFFECT = false
  1116.   #Definição da posição do slide.
  1117.   PARTY_COMMAND_SLIDE_POSITION = [0,-150]      
  1118. #============================================================================

  1119. end

  1120. #==============================================================================
  1121. # ** Cache
  1122. #==============================================================================
  1123. module Cache

  1124.   #--------------------------------------------------------------------------
  1125.   # * Hud
  1126.   #--------------------------------------------------------------------------
  1127.   def self.battle_hud(filename)
  1128.       load_bitmap("Graphics/Huds/Battle/", filename)
  1129.   end

  1130. end

  1131. #==============================================================================
  1132. # ** Game Temp
  1133. #==============================================================================
  1134. class Game_Temp
  1135.   
  1136.   attr_accessor :battler_face_pos
  1137.   attr_accessor :hud_pos
  1138.   attr_accessor :hud_pos_real
  1139.   attr_accessor :com_pos
  1140.   attr_accessor :mbhud_force_refresh
  1141.   attr_accessor :mbhud_window
  1142.   attr_accessor :command_visible
  1143.   attr_accessor :refresh_turn_sprite
  1144.   attr_accessor :battle_hud_visible
  1145.   attr_accessor :battle_hud_visible_refresh
  1146.   attr_accessor :battle_end
  1147.   
  1148.   #--------------------------------------------------------------------------
  1149.   # * Initialize
  1150.   #--------------------------------------------------------------------------   
  1151.   alias mog_monogatari_bhud_initialize initialize
  1152.   def initialize
  1153.       @battler_face_pos = []
  1154.       @hud_pos = []
  1155.       @hud_pos_real = []
  1156.       @com_pos = []
  1157.       @mbhud_force_refresh = false
  1158.       @mbhud_window = [false,false,false,false,false,false,false]
  1159.       @command_visible = false
  1160.       @refresh_turn_sprite = false
  1161.       @battle_hud_visible = true
  1162.       @battle_hud_visible_refresh = [false,false]
  1163.       @battle_end = false      
  1164.       mog_monogatari_bhud_initialize
  1165.   end
  1166.   
  1167.   #--------------------------------------------------------------------------
  1168.   # * Check Screen Xyz
  1169.   #--------------------------------------------------------------------------   
  1170.   def check_screen_xyz_nil
  1171.       return if !SceneManager.face_battler?
  1172.       for actor in $game_party.battle_members
  1173.           actor.screen_x = 0 if actor.screen_x == nil
  1174.           actor.screen_y = 0 if actor.screen_y == nil
  1175.           actor.screen_z = 0 if actor.screen_z == nil
  1176.       end
  1177.   end  
  1178.   
  1179.   #--------------------------------------------------------------------------
  1180.   # ● Sprite Visible
  1181.   #--------------------------------------------------------------------------   
  1182.   def sprite_visible
  1183.       return false if $game_message.visible
  1184.       return false if $game_temp.battle_end
  1185.       return true
  1186.   end  
  1187.   
  1188. end

  1189. #==============================================================================
  1190. # ** Game Interpreter
  1191. #==============================================================================
  1192. class Game_Interpreter
  1193.   
  1194. #--------------------------------------------------------------------------
  1195. # * Refresh Battle Hud
  1196. #--------------------------------------------------------------------------
  1197. def refresh_battle_hud
  1198.      $game_temp.check_screen_xyz_nil rescue nil
  1199.      $game_temp.mbhud_force_refresh = true
  1200. end
  1201.   
  1202. #--------------------------------------------------------------------------
  1203. # * Battler Face Name
  1204. #--------------------------------------------------------------------------
  1205. def battler_face_name(actor_id,face_name = "")
  1206.      for actor in $game_party.members
  1207.          actor.battler_face_name = face_name if actor.id == actor_id
  1208.      end
  1209.      refresh_battle_hud
  1210. end  
  1211.    
  1212. #--------------------------------------------------------------------------
  1213. # * Battler Hud Visible
  1214. #--------------------------------------------------------------------------
  1215. def battle_hud_visible(value)
  1216.      $game_temp.battle_hud_visible = value
  1217. end

  1218. #--------------------------------------------------------------------------
  1219. # * Command_129
  1220. #--------------------------------------------------------------------------
  1221. alias mog_monogatari_bhud_command_129 command_129
  1222. def command_129
  1223.      mog_monogatari_bhud_command_129     
  1224.      refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1225. end
  1226.   
  1227. end

  1228. #==============================================================================
  1229. # ** Game Actor
  1230. #==============================================================================
  1231. class Game_Actor < Game_Battler
  1232.   
  1233.   attr_accessor :face_animation
  1234.   attr_accessor :battler_face_name
  1235.   
  1236.   #--------------------------------------------------------------------------
  1237.   # * Setup
  1238.   #--------------------------------------------------------------------------
  1239.   alias mog_monogatari_face_animation setup
  1240.   def setup(actor_id)
  1241.       mog_monogatari_face_animation(actor_id)
  1242.       @face_animation = [0,0,0]
  1243.       @battler_face_name = "Face_" + actor_id.to_s
  1244.   end   
  1245.   
  1246.   #--------------------------------------------------------------------------
  1247.   # ● Real Next Level
  1248.   #--------------------------------------------------------------------------  
  1249.   def real_next_level
  1250.       next_level_exp - exp_for_level(level)
  1251.   end
  1252.   
  1253.   #--------------------------------------------------------------------------
  1254.   # ● Remain Exp
  1255.   #--------------------------------------------------------------------------  
  1256.   def remain_exp
  1257.       exp - exp_for_level(level)
  1258.   end
  1259.   
  1260.   #--------------------------------------------------------------------------
  1261.   # ● Gain Exp Test
  1262.   #--------------------------------------------------------------------------
  1263.   def gain_exp_test
  1264.       exp_r = rand(next_level_exp)
  1265.       change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1266.   end   
  1267.   
  1268.   #--------------------------------------------------------------------------
  1269.   # ● Low HP?
  1270.   #--------------------------------------------------------------------------   
  1271.   def low_hp?
  1272.       hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1273.   end
  1274.   
  1275.   #--------------------------------------------------------------------------
  1276.   # ● Low MP?
  1277.   #--------------------------------------------------------------------------   
  1278.   def low_mp?
  1279.       mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1280.   end  
  1281.   
  1282.   #--------------------------------------------------------------------------
  1283.   # ● Low TP?
  1284.   #--------------------------------------------------------------------------   
  1285.   def low_tp?
  1286.       tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1287.   end  
  1288.    
  1289. end

  1290. #==============================================================================
  1291. # ** Game Party
  1292. #==============================================================================
  1293. class Game_Party < Game_Unit
  1294.   
  1295.   #--------------------------------------------------------------------------
  1296.   # * Get Maximum Number of Battle Members
  1297.   #--------------------------------------------------------------------------
  1298.   def max_battle_members
  1299.       return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
  1300.   end
  1301.    
  1302. #--------------------------------------------------------------------------
  1303. # * Swap Order
  1304. #--------------------------------------------------------------------------
  1305. alias mog_bhex_swap_order swap_order
  1306. def swap_order(index1, index2)
  1307.      mog_bhex_swap_order(index1, index2)
  1308.      if SceneManager.scene_is?(Scene_Battle)  
  1309.      $game_temp.check_screen_xyz_nil rescue nil
  1310.      $game_temp.mbhud_force_refresh = true     
  1311.      end
  1312. end  
  1313.   
  1314. end

  1315. #==============================================================================
  1316. # ** BattleManager
  1317. #==============================================================================
  1318. module BattleManager
  1319.   
  1320. #--------------------------------------------------------------------------
  1321. # * Current Index
  1322. #--------------------------------------------------------------------------   
  1323. def self.current_index
  1324.      if $imported[:mog_atb_system]
  1325.         return actor.index if actor
  1326.      end   
  1327.      return 0 if @actor_index == nil
  1328.      return @actor_index != -1 ? @actor_index : 0
  1329. end
  1330.   
  1331. #--------------------------------------------------------------------------
  1332. # * Current Index Real
  1333. #--------------------------------------------------------------------------   
  1334. def self.current_index_real
  1335.      return -1 if @actor_index == nil
  1336.      return @actor_index
  1337. end

  1338.   #--------------------------------------------------------------------------
  1339.   # * Next Actor Avaliable
  1340.   #--------------------------------------------------------------------------
  1341.   def self.next_actor_avaliable?
  1342.       return false if @actor_index == nil
  1343.       next_index = @actor_index + 1
  1344.       return false if next_index >= $game_party.members.size
  1345.       return true
  1346.   end

  1347.   #--------------------------------------------------------------------------
  1348.   # * To Next Command Input
  1349.   #--------------------------------------------------------------------------
  1350.   def self.next_command_avaliable
  1351.     aindex = @actor_index
  1352.     begin      
  1353.       if !actor || !actor.next_command
  1354.         return false if actor == nil
  1355.         aindex += 1
  1356.         return false if aindex >= $game_party.members.size
  1357.       end
  1358.     end until actor.inputable?
  1359.     return true
  1360.   end  
  1361.   
  1362.   #--------------------------------------------------------------------------
  1363.   # * Can Enable Window?
  1364.   #--------------------------------------------------------------------------
  1365.   def self.can_enable_window?
  1366.       max_members = $game_party.members.size
  1367.       index_real = current_index_real + 1
  1368.       return false if index_real > max_members
  1369.       return false if in_turn?
  1370.       return false if $imported[:mog_battle_cursor]
  1371.       return true
  1372.   end
  1373.   
  1374. end

  1375. #==============================================================================
  1376. # ** SceneManager
  1377. #==============================================================================
  1378. module SceneManager
  1379.   
  1380.   #--------------------------------------------------------------------------
  1381.   # * Face Battler
  1382.   #--------------------------------------------------------------------------
  1383.   def self.face_battler?
  1384.       return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1385.       return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
  1386.       return false if $imported[:mog_sprite_actor]
  1387.       return false if $imported[:ve_animated_battle]
  1388.       return false if $imported[:ve_actor_battlers]
  1389.       return false if $imported["YES-BattleSymphony"]
  1390.       return false if $imported["YEA-VisualBattlers"]
  1391.       return false if $imported["Galv_Animated_Battlers"]
  1392.       return false if $imported['KRX-AnimatedBattlers']
  1393.       return false if $imported[:Theo_BasicFuntions]
  1394.       return false if $sv_camera != nil
  1395.       return false if BattleManager.true_surprise != nil rescue nil
  1396.       return false if $imported[:jet][:AnimatedBattlers] rescue nil      
  1397.       return true
  1398.   end
  1399.   
  1400. end

  1401. #==============================================================================
  1402. # ■ Sprite Picture
  1403. #==============================================================================
  1404. class Sprite_Picture < Sprite
  1405.   
  1406.   #--------------------------------------------------------------------------
  1407.   # * Initialize
  1408.   #--------------------------------------------------------------------------
  1409.   alias mog_battle_hud_initialize initialize
  1410.   def initialize(viewport, picture)
  1411.       mog_battle_hud_initialize(viewport, picture)
  1412.       self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
  1413.   
  1414.   end  

  1415.   #--------------------------------------------------------------------------
  1416.   # * Update Position
  1417.   #--------------------------------------------------------------------------
  1418.   alias mog_battle_hud_update_position update_position
  1419.   def update_position
  1420.       mog_battle_hud_update_position
  1421.       self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
  1422.   end
  1423.    
  1424. end

  1425. #==============================================================================
  1426. # ■ Sprite Base
  1427. #==============================================================================
  1428. class Sprite_Base < Sprite

  1429.   #--------------------------------------------------------------------------
  1430.   # * Initialize
  1431.   #--------------------------------------------------------------------------
  1432.   alias mog_bhud_ex_initialize initialize
  1433.   def initialize(viewport = nil)
  1434.       @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
  1435.       mog_bhud_ex_initialize(viewport)
  1436.   end  
  1437.   
  1438.   #--------------------------------------------------------------------------
  1439.   # * Animation Set Sprite
  1440.   #--------------------------------------------------------------------------
  1441.   alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
  1442.   def animation_set_sprites(frame)
  1443.       mog_battle_hud_ex_animation_set_sprites(frame)
  1444.       update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
  1445.   end  
  1446.    
  1447.   #--------------------------------------------------------------------------
  1448.   # * Update Sprite Z Animation
  1449.   #--------------------------------------------------------------------------
  1450.   def update_sprite_z_animation  
  1451.       if $imported[:mog_battle_camera]
  1452.          @ani_sprites.each_with_index do |sprite, i|
  1453.          sprite.z = @ani_x + i end      
  1454.       else
  1455.          @ani_sprites.each_with_index do |sprite, i|
  1456.          sprite.viewport = nil ; sprite.z = @ani_x + i end
  1457.       end   
  1458.   end  
  1459.   
  1460. end

  1461. #==============================================================================
  1462. # ** Spriteset Battle
  1463. #==============================================================================
  1464. class Spriteset_Battle  

  1465.   #--------------------------------------------------------------------------
  1466.   # * Create Actors
  1467.   #--------------------------------------------------------------------------
  1468.   alias mog_battle_hud_create_actors create_actors
  1469.   def create_actors
  1470.       if can_create_max_members?
  1471.          @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  1472.          return
  1473.       end
  1474.       mog_battle_hud_create_actors
  1475.   end

  1476.   #--------------------------------------------------------------------------
  1477.   # * Can Create Max Members
  1478.   #--------------------------------------------------------------------------
  1479.   def can_create_max_members?
  1480.       return false if $imported[:ve_animated_battle]
  1481.       return false if $imported[:ve_actor_battlers]
  1482.       return false if $sv_camera != nil
  1483.       return true
  1484.   end
  1485.   
  1486. end

  1487. #==============================================================================
  1488. # ■ Scene Battle
  1489. #==============================================================================
  1490. class Scene_Battle < Scene_Base
  1491.   
  1492. #--------------------------------------------------------------------------
  1493. # ● Clear All Windows
  1494. #--------------------------------------------------------------------------
  1495.   alias mog_battle_hud_ex_start start
  1496.   def start
  1497.       setup_battle_hud_ex
  1498.       mog_battle_hud_ex_start
  1499.   end
  1500.   
  1501. #--------------------------------------------------------------------------
  1502. # ● Setup Battle Hud EX
  1503. #--------------------------------------------------------------------------
  1504. def setup_battle_hud_ex
  1505.      @force_clear_duration = 0
  1506. end
  1507.   
  1508. #--------------------------------------------------------------------------
  1509. # ● Clear All Windows
  1510. #--------------------------------------------------------------------------
  1511. def clear_all_windows
  1512.      if @actor_window != nil
  1513.         @actor_window.visible = false
  1514.         @actor_window.active = false
  1515.      end   
  1516.      if @status_window != nil
  1517.         @status_window.visible = false
  1518.         @status_window.active = false
  1519.      end   
  1520.      if @actor_command_window != nil
  1521.         @actor_command_window.visible = false
  1522.         @actor_command_window.active = false
  1523.      end
  1524.      if @party_command_window != nil
  1525.         @party_command_window.visible = false
  1526.         @party_command_window.active = false
  1527.      end
  1528.      if @help_window != nil
  1529.         @help_window.visible = false
  1530.      end  
  1531. end   
  1532.   
  1533. #--------------------------------------------------------------------------
  1534. # ● Update
  1535. #--------------------------------------------------------------------------
  1536.   alias mog_battle_hud_ex_update_main update
  1537.   def update
  1538.       mog_battle_hud_ex_update_main
  1539.       update_battle_hud_ex
  1540.   end
  1541.   
  1542. #--------------------------------------------------------------------------
  1543. # ● Update Battle Hud_ex
  1544. #--------------------------------------------------------------------------
  1545.   def update_battle_hud_ex
  1546.       @status_window.visible = false
  1547.   end
  1548.   
  1549.   if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1550.   #--------------------------------------------------------------------------
  1551.   # * On Skill OK
  1552.   #--------------------------------------------------------------------------
  1553.   alias mog_battle_hud_ex_on_skill_ok on_skill_ok
  1554.   def on_skill_ok
  1555.       @skill = @skill_window.item
  1556.       @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  1557.       mog_battle_hud_ex_on_skill_ok
  1558.   end
  1559.    
  1560.   #--------------------------------------------------------------------------
  1561.   # * On Item OK
  1562.   #--------------------------------------------------------------------------
  1563.   alias mog_battle_hud_on_item_ok on_item_ok
  1564.   def on_item_ok
  1565.       @item = @item_window.item
  1566.       @item_window.hide if @item.for_opponent? or @item.for_friend?
  1567.       mog_battle_hud_on_item_ok
  1568.   end     
  1569.   
  1570.   #--------------------------------------------------------------------------
  1571.   # * On Enemy Cancel
  1572.   #--------------------------------------------------------------------------
  1573.   alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
  1574.   def on_enemy_cancel
  1575.       mog_battle_hud_ex_on_enemy_cancel
  1576.       @skill_window.show if @skill_window.active
  1577.       @item_window.show if @item_window.active      
  1578.   end
  1579.   
  1580.   #--------------------------------------------------------------------------
  1581.   # * On Actor Cancel
  1582.   #--------------------------------------------------------------------------
  1583.   alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
  1584.   def on_actor_cancel
  1585.       mog_battle_hud_ex_on_actor_cancel
  1586.       @skill_window.show if @skill_window.active
  1587.       @item_window.show if @item_window.active
  1588.       mog_battle_hud_ex_on_actor_cancel
  1589.   end  
  1590.   end

  1591. end

  1592. if SceneManager.face_battler?
  1593. #==============================================================================
  1594. # ■ Game_Actor
  1595. #==============================================================================
  1596. class Game_Actor < Game_Battler
  1597.   
  1598.   attr_accessor :screen_x
  1599.   attr_accessor :screen_y
  1600.   attr_accessor :screen_z

  1601.   
  1602. #--------------------------------------------------------------------------
  1603. # ● Use Sprite?
  1604. #--------------------------------------------------------------------------
  1605.   def use_sprite?
  1606.       return true
  1607.   end
  1608.   
  1609. end

  1610. #==============================================================================
  1611. # ■ Sprite_Battler
  1612. #==============================================================================
  1613. class Sprite_Battler < Sprite_Base
  1614.   include MOG_BATTLE_HUD_EX
  1615.   
  1616.   #--------------------------------------------------------------------------
  1617.   # ● Update Collapse
  1618.   #--------------------------------------------------------------------------                          
  1619.    alias mog_battle_hud_update_collapse update_collapse
  1620.    def update_collapse
  1621.        return if face_can_cancel_method?
  1622.        mog_battle_hud_update_collapse
  1623.    end  
  1624.    
  1625.   #--------------------------------------------------------------------------
  1626.   # ● Update Instant Collapse
  1627.   #--------------------------------------------------------------------------                             
  1628.    alias mog_battle_hud_update_instant_collapse update_instant_collapse
  1629.    def update_instant_collapse
  1630.        return if face_can_cancel_method?
  1631.        mog_battle_hud_update_instant_collapse
  1632.    end  
  1633.    
  1634.   #--------------------------------------------------------------------------
  1635.   # ● Face Can Cancel Method
  1636.   #--------------------------------------------------------------------------                                 
  1637.   def face_can_cancel_method?
  1638.       return false if !SceneManager.face_battler?
  1639.       return false if @battler.is_a?(Game_Enemy)
  1640.       self.opacity = 255 ; self.visible = true
  1641.       return true
  1642.   end  
  1643.    
  1644.   #--------------------------------------------------------------------------
  1645.   # ● Update Bitmap
  1646.   #--------------------------------------------------------------------------                                 
  1647.   alias mog_battle_hud_ex_update_bitmap update_bitmap
  1648.   def update_bitmap
  1649.       return if face_can_cancel_method?
  1650.       mog_battle_hud_ex_update_bitmap
  1651.   end  
  1652.   
  1653.   #--------------------------------------------------------------------------
  1654.   # ● Update Position
  1655.   #--------------------------------------------------------------------------                                 
  1656.   alias mog_battle_hud_ex_update_position update_position
  1657.   def update_position
  1658.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  1659.          if !face_sprite_visible? or $game_temp.battle_end
  1660.              self.y = -1000
  1661.              return
  1662.          end
  1663.       end   
  1664.       mog_battle_hud_ex_update_position
  1665.   end  
  1666.    
  1667.   #--------------------------------------------------------------------------
  1668.   # * Sprite Visible
  1669.   #--------------------------------------------------------------------------
  1670.   def face_sprite_visible?
  1671.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  1672.       return false if !$game_temp.battle_hud_visible
  1673.       return true
  1674.   end  
  1675.   
  1676. end

  1677. end

  1678. #==============================================================================
  1679. # ** Window_BattleStatus
  1680. #==============================================================================
  1681. class Window_BattleStatus < Window_Selectable
  1682. include MOG_BATTLE_HUD_EX

  1683.   #--------------------------------------------------------------------------
  1684.   # * Get Window Width
  1685.   #--------------------------------------------------------------------------
  1686.   def window_width
  1687.       ACTOR_WINDOW_SIZE[0]
  1688.   end

  1689. #--------------------------------------------------------------------------
  1690. # * Refresh
  1691. #--------------------------------------------------------------------------   
  1692. alias mog_monogatari_refresh refresh
  1693. def refresh
  1694.      mog_monogatari_refresh
  1695.      self.visible = false
  1696.      self.opacity = 0
  1697.      self.contents_opacity = 0
  1698.      self.y = 1200
  1699. end  

  1700. end  

  1701. #==============================================================================
  1702. # ** Window Actor Command
  1703. #==============================================================================
  1704. class Window_ActorCommand < Window_Command
  1705.   
  1706. #--------------------------------------------------------------------------
  1707. # * Update
  1708. #--------------------------------------------------------------------------   
  1709.   alias mog_hud_battle_hud_ex_turn_sprite_update update
  1710.   def update
  1711.       mog_hud_battle_hud_ex_turn_sprite_update
  1712.       $game_temp.command_visible = self.visible
  1713.   end

  1714. end

  1715. #==============================================================================
  1716. # ** Window_BattleActor
  1717. #==============================================================================
  1718. class Window_BattleActor < Window_BattleStatus
  1719.   
  1720.   #--------------------------------------------------------------------------
  1721.   # * Refresh
  1722.   #--------------------------------------------------------------------------
  1723.   alias mog_battle_hud_ex_actor_w_refresh refresh
  1724.   def refresh
  1725.       mog_battle_hud_ex_actor_w_refresh
  1726.       self.contents_opacity = 255
  1727.       self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1728.       self.visible = true
  1729.   end

  1730. end  

  1731. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1732.   
  1733. #==============================================================================
  1734. # ** Window BattleLog
  1735. #==============================================================================
  1736. class Window_BattleLog < Window_Selectable
  1737.   
  1738.   include MOG_BATTLE_HUD_EX
  1739.   
  1740. #--------------------------------------------------------------------------
  1741. # * Initialize
  1742. #--------------------------------------------------------------------------   
  1743.   alias mog_battle_hud_ex_log_initialize initialize
  1744.   def initialize
  1745.       mog_battle_hud_ex_log_initialize
  1746.       self.x = BATTLE_LOG_POSITION[0]
  1747.       self.y = BATTLE_LOG_POSITION[1]
  1748.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1749.   end
  1750.   
  1751. #--------------------------------------------------------------------------
  1752. # * Create Back Sprite
  1753. #--------------------------------------------------------------------------   
  1754.   alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
  1755.   def create_back_sprite
  1756.       self.x = BATTLE_LOG_POSITION[0]
  1757.       self.y = BATTLE_LOG_POSITION[1]
  1758.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1759.       mog_battle_hud_ex_log_create_back_sprite
  1760.   end
  1761.   
  1762. end  

  1763. #==============================================================================
  1764. # ** Window Actor Command
  1765. #==============================================================================
  1766. class Window_ActorCommand < Window_Command
  1767.   
  1768.   include MOG_BATTLE_HUD_EX
  1769.   
  1770. #--------------------------------------------------------------------------
  1771. # * Initialize
  1772. #--------------------------------------------------------------------------   
  1773. alias mog_monogatari_initialize initialize
  1774. def initialize
  1775.      mog_monogatari_initialize
  1776.      create_layout if $imported[:mog_battle_command_ex] == nil
  1777. end
  1778.   
  1779. #--------------------------------------------------------------------------
  1780. # * Dispose
  1781. #--------------------------------------------------------------------------
  1782. alias mog_monogatari_actor_command_dispose dispose
  1783. def dispose
  1784.      mog_monogatari_actor_command_dispose
  1785.      dispose_layout
  1786. end

  1787. #--------------------------------------------------------------------------
  1788. # * Create Layout
  1789. #--------------------------------------------------------------------------   
  1790. def create_layout
  1791.      return if @layout != nil
  1792.      return if !ACTOR_COMMAND_LAYOUT
  1793.      return if $game_temp.mbhud_window[0]
  1794.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1795.      $game_temp.mbhud_window[0] = true
  1796.      @layout = Sprite.new
  1797.      @layout.bitmap = Cache.battle_hud("Layout_Command")
  1798.      @layout.z = self.z - 1
  1799.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1800.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1801.      @layout.visible = false
  1802. end

  1803. #--------------------------------------------------------------------------
  1804. # * Dispose Layout
  1805. #--------------------------------------------------------------------------
  1806. def dispose_layout
  1807.      return if @layout == nil
  1808.      @layout.dispose
  1809.      @layout = nil
  1810. end

  1811. #--------------------------------------------------------------------------
  1812. # * Refresh Layout
  1813. #--------------------------------------------------------------------------
  1814. def refresh_layout
  1815.      return if @layout == nil
  1816.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1817.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1818.      @layout.visible = self.visible
  1819.      @layout.z = self.z - 1
  1820. end

  1821. #--------------------------------------------------------------------------
  1822. # * Select
  1823. #--------------------------------------------------------------------------  
  1824. alias mog_monogatari_select_actor_command select
  1825. def select(index)
  1826.      mog_monogatari_select_actor_command(index)
  1827.      set_command_position if $imported[:mog_battle_command_ex] == nil
  1828. end   
  1829.   
  1830. #--------------------------------------------------------------------------
  1831. # * Set Command Position
  1832. #--------------------------------------------------------------------------   
  1833. def set_command_position
  1834.      self.viewport = nil
  1835.      self.opacity = ACTOR_COMMAND_OPACITY
  1836.      battler_index = BattleManager.current_index rescue nil
  1837.      battler_index = 0 if battler_index == nil     
  1838.      if @actor != nil and $game_temp.hud_pos[battler_index] != nil
  1839.         if FIXED_COMMAND_POSITION[battler_index] != nil
  1840.            self.x = FIXED_COMMAND_POSITION[battler_index][0]
  1841.            self.y = FIXED_COMMAND_POSITION[battler_index][1]              
  1842.         else  
  1843.            self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
  1844.            self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1845.            self.x = 0 if self.x < 0
  1846.            self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
  1847.         end   
  1848.      end      
  1849.      refresh_layout
  1850. end  

  1851. #--------------------------------------------------------------------------
  1852. # * Refresh
  1853. #--------------------------------------------------------------------------   
  1854. alias mog_battle_hud_ex_refresh refresh
  1855. def refresh
  1856.      mog_battle_hud_ex_refresh
  1857.      $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1858. end

  1859. #--------------------------------------------------------------------------
  1860. # * Update
  1861. #--------------------------------------------------------------------------  
  1862. alias mog_monogatari_actor_commnand_update update
  1863. def update     
  1864.      mog_monogatari_actor_commnand_update
  1865.      if $imported[:mog_battle_command_ex] == nil
  1866.      self.visible = self.active
  1867.      if !@layout.nil?
  1868.         refresh_layout if @layout.visible != self.visible
  1869.         @layout.visible = false if !$game_temp.sprite_visible
  1870.      end        
  1871.      self.visible = false if !$game_temp.sprite_visible     
  1872.      end
  1873. end

  1874. end

  1875. #==============================================================================
  1876. # ** Window_PartyCommand
  1877. #==============================================================================
  1878. class Window_PartyCommand < Window_Command

  1879.   include MOG_BATTLE_HUD_EX
  1880.   
  1881. #--------------------------------------------------------------------------
  1882. # * Initialize
  1883. #--------------------------------------------------------------------------   
  1884.   alias mog_monogatari_party_initialize initialize
  1885.   def initialize
  1886.       mog_monogatari_party_initialize
  1887.     #  self.x = @org_position[0] ; self.y = @org_position[1]
  1888.     #  self.opacity = PARTY_COMMAND_OPACITY   
  1889.       create_layout
  1890.   end
  1891.   
  1892. #--------------------------------------------------------------------------
  1893. # * Dispose
  1894. #--------------------------------------------------------------------------
  1895. alias mog_monogatari_party_window_dispose dispose
  1896. def dispose
  1897.      mog_monogatari_party_window_dispose
  1898.      dispose_layout
  1899. end

  1900. #--------------------------------------------------------------------------
  1901. # * Create Layout
  1902. #--------------------------------------------------------------------------   
  1903. def create_layout
  1904.      return if @layout != nil
  1905.      return if !PARTY_COMMAND_LAYOUT
  1906.      return if $game_temp.mbhud_window[1]
  1907.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1908.      $game_temp.mbhud_window[1] = true
  1909.      @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1910.      @layout = Sprite.new
  1911.      @layout.bitmap = Cache.battle_hud("Layout_Party")
  1912.      @layout.z = self.z - 1
  1913.      refresh_layout
  1914.      @layout.visible = false
  1915. end

  1916. #--------------------------------------------------------------------------
  1917. # * Dispose Layout
  1918. #--------------------------------------------------------------------------
  1919. def dispose_layout
  1920.      return if @layout == nil
  1921.      @layout.dispose
  1922.      @layout = nil
  1923. end

  1924. #--------------------------------------------------------------------------
  1925. # * Refresh Layout
  1926. #--------------------------------------------------------------------------
  1927. def refresh_layout
  1928.      return if @layout == nil
  1929.      @layout.x = @org_position_2[0]
  1930.      @layout.y = @org_position_2[1]
  1931.      @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  1932.      @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  1933.      @layout.visible = self.visible
  1934. end         

  1935. #--------------------------------------------------------------------------
  1936. # * Select
  1937. #--------------------------------------------------------------------------  
  1938. alias mog_monogatari_refresh_partycommand refresh
  1939. def refresh
  1940.      if @org_position == nil
  1941.       @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  1942.                        PARTY_COMMAND_POSITION[1] - (self.height / 2)]  
  1943.      end                  
  1944.      mog_monogatari_refresh_partycommand
  1945.      
  1946.       self.viewport = nil      
  1947.       self.x = @org_position[0] ; self.y = @org_position[1]
  1948.       if PARTY_COMMAND_SLIDE_EFFECT
  1949.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  1950.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]

  1951.       end
  1952.       self.opacity = PARTY_COMMAND_OPACITY     
  1953. end   
  1954.   
  1955. def show
  1956.    
  1957. end

  1958. #--------------------------------------------------------------------------
  1959. # * Show
  1960. #--------------------------------------------------------------------------   
  1961.   alias mog_bg_ex_slide_show_party show
  1962.   def show
  1963.       self.viewport = nil
  1964.       self.x = @org_position[0] ; self.y = @org_position[1]
  1965.       if PARTY_COMMAND_SLIDE_EFFECT
  1966.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  1967.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]

  1968.       end
  1969.       self.opacity = PARTY_COMMAND_OPACITY
  1970.       mog_bg_ex_slide_show_party
  1971.   end

  1972. #--------------------------------------------------------------------------
  1973. # * Update
  1974. #--------------------------------------------------------------------------  
  1975. alias mog_monogatari_party_window_update update
  1976. def update
  1977.      mog_monogatari_party_window_update  
  1978.      self.visible = self.active
  1979.      if @layout != nil and @layout.visible != self.visible        
  1980.         refresh_layout
  1981.      end
  1982.      execute_slide_effect if self.visible
  1983. end   

  1984. end

  1985. #==============================================================================
  1986. # ** Window_Help
  1987. #==============================================================================
  1988. class Window_Help < Window_Base
  1989.   
  1990.   include MOG_BATTLE_HUD_EX
  1991.   
  1992.   #--------------------------------------------------------------------------
  1993.   # * Object Initialization
  1994.   #--------------------------------------------------------------------------
  1995.   alias mog_monogatari_battle_help_initialize initialize
  1996.   def initialize(line_number = 2)
  1997.       @battle_phase = false
  1998.       mog_monogatari_battle_help_initialize(line_number)
  1999.       @wait_time = 5
  2000.       if SceneManager.scene_is?(Scene_Battle)
  2001.          @battle_phase = true         
  2002.          self.width = HELP_WINDOW_SIZE[0]
  2003.          self.height = HELP_WINDOW_SIZE[1]      
  2004.          @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2005.                           HELP_WINDOW_POSITION[1]]         
  2006.          self.x = @org_position[0]
  2007.          self.y = @org_position[1]  
  2008.          self.opacity = HELP_WINDOW_OPACITY
  2009.          self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2010.          create_layout
  2011.       end     
  2012. end

  2013. #--------------------------------------------------------------------------
  2014. # * Dispose
  2015. #--------------------------------------------------------------------------
  2016. alias mog_monogatari_help_window_dispose dispose
  2017. def dispose
  2018.      mog_monogatari_help_window_dispose
  2019.      dispose_layout
  2020. end

  2021. #--------------------------------------------------------------------------
  2022. # * Create Layout
  2023. #--------------------------------------------------------------------------   
  2024. def create_layout
  2025.      return if @layout != nil
  2026.      return if !HELP_WINDOW_LAYOUT
  2027.      return if $game_temp.mbhud_window[2]
  2028.      return if !SceneManager.scene_is?(Scene_Battle)
  2029.      $game_temp.mbhud_window[2] = true
  2030.      @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2031.      @layout = Sprite.new
  2032.      @layout.bitmap = Cache.battle_hud("Layout_Help")
  2033.      @layout.z = self.z - 1
  2034.      refresh_layout
  2035.      @layout.visible = false
  2036. end

  2037. #--------------------------------------------------------------------------
  2038. # * Dispose Layout
  2039. #--------------------------------------------------------------------------
  2040. def dispose_layout
  2041.      return if @layout == nil
  2042.      @layout.dispose
  2043.      @layout = nil
  2044. end

  2045. #--------------------------------------------------------------------------
  2046. # * Refresh Layout
  2047. #--------------------------------------------------------------------------
  2048. def refresh_layout
  2049.      return if @layout == nil
  2050.      @layout.x = @org_position_2[0]
  2051.      @layout.y = @org_position_2[1]
  2052.      @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2053.      @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2054.      @layout.visible = self.visible  
  2055. end   
  2056.   
  2057. #--------------------------------------------------------------------------
  2058. # * Show
  2059. #--------------------------------------------------------------------------   
  2060.   alias mog_bg_ex_slide_show_help show
  2061.   def show
  2062.       if @battle_phase
  2063.       self.viewport = nil
  2064.       self.x = @org_position[0] ; self.y = @org_position[1]
  2065.       if HELP_WINDOW_SLIDE_EFFECT
  2066.          self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2067.          self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2068.       end
  2069.       self.opacity = HELP_WINDOW_OPACITY
  2070.       end
  2071.       mog_bg_ex_slide_show_help
  2072.   end  
  2073.   
  2074. #--------------------------------------------------------------------------
  2075. # * Update
  2076. #--------------------------------------------------------------------------  
  2077. alias mog_monogatari_help_window_update update
  2078. def update
  2079.      if @wait_time > 0
  2080.         @wait_time -= 1
  2081.         return
  2082.      end   
  2083.      mog_monogatari_help_window_update
  2084.      if SceneManager.scene_is?(Scene_Battle)
  2085.         if @layout != nil           
  2086.            refresh_layout if @layout.visible != self.visible
  2087.            @layout.visible = self.visible
  2088.         end
  2089.         self.visible = false if !$game_temp.sprite_visible
  2090.         execute_slide_effect if self.visible        
  2091.      end
  2092. end   
  2093.   
  2094. end

  2095. #==============================================================================
  2096. # ** Window_BattleActor
  2097. #==============================================================================
  2098. class Window_BattleActor < Window_BattleStatus
  2099.   
  2100.   include MOG_BATTLE_HUD_EX
  2101.   
  2102.   #--------------------------------------------------------------------------
  2103.   # * Initialize
  2104.   #--------------------------------------------------------------------------   
  2105.   alias mog_monogatari_battle_actor_initialize initialize
  2106.   def initialize(info_viewport)
  2107.       @force_hide = can_force_hide?
  2108.       mog_monogatari_battle_actor_initialize(info_viewport)
  2109.       self.width = ACTOR_WINDOW_SIZE[0]
  2110.       self.height = ACTOR_WINDOW_SIZE[1]
  2111.       @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2112.                        ACTOR_WINDOW_POSITION[1] - self.height]
  2113.       @org_position[1] = Graphics.height + 64 if @force_hide
  2114.       self.x = @org_position[0]
  2115.       self.y = @org_position[1]
  2116.       self.opacity = ACTOR_WINDOW_OPACITY
  2117.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2118.       self.viewport = nil
  2119.       create_layout
  2120.   end
  2121.   
  2122.   #--------------------------------------------------------------------------
  2123.   # * Can Force Hide?
  2124.   #--------------------------------------------------------------------------   
  2125.   def can_force_hide?
  2126.       return true if $imported[:ve_target_arrow]
  2127.       return true if $imported[:mog_battle_cursor]
  2128.       return false
  2129.   end
  2130.   
  2131. #--------------------------------------------------------------------------
  2132. # * Dispose
  2133. #--------------------------------------------------------------------------
  2134. alias mog_monogatari_actor_window_dispose dispose
  2135. def dispose
  2136.      mog_monogatari_actor_window_dispose
  2137.      dispose_layout
  2138. end

  2139. #--------------------------------------------------------------------------
  2140. # * Create Layout
  2141. #--------------------------------------------------------------------------   
  2142. def create_layout
  2143.      return if @layout != nil
  2144.      return if !ACTOR_WINDOW_LAYOUT
  2145.      return if $game_temp.mbhud_window[3]
  2146.      $game_temp.mbhud_window[3] = true
  2147.      @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2148.      @layout = Sprite.new
  2149.      @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2150.      @layout.z = self.z - 1
  2151.      refresh_layout
  2152.      @layout.visible = false
  2153. end

  2154. #--------------------------------------------------------------------------
  2155. # * Dispose Layout
  2156. #--------------------------------------------------------------------------
  2157. def dispose_layout
  2158.      return if @layout == nil
  2159.      @layout.dispose
  2160.      @layout = nil
  2161. end

  2162. #--------------------------------------------------------------------------
  2163. # * Refresh Layout
  2164. #--------------------------------------------------------------------------
  2165. def refresh_layout
  2166.      return if @layout == nil
  2167.      @layout.x = @org_position_2[0]
  2168.      @layout.y = @org_position_2[1]
  2169.      @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2170.      @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2171.      @layout.visible = self.visible
  2172. end     
  2173.   
  2174.   if $imported[:ve_target_arrow]
  2175.   #--------------------------------------------------------------------------
  2176.   # * New method: show_actor
  2177.   #--------------------------------------------------------------------------
  2178.   alias mog_battle_hud_ex_show_actor show_actor
  2179.   def show_actor
  2180.       return true if SceneManager.face_battler?
  2181.       mog_battle_hud_ex_show_actor
  2182.   end
  2183.   end
  2184.   
  2185. #--------------------------------------------------------------------------
  2186. # * Show
  2187. #--------------------------------------------------------------------------   
  2188.   alias mog_bg_ex_slide_show_actor show
  2189.   def show
  2190.       self.viewport = nil
  2191.       self.x = @org_position[0] ; self.y = @org_position[1]
  2192.       if ACTOR_WINDOW_SLIDE_EFFECT
  2193.          self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2194.          self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2195.       end
  2196.       self.opacity = ACTOR_WINDOW_OPACITY
  2197.       mog_bg_ex_slide_show_actor
  2198.   end  
  2199.   
  2200. #--------------------------------------------------------------------------
  2201. # * Update
  2202. #--------------------------------------------------------------------------  
  2203. alias mog_monogatari_actor_window_update update
  2204. def update
  2205.      mog_monogatari_actor_window_update   
  2206.      self.visible = self.active
  2207.      self.visible = false if @force_hide
  2208.      if @layout != nil        
  2209.         refresh_layout if @layout.visible != self.visible        
  2210.      end
  2211.      if !$game_temp.sprite_visible   
  2212.         self.visible = false
  2213.         @layout.visible = self.visible if @layout != nil
  2214.      end   
  2215.      execute_slide_effect if self.visible
  2216.   end  

  2217. end

  2218. #==============================================================================
  2219. # ** Window_BattleEnemy
  2220. #==============================================================================
  2221. class Window_BattleEnemy < Window_Selectable
  2222.   
  2223.   include MOG_BATTLE_HUD_EX
  2224.   
  2225.   #--------------------------------------------------------------------------
  2226.   # * Initialize
  2227.   #--------------------------------------------------------------------------   
  2228.   alias mog_monogatari_battle_enemy_initialize initialize
  2229.   def initialize(info_viewport)
  2230.       @force_hide = can_force_hide?
  2231.       mog_monogatari_battle_enemy_initialize(info_viewport)
  2232.       self.width = ENEMY_WINDOW_SIZE[0]
  2233.       self.height = ENEMY_WINDOW_SIZE[1]      
  2234.       @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2235.                        ENEMY_WINDOW_POSITION[1] - self.height]
  2236.       @org_position[1] = Graphics.height + 64 if @force_hide               
  2237.       self.x = @org_position[0]
  2238.       self.y = @org_position[1]      
  2239.       self.opacity = ENEMY_WINDOW_OPACITY
  2240.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2241.       create_layout
  2242.   end  
  2243.   
  2244.   #--------------------------------------------------------------------------
  2245.   # * Can Force Hide?
  2246.   #--------------------------------------------------------------------------   
  2247.   def can_force_hide?
  2248.       return true if $imported[:ve_target_arrow]
  2249.       return true if $imported[:mog_battle_cursor]
  2250.       return false
  2251.   end   
  2252.   
  2253. #--------------------------------------------------------------------------
  2254. # * Dispose
  2255. #--------------------------------------------------------------------------
  2256. alias mog_monogatari_enemy_window_dispose dispose
  2257. def dispose
  2258.      mog_monogatari_enemy_window_dispose
  2259.      dispose_layout
  2260. end

  2261. #--------------------------------------------------------------------------
  2262. # * Create Layout
  2263. #--------------------------------------------------------------------------   
  2264. def create_layout
  2265.      return if @layout != nil
  2266.      return if !ENEMY_WINDOW_LAYOUT
  2267.      return if $game_temp.mbhud_window[4]
  2268.      $game_temp.mbhud_window[4] = true     
  2269.      @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2270.      @layout = Sprite.new
  2271.      @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2272.      @layout.z = self.z - 1
  2273.      refresh_layout
  2274.      @layout.visible = false
  2275. end

  2276. #--------------------------------------------------------------------------
  2277. # * Dispose Layout
  2278. #--------------------------------------------------------------------------
  2279. def dispose_layout
  2280.      return if @layout == nil
  2281.      @layout.dispose
  2282.      @layout = nil
  2283. end

  2284. #--------------------------------------------------------------------------
  2285. # * Refresh Layout
  2286. #--------------------------------------------------------------------------
  2287. def refresh_layout
  2288.      return if @layout == nil
  2289.      @layout.x = @org_position_2[0]
  2290.      @layout.y = @org_position_2[1]
  2291.      @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2292.      @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2293.      @layout.visible = self.visible
  2294. end      
  2295.   
  2296. #--------------------------------------------------------------------------
  2297. # * Show
  2298. #--------------------------------------------------------------------------   
  2299.   alias mog_bg_ex_slide_show_enemy show
  2300.   def show
  2301.       self.viewport = nil
  2302.       self.x = @org_position[0] ; self.y = @org_position[1]
  2303.       if ENEMY_WINDOW_SLIDE_EFFECT
  2304.          self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2305.          self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2306.       end
  2307.       self.opacity = ENEMY_WINDOW_OPACITY
  2308.       mog_bg_ex_slide_show_enemy
  2309.   end  
  2310.   
  2311. #--------------------------------------------------------------------------
  2312. # * Update
  2313. #--------------------------------------------------------------------------  
  2314. alias mog_monogatari_enemy_window_update update
  2315. def update
  2316.      mog_monogatari_enemy_window_update
  2317.      self.visible = false if @force_hide
  2318.      if @layout != nil and @layout.visible != self.visible        
  2319.         refresh_layout
  2320.      end
  2321.      if !$game_temp.sprite_visible   
  2322.         self.visible = false
  2323.         @layout.visible = self.visible if @layout != nil
  2324.      end   
  2325.      execute_slide_effect if self.visible
  2326.   end   
  2327.   
  2328.   if $imported["YEA-BattleEngine"]
  2329.   #--------------------------------------------------------------------------
  2330.   # * Draw Item
  2331.   #--------------------------------------------------------------------------
  2332.   def draw_item(index)
  2333.       change_color(normal_color)
  2334.       name = $game_troop.alive_members[index].name
  2335.       draw_text(item_rect_for_text(index), name)
  2336.   end
  2337.   end

  2338.   #--------------------------------------------------------------------------
  2339.   # * Process Cursor Move
  2340.   #--------------------------------------------------------------------------
  2341.   alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2342.   def process_cursor_move
  2343.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2344.       mog_atb_wenemy_process_cursor_move
  2345.   end

  2346.   #--------------------------------------------------------------------------
  2347.   # * Process Handling
  2348.   #--------------------------------------------------------------------------
  2349.   alias mog_atb_wenemy_process_handling process_handling
  2350.   def process_handling  
  2351.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2352.       mog_atb_wenemy_process_handling
  2353.   end  
  2354.   
  2355. end

  2356. #==============================================================================
  2357. # ** Window_BattleSkill
  2358. #==============================================================================
  2359. class Window_BattleSkill < Window_SkillList
  2360. include MOG_BATTLE_HUD_EX

  2361. #--------------------------------------------------------------------------
  2362. # * Initialize
  2363. #--------------------------------------------------------------------------   
  2364. alias mog_monogatari_battle_skill_initialize initialize
  2365. def initialize(help_window, info_viewport)
  2366.      @force_hide = can_force_hide?
  2367.      @force_hide_active = can_force_hide_active?     
  2368.      mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2369.      self.width = SKILL_WINDOW_SIZE[0]
  2370.      self.height = SKILL_WINDOW_SIZE[1]   
  2371.      @org_position = [SKILL_WINDOW_POSITION[0],
  2372.           Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2373.      self.x = @org_position[0]
  2374.      self.y = @org_position[1]
  2375.      self.opacity = SKILL_WINDOW_OPACITY
  2376.      self.viewport = nil
  2377.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2378.      create_layout
  2379. end
  2380.   
  2381. #--------------------------------------------------------------------------
  2382. # * Col Max
  2383. #--------------------------------------------------------------------------   
  2384.   def col_max
  2385.       return SKILL_COL_MAX
  2386.   end

  2387. #--------------------------------------------------------------------------
  2388. # * Can Force Hide Active?
  2389. #--------------------------------------------------------------------------   
  2390. def can_force_hide_active?
  2391.      return true if $imported[:ve_target_arrow]
  2392.      return true if $imported[:mog_battle_cursor] != nil
  2393.      return false
  2394. end   

  2395.   #--------------------------------------------------------------------------
  2396.   # * Can Force Hide?
  2397.   #--------------------------------------------------------------------------   
  2398.   def can_force_hide?
  2399.       return false
  2400.   end

  2401. #--------------------------------------------------------------------------
  2402. # * Dispose
  2403. #--------------------------------------------------------------------------
  2404. alias mog_monogatari_skill_window_dispose dispose
  2405. def dispose
  2406.      mog_monogatari_skill_window_dispose
  2407.      dispose_layout
  2408. end

  2409. #--------------------------------------------------------------------------
  2410. # * Create Layout
  2411. #--------------------------------------------------------------------------   
  2412. def create_layout
  2413.      return if @layout != nil
  2414.      return if !SKILL_WINDOW_LAYOUT
  2415.      return if $game_temp.mbhud_window[5]
  2416.      $game_temp.mbhud_window[5] = true
  2417.      @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2418.      @layout = Sprite.new
  2419.      @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2420.      @layout.z = self.z - 1
  2421.      refresh_layout
  2422.      @layout.visible = false
  2423. end

  2424. #--------------------------------------------------------------------------
  2425. # * Dispose Layout
  2426. #--------------------------------------------------------------------------
  2427. def dispose_layout
  2428.      return if @layout == nil
  2429.      @layout.dispose
  2430.      @layout = nil
  2431. end

  2432. #--------------------------------------------------------------------------
  2433. # * Refresh Layout
  2434. #--------------------------------------------------------------------------
  2435. def refresh_layout
  2436.      return if @layout == nil
  2437.      @layout.x = @org_position_2[0]
  2438.      @layout.y = @org_position_2[1]
  2439.      @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2440.      @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2441.      @layout.visible = self.visible
  2442. end  
  2443.   
  2444. #--------------------------------------------------------------------------
  2445. # * Show
  2446. #--------------------------------------------------------------------------   
  2447.   alias mog_bg_ex_slide_show_skill show
  2448.   def show
  2449.       self.viewport = nil
  2450.       self.x = @org_position[0] ; self.y = @org_position[1]
  2451.       if SKILL_WINDOW_SLIDE_EFFECT
  2452.          self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2453.          self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2454.       end
  2455.       self.opacity = SKILL_WINDOW_OPACITY
  2456.       mog_bg_ex_slide_show_skill
  2457.   end

  2458. #--------------------------------------------------------------------------
  2459. # * Update
  2460. #--------------------------------------------------------------------------  
  2461. alias mog_monogatari_skill_window_update update
  2462. def update
  2463.      mog_monogatari_skill_window_update
  2464.      self.visible = self.active if @force_hide_active
  2465.      self.visible = false if @force_hide
  2466.      if @layout != nil and @layout.visible != self.visible        
  2467.         refresh_layout
  2468.     end
  2469.     self.visible = false if !$game_temp.sprite_visible
  2470.     execute_slide_effect if self.visible
  2471. end
  2472.   
  2473. end

  2474. #==============================================================================
  2475. # ** Window_BattleItem
  2476. #==============================================================================
  2477. class Window_BattleItem < Window_ItemList
  2478.   include MOG_BATTLE_HUD_EX

  2479. #--------------------------------------------------------------------------
  2480. # * Initialize
  2481. #--------------------------------------------------------------------------  
  2482. alias mog_monogatari_battle_item_initialize initialize
  2483. def initialize(help_window, info_viewport)
  2484.      @force_hide = can_force_hide?
  2485.      @force_hide_active = can_force_hide_active?
  2486.      mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2487.      self.width = ITEM_WINDOW_SIZE[0]
  2488.      self.height = ITEM_WINDOW_SIZE[1]
  2489.      @org_position = [ITEM_WINDOW_POSITION[0],
  2490.           Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2491.      self.x = @org_position[0]
  2492.      self.y = @org_position[1]
  2493.      self.viewport = nil
  2494.      self.opacity = ITEM_WINDOW_OPACITY
  2495.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2496.      create_layout
  2497. end  

  2498. #--------------------------------------------------------------------------
  2499. # * Col Max
  2500. #--------------------------------------------------------------------------   
  2501.   def col_max
  2502.       return ITEM_COL_MAX
  2503.   end  

  2504. #--------------------------------------------------------------------------
  2505. # * Can Force Hide Active?
  2506. #--------------------------------------------------------------------------   
  2507. def can_force_hide_active?
  2508.      return true if $imported[:ve_target_arrow]
  2509.      return true if $imported[:mog_battle_cursor] != nil
  2510.      return false
  2511. end  

  2512. #--------------------------------------------------------------------------
  2513. # * Can Force Hide?
  2514. #--------------------------------------------------------------------------   
  2515. def can_force_hide?
  2516.      return false
  2517. end

  2518. #--------------------------------------------------------------------------
  2519. # * Dispose
  2520. #--------------------------------------------------------------------------
  2521. alias mog_monogatari_item_window_dispose dispose
  2522. def dispose
  2523.      mog_monogatari_item_window_dispose
  2524.      dispose_layout
  2525. end

  2526. #--------------------------------------------------------------------------
  2527. # * Create Layout
  2528. #--------------------------------------------------------------------------   
  2529. def create_layout
  2530.      return if @layout != nil
  2531.      return if !ITEM_WINDOW_LAYOUT
  2532.      return if $game_temp.mbhud_window[6]
  2533.      $game_temp.mbhud_window[6] = true
  2534.      @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2535.      @layout = Sprite.new
  2536.      @layout.bitmap = Cache.battle_hud("Layout_Item")
  2537.      @layout.z = self.z - 1
  2538.      refresh_layout
  2539.      @layout.visible = false
  2540. end

  2541. #--------------------------------------------------------------------------
  2542. # * Dispose Layout
  2543. #--------------------------------------------------------------------------
  2544. def dispose_layout
  2545.      return if @layout == nil
  2546.      @layout.dispose
  2547.      @layout = nil
  2548. end

  2549. #--------------------------------------------------------------------------
  2550. # * Refresh Layout
  2551. #--------------------------------------------------------------------------
  2552. def refresh_layout
  2553.      return if @layout == nil
  2554.      @layout.x = @org_position_2[0]
  2555.      @layout.y = @org_position_2[1]
  2556.      @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2557.      @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2558.      @layout.visible = self.visible
  2559. end  

  2560. #--------------------------------------------------------------------------
  2561. # * Show
  2562. #--------------------------------------------------------------------------   
  2563.   alias mog_bg_ex_slide_show_item show
  2564.   def show
  2565.       self.viewport = nil
  2566.       self.x = @org_position[0] ; self.y = @org_position[1]
  2567.       if ITEM_WINDOW_SLIDE_EFFECT
  2568.          self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2569.          self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2570.       end
  2571.       self.opacity = ITEM_WINDOW_OPACITY
  2572.       mog_bg_ex_slide_show_item      
  2573.   end

  2574. #--------------------------------------------------------------------------
  2575. # * Update
  2576. #--------------------------------------------------------------------------  
  2577. alias mog_monogatari_item_window_update update
  2578. def update
  2579.      mog_monogatari_item_window_update
  2580.      self.visible = self.active if @force_hide_active
  2581.      self.visible = false if @force_hide
  2582.      if @layout != nil
  2583.         refresh_layout if @layout.visible != self.visible
  2584.      end
  2585.      self.visible = false if !$game_temp.sprite_visible
  2586.      execute_slide_effect if self.visible
  2587.   end  

  2588. end

  2589. end

  2590. #--------------------------------------------------------------------------
  2591. #--------------------------------------------------------------------------
  2592. #################################
  2593. if $imported["YEA-BattleEngine"]
  2594. #################################

  2595. #==============================================================================
  2596. # ** Window_BattleStatusAid
  2597. #==============================================================================
  2598. class Window_BattleStatusAid < Window_BattleStatus
  2599.   
  2600. #--------------------------------------------------------------------------
  2601. # * Refresh
  2602. #--------------------------------------------------------------------------   
  2603.   def refresh
  2604.       contents.clear
  2605.       self.visible = false
  2606.   end
  2607.    
  2608. end

  2609. #==============================================================================
  2610. # ** Window_BattleStatus
  2611. #==============================================================================
  2612. class Window_BattleStatus < Window_Selectable

  2613. #--------------------------------------------------------------------------
  2614. # * Update
  2615. #--------------------------------------------------------------------------
  2616. alias mog_monogatari_bhud_yf_update update
  2617. def update
  2618.      mog_monogatari_bhud_yf_update
  2619.      update_visible_yf
  2620. end

  2621. #--------------------------------------------------------------------------
  2622. # * Update Visible Yf
  2623. #--------------------------------------------------------------------------
  2624. def update_visible_yf
  2625.      self.visible = self.active
  2626.      self.visible = false if !$game_temp.sprite_visible
  2627. end

  2628. end  

  2629. #==============================================================================
  2630. # ■ Window ActorCommand
  2631. #==============================================================================
  2632. class Window_ActorCommand < Window_Command
  2633.   
  2634. #--------------------------------------------------------------------------
  2635. # * Show
  2636. #--------------------------------------------------------------------------
  2637.   alias mog_bhud_yf_command_show show
  2638.   def show
  2639.       return if !BattleManager.can_enable_window?
  2640.       mog_bhud_yf_command_show
  2641.   end
  2642.   
  2643. #--------------------------------------------------------------------------
  2644. # * Update
  2645. #--------------------------------------------------------------------------
  2646. alias mog_monogatari_bhud_yf_actorcommand_update update
  2647. def update
  2648.      mog_monogatari_bhud_yf_actorcommand_update
  2649.      update_visible_yf
  2650. end

  2651. #--------------------------------------------------------------------------
  2652. # * Update Visible Yf
  2653. #--------------------------------------------------------------------------
  2654. def update_visible_yf
  2655.      self.visible = self.active
  2656.      self.visible = false if !$game_temp.sprite_visible
  2657. end

  2658. end

  2659. #==============================================================================
  2660. # ** Scene Battle
  2661. #==============================================================================
  2662. class Scene_Battle < Scene_Base
  2663.   
  2664.   include MOG_BATTLE_HUD_EX
  2665.   
  2666.   #--------------------------------------------------------------------------
  2667.   # alias method: create_skill_window
  2668.   #--------------------------------------------------------------------------
  2669.   alias mog_yf_scene_battle_create_skill_window create_skill_window
  2670.   def create_skill_window
  2671.       mog_yf_scene_battle_create_skill_window
  2672.       @skill_window.width = SKILL_WINDOW_SIZE[0]
  2673.       @skill_window.height = SKILL_WINDOW_SIZE[1]
  2674.       @skill_window.x = SKILL_WINDOW_POSITION[0]
  2675.       @skill_window.y = SKILL_WINDOW_POSITION[1]
  2676.   end
  2677.   
  2678.   #--------------------------------------------------------------------------
  2679.   # alias method: create_item_window
  2680.   #--------------------------------------------------------------------------
  2681.   alias mog_yf_scene_battle_create_item_window create_item_window
  2682.   def create_item_window
  2683.       mog_yf_scene_battle_create_item_window
  2684.       @item_window.width = ITEM_WINDOW_SIZE[0]
  2685.       @item_window.height = ITEM_WINDOW_SIZE[1]
  2686.       @item_window.x = ITEM_WINDOW_POSITION[0]
  2687.       @item_window.y = ITEM_WINDOW_POSITION[1]
  2688.   end  
  2689.   
  2690. if !$imported[:mog_atb_system]
  2691. #--------------------------------------------------------------------------
  2692. # * Next Command
  2693. #--------------------------------------------------------------------------
  2694.   def next_command
  2695.     if BattleManager.next_command
  2696.        @status_window.show
  2697.        redraw_current_status
  2698.        @actor_command_window.show
  2699.        @status_aid_window.hide      
  2700.        start_actor_command_selection
  2701.     else
  2702.       turn_start
  2703.     end
  2704.   end
  2705.   end

  2706. #--------------------------------------------------------------------------
  2707. # * STW Can Visible
  2708. #--------------------------------------------------------------------------   
  2709.   def stw_can_visible?
  2710.       return false if !BattleManager.can_enable_window?
  2711.       return false if @item_window.visible
  2712.       return false if @skill_window.visible
  2713.       return true if @actor_window.active
  2714.       return false
  2715.   end

  2716. if $imported["YEA-CommandEquip"]
  2717. #--------------------------------------------------------------------------
  2718. # * Command Equip
  2719. #--------------------------------------------------------------------------   
  2720.   alias mog_yf_command_equip command_equip
  2721.   def command_equip
  2722.       @actor_command_window.visible = false
  2723.       @actor_command_window.update
  2724.       $game_temp.battle_hud_visible_refresh = [true,false]
  2725.       @spriteset.update_battle_hud_ex
  2726.       @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2727.       mog_yf_command_equip
  2728.       $game_temp.battle_hud_visible_refresh = [true,true]
  2729.   end
  2730.   end
  2731.   
  2732. end

  2733. end
  2734. #--------------------------------------------------------------------------


  2735. ######################################
  2736. if $imported["YEA-EnemyTargetInfo"]
  2737. ######################################

  2738. #==============================================================================
  2739. # ■ Window_Comparison
  2740. #==============================================================================
  2741. class Window_Comparison < Window_Base
  2742.   
  2743.   #--------------------------------------------------------------------------
  2744.   # * Refresh
  2745.   #--------------------------------------------------------------------------     
  2746.   alias mog_battle_hud_ex_yf_refresh refresh
  2747.   def refresh
  2748.       mog_battle_hud_ex_yf_refresh
  2749.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2750.       self.viewport = nil
  2751.   end
  2752.   
  2753. end

  2754. #==============================================================================
  2755. # ■ Window_ComparisonHelp
  2756. #==============================================================================
  2757. class Window_ComparisonHelp < Window_Base
  2758.   
  2759.   #--------------------------------------------------------------------------
  2760.   # * Refresh
  2761.   #--------------------------------------------------------------------------     
  2762.   alias mog_battle_hud_ex_yf_refresh refresh
  2763.   def refresh
  2764.       mog_battle_hud_ex_yf_refresh
  2765.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2766.       self.viewport = nil
  2767.   end
  2768.   
  2769. end
  2770. end
  2771. #--------------------------------------------------------------------------
  2772. #--------------------------------------------------------------------------


  2773. #################################
  2774. if $imported["YEA-EnemyTargetInfo"]
  2775. #################################
  2776. class Window_Comparison < Window_Base
  2777.   
  2778.   #--------------------------------------------------------------------------
  2779.   # initialize
  2780.   #--------------------------------------------------------------------------
  2781.   alias mog_battle_hud_yf_wcomparison_initialize initialize
  2782.   def initialize(type)
  2783.       mog_battle_hud_yf_wcomparison_initialize(type)
  2784.       self.z = 102
  2785.   end  
  2786.   
  2787. end
  2788. end
  2789. #--------------------------------------------------------------------------
  2790. #--------------------------------------------------------------------------

  2791. #--------------------------------------------------------------------------
  2792. #--------------------------------------------------------------------------
  2793. #################################
  2794. if $imported["YSA-CATB"]
  2795. #################################

  2796. #==============================================================================
  2797. # ■ Enemy CATB Gauge Viewport
  2798. #==============================================================================
  2799. class Enemy_CATB_Gauge_Viewport < Viewport
  2800.   
  2801.   #--------------------------------------------------------------------------
  2802.   # initialize
  2803.   #--------------------------------------------------------------------------
  2804.   alias mog_battle_hud_ex_yami_initialize initialize
  2805.   def initialize(battler, sprite, type)
  2806.       mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2807.       self.z = 90
  2808.   end

  2809. end
  2810.   
  2811. #==============================================================================
  2812. # ■ Game_Battler
  2813. #==============================================================================
  2814. class Game_Battler < Game_BattlerBase
  2815.   
  2816.   attr_accessor :catb_value  
  2817.   attr_accessor :max_atb
  2818.   
  2819.   #--------------------------------------------------------------------------
  2820.   # * Max ATB
  2821.   #--------------------------------------------------------------------------   
  2822.   def max_atb
  2823.       return MAX_CATB_VALUE
  2824.       return 1
  2825.   end
  2826.   
  2827. end

  2828. end
  2829. #--------------------------------------------------------------------------
  2830. #--------------------------------------------------------------------------

  2831. #==============================================================================
  2832. # ** Window Base
  2833. #==============================================================================
  2834. class Window_Base < Window
  2835.   
  2836. #--------------------------------------------------------------------------
  2837. # * Execute Move W
  2838. #--------------------------------------------------------------------------      
  2839. def execute_move_w(sprite,type,cp,np)
  2840.      sp = 6 + ((cp - np).abs / 10)
  2841.      if cp > np ;    cp -= sp ; cp = np if cp < np
  2842.         elsif cp < np ; cp += sp ; cp = np if cp > np
  2843.      end     
  2844.      sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2845. end
  2846.    
  2847. #--------------------------------------------------------------------------
  2848. # * Set BH EX Font
  2849. #--------------------------------------------------------------------------   
  2850.   def set_bh_ex_font
  2851.       return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2852.       self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2853.       self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2854.       self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2855.       self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2856.   end
  2857.   
  2858. #--------------------------------------------------------------------------
  2859. # * Execute Slide Effect
  2860. #--------------------------------------------------------------------------   
  2861. def execute_slide_effect
  2862.      return if @org_position == nil
  2863.      execute_move_w(self,0,self.x,@org_position[0])
  2864.      execute_move_w(self,1,self.y,@org_position[1])
  2865.      return if @layout == nil
  2866.      execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  2867.      execute_move_w(@layout,1,@layout.y,@org_position_2[1])     
  2868. end     
  2869.   
  2870. end

  2871. #==============================================================================
  2872. # ** Window Help
  2873. #==============================================================================
  2874. class Window_Help < Window_Base
  2875.   
  2876. #--------------------------------------------------------------------------
  2877. # * Draw Text
  2878. #--------------------------------------------------------------------------   
  2879.   alias mog_bh_ex_draw_text_help draw_text
  2880.   def draw_text(*args)
  2881.       set_bh_ex_font
  2882.       mog_bh_ex_draw_text_help(*args)
  2883.   end
  2884.   
  2885. end

  2886. #==============================================================================
  2887. # ** Window BattleActor
  2888. #==============================================================================
  2889. class Window_BattleActor < Window_BattleStatus

  2890. #--------------------------------------------------------------------------
  2891. # * Draw Item
  2892. #--------------------------------------------------------------------------   
  2893.   alias mog_bbex_draw_item_actor draw_item
  2894.   def draw_item(index)
  2895.       set_bh_ex_font
  2896.       mog_bbex_draw_item_actor(index)
  2897.   end
  2898.   
  2899. end

  2900. #==============================================================================
  2901. # ** Window BattleEnemy
  2902. #==============================================================================
  2903. class Window_BattleEnemy < Window_Selectable
  2904.   
  2905. #--------------------------------------------------------------------------
  2906. # * Draw Item
  2907. #--------------------------------------------------------------------------   
  2908.   alias mog_bbex_draw_item_enemy draw_item
  2909.   def draw_item(index)
  2910.       set_bh_ex_font
  2911.       mog_bbex_draw_item_enemy(index)
  2912.   end
  2913.   
  2914. end

  2915. #==============================================================================
  2916. # ** Window ItemList
  2917. #==============================================================================
  2918. class Window_ItemList < Window_Selectable
  2919.   
  2920. #--------------------------------------------------------------------------
  2921. # * Draw Item Name
  2922. #--------------------------------------------------------------------------   
  2923.    alias mog_bhex_draw_item_name_item draw_item_name
  2924.    def draw_item_name(item, x, y, enabled = true, width = 172)
  2925.        set_bh_ex_font
  2926.        mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  2927.    end  

  2928. end

  2929. #==============================================================================
  2930. # ** Window SkillList
  2931. #==============================================================================
  2932. class Window_SkillList < Window_Selectable  

  2933. #--------------------------------------------------------------------------
  2934. # * Draw Item Name
  2935. #--------------------------------------------------------------------------   
  2936.    alias mog_bhex_draw_item_name_skill draw_item_name
  2937.    def draw_item_name(item, x, y, enabled = true, width = 172)
  2938.        set_bh_ex_font
  2939.        mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  2940.    end   
  2941.    
  2942. end

  2943. #==============================================================================
  2944. # ** Spriteset_Battle
  2945. #==============================================================================
  2946. class Spriteset_Battle

  2947.   #--------------------------------------------------------------------------
  2948.   # * Initialize
  2949.   #--------------------------------------------------------------------------
  2950.   alias mog_battle_hud_ex_initialize initialize
  2951.   def initialize
  2952.       check_screen_xyz_nil rescue nil
  2953.       mog_battle_hud_ex_initialize
  2954.       create_battle_hud_ex
  2955.   end
  2956.   
  2957.   #--------------------------------------------------------------------------
  2958.   # * Check Screen Xyz
  2959.   #--------------------------------------------------------------------------   
  2960.   def check_screen_xyz_nil
  2961.       return if !SceneManager.face_battler?
  2962.       for actor in $game_party.battle_members
  2963.           actor.screen_x = 0 if actor.screen_x == nil
  2964.           actor.screen_y = 0 if actor.screen_y == nil
  2965.           actor.screen_z = 0 if actor.screen_z == nil
  2966.       end
  2967.   end
  2968.   
  2969.   #--------------------------------------------------------------------------
  2970.   # * Check Screen Xyz after
  2971.   #--------------------------------------------------------------------------     
  2972.   def check_screen_xyz_after
  2973.       return if !SceneManager.face_battler?
  2974.       $game_party.battle_members.each_with_index do |actor, index|
  2975.           actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  2976.           actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  2977.           actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  2978.       end   
  2979.   end
  2980.   
  2981.   #--------------------------------------------------------------------------
  2982.   # * Dispose
  2983.   #--------------------------------------------------------------------------  
  2984.   alias mog_battle_hud_ex_dispose dispose
  2985.   def dispose
  2986.       dispose_battle_hud_ex
  2987.       mog_battle_hud_ex_dispose
  2988.   end
  2989.   
  2990.   #--------------------------------------------------------------------------
  2991.   # * Update
  2992.   #--------------------------------------------------------------------------  
  2993.   alias mog_battle_hud_ex_update update
  2994.   def update
  2995.       mog_battle_hud_ex_update
  2996.       update_battle_hud_ex
  2997.   end
  2998.   
  2999.   #--------------------------------------------------------------------------
  3000.   # * Create Battle Hud EX
  3001.   #--------------------------------------------------------------------------   
  3002.   def create_battle_hud_ex
  3003.       return if @battle_hud_ex != nil
  3004.       $game_temp.battle_hud_visible = true
  3005.       @battle_hud_ex = Monogatari_Bhud.new(nil)
  3006.       check_screen_xyz_after
  3007.   end
  3008.   
  3009.   #--------------------------------------------------------------------------
  3010.   # * Dispose Battle Hud EX
  3011.   #--------------------------------------------------------------------------   
  3012.   def dispose_battle_hud_ex
  3013.       return if @battle_hud_ex == nil
  3014.       @battle_hud_ex.dispose
  3015.       @battle_hud_ex = nil
  3016.       $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3017.   end
  3018.   
  3019.   #--------------------------------------------------------------------------
  3020.   # * Update Battle Hud EX
  3021.   #--------------------------------------------------------------------------   
  3022.   def update_battle_hud_ex
  3023.       refresh_battle_hud if $game_temp.mbhud_force_refresh
  3024.       return if @battle_hud_ex == nil
  3025.       @battle_hud_ex.update
  3026.   end
  3027.   
  3028.   #--------------------------------------------------------------------------
  3029.   # * Refresh Battle Hud
  3030.   #--------------------------------------------------------------------------   
  3031.   def refresh_battle_hud
  3032.       $game_temp.mbhud_force_refresh = false
  3033.       check_screen_xyz_nil rescue nil
  3034.       dispose_battle_hud_ex
  3035.       create_battle_hud_ex
  3036.   end
  3037.   
  3038. end

  3039. #==============================================================================
  3040. # ** Monogatari Bhud
  3041. #==============================================================================
  3042. class Monogatari_Bhud
  3043.   
  3044.   include MOG_BATTLE_HUD_EX
  3045.   
  3046.   #--------------------------------------------------------------------------
  3047.   # * Initialize
  3048.   #--------------------------------------------------------------------------  
  3049.   def initialize(viewport)
  3050.       @battle_hud = [] ; @sprite_visitle_wait = 0
  3051.       $game_party.battle_members.each_with_index do |actor, index|
  3052.       @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3053.       create_turn_sprite(nil)
  3054.       create_screen_layout(nil)      
  3055.   end
  3056.   
  3057.   #--------------------------------------------------------------------------
  3058.   # * Max members
  3059.   #--------------------------------------------------------------------------   
  3060.   def max_members
  3061.       if $game_party.members.size > $game_party.max_battle_members
  3062.          return $game_party.max_battle_members
  3063.       end   
  3064.       return $game_party.members.size
  3065.   end
  3066.   
  3067.   #--------------------------------------------------------------------------
  3068.   # * Dispose
  3069.   #--------------------------------------------------------------------------   
  3070.   def dispose
  3071.       @battle_hud.each {|sprite| sprite.dispose }
  3072.       dispose_turn_sprite
  3073.       dispose_screen_layout
  3074.   end
  3075.   
  3076.   #--------------------------------------------------------------------------
  3077.   # * Update
  3078.   #--------------------------------------------------------------------------   
  3079.   def update
  3080.       @battle_hud.each {|sprite| sprite.update }
  3081.       update_turn_sprite
  3082.       update_screen_layout
  3083.       refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3084.   end
  3085.   
  3086.   #--------------------------------------------------------------------------
  3087.   # * Update
  3088.   #--------------------------------------------------------------------------   
  3089.   def refresh_battle_hud_visible
  3090.       $game_temp.battle_hud_visible_refresh[0] = false
  3091.       @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3092.       @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3093.       @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3094.       @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3095. end
  3096.   
  3097. end

  3098. #==============================================================================
  3099. # ** Monogatari Bhud
  3100. #==============================================================================
  3101. class Monogatari_Bhud
  3102.   
  3103. #--------------------------------------------------------------------------
  3104. # * Can Update Turn Sprite
  3105. #--------------------------------------------------------------------------
  3106.   def can_refresh_turn_sprite?
  3107.       return true if @turn_sprite.visible != $game_temp.command_visible
  3108.       return true if $game_temp.refresh_turn_sprite
  3109.       return false
  3110.   end
  3111.   
  3112. #--------------------------------------------------------------------------
  3113. # * Create Turn Sprite
  3114. #--------------------------------------------------------------------------
  3115.   def create_turn_sprite(viewport)
  3116.       return if !TURN_SPRITE_VISIBLE
  3117.       return if @turn_sprite != nil
  3118.       @turn_sprite = Sprite.new
  3119.       @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3120.       @turn_sprite.viewport = viewport
  3121.       @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3122.       @turn_sprite.visible = false
  3123.       @turn_sprite_update_time = 5
  3124.       @turn_sprite_blink = [0,0]
  3125.   end
  3126.   
  3127. #--------------------------------------------------------------------------
  3128. # * Dispose Turn Sprite
  3129. #--------------------------------------------------------------------------
  3130.   def dispose_turn_sprite
  3131.       return if @turn_sprite == nil
  3132.       @turn_sprite.dispose
  3133.       @turn_sprite = nil
  3134.   end
  3135.   
  3136. #--------------------------------------------------------------------------
  3137. # * Update Turn Sprite
  3138. #--------------------------------------------------------------------------
  3139.   def update_turn_sprite
  3140.       return if @turn_sprite == nil
  3141.       if @turn_sprite_update_time > 0
  3142.          @turn_sprite_update_time -= 1
  3143.          return
  3144.       end  
  3145.       update_turn_visible
  3146.       update_turn_blink
  3147.   end
  3148.   
  3149. #--------------------------------------------------------------------------
  3150. # * Update Turn Visible
  3151. #--------------------------------------------------------------------------   
  3152.   def update_turn_visible   
  3153.       $game_temp.refresh_turn_sprite = false
  3154.       @turn_sprite.visible = can_turn_sprite_visible?
  3155.       return if BattleManager.actor == nil
  3156.       x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3157.       y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3158.       x = -1000 if x == nil ; y = -1000 if y == nil
  3159.       @turn_sprite.x = x ; @turn_sprite.y = y      
  3160. end
  3161.   
  3162. #--------------------------------------------------------------------------
  3163. # * Can Turn Sprite Visible?
  3164. #--------------------------------------------------------------------------   
  3165. def can_turn_sprite_visible?
  3166.      return false if BattleManager.actor == nil
  3167.      return false if $game_temp.battle_end
  3168.      return false if $game_message.visible
  3169.      return true
  3170. end
  3171.    
  3172. #--------------------------------------------------------------------------
  3173. # * Update Turn Blink
  3174. #--------------------------------------------------------------------------   
  3175. def update_turn_blink
  3176.      return if !TURN_BLINK_EFFECT
  3177.      return if !@turn_sprite.visible
  3178.      @turn_sprite_blink[0] += 1
  3179.      case @turn_sprite_blink[0]
  3180.        when 0..30
  3181.           @turn_sprite_blink[1] += 3
  3182.        when 31..60
  3183.           @turn_sprite_blink[1] -= 3
  3184.        else
  3185.          @turn_sprite_blink = [0,0]
  3186.      end
  3187.      @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  3188. end

  3189.   
  3190. end

  3191. #==============================================================================
  3192. # ** Monogatari Bhud
  3193. #==============================================================================
  3194. class Monogatari_Bhud
  3195.   
  3196.   #--------------------------------------------------------------------------
  3197.   # * Create Screen Layout
  3198.   #--------------------------------------------------------------------------   
  3199.   def create_screen_layout(viewport)
  3200.       return if !SCREEN_LAYOUT
  3201.       @screen_layout = Sprite.new
  3202.       @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3203.       @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3204.       @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3205.       @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3206.       @screen_layout.opacity = 0
  3207.       @screen_layout.viewport = viewport
  3208.    end     
  3209.   
  3210.   #--------------------------------------------------------------------------
  3211.   # * Dispose Screen Layout
  3212.   #--------------------------------------------------------------------------
  3213.    def dispose_screen_layout
  3214.        return if @screen_layout == nil
  3215.        @screen_layout.dispose ; @screen_layout = nil     
  3216.    end
  3217.    
  3218.   #--------------------------------------------------------------------------
  3219.   # * Update Screen Layout
  3220.   #--------------------------------------------------------------------------
  3221.    def update_screen_layout
  3222.        return if @screen_layout == nil
  3223.        @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3224.        sprite_visible(@screen_layout)
  3225.    end
  3226.    
  3227.   #--------------------------------------------------------------------------
  3228.   # * Sprite Visible
  3229.   #--------------------------------------------------------------------------
  3230.   def sprite_visible?
  3231.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3232.       return false if !$game_temp.battle_hud_visible
  3233.       return false if !$game_temp.sprite_visible
  3234.       return true
  3235.   end
  3236.   
  3237.   #--------------------------------------------------------------------------
  3238.   # * Sprite Visible
  3239.   #--------------------------------------------------------------------------
  3240.   def sprite_visible(sprite)      
  3241.       if sprite_visible?
  3242.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3243.       else
  3244.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3245.       end
  3246.   end   
  3247.    
  3248. end

  3249. #==============================================================================
  3250. #==============================================================================
  3251. # ** Battle Hud EX
  3252. #==============================================================================
  3253. #==============================================================================
  3254. class Battle_Hud_EX
  3255.   include MOG_BATTLE_HUD_EX
  3256.   
  3257.   #--------------------------------------------------------------------------
  3258.   # * Initialize
  3259.   #--------------------------------------------------------------------------  
  3260.   def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3261.       pre_cache
  3262.       setup(actor,index,max_members)
  3263.       create_sprites(viewport)
  3264.   end
  3265.   
  3266.   #--------------------------------------------------------------------------
  3267.   # * Setup
  3268.   #--------------------------------------------------------------------------   
  3269.   def setup(actor,index,max_members)
  3270.       $game_temp.battle_end = false
  3271.       @actor = actor
  3272.       @actor_index = index
  3273.       @max_members = max_members
  3274.       @actor.face_animation = [0,0,0]
  3275.       @hp_icon_max = -1
  3276.       @hp_icon_old = -1
  3277.       @hp_icon_col_max = HP_ICON_COL_MAX
  3278.       @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3279.       @hp_icon_row_max = HP_ICON_ROW_MAX
  3280.       @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3281.       @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3282.       @mp_icon_max = -1
  3283.       @mp_icon_old = -1
  3284.       @mp_icon_col_max = MP_ICON_COL_MAX
  3285.       @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3286.       @mp_icon_row_max = MP_ICON_ROW_MAX
  3287.       @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3288.       @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3289.       @tp_icon_max = -1
  3290.       @tp_icon_old = -1
  3291.       @tp_icon_col_max = TP_ICON_COL_MAX
  3292.       @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3293.       @tp_icon_row_max = TP_ICON_ROW_MAX
  3294.       @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3295.       @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3296.       @sprite_visible = true
  3297.       @sprite_visitle_wait = 0
  3298.       setup_actor
  3299.       setup_position
  3300.   end
  3301.      
  3302.   #--------------------------------------------------------------------------
  3303.   # * Setup Actor
  3304.   #--------------------------------------------------------------------------   
  3305.   def setup_actor
  3306.       return if @actor == nil
  3307.       @hp_number_refresh = true
  3308.       @hp_number2_refresh = true
  3309.       @hp_number_old = @actor.hp
  3310.       @hp_number2_old = @actor.mhp
  3311.       @hp_old_meter = 0      
  3312.       @mp_number_refresh = true
  3313.       @mp_number2_refresh = true
  3314.       @mp_number_old = @actor.mp
  3315.       @mp_number2_old = @actor.mmp
  3316.       @mp_old_meter = 0      
  3317.       @tp_number_refresh = true
  3318.       @tp_number2_refresh = true
  3319.       @tp_number_old = @actor.tp
  3320.       @tp_number2_old = @actor.max_tp  
  3321.       @tp_old_meter = 0
  3322.       @at_number_refresh = true
  3323.       @at_number2_refresh = true
  3324.       @at_number_old = actor_at
  3325.       @at_number2_old = actor_max_at
  3326.       @at_old_meter = 0
  3327.       catb = ATB::MAX_AP rescue nil
  3328.       @ccwinter_atb = true if catb != nil
  3329.   end  
  3330.   
  3331.   #--------------------------------------------------------------------------
  3332.   # * Terminate
  3333.   #--------------------------------------------------------------------------   
  3334.   def terminate
  3335.       @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3336.   end
  3337.   
  3338.   #--------------------------------------------------------------------------
  3339.   # * AT
  3340.   #--------------------------------------------------------------------------  
  3341.   def actor_at
  3342.       return @actor.atb if $imported[:mog_atb_system]
  3343.       return @actor.atb if $imported[:ve_active_time_battle]
  3344.       return @actor.catb_value if $imported["YSA-CATB"]
  3345.       return @actor.ap if @ccwinter_atb != nil
  3346.       return 0
  3347.   end
  3348.   
  3349.   #--------------------------------------------------------------------------
  3350.   # * Max AT
  3351.   #--------------------------------------------------------------------------  
  3352.   def actor_max_at
  3353.       return @actor.atb_max if $imported[:mog_atb_system]
  3354.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3355.       return @actor.max_atb if $imported["YSA-CATB"]
  3356.       return ATB::MAX_AP if @ccwinter_atb != nil
  3357.       return 1
  3358.   end
  3359.   
  3360.   #--------------------------------------------------------------------------
  3361.   # ● Actor Cast
  3362.   #--------------------------------------------------------------------------            
  3363.   def actor_cast
  3364.       return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3365.       return @actor.atb if $imported[:ve_active_time_battle]
  3366.       return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3367.       return 0
  3368.   end
  3369.   
  3370.   #--------------------------------------------------------------------------
  3371.   # ● Actor Max Cast
  3372.   #--------------------------------------------------------------------------            
  3373.   def actor_max_cast
  3374.       if $imported[:mog_atb_system]
  3375.          return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3376.          return @actor.atb_cast[0].speed.abs
  3377.       end   
  3378.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3379.       return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3380.       return 1
  3381.   end
  3382.   
  3383.   #--------------------------------------------------------------------------
  3384.   # ● Actor Cast?
  3385.   #--------------------------------------------------------------------------            
  3386.   def actor_cast?   
  3387.       if $imported[:mog_atb_system]
  3388.          return true if !@actor.atb_cast.empty?
  3389.       end   
  3390.       if $imported[:ve_active_time_battle]
  3391.          return true if @actor.cast_action?
  3392.       end      
  3393.       if @ccwinter_atb
  3394.          return true if @actor.chanting?
  3395.       end
  3396.       return false
  3397.   end  
  3398.   
  3399.   #--------------------------------------------------------------------------
  3400.   # * Create Sprites
  3401.   #--------------------------------------------------------------------------   
  3402.   def create_sprites(viewport)
  3403.       dispose
  3404.       return if @actor == nil
  3405.       create_layout(viewport)
  3406.       create_layout_2(viewport)
  3407.       create_name(viewport)
  3408.       create_face(viewport)
  3409.       create_hp_number(viewport)
  3410.       create_hp_number_max(viewport)
  3411.       create_hp_meter(viewport)
  3412.       create_hp_icon(viewport)
  3413.       create_hp_icon_ex(viewport)
  3414.       create_hp_icon_number(viewport)
  3415.       create_mp_number(viewport)
  3416.       create_mp_number_max(viewport)
  3417.       create_mp_meter(viewport)
  3418.       create_mp_icon(viewport)
  3419.       create_mp_icon_ex(viewport)
  3420.       create_mp_icon_number(viewport)
  3421.       create_tp_number(viewport)
  3422.       create_tp_number_max(viewport)
  3423.       create_tp_meter(viewport)
  3424.       create_tp_icon(viewport)
  3425.       create_tp_icon_ex(viewport)
  3426.       create_tp_icon_number(viewport)
  3427.       create_at_number(viewport)
  3428.       create_at_number_max(viewport)
  3429.       create_at_meter(viewport)      
  3430.       create_level_number(viewport)
  3431.       create_states(viewport)
  3432.       update
  3433.   end   
  3434.   
  3435.   #--------------------------------------------------------------------------
  3436.   # * Sprite Visible
  3437.   #--------------------------------------------------------------------------
  3438.   def sprite_visible?
  3439.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3440.       return false if !$game_temp.battle_hud_visible
  3441.       return false if !$game_temp.sprite_visible
  3442.       return true
  3443.   end
  3444.   
  3445.   #--------------------------------------------------------------------------
  3446.   # * Sprite Visible
  3447.   #--------------------------------------------------------------------------
  3448.   def sprite_visible(sprite)
  3449.       if @sprite_visible         
  3450.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3451.       else
  3452.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3453.       end
  3454.   end
  3455.   
  3456. end

  3457. #==============================================================================
  3458. #==============================================================================
  3459. # ** Battle Hud EX
  3460. #==============================================================================
  3461. #==============================================================================
  3462. class Battle_Hud_EX
  3463.   
  3464.   #--------------------------------------------------------------------------
  3465.   # * Setup Position
  3466.   #--------------------------------------------------------------------------
  3467.   def setup_position
  3468.       sprite_width = (Graphics.width - 64) / 4
  3469.       sprite_center = sprite_width / 2  
  3470.       if $game_party.battle_members.size > 4
  3471.          members = $game_party.battle_members.size - 4
  3472.          fx = 32 * members
  3473.        else
  3474.          fx = 0
  3475.       end   
  3476.       space_x = MEMBERS_SPACE[0] - fx
  3477.       space_y = MEMBERS_SPACE[1]      
  3478.       center = Graphics.width / 2
  3479.       members_space = (Graphics.width + space_x) / @max_members
  3480.       members_space2 = (members_space * @actor_index)      
  3481.       members_space3 = ((members_space / 2) * (@max_members - 1))
  3482.       members_space_y = space_y * @actor_index
  3483.       x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3484.       screen_resize_y = 0
  3485.       screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3486.       y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3487.       @hud_position = [x,y]
  3488.       $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3489.       $game_temp.hud_pos_real[@actor_index] = [x,y]
  3490.       x2 = x + sprite_center
  3491.       $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3492.       $game_temp.hud_pos[@actor_index] = [x2,y]
  3493.       if FIXED_HUD_POSITION[@actor_index] != nil     
  3494.          @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3495.          $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3496.          $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3497.          $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]   
  3498.       end      
  3499.   end

  3500. end

  3501. #==============================================================================
  3502. # ** Game Temp
  3503. #==============================================================================
  3504. class Game_Temp
  3505.   
  3506.   attr_accessor :cache_bhud_sprites
  3507.   
  3508.   #--------------------------------------------------------------------------
  3509.   # * Cache Battle Hud
  3510.   #--------------------------------------------------------------------------  
  3511.   def cache_battle_hud      
  3512.       execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3513.   end
  3514.   
  3515.   #--------------------------------------------------------------------------
  3516.   # * Execute Cache Bhud Sprites
  3517.   #--------------------------------------------------------------------------  
  3518.   def execute_cache_bhud_sprites
  3519.       @cache_bhud_sprites = []
  3520.       windows = ["Layout_Command","Layout_Party","Layout_Help",
  3521.       "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3522.       "Layout_Item"]
  3523.       for s in windows
  3524.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3525.       end
  3526.       sprites = ["Layout","Layout_2",
  3527.      "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3528.      "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",  
  3529.      "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",  
  3530.      "LV_Number","Turn","Iconset","Layout_Screen"
  3531.       ]
  3532.       for s in sprites
  3533.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3534.       end      
  3535.   end
  3536.   
  3537. end

  3538. #==============================================================================
  3539. # ** Spriteset_Map
  3540. #==============================================================================
  3541. class Spriteset_Map

  3542.   #--------------------------------------------------------------------------
  3543.   # * Initialize
  3544.   #--------------------------------------------------------------------------
  3545.   alias mog_monogatari_bhud_initialize initialize
  3546.   def initialize
  3547.       $game_temp.cache_battle_hud
  3548.       mog_monogatari_bhud_initialize
  3549.   end
  3550.   
  3551. end

  3552. #==============================================================================
  3553. #==============================================================================
  3554. # ** Battle Hud EX
  3555. #==============================================================================
  3556. #==============================================================================
  3557. class Battle_Hud_EX

  3558.   #--------------------------------------------------------------------------
  3559.   # * Pre Cache
  3560.   #--------------------------------------------------------------------------
  3561.   def pre_cache
  3562.       $game_temp.cache_battle_hud
  3563.       @force_hide = false
  3564.       @force_hide_time = 0
  3565.       @fade_hud = false
  3566.       @fade_hud_gold = false     
  3567.       @fade_hud_equip = false
  3568.       @layout_image = Cache.battle_hud("Layout")
  3569.       @layout_cw = @layout_image.width
  3570.       @layout_ch = @layout_image.height
  3571.       @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3572.       @layout2_cw = @layout2_image.width if @layout2_image != nil
  3573.       @layout2_ch = @layout2_image.height if @layout2_image != nil
  3574.       @layout2_cw = 0 if @layout2_cw == nil      
  3575.       #------------------------------------------------
  3576.       # HP
  3577.       #------------------------------------------------
  3578.       if HP_NUMBER_VISIBLE
  3579.          @hp_number_image = Cache.battle_hud("HP_Number")
  3580.          @hp_number_cw = @hp_number_image.width / 10
  3581.          if HP_NUMBER_LOW_COLOR
  3582.             @hp_number_ch = @hp_number_image.height / 2
  3583.          else
  3584.             @hp_number_ch = @hp_number_image.height
  3585.          end   
  3586.          @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3587.          @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number      
  3588.       end
  3589.       if HP_NUMBER_MAX_VISIBLE
  3590.          @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3591.          @hp_number2_cw = @hp_number2_image.width / 10
  3592.          @hp_number2_ch = @hp_number2_image.height
  3593.       end
  3594.       if HP_METER_VISIBLE
  3595.          @hp_meter_image = Cache.battle_hud("HP_Meter")
  3596.          if HP_METER_GRADIENT_ANIMATION
  3597.             @hp_meter_cw = @hp_meter_image.width / 3
  3598.          else   
  3599.             @hp_meter_cw = @hp_meter_image.width
  3600.          end   
  3601.          if HP_METER_REDUCTION_ANIMATION
  3602.             @hp_meter_ch = @hp_meter_image.height / 2
  3603.          else
  3604.             @hp_meter_ch = @hp_meter_image.height
  3605.          end  
  3606.       end
  3607.       if HP_ICON_VISIBLE
  3608.          @hp_icon_image = Cache.battle_hud("HP_Icon")
  3609.          @hp_icon_cw = @hp_icon_image.width / 2
  3610.          @hp_icon_ch = @hp_icon_image.height
  3611.       end
  3612.       if HP_ICON_EX_VISIBLE
  3613.          @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3614.          @hp_icon2_cw = @hp_icon2_image.width
  3615.          @hp_icon2_ch = @hp_icon2_image.height        
  3616.       end      
  3617.       if HP_ICON_NUMBER_VISIBLE
  3618.          @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3619.          @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3620.          @hp_icon_number_ch = @hp_icon_number_image.height        
  3621.       end
  3622.       #------------------------------------------------
  3623.       # MP
  3624.       #------------------------------------------------
  3625.       if MP_NUMBER_VISIBLE
  3626.          @mp_number_image = Cache.battle_hud("MP_Number")
  3627.          @mp_number_cw = @mp_number_image.width / 10
  3628.          if MP_NUMBER_LOW_COLOR
  3629.             @mp_number_ch = @mp_number_image.height / 2
  3630.          else
  3631.             @mp_number_ch = @mp_number_image.height
  3632.         end
  3633.         @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3634.         @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3635.       end
  3636.       if MP_NUMBER_MAX_VISIBLE
  3637.          @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3638.          @mp_number2_cw = @mp_number2_image.width / 10
  3639.          @mp_number2_ch = @mp_number2_image.height
  3640.       end
  3641.       if MP_METER_VISIBLE
  3642.          @mp_meter_image = Cache.battle_hud("MP_Meter")
  3643.          if MP_METER_GRADIENT_ANIMATION
  3644.             @mp_meter_cw = @mp_meter_image.width / 3
  3645.          else   
  3646.             @mp_meter_cw = @mp_meter_image.width
  3647.          end  
  3648.          if MP_METER_REDUCTION_ANIMATION
  3649.             @mp_meter_ch = @mp_meter_image.height / 2
  3650.          else
  3651.             @mp_meter_ch = @mp_meter_image.height
  3652.          end
  3653.       end
  3654.       if MP_ICON_VISIBLE
  3655.          @mp_icon_image = Cache.battle_hud("MP_Icon")
  3656.          @mp_icon_cw = @mp_icon_image.width / 2
  3657.          @mp_icon_ch = @mp_icon_image.height
  3658.       end
  3659.       if MP_ICON_EX_VISIBLE
  3660.          @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3661.          @mp_icon2_cw = @mp_icon2_image.width
  3662.          @mp_icon2_ch = @mp_icon2_image.height        
  3663.       end      
  3664.       if MP_ICON_NUMBER_VISIBLE
  3665.          @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3666.          @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3667.          @mp_icon_number_ch = @mp_icon_number_image.height        
  3668.       end
  3669.       #------------------------------------------------
  3670.       # TP
  3671.       #------------------------------------------------
  3672.       if TP_NUMBER_VISIBLE
  3673.          @tp_number_image = Cache.battle_hud("TP_Number")
  3674.          @tp_number_cw = @tp_number_image.width / 10
  3675.          if TP_NUMBER_LOW_COLOR
  3676.             @tp_number_ch = @tp_number_image.height / 2
  3677.          else
  3678.             @tp_number_ch = @tp_number_image.height
  3679.          end  
  3680.         @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3681.         @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number      
  3682.       end
  3683.       if TP_NUMBER_MAX_VISIBLE
  3684.          @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3685.          @tp_number2_cw = @tp_number2_image.width / 10
  3686.          @tp_number2_ch = @tp_number2_image.height
  3687.       end
  3688.       if TP_METER_VISIBLE
  3689.          @tp_meter_image = Cache.battle_hud("TP_Meter")
  3690.          if TP_METER_GRADIENT_ANIMATION
  3691.             @tp_meter_cw = @tp_meter_image.width / 3
  3692.          else   
  3693.             @tp_meter_cw = @tp_meter_image.width
  3694.          end  
  3695.          if TP_METER_REDUCTION_ANIMATION
  3696.             @tp_meter_ch = @tp_meter_image.height / 2      
  3697.          else
  3698.             @tp_meter_ch = @tp_meter_image.height
  3699.          end   
  3700.       end        
  3701.       if TP_ICON_VISIBLE
  3702.          @tp_icon_image = Cache.battle_hud("TP_Icon")
  3703.          @tp_icon_cw = @tp_icon_image.width / 2
  3704.          @tp_icon_ch = @tp_icon_image.height
  3705.       end  
  3706.       if TP_ICON_EX_VISIBLE
  3707.          @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3708.          @tp_icon2_cw = @tp_icon2_image.width
  3709.          @tp_icon2_ch = @tp_icon2_image.height        
  3710.       end      
  3711.       if TP_ICON_NUMBER_VISIBLE
  3712.          @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3713.          @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3714.          @tp_icon_number_ch = @tp_icon_number_image.height        
  3715.       end
  3716.       #------------------------------------------------
  3717.       # AT
  3718.       #------------------------------------------------
  3719.       if AT_NUMBER_VISIBLE
  3720.          @at_number_image = Cache.battle_hud("AT_Number")
  3721.          @at_number_cw = @at_number_image.width / 10
  3722.          @at_number_ch = @at_number_image.height
  3723.          @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3724.          @at_number_ch += (@at_number_ch / 2) if @at_wave_number      
  3725.       end
  3726.       if AT_NUMBER_MAX_VISIBLE
  3727.          @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3728.          @at_number2_cw = @at_number2_image.width / 10
  3729.          @at_number2_ch = @at_number2_image.height
  3730.       end
  3731.       if AT_METER_VISIBLE
  3732.          @at_meter_image = Cache.battle_hud("AT_Meter")
  3733.          if AT_METER_GRADIENT_ANIMATION
  3734.             @at_meter_cw = @at_meter_image.width / 3
  3735.          else   
  3736.             @at_meter_cw = @at_meter_image.width
  3737.          end   
  3738.          @at_meter_ch = @at_meter_image.height / 3
  3739.       end
  3740.       #------------------------------------------------
  3741.       # LV
  3742.       #------------------------------------------------  
  3743.       if LEVEL_NUMBER_VISIBLE
  3744.          @lv_number_image = Cache.battle_hud("LV_Number")
  3745.          @lv_number_cw = @lv_number_image.width / 10
  3746.          @lv_number_ch = @lv_number_image.height
  3747.       end      
  3748.       #------------------------------------------------
  3749.       # ICON
  3750.       #------------------------------------------------  
  3751.       if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3752.          @icon_image = Cache.system("Iconset")
  3753.       end         
  3754.   end
  3755.   
  3756.   #--------------------------------------------------------------------------
  3757.   # * Check Icon Image
  3758.   #--------------------------------------------------------------------------         
  3759.   def check_icon_image
  3760.       if @icon_image == nil or @icon_image.disposed?
  3761.          @icon_image = Cache.system("Iconset")
  3762.       end   
  3763.   end  
  3764.   
  3765. end

  3766. #==============================================================================
  3767. #==============================================================================
  3768. # ** Battle Hud EX
  3769. #==============================================================================
  3770. #==============================================================================
  3771. class Battle_Hud_EX
  3772.   
  3773.   #--------------------------------------------------------------------------
  3774.   # * Update Number
  3775.   #--------------------------------------------------------------------------   
  3776.   def update_number(type,value)
  3777.       actor_value = @actor.hp if type == 0
  3778.       actor_value = @actor.mp if type == 1
  3779.       actor_value = @actor.tp if type == 2
  3780.       actor_value = @actor.mhp if type == 3
  3781.       actor_value = @actor.mmp if type == 4
  3782.       actor_value = @actor.max_tp if type == 5
  3783.       actor_value = actor_at if type == 6
  3784.       actor_value = actor_max_at if type == 7
  3785.       if value < actor_value
  3786.          value += number_refresh_speed(actor_value,value)
  3787.          value = actor_value if value >= actor_value
  3788.          refresh_sprite_number(type,value)
  3789.      elsif value > actor_value
  3790.          value -= number_refresh_speed(actor_value,value)
  3791.          value = actor_value if value <= actor_value
  3792.          refresh_sprite_number(type,value)
  3793.      end  
  3794.   end
  3795.   
  3796.   #--------------------------------------------------------------------------
  3797.   # * Number Refresh Speed
  3798.   #--------------------------------------------------------------------------      
  3799.   def number_refresh_speed(actor_value,value)
  3800.       n =  1 * (actor_value - value).abs / 10
  3801.       return [[n, 99999999].min,1].max   
  3802.   end
  3803.   
  3804.   #--------------------------------------------------------------------------
  3805.   # * Update Number Fix
  3806.   #--------------------------------------------------------------------------      
  3807.   def update_number_fix(type)
  3808.       if type == 0
  3809.          @hp_number_old =  @actor.hp
  3810.          @hp_number_refresh = true
  3811.       elsif type == 1
  3812.          @mp_number_old =  @actor.mp
  3813.          @mp_number_refresh = true
  3814.       elsif type == 2
  3815.          @tp_number_old =  @actor.tp
  3816.          @tp_number_refresh = true  
  3817.       elsif type == 3
  3818.          @hp_number2_old =  @actor.mhp
  3819.          @hp_number2_refresh = true
  3820.       elsif type == 4
  3821.          @mp_number2_old =  @actor.mmp
  3822.          @mp_number2_refresh = true
  3823.       elsif type == 5
  3824.          @tp_number2_old =  @actor.max_tp
  3825.          @tp_number2_refresh = true  
  3826.       elsif type == 6
  3827.          @at_number_old =  actor_at
  3828.          @at_number_refresh = true         
  3829.       elsif type == 7
  3830.          @at_number2_old = actor_max_at
  3831.          @at_number2_refresh = true            
  3832.       end   
  3833.   end  
  3834.   
  3835.   #--------------------------------------------------------------------------
  3836.   # * Refresh Sprite Number
  3837.   #--------------------------------------------------------------------------   
  3838.   def refresh_sprite_number(type,value)   
  3839.       @hp_number_refresh = true if type == 0
  3840.       @hp_number_old = value if type == 0
  3841.       @mp_number_refresh = true if type == 1
  3842.       @mp_number_old = value if type == 1
  3843.       @tp_number_refresh = true if type == 2
  3844.       @tp_number_old = value if type == 2
  3845.       @hp_number2_refresh = true if type == 3
  3846.       @hp_number2_old = value if type == 3
  3847.       @mp_number2_refresh = true if type == 4
  3848.       @mp_number2_old = value if type == 4
  3849.       @tp_number2_refresh = true if type == 5
  3850.       @tp_number2_old = value if type == 5
  3851.       @at_number_refresh = true if type == 6
  3852.       @at_number_old = value if type == 6
  3853.       @at_number2_refresh = true if type == 7
  3854.       @at_number2_old = value if type == 7
  3855.   end  
  3856.   
  3857.   #--------------------------------------------------------------------------
  3858.   # * Refresh Number
  3859.   #--------------------------------------------------------------------------   
  3860.   def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  3861.       sprite.bitmap.clear
  3862.       clear_number_refresh(type)
  3863.       number_color = low_number_color(type,number_ch)
  3864.       if type == 0 and HP_NUMBER_PERCENTAGE
  3865.          value_max = @actor.mhp
  3866.          value = value.to_f / value_max.to_f * 100
  3867.          value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  3868.       elsif type == 1 and MP_NUMBER_PERCENTAGE
  3869.          value_max = @actor.mmp
  3870.          value = value.to_f / value_max.to_f * 100
  3871.       elsif type == 2 and TP_NUMBER_PERCENTAGE
  3872.          value_max = @actor.max_tp
  3873.          value = value.to_f / value_max.to_f * 100  
  3874.       elsif type == 3 and HP_NUMBER_PERCENTAGE
  3875.          value = 100
  3876.       elsif type == 4 and MP_NUMBER_PERCENTAGE
  3877.          value = 100
  3878.       elsif type == 5 and TP_NUMBER_PERCENTAGE
  3879.          value = 100
  3880.       elsif type == 6 and AT_NUMBER_PERCENTAGE
  3881.          value_max = actor_max_at
  3882.          value = value.to_f / value_max.to_f * 100
  3883.       elsif type == 7 and AT_NUMBER_PERCENTAGE
  3884.          value = 100         
  3885.       end
  3886.       value = 9999999 if value > 9999999
  3887.       number_value = value.truncate.abs.to_s.split(//)
  3888.       wave_h = 0
  3889.       wave_h2 = wave_number ? (number_ch / 3) : 0
  3890.       wave_h3 = number_color != 0 ? wave_h2 : 0
  3891.       for r in 0..number_value.size - 1         
  3892.          number_value_abs = number_value[r].to_i
  3893.          wh = wave_h2 * wave_h
  3894.          wh2 = wave_h == 0 ? wave_h2 : 0
  3895.          nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  3896.          sprite.bitmap.blt(number_cw *  r, wh, image, nsrc_rect)
  3897.          wave_h = wave_h == 0 ? 1 : 0
  3898.       end
  3899.       refresh_number_position(type,number_value.size,number_cw)
  3900.   end
  3901.   
  3902.   #--------------------------------------------------------------------------
  3903.   # * Refresh Number
  3904.   #--------------------------------------------------------------------------     
  3905.   def refresh_number_position(type,number_value,number_cw)
  3906.       cx = number_value * number_cw
  3907.       if type == 0
  3908.          case HP_NUMBER_ALIGN_TYPE
  3909.            when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  3910.            when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  3911.            when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  3912.          end            
  3913.       elsif type == 1
  3914.          case MP_NUMBER_ALIGN_TYPE
  3915.            when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  3916.            when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  3917.            when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  3918.          end     
  3919.       elsif type == 2  
  3920.          case TP_NUMBER_ALIGN_TYPE
  3921.            when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  3922.            when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  3923.            when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  3924.          end           
  3925.       elsif type == 3   
  3926.          case HP_NUMBER_ALIGN_TYPE
  3927.            when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  3928.            when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  3929.            when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  3930.          end           
  3931.       elsif type ==  4
  3932.          case MP_NUMBER_ALIGN_TYPE
  3933.            when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  3934.            when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  3935.            when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  3936.          end         
  3937.       elsif type ==  5
  3938.          case TP_NUMBER_ALIGN_TYPE
  3939.            when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  3940.            when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  3941.            when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  3942.          end
  3943.       elsif type ==  6     
  3944.          case MP_NUMBER_ALIGN_TYPE
  3945.            when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  3946.            when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  3947.            when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  3948.          end            
  3949.       elsif type ==  7     
  3950.          case AT_NUMBER_ALIGN_TYPE
  3951.            when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  3952.            when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  3953.            when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  3954.          end
  3955.       end  
  3956.   end
  3957.   
  3958.   #--------------------------------------------------------------------------
  3959.   # * Low Number Color
  3960.   #--------------------------------------------------------------------------      
  3961.   def low_number_color(type,number_ch)
  3962.       if type == 0
  3963.          if HP_NUMBER_LOW_COLOR
  3964.             return @actor.low_hp? ? number_ch : 0
  3965.          else
  3966.             return 0
  3967.          end  
  3968.       elsif type == 1
  3969.          if MP_NUMBER_LOW_COLOR   
  3970.             return @actor.low_mp? ? number_ch : 0
  3971.          else
  3972.             return 0
  3973.          end         
  3974.       elsif type == 2
  3975.          if TP_NUMBER_LOW_COLOR
  3976.             return @actor.low_tp? ? number_ch : 0
  3977.          else
  3978.             return 0
  3979.          end
  3980.       else   
  3981.          return 0  
  3982.       end     
  3983.   end
  3984.   
  3985.   #--------------------------------------------------------------------------
  3986.   # * Clear Number Refresh
  3987.   #--------------------------------------------------------------------------      
  3988.   def clear_number_refresh(type)
  3989.       @hp_number_refresh = false if type == 0
  3990.       @mp_number_refresh = false if type == 1
  3991.       @tp_number_refresh = false if type == 2
  3992.       @hp_number2_refresh = false if type == 3
  3993.       @mp_number2_refresh = false if type == 4
  3994.       @tp_number2_refresh = false if type == 5
  3995.       @at_number_refresh = false if type == 6
  3996.       @at_number2_refresh = false if type == 7
  3997.   end  
  3998.   
  3999.   #--------------------------------------------------------------------------
  4000.   # * Icon Limit
  4001.   #--------------------------------------------------------------------------      
  4002.   def icon_limit(value,value_max)
  4003.       n1 = value / value_max
  4004.       n2 = value - (n1 * value_max)
  4005.       n2 = value_max if (n2 == 0 and value > 0)
  4006.       return n2
  4007.   end  
  4008.   
  4009. end

  4010. #==============================================================================
  4011. #==============================================================================
  4012. # ** Battle Hud EX
  4013. #==============================================================================
  4014. #==============================================================================
  4015. class Battle_Hud_EX

  4016.   #--------------------------------------------------------------------------
  4017.   # * Create Layout
  4018.   #--------------------------------------------------------------------------   
  4019.   def create_layout(viewport)
  4020.       @layout = Sprite.new
  4021.       @layout.bitmap = @layout_image
  4022.       @layout.z = HUD_Z
  4023.       @layout.x = @hud_position[0]
  4024.       @layout.y = @hud_position[1]
  4025.       @layout.opacity = 0
  4026.       @layout.viewport = viewport
  4027.   end   
  4028.   
  4029.   #--------------------------------------------------------------------------
  4030.   # * Update Layout
  4031.   #--------------------------------------------------------------------------   
  4032.   def update_layout
  4033.       return if @layout == nil
  4034.       sprite_visible(@layout)
  4035.   end
  4036.   
  4037.   #--------------------------------------------------------------------------
  4038.   # * Create Layout
  4039.   #--------------------------------------------------------------------------   
  4040.   def create_layout_2(viewport)
  4041.       return if !SECOND_LAYOUT
  4042.       @layout2 = Sprite.new
  4043.       @layout2.bitmap = @layout2_image
  4044.       @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4045.       @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4046.       @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4047.       @layout2.opacity = 0
  4048.       @layout2.viewport = viewport
  4049.   end   
  4050.   
  4051.   #--------------------------------------------------------------------------
  4052.   # * Update Layout
  4053.   #--------------------------------------------------------------------------   
  4054.   def update_layout_2
  4055.       return if @layout2 == nil
  4056.       sprite_visible(@layout2)
  4057.   end  
  4058.   
  4059. end

  4060. #==============================================================================
  4061. #==============================================================================
  4062. # ** Battle Hud EX
  4063. #==============================================================================
  4064. #==============================================================================
  4065. class Battle_Hud_EX
  4066.   
  4067.   #--------------------------------------------------------------------------
  4068.   # * Create Name
  4069.   #--------------------------------------------------------------------------      
  4070.   def create_name(viewport)
  4071.       return if !NAME_VISIBLE
  4072.       @name = Sprite.new
  4073.       @name.bitmap = Bitmap.new(160,32)
  4074.       @name.bitmap.font.size = NAME_FONT_SIZE
  4075.       @name.bitmap.font.bold = NAME_FONT_BOLD
  4076.       @name.bitmap.font.italic = NAME_FONT_ITALIC
  4077.       @name.bitmap.font.color = NAME_FONT_COLOR
  4078.       @name.z = HUD_Z + NAME_Z
  4079.       @name.x = @hud_position[0] + NAME_POSITION[0]
  4080.       @name.y = @hud_position[1] + NAME_POSITION[1]
  4081.       @name.viewport = viewport
  4082.       @name.opacity = 0
  4083.       refresh_name
  4084.   end

  4085.   #--------------------------------------------------------------------------
  4086.   # * Refresh Name
  4087.   #--------------------------------------------------------------------------      
  4088.   def refresh_name
  4089.       return if @name == nil
  4090.       @name.bitmap.clear
  4091.       if NAME_FONT_SHADOW
  4092.          @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4093.          @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4094.          @name.bitmap.font.color = NAME_FONT_COLOR
  4095.       end   
  4096.       @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4097.   end
  4098.   
  4099.   #--------------------------------------------------------------------------
  4100.   # * Update Name
  4101.   #--------------------------------------------------------------------------        
  4102.   def update_name
  4103.       return if @name == nil
  4104.       sprite_visible(@name)
  4105.   end
  4106.   
  4107. end

  4108. #==============================================================================
  4109. #==============================================================================
  4110. # ** Battle Hud EX
  4111. #==============================================================================
  4112. #==============================================================================
  4113. class Battle_Hud_EX
  4114.   
  4115.   #--------------------------------------------------------------------------
  4116.   # * Create HP Number
  4117.   #--------------------------------------------------------------------------  
  4118.   def create_hp_number(viewport)
  4119.       return if !HP_NUMBER_VISIBLE
  4120.       @hp_number = Sprite.new
  4121.       @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4122.       @hp_number.z = HUD_Z + HP_NUMBER_Z
  4123.       @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4124.       @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4125.       @hp_number.viewport = viewport
  4126.       @hp_number.opacity = 0
  4127.   end
  4128.   
  4129.   #--------------------------------------------------------------------------
  4130.   # * Create HP Number Max
  4131.   #--------------------------------------------------------------------------  
  4132.   def create_hp_number_max(viewport)
  4133.       return if !HP_NUMBER_MAX_VISIBLE
  4134.       @hp_number2 = Sprite.new
  4135.       @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4136.       @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4137.       @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4138.       @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4139.       @hp_number2.viewport = viewport
  4140.       @hp_number2.opacity = 0
  4141.   end  
  4142.   
  4143.   #--------------------------------------------------------------------------
  4144.   # * Create HP Meter
  4145.   #--------------------------------------------------------------------------   
  4146.   def create_hp_meter(viewport)
  4147.       return if !HP_METER_VISIBLE
  4148.       @hp_flow_max = @hp_meter_cw * 2
  4149.       @hp_flow = rand(@hp_flow_max)
  4150.       @hp_meter = Sprite.new
  4151.       @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4152.       @hp_meter.z = HUD_Z + HP_METER_Z
  4153.       @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4154.       @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4155.       @hp_meter.angle = HP_METER_ANGLE
  4156.       @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4157.       @hp_meter.viewport = viewport
  4158.       @hp_meter.opacity = 0
  4159.   end
  4160.   
  4161.   #--------------------------------------------------------------------------
  4162.   # ● Update Flow HP
  4163.   #--------------------------------------------------------------------------            
  4164.   def update_flow_hp
  4165.       @hp_meter.bitmap.clear
  4166.       @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4167.       meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4168.       meter_width = 0 if meter_width == nil
  4169.       execute_hp_damage_flow(meter_width)      
  4170.       meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4171.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)  
  4172.       @hp_flow += 1
  4173.       @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4174.   end  
  4175.    
  4176.   #--------------------------------------------------------------------------
  4177.   # ● Execute HP Damage Flow
  4178.   #--------------------------------------------------------------------------
  4179.   def execute_hp_damage_flow(meter_width)
  4180.       return if !HP_METER_REDUCTION_ANIMATION
  4181.       return if @hp_old_meter == meter_width
  4182.       n = (@hp_old_meter - meter_width).abs * 3 / 100
  4183.       damage_flow = [[n, 2].min,0.5].max
  4184.       @hp_old_meter -= damage_flow
  4185.       @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4186.       src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4187.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)      
  4188.   end

  4189.   #--------------------------------------------------------------------------
  4190.   # * Create HP Icon
  4191.   #--------------------------------------------------------------------------  
  4192.   def create_hp_icon(viewport)
  4193.       return if !HP_ICON_VISIBLE
  4194.       @hp_icon = Sprite.new
  4195.       icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4196.       icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4197.       @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4198.       @hp_icon.z = HUD_Z + HP_ICON_Z
  4199.       @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4200.       @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4201.       @hp_icon.viewport = viewport
  4202.       @hp_icon.opacity = 0
  4203.   end
  4204.    
  4205.   #--------------------------------------------------------------------------
  4206.   # * Refresh HP Icon
  4207.   #--------------------------------------------------------------------------   
  4208.   def refresh_hp_icon
  4209.       @hp_icon_old = @actor.hp
  4210.       @hp_icon.bitmap.clear
  4211.       max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4212.       if @actor.hp > max_value
  4213.          icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4214.       else   
  4215.          icon_max = @actor.mhp
  4216.       end      
  4217.       for i in 0...icon_max
  4218.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4219.           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)
  4220.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4221.           i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4222.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )      
  4223.       end      
  4224.       icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4225.       rx = 0
  4226.       ry = 0
  4227.       for i in 0...icon_max
  4228.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4229.           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)
  4230.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4231.           i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4232.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4233.       end
  4234.       refresh_hp_icon_ex(rx,ry)      
  4235.   end
  4236.   
  4237.   #--------------------------------------------------------------------------
  4238.   # * Create HP Icon EX
  4239.   #--------------------------------------------------------------------------  
  4240.   def create_hp_icon_ex(viewport)
  4241.       return if !HP_ICON_EX_VISIBLE
  4242.       @hp_icon3_anime_phase = 0
  4243.       @hp_icon3 = Sprite.new
  4244.       @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4245.       @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4246.       @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4247.       @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4248.       @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4249.                        @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4250.       @hp_icon3.x = @hp_icon3_org[0]
  4251.       @hp_icon3.y = @hp_icon3_org[1]
  4252.       @hp_icon3.viewport = viewport
  4253.       @hp_icon3.opacity = 0
  4254.   end   
  4255.   
  4256.   #--------------------------------------------------------------------------
  4257.   # * Refresh HP Icon EX
  4258.   #--------------------------------------------------------------------------      
  4259.   def refresh_hp_icon_ex(rx,ry)
  4260.       return if @hp_icon3 == nil
  4261.       @hp_icon3.bitmap.clear
  4262.       return if @actor.hp == 0
  4263.       i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4264.       @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4265.       @hp_icon3.x = @hp_icon3_org[0] + rx
  4266.       @hp_icon3.y = @hp_icon3_org[1] + ry     
  4267.   end
  4268.   
  4269.   #--------------------------------------------------------------------------
  4270.   # * Update Icon HP EX Anime
  4271.   #--------------------------------------------------------------------------  
  4272.   def update_icon_hp_ex_anime
  4273.       return if !HP_ICON_EX_ZOOM_EFFECT
  4274.       if @hp_icon3_anime_phase == 0
  4275.          @hp_icon3.zoom_x += 0.01
  4276.          if @hp_icon3.zoom_x >= 1.30
  4277.             @hp_icon3.zoom_x = 1.30
  4278.             @hp_icon3_anime_phase = 1
  4279.          end  
  4280.       else
  4281.         @hp_icon3.zoom_x -= 0.01
  4282.         if @hp_icon3.zoom_x <= 1.05
  4283.            @hp_icon3.zoom_x = 1.05
  4284.            @hp_icon3_anime_phase = 0
  4285.         end   
  4286.       end  
  4287.       @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4288.   end
  4289.   
  4290.   #--------------------------------------------------------------------------
  4291.   # * Create HP Icon Nummber
  4292.   #--------------------------------------------------------------------------      
  4293.   def create_hp_icon_number(viewport)
  4294.       return if !HP_ICON_NUMBER_VISIBLE
  4295.       @hp_icon_number_old = [-1,-1]
  4296.       @hp_icon_number = Sprite.new
  4297.       @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4298.       @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4299.       @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4300.       @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4301.       @hp_icon_number.viewport = viewport
  4302.       @hp_icon_number.opacity = 0
  4303.   end
  4304.   
  4305.   #--------------------------------------------------------------------------
  4306.   # * Refresh Icon Number HP
  4307.   #--------------------------------------------------------------------------  
  4308.   def refresh_icon_number_hp
  4309.       @hp_icon_number_old[0] = @actor.hp
  4310.       @hp_icon_number_old[1] = @actor.mhp
  4311.       @hp_icon_number.bitmap.clear
  4312.       value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4313.       value = 0 if value < 0
  4314.       number_value = value.truncate.abs.to_s.split(//)
  4315.       for r in 0..number_value.size - 1         
  4316.          number_value_abs = number_value[r].to_i
  4317.          nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4318.          @hp_icon_number.bitmap.blt(@hp_icon_number_cw *  r, 0, @hp_icon_number_image, nsrc_rect)
  4319.       end
  4320.       cx = (number_value.size * @hp_icon_number_cw)
  4321.       case HP_ICON_NUMBER_ALIGN_TYPE
  4322.          when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4323.          when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4324.          when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4325.       end   
  4326.   end

  4327.   #--------------------------------------------------------------------------
  4328.   # * Can Refresh Icon Number HP
  4329.   #--------------------------------------------------------------------------  
  4330.   def can_refresh_icon_number_hp?
  4331.       return true if @hp_icon_number_old[0] != @actor.hp
  4332.       return true if @hp_icon_number_old[1] != @actor.mhp
  4333.       return false
  4334.   end
  4335.   
  4336.   #--------------------------------------------------------------------------
  4337.   # * Update HP
  4338.   #--------------------------------------------------------------------------   
  4339.   def update_hp
  4340.       if @hp_number != nil
  4341.          if HP_NUMBER_ANIMATION
  4342.             update_number(0,@hp_number_old)
  4343.          else   
  4344.             update_number_fix(0) if @hp_number_old != @actor.hp
  4345.          end
  4346.          sprite_visible(@hp_number)  
  4347.          refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4348.       end
  4349.       if @hp_number2 != nil
  4350.          if HP_NUMBER_ANIMATION
  4351.             update_number(3,@hp_number2_old)
  4352.          else   
  4353.             update_number_fix(3) if @hp_number2_old != @actor.mhp
  4354.          end  
  4355.          refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4356.          sprite_visible(@hp_number2)
  4357.       end
  4358.       if @hp_meter != nil
  4359.          sprite_visible(@hp_meter)
  4360.          update_flow_hp
  4361.       end   
  4362.       if @hp_icon != nil
  4363.          sprite_visible(@hp_icon)
  4364.          refresh_hp_icon if @hp_icon_old != @actor.hp
  4365.       end
  4366.       if @hp_icon3 != nil
  4367.          sprite_visible(@hp_icon3)
  4368.          update_icon_hp_ex_anime
  4369.       end      
  4370.       if @hp_icon_number != nil
  4371.          sprite_visible(@hp_icon_number)
  4372.          refresh_icon_number_hp if can_refresh_icon_number_hp?
  4373.       end  
  4374.   end  
  4375.    
  4376. end

  4377. #==============================================================================
  4378. #==============================================================================
  4379. # ** Battle Hud EX
  4380. #==============================================================================
  4381. #==============================================================================
  4382. class Battle_Hud_EX
  4383.   
  4384.   #--------------------------------------------------------------------------
  4385.   # * Create MP Number
  4386.   #--------------------------------------------------------------------------  
  4387.   def create_mp_number(viewport)
  4388.       return if !MP_NUMBER_VISIBLE
  4389.       @mp_number = Sprite.new
  4390.       @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4391.       @mp_number.z = HUD_Z + MP_NUMBER_Z
  4392.       @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4393.       @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4394.       @mp_number.viewport = viewport
  4395.       @mp_number.opacity = 0
  4396.   end
  4397.   
  4398.   #--------------------------------------------------------------------------
  4399.   # * Create MP Number Max
  4400.   #--------------------------------------------------------------------------  
  4401.   def create_mp_number_max(viewport)
  4402.       return if !MP_NUMBER_MAX_VISIBLE
  4403.       @mp_number2 = Sprite.new
  4404.       @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4405.       @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4406.       @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4407.       @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4408.       @mp_number2.viewport = viewport
  4409.       @mp_number2.opacity = 0
  4410.   end  
  4411.   
  4412.   #--------------------------------------------------------------------------
  4413.   # * Create MP Meter
  4414.   #--------------------------------------------------------------------------   
  4415.   def create_mp_meter(viewport)
  4416.       return if !MP_METER_VISIBLE
  4417.       @mp_flow_max = @mp_meter_cw * 2
  4418.       @mp_flow = rand(@mp_flow_max)
  4419.       @mp_meter = Sprite.new
  4420.       @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4421.       @mp_meter.z = HUD_Z + MP_METER_Z
  4422.       @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4423.       @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4424.       @mp_meter.angle = MP_METER_ANGLE
  4425.       @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4426.       @mp_meter.viewport = viewport
  4427.       @mp_meter.opacity = 0
  4428.   end
  4429.   
  4430.   #--------------------------------------------------------------------------
  4431.   # ● Update Flow MP
  4432.   #--------------------------------------------------------------------------            
  4433.   def update_flow_mp
  4434.       @mp_meter.bitmap.clear
  4435.       @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4436.       meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4437.       meter_width = 0 if meter_width == nil
  4438.       execute_mp_damage_flow(meter_width)      
  4439.       meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4440.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)  
  4441.       @mp_flow += 1
  4442.       @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4443.   end  
  4444.    
  4445.   #--------------------------------------------------------------------------
  4446.   # ● Execute MP Damage Flow
  4447.   #--------------------------------------------------------------------------
  4448.   def execute_mp_damage_flow(meter_width)
  4449.       return if !MP_METER_REDUCTION_ANIMATION
  4450.       return if @mp_old_meter == meter_width
  4451.       n = (@mp_old_meter - meter_width).abs * 3 / 100
  4452.       damage_flow = [[n, 2].min,0.5].max
  4453.       @mp_old_meter -= damage_flow      
  4454.       @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4455.       src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4456.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)      
  4457.   end

  4458.   #--------------------------------------------------------------------------
  4459.   # * Create MP Icon
  4460.   #--------------------------------------------------------------------------  
  4461.   def create_mp_icon(viewport)
  4462.       return if !MP_ICON_VISIBLE
  4463.       @mp_icon = Sprite.new
  4464.       icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4465.       icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4466.       @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4467.       @mp_icon.z = HUD_Z + MP_ICON_Z
  4468.       @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4469.       @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4470.       @mp_icon.viewport = viewport
  4471.       @mp_icon.opacity = 0
  4472.   end
  4473.    
  4474.   #--------------------------------------------------------------------------
  4475.   # * Refresh MP Icon
  4476.   #--------------------------------------------------------------------------   
  4477.   def refresh_mp_icon
  4478.       @mp_icon_old = @actor.mp
  4479.       @mp_icon.bitmap.clear
  4480.       max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4481.       if @actor.mp > max_value
  4482.          icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4483.       else   
  4484.          icon_max = @actor.mmp
  4485.       end      
  4486.       for i in 0...icon_max
  4487.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4488.           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)
  4489.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4490.           i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4491.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )      
  4492.       end      
  4493.       icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4494.       rx = 0
  4495.       ry = 0
  4496.       for i in 0...icon_max
  4497.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4498.           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)
  4499.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4500.           i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4501.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4502.       end
  4503.       refresh_mp_icon_ex(rx,ry)      
  4504.   end
  4505.   
  4506.   #--------------------------------------------------------------------------
  4507.   # * Create MP Icon EX
  4508.   #--------------------------------------------------------------------------  
  4509.   def create_mp_icon_ex(viewport)
  4510.       return if !MP_ICON_EX_VISIBLE
  4511.       @mp_icon3_anime_phase = 0
  4512.       @mp_icon3 = Sprite.new
  4513.       @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4514.       @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4515.       @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4516.       @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4517.       @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4518.                        @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4519.       @mp_icon3.x = @mp_icon3_org[0]
  4520.       @mp_icon3.y = @mp_icon3_org[1]
  4521.       @mp_icon3.viewport = viewport
  4522.       @mp_icon3.opacity = 0
  4523.   end   
  4524.   
  4525.   #--------------------------------------------------------------------------
  4526.   # * Refresh MP Icon EX
  4527.   #--------------------------------------------------------------------------      
  4528.   def refresh_mp_icon_ex(rx,ry)
  4529.       return if @mp_icon3 == nil
  4530.       @mp_icon3.bitmap.clear
  4531.       return if @actor.mp == 0
  4532.       i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4533.       @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4534.       @mp_icon3.x = @mp_icon3_org[0] + rx
  4535.       @mp_icon3.y = @mp_icon3_org[1] + ry     
  4536.   end
  4537.   
  4538.   #--------------------------------------------------------------------------
  4539.   # * Update Icon MP EX Anime
  4540.   #--------------------------------------------------------------------------  
  4541.   def update_icon_mp_ex_anime
  4542.       return if !MP_ICON_EX_ZOOM_EFFECT
  4543.       if @mp_icon3_anime_phase == 0
  4544.          @mp_icon3.zoom_x += 0.01
  4545.          if @mp_icon3.zoom_x >= 1.30
  4546.             @mp_icon3.zoom_x = 1.30
  4547.             @mp_icon3_anime_phase = 1
  4548.          end  
  4549.       else
  4550.         @mp_icon3.zoom_x -= 0.01
  4551.         if @mp_icon3.zoom_x <= 1.05
  4552.            @mp_icon3.zoom_x = 1.05
  4553.            @mp_icon3_anime_phase = 0
  4554.         end   
  4555.       end  
  4556.       @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4557.   end  
  4558.   
  4559.   #--------------------------------------------------------------------------
  4560.   # * Create MP Icon Number
  4561.   #--------------------------------------------------------------------------      
  4562.   def create_mp_icon_number(viewport)
  4563.       return if !MP_ICON_NUMBER_VISIBLE
  4564.       @mp_icon_number_old = [-1,-1]
  4565.       @mp_icon_number = Sprite.new
  4566.       @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4567.       @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4568.       @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4569.       @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4570.       @mp_icon_number.viewport = viewport
  4571.       @mp_icon_number.opacity = 0
  4572.   end
  4573.   
  4574.   #--------------------------------------------------------------------------
  4575.   # * Refresh Icon Number MP
  4576.   #--------------------------------------------------------------------------  
  4577.   def refresh_icon_number_mp
  4578.       @mp_icon_number_old[0] = @actor.mp
  4579.       @mp_icon_number_old[1] = @actor.mmp
  4580.       @mp_icon_number.bitmap.clear
  4581.       value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4582.       value = 0 if value < 0
  4583.       number_value = value.truncate.abs.to_s.split(//)
  4584.       for r in 0..number_value.size - 1         
  4585.          number_value_abs = number_value[r].to_i
  4586.          nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4587.          @mp_icon_number.bitmap.blt(@mp_icon_number_cw *  r, 0, @mp_icon_number_image, nsrc_rect)
  4588.       end
  4589.       cx = (number_value.size * @mp_icon_number_cw)
  4590.       case MP_ICON_NUMBER_ALIGN_TYPE
  4591.          when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4592.          when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4593.          when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4594.       end        
  4595.   end

  4596.   #--------------------------------------------------------------------------
  4597.   # * Can Refresh Icon Number MP
  4598.   #--------------------------------------------------------------------------  
  4599.   def can_refresh_icon_number_mp?
  4600.       return true if @mp_icon_number_old[0] != @actor.mp
  4601.       return true if @mp_icon_number_old[1] != @actor.mmp
  4602.       return false
  4603.   end   
  4604.   
  4605.   #--------------------------------------------------------------------------
  4606.   # * Update MP
  4607.   #--------------------------------------------------------------------------   
  4608.   def update_mp
  4609.       if @mp_number != nil
  4610.          sprite_visible(@mp_number)
  4611.          if MP_NUMBER_ANIMATION
  4612.             update_number(1,@mp_number_old)
  4613.          else
  4614.             update_number_fix(1) if @mp_number_old != @actor.mp
  4615.          end  
  4616.          refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4617.       end
  4618.       if @mp_number2 != nil
  4619.          sprite_visible(@mp_number2)
  4620.          if MP_NUMBER_ANIMATION
  4621.             update_number(4,@mp_number2_old)
  4622.          else
  4623.             update_number_fix(4) if @mp_number2_old != @actor.mmp
  4624.          end  
  4625.          refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4626.       end      
  4627.       if @mp_meter != nil
  4628.          sprite_visible(@mp_meter)
  4629.          update_flow_mp
  4630.       end
  4631.       if @mp_icon != nil
  4632.          sprite_visible(@mp_icon)
  4633.          refresh_mp_icon if @mp_icon_old != @actor.mp
  4634.       end
  4635.       if @mp_icon3 != nil
  4636.          sprite_visible(@mp_icon3)
  4637.          update_icon_mp_ex_anime
  4638.       end         
  4639.       if @mp_icon_number != nil
  4640.          sprite_visible(@mp_icon_number)
  4641.          refresh_icon_number_mp if can_refresh_icon_number_mp?
  4642.       end      
  4643.   end  
  4644.   
  4645. end

  4646. #==============================================================================
  4647. #==============================================================================
  4648. # ** Battle Hud EX
  4649. #==============================================================================
  4650. #==============================================================================
  4651. class Battle_Hud_EX
  4652.   
  4653.   #--------------------------------------------------------------------------
  4654.   # * Create TP Number
  4655.   #--------------------------------------------------------------------------  
  4656.   def create_tp_number(viewport)
  4657.       return if !TP_NUMBER_VISIBLE
  4658.       @tp_number = Sprite.new
  4659.       @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4660.       @tp_number.z = HUD_Z + TP_NUMBER_Z
  4661.       @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4662.       @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4663.       @tp_number.viewport = viewport
  4664.       @tp_number.opacity = 0
  4665.   end
  4666.   
  4667.   #--------------------------------------------------------------------------
  4668.   # * Create TP Number MAX
  4669.   #--------------------------------------------------------------------------  
  4670.   def create_tp_number_max(viewport)
  4671.       return if !TP_NUMBER_MAX_VISIBLE
  4672.       @tp_number2 = Sprite.new
  4673.       @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4674.       @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4675.       @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4676.       @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4677.       @tp_number2.viewport = viewport
  4678.       @tp_number2.opacity = 0
  4679.   end  
  4680.   
  4681.   #--------------------------------------------------------------------------
  4682.   # * Create TP Meter
  4683.   #--------------------------------------------------------------------------   
  4684.   def create_tp_meter(viewport)
  4685.       return if !TP_METER_VISIBLE
  4686.       @tp_flow_max = @tp_meter_cw * 2
  4687.       @tp_flow = rand(@tp_flow_max)
  4688.       @tp_meter = Sprite.new
  4689.       @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4690.       @tp_meter.z = HUD_Z + TP_METER_Z
  4691.       @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4692.       @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4693.       @tp_meter.angle = TP_METER_ANGLE
  4694.       @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4695.       @tp_meter.viewport = viewport
  4696.       @tp_meter.opacity = 0
  4697.   end
  4698.   
  4699.   #--------------------------------------------------------------------------
  4700.   # ● Update Flow TP
  4701.   #--------------------------------------------------------------------------            
  4702.   def update_flow_tp
  4703.       @tp_meter.bitmap.clear      
  4704.       @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4705.       meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil  
  4706.       meter_width = 0 if meter_width == nil
  4707.       execute_tp_damage_flow(meter_width)      
  4708.       meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4709.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)  
  4710.       @tp_flow += 1
  4711.       @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4712.   end  
  4713.    
  4714.   #--------------------------------------------------------------------------
  4715.   # ● Execute TP Damage Flow
  4716.   #--------------------------------------------------------------------------
  4717.   def execute_tp_damage_flow(meter_width)
  4718.       return if !TP_METER_REDUCTION_ANIMATION
  4719.       return if @tp_old_meter == meter_width
  4720.       n = (@tp_old_meter - meter_width).abs * 3 / 100
  4721.       damage_flow = [[n, 2].min,0.5].max
  4722.       @tp_old_meter -= damage_flow
  4723.       @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4724.       src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4725.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)      
  4726.   end

  4727.   #--------------------------------------------------------------------------
  4728.   # * Create TP Icon
  4729.   #--------------------------------------------------------------------------  
  4730.   def create_tp_icon(viewport)
  4731.       return if !TP_ICON_VISIBLE
  4732.       @tp_icon = Sprite.new
  4733.       icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4734.       icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4735.       @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4736.       @tp_icon.z = HUD_Z + TP_ICON_Z
  4737.       @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4738.       @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4739.       @tp_icon.viewport = viewport
  4740.       @tp_icon.opacity = 0
  4741.   end
  4742.    
  4743.   #--------------------------------------------------------------------------
  4744.   # * Refresh TP Icon
  4745.   #--------------------------------------------------------------------------   
  4746.   def refresh_tp_icon
  4747.       @tp_icon_old = @actor.tp
  4748.       @tp_icon.bitmap.clear
  4749.       max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4750.       if @actor.mp > max_value
  4751.          icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4752.       else   
  4753.          icon_max = @actor.max_tp
  4754.       end      
  4755.       for i in 0...icon_max
  4756.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4757.           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)
  4758.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4759.           i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4760.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )      
  4761.       end      
  4762.       icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4763.       rx = 0
  4764.       ry = 0
  4765.       for i in 0...icon_max
  4766.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4767.           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)
  4768.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4769.           i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4770.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4771.       end
  4772.       refresh_tp_icon_ex(rx,ry)      
  4773.   end
  4774.   
  4775.   #--------------------------------------------------------------------------
  4776.   # * Create TP Icon EX
  4777.   #--------------------------------------------------------------------------  
  4778.   def create_tp_icon_ex(viewport)
  4779.       return if !TP_ICON_EX_VISIBLE
  4780.       @tp_icon3_anime_phase = 0
  4781.       @tp_icon3 = Sprite.new
  4782.       @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4783.       @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4784.       @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4785.       @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4786.       @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4787.                        @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4788.       @tp_icon3.x = @tp_icon3_org[0]
  4789.       @tp_icon3.y = @tp_icon3_org[1]
  4790.       @tp_icon3.viewport = viewport
  4791.       @tp_icon3.opacity = 0
  4792.   end   
  4793.   
  4794.   #--------------------------------------------------------------------------
  4795.   # * Refresh TP Icon EX
  4796.   #--------------------------------------------------------------------------      
  4797.   def refresh_tp_icon_ex(rx,ry)
  4798.       return if @tp_icon3 == nil
  4799.       @tp_icon3.bitmap.clear
  4800.       return if @actor.tp == 0
  4801.       i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4802.       @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4803.       @tp_icon3.x = @tp_icon3_org[0] + rx
  4804.       @tp_icon3.y = @tp_icon3_org[1] + ry     
  4805.   end
  4806.   
  4807.   #--------------------------------------------------------------------------
  4808.   # * Update Icon TP EX Anime
  4809.   #--------------------------------------------------------------------------  
  4810.   def update_icon_tp_ex_anime
  4811.       return if !MP_ICON_EX_ZOOM_EFFECT
  4812.       if @tp_icon3_anime_phase == 0
  4813.          @tp_icon3.zoom_x += 0.01
  4814.          if @tp_icon3.zoom_x >= 1.30
  4815.             @tp_icon3.zoom_x = 1.30
  4816.             @tp_icon3_anime_phase = 1
  4817.          end  
  4818.       else
  4819.         @tp_icon3.zoom_x -= 0.01
  4820.         if @tp_icon3.zoom_x <= 1.05
  4821.            @tp_icon3.zoom_x = 1.05
  4822.            @tp_icon3_anime_phase = 0
  4823.         end   
  4824.       end  
  4825.       @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4826.   end   
  4827.   
  4828.   #--------------------------------------------------------------------------
  4829.   # * Create HP Icon Number
  4830.   #--------------------------------------------------------------------------      
  4831.   def create_tp_icon_number(viewport)
  4832.       return if !TP_ICON_NUMBER_VISIBLE
  4833.       @tp_icon_number_old = [-1,-1]
  4834.       @tp_icon_number = Sprite.new
  4835.       @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  4836.       @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  4837.       @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  4838.       @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  4839.       @tp_icon_number.viewport = viewport
  4840.       @tp_icon_number.opacity = 0
  4841.   end
  4842.   
  4843.   #--------------------------------------------------------------------------
  4844.   # * Refresh Icon Number TP
  4845.   #--------------------------------------------------------------------------  
  4846.   def refresh_icon_number_tp
  4847.       @tp_icon_number_old[0] = @actor.tp
  4848.       @tp_icon_number_old[1] = @actor.max_tp
  4849.       @tp_icon_number.bitmap.clear
  4850.       value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  4851.       value = 0 if value < 0
  4852.       number_value = value.truncate.abs.to_s.split(//)
  4853.       for r in 0..number_value.size - 1         
  4854.          number_value_abs = number_value[r].to_i
  4855.          nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  4856.          @tp_icon_number.bitmap.blt(@tp_icon_number_cw *  r, 0, @tp_icon_number_image, nsrc_rect)
  4857.       end
  4858.       cx = (number_value.size * @tp_icon_number_cw)
  4859.       case TP_ICON_NUMBER_ALIGN_TYPE
  4860.          when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  4861.          when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4862.          when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  4863.       end        
  4864.   end

  4865.   #--------------------------------------------------------------------------
  4866.   # * Can Refresh Icon Number TP
  4867.   #--------------------------------------------------------------------------  
  4868.   def can_refresh_icon_number_tp?
  4869.       return true if @tp_icon_number_old[0] != @actor.tp
  4870.       return true if @tp_icon_number_old[1] != @actor.max_tp
  4871.       return false
  4872.   end   
  4873.   
  4874.   #--------------------------------------------------------------------------
  4875.   # * Update TP
  4876.   #--------------------------------------------------------------------------   
  4877.   def update_tp
  4878.       if @tp_number != nil
  4879.          sprite_visible(@tp_number)
  4880.          if MP_NUMBER_ANIMATION
  4881.             update_number(2,@tp_number_old)
  4882.          else
  4883.             update_number_fix(2) if @tp_number_old != @actor.tp
  4884.          end           
  4885.          refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh         
  4886.       end   
  4887.       if @tp_number2 != nil
  4888.          sprite_visible(@tp_number2)
  4889.          if MP_NUMBER_ANIMATION
  4890.             update_number(5,@tp_number2_old)
  4891.          else
  4892.             update_number_fix(5) if @tp_number2_old != @actor.max_tp
  4893.          end           
  4894.          refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  4895.       end        
  4896.       if @tp_meter != nil
  4897.          sprite_visible(@tp_meter)
  4898.          update_flow_tp
  4899.       end
  4900.       if @tp_icon != nil
  4901.          sprite_visible(@tp_icon)
  4902.          refresh_tp_icon if @tp_icon_old != @actor.tp
  4903.       end
  4904.       if @tp_icon3 != nil
  4905.          sprite_visible(@tp_icon3)
  4906.          update_icon_tp_ex_anime
  4907.       end         
  4908.       if @tp_icon_number != nil
  4909.          sprite_visible(@tp_icon_number)
  4910.          refresh_icon_number_tp if can_refresh_icon_number_tp?
  4911.       end  
  4912.   end  
  4913.   
  4914. end

  4915. #==============================================================================
  4916. #==============================================================================
  4917. # ** Battle Hud EX
  4918. #==============================================================================
  4919. #==============================================================================
  4920. class Battle_Hud_EX
  4921.   
  4922.   #--------------------------------------------------------------------------
  4923.   # * Create AT Number
  4924.   #--------------------------------------------------------------------------  
  4925.   def create_at_number(viewport)
  4926.       return if !AT_NUMBER_VISIBLE
  4927.       @at_number = Sprite.new
  4928.       @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  4929.       @at_number.z = HUD_Z + AT_NUMBER_Z
  4930.       @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4931.       @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  4932.       @at_number.viewport = viewport
  4933.       @at_number.opacity = 0
  4934.   end
  4935.   
  4936.   #--------------------------------------------------------------------------
  4937.   # * Create AT Number Max
  4938.   #--------------------------------------------------------------------------  
  4939.   def create_at_number_max(viewport)
  4940.       return if !AT_NUMBER_MAX_VISIBLE
  4941.       @at_number2 = Sprite.new
  4942.       @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  4943.       @at_number2.z = HUD_Z + AT_NUMBER_Z
  4944.       @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  4945.       @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  4946.       @at_number2.viewport = viewport
  4947.       @at_number2.opacity = 0
  4948.   end  
  4949.   
  4950.   #--------------------------------------------------------------------------
  4951.   # * Create AT Meter
  4952.   #--------------------------------------------------------------------------   
  4953.   def create_at_meter(viewport)
  4954.       return if !AT_METER_VISIBLE
  4955.       @at_flow_max = @at_meter_cw * 2
  4956.       @at_flow = rand(@at_flow_max)
  4957.       @at_meter = Sprite.new
  4958.       @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  4959.       @at_meter.z = HUD_Z + AT_METER_Z
  4960.       @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  4961.       @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  4962.       @at_meter.angle = AT_METER_ANGLE
  4963.       @at_meter.mirror = AT_METER_MIRROR_EFFECT
  4964.       @at_meter.viewport = viewport
  4965.       @at_meter.opacity = 0
  4966.   end
  4967.   
  4968.   #--------------------------------------------------------------------------
  4969.   # ● Update Flow AT
  4970.   #--------------------------------------------------------------------------            
  4971.   def update_flow_at
  4972.       @at_meter.bitmap.clear
  4973.       @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  4974.       if actor_cast?
  4975.          meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  4976.          meter_width = 0 if meter_width == nil
  4977.          ch = @at_meter_ch * 2
  4978.       else
  4979.          meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  4980.          meter_width = 0 if meter_width == nil         
  4981.          ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  4982.       end   
  4983.       meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  4984.       @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)  
  4985.       @at_flow += 1
  4986.       @at_flow = 0 if @at_flow >= @at_flow_max
  4987.   end  
  4988.   
  4989.   #--------------------------------------------------------------------------
  4990.   # * Update AT
  4991.   #--------------------------------------------------------------------------   
  4992.   def update_at
  4993.       if @at_number != nil
  4994.          sprite_visible(@at_number)
  4995.          if AT_NUMBER_ANIMATION
  4996.             update_number(6,@at_number_old)
  4997.          else   
  4998.             update_number_fix(6) if @at_number_old != actor_at
  4999.          end  
  5000.          refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5001.       end
  5002.       if @at_number2 != nil
  5003.          sprite_visible(@at_number2)
  5004.          if AT_NUMBER_ANIMATION
  5005.             update_number(7,@at_number2_old)
  5006.          else   
  5007.             update_number_fix(7) if @at_number2_old != actor_max_at
  5008.          end  
  5009.          refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5010.       end
  5011.       if @at_meter != nil
  5012.          sprite_visible(@at_meter)
  5013.          update_flow_at
  5014.       end   
  5015.   end  
  5016.    
  5017. end

  5018. #==============================================================================
  5019. #==============================================================================
  5020. # ** Battle Hud EX
  5021. #==============================================================================
  5022. #==============================================================================
  5023. class Battle_Hud_EX
  5024.   
  5025.   #--------------------------------------------------------------------------
  5026.   # * Create Level Number
  5027.   #--------------------------------------------------------------------------   
  5028.   def create_level_number(viewport)
  5029.       return if !LEVEL_NUMBER_VISIBLE
  5030.       @old_level = -1
  5031.       @lv_number = Sprite.new
  5032.       @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5033.       @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5034.       @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5035.       @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5036.       @lv_number.viewport = viewport
  5037.       @lv_number.opacity = 0
  5038.   end
  5039.   
  5040.   #--------------------------------------------------------------------------
  5041.   # * Refresh Level Number
  5042.   #--------------------------------------------------------------------------  
  5043.   def refresh_level_number
  5044.       @lv_number.bitmap.clear
  5045.       @old_level = @actor.level      
  5046.       number_value = @actor.level.abs.to_s.split(//)
  5047.       for r in 0..number_value.size - 1         
  5048.          number_value_abs = number_value[r].to_i
  5049.          nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5050.          @lv_number.bitmap.blt(@lv_number_cw *  r, 0, @lv_number_image, nsrc_rect)
  5051.       end
  5052.       cx = (number_value.size * @lv_number_cw)
  5053.       case LEVEL_NUMBER_ALIGN_TYPE
  5054.            when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5055.            when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5056.            when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5057.       end
  5058.   end
  5059.   
  5060.   #--------------------------------------------------------------------------
  5061.   # * Update Level
  5062.   #--------------------------------------------------------------------------  
  5063.   def update_level
  5064.       return if @lv_number == nil
  5065.       sprite_visible(@lv_number)
  5066.       refresh_level_number if @old_level != @actor.level
  5067.   end
  5068.   
  5069. end

  5070. #==============================================================================
  5071. #==============================================================================
  5072. # ** Battle Hud EX
  5073. #==============================================================================
  5074. #==============================================================================
  5075. class Battle_Hud_EX
  5076.   
  5077.   #--------------------------------------------------------------------------
  5078.   # * Create States
  5079.   #--------------------------------------------------------------------------  
  5080.   def create_states(viewport)
  5081.       return if !STATES_VISIBLE
  5082.       @status_old = nil
  5083.       @status_flow = [-24,0]
  5084.       @status_size_real = 0
  5085.       @status = Sprite.new
  5086.       @status.bitmap = Bitmap.new(24,24)
  5087.       @status.x = @hud_position[0] + STATES_POSITION[0]
  5088.       @status.y = @hud_position[1] + STATES_POSITION[1]
  5089.       @status.z = HUD_Z + STATES_Z
  5090.       @status.angle = STATE_ANGLE
  5091.       @status.viewport = viewport
  5092.       @status.opacity = 0
  5093.   end
  5094.   
  5095.   #--------------------------------------------------------------------------
  5096.   # * Refresh States
  5097.   #--------------------------------------------------------------------------        
  5098.   def refresh_states
  5099.       check_icon_image
  5100.       @status_size_real = set_real_states_size
  5101.       @status_old = @actor.states
  5102.       @status_flow = [0,0]
  5103.       @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5104.       @actor_status.dispose if @actor_status != nil
  5105.       @actor_status = Bitmap.new(@states_size,24)
  5106.       index = 0
  5107.       for i in @actor.states
  5108.          next if HIDE_STATES_ID.include?(i.id)         
  5109.          rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5110.          @actor_status.blt(26 * index , 0, @icon_image, rect)
  5111.          index += 1
  5112.       end
  5113.   end   
  5114.   
  5115.   #--------------------------------------------------------------------------
  5116.   # * Set Real States Size
  5117.   #--------------------------------------------------------------------------        
  5118.   def set_real_states_size
  5119.       n = 0
  5120.       for i in @actor.states
  5121.           next if HIDE_STATES_ID.include?(i.id)  
  5122.           n += 1
  5123.       end
  5124.       return n
  5125.   end
  5126.   
  5127.   #--------------------------------------------------------------------------
  5128.   # * Flow_Status
  5129.   #--------------------------------------------------------------------------         
  5130.   def flow_states
  5131.       return if @actor_status == nil
  5132.       @status.bitmap.clear
  5133.       return if @actor.states.size == 0
  5134.       st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5135.       @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5136.       if STATES_SCROLLING_ANIMATION
  5137.          @status_flow[0] += 1
  5138.          @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5139.       else   
  5140.          @status_flow[1] += 1 unless @actor.states.size <= 1
  5141.          if @status_flow[1] > 30
  5142.             @status_flow[1] = 0
  5143.             @status_flow[0] += 26
  5144.             @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5145.          end   
  5146.      end   
  5147.   end      
  5148.   
  5149.   #--------------------------------------------------------------------------
  5150.   # * Update States
  5151.   #--------------------------------------------------------------------------  
  5152.   def update_states
  5153.       return if @status == nil
  5154.       sprite_visible(@status)
  5155.       refresh_states if @status_old != @actor.states
  5156.       flow_states
  5157.   end  
  5158.   
  5159. end

  5160. #==============================================================================
  5161. #==============================================================================
  5162. # ** Battle Hud EX
  5163. #==============================================================================
  5164. #==============================================================================
  5165. class Battle_Hud_EX
  5166.   
  5167.   #--------------------------------------------------------------------------
  5168.   # * Create Face
  5169.   #--------------------------------------------------------------------------   
  5170.   def create_face(viewport)
  5171.       return if !FACE_VISIBLE
  5172.       @face_old_hp = @actor.hp
  5173.       @face_old_mp = @actor.mp
  5174.       @face_old_tp = @actor.tp
  5175.       @face_name = ""
  5176.       @face = Sprite.new
  5177.       @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5178.       @face.x = @face_org[0]
  5179.       @face.y = @face_org[1]
  5180.       @face.z = HUD_Z + FACE_Z
  5181.       @face.viewport = viewport
  5182.       @face.opacity = 0
  5183.       refresh_face_name
  5184.   end

  5185.   #--------------------------------------------------------------------------
  5186.   # * Refresh Face Name
  5187.   #--------------------------------------------------------------------------      
  5188.   def refresh_face_name      
  5189.       @face_image.dispose if @face_image != nil
  5190.       @face.bitmap.dispose if @face.bitmap != nil
  5191.       return if @actor == nil or @actor.id == nil
  5192.       @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5193.       @face_image = Bitmap.new(32,32) if @face_image == nil
  5194.       @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5195.       @face_ch = @face_image.height
  5196.       @face.ox = @face_cw / 2
  5197.       @face.oy = @face_ch / 2      
  5198.       @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5199.       @face_org = [@hud_position[0] + FACE_POSITION[0],
  5200.                    @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5201.       if $game_temp.battler_face_pos[@actor_index] == nil
  5202.          $game_temp.battler_face_pos[@actor_index] = []
  5203.       end
  5204.       @face.x = @face_org[0]
  5205.       @face.y = @face_org[1]  
  5206.       limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5207.       fy = @face_org[1]
  5208.       if limit_Y > Graphics.height
  5209.          @face.y = Graphics.height - (@face_image.height - @face.oy)
  5210.          fy = Graphics.height - 16
  5211.          @face_org[1] = @face.y
  5212.       end
  5213.       $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5214.       $game_temp.battler_face_pos[@actor_index][1] = fy
  5215.       $game_temp.battler_face_pos[@actor_index][2] = @face.z     
  5216.       clear_face_index
  5217.   end

  5218.   #--------------------------------------------------------------------------
  5219.   # * Refresh Face
  5220.   #--------------------------------------------------------------------------  
  5221.   def refresh_face
  5222.       @face.mirror = false
  5223.       @face.zoom_x = 1.00
  5224.       @face.zoom_y = 1.00
  5225.       @face_index = @actor.face_animation[1]
  5226.       @face.bitmap.clear
  5227.       if !FACE_ANIMATION
  5228.          f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5229.       else
  5230.          f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5231.       end
  5232.       @face.bitmap.blt(0,0,@face_image,f_scr)
  5233.   end
  5234.    
  5235.   #--------------------------------------------------------------------------
  5236.   # * Update Face Duration
  5237.   #--------------------------------------------------------------------------   
  5238.   def update_face_duration
  5239.       return if @actor.face_animation[0] == 0
  5240.       @actor.face_animation[0] -= 1
  5241.       update_face_shake_effect
  5242.       update_face_zoom if @actor.face_animation[1] == 2
  5243.       return if @actor.face_animation[0] > 0
  5244.       clear_face_index
  5245.   end
  5246.   
  5247.   #--------------------------------------------------------------------------
  5248.   # * Clear Face Index
  5249.   #--------------------------------------------------------------------------      
  5250.   def clear_face_index
  5251.       @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5252.       @actor.face_animation[1] = 4 if @actor.dead?
  5253.       refresh_face
  5254.   end
  5255.       
  5256.   #--------------------------------------------------------------------------
  5257.   # * Update Face Zoom
  5258.   #--------------------------------------------------------------------------      
  5259.   def update_face_zoom
  5260.       return if !FACE_ZOOM_ANIMATION
  5261.       case @actor.face_animation[0]
  5262.          when 30..60
  5263.             @face.zoom_x += 0.01
  5264.             @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5265.             @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5266.          when 1..29
  5267.             @face.zoom_x -= 0.01
  5268.             @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5269.             @face.mirror = false
  5270.          else
  5271.             @face.zoom_x = 1.00
  5272.             @face.mirror = false
  5273.       end
  5274.       @face.zoom_y = @face.zoom_x
  5275.   end
  5276.   
  5277.   #--------------------------------------------------------------------------
  5278.   # * Can Refresh Index MP TP?
  5279.   #--------------------------------------------------------------------------     
  5280.   def can_refresh_index_mp_tp?
  5281.       return true if @face_old_mp != @actor.mp
  5282.       return false
  5283.   end
  5284.   
  5285.   #--------------------------------------------------------------------------
  5286.   # * Refresh Face Index HP
  5287.   #--------------------------------------------------------------------------  
  5288.   def refresh_face_index_hp
  5289.       @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5290.       @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5291.       @face_old_hp = @actor.hp
  5292.   end
  5293.   
  5294.   #--------------------------------------------------------------------------
  5295.   # * Refresh Face Index MP TP
  5296.   #--------------------------------------------------------------------------  
  5297.   def refresh_face_index_mp_tp
  5298.       if @face_old_mp < @actor.mp
  5299.          @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5300.          @actor.face_animation[1] = 1
  5301.       end
  5302.       @face_old_mp = @actor.mp
  5303.       @face_old_tp = @actor.tp
  5304.   end  
  5305.   
  5306.   #--------------------------------------------------------------------------
  5307.   # * Update Face Shake Effect
  5308.   #--------------------------------------------------------------------------  
  5309.   def update_face_shake_effect
  5310.       return if !FACE_SHAKE_EFFECT
  5311.       if FACE_ANIMATION
  5312.          update_shake_animated_face
  5313.       else            
  5314.          update_shake_still_face
  5315.       end  
  5316.   end      

  5317.   #--------------------------------------------------------------------------
  5318.   # * Update Shake Still Effect Face
  5319.   #--------------------------------------------------------------------------   
  5320.   def update_shake_still_face
  5321.       if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5322.          @face.x = @face_org[0] - 4 + rand(8)
  5323.       else
  5324.          @face.x = @face_org[0]
  5325.       end     
  5326.   end
  5327.       
  5328.   #--------------------------------------------------------------------------
  5329.   # * Update Shake Animated Face
  5330.   #--------------------------------------------------------------------------   
  5331.   def update_shake_animated_face
  5332.       if @actor.face_animation[0] == 0
  5333.          @face.x = @face_org[0]
  5334.          return
  5335.       end
  5336.       if @actor.face_animation[1] == 3 and @actor.hp > 0
  5337.          @face.x = @face_org[0] - 4 + rand(8)
  5338.       else
  5339.          @face.x = @face_org[0]
  5340.       end         
  5341.   end
  5342.   
  5343.   #--------------------------------------------------------------------------
  5344.   # * Update Face
  5345.   #--------------------------------------------------------------------------   
  5346.   def update_face
  5347.       return if @face == nil
  5348.       sprite_visible(@face)
  5349.       refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5350.       update_face_duration
  5351.       return if !FACE_ANIMATION
  5352.       refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5353.       refresh_face_index_hp if @face_old_hp != @actor.hp
  5354.       refresh_face if @face_index != @actor.face_animation[1]
  5355.   end  
  5356.   
  5357. end

  5358. #==============================================================================
  5359. # ■ Battle Manager
  5360. #==============================================================================
  5361. class << BattleManager
  5362.   
  5363.   #--------------------------------------------------------------------------
  5364.   # ● Battle End
  5365.   #--------------------------------------------------------------------------                    
  5366.   alias mog_battle_hud_battle_process_victory process_victory
  5367.   def process_victory
  5368.       execute_face_effect_end
  5369.       mog_battle_hud_battle_process_victory
  5370.   end
  5371.   
  5372.   #--------------------------------------------------------------------------
  5373.   # ● Execute Face Effect End
  5374.   #--------------------------------------------------------------------------                  
  5375.   def execute_face_effect_end
  5376.       $game_temp.battle_end = true
  5377.       for i in $game_party.members
  5378.           i.face_animation = [120,1,0] if i.hp > 0   
  5379.       end  
  5380.   end
  5381.   
  5382.   #--------------------------------------------------------------------------
  5383.   # * Display EXP Earned
  5384.   #--------------------------------------------------------------------------
  5385.   alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5386.   def process_defeat
  5387.       $game_temp.battle_end = true
  5388.       mog_battle_hud_ex_message_battle_process_defeat
  5389.   end
  5390.   
  5391.   #--------------------------------------------------------------------------
  5392.   # * Process Abort
  5393.   #--------------------------------------------------------------------------
  5394.   alias mog_battle_hud_ex_process_abort process_abort
  5395.   def process_abort
  5396.       $game_temp.battle_end = true
  5397.       mog_battle_hud_ex_process_abort
  5398.   end  
  5399.   
  5400. end

  5401. #==============================================================================
  5402. # ** Scene Battle
  5403. #==============================================================================
  5404. class Scene_Battle < Scene_Base

  5405.   #--------------------------------------------------------------------------
  5406.   # * Use Item
  5407.   #--------------------------------------------------------------------------      
  5408.   alias mog_monogatari_use_item use_item
  5409.   def use_item
  5410.       execute_face_animation
  5411.       mog_monogatari_use_item
  5412.   end

  5413.   #--------------------------------------------------------------------------
  5414.   # * Execute Face Animation
  5415.   #--------------------------------------------------------------------------  
  5416.   def execute_face_animation
  5417.       return if @subject.is_a?(Game_Enemy)
  5418.       @subject.face_animation = [60 ,2,0]   
  5419.   end
  5420.    
  5421. end

  5422. #==============================================================================
  5423. #==============================================================================
  5424. # ** Battle Hud EX
  5425. #==============================================================================
  5426. #==============================================================================
  5427. class Battle_Hud_EX

  5428.   #--------------------------------------------------------------------------
  5429.   # * Dispose
  5430.   #--------------------------------------------------------------------------  
  5431.   def dispose
  5432.       terminate
  5433.       dispose_layout
  5434.       dispose_layout_2
  5435.       dispose_name
  5436.       dispose_face
  5437.       dispose_hp_number
  5438.       dispose_hp_number_max
  5439.       dispose_hp_meter
  5440.       dispose_hp_icon
  5441.       dispose_hp_icon_ex
  5442.       dispose_hp_icon_number
  5443.       dispose_mp_number
  5444.       dispose_mp_number_max
  5445.       dispose_mp_meter
  5446.       dispose_mp_icon
  5447.       dispose_mp_icon_ex
  5448.       dispose_mp_icon_number
  5449.       dispose_tp_number
  5450.       dispose_tp_number_max
  5451.       dispose_tp_meter
  5452.       dispose_tp_icon
  5453.       dispose_tp_icon_ex
  5454.       dispose_tp_icon_number
  5455.       dispose_at_number
  5456.       dispose_at_number_max
  5457.       dispose_at_meter      
  5458.       dispose_lv_number
  5459.       dispose_states
  5460.   end
  5461.   
  5462.   #--------------------------------------------------------------------------
  5463.   # * Dispose Layout
  5464.   #--------------------------------------------------------------------------  
  5465.   def dispose_layout
  5466.       return if @layout == nil
  5467.       @layout.dispose
  5468.       @layout = nil
  5469.   end
  5470.   
  5471.   #--------------------------------------------------------------------------
  5472.   # * Dispose Layout 2
  5473.   #--------------------------------------------------------------------------  
  5474.   def dispose_layout_2
  5475.       return if @layout2 == nil
  5476.       @layout2.dispose
  5477.       @layout2 = nil
  5478.   end  
  5479.   
  5480.   #--------------------------------------------------------------------------
  5481.   # * Dispose Name
  5482.   #--------------------------------------------------------------------------         
  5483.   def dispose_name
  5484.       return if @name == nil
  5485.       @name.bitmap.dispose
  5486.       @name.dispose
  5487.       @name = nil
  5488.   end  
  5489.   
  5490.   #--------------------------------------------------------------------------
  5491.   # * Dispose Face
  5492.   #--------------------------------------------------------------------------        
  5493.   def dispose_face
  5494.       return if @face == nil      
  5495.       @face.bitmap.dispose if @face.bitmap != nil   
  5496.       @face.dispose
  5497.       @face = nil
  5498.       @face_image.dispose if @face_image != nil
  5499.   end  
  5500.   
  5501.   #--------------------------------------------------------------------------
  5502.   # * Dispose HP Number
  5503.   #--------------------------------------------------------------------------   
  5504.   def dispose_hp_number
  5505.       return if @hp_number == nil
  5506.       @hp_number.bitmap.dispose
  5507.       @hp_number.dispose
  5508.       @hp_number = nil
  5509.   end

  5510.   #--------------------------------------------------------------------------
  5511.   # * Dispose HP Number Max
  5512.   #--------------------------------------------------------------------------   
  5513.   def dispose_hp_number_max
  5514.       return if @hp_number2 == nil
  5515.       @hp_number2.bitmap.dispose
  5516.       @hp_number2.dispose
  5517.       @hp_number2 = nil
  5518.   end   
  5519.   
  5520.   #--------------------------------------------------------------------------
  5521.   # * Dispose HP Meter
  5522.   #--------------------------------------------------------------------------     
  5523.   def dispose_hp_meter
  5524.       return if @hp_meter == nil
  5525.       @hp_meter.bitmap.dispose
  5526.       @hp_meter.dispose
  5527.       @hp_meter = nil
  5528.   end   
  5529.   
  5530.   #--------------------------------------------------------------------------
  5531.   # * Dispose HP Icon
  5532.   #--------------------------------------------------------------------------      
  5533.   def dispose_hp_icon
  5534.       return if @hp_icon == nil
  5535.       @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5536.       @hp_icon.dispose
  5537.       @hp_icon = nil
  5538.   end   
  5539.   
  5540.   #--------------------------------------------------------------------------
  5541.   # * Dispose HP Icon EX
  5542.   #--------------------------------------------------------------------------      
  5543.   def dispose_hp_icon_ex
  5544.       return if @hp_icon3 == nil
  5545.       @hp_icon3.bitmap.dispose
  5546.       @hp_icon3.dispose
  5547.       @hp_icon3 = nil
  5548.   end      
  5549.   
  5550.   #--------------------------------------------------------------------------
  5551.   # * Dispose HP Icon Number
  5552.   #--------------------------------------------------------------------------  
  5553.   def dispose_hp_icon_number
  5554.       return if @hp_icon_number == nil
  5555.       @hp_icon_number.bitmap.dispose
  5556.       @hp_icon_number.dispose
  5557.       @hp_icon_number = nil
  5558.   end   
  5559.   
  5560.   #--------------------------------------------------------------------------
  5561.   # * Dispose MP Number
  5562.   #--------------------------------------------------------------------------   
  5563.   def dispose_mp_number
  5564.       return if @mp_number == nil
  5565.       @mp_number.bitmap.dispose
  5566.       @mp_number.dispose
  5567.       @mp_number = nil
  5568.   end   
  5569.   
  5570.   #--------------------------------------------------------------------------
  5571.   # * Dispose MP Number Max
  5572.   #--------------------------------------------------------------------------   
  5573.   def dispose_mp_number_max
  5574.       return if @mp_number2 == nil
  5575.       @mp_number2.bitmap.dispose
  5576.       @mp_number2.dispose
  5577.       @mp_number2 = nil
  5578.   end   
  5579.   
  5580.   #--------------------------------------------------------------------------
  5581.   # * Dispose MP Meter
  5582.   #--------------------------------------------------------------------------     
  5583.   def dispose_mp_meter
  5584.       return if @mp_meter == nil
  5585.       @mp_meter.bitmap.dispose
  5586.       @mp_meter.dispose
  5587.       @mp_meter = nil
  5588.   end     
  5589.   
  5590.   #--------------------------------------------------------------------------
  5591.   # * Dispose MP Icon
  5592.   #--------------------------------------------------------------------------      
  5593.   def dispose_mp_icon
  5594.       return if @mp_icon == nil
  5595.       @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5596.       @mp_icon.dispose
  5597.       @mp_icon = nil
  5598.   end     
  5599.   
  5600.   #--------------------------------------------------------------------------
  5601.   # * Dispose MP Icon EX
  5602.   #--------------------------------------------------------------------------      
  5603.   def dispose_mp_icon_ex
  5604.       return if @mp_icon3 == nil
  5605.       @mp_icon3.bitmap.dispose
  5606.       @mp_icon3.dispose
  5607.       @mp_icon3 = nil
  5608.   end        
  5609.   
  5610.   #--------------------------------------------------------------------------
  5611.   # * Dispose MP Icon Number
  5612.   #--------------------------------------------------------------------------  
  5613.   def dispose_mp_icon_number
  5614.       return if @mp_icon_number == nil
  5615.       @mp_icon_number.bitmap.dispose
  5616.       @mp_icon_number.dispose
  5617.       @mp_icon_number = nil
  5618.   end   
  5619.    
  5620.   #--------------------------------------------------------------------------
  5621.   # * Dispose TP Number
  5622.   #--------------------------------------------------------------------------   
  5623.   def dispose_tp_number
  5624.       return if @tp_number == nil
  5625.       @tp_number.bitmap.dispose
  5626.       @tp_number.dispose
  5627.       @tp_number = nil
  5628.   end
  5629.   
  5630.   #--------------------------------------------------------------------------
  5631.   # * Dispose TP Number Max
  5632.   #--------------------------------------------------------------------------   
  5633.   def dispose_tp_number_max
  5634.       return if @tp_number2 == nil
  5635.       @tp_number2.bitmap.dispose
  5636.       @tp_number2.dispose
  5637.       @tp_number2 = nil
  5638.   end  
  5639.   
  5640.   #--------------------------------------------------------------------------
  5641.   # * Dispose TP Meter
  5642.   #--------------------------------------------------------------------------     
  5643.   def dispose_tp_meter
  5644.       return if @tp_meter == nil
  5645.       @tp_meter.bitmap.dispose
  5646.       @tp_meter.dispose
  5647.       @tp_meter = nil
  5648.   end     
  5649.   
  5650.   #--------------------------------------------------------------------------
  5651.   # * Dispose TP Icon
  5652.   #--------------------------------------------------------------------------      
  5653.   def dispose_tp_icon
  5654.       return if @tp_icon == nil
  5655.       @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5656.       @tp_icon.dispose
  5657.       @tp_icon = nil
  5658.   end   
  5659.   
  5660.   #--------------------------------------------------------------------------
  5661.   # * Dispose TP Icon EX
  5662.   #--------------------------------------------------------------------------      
  5663.   def dispose_tp_icon_ex
  5664.       return if @tp_icon3 == nil
  5665.       @tp_icon3.bitmap.dispose
  5666.       @tp_icon3.dispose
  5667.       @tp_icon3 = nil
  5668.   end   
  5669.   
  5670.   #--------------------------------------------------------------------------
  5671.   # * Dispose TP Icon Number
  5672.   #--------------------------------------------------------------------------  
  5673.   def dispose_tp_icon_number
  5674.       return if @tp_icon_number == nil
  5675.       @tp_icon_number.bitmap.dispose
  5676.       @tp_icon_number.dispose
  5677.       @tp_icon_numbe = nil
  5678.   end     
  5679.   
  5680.   #--------------------------------------------------------------------------
  5681.   # * Dispose AT Number
  5682.   #--------------------------------------------------------------------------   
  5683.   def dispose_at_number
  5684.       return if @at_number == nil
  5685.       @at_number.bitmap.dispose
  5686.       @at_number.dispose
  5687.       @at_number = nil
  5688.   end

  5689.   #--------------------------------------------------------------------------
  5690.   # * Dispose AT Number Max
  5691.   #--------------------------------------------------------------------------   
  5692.   def dispose_at_number_max
  5693.       return if @at_number2 == nil
  5694.       @at_number2.bitmap.dispose
  5695.       @at_number2.dispose
  5696.       @at_number2 = nil
  5697.   end   
  5698.   
  5699.   #--------------------------------------------------------------------------
  5700.   # * Dispose AT Meter
  5701.   #--------------------------------------------------------------------------     
  5702.   def dispose_at_meter
  5703.       return if @at_meter == nil
  5704.       @at_meter.bitmap.dispose
  5705.       @at_meter.dispose
  5706.       @at_meter = nil
  5707.   end     
  5708.   
  5709.   #--------------------------------------------------------------------------
  5710.   # * Dispose Lv Number
  5711.   #--------------------------------------------------------------------------   
  5712.   def dispose_lv_number
  5713.       return if @lv_number == nil
  5714.       @lv_number.bitmap.dispose
  5715.       @lv_number.dispose
  5716.       @lv_number = nil
  5717.   end
  5718.   
  5719.   #--------------------------------------------------------------------------
  5720.   # * Dispose States
  5721.   #--------------------------------------------------------------------------      
  5722.   def dispose_states
  5723.       return if @status == nil
  5724.       @status.bitmap.dispose if @status.bitmap != nil
  5725.       @status.dispose
  5726.       @actor_status.dispose if @actor_status != nil
  5727.       @status = nil
  5728.   end
  5729.   
  5730. end

  5731. #==============================================================================
  5732. #==============================================================================
  5733. # ** Battle Hud EX
  5734. #==============================================================================
  5735. #==============================================================================
  5736. class Battle_Hud_EX

  5737. #--------------------------------------------------------------------------
  5738. # * Refresh Visible
  5739. #--------------------------------------------------------------------------  
  5740. def refresh_visible(vis)
  5741.      @layout.visible = vis if @layout
  5742.      @layout2.visible = vis if @layout2
  5743.      @name.visible = vis if @name
  5744.      @lv_number.visible = vis if @lv_number
  5745.      @status.visible = vis if @status
  5746.      @face.visible = vis if @face     
  5747.      @hp_number.visible = vis if @hp_number
  5748.      @hp_number2.visible = vis if @hp_number2
  5749.      @hp_meter.visible = vis if @hp_meter
  5750.      @hp_icon.visible = vis if @hp_icon
  5751.      @hp_icon3.visible = vis if @hp_icon3
  5752.      @hp_icon_number.visible = vis if @hp_icon_number     
  5753.      @mp_number.visible = vis if @mp_number
  5754.      @mp_number2.visible = vis if @mp_number2
  5755.      @mp_meter.visible = vis if @mp_meter
  5756.      @mp_icon.visible = vis if @mp_icon
  5757.      @mp_icon3.visible = vis if @mp_icon3
  5758.      @mp_icon_number.visible = vis if @mp_icon_number
  5759.      @tp_number.visible = vis if @tp_number
  5760.      @tp_number2.visible = vis if @tp_number2
  5761.      @tp_meter.visible = vis if @tp_meter
  5762.      @tp_icon.visible = vis if @tp_icon
  5763.      @tp_icon3.visible = vis if @tp_icon3
  5764.      @tp_icon_number.visible = vis if @tp_icon_number      
  5765.      @at_number.visible = vis if @at_number
  5766.      @at_number2.visible = vis if @at_number2
  5767.      @at_meter.visible = vis if @at_meter   
  5768.   end  
  5769.   
  5770.   #--------------------------------------------------------------------------
  5771.   # * Update
  5772.   #--------------------------------------------------------------------------  
  5773.   def update
  5774.       return if @actor == nil
  5775.       @sprite_visible = sprite_visible?
  5776.       @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5777.       update_layout ; update_layout_2 ; update_name
  5778.       update_face ; update_hp ; update_mp ; update_tp
  5779.       update_at ; update_level ; update_states
  5780.   end
  5781.   
  5782. end

  5783. #==============================================================================
  5784. # ■ Sprite Battler
  5785. #==============================================================================
  5786. class Sprite_Battler < Sprite_Base

  5787.   #--------------------------------------------------------------------------
  5788.   # ● Set AV
  5789.   #--------------------------------------------------------------------------      
  5790.   def set_av(a_viewport)
  5791.       @viewport_cm = a_viewport
  5792.   end
  5793.   
  5794.   #--------------------------------------------------------------------------
  5795.   # ● Dispose
  5796.   #--------------------------------------------------------------------------      
  5797.   alias mog_bc_dispose dispose
  5798.   def dispose
  5799.       mog_bc_dispose
  5800.       @viewport_cm.dispose if @viewport_cm != nil
  5801.   end
  5802.   
  5803.   #--------------------------------------------------------------------------
  5804.   # ● Maker Animation Sprites
  5805.   #--------------------------------------------------------------------------      
  5806.   alias mog_bc_make_animation_sprites make_animation_sprites
  5807.   def make_animation_sprites
  5808.       mog_bc_make_animation_sprites
  5809.       set_cm_viewport if $imported[:mog_battle_camera]
  5810.   end
  5811.   
  5812.   #--------------------------------------------------------------------------
  5813.   # ● Set CM Viewpor
  5814.   #--------------------------------------------------------------------------      
  5815.   def set_cm_viewport
  5816.       return if @viewport_cm == nil
  5817.       return if @ani_sprites == nil
  5818.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  5819.          @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  5820.          return
  5821.       end
  5822.       @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  5823.   end
  5824.    
  5825. end

  5826. #==============================================================================
  5827. # ■ Game Temp
  5828. #==============================================================================
  5829. class Spriteset_Battle
  5830.   
  5831.   #--------------------------------------------------------------------------
  5832.   # ● Initialize
  5833.   #--------------------------------------------------------------------------      
  5834.   alias mog_bc_sp_initialize initialize
  5835.   def initialize
  5836.       mog_bc_sp_initialize
  5837.       if $imported[:mog_battle_camera] and @viewport_cm != nil
  5838.          battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  5839.       end
  5840.   end

  5841.   #--------------------------------------------------------------------------
  5842.   # ● Create Viewports
  5843.   #--------------------------------------------------------------------------      
  5844.   alias mog_bc_create_viewports create_viewports
  5845.   def create_viewports
  5846.       mog_bc_create_viewports
  5847.       if $imported[:mog_battle_camera]
  5848.          @viewport_cm = Viewport.new
  5849.          @viewport_cm.z = 100
  5850.       end   
  5851.   end
  5852.   
  5853.   #--------------------------------------------------------------------------
  5854.   # ● Dispose Viewports
  5855.   #--------------------------------------------------------------------------      
  5856.   alias mog_bc_dispose_viewports dispose_viewports
  5857.   def dispose_viewports
  5858.       mog_bc_dispose_viewports
  5859.       @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  5860.   end
  5861.   
  5862.   #--------------------------------------------------------------------------
  5863.   # ● Update Viewports
  5864.   #--------------------------------------------------------------------------      
  5865.   alias mog_bcf_update_viewports update_viewports
  5866.   def update_viewports
  5867.       mog_bcf_update_viewports
  5868.       update_viewport_cm if $imported[:mog_battle_camera]
  5869.   end

  5870.   #--------------------------------------------------------------------------
  5871.   # ● Update Viewport CM
  5872.   #--------------------------------------------------------------------------      
  5873.   def update_viewport_cm
  5874.       return if @viewport_cm == nil  
  5875.       @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  5876.       @viewport_cm.oy = $game_temp.bc_data[1]
  5877.       @viewport_cm.update
  5878.   end
  5879.    
  5880. end
复制代码
梦石
0
星屑
1088
在线时间
141 小时
注册时间
2019-5-12
回帖
49
发表于 2019-9-13 09:34:16 | 显示全部楼层
先说好,这个我并不会,但是你想让别人帮你改这个,你起码也得把显示战斗图的脚本发出来吧?大佬也不是神啊。
回复

使用道具 举报

梦石
0
星屑
1618
在线时间
267 小时
注册时间
2019-1-18
回帖
129
 楼主| 发表于 2019-9-13 11:01:44 | 显示全部楼层
真の玛娜君 发表于 2019-9-13 09:34
先说好,这个我并不会,但是你想让别人帮你改这个,你起码也得把显示战斗图的脚本发出来吧?大佬也不是神啊。 ...

我都不知道显示战斗图的脚本在哪。。。
回复

使用道具 举报

梦石
0
星屑
1088
在线时间
141 小时
注册时间
2019-5-12
回帖
49
发表于 2019-9-13 11:58:30 | 显示全部楼层
造小梦 发表于 2019-9-13 11:01
我都不知道显示战斗图的脚本在哪。。。

那别人更不知道啊,sa的话应该是MOG的脚本
回复

使用道具 举报

梦石
0
星屑
1618
在线时间
267 小时
注册时间
2019-1-18
回帖
129
 楼主| 发表于 2019-9-13 15:27:01 | 显示全部楼层
真の玛娜君 发表于 2019-9-13 11:58
那别人更不知道啊,sa的话应该是MOG的脚本

嗯,我发了,大佬看看呗。。。
回复

使用道具 举报

梦石
0
星屑
1088
在线时间
141 小时
注册时间
2019-5-12
回帖
49
发表于 2019-9-13 22:27:16 | 显示全部楼层
造小梦 发表于 2019-9-13 15:27
嗯,我发了,大佬看看呗。。。

我说了我不会呀,我不是什么大佬,我是事件党,只懂一点很基础的脚本,我接触VA甚至没你早,只不过我比较喜欢钻研罢了。
不过我也用过这个脚本,看看能不能降低一下其他人回答的难度吧 battler_face_name( ACTOR_ID, FIlE_NAME )  这个应该可以更改战斗图,用公共事件触发,具体用法我也不太清楚,如何和状态挂钩我也不清楚,看其他大佬的吧。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部