查看: 2152|回复: 1

有跟MOG战斗脸图不冲突的地图战斗背景脚本吗?

[复制链接]
梦石
0
星屑
4881
在线时间
425 小时
注册时间
2019-10-22
回帖
647
发表于 2019-10-31 09:35:40 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 坏数据 于 2020-1-18 08:28 编辑

想找一个能用的以当前地图作为背景的战斗背景脚本。实现的效果是 我既要用上VA的两张战斗背景图,然后战斗背景的素材透明的部分,下面一层看到的是当前的地图。
目前论坛上找到能用的只有这个了:
点击展开/收起
  1. #===============================================================
  2. # 本脚本来自www.66rpg.com
  3. # 功能:对于没有设置战斗背景的地图,直接用地图做战斗背景
  4. #===============================================================
  5. class Scene_Battle
  6. alias battleback_map_main main
  7. def main
  8.    @battleback_sprite = Spriteset_Map.new
  9.    battleback_map_main
  10.    @battleback_sprite.dispose
  11. end
  12. end
  13. #===============================================================
  14. # 申请者:张永;脚本作者:bluefool 改善人:亿万星辰
  15. #===============================================================
复制代码



但是恰好跟战斗脸图冲突了 搞得战斗脸图不显示 就很坑,想问问有没有其他能用的(已经搜索搜寻多天),或者基于这个怎么改?
MOG battle HUD 脚本:
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. #
  8. # Coloque as imagens da hud na pasta.
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # Para ocultar ou apresentar a hud de batalha use o código abaixo.
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # ou
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # Para mudar o sprite da face do battler use o código abaixo.
  22. #==============================================================================
  23. #
  24. # battler_face_name( ACTOR_ID, FIlE_NAME )
  25. #
  26. #==============================================================================

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

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

  971. #============================================================================
  972. #============================================================================
  973. # * CUSTOM WINDOWS (GENERAL)
  974. #============================================================================
  975. module MOG_BATTLE_HUD_EX
  976.   
  977. #============================================================================
  978. # * Ativar Janelas Customizadas.
  979. #============================================================================
  980.   ENABLE_CUSTOM_WINDOWS = true

  981. #============================================================================
  982. # * BATTLE LOG WINDOW
  983. #============================================================================
  984. #Definição da posição da janela de log.
  985.   BATTLE_LOG_POSITION = [0,0]
  986. #============================================================================

  987. #============================================================================
  988. # * FONT SETTING
  989. #============================================================================
  990. #Ativar a configuração da fonte.
  991. ENABLE_WINDOW_FONT_SET = false
  992. #Definição do nome da fonte.
  993. WINDOW_FONT_NAME = nil
  994. #Definição do tamanho da fonte.
  995. WINDOW_FONT_SIZE = 18
  996. #Ativar fonte em bold;
  997. WINDOW_FONT_BOLD = true
  998. #Ativar fonte em itálico.
  999. WINDOW_FONT_ITALIC = false

  1000. #============================================================================
  1001. # * SKILL WINDOW
  1002. #============================================================================
  1003. #Definição do tamanho da janela.
  1004.   SKILL_WINDOW_SIZE = [200, 250]
  1005. #Definição da posição da janela.
  1006.   SKILL_WINDOW_POSITION = [284,-164]
  1007. #Definição da transparência da janela.
  1008.   SKILL_WINDOW_OPACITY = 0
  1009. #Ativar a imagem de Layout. ("Layout_Skill.png")
  1010.   SKILL_WINDOW_LAYOUT = true
  1011. #Definição do layout.
  1012.   SKILL_WINDOW_LAYOUT_POSITION = [0,-32]  
  1013. #Definição da quantidade colunas máxima.
  1014.   SKILL_COL_MAX = 1  
  1015.    #Ativar a animação de slide.
  1016.   SKILL_WINDOW_SLIDE_EFFECT = true
  1017.   #Definição da posição do slide.
  1018.   SKILL_WINDOW_SLIDE_POSITION = [0,-300]   
  1019. #============================================================================
  1020.   
  1021. #============================================================================
  1022. # * ITEM WINDOW
  1023. #============================================================================
  1024. #Definição do tamanho da janela.  
  1025.   ITEM_WINDOW_SIZE = [200, 250]
  1026. #Definição da posição da janela.
  1027.   ITEM_WINDOW_POSITION = [284,-164]
  1028. #Definição da transparência da janela.
  1029.   ITEM_WINDOW_OPACITY = 0
  1030. #Ativar a imagem de Layout. ("Layout_Item.png")   
  1031.   ITEM_WINDOW_LAYOUT = true
  1032. #Definição do layout.  
  1033.   ITEM_WINDOW_LAYOUT_POSITION = [0,-32]
  1034. #Definição da quantidade colunas máxima.
  1035.   ITEM_COL_MAX = 1  
  1036.   #Ativar a animação de slide.
  1037.   ITEM_WINDOW_SLIDE_EFFECT = true
  1038.   #Definição da posição do slide.
  1039.   ITEM_WINDOW_SLIDE_POSITION = [0,-300]  
  1040. #============================================================================

  1041. #============================================================================
  1042. # * COMMAND WINDOW
  1043. #============================================================================
  1044. #Definição da posição da janela. (Apenas para Ajustes)
  1045.   ACTOR_COMMAND_POSITION = [30,-70]
  1046. #Definição da transparência da janela.
  1047.   ACTOR_COMMAND_OPACITY = 0
  1048. #Ativar a imagem de Layout. ("Layout_Command.png")   
  1049.   ACTOR_COMMAND_LAYOUT = true
  1050. #Definição do layout.   
  1051.   ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
  1052. #============================================================================

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

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

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

  1107. #============================================================================
  1108. # * PARTY WINDOW (Fight/Escape)
  1109. #============================================================================
  1110. #Definição do tamanho da janela.  
  1111.   PARTY_COMMAND_POSITION = [690,100]
  1112. #Definição da transparência da janela.   
  1113.   PARTY_COMMAND_OPACITY = 0
  1114. #Ativar a imagem de Layout. ("Layout_Party.png")  
  1115.   PARTY_COMMAND_LAYOUT = true
  1116. #Definição do layout.  
  1117.   PARTY_COMMAND_LAYOUT_POSITION = [0,0]
  1118.   #Ativar a animação de slide.
  1119.   PARTY_COMMAND_SLIDE_EFFECT = false
  1120.   #Definição da posição do slide.
  1121.   PARTY_COMMAND_SLIDE_POSITION = [0,-150]   
  1122. #============================================================================

  1123. end

  1124. #==============================================================================
  1125. # ** Cache
  1126. #==============================================================================
  1127. module Cache

  1128.   #--------------------------------------------------------------------------
  1129.   # * Hud
  1130.   #--------------------------------------------------------------------------
  1131.   def self.battle_hud(filename)
  1132.       load_bitmap("Graphics/Huds/Battle/", filename)
  1133.   end

  1134. end

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

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

  1222. #--------------------------------------------------------------------------
  1223. # * Command_129
  1224. #--------------------------------------------------------------------------
  1225. alias mog_monogatari_bhud_command_129 command_129
  1226. def command_129
  1227.      mog_monogatari_bhud_command_129     
  1228.      refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1229. end
  1230.   
  1231. end

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

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

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

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

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

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

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

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

  1429. #==============================================================================
  1430. # ■ Sprite Base
  1431. #==============================================================================
  1432. class Sprite_Base < Sprite

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

  1465. #==============================================================================
  1466. # ** Spriteset Battle
  1467. #==============================================================================
  1468. class Spriteset_Battle  

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

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

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

  1595. end

  1596. if SceneManager.face_battler?
  1597. #==============================================================================
  1598. # ■ Game_Actor
  1599. #==============================================================================
  1600. class Game_Actor < Game_Battler
  1601.   
  1602.   attr_accessor :screen_x
  1603.   attr_accessor :screen_y
  1604.   attr_accessor :screen_z

  1605.   
  1606. #--------------------------------------------------------------------------
  1607. # ● Use Sprite?
  1608. #--------------------------------------------------------------------------
  1609.   def use_sprite?
  1610.       return true
  1611.   end
  1612.   
  1613. end

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

  1681. end

  1682. #==============================================================================
  1683. # ** Window_BattleStatus
  1684. #==============================================================================
  1685. class Window_BattleStatus < Window_Selectable
  1686. include MOG_BATTLE_HUD_EX

  1687.   #--------------------------------------------------------------------------
  1688.   # * Get Window Width
  1689.   #--------------------------------------------------------------------------
  1690.   def window_width
  1691.       ACTOR_WINDOW_SIZE[0]
  1692.   end

  1693. #--------------------------------------------------------------------------
  1694. # * Refresh
  1695. #--------------------------------------------------------------------------   
  1696. alias mog_monogatari_refresh refresh
  1697. def refresh
  1698.      mog_monogatari_refresh
  1699.      self.visible = false
  1700.      self.opacity = 0
  1701.      self.contents_opacity = 0
  1702.      self.y = 1200
  1703. end  

  1704. end  

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

  1718. end

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

  1734. end  

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

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

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

  1807. #--------------------------------------------------------------------------
  1808. # * Dispose Layout
  1809. #--------------------------------------------------------------------------
  1810. def dispose_layout
  1811.      return if @layout == nil
  1812.      @layout.dispose
  1813.      @layout = nil
  1814. end

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

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

  1855. #--------------------------------------------------------------------------
  1856. # * Refresh
  1857. #--------------------------------------------------------------------------   
  1858. alias mog_battle_hud_ex_refresh refresh
  1859. def refresh
  1860.      mog_battle_hud_ex_refresh
  1861.      $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1862. end

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

  1878. end

  1879. #==============================================================================
  1880. # ** Window_PartyCommand
  1881. #==============================================================================
  1882. class Window_PartyCommand < Window_Command

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

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

  1920. #--------------------------------------------------------------------------
  1921. # * Dispose Layout
  1922. #--------------------------------------------------------------------------
  1923. def dispose_layout
  1924.      return if @layout == nil
  1925.      @layout.dispose
  1926.      @layout = nil
  1927. end

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

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

  1955.       end
  1956.       self.opacity = PARTY_COMMAND_OPACITY     
  1957. end   
  1958.   
  1959. def show
  1960.    
  1961. end

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

  1972.       end
  1973.       self.opacity = PARTY_COMMAND_OPACITY
  1974.       mog_bg_ex_slide_show_party
  1975.   end

  1976. #--------------------------------------------------------------------------
  1977. # * Update
  1978. #--------------------------------------------------------------------------  
  1979. alias mog_monogatari_party_window_update update
  1980. def update
  1981.      mog_monogatari_party_window_update  
  1982.      self.visible = self.active
  1983.      if @layout != nil and @layout.visible != self.visible        
  1984.         refresh_layout
  1985.      end
  1986.      execute_slide_effect if self.visible
  1987. end   

  1988. end

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

  2017. #--------------------------------------------------------------------------
  2018. # * Dispose
  2019. #--------------------------------------------------------------------------
  2020. alias mog_monogatari_help_window_dispose dispose
  2021. def dispose
  2022.      mog_monogatari_help_window_dispose
  2023.      dispose_layout
  2024. end

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

  2041. #--------------------------------------------------------------------------
  2042. # * Dispose Layout
  2043. #--------------------------------------------------------------------------
  2044. def dispose_layout
  2045.      return if @layout == nil
  2046.      @layout.dispose
  2047.      @layout = nil
  2048. end

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

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

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

  2158. #--------------------------------------------------------------------------
  2159. # * Dispose Layout
  2160. #--------------------------------------------------------------------------
  2161. def dispose_layout
  2162.      return if @layout == nil
  2163.      @layout.dispose
  2164.      @layout = nil
  2165. end

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

  2221. end


  2222. #==============================================================================
  2223. # ** Window_BattleSkill
  2224. #==============================================================================
  2225. class Window_BattleSkill < Window_SkillList
  2226. include MOG_BATTLE_HUD_EX

  2227. #--------------------------------------------------------------------------
  2228. # * Initialize
  2229. #--------------------------------------------------------------------------   
  2230. alias mog_monogatari_battle_skill_initialize initialize
  2231. def initialize(help_window, info_viewport)
  2232.      @force_hide = can_force_hide?
  2233.      @force_hide_active = can_force_hide_active?     
  2234.      mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2235.      self.width = SKILL_WINDOW_SIZE[0]
  2236.      self.height = SKILL_WINDOW_SIZE[1]   
  2237.      @org_position = [SKILL_WINDOW_POSITION[0],
  2238.           Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2239.      self.x = @org_position[0]
  2240.      self.y = @org_position[1]
  2241.      self.opacity = SKILL_WINDOW_OPACITY
  2242.      self.viewport = nil
  2243.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2244.      create_layout
  2245. end
  2246.   
  2247. #--------------------------------------------------------------------------
  2248. # * Col Max
  2249. #--------------------------------------------------------------------------   
  2250.   def col_max
  2251.       return SKILL_COL_MAX
  2252.   end

  2253. #--------------------------------------------------------------------------
  2254. # * Can Force Hide Active?
  2255. #--------------------------------------------------------------------------   
  2256. def can_force_hide_active?
  2257.      return true if $imported[:ve_target_arrow]
  2258.      return true if $imported[:mog_battle_cursor] != nil
  2259.      return false
  2260. end   

  2261.   #--------------------------------------------------------------------------
  2262.   # * Can Force Hide?
  2263.   #--------------------------------------------------------------------------   
  2264.   def can_force_hide?
  2265.       return false
  2266.   end

  2267. #--------------------------------------------------------------------------
  2268. # * Dispose
  2269. #--------------------------------------------------------------------------
  2270. alias mog_monogatari_skill_window_dispose dispose
  2271. def dispose
  2272.      mog_monogatari_skill_window_dispose
  2273.      dispose_layout
  2274. end

  2275. #--------------------------------------------------------------------------
  2276. # * Create Layout
  2277. #--------------------------------------------------------------------------   
  2278. def create_layout
  2279.      return if @layout != nil
  2280.      return if !SKILL_WINDOW_LAYOUT
  2281.      return if $game_temp.mbhud_window[5]
  2282.      $game_temp.mbhud_window[5] = true
  2283.      @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2284.      @layout = Sprite.new
  2285.      @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2286.      @layout.z = self.z - 1
  2287.      refresh_layout
  2288.      @layout.visible = false
  2289. end

  2290. #--------------------------------------------------------------------------
  2291. # * Dispose Layout
  2292. #--------------------------------------------------------------------------
  2293. def dispose_layout
  2294.      return if @layout == nil
  2295.      @layout.dispose
  2296.      @layout = nil
  2297. end

  2298. #--------------------------------------------------------------------------
  2299. # * Refresh Layout
  2300. #--------------------------------------------------------------------------
  2301. def refresh_layout
  2302.      return if @layout == nil
  2303.      @layout.x = @org_position_2[0]
  2304.      @layout.y = @org_position_2[1]
  2305.      @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2306.      @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2307.      @layout.visible = self.visible
  2308. end  
  2309.   
  2310. #--------------------------------------------------------------------------
  2311. # * Show
  2312. #--------------------------------------------------------------------------   
  2313.   alias mog_bg_ex_slide_show_skill show
  2314.   def show
  2315.       self.viewport = nil
  2316.       self.x = @org_position[0] ; self.y = @org_position[1]
  2317.       if SKILL_WINDOW_SLIDE_EFFECT
  2318.          self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2319.          self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2320.       end
  2321.       self.opacity = SKILL_WINDOW_OPACITY
  2322.       mog_bg_ex_slide_show_skill
  2323.   end

  2324. #--------------------------------------------------------------------------
  2325. # * Update
  2326. #--------------------------------------------------------------------------  
  2327. alias mog_monogatari_skill_window_update update
  2328. def update
  2329.      mog_monogatari_skill_window_update
  2330.      self.visible = self.active if @force_hide_active
  2331.      self.visible = false if @force_hide
  2332.      if @layout != nil and @layout.visible != self.visible        
  2333.         refresh_layout
  2334.     end
  2335.     self.visible = false if !$game_temp.sprite_visible
  2336.     execute_slide_effect if self.visible
  2337. end
  2338.   
  2339. end

  2340. #==============================================================================
  2341. # ** Window_BattleItem
  2342. #==============================================================================
  2343. class Window_BattleItem < Window_ItemList
  2344.   include MOG_BATTLE_HUD_EX

  2345. #--------------------------------------------------------------------------
  2346. # * Initialize
  2347. #--------------------------------------------------------------------------  
  2348. alias mog_monogatari_battle_item_initialize initialize
  2349. def initialize(help_window, info_viewport)
  2350.      @force_hide = can_force_hide?
  2351.      @force_hide_active = can_force_hide_active?
  2352.      mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2353.      self.width = ITEM_WINDOW_SIZE[0]
  2354.      self.height = ITEM_WINDOW_SIZE[1]
  2355.      @org_position = [ITEM_WINDOW_POSITION[0],
  2356.           Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2357.      self.x = @org_position[0]
  2358.      self.y = @org_position[1]
  2359.      self.viewport = nil
  2360.      self.opacity = ITEM_WINDOW_OPACITY
  2361.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2362.      create_layout
  2363. end  

  2364. #--------------------------------------------------------------------------
  2365. # * Col Max
  2366. #--------------------------------------------------------------------------   
  2367.   def col_max
  2368.       return ITEM_COL_MAX
  2369.   end  

  2370. #--------------------------------------------------------------------------
  2371. # * Can Force Hide Active?
  2372. #--------------------------------------------------------------------------   
  2373. def can_force_hide_active?
  2374.      return true if $imported[:ve_target_arrow]
  2375.      return true if $imported[:mog_battle_cursor] != nil
  2376.      return false
  2377. end  

  2378. #--------------------------------------------------------------------------
  2379. # * Can Force Hide?
  2380. #--------------------------------------------------------------------------   
  2381. def can_force_hide?
  2382.      return false
  2383. end

  2384. #--------------------------------------------------------------------------
  2385. # * Dispose
  2386. #--------------------------------------------------------------------------
  2387. alias mog_monogatari_item_window_dispose dispose
  2388. def dispose
  2389.      mog_monogatari_item_window_dispose
  2390.      dispose_layout
  2391. end

  2392. #--------------------------------------------------------------------------
  2393. # * Create Layout
  2394. #--------------------------------------------------------------------------   
  2395. def create_layout
  2396.      return if @layout != nil
  2397.      return if !ITEM_WINDOW_LAYOUT
  2398.      return if $game_temp.mbhud_window[6]
  2399.      $game_temp.mbhud_window[6] = true
  2400.      @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2401.      @layout = Sprite.new
  2402.      @layout.bitmap = Cache.battle_hud("Layout_Item")
  2403.      @layout.z = self.z - 1
  2404.      refresh_layout
  2405.      @layout.visible = false
  2406. end

  2407. #--------------------------------------------------------------------------
  2408. # * Dispose Layout
  2409. #--------------------------------------------------------------------------
  2410. def dispose_layout
  2411.      return if @layout == nil
  2412.      @layout.dispose
  2413.      @layout = nil
  2414. end

  2415. #--------------------------------------------------------------------------
  2416. # * Refresh Layout
  2417. #--------------------------------------------------------------------------
  2418. def refresh_layout
  2419.      return if @layout == nil
  2420.      @layout.x = @org_position_2[0]
  2421.      @layout.y = @org_position_2[1]
  2422.      @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2423.      @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2424.      @layout.visible = self.visible
  2425. end  

  2426. #--------------------------------------------------------------------------
  2427. # * Show
  2428. #--------------------------------------------------------------------------   
  2429.   alias mog_bg_ex_slide_show_item show
  2430.   def show
  2431.       self.viewport = nil
  2432.       self.x = @org_position[0] ; self.y = @org_position[1]
  2433.       if ITEM_WINDOW_SLIDE_EFFECT
  2434.          self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2435.          self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2436.       end
  2437.       self.opacity = ITEM_WINDOW_OPACITY
  2438.       mog_bg_ex_slide_show_item      
  2439.   end

  2440. #--------------------------------------------------------------------------
  2441. # * Update
  2442. #--------------------------------------------------------------------------  
  2443. alias mog_monogatari_item_window_update update
  2444. def update
  2445.      mog_monogatari_item_window_update
  2446.      self.visible = self.active if @force_hide_active
  2447.      self.visible = false if @force_hide
  2448.      if @layout != nil
  2449.         refresh_layout if @layout.visible != self.visible
  2450.      end
  2451.      self.visible = false if !$game_temp.sprite_visible
  2452.      execute_slide_effect if self.visible
  2453.   end  

  2454. end

  2455. end


  2456. #==============================================================================
  2457. # ** Window Base
  2458. #==============================================================================
  2459. class Window_Base < Window
  2460.   
  2461. #--------------------------------------------------------------------------
  2462. # * Execute Move W
  2463. #--------------------------------------------------------------------------      
  2464. def execute_move_w(sprite,type,cp,np)
  2465.      sp = 6 + ((cp - np).abs / 10)
  2466.      if cp > np ;    cp -= sp ; cp = np if cp < np
  2467.         elsif cp < np ; cp += sp ; cp = np if cp > np
  2468.      end     
  2469.      sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2470. end
  2471.    
  2472. #--------------------------------------------------------------------------
  2473. # * Set BH EX Font
  2474. #--------------------------------------------------------------------------   
  2475.   def set_bh_ex_font
  2476.       return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2477.       self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2478.       self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2479.       self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2480.       self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2481.   end
  2482.   
  2483. #--------------------------------------------------------------------------
  2484. # * Execute Slide Effect
  2485. #--------------------------------------------------------------------------   
  2486. def execute_slide_effect
  2487.      return if @org_position == nil
  2488.      execute_move_w(self,0,self.x,@org_position[0])
  2489.      execute_move_w(self,1,self.y,@org_position[1])
  2490.      return if @layout == nil
  2491.      execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  2492.      execute_move_w(@layout,1,@layout.y,@org_position_2[1])     
  2493. end     
  2494.   
  2495. end

  2496. #==============================================================================
  2497. # ** Window Help
  2498. #==============================================================================
  2499. class Window_Help < Window_Base
  2500.   
  2501. #--------------------------------------------------------------------------
  2502. # * Draw Text
  2503. #--------------------------------------------------------------------------   
  2504.   alias mog_bh_ex_draw_text_help draw_text
  2505.   def draw_text(*args)
  2506.       set_bh_ex_font
  2507.       mog_bh_ex_draw_text_help(*args)
  2508.   end
  2509.   
  2510. end

  2511. #==============================================================================
  2512. # ** Window BattleActor
  2513. #==============================================================================
  2514. class Window_BattleActor < Window_BattleStatus

  2515. #--------------------------------------------------------------------------
  2516. # * Draw Item
  2517. #--------------------------------------------------------------------------   
  2518.   alias mog_bbex_draw_item_actor draw_item
  2519.   def draw_item(index)
  2520.       set_bh_ex_font
  2521.       mog_bbex_draw_item_actor(index)
  2522.   end
  2523.   
  2524. end

  2525. #==============================================================================
  2526. # ** Window BattleEnemy
  2527. #==============================================================================
  2528. class Window_BattleEnemy < Window_Selectable
  2529.   
  2530. #--------------------------------------------------------------------------
  2531. # * Draw Item
  2532. #--------------------------------------------------------------------------   
  2533.   alias mog_bbex_draw_item_enemy draw_item
  2534.   def draw_item(index)
  2535.       set_bh_ex_font
  2536.       mog_bbex_draw_item_enemy(index)
  2537.   end
  2538.   
  2539. end

  2540. #==============================================================================
  2541. # ** Window ItemList
  2542. #==============================================================================
  2543. class Window_ItemList < Window_Selectable
  2544.   
  2545. #--------------------------------------------------------------------------
  2546. # * Draw Item Name
  2547. #--------------------------------------------------------------------------   
  2548.    alias mog_bhex_draw_item_name_item draw_item_name
  2549.    def draw_item_name(item, x, y, enabled = true, width = 172)
  2550.        set_bh_ex_font
  2551.        mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  2552.    end  

  2553. end

  2554. #==============================================================================
  2555. # ** Window SkillList
  2556. #==============================================================================
  2557. class Window_SkillList < Window_Selectable  

  2558. #--------------------------------------------------------------------------
  2559. # * Draw Item Name
  2560. #--------------------------------------------------------------------------   
  2561.    alias mog_bhex_draw_item_name_skill draw_item_name
  2562.    def draw_item_name(item, x, y, enabled = true, width = 172)
  2563.        set_bh_ex_font
  2564.        mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  2565.    end   
  2566.    
  2567. end

  2568. #==============================================================================
  2569. # ** Spriteset_Battle
  2570. #==============================================================================
  2571. class Spriteset_Battle

  2572.   #--------------------------------------------------------------------------
  2573.   # * Initialize
  2574.   #--------------------------------------------------------------------------
  2575.   alias mog_battle_hud_ex_initialize initialize
  2576.   def initialize
  2577.       check_screen_xyz_nil rescue nil
  2578.       mog_battle_hud_ex_initialize
  2579.       create_battle_hud_ex
  2580.   end
  2581.   
  2582.   #--------------------------------------------------------------------------
  2583.   # * Check Screen Xyz
  2584.   #--------------------------------------------------------------------------   
  2585.   def check_screen_xyz_nil
  2586.       return if !SceneManager.face_battler?
  2587.       for actor in $game_party.battle_members
  2588.           actor.screen_x = 0 if actor.screen_x == nil
  2589.           actor.screen_y = 0 if actor.screen_y == nil
  2590.           actor.screen_z = 0 if actor.screen_z == nil
  2591.       end
  2592.   end
  2593.   
  2594.   #--------------------------------------------------------------------------
  2595.   # * Check Screen Xyz after
  2596.   #--------------------------------------------------------------------------     
  2597.   def check_screen_xyz_after
  2598.       return if !SceneManager.face_battler?
  2599.       $game_party.battle_members.each_with_index do |actor, index|
  2600.           actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  2601.           actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  2602.           actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  2603.       end   
  2604.   end
  2605.   
  2606.   #--------------------------------------------------------------------------
  2607.   # * Dispose
  2608.   #--------------------------------------------------------------------------  
  2609.   alias mog_battle_hud_ex_dispose dispose
  2610.   def dispose
  2611.       dispose_battle_hud_ex
  2612.       mog_battle_hud_ex_dispose
  2613.   end
  2614.   
  2615.   #--------------------------------------------------------------------------
  2616.   # * Update
  2617.   #--------------------------------------------------------------------------  
  2618.   alias mog_battle_hud_ex_update update
  2619.   def update
  2620.       mog_battle_hud_ex_update
  2621.       update_battle_hud_ex
  2622.   end
  2623.   
  2624.   #--------------------------------------------------------------------------
  2625.   # * Create Battle Hud EX
  2626.   #--------------------------------------------------------------------------   
  2627.   def create_battle_hud_ex
  2628.       return if @battle_hud_ex != nil
  2629.       $game_temp.battle_hud_visible = true
  2630.       @battle_hud_ex = Monogatari_Bhud.new(nil)
  2631.       check_screen_xyz_after
  2632.   end
  2633.   
  2634.   #--------------------------------------------------------------------------
  2635.   # * Dispose Battle Hud EX
  2636.   #--------------------------------------------------------------------------   
  2637.   def dispose_battle_hud_ex
  2638.       return if @battle_hud_ex == nil
  2639.       @battle_hud_ex.dispose
  2640.       @battle_hud_ex = nil
  2641.       $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  2642.   end
  2643.   
  2644.   #--------------------------------------------------------------------------
  2645.   # * Update Battle Hud EX
  2646.   #--------------------------------------------------------------------------   
  2647.   def update_battle_hud_ex
  2648.       refresh_battle_hud if $game_temp.mbhud_force_refresh
  2649.       return if @battle_hud_ex == nil
  2650.       @battle_hud_ex.update
  2651.   end
  2652.   
  2653.   #--------------------------------------------------------------------------
  2654.   # * Refresh Battle Hud
  2655.   #--------------------------------------------------------------------------   
  2656.   def refresh_battle_hud
  2657.       $game_temp.mbhud_force_refresh = false
  2658.       check_screen_xyz_nil rescue nil
  2659.       dispose_battle_hud_ex
  2660.       create_battle_hud_ex
  2661.   end
  2662.   
  2663. end

  2664. #==============================================================================
  2665. # ** Monogatari Bhud
  2666. #==============================================================================
  2667. class Monogatari_Bhud
  2668.   
  2669.   include MOG_BATTLE_HUD_EX
  2670.   
  2671.   #--------------------------------------------------------------------------
  2672.   # * Initialize
  2673.   #--------------------------------------------------------------------------  
  2674.   def initialize(viewport)
  2675.       @battle_hud = [] ; @sprite_visitle_wait = 0
  2676.       $game_party.battle_members.each_with_index do |actor, index|
  2677.       @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  2678.       create_turn_sprite(nil)
  2679.       create_screen_layout(nil)      
  2680.   end
  2681.   
  2682.   #--------------------------------------------------------------------------
  2683.   # * Max members
  2684.   #--------------------------------------------------------------------------   
  2685.   def max_members
  2686.       if $game_party.members.size > $game_party.max_battle_members
  2687.          return $game_party.max_battle_members
  2688.       end   
  2689.       return $game_party.members.size
  2690.   end
  2691.   
  2692.   #--------------------------------------------------------------------------
  2693.   # * Dispose
  2694.   #--------------------------------------------------------------------------   
  2695.   def dispose
  2696.       @battle_hud.each {|sprite| sprite.dispose }
  2697.       dispose_turn_sprite
  2698.       dispose_screen_layout
  2699.   end
  2700.   
  2701.   #--------------------------------------------------------------------------
  2702.   # * Update
  2703.   #--------------------------------------------------------------------------   
  2704.   def update
  2705.       @battle_hud.each {|sprite| sprite.update }
  2706.       update_turn_sprite
  2707.       update_screen_layout
  2708.       refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  2709.   end
  2710.   
  2711.   #--------------------------------------------------------------------------
  2712.   # * Update
  2713.   #--------------------------------------------------------------------------   
  2714.   def refresh_battle_hud_visible
  2715.       $game_temp.battle_hud_visible_refresh[0] = false
  2716.       @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  2717.       @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  2718.       @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  2719.       @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  2720. end
  2721.   
  2722. end

  2723. #==============================================================================
  2724. # ** Monogatari Bhud
  2725. #==============================================================================
  2726. class Monogatari_Bhud
  2727.   
  2728. #--------------------------------------------------------------------------
  2729. # * Can Update Turn Sprite
  2730. #--------------------------------------------------------------------------
  2731.   def can_refresh_turn_sprite?
  2732.       return true if @turn_sprite.visible != $game_temp.command_visible
  2733.       return true if $game_temp.refresh_turn_sprite
  2734.       return false
  2735.   end
  2736.   
  2737. #--------------------------------------------------------------------------
  2738. # * Create Turn Sprite
  2739. #--------------------------------------------------------------------------
  2740.   def create_turn_sprite(viewport)
  2741.       return if !TURN_SPRITE_VISIBLE
  2742.       return if @turn_sprite != nil
  2743.       @turn_sprite = Sprite.new
  2744.       @turn_sprite.bitmap = Cache.battle_hud("Turn")
  2745.       @turn_sprite.viewport = viewport
  2746.       @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  2747.       @turn_sprite.visible = false
  2748.       @turn_sprite_update_time = 5
  2749.       @turn_sprite_blink = [0,0]
  2750.   end
  2751.   
  2752. #--------------------------------------------------------------------------
  2753. # * Dispose Turn Sprite
  2754. #--------------------------------------------------------------------------
  2755.   def dispose_turn_sprite
  2756.       return if @turn_sprite == nil
  2757.       @turn_sprite.dispose
  2758.       @turn_sprite = nil
  2759.   end
  2760.   
  2761. #--------------------------------------------------------------------------
  2762. # * Update Turn Sprite
  2763. #--------------------------------------------------------------------------
  2764.   def update_turn_sprite
  2765.       return if @turn_sprite == nil
  2766.       if @turn_sprite_update_time > 0
  2767.          @turn_sprite_update_time -= 1
  2768.          return
  2769.       end  
  2770.       update_turn_visible
  2771.       update_turn_blink
  2772.   end
  2773.   
  2774. #--------------------------------------------------------------------------
  2775. # * Update Turn Visible
  2776. #--------------------------------------------------------------------------   
  2777.   def update_turn_visible   
  2778.       $game_temp.refresh_turn_sprite = false
  2779.       @turn_sprite.visible = can_turn_sprite_visible?
  2780.       return if BattleManager.actor == nil
  2781.       x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  2782.       y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  2783.       x = -1000 if x == nil ; y = -1000 if y == nil
  2784.       @turn_sprite.x = x ; @turn_sprite.y = y      
  2785. end
  2786.   
  2787. #--------------------------------------------------------------------------
  2788. # * Can Turn Sprite Visible?
  2789. #--------------------------------------------------------------------------   
  2790. def can_turn_sprite_visible?
  2791.      return false if BattleManager.actor == nil
  2792.      return false if $game_temp.battle_end
  2793.      return false if $game_message.visible
  2794.      return true
  2795. end
  2796.    
  2797. #--------------------------------------------------------------------------
  2798. # * Update Turn Blink
  2799. #--------------------------------------------------------------------------   
  2800. def update_turn_blink
  2801.      return if !TURN_BLINK_EFFECT
  2802.      return if !@turn_sprite.visible
  2803.      @turn_sprite_blink[0] += 1
  2804.      case @turn_sprite_blink[0]
  2805.        when 0..30
  2806.           @turn_sprite_blink[1] += 3
  2807.        when 31..60
  2808.           @turn_sprite_blink[1] -= 3
  2809.        else
  2810.          @turn_sprite_blink = [0,0]
  2811.      end
  2812.      @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  2813. end

  2814.   
  2815. end

  2816. #==============================================================================
  2817. # ** Monogatari Bhud
  2818. #==============================================================================
  2819. class Monogatari_Bhud
  2820.   
  2821.   #--------------------------------------------------------------------------
  2822.   # * Create Screen Layout
  2823.   #--------------------------------------------------------------------------   
  2824.   def create_screen_layout(viewport)
  2825.       return if !SCREEN_LAYOUT
  2826.       @screen_layout = Sprite.new
  2827.       @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  2828.       @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  2829.       @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  2830.       @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  2831.       @screen_layout.opacity = 0
  2832.       @screen_layout.viewport = viewport
  2833.    end     
  2834.   
  2835.   #--------------------------------------------------------------------------
  2836.   # * Dispose Screen Layout
  2837.   #--------------------------------------------------------------------------
  2838.    def dispose_screen_layout
  2839.        return if @screen_layout == nil
  2840.        @screen_layout.dispose ; @screen_layout = nil     
  2841.    end
  2842.    
  2843.   #--------------------------------------------------------------------------
  2844.   # * Update Screen Layout
  2845.   #--------------------------------------------------------------------------
  2846.    def update_screen_layout
  2847.        return if @screen_layout == nil
  2848.        @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  2849.        sprite_visible(@screen_layout)
  2850.    end
  2851.    
  2852.   #--------------------------------------------------------------------------
  2853.   # * Sprite Visible
  2854.   #--------------------------------------------------------------------------
  2855.   def sprite_visible?
  2856.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  2857.       return false if !$game_temp.battle_hud_visible
  2858.       return false if !$game_temp.sprite_visible
  2859.       return true
  2860.   end
  2861.   
  2862.   #--------------------------------------------------------------------------
  2863.   # * Sprite Visible
  2864.   #--------------------------------------------------------------------------
  2865.   def sprite_visible(sprite)      
  2866.       if sprite_visible?
  2867.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  2868.       else
  2869.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  2870.       end
  2871.   end   
  2872.    
  2873. end

  2874. #==============================================================================
  2875. #==============================================================================
  2876. # ** Battle Hud EX
  2877. #==============================================================================
  2878. #==============================================================================
  2879. class Battle_Hud_EX
  2880.   include MOG_BATTLE_HUD_EX
  2881.   
  2882.   #--------------------------------------------------------------------------
  2883.   # * Initialize
  2884.   #--------------------------------------------------------------------------  
  2885.   def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  2886.       pre_cache
  2887.       setup(actor,index,max_members)
  2888.       create_sprites(viewport)
  2889.   end
  2890.   
  2891.   #--------------------------------------------------------------------------
  2892.   # * Setup
  2893.   #--------------------------------------------------------------------------   
  2894.   def setup(actor,index,max_members)
  2895.       $game_temp.battle_end = false
  2896.       @actor = actor
  2897.       @actor_index = index
  2898.       @max_members = max_members
  2899.       @actor.face_animation = [0,0,0]
  2900.       @hp_icon_max = -1
  2901.       @hp_icon_old = -1
  2902.       @hp_icon_col_max = HP_ICON_COL_MAX
  2903.       @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  2904.       @hp_icon_row_max = HP_ICON_ROW_MAX
  2905.       @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  2906.       @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  2907.       @mp_icon_max = -1
  2908.       @mp_icon_old = -1
  2909.       @mp_icon_col_max = MP_ICON_COL_MAX
  2910.       @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  2911.       @mp_icon_row_max = MP_ICON_ROW_MAX
  2912.       @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  2913.       @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  2914.       @tp_icon_max = -1
  2915.       @tp_icon_old = -1
  2916.       @tp_icon_col_max = TP_ICON_COL_MAX
  2917.       @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  2918.       @tp_icon_row_max = TP_ICON_ROW_MAX
  2919.       @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  2920.       @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  2921.       @sprite_visible = true
  2922.       @sprite_visitle_wait = 0
  2923.       setup_actor
  2924.       setup_position
  2925.   end
  2926.      
  2927.   #--------------------------------------------------------------------------
  2928.   # * Setup Actor
  2929.   #--------------------------------------------------------------------------   
  2930.   def setup_actor
  2931.       return if @actor == nil
  2932.       @hp_number_refresh = true
  2933.       @hp_number2_refresh = true
  2934.       @hp_number_old = @actor.hp
  2935.       @hp_number2_old = @actor.mhp
  2936.       @hp_old_meter = 0      
  2937.       @mp_number_refresh = true
  2938.       @mp_number2_refresh = true
  2939.       @mp_number_old = @actor.mp
  2940.       @mp_number2_old = @actor.mmp
  2941.       @mp_old_meter = 0      
  2942.       @tp_number_refresh = true
  2943.       @tp_number2_refresh = true
  2944.       @tp_number_old = @actor.tp
  2945.       @tp_number2_old = @actor.max_tp  
  2946.       @tp_old_meter = 0
  2947.       @at_number_refresh = true
  2948.       @at_number2_refresh = true
  2949.       @at_number_old = actor_at
  2950.       @at_number2_old = actor_max_at
  2951.       @at_old_meter = 0
  2952.       catb = ATB::MAX_AP rescue nil
  2953.       @ccwinter_atb = true if catb != nil
  2954.   end  
  2955.   
  2956.   #--------------------------------------------------------------------------
  2957.   # * Terminate
  2958.   #--------------------------------------------------------------------------   
  2959.   def terminate
  2960.       @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  2961.   end
  2962.   
  2963.   #--------------------------------------------------------------------------
  2964.   # * AT
  2965.   #--------------------------------------------------------------------------  
  2966.   def actor_at
  2967.       return @actor.atb if $imported[:mog_atb_system]
  2968.       return @actor.atb if $imported[:ve_active_time_battle]
  2969.       return @actor.catb_value if $imported["YSA-CATB"]
  2970.       return @actor.ap if @ccwinter_atb != nil
  2971.       return 0
  2972.   end
  2973.   
  2974.   #--------------------------------------------------------------------------
  2975.   # * Max AT
  2976.   #--------------------------------------------------------------------------  
  2977.   def actor_max_at
  2978.       return @actor.atb_max if $imported[:mog_atb_system]
  2979.       return @actor.max_atb if $imported[:ve_active_time_battle]
  2980.       return @actor.max_atb if $imported["YSA-CATB"]
  2981.       return ATB::MAX_AP if @ccwinter_atb != nil
  2982.       return 1
  2983.   end
  2984.   
  2985.   #--------------------------------------------------------------------------
  2986.   # ● Actor Cast
  2987.   #--------------------------------------------------------------------------            
  2988.   def actor_cast
  2989.       return @actor.atb_cast[1] if $imported[:mog_atb_system]
  2990.       return @actor.atb if $imported[:ve_active_time_battle]
  2991.       return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  2992.       return 0
  2993.   end
  2994.   
  2995.   #--------------------------------------------------------------------------
  2996.   # ● Actor Max Cast
  2997.   #--------------------------------------------------------------------------            
  2998.   def actor_max_cast
  2999.       if $imported[:mog_atb_system]
  3000.          return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3001.          return @actor.atb_cast[0].speed.abs
  3002.       end   
  3003.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3004.       return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3005.       return 1
  3006.   end
  3007.   
  3008.   #--------------------------------------------------------------------------
  3009.   # ● Actor Cast?
  3010.   #--------------------------------------------------------------------------            
  3011.   def actor_cast?   
  3012.       if $imported[:mog_atb_system]
  3013.          return true if !@actor.atb_cast.empty?
  3014.       end   
  3015.       if $imported[:ve_active_time_battle]
  3016.          return true if @actor.cast_action?
  3017.       end      
  3018.       if @ccwinter_atb
  3019.          return true if @actor.chanting?
  3020.       end
  3021.       return false
  3022.   end  
  3023.   
  3024.   #--------------------------------------------------------------------------
  3025.   # * Create Sprites
  3026.   #--------------------------------------------------------------------------   
  3027.   def create_sprites(viewport)
  3028.       dispose
  3029.       return if @actor == nil
  3030.       create_layout(viewport)
  3031.       create_layout_2(viewport)
  3032.       create_name(viewport)
  3033.       create_face(viewport)
  3034.       create_hp_number(viewport)
  3035.       create_hp_number_max(viewport)
  3036.       create_hp_meter(viewport)
  3037.       create_hp_icon(viewport)
  3038.       create_hp_icon_ex(viewport)
  3039.       create_hp_icon_number(viewport)
  3040.       create_mp_number(viewport)
  3041.       create_mp_number_max(viewport)
  3042.       create_mp_meter(viewport)
  3043.       create_mp_icon(viewport)
  3044.       create_mp_icon_ex(viewport)
  3045.       create_mp_icon_number(viewport)
  3046.       create_tp_number(viewport)
  3047.       create_tp_number_max(viewport)
  3048.       create_tp_meter(viewport)
  3049.       create_tp_icon(viewport)
  3050.       create_tp_icon_ex(viewport)
  3051.       create_tp_icon_number(viewport)
  3052.       create_at_number(viewport)
  3053.       create_at_number_max(viewport)
  3054.       create_at_meter(viewport)      
  3055.       create_level_number(viewport)
  3056.       create_states(viewport)
  3057.       update
  3058.   end   
  3059.   
  3060.   #--------------------------------------------------------------------------
  3061.   # * Sprite Visible
  3062.   #--------------------------------------------------------------------------
  3063.   def sprite_visible?
  3064.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3065.       return false if !$game_temp.battle_hud_visible
  3066.       return false if !$game_temp.sprite_visible
  3067.       return true
  3068.   end
  3069.   
  3070.   #--------------------------------------------------------------------------
  3071.   # * Sprite Visible
  3072.   #--------------------------------------------------------------------------
  3073.   def sprite_visible(sprite)
  3074.       if @sprite_visible         
  3075.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3076.       else
  3077.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3078.       end
  3079.   end
  3080.   
  3081. end

  3082. #==============================================================================
  3083. #==============================================================================
  3084. # ** Battle Hud EX
  3085. #==============================================================================
  3086. #==============================================================================
  3087. class Battle_Hud_EX
  3088.   
  3089.   #--------------------------------------------------------------------------
  3090.   # * Setup Position
  3091.   #--------------------------------------------------------------------------
  3092.   def setup_position
  3093.       sprite_width = (Graphics.width - 64) / 4
  3094.       sprite_center = sprite_width / 2  
  3095.       if $game_party.battle_members.size > 4
  3096.          members = $game_party.battle_members.size - 4
  3097.          fx = 32 * members
  3098.        else
  3099.          fx = 0
  3100.       end   
  3101.       space_x = MEMBERS_SPACE[0] - fx
  3102.       space_y = MEMBERS_SPACE[1]      
  3103.       center = Graphics.width / 2
  3104.       members_space = (Graphics.width + space_x) / @max_members
  3105.       members_space2 = (members_space * @actor_index)      
  3106.       members_space3 = ((members_space / 2) * (@max_members - 1))
  3107.       members_space_y = space_y * @actor_index
  3108.       x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3109.       screen_resize_y = 0
  3110.       screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3111.       y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3112.       @hud_position = [x,y]
  3113.       $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3114.       $game_temp.hud_pos_real[@actor_index] = [x,y]
  3115.       x2 = x + sprite_center
  3116.       $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3117.       $game_temp.hud_pos[@actor_index] = [x2,y]
  3118.       if FIXED_HUD_POSITION[@actor_index] != nil     
  3119.          @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3120.          $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3121.          $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3122.          $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]   
  3123.       end      
  3124.   end

  3125. end

  3126. #==============================================================================
  3127. # ** Game Temp
  3128. #==============================================================================
  3129. class Game_Temp
  3130.   
  3131.   attr_accessor :cache_bhud_sprites
  3132.   
  3133.   #--------------------------------------------------------------------------
  3134.   # * Cache Battle Hud
  3135.   #--------------------------------------------------------------------------  
  3136.   def cache_battle_hud      
  3137.       execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3138.   end
  3139.   
  3140.   #--------------------------------------------------------------------------
  3141.   # * Execute Cache Bhud Sprites
  3142.   #--------------------------------------------------------------------------  
  3143.   def execute_cache_bhud_sprites
  3144.       @cache_bhud_sprites = []
  3145.       windows = ["Layout_Command","Layout_Party","Layout_Help",
  3146.       "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3147.       "Layout_Item"]
  3148.       for s in windows
  3149.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3150.       end
  3151.       sprites = ["Layout","Layout_2",
  3152.      "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3153.      "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",  
  3154.      "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",  
  3155.      "LV_Number","Turn","Iconset","Layout_Screen"
  3156.       ]
  3157.       for s in sprites
  3158.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3159.       end      
  3160.   end
  3161.   
  3162. end

  3163. #==============================================================================
  3164. # ** Spriteset_Map
  3165. #==============================================================================
  3166. class Spriteset_Map

  3167.   #--------------------------------------------------------------------------
  3168.   # * Initialize
  3169.   #--------------------------------------------------------------------------
  3170.   alias mog_monogatari_bhud_initialize initialize
  3171.   def initialize
  3172.       $game_temp.cache_battle_hud
  3173.       mog_monogatari_bhud_initialize
  3174.   end
  3175.   
  3176. end

  3177. #==============================================================================
  3178. #==============================================================================
  3179. # ** Battle Hud EX
  3180. #==============================================================================
  3181. #==============================================================================
  3182. class Battle_Hud_EX

  3183.   #--------------------------------------------------------------------------
  3184.   # * Pre Cache
  3185.   #--------------------------------------------------------------------------
  3186.   def pre_cache
  3187.       $game_temp.cache_battle_hud
  3188.       @force_hide = false
  3189.       @force_hide_time = 0
  3190.       @fade_hud = false
  3191.       @fade_hud_gold = false     
  3192.       @fade_hud_equip = false
  3193.       @layout_image = Cache.battle_hud("Layout")
  3194.       @layout_cw = @layout_image.width
  3195.       @layout_ch = @layout_image.height
  3196.       @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3197.       @layout2_cw = @layout2_image.width if @layout2_image != nil
  3198.       @layout2_ch = @layout2_image.height if @layout2_image != nil
  3199.       @layout2_cw = 0 if @layout2_cw == nil      
  3200.       #------------------------------------------------
  3201.       # HP
  3202.       #------------------------------------------------
  3203.       if HP_NUMBER_VISIBLE
  3204.          @hp_number_image = Cache.battle_hud("HP_Number")
  3205.          @hp_number_cw = @hp_number_image.width / 10
  3206.          if HP_NUMBER_LOW_COLOR
  3207.             @hp_number_ch = @hp_number_image.height / 2
  3208.          else
  3209.             @hp_number_ch = @hp_number_image.height
  3210.          end   
  3211.          @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3212.          @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number      
  3213.       end
  3214.       if HP_NUMBER_MAX_VISIBLE
  3215.          @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3216.          @hp_number2_cw = @hp_number2_image.width / 10
  3217.          @hp_number2_ch = @hp_number2_image.height
  3218.       end
  3219.       if HP_METER_VISIBLE
  3220.          @hp_meter_image = Cache.battle_hud("HP_Meter")
  3221.          if HP_METER_GRADIENT_ANIMATION
  3222.             @hp_meter_cw = @hp_meter_image.width / 3
  3223.          else   
  3224.             @hp_meter_cw = @hp_meter_image.width
  3225.          end   
  3226.          if HP_METER_REDUCTION_ANIMATION
  3227.             @hp_meter_ch = @hp_meter_image.height / 2
  3228.          else
  3229.             @hp_meter_ch = @hp_meter_image.height
  3230.          end  
  3231.       end
  3232.       if HP_ICON_VISIBLE
  3233.          @hp_icon_image = Cache.battle_hud("HP_Icon")
  3234.          @hp_icon_cw = @hp_icon_image.width / 2
  3235.          @hp_icon_ch = @hp_icon_image.height
  3236.       end
  3237.       if HP_ICON_EX_VISIBLE
  3238.          @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3239.          @hp_icon2_cw = @hp_icon2_image.width
  3240.          @hp_icon2_ch = @hp_icon2_image.height        
  3241.       end      
  3242.       if HP_ICON_NUMBER_VISIBLE
  3243.          @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3244.          @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3245.          @hp_icon_number_ch = @hp_icon_number_image.height        
  3246.       end
  3247.       #------------------------------------------------
  3248.       # MP
  3249.       #------------------------------------------------
  3250.       if MP_NUMBER_VISIBLE
  3251.          @mp_number_image = Cache.battle_hud("MP_Number")
  3252.          @mp_number_cw = @mp_number_image.width / 10
  3253.          if MP_NUMBER_LOW_COLOR
  3254.             @mp_number_ch = @mp_number_image.height / 2
  3255.          else
  3256.             @mp_number_ch = @mp_number_image.height
  3257.         end
  3258.         @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3259.         @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3260.       end
  3261.       if MP_NUMBER_MAX_VISIBLE
  3262.          @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3263.          @mp_number2_cw = @mp_number2_image.width / 10
  3264.          @mp_number2_ch = @mp_number2_image.height
  3265.       end
  3266.       if MP_METER_VISIBLE
  3267.          @mp_meter_image = Cache.battle_hud("MP_Meter")
  3268.          if MP_METER_GRADIENT_ANIMATION
  3269.             @mp_meter_cw = @mp_meter_image.width / 3
  3270.          else   
  3271.             @mp_meter_cw = @mp_meter_image.width
  3272.          end  
  3273.          if MP_METER_REDUCTION_ANIMATION
  3274.             @mp_meter_ch = @mp_meter_image.height / 2
  3275.          else
  3276.             @mp_meter_ch = @mp_meter_image.height
  3277.          end
  3278.       end
  3279.       if MP_ICON_VISIBLE
  3280.          @mp_icon_image = Cache.battle_hud("MP_Icon")
  3281.          @mp_icon_cw = @mp_icon_image.width / 2
  3282.          @mp_icon_ch = @mp_icon_image.height
  3283.       end
  3284.       if MP_ICON_EX_VISIBLE
  3285.          @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3286.          @mp_icon2_cw = @mp_icon2_image.width
  3287.          @mp_icon2_ch = @mp_icon2_image.height        
  3288.       end      
  3289.       if MP_ICON_NUMBER_VISIBLE
  3290.          @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3291.          @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3292.          @mp_icon_number_ch = @mp_icon_number_image.height        
  3293.       end
  3294.       #------------------------------------------------
  3295.       # TP
  3296.       #------------------------------------------------
  3297.       if TP_NUMBER_VISIBLE
  3298.          @tp_number_image = Cache.battle_hud("TP_Number")
  3299.          @tp_number_cw = @tp_number_image.width / 10
  3300.          if TP_NUMBER_LOW_COLOR
  3301.             @tp_number_ch = @tp_number_image.height / 2
  3302.          else
  3303.             @tp_number_ch = @tp_number_image.height
  3304.          end  
  3305.         @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3306.         @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number      
  3307.       end
  3308.       if TP_NUMBER_MAX_VISIBLE
  3309.          @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3310.          @tp_number2_cw = @tp_number2_image.width / 10
  3311.          @tp_number2_ch = @tp_number2_image.height
  3312.       end
  3313.       if TP_METER_VISIBLE
  3314.          @tp_meter_image = Cache.battle_hud("TP_Meter")
  3315.          if TP_METER_GRADIENT_ANIMATION
  3316.             @tp_meter_cw = @tp_meter_image.width / 3
  3317.          else   
  3318.             @tp_meter_cw = @tp_meter_image.width
  3319.          end  
  3320.          if TP_METER_REDUCTION_ANIMATION
  3321.             @tp_meter_ch = @tp_meter_image.height / 2      
  3322.          else
  3323.             @tp_meter_ch = @tp_meter_image.height
  3324.          end   
  3325.       end        
  3326.       if TP_ICON_VISIBLE
  3327.          @tp_icon_image = Cache.battle_hud("TP_Icon")
  3328.          @tp_icon_cw = @tp_icon_image.width / 2
  3329.          @tp_icon_ch = @tp_icon_image.height
  3330.       end  
  3331.       if TP_ICON_EX_VISIBLE
  3332.          @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3333.          @tp_icon2_cw = @tp_icon2_image.width
  3334.          @tp_icon2_ch = @tp_icon2_image.height        
  3335.       end      
  3336.       if TP_ICON_NUMBER_VISIBLE
  3337.          @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3338.          @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3339.          @tp_icon_number_ch = @tp_icon_number_image.height        
  3340.       end
  3341.       #------------------------------------------------
  3342.       # AT
  3343.       #------------------------------------------------
  3344.       if AT_NUMBER_VISIBLE
  3345.          @at_number_image = Cache.battle_hud("AT_Number")
  3346.          @at_number_cw = @at_number_image.width / 10
  3347.          @at_number_ch = @at_number_image.height
  3348.          @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3349.          @at_number_ch += (@at_number_ch / 2) if @at_wave_number      
  3350.       end
  3351.       if AT_NUMBER_MAX_VISIBLE
  3352.          @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3353.          @at_number2_cw = @at_number2_image.width / 10
  3354.          @at_number2_ch = @at_number2_image.height
  3355.       end
  3356.       if AT_METER_VISIBLE
  3357.          @at_meter_image = Cache.battle_hud("AT_Meter")
  3358.          if AT_METER_GRADIENT_ANIMATION
  3359.             @at_meter_cw = @at_meter_image.width / 3
  3360.          else   
  3361.             @at_meter_cw = @at_meter_image.width
  3362.          end   
  3363.          @at_meter_ch = @at_meter_image.height / 3
  3364.       end
  3365.       #------------------------------------------------
  3366.       # LV
  3367.       #------------------------------------------------  
  3368.       if LEVEL_NUMBER_VISIBLE
  3369.          @lv_number_image = Cache.battle_hud("LV_Number")
  3370.          @lv_number_cw = @lv_number_image.width / 10
  3371.          @lv_number_ch = @lv_number_image.height
  3372.       end      
  3373.       #------------------------------------------------
  3374.       # ICON
  3375.       #------------------------------------------------  
  3376.       if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3377.          @icon_image = Cache.system("Iconset")
  3378.       end         
  3379.   end
  3380.   
  3381.   #--------------------------------------------------------------------------
  3382.   # * Check Icon Image
  3383.   #--------------------------------------------------------------------------         
  3384.   def check_icon_image
  3385.       if @icon_image == nil or @icon_image.disposed?
  3386.          @icon_image = Cache.system("Iconset")
  3387.       end   
  3388.   end  
  3389.   
  3390. end

  3391. #==============================================================================
  3392. #==============================================================================
  3393. # ** Battle Hud EX
  3394. #==============================================================================
  3395. #==============================================================================
  3396. class Battle_Hud_EX
  3397.   
  3398.   #--------------------------------------------------------------------------
  3399.   # * Update Number
  3400.   #--------------------------------------------------------------------------   
  3401.   def update_number(type,value)
  3402.       actor_value = @actor.hp if type == 0
  3403.       actor_value = @actor.mp if type == 1
  3404.       actor_value = @actor.tp if type == 2
  3405.       actor_value = @actor.mhp if type == 3
  3406.       actor_value = @actor.mmp if type == 4
  3407.       actor_value = @actor.max_tp if type == 5
  3408.       actor_value = actor_at if type == 6
  3409.       actor_value = actor_max_at if type == 7
  3410.       if value < actor_value
  3411.          value += number_refresh_speed(actor_value,value)
  3412.          value = actor_value if value >= actor_value
  3413.          refresh_sprite_number(type,value)
  3414.      elsif value > actor_value
  3415.          value -= number_refresh_speed(actor_value,value)
  3416.          value = actor_value if value <= actor_value
  3417.          refresh_sprite_number(type,value)
  3418.      end  
  3419.   end
  3420.   
  3421.   #--------------------------------------------------------------------------
  3422.   # * Number Refresh Speed
  3423.   #--------------------------------------------------------------------------      
  3424.   def number_refresh_speed(actor_value,value)
  3425.       n =  1 * (actor_value - value).abs / 10
  3426.       return [[n, 99999999].min,1].max   
  3427.   end
  3428.   
  3429.   #--------------------------------------------------------------------------
  3430.   # * Update Number Fix
  3431.   #--------------------------------------------------------------------------      
  3432.   def update_number_fix(type)
  3433.       if type == 0
  3434.          @hp_number_old =  @actor.hp
  3435.          @hp_number_refresh = true
  3436.       elsif type == 1
  3437.          @mp_number_old =  @actor.mp
  3438.          @mp_number_refresh = true
  3439.       elsif type == 2
  3440.          @tp_number_old =  @actor.tp
  3441.          @tp_number_refresh = true  
  3442.       elsif type == 3
  3443.          @hp_number2_old =  @actor.mhp
  3444.          @hp_number2_refresh = true
  3445.       elsif type == 4
  3446.          @mp_number2_old =  @actor.mmp
  3447.          @mp_number2_refresh = true
  3448.       elsif type == 5
  3449.          @tp_number2_old =  @actor.max_tp
  3450.          @tp_number2_refresh = true  
  3451.       elsif type == 6
  3452.          @at_number_old =  actor_at
  3453.          @at_number_refresh = true         
  3454.       elsif type == 7
  3455.          @at_number2_old = actor_max_at
  3456.          @at_number2_refresh = true            
  3457.       end   
  3458.   end  
  3459.   
  3460.   #--------------------------------------------------------------------------
  3461.   # * Refresh Sprite Number
  3462.   #--------------------------------------------------------------------------   
  3463.   def refresh_sprite_number(type,value)   
  3464.       @hp_number_refresh = true if type == 0
  3465.       @hp_number_old = value if type == 0
  3466.       @mp_number_refresh = true if type == 1
  3467.       @mp_number_old = value if type == 1
  3468.       @tp_number_refresh = true if type == 2
  3469.       @tp_number_old = value if type == 2
  3470.       @hp_number2_refresh = true if type == 3
  3471.       @hp_number2_old = value if type == 3
  3472.       @mp_number2_refresh = true if type == 4
  3473.       @mp_number2_old = value if type == 4
  3474.       @tp_number2_refresh = true if type == 5
  3475.       @tp_number2_old = value if type == 5
  3476.       @at_number_refresh = true if type == 6
  3477.       @at_number_old = value if type == 6
  3478.       @at_number2_refresh = true if type == 7
  3479.       @at_number2_old = value if type == 7
  3480.   end  
  3481.   
  3482.   #--------------------------------------------------------------------------
  3483.   # * Refresh Number
  3484.   #--------------------------------------------------------------------------   
  3485.   def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  3486.       sprite.bitmap.clear
  3487.       clear_number_refresh(type)
  3488.       number_color = low_number_color(type,number_ch)
  3489.       if type == 0 and HP_NUMBER_PERCENTAGE
  3490.          value_max = @actor.mhp
  3491.          value = value.to_f / value_max.to_f * 100
  3492.          value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  3493.       elsif type == 1 and MP_NUMBER_PERCENTAGE
  3494.          value_max = @actor.mmp
  3495.          value = value.to_f / value_max.to_f * 100
  3496.       elsif type == 2 and TP_NUMBER_PERCENTAGE
  3497.          value_max = @actor.max_tp
  3498.          value = value.to_f / value_max.to_f * 100  
  3499.       elsif type == 3 and HP_NUMBER_PERCENTAGE
  3500.          value = 100
  3501.       elsif type == 4 and MP_NUMBER_PERCENTAGE
  3502.          value = 100
  3503.       elsif type == 5 and TP_NUMBER_PERCENTAGE
  3504.          value = 100
  3505.       elsif type == 6 and AT_NUMBER_PERCENTAGE
  3506.          value_max = actor_max_at
  3507.          value = value.to_f / value_max.to_f * 100
  3508.       elsif type == 7 and AT_NUMBER_PERCENTAGE
  3509.          value = 100         
  3510.       end
  3511.       value = 9999999 if value > 9999999
  3512.       number_value = value.truncate.abs.to_s.split(//)
  3513.       wave_h = 0
  3514.       wave_h2 = wave_number ? (number_ch / 3) : 0
  3515.       wave_h3 = number_color != 0 ? wave_h2 : 0
  3516.       for r in 0..number_value.size - 1         
  3517.          number_value_abs = number_value[r].to_i
  3518.          wh = wave_h2 * wave_h
  3519.          wh2 = wave_h == 0 ? wave_h2 : 0
  3520.          nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  3521.          sprite.bitmap.blt(number_cw *  r, wh, image, nsrc_rect)
  3522.          wave_h = wave_h == 0 ? 1 : 0
  3523.       end
  3524.       refresh_number_position(type,number_value.size,number_cw)
  3525.   end
  3526.   
  3527.   #--------------------------------------------------------------------------
  3528.   # * Refresh Number
  3529.   #--------------------------------------------------------------------------     
  3530.   def refresh_number_position(type,number_value,number_cw)
  3531.       cx = number_value * number_cw
  3532.       if type == 0
  3533.          case HP_NUMBER_ALIGN_TYPE
  3534.            when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  3535.            when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  3536.            when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  3537.          end            
  3538.       elsif type == 1
  3539.          case MP_NUMBER_ALIGN_TYPE
  3540.            when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  3541.            when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  3542.            when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  3543.          end     
  3544.       elsif type == 2  
  3545.          case TP_NUMBER_ALIGN_TYPE
  3546.            when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  3547.            when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  3548.            when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  3549.          end           
  3550.       elsif type == 3   
  3551.          case HP_NUMBER_ALIGN_TYPE
  3552.            when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  3553.            when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  3554.            when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  3555.          end           
  3556.       elsif type ==  4
  3557.          case MP_NUMBER_ALIGN_TYPE
  3558.            when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  3559.            when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  3560.            when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  3561.          end         
  3562.       elsif type ==  5
  3563.          case TP_NUMBER_ALIGN_TYPE
  3564.            when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  3565.            when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  3566.            when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  3567.          end
  3568.       elsif type ==  6     
  3569.          case MP_NUMBER_ALIGN_TYPE
  3570.            when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  3571.            when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  3572.            when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  3573.          end            
  3574.       elsif type ==  7     
  3575.          case AT_NUMBER_ALIGN_TYPE
  3576.            when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  3577.            when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  3578.            when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  3579.          end
  3580.       end  
  3581.   end
  3582.   
  3583.   #--------------------------------------------------------------------------
  3584.   # * Low Number Color
  3585.   #--------------------------------------------------------------------------      
  3586.   def low_number_color(type,number_ch)
  3587.       if type == 0
  3588.          if HP_NUMBER_LOW_COLOR
  3589.             return @actor.low_hp? ? number_ch : 0
  3590.          else
  3591.             return 0
  3592.          end  
  3593.       elsif type == 1
  3594.          if MP_NUMBER_LOW_COLOR   
  3595.             return @actor.low_mp? ? number_ch : 0
  3596.          else
  3597.             return 0
  3598.          end         
  3599.       elsif type == 2
  3600.          if TP_NUMBER_LOW_COLOR
  3601.             return @actor.low_tp? ? number_ch : 0
  3602.          else
  3603.             return 0
  3604.          end
  3605.       else   
  3606.          return 0  
  3607.       end     
  3608.   end
  3609.   
  3610.   #--------------------------------------------------------------------------
  3611.   # * Clear Number Refresh
  3612.   #--------------------------------------------------------------------------      
  3613.   def clear_number_refresh(type)
  3614.       @hp_number_refresh = false if type == 0
  3615.       @mp_number_refresh = false if type == 1
  3616.       @tp_number_refresh = false if type == 2
  3617.       @hp_number2_refresh = false if type == 3
  3618.       @mp_number2_refresh = false if type == 4
  3619.       @tp_number2_refresh = false if type == 5
  3620.       @at_number_refresh = false if type == 6
  3621.       @at_number2_refresh = false if type == 7
  3622.   end  
  3623.   
  3624.   #--------------------------------------------------------------------------
  3625.   # * Icon Limit
  3626.   #--------------------------------------------------------------------------      
  3627.   def icon_limit(value,value_max)
  3628.       n1 = value / value_max
  3629.       n2 = value - (n1 * value_max)
  3630.       n2 = value_max if (n2 == 0 and value > 0)
  3631.       return n2
  3632.   end  
  3633.   
  3634. end

  3635. #==============================================================================
  3636. #==============================================================================
  3637. # ** Battle Hud EX
  3638. #==============================================================================
  3639. #==============================================================================
  3640. class Battle_Hud_EX

  3641.   #--------------------------------------------------------------------------
  3642.   # * Create Layout
  3643.   #--------------------------------------------------------------------------   
  3644.   def create_layout(viewport)
  3645.       @layout = Sprite.new
  3646.       @layout.bitmap = @layout_image
  3647.       @layout.z = HUD_Z
  3648.       @layout.x = @hud_position[0]
  3649.       @layout.y = @hud_position[1]
  3650.       @layout.opacity = 0
  3651.       @layout.viewport = viewport
  3652.   end   
  3653.   
  3654.   #--------------------------------------------------------------------------
  3655.   # * Update Layout
  3656.   #--------------------------------------------------------------------------   
  3657.   def update_layout
  3658.       return if @layout == nil
  3659.       sprite_visible(@layout)
  3660.   end
  3661.   
  3662.   #--------------------------------------------------------------------------
  3663.   # * Create Layout
  3664.   #--------------------------------------------------------------------------   
  3665.   def create_layout_2(viewport)
  3666.       return if !SECOND_LAYOUT
  3667.       @layout2 = Sprite.new
  3668.       @layout2.bitmap = @layout2_image
  3669.       @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  3670.       @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  3671.       @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  3672.       @layout2.opacity = 0
  3673.       @layout2.viewport = viewport
  3674.   end   
  3675.   
  3676.   #--------------------------------------------------------------------------
  3677.   # * Update Layout
  3678.   #--------------------------------------------------------------------------   
  3679.   def update_layout_2
  3680.       return if @layout2 == nil
  3681.       sprite_visible(@layout2)
  3682.   end  
  3683.   
  3684. end

  3685. #==============================================================================
  3686. #==============================================================================
  3687. # ** Battle Hud EX
  3688. #==============================================================================
  3689. #==============================================================================
  3690. class Battle_Hud_EX
  3691.   
  3692.   #--------------------------------------------------------------------------
  3693.   # * Create Name
  3694.   #--------------------------------------------------------------------------      
  3695.   def create_name(viewport)
  3696.       return if !NAME_VISIBLE
  3697.       @name = Sprite.new
  3698.       @name.bitmap = Bitmap.new(160,32)
  3699.       @name.bitmap.font.size = NAME_FONT_SIZE
  3700.       @name.bitmap.font.bold = NAME_FONT_BOLD
  3701.       @name.bitmap.font.italic = NAME_FONT_ITALIC
  3702.       @name.bitmap.font.color = NAME_FONT_COLOR
  3703.       @name.z = HUD_Z + NAME_Z
  3704.       @name.x = @hud_position[0] + NAME_POSITION[0]
  3705.       @name.y = @hud_position[1] + NAME_POSITION[1]
  3706.       @name.viewport = viewport
  3707.       @name.opacity = 0
  3708.       refresh_name
  3709.   end

  3710.   #--------------------------------------------------------------------------
  3711.   # * Refresh Name
  3712.   #--------------------------------------------------------------------------      
  3713.   def refresh_name
  3714.       return if @name == nil
  3715.       @name.bitmap.clear
  3716.       if NAME_FONT_SHADOW
  3717.          @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  3718.          @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  3719.          @name.bitmap.font.color = NAME_FONT_COLOR
  3720.       end   
  3721.       @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  3722.   end
  3723.   
  3724.   #--------------------------------------------------------------------------
  3725.   # * Update Name
  3726.   #--------------------------------------------------------------------------        
  3727.   def update_name
  3728.       return if @name == nil
  3729.       sprite_visible(@name)
  3730.   end
  3731.   
  3732. end

  3733. #==============================================================================
  3734. #==============================================================================
  3735. # ** Battle Hud EX
  3736. #==============================================================================
  3737. #==============================================================================
  3738. class Battle_Hud_EX
  3739.   
  3740.   #--------------------------------------------------------------------------
  3741.   # * Create HP Number
  3742.   #--------------------------------------------------------------------------  
  3743.   def create_hp_number(viewport)
  3744.       return if !HP_NUMBER_VISIBLE
  3745.       @hp_number = Sprite.new
  3746.       @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  3747.       @hp_number.z = HUD_Z + HP_NUMBER_Z
  3748.       @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  3749.       @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  3750.       @hp_number.viewport = viewport
  3751.       @hp_number.opacity = 0
  3752.   end
  3753.   
  3754.   #--------------------------------------------------------------------------
  3755.   # * Create HP Number Max
  3756.   #--------------------------------------------------------------------------  
  3757.   def create_hp_number_max(viewport)
  3758.       return if !HP_NUMBER_MAX_VISIBLE
  3759.       @hp_number2 = Sprite.new
  3760.       @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  3761.       @hp_number2.z = HUD_Z + HP_NUMBER_Z
  3762.       @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  3763.       @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  3764.       @hp_number2.viewport = viewport
  3765.       @hp_number2.opacity = 0
  3766.   end  
  3767.   
  3768.   #--------------------------------------------------------------------------
  3769.   # * Create HP Meter
  3770.   #--------------------------------------------------------------------------   
  3771.   def create_hp_meter(viewport)
  3772.       return if !HP_METER_VISIBLE
  3773.       @hp_flow_max = @hp_meter_cw * 2
  3774.       @hp_flow = rand(@hp_flow_max)
  3775.       @hp_meter = Sprite.new
  3776.       @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  3777.       @hp_meter.z = HUD_Z + HP_METER_Z
  3778.       @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  3779.       @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  3780.       @hp_meter.angle = HP_METER_ANGLE
  3781.       @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  3782.       @hp_meter.viewport = viewport
  3783.       @hp_meter.opacity = 0
  3784.   end
  3785.   
  3786.   #--------------------------------------------------------------------------
  3787.   # ● Update Flow HP
  3788.   #--------------------------------------------------------------------------            
  3789.   def update_flow_hp
  3790.       @hp_meter.bitmap.clear
  3791.       @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  3792.       meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  3793.       meter_width = 0 if meter_width == nil
  3794.       execute_hp_damage_flow(meter_width)      
  3795.       meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  3796.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)  
  3797.       @hp_flow += 1
  3798.       @hp_flow = 0 if @hp_flow >= @hp_flow_max
  3799.   end  
  3800.    
  3801.   #--------------------------------------------------------------------------
  3802.   # ● Execute HP Damage Flow
  3803.   #--------------------------------------------------------------------------
  3804.   def execute_hp_damage_flow(meter_width)
  3805.       return if !HP_METER_REDUCTION_ANIMATION
  3806.       return if @hp_old_meter == meter_width
  3807.       n = (@hp_old_meter - meter_width).abs * 3 / 100
  3808.       damage_flow = [[n, 2].min,0.5].max
  3809.       @hp_old_meter -= damage_flow
  3810.       @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  3811.       src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  3812.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)      
  3813.   end

  3814.   #--------------------------------------------------------------------------
  3815.   # * Create HP Icon
  3816.   #--------------------------------------------------------------------------  
  3817.   def create_hp_icon(viewport)
  3818.       return if !HP_ICON_VISIBLE
  3819.       @hp_icon = Sprite.new
  3820.       icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  3821.       icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  3822.       @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  3823.       @hp_icon.z = HUD_Z + HP_ICON_Z
  3824.       @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  3825.       @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  3826.       @hp_icon.viewport = viewport
  3827.       @hp_icon.opacity = 0
  3828.   end
  3829.    
  3830.   #--------------------------------------------------------------------------
  3831.   # * Refresh HP Icon
  3832.   #--------------------------------------------------------------------------   
  3833.   def refresh_hp_icon
  3834.       @hp_icon_old = @actor.hp
  3835.       @hp_icon.bitmap.clear
  3836.       max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  3837.       if @actor.hp > max_value
  3838.          icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  3839.       else   
  3840.          icon_max = @actor.mhp
  3841.       end      
  3842.       for i in 0...icon_max
  3843.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  3844.           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)
  3845.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  3846.           i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  3847.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )      
  3848.       end      
  3849.       icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  3850.       rx = 0
  3851.       ry = 0
  3852.       for i in 0...icon_max
  3853.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  3854.           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)
  3855.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  3856.           i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  3857.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  3858.       end
  3859.       refresh_hp_icon_ex(rx,ry)      
  3860.   end
  3861.   
  3862.   #--------------------------------------------------------------------------
  3863.   # * Create HP Icon EX
  3864.   #--------------------------------------------------------------------------  
  3865.   def create_hp_icon_ex(viewport)
  3866.       return if !HP_ICON_EX_VISIBLE
  3867.       @hp_icon3_anime_phase = 0
  3868.       @hp_icon3 = Sprite.new
  3869.       @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  3870.       @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  3871.       @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  3872.       @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  3873.       @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  3874.                        @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  3875.       @hp_icon3.x = @hp_icon3_org[0]
  3876.       @hp_icon3.y = @hp_icon3_org[1]
  3877.       @hp_icon3.viewport = viewport
  3878.       @hp_icon3.opacity = 0
  3879.   end   
  3880.   
  3881.   #--------------------------------------------------------------------------
  3882.   # * Refresh HP Icon EX
  3883.   #--------------------------------------------------------------------------      
  3884.   def refresh_hp_icon_ex(rx,ry)
  3885.       return if @hp_icon3 == nil
  3886.       @hp_icon3.bitmap.clear
  3887.       return if @actor.hp == 0
  3888.       i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  3889.       @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  3890.       @hp_icon3.x = @hp_icon3_org[0] + rx
  3891.       @hp_icon3.y = @hp_icon3_org[1] + ry     
  3892.   end
  3893.   
  3894.   #--------------------------------------------------------------------------
  3895.   # * Update Icon HP EX Anime
  3896.   #--------------------------------------------------------------------------  
  3897.   def update_icon_hp_ex_anime
  3898.       return if !HP_ICON_EX_ZOOM_EFFECT
  3899.       if @hp_icon3_anime_phase == 0
  3900.          @hp_icon3.zoom_x += 0.01
  3901.          if @hp_icon3.zoom_x >= 1.30
  3902.             @hp_icon3.zoom_x = 1.30
  3903.             @hp_icon3_anime_phase = 1
  3904.          end  
  3905.       else
  3906.         @hp_icon3.zoom_x -= 0.01
  3907.         if @hp_icon3.zoom_x <= 1.05
  3908.            @hp_icon3.zoom_x = 1.05
  3909.            @hp_icon3_anime_phase = 0
  3910.         end   
  3911.       end  
  3912.       @hp_icon3.zoom_y = @hp_icon3.zoom_x
  3913.   end
  3914.   
  3915.   #--------------------------------------------------------------------------
  3916.   # * Create HP Icon Nummber
  3917.   #--------------------------------------------------------------------------      
  3918.   def create_hp_icon_number(viewport)
  3919.       return if !HP_ICON_NUMBER_VISIBLE
  3920.       @hp_icon_number_old = [-1,-1]
  3921.       @hp_icon_number = Sprite.new
  3922.       @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  3923.       @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  3924.       @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  3925.       @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  3926.       @hp_icon_number.viewport = viewport
  3927.       @hp_icon_number.opacity = 0
  3928.   end
  3929.   
  3930.   #--------------------------------------------------------------------------
  3931.   # * Refresh Icon Number HP
  3932.   #--------------------------------------------------------------------------  
  3933.   def refresh_icon_number_hp
  3934.       @hp_icon_number_old[0] = @actor.hp
  3935.       @hp_icon_number_old[1] = @actor.mhp
  3936.       @hp_icon_number.bitmap.clear
  3937.       value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  3938.       value = 0 if value < 0
  3939.       number_value = value.truncate.abs.to_s.split(//)
  3940.       for r in 0..number_value.size - 1         
  3941.          number_value_abs = number_value[r].to_i
  3942.          nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  3943.          @hp_icon_number.bitmap.blt(@hp_icon_number_cw *  r, 0, @hp_icon_number_image, nsrc_rect)
  3944.       end
  3945.       cx = (number_value.size * @hp_icon_number_cw)
  3946.       case HP_ICON_NUMBER_ALIGN_TYPE
  3947.          when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  3948.          when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  3949.          when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  3950.       end   
  3951.   end

  3952.   #--------------------------------------------------------------------------
  3953.   # * Can Refresh Icon Number HP
  3954.   #--------------------------------------------------------------------------  
  3955.   def can_refresh_icon_number_hp?
  3956.       return true if @hp_icon_number_old[0] != @actor.hp
  3957.       return true if @hp_icon_number_old[1] != @actor.mhp
  3958.       return false
  3959.   end
  3960.   
  3961.   #--------------------------------------------------------------------------
  3962.   # * Update HP
  3963.   #--------------------------------------------------------------------------   
  3964.   def update_hp
  3965.       if @hp_number != nil
  3966.          if HP_NUMBER_ANIMATION
  3967.             update_number(0,@hp_number_old)
  3968.          else   
  3969.             update_number_fix(0) if @hp_number_old != @actor.hp
  3970.          end
  3971.          sprite_visible(@hp_number)  
  3972.          refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  3973.       end
  3974.       if @hp_number2 != nil
  3975.          if HP_NUMBER_ANIMATION
  3976.             update_number(3,@hp_number2_old)
  3977.          else   
  3978.             update_number_fix(3) if @hp_number2_old != @actor.mhp
  3979.          end  
  3980.          refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  3981.          sprite_visible(@hp_number2)
  3982.       end
  3983.       if @hp_meter != nil
  3984.          sprite_visible(@hp_meter)
  3985.          update_flow_hp
  3986.       end   
  3987.       if @hp_icon != nil
  3988.          sprite_visible(@hp_icon)
  3989.          refresh_hp_icon if @hp_icon_old != @actor.hp
  3990.       end
  3991.       if @hp_icon3 != nil
  3992.          sprite_visible(@hp_icon3)
  3993.          update_icon_hp_ex_anime
  3994.       end      
  3995.       if @hp_icon_number != nil
  3996.          sprite_visible(@hp_icon_number)
  3997.          refresh_icon_number_hp if can_refresh_icon_number_hp?
  3998.       end  
  3999.   end  
  4000.    
  4001. end

  4002. #==============================================================================
  4003. #==============================================================================
  4004. # ** Battle Hud EX
  4005. #==============================================================================
  4006. #==============================================================================
  4007. class Battle_Hud_EX
  4008.   
  4009.   #--------------------------------------------------------------------------
  4010.   # * Create MP Number
  4011.   #--------------------------------------------------------------------------  
  4012.   def create_mp_number(viewport)
  4013.       return if !MP_NUMBER_VISIBLE
  4014.       @mp_number = Sprite.new
  4015.       @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4016.       @mp_number.z = HUD_Z + MP_NUMBER_Z
  4017.       @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4018.       @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4019.       @mp_number.viewport = viewport
  4020.       @mp_number.opacity = 0
  4021.   end
  4022.   
  4023.   #--------------------------------------------------------------------------
  4024.   # * Create MP Number Max
  4025.   #--------------------------------------------------------------------------  
  4026.   def create_mp_number_max(viewport)
  4027.       return if !MP_NUMBER_MAX_VISIBLE
  4028.       @mp_number2 = Sprite.new
  4029.       @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4030.       @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4031.       @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4032.       @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4033.       @mp_number2.viewport = viewport
  4034.       @mp_number2.opacity = 0
  4035.   end  
  4036.   
  4037.   #--------------------------------------------------------------------------
  4038.   # * Create MP Meter
  4039.   #--------------------------------------------------------------------------   
  4040.   def create_mp_meter(viewport)
  4041.       return if !MP_METER_VISIBLE
  4042.       @mp_flow_max = @mp_meter_cw * 2
  4043.       @mp_flow = rand(@mp_flow_max)
  4044.       @mp_meter = Sprite.new
  4045.       @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4046.       @mp_meter.z = HUD_Z + MP_METER_Z
  4047.       @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4048.       @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4049.       @mp_meter.angle = MP_METER_ANGLE
  4050.       @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4051.       @mp_meter.viewport = viewport
  4052.       @mp_meter.opacity = 0
  4053.   end
  4054.   
  4055.   #--------------------------------------------------------------------------
  4056.   # ● Update Flow MP
  4057.   #--------------------------------------------------------------------------            
  4058.   def update_flow_mp
  4059.       @mp_meter.bitmap.clear
  4060.       @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4061.       meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4062.       meter_width = 0 if meter_width == nil
  4063.       execute_mp_damage_flow(meter_width)      
  4064.       meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4065.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)  
  4066.       @mp_flow += 1
  4067.       @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4068.   end  
  4069.    
  4070.   #--------------------------------------------------------------------------
  4071.   # ● Execute MP Damage Flow
  4072.   #--------------------------------------------------------------------------
  4073.   def execute_mp_damage_flow(meter_width)
  4074.       return if !MP_METER_REDUCTION_ANIMATION
  4075.       return if @mp_old_meter == meter_width
  4076.       n = (@mp_old_meter - meter_width).abs * 3 / 100
  4077.       damage_flow = [[n, 2].min,0.5].max
  4078.       @mp_old_meter -= damage_flow      
  4079.       @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4080.       src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4081.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)      
  4082.   end

  4083.   #--------------------------------------------------------------------------
  4084.   # * Create MP Icon
  4085.   #--------------------------------------------------------------------------  
  4086.   def create_mp_icon(viewport)
  4087.       return if !MP_ICON_VISIBLE
  4088.       @mp_icon = Sprite.new
  4089.       icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4090.       icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4091.       @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4092.       @mp_icon.z = HUD_Z + MP_ICON_Z
  4093.       @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4094.       @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4095.       @mp_icon.viewport = viewport
  4096.       @mp_icon.opacity = 0
  4097.   end
  4098.    
  4099.   #--------------------------------------------------------------------------
  4100.   # * Refresh MP Icon
  4101.   #--------------------------------------------------------------------------   
  4102.   def refresh_mp_icon
  4103.       @mp_icon_old = @actor.mp
  4104.       @mp_icon.bitmap.clear
  4105.       max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4106.       if @actor.mp > max_value
  4107.          icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4108.       else   
  4109.          icon_max = @actor.mmp
  4110.       end      
  4111.       for i in 0...icon_max
  4112.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4113.           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)
  4114.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4115.           i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4116.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )      
  4117.       end      
  4118.       icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4119.       rx = 0
  4120.       ry = 0
  4121.       for i in 0...icon_max
  4122.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4123.           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)
  4124.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4125.           i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4126.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4127.       end
  4128.       refresh_mp_icon_ex(rx,ry)      
  4129.   end
  4130.   
  4131.   #--------------------------------------------------------------------------
  4132.   # * Create MP Icon EX
  4133.   #--------------------------------------------------------------------------  
  4134.   def create_mp_icon_ex(viewport)
  4135.       return if !MP_ICON_EX_VISIBLE
  4136.       @mp_icon3_anime_phase = 0
  4137.       @mp_icon3 = Sprite.new
  4138.       @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4139.       @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4140.       @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4141.       @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4142.       @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4143.                        @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4144.       @mp_icon3.x = @mp_icon3_org[0]
  4145.       @mp_icon3.y = @mp_icon3_org[1]
  4146.       @mp_icon3.viewport = viewport
  4147.       @mp_icon3.opacity = 0
  4148.   end   
  4149.   
  4150.   #--------------------------------------------------------------------------
  4151.   # * Refresh MP Icon EX
  4152.   #--------------------------------------------------------------------------      
  4153.   def refresh_mp_icon_ex(rx,ry)
  4154.       return if @mp_icon3 == nil
  4155.       @mp_icon3.bitmap.clear
  4156.       return if @actor.mp == 0
  4157.       i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4158.       @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4159.       @mp_icon3.x = @mp_icon3_org[0] + rx
  4160.       @mp_icon3.y = @mp_icon3_org[1] + ry     
  4161.   end
  4162.   
  4163.   #--------------------------------------------------------------------------
  4164.   # * Update Icon MP EX Anime
  4165.   #--------------------------------------------------------------------------  
  4166.   def update_icon_mp_ex_anime
  4167.       return if !MP_ICON_EX_ZOOM_EFFECT
  4168.       if @mp_icon3_anime_phase == 0
  4169.          @mp_icon3.zoom_x += 0.01
  4170.          if @mp_icon3.zoom_x >= 1.30
  4171.             @mp_icon3.zoom_x = 1.30
  4172.             @mp_icon3_anime_phase = 1
  4173.          end  
  4174.       else
  4175.         @mp_icon3.zoom_x -= 0.01
  4176.         if @mp_icon3.zoom_x <= 1.05
  4177.            @mp_icon3.zoom_x = 1.05
  4178.            @mp_icon3_anime_phase = 0
  4179.         end   
  4180.       end  
  4181.       @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4182.   end  
  4183.   
  4184.   #--------------------------------------------------------------------------
  4185.   # * Create MP Icon Number
  4186.   #--------------------------------------------------------------------------      
  4187.   def create_mp_icon_number(viewport)
  4188.       return if !MP_ICON_NUMBER_VISIBLE
  4189.       @mp_icon_number_old = [-1,-1]
  4190.       @mp_icon_number = Sprite.new
  4191.       @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4192.       @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4193.       @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4194.       @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4195.       @mp_icon_number.viewport = viewport
  4196.       @mp_icon_number.opacity = 0
  4197.   end
  4198.   
  4199.   #--------------------------------------------------------------------------
  4200.   # * Refresh Icon Number MP
  4201.   #--------------------------------------------------------------------------  
  4202.   def refresh_icon_number_mp
  4203.       @mp_icon_number_old[0] = @actor.mp
  4204.       @mp_icon_number_old[1] = @actor.mmp
  4205.       @mp_icon_number.bitmap.clear
  4206.       value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4207.       value = 0 if value < 0
  4208.       number_value = value.truncate.abs.to_s.split(//)
  4209.       for r in 0..number_value.size - 1         
  4210.          number_value_abs = number_value[r].to_i
  4211.          nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4212.          @mp_icon_number.bitmap.blt(@mp_icon_number_cw *  r, 0, @mp_icon_number_image, nsrc_rect)
  4213.       end
  4214.       cx = (number_value.size * @mp_icon_number_cw)
  4215.       case MP_ICON_NUMBER_ALIGN_TYPE
  4216.          when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4217.          when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4218.          when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4219.       end        
  4220.   end

  4221.   #--------------------------------------------------------------------------
  4222.   # * Can Refresh Icon Number MP
  4223.   #--------------------------------------------------------------------------  
  4224.   def can_refresh_icon_number_mp?
  4225.       return true if @mp_icon_number_old[0] != @actor.mp
  4226.       return true if @mp_icon_number_old[1] != @actor.mmp
  4227.       return false
  4228.   end   
  4229.   
  4230.   #--------------------------------------------------------------------------
  4231.   # * Update MP
  4232.   #--------------------------------------------------------------------------   
  4233.   def update_mp
  4234.       if @mp_number != nil
  4235.          sprite_visible(@mp_number)
  4236.          if MP_NUMBER_ANIMATION
  4237.             update_number(1,@mp_number_old)
  4238.          else
  4239.             update_number_fix(1) if @mp_number_old != @actor.mp
  4240.          end  
  4241.          refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4242.       end
  4243.       if @mp_number2 != nil
  4244.          sprite_visible(@mp_number2)
  4245.          if MP_NUMBER_ANIMATION
  4246.             update_number(4,@mp_number2_old)
  4247.          else
  4248.             update_number_fix(4) if @mp_number2_old != @actor.mmp
  4249.          end  
  4250.          refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4251.       end      
  4252.       if @mp_meter != nil
  4253.          sprite_visible(@mp_meter)
  4254.          update_flow_mp
  4255.       end
  4256.       if @mp_icon != nil
  4257.          sprite_visible(@mp_icon)
  4258.          refresh_mp_icon if @mp_icon_old != @actor.mp
  4259.       end
  4260.       if @mp_icon3 != nil
  4261.          sprite_visible(@mp_icon3)
  4262.          update_icon_mp_ex_anime
  4263.       end         
  4264.       if @mp_icon_number != nil
  4265.          sprite_visible(@mp_icon_number)
  4266.          refresh_icon_number_mp if can_refresh_icon_number_mp?
  4267.       end      
  4268.   end  
  4269.   
  4270. end

  4271. #==============================================================================
  4272. #==============================================================================
  4273. # ** Battle Hud EX
  4274. #==============================================================================
  4275. #==============================================================================
  4276. class Battle_Hud_EX
  4277.   
  4278.   #--------------------------------------------------------------------------
  4279.   # * Create TP Number
  4280.   #--------------------------------------------------------------------------  
  4281.   def create_tp_number(viewport)
  4282.       return if !TP_NUMBER_VISIBLE
  4283.       @tp_number = Sprite.new
  4284.       @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4285.       @tp_number.z = HUD_Z + TP_NUMBER_Z
  4286.       @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4287.       @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4288.       @tp_number.viewport = viewport
  4289.       @tp_number.opacity = 0
  4290.   end
  4291.   
  4292.   #--------------------------------------------------------------------------
  4293.   # * Create TP Number MAX
  4294.   #--------------------------------------------------------------------------  
  4295.   def create_tp_number_max(viewport)
  4296.       return if !TP_NUMBER_MAX_VISIBLE
  4297.       @tp_number2 = Sprite.new
  4298.       @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4299.       @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4300.       @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4301.       @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4302.       @tp_number2.viewport = viewport
  4303.       @tp_number2.opacity = 0
  4304.   end  
  4305.   
  4306.   #--------------------------------------------------------------------------
  4307.   # * Create TP Meter
  4308.   #--------------------------------------------------------------------------   
  4309.   def create_tp_meter(viewport)
  4310.       return if !TP_METER_VISIBLE
  4311.       @tp_flow_max = @tp_meter_cw * 2
  4312.       @tp_flow = rand(@tp_flow_max)
  4313.       @tp_meter = Sprite.new
  4314.       @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4315.       @tp_meter.z = HUD_Z + TP_METER_Z
  4316.       @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4317.       @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4318.       @tp_meter.angle = TP_METER_ANGLE
  4319.       @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4320.       @tp_meter.viewport = viewport
  4321.       @tp_meter.opacity = 0
  4322.   end
  4323.   
  4324.   #--------------------------------------------------------------------------
  4325.   # ● Update Flow TP
  4326.   #--------------------------------------------------------------------------            
  4327.   def update_flow_tp
  4328.       @tp_meter.bitmap.clear      
  4329.       @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4330.       meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil  
  4331.       meter_width = 0 if meter_width == nil
  4332.       execute_tp_damage_flow(meter_width)      
  4333.       meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4334.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)  
  4335.       @tp_flow += 1
  4336.       @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4337.   end  
  4338.    
  4339.   #--------------------------------------------------------------------------
  4340.   # ● Execute TP Damage Flow
  4341.   #--------------------------------------------------------------------------
  4342.   def execute_tp_damage_flow(meter_width)
  4343.       return if !TP_METER_REDUCTION_ANIMATION
  4344.       return if @tp_old_meter == meter_width
  4345.       n = (@tp_old_meter - meter_width).abs * 3 / 100
  4346.       damage_flow = [[n, 2].min,0.5].max
  4347.       @tp_old_meter -= damage_flow
  4348.       @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4349.       src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4350.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)      
  4351.   end

  4352.   #--------------------------------------------------------------------------
  4353.   # * Create TP Icon
  4354.   #--------------------------------------------------------------------------  
  4355.   def create_tp_icon(viewport)
  4356.       return if !TP_ICON_VISIBLE
  4357.       @tp_icon = Sprite.new
  4358.       icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4359.       icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4360.       @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4361.       @tp_icon.z = HUD_Z + TP_ICON_Z
  4362.       @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4363.       @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4364.       @tp_icon.viewport = viewport
  4365.       @tp_icon.opacity = 0
  4366.   end
  4367.    
  4368.   #--------------------------------------------------------------------------
  4369.   # * Refresh TP Icon
  4370.   #--------------------------------------------------------------------------   
  4371.   def refresh_tp_icon
  4372.       @tp_icon_old = @actor.tp
  4373.       @tp_icon.bitmap.clear
  4374.       max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4375.       if @actor.mp > max_value
  4376.          icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4377.       else   
  4378.          icon_max = @actor.max_tp
  4379.       end      
  4380.       for i in 0...icon_max
  4381.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4382.           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)
  4383.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4384.           i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4385.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )      
  4386.       end      
  4387.       icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4388.       rx = 0
  4389.       ry = 0
  4390.       for i in 0...icon_max
  4391.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4392.           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)
  4393.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4394.           i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4395.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4396.       end
  4397.       refresh_tp_icon_ex(rx,ry)      
  4398.   end
  4399.   
  4400.   #--------------------------------------------------------------------------
  4401.   # * Create TP Icon EX
  4402.   #--------------------------------------------------------------------------  
  4403.   def create_tp_icon_ex(viewport)
  4404.       return if !TP_ICON_EX_VISIBLE
  4405.       @tp_icon3_anime_phase = 0
  4406.       @tp_icon3 = Sprite.new
  4407.       @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4408.       @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4409.       @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4410.       @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4411.       @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4412.                        @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4413.       @tp_icon3.x = @tp_icon3_org[0]
  4414.       @tp_icon3.y = @tp_icon3_org[1]
  4415.       @tp_icon3.viewport = viewport
  4416.       @tp_icon3.opacity = 0
  4417.   end   
  4418.   
  4419.   #--------------------------------------------------------------------------
  4420.   # * Refresh TP Icon EX
  4421.   #--------------------------------------------------------------------------      
  4422.   def refresh_tp_icon_ex(rx,ry)
  4423.       return if @tp_icon3 == nil
  4424.       @tp_icon3.bitmap.clear
  4425.       return if @actor.tp == 0
  4426.       i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4427.       @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4428.       @tp_icon3.x = @tp_icon3_org[0] + rx
  4429.       @tp_icon3.y = @tp_icon3_org[1] + ry     
  4430.   end
  4431.   
  4432.   #--------------------------------------------------------------------------
  4433.   # * Update Icon TP EX Anime
  4434.   #--------------------------------------------------------------------------  
  4435.   def update_icon_tp_ex_anime
  4436.       return if !MP_ICON_EX_ZOOM_EFFECT
  4437.       if @tp_icon3_anime_phase == 0
  4438.          @tp_icon3.zoom_x += 0.01
  4439.          if @tp_icon3.zoom_x >= 1.30
  4440.             @tp_icon3.zoom_x = 1.30
  4441.             @tp_icon3_anime_phase = 1
  4442.          end  
  4443.       else
  4444.         @tp_icon3.zoom_x -= 0.01
  4445.         if @tp_icon3.zoom_x <= 1.05
  4446.            @tp_icon3.zoom_x = 1.05
  4447.            @tp_icon3_anime_phase = 0
  4448.         end   
  4449.       end  
  4450.       @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4451.   end   
  4452.   
  4453.   #--------------------------------------------------------------------------
  4454.   # * Create HP Icon Number
  4455.   #--------------------------------------------------------------------------      
  4456.   def create_tp_icon_number(viewport)
  4457.       return if !TP_ICON_NUMBER_VISIBLE
  4458.       @tp_icon_number_old = [-1,-1]
  4459.       @tp_icon_number = Sprite.new
  4460.       @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  4461.       @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  4462.       @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  4463.       @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  4464.       @tp_icon_number.viewport = viewport
  4465.       @tp_icon_number.opacity = 0
  4466.   end
  4467.   
  4468.   #--------------------------------------------------------------------------
  4469.   # * Refresh Icon Number TP
  4470.   #--------------------------------------------------------------------------  
  4471.   def refresh_icon_number_tp
  4472.       @tp_icon_number_old[0] = @actor.tp
  4473.       @tp_icon_number_old[1] = @actor.max_tp
  4474.       @tp_icon_number.bitmap.clear
  4475.       value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  4476.       value = 0 if value < 0
  4477.       number_value = value.truncate.abs.to_s.split(//)
  4478.       for r in 0..number_value.size - 1         
  4479.          number_value_abs = number_value[r].to_i
  4480.          nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  4481.          @tp_icon_number.bitmap.blt(@tp_icon_number_cw *  r, 0, @tp_icon_number_image, nsrc_rect)
  4482.       end
  4483.       cx = (number_value.size * @tp_icon_number_cw)
  4484.       case TP_ICON_NUMBER_ALIGN_TYPE
  4485.          when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  4486.          when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4487.          when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  4488.       end        
  4489.   end

  4490.   #--------------------------------------------------------------------------
  4491.   # * Can Refresh Icon Number TP
  4492.   #--------------------------------------------------------------------------  
  4493.   def can_refresh_icon_number_tp?
  4494.       return true if @tp_icon_number_old[0] != @actor.tp
  4495.       return true if @tp_icon_number_old[1] != @actor.max_tp
  4496.       return false
  4497.   end   
  4498.   
  4499.   #--------------------------------------------------------------------------
  4500.   # * Update TP
  4501.   #--------------------------------------------------------------------------   
  4502.   def update_tp
  4503.       if @tp_number != nil
  4504.          sprite_visible(@tp_number)
  4505.          if MP_NUMBER_ANIMATION
  4506.             update_number(2,@tp_number_old)
  4507.          else
  4508.             update_number_fix(2) if @tp_number_old != @actor.tp
  4509.          end           
  4510.          refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh         
  4511.       end   
  4512.       if @tp_number2 != nil
  4513.          sprite_visible(@tp_number2)
  4514.          if MP_NUMBER_ANIMATION
  4515.             update_number(5,@tp_number2_old)
  4516.          else
  4517.             update_number_fix(5) if @tp_number2_old != @actor.max_tp
  4518.          end           
  4519.          refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  4520.       end        
  4521.       if @tp_meter != nil
  4522.          sprite_visible(@tp_meter)
  4523.          update_flow_tp
  4524.       end
  4525.       if @tp_icon != nil
  4526.          sprite_visible(@tp_icon)
  4527.          refresh_tp_icon if @tp_icon_old != @actor.tp
  4528.       end
  4529.       if @tp_icon3 != nil
  4530.          sprite_visible(@tp_icon3)
  4531.          update_icon_tp_ex_anime
  4532.       end         
  4533.       if @tp_icon_number != nil
  4534.          sprite_visible(@tp_icon_number)
  4535.          refresh_icon_number_tp if can_refresh_icon_number_tp?
  4536.       end  
  4537.   end  
  4538.   
  4539. end

  4540. #==============================================================================
  4541. #==============================================================================
  4542. # ** Battle Hud EX
  4543. #==============================================================================
  4544. #==============================================================================
  4545. class Battle_Hud_EX
  4546.   
  4547.   #--------------------------------------------------------------------------
  4548.   # * Create AT Number
  4549.   #--------------------------------------------------------------------------  
  4550.   def create_at_number(viewport)
  4551.       return if !AT_NUMBER_VISIBLE
  4552.       @at_number = Sprite.new
  4553.       @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  4554.       @at_number.z = HUD_Z + AT_NUMBER_Z
  4555.       @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4556.       @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  4557.       @at_number.viewport = viewport
  4558.       @at_number.opacity = 0
  4559.   end
  4560.   
  4561.   #--------------------------------------------------------------------------
  4562.   # * Create AT Number Max
  4563.   #--------------------------------------------------------------------------  
  4564.   def create_at_number_max(viewport)
  4565.       return if !AT_NUMBER_MAX_VISIBLE
  4566.       @at_number2 = Sprite.new
  4567.       @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  4568.       @at_number2.z = HUD_Z + AT_NUMBER_Z
  4569.       @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  4570.       @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  4571.       @at_number2.viewport = viewport
  4572.       @at_number2.opacity = 0
  4573.   end  
  4574.   
  4575.   #--------------------------------------------------------------------------
  4576.   # * Create AT Meter
  4577.   #--------------------------------------------------------------------------   
  4578.   def create_at_meter(viewport)
  4579.       return if !AT_METER_VISIBLE
  4580.       @at_flow_max = @at_meter_cw * 2
  4581.       @at_flow = rand(@at_flow_max)
  4582.       @at_meter = Sprite.new
  4583.       @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  4584.       @at_meter.z = HUD_Z + AT_METER_Z
  4585.       @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  4586.       @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  4587.       @at_meter.angle = AT_METER_ANGLE
  4588.       @at_meter.mirror = AT_METER_MIRROR_EFFECT
  4589.       @at_meter.viewport = viewport
  4590.       @at_meter.opacity = 0
  4591.   end
  4592.   
  4593.   #--------------------------------------------------------------------------
  4594.   # ● Update Flow AT
  4595.   #--------------------------------------------------------------------------            
  4596.   def update_flow_at
  4597.       @at_meter.bitmap.clear
  4598.       @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  4599.       if actor_cast?
  4600.          meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  4601.          meter_width = 0 if meter_width == nil
  4602.          ch = @at_meter_ch * 2
  4603.       else
  4604.          meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  4605.          meter_width = 0 if meter_width == nil         
  4606.          ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  4607.       end   
  4608.       meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  4609.       @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)  
  4610.       @at_flow += 1
  4611.       @at_flow = 0 if @at_flow >= @at_flow_max
  4612.   end  
  4613.   
  4614.   #--------------------------------------------------------------------------
  4615.   # * Update AT
  4616.   #--------------------------------------------------------------------------   
  4617.   def update_at
  4618.       if @at_number != nil
  4619.          sprite_visible(@at_number)
  4620.          if AT_NUMBER_ANIMATION
  4621.             update_number(6,@at_number_old)
  4622.          else   
  4623.             update_number_fix(6) if @at_number_old != actor_at
  4624.          end  
  4625.          refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  4626.       end
  4627.       if @at_number2 != nil
  4628.          sprite_visible(@at_number2)
  4629.          if AT_NUMBER_ANIMATION
  4630.             update_number(7,@at_number2_old)
  4631.          else   
  4632.             update_number_fix(7) if @at_number2_old != actor_max_at
  4633.          end  
  4634.          refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  4635.       end
  4636.       if @at_meter != nil
  4637.          sprite_visible(@at_meter)
  4638.          update_flow_at
  4639.       end   
  4640.   end  
  4641.    
  4642. end

  4643. #==============================================================================
  4644. #==============================================================================
  4645. # ** Battle Hud EX
  4646. #==============================================================================
  4647. #==============================================================================
  4648. class Battle_Hud_EX
  4649.   
  4650.   #--------------------------------------------------------------------------
  4651.   # * Create Level Number
  4652.   #--------------------------------------------------------------------------   
  4653.   def create_level_number(viewport)
  4654.       return if !LEVEL_NUMBER_VISIBLE
  4655.       @old_level = -1
  4656.       @lv_number = Sprite.new
  4657.       @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  4658.       @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  4659.       @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  4660.       @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  4661.       @lv_number.viewport = viewport
  4662.       @lv_number.opacity = 0
  4663.   end
  4664.   
  4665.   #--------------------------------------------------------------------------
  4666.   # * Refresh Level Number
  4667.   #--------------------------------------------------------------------------  
  4668.   def refresh_level_number
  4669.       @lv_number.bitmap.clear
  4670.       @old_level = @actor.level      
  4671.       number_value = @actor.level.abs.to_s.split(//)
  4672.       for r in 0..number_value.size - 1         
  4673.          number_value_abs = number_value[r].to_i
  4674.          nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  4675.          @lv_number.bitmap.blt(@lv_number_cw *  r, 0, @lv_number_image, nsrc_rect)
  4676.       end
  4677.       cx = (number_value.size * @lv_number_cw)
  4678.       case LEVEL_NUMBER_ALIGN_TYPE
  4679.            when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  4680.            when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  4681.            when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  4682.       end
  4683.   end
  4684.   
  4685.   #--------------------------------------------------------------------------
  4686.   # * Update Level
  4687.   #--------------------------------------------------------------------------  
  4688.   def update_level
  4689.       return if @lv_number == nil
  4690.       sprite_visible(@lv_number)
  4691.       refresh_level_number if @old_level != @actor.level
  4692.   end
  4693.   
  4694. end

  4695. #==============================================================================
  4696. #==============================================================================
  4697. # ** Battle Hud EX
  4698. #==============================================================================
  4699. #==============================================================================
  4700. class Battle_Hud_EX
  4701.   
  4702.   #--------------------------------------------------------------------------
  4703.   # * Create States
  4704.   #--------------------------------------------------------------------------  
  4705.   def create_states(viewport)
  4706.       return if !STATES_VISIBLE
  4707.       @status_old = nil
  4708.       @status_flow = [-24,0]
  4709.       @status_size_real = 0
  4710.       @status = Sprite.new
  4711.       @status.bitmap = Bitmap.new(24,24)
  4712.       @status.x = @hud_position[0] + STATES_POSITION[0]
  4713.       @status.y = @hud_position[1] + STATES_POSITION[1]
  4714.       @status.z = HUD_Z + STATES_Z
  4715.       @status.angle = STATE_ANGLE
  4716.       @status.viewport = viewport
  4717.       @status.opacity = 0
  4718.   end
  4719.   
  4720.   #--------------------------------------------------------------------------
  4721.   # * Refresh States
  4722.   #--------------------------------------------------------------------------        
  4723.   def refresh_states
  4724.       check_icon_image
  4725.       @status_size_real = set_real_states_size
  4726.       @status_old = @actor.states
  4727.       @status_flow = [0,0]
  4728.       @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  4729.       @actor_status.dispose if @actor_status != nil
  4730.       @actor_status = Bitmap.new(@states_size,24)
  4731.       index = 0
  4732.       for i in @actor.states
  4733.          next if HIDE_STATES_ID.include?(i.id)         
  4734.          rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  4735.          @actor_status.blt(26 * index , 0, @icon_image, rect)
  4736.          index += 1
  4737.       end
  4738.   end   
  4739.   
  4740.   #--------------------------------------------------------------------------
  4741.   # * Set Real States Size
  4742.   #--------------------------------------------------------------------------        
  4743.   def set_real_states_size
  4744.       n = 0
  4745.       for i in @actor.states
  4746.           next if HIDE_STATES_ID.include?(i.id)  
  4747.           n += 1
  4748.       end
  4749.       return n
  4750.   end
  4751.   
  4752.   #--------------------------------------------------------------------------
  4753.   # * Flow_Status
  4754.   #--------------------------------------------------------------------------         
  4755.   def flow_states
  4756.       return if @actor_status == nil
  4757.       @status.bitmap.clear
  4758.       return if @actor.states.size == 0
  4759.       st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  4760.       @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  4761.       if STATES_SCROLLING_ANIMATION
  4762.          @status_flow[0] += 1
  4763.          @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  4764.       else   
  4765.          @status_flow[1] += 1 unless @actor.states.size <= 1
  4766.          if @status_flow[1] > 30
  4767.             @status_flow[1] = 0
  4768.             @status_flow[0] += 26
  4769.             @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  4770.          end   
  4771.      end   
  4772.   end      
  4773.   
  4774.   #--------------------------------------------------------------------------
  4775.   # * Update States
  4776.   #--------------------------------------------------------------------------  
  4777.   def update_states
  4778.       return if @status == nil
  4779.       sprite_visible(@status)
  4780.       refresh_states if @status_old != @actor.states
  4781.       flow_states
  4782.   end  
  4783.   
  4784. end

  4785. #==============================================================================
  4786. #==============================================================================
  4787. # ** Battle Hud EX
  4788. #==============================================================================
  4789. #==============================================================================
  4790. class Battle_Hud_EX
  4791.   
  4792.   #--------------------------------------------------------------------------
  4793.   # * Create Face
  4794.   #--------------------------------------------------------------------------   
  4795.   def create_face(viewport)
  4796.       return if !FACE_VISIBLE
  4797.       @face_old_hp = @actor.hp
  4798.       @face_old_mp = @actor.mp
  4799.       @face_old_tp = @actor.tp
  4800.       @face_name = ""
  4801.       @face = Sprite.new
  4802.       @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  4803.       @face.x = @face_org[0]
  4804.       @face.y = @face_org[1]
  4805.       @face.z = HUD_Z + FACE_Z
  4806.       @face.viewport = viewport
  4807.       @face.opacity = 0
  4808.       refresh_face_name
  4809.   end

  4810.   #--------------------------------------------------------------------------
  4811.   # * Refresh Face Name
  4812.   #--------------------------------------------------------------------------      
  4813.   def refresh_face_name      
  4814.       @face_image.dispose if @face_image != nil
  4815.       @face.bitmap.dispose if @face.bitmap != nil
  4816.       return if @actor == nil or @actor.id == nil
  4817.       @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  4818.       @face_image = Bitmap.new(32,32) if @face_image == nil
  4819.       @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  4820.       @face_ch = @face_image.height
  4821.       @face.ox = @face_cw / 2
  4822.       @face.oy = @face_ch / 2      
  4823.       @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  4824.       @face_org = [@hud_position[0] + FACE_POSITION[0],
  4825.                    @hud_position[1] + @face.oy + FACE_POSITION[1]]
  4826.       if $game_temp.battler_face_pos[@actor_index] == nil
  4827.          $game_temp.battler_face_pos[@actor_index] = []
  4828.       end
  4829.       @face.x = @face_org[0]
  4830.       @face.y = @face_org[1]  
  4831.       limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  4832.       fy = @face_org[1]
  4833.       if limit_Y > Graphics.height
  4834.          @face.y = Graphics.height - (@face_image.height - @face.oy)
  4835.          fy = Graphics.height - 16
  4836.          @face_org[1] = @face.y
  4837.       end
  4838.       $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  4839.       $game_temp.battler_face_pos[@actor_index][1] = fy
  4840.       $game_temp.battler_face_pos[@actor_index][2] = @face.z     
  4841.       clear_face_index
  4842.   end

  4843.   #--------------------------------------------------------------------------
  4844.   # * Refresh Face
  4845.   #--------------------------------------------------------------------------  
  4846.   def refresh_face
  4847.       @face.mirror = false
  4848.       @face.zoom_x = 1.00
  4849.       @face.zoom_y = 1.00
  4850.       @face_index = @actor.face_animation[1]
  4851.       @face.bitmap.clear
  4852.       if !FACE_ANIMATION
  4853.          f_scr = Rect.new(0,0,@face_cw,@face_ch)
  4854.       else
  4855.          f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  4856.       end
  4857.       @face.bitmap.blt(0,0,@face_image,f_scr)
  4858.   end
  4859.    
  4860.   #--------------------------------------------------------------------------
  4861.   # * Update Face Duration
  4862.   #--------------------------------------------------------------------------   
  4863.   def update_face_duration
  4864.       return if @actor.face_animation[0] == 0
  4865.       @actor.face_animation[0] -= 1
  4866.       update_face_shake_effect
  4867.       update_face_zoom if @actor.face_animation[1] == 2
  4868.       return if @actor.face_animation[0] > 0
  4869.       clear_face_index
  4870.   end
  4871.   
  4872.   #--------------------------------------------------------------------------
  4873.   # * Clear Face Index
  4874.   #--------------------------------------------------------------------------      
  4875.   def clear_face_index
  4876.       @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  4877.       @actor.face_animation[1] = 4 if @actor.dead?
  4878.       refresh_face
  4879.   end
  4880.       
  4881.   #--------------------------------------------------------------------------
  4882.   # * Update Face Zoom
  4883.   #--------------------------------------------------------------------------      
  4884.   def update_face_zoom
  4885.       return if !FACE_ZOOM_ANIMATION
  4886.       case @actor.face_animation[0]
  4887.          when 30..60
  4888.             @face.zoom_x += 0.01
  4889.             @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  4890.             @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  4891.          when 1..29
  4892.             @face.zoom_x -= 0.01
  4893.             @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  4894.             @face.mirror = false
  4895.          else
  4896.             @face.zoom_x = 1.00
  4897.             @face.mirror = false
  4898.       end
  4899.       @face.zoom_y = @face.zoom_x
  4900.   end
  4901.   
  4902.   #--------------------------------------------------------------------------
  4903.   # * Can Refresh Index MP TP?
  4904.   #--------------------------------------------------------------------------     
  4905.   def can_refresh_index_mp_tp?
  4906.       return true if @face_old_mp != @actor.mp
  4907.       return false
  4908.   end
  4909.   
  4910.   #--------------------------------------------------------------------------
  4911.   # * Refresh Face Index HP
  4912.   #--------------------------------------------------------------------------  
  4913.   def refresh_face_index_hp
  4914.       @actor.face_animation[0] = FACE_ANIMATION_DURATION
  4915.       @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  4916.       @face_old_hp = @actor.hp
  4917.   end
  4918.   
  4919.   #--------------------------------------------------------------------------
  4920.   # * Refresh Face Index MP TP
  4921.   #--------------------------------------------------------------------------  
  4922.   def refresh_face_index_mp_tp
  4923.       if @face_old_mp < @actor.mp
  4924.          @actor.face_animation[0] = FACE_ANIMATION_DURATION
  4925.          @actor.face_animation[1] = 1
  4926.       end
  4927.       @face_old_mp = @actor.mp
  4928.       @face_old_tp = @actor.tp
  4929.   end  
  4930.   
  4931.   #--------------------------------------------------------------------------
  4932.   # * Update Face Shake Effect
  4933.   #--------------------------------------------------------------------------  
  4934.   def update_face_shake_effect
  4935.       return if !FACE_SHAKE_EFFECT
  4936.       if FACE_ANIMATION
  4937.          update_shake_animated_face
  4938.       else            
  4939.          update_shake_still_face
  4940.       end  
  4941.   end      

  4942.   #--------------------------------------------------------------------------
  4943.   # * Update Shake Still Effect Face
  4944.   #--------------------------------------------------------------------------   
  4945.   def update_shake_still_face
  4946.       if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  4947.          @face.x = @face_org[0] - 4 + rand(8)
  4948.       else
  4949.          @face.x = @face_org[0]
  4950.       end     
  4951.   end
  4952.       
  4953.   #--------------------------------------------------------------------------
  4954.   # * Update Shake Animated Face
  4955.   #--------------------------------------------------------------------------   
  4956.   def update_shake_animated_face
  4957.       if @actor.face_animation[0] == 0
  4958.          @face.x = @face_org[0]
  4959.          return
  4960.       end
  4961.       if @actor.face_animation[1] == 3 and @actor.hp > 0
  4962.          @face.x = @face_org[0] - 4 + rand(8)
  4963.       else
  4964.          @face.x = @face_org[0]
  4965.       end         
  4966.   end
  4967.   
  4968.   #--------------------------------------------------------------------------
  4969.   # * Update Face
  4970.   #--------------------------------------------------------------------------   
  4971.   def update_face
  4972.       return if @face == nil
  4973.       sprite_visible(@face)
  4974.       refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  4975.       update_face_duration
  4976.       return if !FACE_ANIMATION
  4977.       refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  4978.       refresh_face_index_hp if @face_old_hp != @actor.hp
  4979.       refresh_face if @face_index != @actor.face_animation[1]
  4980.   end  
  4981.   
  4982. end

  4983. #==============================================================================
  4984. # ■ Battle Manager
  4985. #==============================================================================
  4986. class << BattleManager
  4987.   
  4988.   #--------------------------------------------------------------------------
  4989.   # ● Battle End
  4990.   #--------------------------------------------------------------------------                    
  4991.   alias mog_battle_hud_battle_process_victory process_victory
  4992.   def process_victory
  4993.       execute_face_effect_end
  4994.       mog_battle_hud_battle_process_victory
  4995.   end
  4996.   
  4997.   #--------------------------------------------------------------------------
  4998.   # ● Execute Face Effect End
  4999.   #--------------------------------------------------------------------------                  
  5000.   def execute_face_effect_end
  5001.       $game_temp.battle_end = true
  5002.       for i in $game_party.members
  5003.           i.face_animation = [120,1,0] if i.hp > 0   
  5004.       end  
  5005.   end
  5006.   
  5007.   #--------------------------------------------------------------------------
  5008.   # * Display EXP Earned
  5009.   #--------------------------------------------------------------------------
  5010.   alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5011.   def process_defeat
  5012.       $game_temp.battle_end = true
  5013.       mog_battle_hud_ex_message_battle_process_defeat
  5014.   end
  5015.   
  5016.   #--------------------------------------------------------------------------
  5017.   # * Process Abort
  5018.   #--------------------------------------------------------------------------
  5019.   alias mog_battle_hud_ex_process_abort process_abort
  5020.   def process_abort
  5021.       $game_temp.battle_end = true
  5022.       mog_battle_hud_ex_process_abort
  5023.   end  
  5024.   
  5025. end

  5026. #==============================================================================
  5027. # ** Scene Battle
  5028. #==============================================================================
  5029. class Scene_Battle < Scene_Base

  5030.   #--------------------------------------------------------------------------
  5031.   # * Use Item
  5032.   #--------------------------------------------------------------------------      
  5033.   alias mog_monogatari_use_item use_item
  5034.   def use_item
  5035.       execute_face_animation
  5036.       mog_monogatari_use_item
  5037.   end

  5038.   #--------------------------------------------------------------------------
  5039.   # * Execute Face Animation
  5040.   #--------------------------------------------------------------------------  
  5041.   def execute_face_animation
  5042.       return if @subject.is_a?(Game_Enemy)
  5043.       @subject.face_animation = [60 ,2,0]   
  5044.   end
  5045.    
  5046. end

  5047. #==============================================================================
  5048. #==============================================================================
  5049. # ** Battle Hud EX
  5050. #==============================================================================
  5051. #==============================================================================
  5052. class Battle_Hud_EX

  5053.   #--------------------------------------------------------------------------
  5054.   # * Dispose
  5055.   #--------------------------------------------------------------------------  
  5056.   def dispose
  5057.       terminate
  5058.       dispose_layout
  5059.       dispose_layout_2
  5060.       dispose_name
  5061.       dispose_face
  5062.       dispose_hp_number
  5063.       dispose_hp_number_max
  5064.       dispose_hp_meter
  5065.       dispose_hp_icon
  5066.       dispose_hp_icon_ex
  5067.       dispose_hp_icon_number
  5068.       dispose_mp_number
  5069.       dispose_mp_number_max
  5070.       dispose_mp_meter
  5071.       dispose_mp_icon
  5072.       dispose_mp_icon_ex
  5073.       dispose_mp_icon_number
  5074.       dispose_tp_number
  5075.       dispose_tp_number_max
  5076.       dispose_tp_meter
  5077.       dispose_tp_icon
  5078.       dispose_tp_icon_ex
  5079.       dispose_tp_icon_number
  5080.       dispose_at_number
  5081.       dispose_at_number_max
  5082.       dispose_at_meter      
  5083.       dispose_lv_number
  5084.       dispose_states
  5085.   end
  5086.   
  5087.   #--------------------------------------------------------------------------
  5088.   # * Dispose Layout
  5089.   #--------------------------------------------------------------------------  
  5090.   def dispose_layout
  5091.       return if @layout == nil
  5092.       @layout.dispose
  5093.       @layout = nil
  5094.   end
  5095.   
  5096.   #--------------------------------------------------------------------------
  5097.   # * Dispose Layout 2
  5098.   #--------------------------------------------------------------------------  
  5099.   def dispose_layout_2
  5100.       return if @layout2 == nil
  5101.       @layout2.dispose
  5102.       @layout2 = nil
  5103.   end  
  5104.   
  5105.   #--------------------------------------------------------------------------
  5106.   # * Dispose Name
  5107.   #--------------------------------------------------------------------------         
  5108.   def dispose_name
  5109.       return if @name == nil
  5110.       @name.bitmap.dispose
  5111.       @name.dispose
  5112.       @name = nil
  5113.   end  
  5114.   
  5115.   #--------------------------------------------------------------------------
  5116.   # * Dispose Face
  5117.   #--------------------------------------------------------------------------        
  5118.   def dispose_face
  5119.       return if @face == nil      
  5120.       @face.bitmap.dispose if @face.bitmap != nil   
  5121.       @face.dispose
  5122.       @face = nil
  5123.       @face_image.dispose if @face_image != nil
  5124.   end  
  5125.   
  5126.   #--------------------------------------------------------------------------
  5127.   # * Dispose HP Number
  5128.   #--------------------------------------------------------------------------   
  5129.   def dispose_hp_number
  5130.       return if @hp_number == nil
  5131.       @hp_number.bitmap.dispose
  5132.       @hp_number.dispose
  5133.       @hp_number = nil
  5134.   end

  5135.   #--------------------------------------------------------------------------
  5136.   # * Dispose HP Number Max
  5137.   #--------------------------------------------------------------------------   
  5138.   def dispose_hp_number_max
  5139.       return if @hp_number2 == nil
  5140.       @hp_number2.bitmap.dispose
  5141.       @hp_number2.dispose
  5142.       @hp_number2 = nil
  5143.   end   
  5144.   
  5145.   #--------------------------------------------------------------------------
  5146.   # * Dispose HP Meter
  5147.   #--------------------------------------------------------------------------     
  5148.   def dispose_hp_meter
  5149.       return if @hp_meter == nil
  5150.       @hp_meter.bitmap.dispose
  5151.       @hp_meter.dispose
  5152.       @hp_meter = nil
  5153.   end   
  5154.   
  5155.   #--------------------------------------------------------------------------
  5156.   # * Dispose HP Icon
  5157.   #--------------------------------------------------------------------------      
  5158.   def dispose_hp_icon
  5159.       return if @hp_icon == nil
  5160.       @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5161.       @hp_icon.dispose
  5162.       @hp_icon = nil
  5163.   end   
  5164.   
  5165.   #--------------------------------------------------------------------------
  5166.   # * Dispose HP Icon EX
  5167.   #--------------------------------------------------------------------------      
  5168.   def dispose_hp_icon_ex
  5169.       return if @hp_icon3 == nil
  5170.       @hp_icon3.bitmap.dispose
  5171.       @hp_icon3.dispose
  5172.       @hp_icon3 = nil
  5173.   end      
  5174.   
  5175.   #--------------------------------------------------------------------------
  5176.   # * Dispose HP Icon Number
  5177.   #--------------------------------------------------------------------------  
  5178.   def dispose_hp_icon_number
  5179.       return if @hp_icon_number == nil
  5180.       @hp_icon_number.bitmap.dispose
  5181.       @hp_icon_number.dispose
  5182.       @hp_icon_number = nil
  5183.   end   
  5184.   
  5185.   #--------------------------------------------------------------------------
  5186.   # * Dispose MP Number
  5187.   #--------------------------------------------------------------------------   
  5188.   def dispose_mp_number
  5189.       return if @mp_number == nil
  5190.       @mp_number.bitmap.dispose
  5191.       @mp_number.dispose
  5192.       @mp_number = nil
  5193.   end   
  5194.   
  5195.   #--------------------------------------------------------------------------
  5196.   # * Dispose MP Number Max
  5197.   #--------------------------------------------------------------------------   
  5198.   def dispose_mp_number_max
  5199.       return if @mp_number2 == nil
  5200.       @mp_number2.bitmap.dispose
  5201.       @mp_number2.dispose
  5202.       @mp_number2 = nil
  5203.   end   
  5204.   
  5205.   #--------------------------------------------------------------------------
  5206.   # * Dispose MP Meter
  5207.   #--------------------------------------------------------------------------     
  5208.   def dispose_mp_meter
  5209.       return if @mp_meter == nil
  5210.       @mp_meter.bitmap.dispose
  5211.       @mp_meter.dispose
  5212.       @mp_meter = nil
  5213.   end     
  5214.   
  5215.   #--------------------------------------------------------------------------
  5216.   # * Dispose MP Icon
  5217.   #--------------------------------------------------------------------------      
  5218.   def dispose_mp_icon
  5219.       return if @mp_icon == nil
  5220.       @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5221.       @mp_icon.dispose
  5222.       @mp_icon = nil
  5223.   end     
  5224.   
  5225.   #--------------------------------------------------------------------------
  5226.   # * Dispose MP Icon EX
  5227.   #--------------------------------------------------------------------------      
  5228.   def dispose_mp_icon_ex
  5229.       return if @mp_icon3 == nil
  5230.       @mp_icon3.bitmap.dispose
  5231.       @mp_icon3.dispose
  5232.       @mp_icon3 = nil
  5233.   end        
  5234.   
  5235.   #--------------------------------------------------------------------------
  5236.   # * Dispose MP Icon Number
  5237.   #--------------------------------------------------------------------------  
  5238.   def dispose_mp_icon_number
  5239.       return if @mp_icon_number == nil
  5240.       @mp_icon_number.bitmap.dispose
  5241.       @mp_icon_number.dispose
  5242.       @mp_icon_number = nil
  5243.   end   
  5244.    
  5245.   #--------------------------------------------------------------------------
  5246.   # * Dispose TP Number
  5247.   #--------------------------------------------------------------------------   
  5248.   def dispose_tp_number
  5249.       return if @tp_number == nil
  5250.       @tp_number.bitmap.dispose
  5251.       @tp_number.dispose
  5252.       @tp_number = nil
  5253.   end
  5254.   
  5255.   #--------------------------------------------------------------------------
  5256.   # * Dispose TP Number Max
  5257.   #--------------------------------------------------------------------------   
  5258.   def dispose_tp_number_max
  5259.       return if @tp_number2 == nil
  5260.       @tp_number2.bitmap.dispose
  5261.       @tp_number2.dispose
  5262.       @tp_number2 = nil
  5263.   end  
  5264.   
  5265.   #--------------------------------------------------------------------------
  5266.   # * Dispose TP Meter
  5267.   #--------------------------------------------------------------------------     
  5268.   def dispose_tp_meter
  5269.       return if @tp_meter == nil
  5270.       @tp_meter.bitmap.dispose
  5271.       @tp_meter.dispose
  5272.       @tp_meter = nil
  5273.   end     
  5274.   
  5275.   #--------------------------------------------------------------------------
  5276.   # * Dispose TP Icon
  5277.   #--------------------------------------------------------------------------      
  5278.   def dispose_tp_icon
  5279.       return if @tp_icon == nil
  5280.       @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5281.       @tp_icon.dispose
  5282.       @tp_icon = nil
  5283.   end   
  5284.   
  5285.   #--------------------------------------------------------------------------
  5286.   # * Dispose TP Icon EX
  5287.   #--------------------------------------------------------------------------      
  5288.   def dispose_tp_icon_ex
  5289.       return if @tp_icon3 == nil
  5290.       @tp_icon3.bitmap.dispose
  5291.       @tp_icon3.dispose
  5292.       @tp_icon3 = nil
  5293.   end   
  5294.   
  5295.   #--------------------------------------------------------------------------
  5296.   # * Dispose TP Icon Number
  5297.   #--------------------------------------------------------------------------  
  5298.   def dispose_tp_icon_number
  5299.       return if @tp_icon_number == nil
  5300.       @tp_icon_number.bitmap.dispose
  5301.       @tp_icon_number.dispose
  5302.       @tp_icon_numbe = nil
  5303.   end     
  5304.   
  5305.   #--------------------------------------------------------------------------
  5306.   # * Dispose AT Number
  5307.   #--------------------------------------------------------------------------   
  5308.   def dispose_at_number
  5309.       return if @at_number == nil
  5310.       @at_number.bitmap.dispose
  5311.       @at_number.dispose
  5312.       @at_number = nil
  5313.   end

  5314.   #--------------------------------------------------------------------------
  5315.   # * Dispose AT Number Max
  5316.   #--------------------------------------------------------------------------   
  5317.   def dispose_at_number_max
  5318.       return if @at_number2 == nil
  5319.       @at_number2.bitmap.dispose
  5320.       @at_number2.dispose
  5321.       @at_number2 = nil
  5322.   end   
  5323.   
  5324.   #--------------------------------------------------------------------------
  5325.   # * Dispose AT Meter
  5326.   #--------------------------------------------------------------------------     
  5327.   def dispose_at_meter
  5328.       return if @at_meter == nil
  5329.       @at_meter.bitmap.dispose
  5330.       @at_meter.dispose
  5331.       @at_meter = nil
  5332.   end     
  5333.   
  5334.   #--------------------------------------------------------------------------
  5335.   # * Dispose Lv Number
  5336.   #--------------------------------------------------------------------------   
  5337.   def dispose_lv_number
  5338.       return if @lv_number == nil
  5339.       @lv_number.bitmap.dispose
  5340.       @lv_number.dispose
  5341.       @lv_number = nil
  5342.   end
  5343.   
  5344.   #--------------------------------------------------------------------------
  5345.   # * Dispose States
  5346.   #--------------------------------------------------------------------------      
  5347.   def dispose_states
  5348.       return if @status == nil
  5349.       @status.bitmap.dispose if @status.bitmap != nil
  5350.       @status.dispose
  5351.       @actor_status.dispose if @actor_status != nil
  5352.       @status = nil
  5353.   end
  5354.   
  5355. end

  5356. #==============================================================================
  5357. #==============================================================================
  5358. # ** Battle Hud EX
  5359. #==============================================================================
  5360. #==============================================================================
  5361. class Battle_Hud_EX

  5362. #--------------------------------------------------------------------------
  5363. # * Refresh Visible
  5364. #--------------------------------------------------------------------------  
  5365. def refresh_visible(vis)
  5366.      @layout.visible = vis if @layout
  5367.      @layout2.visible = vis if @layout2
  5368.      @name.visible = vis if @name
  5369.      @lv_number.visible = vis if @lv_number
  5370.      @status.visible = vis if @status
  5371.      @face.visible = vis if @face     
  5372.      @hp_number.visible = vis if @hp_number
  5373.      @hp_number2.visible = vis if @hp_number2
  5374.      @hp_meter.visible = vis if @hp_meter
  5375.      @hp_icon.visible = vis if @hp_icon
  5376.      @hp_icon3.visible = vis if @hp_icon3
  5377.      @hp_icon_number.visible = vis if @hp_icon_number     
  5378.      @mp_number.visible = vis if @mp_number
  5379.      @mp_number2.visible = vis if @mp_number2
  5380.      @mp_meter.visible = vis if @mp_meter
  5381.      @mp_icon.visible = vis if @mp_icon
  5382.      @mp_icon3.visible = vis if @mp_icon3
  5383.      @mp_icon_number.visible = vis if @mp_icon_number
  5384.      @tp_number.visible = vis if @tp_number
  5385.      @tp_number2.visible = vis if @tp_number2
  5386.      @tp_meter.visible = vis if @tp_meter
  5387.      @tp_icon.visible = vis if @tp_icon
  5388.      @tp_icon3.visible = vis if @tp_icon3
  5389.      @tp_icon_number.visible = vis if @tp_icon_number      
  5390.      @at_number.visible = vis if @at_number
  5391.      @at_number2.visible = vis if @at_number2
  5392.      @at_meter.visible = vis if @at_meter   
  5393.   end  
  5394.   
  5395.   #--------------------------------------------------------------------------
  5396.   # * Update
  5397.   #--------------------------------------------------------------------------  
  5398.   def update
  5399.       return if @actor == nil
  5400.       @sprite_visible = sprite_visible?
  5401.       @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5402.       update_layout ; update_layout_2 ; update_name
  5403.       update_face ; update_hp ; update_mp ; update_tp
  5404.       update_at ; update_level ; update_states
  5405.   end
  5406.   
  5407. end

  5408. #==============================================================================
  5409. # ■ Sprite Battler
  5410. #==============================================================================
  5411. class Sprite_Battler < Sprite_Base

  5412.   #--------------------------------------------------------------------------
  5413.   # ● Set AV
  5414.   #--------------------------------------------------------------------------      
  5415.   def set_av(a_viewport)
  5416.       @viewport_cm = a_viewport
  5417.   end
  5418.   
  5419.   #--------------------------------------------------------------------------
  5420.   # ● Dispose
  5421.   #--------------------------------------------------------------------------      
  5422.   alias mog_bc_dispose dispose
  5423.   def dispose
  5424.       mog_bc_dispose
  5425.       @viewport_cm.dispose if @viewport_cm != nil
  5426.   end
  5427.   
  5428.   #--------------------------------------------------------------------------
  5429.   # ● Maker Animation Sprites
  5430.   #--------------------------------------------------------------------------      
  5431.   alias mog_bc_make_animation_sprites make_animation_sprites
  5432.   def make_animation_sprites
  5433.       mog_bc_make_animation_sprites
  5434.       set_cm_viewport if $imported[:mog_battle_camera]
  5435.   end
  5436.   
  5437.   #--------------------------------------------------------------------------
  5438.   # ● Set CM Viewpor
  5439.   #--------------------------------------------------------------------------      
  5440.   def set_cm_viewport
  5441.       return if @viewport_cm == nil
  5442.       return if @ani_sprites == nil
  5443.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  5444.          @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  5445.          return
  5446.       end
  5447.       @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  5448.   end
  5449.    
  5450. end

  5451. #==============================================================================
  5452. # ■ Game Temp
  5453. #==============================================================================
  5454. class Spriteset_Battle
  5455.   
  5456.   #--------------------------------------------------------------------------
  5457.   # ● Initialize
  5458.   #--------------------------------------------------------------------------      
  5459.   alias mog_bc_sp_initialize initialize
  5460.   def initialize
  5461.       mog_bc_sp_initialize
  5462.       if $imported[:mog_battle_camera] and @viewport_cm != nil
  5463.          battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  5464.       end
  5465.   end

  5466.   #--------------------------------------------------------------------------
  5467.   # ● Create Viewports
  5468.   #--------------------------------------------------------------------------      
  5469.   alias mog_bc_create_viewports create_viewports
  5470.   def create_viewports
  5471.       mog_bc_create_viewports
  5472.       if $imported[:mog_battle_camera]
  5473.          @viewport_cm = Viewport.new
  5474.          @viewport_cm.z = 100
  5475.       end   
  5476.   end
  5477.   
  5478.   #--------------------------------------------------------------------------
  5479.   # ● Dispose Viewports
  5480.   #--------------------------------------------------------------------------      
  5481.   alias mog_bc_dispose_viewports dispose_viewports
  5482.   def dispose_viewports
  5483.       mog_bc_dispose_viewports
  5484.       @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  5485.   end
  5486.   
  5487.   #--------------------------------------------------------------------------
  5488.   # ● Update Viewports
  5489.   #--------------------------------------------------------------------------      
  5490.   alias mog_bcf_update_viewports update_viewports
  5491.   def update_viewports
  5492.       mog_bcf_update_viewports
  5493.       update_viewport_cm if $imported[:mog_battle_camera]
  5494.   end

  5495.   #--------------------------------------------------------------------------
  5496.   # ● Update Viewport CM
  5497.   #--------------------------------------------------------------------------      
  5498.   def update_viewport_cm
  5499.       return if @viewport_cm == nil  
  5500.       @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  5501.       @viewport_cm.oy = $game_temp.bc_data[1]
  5502.       @viewport_cm.update
  5503.   end
  5504.    
  5505. end
复制代码



















梦石
0
星屑
4881
在线时间
425 小时
注册时间
2019-10-22
回帖
647
 楼主| 发表于 2019-11-1 00:56:46 | 显示全部楼层
已经自己找到解决办法
直接修改 Spriteset_Battle 即可


  1.   #--------------------------------------------------------------------------
  2.   # ● 获取战场背景(地面)的位图
  3.   #--------------------------------------------------------------------------
  4.   def battleback1_bitmap
  5.     #if battleback1_name
  6.     #  Cache.battleback1(battleback1_name)
  7.     #else
  8.     #  create_blurry_background_bitmap
  9.     #end
  10.     if SceneManager.background_bitmap != nil
  11.       create_blurry_background_bitmap
  12.     else
  13.       Cache.battleback1(battleback1_name)
  14.     end
  15.   end
  16.   
  17.   #--------------------------------------------------------------------------
  18.   # ● 生成由地图画面加工而来的战场背景
  19.   #--------------------------------------------------------------------------
  20.   def create_blurry_background_bitmap
  21.     source = SceneManager.background_bitmap
  22.     bitmap = Bitmap.new(768, 512)
  23.     bitmap.stretch_blt(bitmap.rect, source, source.rect)
  24.     #bitmap.radial_blur(120, 16)
  25.     bitmap
  26.   end
复制代码


注释部分就是修改过的  

麻烦版主帮忙退回悬赏

评分

参与人数 1赞 +1 收起 理由
白嫩白嫩的 + 1 塞糖

查看全部评分

















回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部