设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 306|回复: 4
打印 上一主题 下一主题

[有事请教] 关于我弄到了个脚本却不会用这档事

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1422
在线时间
245 小时
注册时间
2019-1-18
帖子
190
跳转到指定楼层
1
发表于 2024-1-28 00:02:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
200星屑
如题,我从某处获得了一个可以按状态和血量控制角色立绘的脚本,但这个脚本貌似只能对队伍里的第一个角色生效,我捣鼓了一晚上都没搞懂到底能不能对全体队友生效,就是做出用一组变量控制角色切换不同的立绘,本人对rgss3的脚本也是一知半解,根本不知道该怎么操作,有无大佬能救救萌新
附上脚本:
RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  6. #==============================================================================
  7. #
  8. # Coloque as imagens da hud na pasta.
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # Para ocultar ou apresentar a hud de batalha use o código abaixo.
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # ou
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # Para mudar o sprite da face do battler use o código abaixo.
  22. #==============================================================================
  23. #
  24. # battler_face_name( ACTOR_ID, FIlE_NAME )
  25. #
  26. #==============================================================================
  27.  
  28. #==============================================================================
  29. # Atualizações desta versão.
  30. #==============================================================================
  31. # (ver 6.6)
  32. #      - Correção do Crash caso optar por desativar o layout das janelas.
  33. # (ver 6.5)
  34. #      - Melhoria no cálculo da posição Z.
  35. #      - Correção de travar o menu.
  36. # (ver 6.4)
  37. #      - Correção do glitch de aparecer um pedaço da Windowskin quando se
  38. #        usa mais de 4 battlers na batalha.
  39. # (ver 6.3)
  40. #      - Compatibilidade com o MOG Battle Camera.
  41. # (ver 6.2)
  42. #     - Refresh da hud ao trocar a posição dos personagens.
  43. # (ver 6.0)
  44. #     - Adição da camada da tela.
  45. #     - Adição do efeito Slide.
  46. #     - Adição de novas opções referente a fonte.
  47. #==============================================================================
  48.  
  49. $imported = {} if $imported.nil?
  50. $imported[:mog_battle_hud_ex] = true
  51.  
  52. module MOG_BATTLE_HUD_EX  
  53.  
  54.   #============================================================================
  55.   #============================================================================
  56.   # * HUD SPRITE (GENERAL)
  57.   #============================================================================
  58.   # Definição da quantidade maxima de personagens na batalha.
  59.   #---------------------------------------------------------------------------
  60.   MAX_BATTLE_MEMBERS = 3
  61.   #---------------------------------------------------------------------------
  62.   # Definição da prioridade da hud.
  63.   #---------------------------------------------------------------------------
  64.   HUD_Z = 110 #110
  65.   #---------------------------------------------------------------------------
  66.   # Definição da posição geral da hud, influência em todos os sprites da hud.
  67.   #---------------------------------------------------------------------------
  68.   HUD_POSITION = [-100,310]
  69.   #---------------------------------------------------------------------------
  70.   # Definição do espaço entre os membros do grupo.
  71.   # (Use apenas para ajustes)
  72.   #---------------------------------------------------------------------------
  73.   MEMBERS_SPACE = [-24,0]
  74.   #---------------------------------------------------------------------------
  75.   # Definição fixa da hud se deseja posicionar a hud em lugares
  76.   # específicos da tela.
  77.   #
  78.   # FIXED_POSITION[INDEX_ID] = [X,Y]
  79.   #
  80.   #---------------------------------------------------------------------------
  81.   FIXED_HUD_POSITION = []
  82.   # FIXED_HUD_POSITION[0] = [10,50]
  83.   # FIXED_HUD_POSITION[1] = [440,50]
  84.   # FIXED_HUD_POSITION[2] = [10,330]
  85.   # FIXED_HUD_POSITION[3] = [440,330]
  86.   #---------------------------------------------------------------------------
  87.   # Definição da posição do comando quando a opção de janelas fixa é ativada.
  88.   #---------------------------------------------------------------------------
  89.   FIXED_COMMAND_POSITION = []
  90.    FIXED_COMMAND_POSITION[0] = [10,350]
  91.   # FIXED_COMMAND_POSITION[1] = [300,10]
  92.   # FIXED_COMMAND_POSITION[2] = [130,290]
  93.   # FIXED_COMMAND_POSITION[3] = [300,290]
  94.   #---------------------------------------------------------------------------
  95.   # Ocultar a HUD quando a janela de mensagem está ativa.
  96.   #---------------------------------------------------------------------------
  97.   MESSAGE_WINDOW_FADE_HUD = false
  98.   #---------------------------------------------------------------------------
  99.   # Definição da posição da janela de mensagem.
  100.   #---------------------------------------------------------------------------
  101.   # 0 - Acima
  102.   # 1 - Centro
  103.   # 2 - Abaixo
  104.   #---------------------------------------------------------------------------
  105.   BATTLE_MESSAGE_POSITION = 2  
  106.   #---------------------------------------------------------------------------
  107.   # Definição da porcentagem do parâmetro baixo, isso influência na cor
  108.   # do número dos parâmetros de HP, MP e TP.
  109.   #---------------------------------------------------------------------------
  110.   LOW_PARAMETER_PERCENTAGE = 30
  111.   #============================================================================
  112.   #============================================================================
  113.  
  114.  
  115.   #============================================================================
  116.   #============================================================================
  117.   # * NAME
  118.   #============================================================================
  119.   # Ativar o Sprite do nome do personagem.
  120.   #---------------------------------------------------------------------------
  121.   NAME_VISIBLE = false
  122.   #---------------------------------------------------------------------------
  123.   # Definição da prioridade do Sprite.
  124.   #---------------------------------------------------------------------------  
  125.   NAME_Z = 5
  126.   #---------------------------------------------------------------------------
  127.   # Definição da posição da Face. [X,Y]
  128.   #---------------------------------------------------------------------------
  129.   NAME_POSITION = [-40,103]
  130.   #---------------------------------------------------------------------------
  131.   # Definição do tipo alinhamento do nome.
  132.   #
  133.   # 0 - Esquerda
  134.   # 1 - Centro
  135.   # 2 - Direita
  136.   #---------------------------------------------------------------------------  
  137.   NAME_ALIGN_TYPE = 1
  138.   #---------------------------------------------------------------------------
  139.   # Definição do nome da fonte.
  140.   #---------------------------------------------------------------------------
  141.   NAME_FONT_NAME = "Lolita"
  142.   #---------------------------------------------------------------------------
  143.   # Definição do tamanho da fonte.
  144.   #---------------------------------------------------------------------------   
  145.   NAME_FONT_SIZE = 16
  146.   #---------------------------------------------------------------------------
  147.   # Ativar Bold.
  148.   #---------------------------------------------------------------------------   
  149.   NAME_FONT_BOLD = true
  150.   #---------------------------------------------------------------------------
  151.   # Ativar Italic.
  152.   #---------------------------------------------------------------------------   
  153.   NAME_FONT_ITALIC = true
  154.   #---------------------------------------------------------------------------
  155.   # Definição da cor da fonte
  156.   #---------------------------------------------------------------------------     
  157.   NAME_FONT_COLOR = Color.new(255,255,255,255)
  158.   #---------------------------------------------------------------------------
  159.   # Ativar Sombra
  160.   #---------------------------------------------------------------------------  
  161.   NAME_FONT_SHADOW = false
  162.   #---------------------------------------------------------------------------
  163.   # Definição da cor da sombra
  164.   #---------------------------------------------------------------------------   
  165.   NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  166.   #---------------------------------------------------------------------------
  167.   # Definição da distância da sombra.
  168.   #---------------------------------------------------------------------------   
  169.   NAME_FONT_SHADOW_POSITION = [2,2]  
  170.   #============================================================================
  171.   #============================================================================
  172.  
  173.  
  174.   #============================================================================
  175.   #============================================================================
  176.   # * FACE
  177.   #============================================================================
  178.   # Ativar a face.
  179.   # Será necessário o arquivo.
  180.   #
  181.   # ACTOR_NAME + _Face.png
  182.   #
  183.   # Eric_Face.png
  184.   #
  185.   #---------------------------------------------------------------------------
  186.   FACE_VISIBLE = true
  187.   # Ativar as Faces representando os battlers.
  188.   # Deixe "false" se tiver problemas de compatibilidade com scripts.
  189.   FACE_BATTLER = true
  190.   #---------------------------------------------------------------------------
  191.   # Definição da prioridade do sprite.
  192.   #---------------------------------------------------------------------------  
  193.   FACE_Z = -1 # 100
  194.   #---------------------------------------------------------------------------
  195.   # Definição da posição da Face. [X,Y]
  196.   #---------------------------------------------------------------------------
  197.   FACE_POSITION = [350,0] #[330,0]
  198.   #---------------------------------------------------------------------------
  199.   # Ativar faces animadas.
  200.   # Será necessário ter uma imagem de 4 faces do personagem no mesmo arquivo.
  201.   #
  202.   # FACE1/FACE2/FACE3/FACE4
  203.   #
  204.   # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  205.   # a imagem será dividida por 1 frame
  206.   #---------------------------------------------------------------------------  
  207.   FACE_ANIMATION = true
  208.   #---------------------------------------------------------------------------
  209.   # Ativar o efeito de Zoom quando o personagem usar alguma ação.
  210.   #---------------------------------------------------------------------------
  211.   FACE_ZOOM_ANIMATION = false
  212.   #---------------------------------------------------------------------------
  213.   # Ativar o efeito Mirror na animação de ação do personagem.
  214.   #---------------------------------------------------------------------------
  215.   FACE_ZOOM_MIRROR_EFFECT = false
  216.   #---------------------------------------------------------------------------
  217.   # Definição do tempo duração da animação da face.
  218.   #---------------------------------------------------------------------------  
  219.   FACE_ANIMATION_DURATION = 40
  220.   #---------------------------------------------------------------------------
  221.   # Ativar o efeito tremor da face quando o personagem sofrer dano.
  222.   #---------------------------------------------------------------------------  
  223.   FACE_SHAKE_EFFECT = true
  224.   #============================================================================
  225.   #============================================================================
  226.  
  227.   #============================================================================
  228.   #============================================================================
  229.   # * TURN (ACTIVE INDICATOR)
  230.   #============================================================================
  231.   # Ativar o indicador de turno do personagem.
  232.   # Será necessário o arquivo.
  233.   #
  234.   # Turn.png
  235.   #
  236.   #---------------------------------------------------------------------------
  237.   TURN_SPRITE_VISIBLE = false
  238.   #---------------------------------------------------------------------------
  239.   # Definição da prioridade do Sprite.
  240.   #---------------------------------------------------------------------------   
  241.   TURN_SPRITE_Z = 0
  242.   #---------------------------------------------------------------------------
  243.   # Definição da posição do sprite de turno.
  244.   #---------------------------------------------------------------------------  
  245.   TURN_SPRITE_POSITION = [-5,-47]
  246.   #---------------------------------------------------------------------------  
  247.   # Ativar o efeito de animação de piscar.
  248.   #---------------------------------------------------------------------------  
  249.   TURN_BLINK_EFFECT = true
  250.   #---------------------------------------------------------------------------  
  251.  
  252.   #============================================================================
  253.   #============================================================================
  254.   # * HP
  255.   #============================================================================
  256.   # Ativar o número de HP.
  257.   # Será necessário o arquivo.
  258.   #
  259.   # HP_Number.png
  260.   #
  261.   #---------------------------------------------------------------------------
  262.   HP_NUMBER_VISIBLE = true
  263.   #---------------------------------------------------------------------------
  264.   # Definição da prioridade do Sprite.
  265.   #---------------------------------------------------------------------------   
  266.   HP_NUMBER_Z = 2
  267.   #---------------------------------------------------------------------------
  268.   # Definição da posição do número de HP. [X,Y]
  269.   #---------------------------------------------------------------------------  
  270.   HP_NUMBER_POSITION = [114,21] #[110,17]
  271.   #---------------------------------------------------------------------------  
  272.   # Ativar o número de HP Total.
  273.   # Será necessário o arquivo.
  274.   #
  275.   # HP_Number_Max.png
  276.   #
  277.   #---------------------------------------------------------------------------
  278.   HP_NUMBER_MAX_VISIBLE = false
  279.   #---------------------------------------------------------------------------
  280.   # Definição da posição do número de HP Total. [X,Y]
  281.   #---------------------------------------------------------------------------  
  282.   HP_NUMBER_MAX_POSITION = [88,64]
  283.   #---------------------------------------------------------------------------
  284.   # Definição do tipo alinhamento do número.
  285.   #
  286.   # 0 - Esquerda
  287.   # 1 - Centro
  288.   # 2 - Direita
  289.   #---------------------------------------------------------------------------  
  290.   HP_NUMBER_ALIGN_TYPE = 1
  291.   #---------------------------------------------------------------------------
  292.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  293.   #---------------------------------------------------------------------------
  294.   HP_NUMBER_WAVE_ALIGN_EFFECT = false
  295.   #---------------------------------------------------------------------------
  296.   # Apresentar os números em porcentagem.
  297.   #---------------------------------------------------------------------------   
  298.   HP_NUMBER_PERCENTAGE = false
  299.   #---------------------------------------------------------------------------
  300.   # Ativar números animados ("Rolantes").
  301.   #---------------------------------------------------------------------------  
  302.   HP_NUMBER_ANIMATION = true
  303.   #---------------------------------------------------------------------------
  304.   # Ativar a cor do HP baixo.
  305.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  306.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  307.   #
  308.   # NORMAL_COLOR
  309.   # LOW_PARAMETER_COLOR
  310.   #
  311.   # Caso definir a função como FALSE a imagem será dividida apenas como
  312.   # 1 frame de altura.
  313.   #---------------------------------------------------------------------------  
  314.   HP_NUMBER_LOW_COLOR = false
  315.   #---------------------------------------------------------------------------
  316.   # Ativar o medidor de HP.
  317.   # Será necessário o arquivo.
  318.   #
  319.   # HP_Meter.png
  320.   #  
  321.   #---------------------------------------------------------------------------  
  322.   HP_METER_VISIBLE = true
  323.   #---------------------------------------------------------------------------
  324.   # Definição da prioridade do sprite.
  325.   #---------------------------------------------------------------------------   
  326.   HP_METER_Z = 3
  327.   #---------------------------------------------------------------------------
  328.   # Definição da posição do medidor de HP. [X,Y]
  329.   #---------------------------------------------------------------------------  
  330.   HP_METER_POSITION = [58,44]
  331.   #---------------------------------------------------------------------------
  332.   # Definição do ângulo do medidor.
  333.   #---------------------------------------------------------------------------  
  334.   HP_METER_ANGLE = 0
  335.   #---------------------------------------------------------------------------
  336.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  337.   # inverso.
  338.   #---------------------------------------------------------------------------  
  339.   HP_METER_MIRROR_EFFECT = false
  340.   #---------------------------------------------------------------------------
  341.   # Ativar o efeito animado de dano no medidor.
  342.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  343.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  344.   #
  345.   # NORMAL_COLOR
  346.   # DAMAGE_COLOR
  347.   #
  348.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  349.   #---------------------------------------------------------------------------  
  350.   HP_METER_REDUCTION_ANIMATION = true
  351.   #---------------------------------------------------------------------------
  352.   # Ativar o efeito animado do "medidor fluindo".
  353.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  354.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  355.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  356.   #---------------------------------------------------------------------------  
  357.   HP_METER_GRADIENT_ANIMATION = false
  358.   #---------------------------------------------------------------------------
  359.   # Ativar HP em ícones.
  360.   # Será necessário ter a imagem.
  361.   #
  362.   # HP_Icon.png
  363.   #
  364.   #---------------------------------------------------------------------------
  365.   HP_ICON_VISIBLE = false
  366.   #---------------------------------------------------------------------------
  367.   # Definição da prioridade do Sprite.
  368.   #---------------------------------------------------------------------------   
  369.   HP_ICON_Z = 1
  370.   #---------------------------------------------------------------------------
  371.   # Posição do ícone de HP.
  372.   #---------------------------------------------------------------------------  
  373.   HP_ICON_POSITION = [200,0]
  374.   #---------------------------------------------------------------------------
  375.   # Ativar o sprite EX do ultimo ícone
  376.   # Será necessário ter a imagem.
  377.   #
  378.   # HP_Icon_EX.png
  379.   #
  380.   #---------------------------------------------------------------------------
  381.   HP_ICON_EX_VISIBLE = false
  382.   #---------------------------------------------------------------------------
  383.   # Posição do ícone Animado.
  384.   #---------------------------------------------------------------------------  
  385.   HP_ICON_EX_POSITION = [0,0]
  386.   #---------------------------------------------------------------------------
  387.   # Ativar o efeito de Zoom do Sprite.
  388.   #---------------------------------------------------------------------------
  389.   HP_ICON_EX_ZOOM_EFFECT = true
  390.   #---------------------------------------------------------------------------
  391.   # Espaço entre os ícones.
  392.   #---------------------------------------------------------------------------   
  393.   HP_ICON_SPACE = [-10,-10]
  394.   #---------------------------------------------------------------------------
  395.   # Definição da quantidade maxima de ícones na horizontal.
  396.   #---------------------------------------------------------------------------  
  397.   HP_ICON_COL_MAX = 10
  398.   #---------------------------------------------------------------------------
  399.   # Definição da quantidade maxima de ícones na vertical.
  400.   #---------------------------------------------------------------------------   
  401.   HP_ICON_ROW_MAX = 2
  402.   #---------------------------------------------------------------------------
  403.   # Ativar o número de HP de ícones.
  404.   # Será necessário ter a imagem.
  405.   #
  406.   # HP_Icon_Number.png
  407.   #
  408.   #---------------------------------------------------------------------------
  409.   HP_ICON_NUMBER_VISIBLE = false
  410.   #---------------------------------------------------------------------------
  411.   # Definição da prioridade do sprite.
  412.   #---------------------------------------------------------------------------
  413.   HP_ICON_NUMBER_Z = 4
  414.   #---------------------------------------------------------------------------
  415.   # Posição do número do ícone
  416.   #---------------------------------------------------------------------------  
  417.   HP_ICON_NUMBER_POSITION = [0,0]
  418.   #---------------------------------------------------------------------------
  419.   # Definição do tipo alinhamento do número.
  420.   #
  421.   # 0 - Esquerda
  422.   # 1 - Centro
  423.   # 2 - Direita
  424.   #---------------------------------------------------------------------------  
  425.   HP_ICON_NUMBER_ALIGN_TYPE = 0   
  426.   #============================================================================
  427.   #============================================================================
  428.  
  429.  
  430.   #============================================================================
  431.   #============================================================================
  432.   # * MP
  433.   #============================================================================
  434.   # Ativar o número de MP.
  435.   # Será necessário o arquivo.
  436.   #
  437.   # MP_Number.png
  438.   #  
  439.   #---------------------------------------------------------------------------  
  440.   MP_NUMBER_VISIBLE = true
  441.   #---------------------------------------------------------------------------
  442.   # Definição da prioridade do Sprite.
  443.   #---------------------------------------------------------------------------   
  444.   MP_NUMBER_Z = 2  
  445.   #---------------------------------------------------------------------------
  446.   # Definição da posição do número de MP. [X,Y]
  447.   #---------------------------------------------------------------------------  
  448.   MP_NUMBER_POSITION = [146,50] #[142,46]
  449.   #---------------------------------------------------------------------------  
  450.   # Ativar o número de MP Total.
  451.   # Será necessário o arquivo.
  452.   #
  453.   # MP_Number_Max.png
  454.   #
  455.   #---------------------------------------------------------------------------
  456.   MP_NUMBER_MAX_VISIBLE = false
  457.   #---------------------------------------------------------------------------
  458.   # Definição da posição do número de MP Total. [X,Y]
  459.   #---------------------------------------------------------------------------  
  460.   MP_NUMBER_MAX_POSITION = [100,48]
  461.   #---------------------------------------------------------------------------
  462.   # Definição do tipo alinhamento do número.
  463.   #
  464.   # 0 - Esquerda
  465.   # 1 - Centro
  466.   # 2 - Direita
  467.   #---------------------------------------------------------------------------  
  468.   MP_NUMBER_ALIGN_TYPE = 1
  469.   #---------------------------------------------------------------------------
  470.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  471.   #---------------------------------------------------------------------------
  472.   MP_NUMBER_WAVE_ALIGN_EFFECT = false   
  473.   #---------------------------------------------------------------------------
  474.   # Apresentar os números em porcentagem.
  475.   #---------------------------------------------------------------------------   
  476.   MP_NUMBER_PERCENTAGE = false
  477.   #---------------------------------------------------------------------------
  478.   # Ativar números animados ("Rolantes").
  479.   #---------------------------------------------------------------------------  
  480.   MP_NUMBER_ANIMATION = true
  481.   #---------------------------------------------------------------------------
  482.   # Ativar a cor do MP baixo.
  483.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  484.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  485.   #
  486.   # NORMAL_COLOR
  487.   # LOW_PARAMETER_COLOR
  488.   #
  489.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  490.   #---------------------------------------------------------------------------  
  491.   MP_NUMBER_LOW_COLOR = false
  492.   #---------------------------------------------------------------------------
  493.   # Ativar o medidor de MP.
  494.   # Será necessário o arquivo.
  495.   #
  496.   # MP_Meter.png
  497.   #   
  498.   #---------------------------------------------------------------------------  
  499.   MP_METER_VISIBLE = true
  500.   #---------------------------------------------------------------------------
  501.   # Definição da prioridade do sprite.
  502.   #---------------------------------------------------------------------------   
  503.   MP_METER_Z = 3
  504.   #---------------------------------------------------------------------------
  505.   # Definição da posição do medidor de MP. [X,Y]
  506.   #---------------------------------------------------------------------------  
  507.   MP_METER_POSITION = [91,73]
  508.   #---------------------------------------------------------------------------
  509.   # Definição do ângulo do medidor.
  510.   #---------------------------------------------------------------------------  
  511.   MP_METER_ANGLE = 0
  512.   #---------------------------------------------------------------------------
  513.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  514.   # inverso.
  515.   #---------------------------------------------------------------------------  
  516.   MP_METER_MIRROR_EFFECT = false
  517.   #---------------------------------------------------------------------------
  518.   # Ativar o efeito animado de dano no medidor.
  519.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  520.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  521.   #
  522.   # NORMAL_COLOR
  523.   # DAMAGE_COLOR
  524.   #
  525.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  526.   #---------------------------------------------------------------------------  
  527.   MP_METER_REDUCTION_ANIMATION = true
  528.   #---------------------------------------------------------------------------
  529.   # Ativar o efeito animado do "medidor fluindo".
  530.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  531.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  532.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  533.   #---------------------------------------------------------------------------  
  534.   MP_METER_GRADIENT_ANIMATION = false
  535.   #---------------------------------------------------------------------------
  536.   # Ativar MP em ícones.
  537.   # Será necessário ter a imagem.
  538.   #
  539.   # MP_Icon.png
  540.   #
  541.   #---------------------------------------------------------------------------
  542.   MP_ICON_VISIBLE = false
  543.   #---------------------------------------------------------------------------
  544.   # Definição da prioridade do Sprite.
  545.   #---------------------------------------------------------------------------   
  546.   MP_ICON_Z = 1  
  547.   #---------------------------------------------------------------------------
  548.   # Posição do ícone de MP.
  549.   #---------------------------------------------------------------------------  
  550.   MP_ICON_POSITION = [200,64]
  551.   #---------------------------------------------------------------------------
  552.   # Ativar o sprite EX do ultimo ícone
  553.   # Será necessário ter a imagem.
  554.   #
  555.   # MP_Icon_EX.png
  556.   #
  557.   #---------------------------------------------------------------------------
  558.   MP_ICON_EX_VISIBLE = false
  559.   #---------------------------------------------------------------------------
  560.   # Posição do ícone Animado.
  561.   #---------------------------------------------------------------------------  
  562.   MP_ICON_EX_POSITION = [0,0]
  563.   #---------------------------------------------------------------------------
  564.   # Ativar o efeito de Zoom do Sprite.
  565.   #---------------------------------------------------------------------------
  566.   MP_ICON_EX_ZOOM_EFFECT = true
  567.   #---------------------------------------------------------------------------
  568.   # Espaço entre os ícones.
  569.   #---------------------------------------------------------------------------   
  570.   MP_ICON_SPACE = [-10,-10]
  571.   #---------------------------------------------------------------------------
  572.   # Definição da quantidade maxima de ícones na horizontal.
  573.   #---------------------------------------------------------------------------  
  574.   MP_ICON_COL_MAX = 10
  575.   #---------------------------------------------------------------------------
  576.   # Definição da quantidade maxima de ícones na vertical.
  577.   #---------------------------------------------------------------------------   
  578.   MP_ICON_ROW_MAX = 2
  579.   #---------------------------------------------------------------------------
  580.   # Ativar o número de MP de ícones.
  581.   # Será necessário ter a imagem.
  582.   #
  583.   # MP_Icon_Number.png
  584.   #
  585.   #---------------------------------------------------------------------------
  586.   MP_ICON_NUMBER_VISIBLE = false
  587.   #---------------------------------------------------------------------------
  588.   # Definição da prioridade do sprite.
  589.   #---------------------------------------------------------------------------
  590.   MP_ICON_NUMBER_Z = 4
  591.   #---------------------------------------------------------------------------
  592.   # Posição do número do ícone
  593.   #---------------------------------------------------------------------------  
  594.   MP_ICON_NUMBER_POSITION = [0,64]
  595.   #---------------------------------------------------------------------------
  596.   # Definição do tipo alinhamento do número.
  597.   #
  598.   # 0 - Esquerda
  599.   # 1 - Centro
  600.   # 2 - Direita
  601.   #---------------------------------------------------------------------------  
  602.   MP_ICON_NUMBER_ALIGN_TYPE = 0   
  603.   #============================================================================
  604.   #============================================================================
  605.  
  606.  
  607.   #============================================================================
  608.   #============================================================================
  609.   # * TP
  610.   #============================================================================
  611.   # Ativar o número de TP.
  612.   # Será necessário o arquivo.
  613.   #
  614.   # TP_Number.png
  615.   #   
  616.   #---------------------------------------------------------------------------
  617.   TP_NUMBER_VISIBLE = true
  618.   #---------------------------------------------------------------------------
  619.   # Definição da prioridade do sprite.
  620.   #---------------------------------------------------------------------------
  621.   TP_NUMBER_Z = 10  
  622.   #---------------------------------------------------------------------------
  623.   # Definição da posição do número de TP. [X,Y]
  624.   #---------------------------------------------------------------------------  
  625.   TP_NUMBER_POSITION = [52,0]
  626.   #---------------------------------------------------------------------------  
  627.   # Ativar o número de TP Total.
  628.   # Será necessário o arquivo.
  629.   #
  630.   # TP_Number_Max.png
  631.   #
  632.   #---------------------------------------------------------------------------
  633.   TP_NUMBER_MAX_VISIBLE = false
  634.   #---------------------------------------------------------------------------
  635.   # Definição da posição do número de TP Total. [X,Y]
  636.   #---------------------------------------------------------------------------  
  637.   TP_NUMBER_MAX_POSITION = [165,77]
  638.   #---------------------------------------------------------------------------
  639.   # Definição do tipo alinhamento do número.
  640.   #
  641.   # 0 - Esquerda
  642.   # 1 - Centro
  643.   # 2 - Direita
  644.   #---------------------------------------------------------------------------  
  645.   TP_NUMBER_ALIGN_TYPE = 2
  646.   #---------------------------------------------------------------------------
  647.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  648.   #---------------------------------------------------------------------------
  649.   TP_NUMBER_WAVE_ALIGN_EFFECT = false   
  650.   #---------------------------------------------------------------------------
  651.   # Apresentar os números em porcentagem.
  652.   #---------------------------------------------------------------------------   
  653.   TP_NUMBER_PERCENTAGE = true
  654.   #---------------------------------------------------------------------------
  655.   # Ativar números animados ("Rolantes").
  656.   #---------------------------------------------------------------------------  
  657.   TP_NUMBER_ANIMATION = false
  658.   #---------------------------------------------------------------------------
  659.   # Ativar a cor do TP baixo.
  660.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  661.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  662.   #
  663.   # NORMAL_COLOR
  664.   # LOW_PARAMETER_COLOR
  665.   #
  666.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  667.   #---------------------------------------------------------------------------  
  668.   TP_NUMBER_LOW_COLOR = false
  669.   #---------------------------------------------------------------------------
  670.   # Ativar o medidor de TP.
  671.   # Será necessário o arquivo.
  672.   #
  673.   # TP_Meter.png
  674.   #   
  675.   #---------------------------------------------------------------------------  
  676.   TP_METER_VISIBLE = true
  677.   #---------------------------------------------------------------------------
  678.   # Definição da prioridade do sprite.
  679.   #---------------------------------------------------------------------------
  680.   TP_METER_Z = 3  
  681.   #---------------------------------------------------------------------------
  682.   # Definição da posição do medidor de TP. [X,Y]
  683.   #---------------------------------------------------------------------------  
  684.   TP_METER_POSITION = [14,68]
  685.   #---------------------------------------------------------------------------
  686.   # Definição do ângulo do medidor.
  687.   #---------------------------------------------------------------------------  
  688.   TP_METER_ANGLE = 91
  689.   #---------------------------------------------------------------------------
  690.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  691.   # inverso.
  692.   #---------------------------------------------------------------------------  
  693.   TP_METER_MIRROR_EFFECT = false
  694.   #---------------------------------------------------------------------------
  695.   # Ativar o efeito animado de dano no medidor.
  696.   # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  697.   # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  698.   #
  699.   # NORMAL_COLOR
  700.   # DAMAGE_COLOR
  701.   #
  702.   # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  703.   #---------------------------------------------------------------------------  
  704.   TP_METER_REDUCTION_ANIMATION = false
  705.   #---------------------------------------------------------------------------
  706.   # Ativar o efeito animado do "medidor fluindo".
  707.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  708.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  709.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  710.   #---------------------------------------------------------------------------  
  711.   TP_METER_GRADIENT_ANIMATION = true
  712.   #---------------------------------------------------------------------------
  713.   # Ativar TP em ícones.
  714.   # Será necessário ter a imagem.
  715.   #
  716.   # TP_Icon.png
  717.   #
  718.   #---------------------------------------------------------------------------
  719.   TP_ICON_VISIBLE = false
  720.   #---------------------------------------------------------------------------
  721.   # Definição da prioridade do sprite.
  722.   #---------------------------------------------------------------------------
  723.   TP_ICON_Z = 1  
  724.   #---------------------------------------------------------------------------
  725.   # Posição do ícone de TP.
  726.   #---------------------------------------------------------------------------  
  727.   TP_ICON_POSITION = [200,128]
  728.   #---------------------------------------------------------------------------
  729.   # Ativar o sprite EX do ultimo ícone
  730.   # Será necessário ter a imagem.
  731.   #
  732.   # TP_Icon_EX.png
  733.   #
  734.   #---------------------------------------------------------------------------
  735.   TP_ICON_EX_VISIBLE = false
  736.   #---------------------------------------------------------------------------
  737.   # Posição do ícone Animado.
  738.   #---------------------------------------------------------------------------  
  739.   TP_ICON_EX_POSITION = [0,0]
  740.   #---------------------------------------------------------------------------
  741.   # Ativar o efeito de Zoom do Sprite.
  742.   #---------------------------------------------------------------------------
  743.   TP_ICON_EX_ZOOM_EFFECT = true
  744.   #---------------------------------------------------------------------------
  745.   # Espaço entre os ícones.
  746.   #---------------------------------------------------------------------------   
  747.   TP_ICON_SPACE = [-10,-10]
  748.   #---------------------------------------------------------------------------
  749.   # Definição da quantidade maxima de ícones na horizontal.
  750.   #---------------------------------------------------------------------------  
  751.   TP_ICON_COL_MAX = 10
  752.   #---------------------------------------------------------------------------
  753.   # Definição da quantidade maxima de ícones na vertical.
  754.   #---------------------------------------------------------------------------   
  755.   TP_ICON_ROW_MAX = 2
  756.   #---------------------------------------------------------------------------
  757.   # Ativar o número de TP de ícones.
  758.   # Será necessário ter a imagem.
  759.   #
  760.   # TP_Icon_Number.png
  761.   #
  762.   #---------------------------------------------------------------------------
  763.   TP_ICON_NUMBER_VISIBLE = false
  764.   #---------------------------------------------------------------------------
  765.   # Definição da prioridade do sprite.
  766.   #---------------------------------------------------------------------------
  767.   TP_ICON_NUMBER_Z = 4
  768.   #---------------------------------------------------------------------------
  769.   # Posição do número do ícone
  770.   #---------------------------------------------------------------------------  
  771.   TP_ICON_NUMBER_POSITION = [0,128]
  772.   #---------------------------------------------------------------------------
  773.   # Definição do tipo alinhamento do número.
  774.   #
  775.   # 0 - Esquerda
  776.   # 1 - Centro
  777.   # 2 - Direita
  778.   #---------------------------------------------------------------------------  
  779.   TP_ICON_NUMBER_ALIGN_TYPE = 0   
  780.   #============================================================================
  781.   #============================================================================
  782.  
  783.   #============================================================================
  784.   #============================================================================
  785.   # * AT
  786.   #============================================================================
  787.   # Ativar o número de AT.
  788.   # Será necessário o arquivo.
  789.   #
  790.   # AT_Number.png
  791.   #
  792.   #---------------------------------------------------------------------------
  793.   AT_NUMBER_VISIBLE = false
  794.   #---------------------------------------------------------------------------
  795.   # Definição da prioridade do Sprite.
  796.   #---------------------------------------------------------------------------   
  797.   AT_NUMBER_Z = 2
  798.   #---------------------------------------------------------------------------
  799.   # Definição da posição do número de AT. [X,Y]
  800.   #---------------------------------------------------------------------------  
  801.   AT_NUMBER_POSITION = [125,-27]
  802.   #---------------------------------------------------------------------------  
  803.   # Ativar o número de AT Total.
  804.   # Será necessário o arquivo.
  805.   #
  806.   # AT_Number_Max.png
  807.   #
  808.   #---------------------------------------------------------------------------
  809.   AT_NUMBER_MAX_VISIBLE = false
  810.   #---------------------------------------------------------------------------
  811.   # Definição da posição do número de AT Total. [X,Y]
  812.   #---------------------------------------------------------------------------  
  813.   AT_NUMBER_MAX_POSITION = [165,-17]
  814.   #---------------------------------------------------------------------------
  815.   # Definição do tipo alinhamento do número.
  816.   #
  817.   # 0 - Esquerda
  818.   # 1 - Centro
  819.   # 2 - Direita
  820.   #---------------------------------------------------------------------------  
  821.   AT_NUMBER_ALIGN_TYPE = 2
  822.   #---------------------------------------------------------------------------
  823.   # Ativa o efeito de alinhar os números em posições de Y diferentes.
  824.   #---------------------------------------------------------------------------
  825.   AT_NUMBER_WAVE_ALIGN_EFFECT = false
  826.   #---------------------------------------------------------------------------
  827.   # Apresentar os números em porcentagem.
  828.   #---------------------------------------------------------------------------   
  829.   AT_NUMBER_PERCENTAGE = true
  830.   #---------------------------------------------------------------------------
  831.   # Ativar números animados ("Rolantes").
  832.   #---------------------------------------------------------------------------  
  833.   AT_NUMBER_ANIMATION = false
  834.   #---------------------------------------------------------------------------
  835.   # Ativar o medidor de AT.
  836.   # Será necessário o arquivo.
  837.   #
  838.   # AT_Meter.png
  839.   #  
  840.   #---------------------------------------------------------------------------  
  841.   AT_METER_VISIBLE = true
  842.   #---------------------------------------------------------------------------
  843.   # Definição da prioridade do sprite.
  844.   #---------------------------------------------------------------------------   
  845.   AT_METER_Z = 3
  846.   #---------------------------------------------------------------------------
  847.   # Definição da posição do medidor de AT. [X,Y]
  848.   #---------------------------------------------------------------------------  
  849.   AT_METER_POSITION = [23,60]
  850.   #---------------------------------------------------------------------------
  851.   # Definição do ângulo do medidor.
  852.   #---------------------------------------------------------------------------  
  853.   AT_METER_ANGLE = 91
  854.   #---------------------------------------------------------------------------
  855.   # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  856.   # inverso.
  857.   #---------------------------------------------------------------------------  
  858.   AT_METER_MIRROR_EFFECT = false
  859.   #---------------------------------------------------------------------------
  860.   # Ativar o efeito animado do "medidor fluindo".
  861.   # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  862.   # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  863.   # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  864.   #---------------------------------------------------------------------------  
  865.   AT_METER_GRADIENT_ANIMATION = true
  866.   #============================================================================
  867.  
  868.  
  869.   #============================================================================
  870.   #============================================================================
  871.   # * LEVEL
  872.   #============================================================================
  873.   # Ativar o número de Level.
  874.   # Será necessário o arquivo.
  875.   #
  876.   # LV_Number.png
  877.   #   
  878.   #---------------------------------------------------------------------------
  879.   LEVEL_NUMBER_VISIBLE = false
  880.   #---------------------------------------------------------------------------
  881.   # Definição da prioridade do Sprite.
  882.   #---------------------------------------------------------------------------   
  883.   LEVEL_NUMBER_Z = 2
  884.   #---------------------------------------------------------------------------
  885.   # Definição da posição do número do Level. [X,Y]
  886.   #---------------------------------------------------------------------------  
  887.   LEVEL_NUMBER_POSITION = [84,0]
  888.   #---------------------------------------------------------------------------
  889.   # Definição do tipo alinhamento do número.
  890.   #
  891.   # 0 - Esquerda
  892.   # 1 - Centro
  893.   # 2 - Direita
  894.   #---------------------------------------------------------------------------  
  895.   LEVEL_NUMBER_ALIGN_TYPE = 1     
  896.   #============================================================================
  897.   #============================================================================
  898.  
  899.  
  900.   #============================================================================
  901.   #============================================================================
  902.   # * STATE
  903.   #============================================================================
  904.   # Ativar as condições.
  905.   #---------------------------------------------------------------------------  
  906.   STATES_VISIBLE = true
  907.   #---------------------------------------------------------------------------
  908.   # Definição da prioridade do sprite.
  909.   #---------------------------------------------------------------------------   
  910.   STATES_Z = 4
  911.   #---------------------------------------------------------------------------
  912.   # Definição da posição das condições. [X,Y]
  913.   #---------------------------------------------------------------------------  
  914.   STATES_POSITION = [25,54]
  915.   #---------------------------------------------------------------------------
  916.   # Ativar o efeito animado das condições deslizando.
  917.   #---------------------------------------------------------------------------  
  918.   STATES_SCROLLING_ANIMATION = false
  919.   #---------------------------------------------------------------------------
  920.   # Definição do ângulo do sprite.
  921.   #---------------------------------------------------------------------------   
  922.   STATE_ANGLE = 0
  923.   #---------------------------------------------------------------------------
  924.   # Definição das condições que serão ocultadas pela hud.
  925.   # EX - HIDE_STATES_ID = [9,10,13]
  926.   #---------------------------------------------------------------------------   
  927.   HIDE_STATES_ID = []
  928.   #============================================================================
  929.   #============================================================================
  930.  
  931.   #============================================================================
  932.   #============================================================================
  933.   # * SECOND LAYOUT (Overlayer)
  934.   #============================================================================  
  935.   # Ativar a segunda camada de Layout
  936.   # Será necessário o arquivo.
  937.   #
  938.   # Layout_2.png
  939.   #
  940.   #============================================================================  
  941.   SECOND_LAYOUT = false
  942.   #---------------------------------------------------------------------------
  943.   # Definição da prioridade do sprite.
  944.   #---------------------------------------------------------------------------  
  945.   SECOND_LAYOUT_Z = 2
  946.   #---------------------------------------------------------------------------
  947.   # Definição da posição do sprite.
  948.   #---------------------------------------------------------------------------   
  949.   SECOND_LAYOUT_POSITION = [0,0]
  950.   #============================================================================
  951.   #============================================================================
  952.  
  953.   #============================================================================
  954.   #============================================================================
  955.   # * SCREEN LAYOUT
  956.   #============================================================================  
  957.   # Ativar o Layout da tela.
  958.   # Será necessário o arquivo.
  959.   #
  960.   # Layout_Screen.png
  961.   #
  962.   #============================================================================  
  963.   #Ativar o Layout da tela
  964.   SCREEN_LAYOUT = false
  965.   #---------------------------------------------------------------------------
  966.   #Posição do layout
  967.   #---------------------------------------------------------------------------
  968.   SCREEN_LAYOUT_POSITION = [0,0]
  969.   #---------------------------------------------------------------------------
  970.   #Definição da posição Z
  971.   #---------------------------------------------------------------------------
  972.   SCREEN_LAYOUT_Z = -2     
  973.  
  974. end
  975.  
  976. #============================================================================
  977. #============================================================================
  978. # * CUSTOM WINDOWS (GENERAL)
  979. #============================================================================
  980. module MOG_BATTLE_HUD_EX
  981.  
  982. #============================================================================
  983. # * Ativar Janelas Customizadas.
  984. #============================================================================
  985.   ENABLE_CUSTOM_WINDOWS = true
  986.  
  987. #============================================================================
  988. # * BATTLE LOG WINDOW
  989. #============================================================================
  990. #Definição da posição da janela de log.
  991.   BATTLE_LOG_POSITION = [0,0]
  992. #============================================================================
  993.  
  994. #============================================================================
  995. # * FONT SETTING
  996. #============================================================================
  997. #Ativar a configuração da fonte.
  998. ENABLE_WINDOW_FONT_SET = false
  999. #Definição do nome da fonte.
  1000. WINDOW_FONT_NAME = nil
  1001. #Definição do tamanho da fonte.
  1002. WINDOW_FONT_SIZE = 18
  1003. #Ativar fonte em bold;
  1004. WINDOW_FONT_BOLD = true
  1005. #Ativar fonte em itálico.
  1006. WINDOW_FONT_ITALIC = false
  1007.  
  1008. #============================================================================
  1009. # * SKILL WINDOW
  1010. #============================================================================
  1011. #Definição do tamanho da janela.
  1012.   SKILL_WINDOW_SIZE = [Graphics.width, 120]
  1013. #Definição da posição da janela.
  1014.   SKILL_WINDOW_POSITION = [0,0]
  1015. #Definição da transparência da janela.
  1016.   SKILL_WINDOW_OPACITY = 0
  1017. #Ativar a imagem de Layout. ("Layout_Skill.png")
  1018.   SKILL_WINDOW_LAYOUT = true
  1019. #Definição do layout.
  1020.   SKILL_WINDOW_LAYOUT_POSITION = [0,-7]  
  1021. #Definição da quantidade colunas máxima.
  1022.   SKILL_COL_MAX = 2  
  1023.    #Ativar a animação de slide.
  1024.   SKILL_WINDOW_SLIDE_EFFECT = false
  1025.   #Definição da posição do slide.
  1026.   SKILL_WINDOW_SLIDE_POSITION = [150,0]   
  1027. #============================================================================
  1028.  
  1029. #============================================================================
  1030. # * ITEM WINDOW
  1031. #============================================================================
  1032. #Definição do tamanho da janela.  
  1033.   ITEM_WINDOW_SIZE = [Graphics.width, 120]
  1034. #Definição da posição da janela.
  1035.   ITEM_WINDOW_POSITION = [0,0]
  1036. #Definição da transparência da janela.
  1037.   ITEM_WINDOW_OPACITY = 0
  1038. #Ativar a imagem de Layout. ("Layout_Item.png")   
  1039.   ITEM_WINDOW_LAYOUT = true
  1040. #Definição do layout.  
  1041.   ITEM_WINDOW_LAYOUT_POSITION = [0,-7]
  1042. #Definição da quantidade colunas máxima.
  1043.   ITEM_COL_MAX = 2   
  1044.   #Ativar a animação de slide.
  1045.   ITEM_WINDOW_SLIDE_EFFECT = false
  1046.   #Definição da posição do slide.
  1047.   ITEM_WINDOW_SLIDE_POSITION = [150,0]  
  1048. #============================================================================
  1049.  
  1050. #============================================================================
  1051. # * COMMAND WINDOW
  1052. #============================================================================
  1053. #Definição da posição da janela. (Apenas para Ajustes)
  1054.   ACTOR_COMMAND_POSITION = [0,0] #[30,-70]
  1055. #Definição da transparência da janela.
  1056.   ACTOR_COMMAND_OPACITY = 0
  1057. #Ativar a imagem de Layout. ("Layout_Command.png")   
  1058.   ACTOR_COMMAND_LAYOUT = true
  1059. #Definição do layout.   
  1060.   ACTOR_COMMAND_LAYOUT_POSITION = [0,0] #[0,0]
  1061. #============================================================================
  1062.  
  1063. #============================================================================
  1064. # * HELP WINDOW
  1065. #============================================================================
  1066. #Definição do tamanho da janela.   
  1067.   HELP_WINDOW_SIZE = [Graphics.width, 72]
  1068. #Definição do tamanho da janela.
  1069.   HELP_WINDOW_POSITION = [Graphics.width / 2, 0]  
  1070. #Definição da transparência da janela.
  1071.   HELP_WINDOW_OPACITY = 0
  1072. #Ativar a imagem de Layout. ("Layout_Help.png")   
  1073.   HELP_WINDOW_LAYOUT = true
  1074. #Definição do layout.
  1075.   HELP_WINDOW_LAYOUT_POSITION = [0,0]
  1076.   #Ativar a animação de slide.
  1077.   HELP_WINDOW_SLIDE_EFFECT = false
  1078.   #Definição da posição do slide.
  1079.   HELP_WINDOW_SLIDE_POSITION = [0,-150]   
  1080. #============================================================================
  1081.  
  1082. #============================================================================
  1083. # * TARGET ACTOR WINDOW
  1084. #============================================================================
  1085. #Definição do tamanho da janela.   
  1086.   ACTOR_WINDOW_SIZE = [Graphics.width, 120]  
  1087. #Definição do tamanho da janela.
  1088.   ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1089. #Definição da transparência da janela.  
  1090.   ACTOR_WINDOW_OPACITY = 0
  1091. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1092.   ACTOR_WINDOW_LAYOUT = true
  1093. #Definição do layout.
  1094.   ACTOR_WINDOW_LAYOUT_POSITION = [0,0]
  1095.   #Ativar a animação de slide.
  1096.   ACTOR_WINDOW_SLIDE_EFFECT = false
  1097.   #Definição da posição do slide.
  1098.   ACTOR_WINDOW_SLIDE_POSITION = [0,100]   
  1099. #============================================================================
  1100.  
  1101. #============================================================================
  1102. # * TARGET ENEMY WINDOW
  1103. #============================================================================
  1104. #Definição do tamanho da janela.
  1105.   ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  1106. #Definição do tamanho da janela.  
  1107.   ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1108. #Definição da transparência da janela.   
  1109.   ENEMY_WINDOW_OPACITY = 0
  1110. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1111.   ENEMY_WINDOW_LAYOUT = true
  1112. #Definição do layout.
  1113.   ENEMY_WINDOW_LAYOUT_POSITION = [0,0]
  1114.   #Ativar a animação de slide.
  1115.   ENEMY_WINDOW_SLIDE_EFFECT = false
  1116.   #Definição da posição do slide.
  1117.   ENEMY_WINDOW_SLIDE_POSITION = [0,100]   
  1118. #============================================================================
  1119.  
  1120. #============================================================================
  1121. # * PARTY WINDOW (Fight/Escape)
  1122. #============================================================================
  1123. #Definição do tamanho da janela.  
  1124.   #PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  1125.   PARTY_COMMAND_POSITION = [70,430]
  1126. #Definição da transparência da janela.   
  1127.   PARTY_COMMAND_OPACITY = 0
  1128. #Ativar a imagem de Layout. ("Layout_Party.png")  
  1129.   PARTY_COMMAND_LAYOUT = true
  1130. #Definição do layout.  
  1131.   PARTY_COMMAND_LAYOUT_POSITION = [0,0]
  1132.   #Ativar a animação de slide.
  1133.   PARTY_COMMAND_SLIDE_EFFECT = false
  1134.   #Definição da posição do slide.
  1135.   PARTY_COMMAND_SLIDE_POSITION = [0,-150]   
  1136. #============================================================================
  1137.  
  1138. end
  1139.  
  1140. #==============================================================================
  1141. # ** Cache
  1142. #==============================================================================
  1143. module Cache
  1144.  
  1145.   #--------------------------------------------------------------------------
  1146.   # * Hud
  1147.   #--------------------------------------------------------------------------
  1148.   def self.battle_hud(filename)
  1149.       load_bitmap("Graphics/Huds/Battle/", filename)
  1150.   end
  1151.  
  1152. end
  1153.  
  1154. #==============================================================================
  1155. # ** Game Temp
  1156. #==============================================================================
  1157. class Game_Temp
  1158.  
  1159.   attr_accessor :battler_face_pos
  1160.   attr_accessor :hud_pos
  1161.   attr_accessor :hud_pos_real
  1162.   attr_accessor :com_pos
  1163.   attr_accessor :mbhud_force_refresh
  1164.   attr_accessor :mbhud_window
  1165.   attr_accessor :command_visible
  1166.   attr_accessor :refresh_turn_sprite
  1167.   attr_accessor :battle_hud_visible
  1168.   attr_accessor :battle_hud_visible_refresh
  1169.   attr_accessor :battle_end
  1170.  
  1171.   #--------------------------------------------------------------------------
  1172.   # * Initialize
  1173.   #--------------------------------------------------------------------------   
  1174.   alias mog_monogatari_bhud_initialize initialize
  1175.   def initialize
  1176.       @battler_face_pos = []
  1177.       @hud_pos = []
  1178.       @hud_pos_real = []
  1179.       @com_pos = []
  1180.       @mbhud_force_refresh = false
  1181.       @mbhud_window = [false,false,false,false,false,false,false]
  1182.       @command_visible = false
  1183.       @refresh_turn_sprite = false
  1184.       @battle_hud_visible = true
  1185.       @battle_hud_visible_refresh = [false,false]
  1186.       @battle_end = false      
  1187.       mog_monogatari_bhud_initialize
  1188.   end
  1189.  
  1190.   #--------------------------------------------------------------------------
  1191.   # * Check Screen Xyz
  1192.   #--------------------------------------------------------------------------   
  1193.   def check_screen_xyz_nil
  1194.       return if !SceneManager.face_battler?
  1195.       for actor in $game_party.battle_members
  1196.           actor.screen_x = 0 if actor.screen_x == nil
  1197.           actor.screen_y = 0 if actor.screen_y == nil
  1198.           actor.screen_z = 0 if actor.screen_z == nil
  1199.       end
  1200.   end  
  1201.  
  1202.   #--------------------------------------------------------------------------
  1203.   # ● Sprite Visible
  1204.   #--------------------------------------------------------------------------   
  1205.   def sprite_visible
  1206.       return false if $game_message.visible
  1207.       return false if $game_temp.battle_end
  1208.       return true
  1209.   end  
  1210.  
  1211. end
  1212.  
  1213. #==============================================================================
  1214. # ** Game Interpreter
  1215. #==============================================================================
  1216. class Game_Interpreter
  1217.  
  1218. #--------------------------------------------------------------------------
  1219. # * Refresh Battle Hud
  1220. #--------------------------------------------------------------------------
  1221. def refresh_battle_hud
  1222.      $game_temp.check_screen_xyz_nil rescue nil
  1223.      $game_temp.mbhud_force_refresh = true
  1224. end
  1225.  
  1226. #--------------------------------------------------------------------------
  1227. # * Battler Face Name
  1228. #--------------------------------------------------------------------------
  1229. def battler_face_name(actor_id,face_name = "")
  1230.      for actor in $game_party.members
  1231.          actor.battler_face_name = face_name if actor.id == actor_id
  1232.      end
  1233.      refresh_battle_hud
  1234. end  
  1235.  
  1236. #--------------------------------------------------------------------------
  1237. # * Battler Hud Visible
  1238. #--------------------------------------------------------------------------
  1239. def battle_hud_visible(value)
  1240.      $game_temp.battle_hud_visible = value
  1241. end
  1242.  
  1243. #--------------------------------------------------------------------------
  1244. # * Command_129
  1245. #--------------------------------------------------------------------------
  1246. alias mog_monogatari_bhud_command_129 command_129
  1247. def command_129
  1248.      mog_monogatari_bhud_command_129     
  1249.      refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1250. end
  1251.  
  1252. end
  1253.  
  1254. #==============================================================================
  1255. # ** Game Actor
  1256. #==============================================================================
  1257. class Game_Actor < Game_Battler
  1258.  
  1259.   attr_accessor :face_animation
  1260.   attr_accessor :battler_face_name
  1261.  
  1262.   #--------------------------------------------------------------------------
  1263.   # * Setup
  1264.   #--------------------------------------------------------------------------
  1265.   alias mog_monogatari_face_animation setup
  1266.   def setup(actor_id)
  1267.       mog_monogatari_face_animation(actor_id)
  1268.       @face_animation = [0,0,0]
  1269.  
  1270.       #追記
  1271.       p "setup"      
  1272.  
  1273.       if $game_variables[1] == 1
  1274.         @battler_face_name = "Face_1"
  1275.       end
  1276.       if $game_variables[1] == 0
  1277.         @battler_face_name = "Face_2"
  1278.       end
  1279.       #追記終わり
  1280.  
  1281.  
  1282.       @battler_face_name = "Face_" + actor_id.to_s
  1283.   end   
  1284.  
  1285.   #--------------------------------------------------------------------------
  1286.   # ● Real Next Level
  1287.   #--------------------------------------------------------------------------  
  1288.   def real_next_level
  1289.       next_level_exp - exp_for_level(level)
  1290.   end
  1291.  
  1292.   #--------------------------------------------------------------------------
  1293.   # ● Remain Exp
  1294.   #--------------------------------------------------------------------------  
  1295.   def remain_exp
  1296.       exp - exp_for_level(level)
  1297.   end
  1298.  
  1299.   #--------------------------------------------------------------------------
  1300.   # ● Gain Exp Test
  1301.   #--------------------------------------------------------------------------
  1302.   def gain_exp_test
  1303.       exp_r = rand(next_level_exp)
  1304.       change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1305.   end   
  1306.  
  1307.   #--------------------------------------------------------------------------
  1308.   # ● Low HP?
  1309.   #--------------------------------------------------------------------------   
  1310.   def low_hp?
  1311.       hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1312.   end
  1313.  
  1314.   #--------------------------------------------------------------------------
  1315.   # ● Low MP?
  1316.   #--------------------------------------------------------------------------   
  1317.   def low_mp?
  1318.       mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1319.   end  
  1320.  
  1321.   #--------------------------------------------------------------------------
  1322.   # ● Low TP?
  1323.   #--------------------------------------------------------------------------   
  1324.   def low_tp?
  1325.       tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1326.   end  
  1327.  
  1328. end
  1329.  
  1330. #==============================================================================
  1331. # ** Game Party
  1332. #==============================================================================
  1333. class Game_Party < Game_Unit
  1334.  
  1335.   #--------------------------------------------------------------------------
  1336.   # * Get Maximum Number of Battle Members
  1337.   #--------------------------------------------------------------------------
  1338.   def max_battle_members
  1339.       return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
  1340.   end
  1341.  
  1342. #--------------------------------------------------------------------------
  1343. # * Swap Order
  1344. #--------------------------------------------------------------------------
  1345. alias mog_bhex_swap_order swap_order
  1346. def swap_order(index1, index2)
  1347.      mog_bhex_swap_order(index1, index2)
  1348.      if SceneManager.scene_is?(Scene_Battle)  
  1349.      $game_temp.check_screen_xyz_nil rescue nil
  1350.      $game_temp.mbhud_force_refresh = true     
  1351.      end
  1352. end  
  1353.  
  1354. end
  1355.  
  1356. #==============================================================================
  1357. # ** BattleManager
  1358. #==============================================================================
  1359. module BattleManager
  1360.  
  1361. #--------------------------------------------------------------------------
  1362. # * Current Index
  1363. #--------------------------------------------------------------------------   
  1364. def self.current_index
  1365.      if $imported[:mog_atb_system]
  1366.         return actor.index if actor
  1367.      end   
  1368.      return 0 if @actor_index == nil
  1369.      return @actor_index != -1 ? @actor_index : 0
  1370. end
  1371.  
  1372. #--------------------------------------------------------------------------
  1373. # * Current Index Real
  1374. #--------------------------------------------------------------------------   
  1375. def self.current_index_real
  1376.      return -1 if @actor_index == nil
  1377.      return @actor_index
  1378. end
  1379.  
  1380.   #--------------------------------------------------------------------------
  1381.   # * Next Actor Avaliable
  1382.   #--------------------------------------------------------------------------
  1383.   def self.next_actor_avaliable?
  1384.       return false if @actor_index == nil
  1385.       next_index = @actor_index + 1
  1386.       return false if next_index >= $game_party.members.size
  1387.       return true
  1388.   end
  1389.  
  1390.   #--------------------------------------------------------------------------
  1391.   # * To Next Command Input
  1392.   #--------------------------------------------------------------------------
  1393.   def self.next_command_avaliable
  1394.     aindex = @actor_index
  1395.     begin      
  1396.       if !actor || !actor.next_command
  1397.         return false if actor == nil
  1398.         aindex += 1
  1399.         return false if aindex >= $game_party.members.size
  1400.       end
  1401.     end until actor.inputable?
  1402.     return true
  1403.   end  
  1404.  
  1405.   #--------------------------------------------------------------------------
  1406.   # * Can Enable Window?
  1407.   #--------------------------------------------------------------------------
  1408.   def self.can_enable_window?
  1409.       max_members = $game_party.members.size
  1410.       index_real = current_index_real + 1
  1411.       return false if index_real > max_members
  1412.       return false if in_turn?
  1413.       return false if $imported[:mog_battle_cursor]
  1414.       return true
  1415.   end
  1416.  
  1417. end
  1418.  
  1419. #==============================================================================
  1420. # ** SceneManager
  1421. #==============================================================================
  1422. module SceneManager
  1423.  
  1424.   #--------------------------------------------------------------------------
  1425.   # * Face Battler
  1426.   #--------------------------------------------------------------------------
  1427.   def self.face_battler?
  1428.       return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1429.       return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
  1430.       return false if $imported[:mog_sprite_actor]
  1431.       return false if $imported[:ve_animated_battle]
  1432.       return false if $imported[:ve_actor_battlers]
  1433.       return false if $imported["YES-BattleSymphony"]
  1434.       return false if $imported["YEA-VisualBattlers"]
  1435.       return false if $imported["Galv_Animated_Battlers"]
  1436.       return false if $imported['KRX-AnimatedBattlers']
  1437.       return false if $imported[:Theo_BasicFuntions]
  1438.       return false if $sv_camera != nil
  1439.       return false if BattleManager.true_surprise != nil rescue nil
  1440.       return false if $imported[:jet][:AnimatedBattlers] rescue nil      
  1441.       return true
  1442.   end
  1443.  
  1444. end
  1445.  
  1446. #==============================================================================
  1447. # ■ Sprite Picture
  1448. #==============================================================================
  1449. class Sprite_Picture < Sprite
  1450.  
  1451.   #--------------------------------------------------------------------------
  1452.   # * Initialize
  1453.   #--------------------------------------------------------------------------
  1454.   alias mog_battle_hud_initialize initialize
  1455.   def initialize(viewport, picture)
  1456.       mog_battle_hud_initialize(viewport, picture)
  1457.       self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
  1458.  
  1459.   end  
  1460.  
  1461.   #--------------------------------------------------------------------------
  1462.   # * Update Position
  1463.   #--------------------------------------------------------------------------
  1464.   alias mog_battle_hud_update_position update_position
  1465.   def update_position
  1466.       mog_battle_hud_update_position
  1467.       self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
  1468.   end
  1469.  
  1470. end
  1471.  
  1472. #==============================================================================
  1473. # ■ Sprite Base
  1474. #==============================================================================
  1475. class Sprite_Base < Sprite
  1476.  
  1477.   #--------------------------------------------------------------------------
  1478.   # * Initialize
  1479.   #--------------------------------------------------------------------------
  1480.   alias mog_bhud_ex_initialize initialize
  1481.   def initialize(viewport = nil)
  1482.       #追加
  1483.       @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
  1484.       mog_bhud_ex_initialize(viewport)
  1485.   end  
  1486.  
  1487.   #--------------------------------------------------------------------------
  1488.   # * Animation Set Sprite
  1489.   #--------------------------------------------------------------------------
  1490.   alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
  1491.   def animation_set_sprites(frame)
  1492.       mog_battle_hud_ex_animation_set_sprites(frame)
  1493.       update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
  1494.   end  
  1495.  
  1496.   #--------------------------------------------------------------------------
  1497.   # * Update Sprite Z Animation
  1498.   #--------------------------------------------------------------------------
  1499.   def update_sprite_z_animation  
  1500.       if $imported[:mog_battle_camera]
  1501.          @ani_sprites.each_with_index do |sprite, i|
  1502.          sprite.z = @ani_x + i end  
  1503.          #追加
  1504.          #sprite.z = @ani_x + i end
  1505.       else
  1506.          @ani_sprites.each_with_index do |sprite, i|
  1507.          sprite.viewport = nil ; sprite.z = @ani_x + i end
  1508.           #追加
  1509.          #sprite.viewport = nil ; sprite.z = @ani_x + i end
  1510.       end   
  1511.   end  
  1512.  
  1513. end
  1514.  
  1515. #==============================================================================
  1516. # ** Spriteset Battle
  1517. #==============================================================================
  1518. class Spriteset_Battle  
  1519.  
  1520.   #--------------------------------------------------------------------------
  1521.   # * Create Actors
  1522.   #--------------------------------------------------------------------------
  1523.   alias mog_battle_hud_create_actors create_actors
  1524.   def create_actors
  1525.       if can_create_max_members?
  1526.          @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  1527.          return
  1528.       end
  1529.       mog_battle_hud_create_actors
  1530.   end
  1531.  
  1532.   #--------------------------------------------------------------------------
  1533.   # * Can Create Max Members
  1534.   #--------------------------------------------------------------------------
  1535.   def can_create_max_members?
  1536.       return false if $imported[:ve_animated_battle]
  1537.       return false if $imported[:ve_actor_battlers]
  1538.       return false if $sv_camera != nil
  1539.       return true
  1540.   end
  1541.  
  1542. end
  1543.  
  1544. #==============================================================================
  1545. # ■ Scene Battle
  1546. #==============================================================================
  1547. class Scene_Battle < Scene_Base
  1548.  
  1549. #--------------------------------------------------------------------------
  1550. # ● Clear All Windows
  1551. #--------------------------------------------------------------------------
  1552.   alias mog_battle_hud_ex_start start
  1553.   def start
  1554.       setup_battle_hud_ex
  1555.       mog_battle_hud_ex_start
  1556.   end
  1557.  
  1558. #--------------------------------------------------------------------------
  1559. # ● Setup Battle Hud EX
  1560. #--------------------------------------------------------------------------
  1561. def setup_battle_hud_ex
  1562.      @force_clear_duration = 0
  1563. end
  1564.  
  1565. #--------------------------------------------------------------------------
  1566. # ● Clear All Windows
  1567. #--------------------------------------------------------------------------
  1568. def clear_all_windows
  1569.      if @actor_window != nil
  1570.         @actor_window.visible = false
  1571.         @actor_window.active = false
  1572.      end   
  1573.      if @status_window != nil
  1574.         @status_window.visible = false
  1575.         @status_window.active = false
  1576.      end   
  1577.      if @actor_command_window != nil
  1578.         @actor_command_window.visible = false
  1579.         @actor_command_window.active = false
  1580.      end
  1581.      if @party_command_window != nil
  1582.         @party_command_window.visible = false
  1583.         @party_command_window.active = false
  1584.      end
  1585.      if @help_window != nil
  1586.         @help_window.visible = false
  1587.      end  
  1588. end   
  1589.  
  1590. #--------------------------------------------------------------------------
  1591. # ● Update
  1592. #--------------------------------------------------------------------------
  1593.   alias mog_battle_hud_ex_update_main update
  1594.   def update
  1595.       mog_battle_hud_ex_update_main
  1596.       update_battle_hud_ex
  1597.   end
  1598.  
  1599. #--------------------------------------------------------------------------
  1600. # ● Update Battle Hud_ex
  1601. #--------------------------------------------------------------------------
  1602.   def update_battle_hud_ex
  1603.       @status_window.visible = false
  1604.   end
  1605.  
  1606.   if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1607.   #--------------------------------------------------------------------------
  1608.   # * On Skill OK
  1609.   #--------------------------------------------------------------------------
  1610.   alias mog_battle_hud_ex_on_skill_ok on_skill_ok
  1611.   def on_skill_ok
  1612.       @skill = @skill_window.item
  1613.       @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  1614.       mog_battle_hud_ex_on_skill_ok
  1615.   end
  1616.  
  1617.   #--------------------------------------------------------------------------
  1618.   # * On Item OK
  1619.   #--------------------------------------------------------------------------
  1620.   alias mog_battle_hud_on_item_ok on_item_ok
  1621.   def on_item_ok
  1622.       @item = @item_window.item
  1623.       @item_window.hide if @item.for_opponent? or @item.for_friend?
  1624.       mog_battle_hud_on_item_ok
  1625.   end     
  1626.  
  1627.   #--------------------------------------------------------------------------
  1628.   # * On Enemy Cancel
  1629.   #--------------------------------------------------------------------------
  1630.   alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
  1631.   def on_enemy_cancel
  1632.       mog_battle_hud_ex_on_enemy_cancel
  1633.       @skill_window.show if @skill_window.active
  1634.       @item_window.show if @item_window.active      
  1635.   end
  1636.  
  1637.   #--------------------------------------------------------------------------
  1638.   # * On Actor Cancel
  1639.   #--------------------------------------------------------------------------
  1640.   alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
  1641.   def on_actor_cancel
  1642.       mog_battle_hud_ex_on_actor_cancel
  1643.       @skill_window.show if @skill_window.active
  1644.       @item_window.show if @item_window.active
  1645.       mog_battle_hud_ex_on_actor_cancel
  1646.   end  
  1647.   end
  1648.  
  1649. end
  1650.  
  1651. if SceneManager.face_battler?
  1652. #==============================================================================
  1653. # ■ Game_Actor
  1654. #==============================================================================
  1655. class Game_Actor < Game_Battler
  1656.  
  1657.   attr_accessor :screen_x
  1658.   attr_accessor :screen_y
  1659.   attr_accessor :screen_z
  1660.  
  1661.  
  1662. #--------------------------------------------------------------------------
  1663. # ● Use Sprite?
  1664. #--------------------------------------------------------------------------
  1665.   def use_sprite?
  1666.       return true
  1667.   end
  1668.  
  1669. end
  1670.  
  1671. #==============================================================================
  1672. # ■ Sprite_Battler
  1673. #==============================================================================
  1674. class Sprite_Battler < Sprite_Base
  1675.   include MOG_BATTLE_HUD_EX
  1676.  
  1677.   #--------------------------------------------------------------------------
  1678.   # ● Update Collapse
  1679.   #--------------------------------------------------------------------------                          
  1680.    alias mog_battle_hud_update_collapse update_collapse
  1681.    def update_collapse
  1682.        return if face_can_cancel_method?
  1683.        mog_battle_hud_update_collapse
  1684.    end  
  1685.  
  1686.   #--------------------------------------------------------------------------
  1687.   # ● Update Instant Collapse
  1688.   #--------------------------------------------------------------------------                             
  1689.    alias mog_battle_hud_update_instant_collapse update_instant_collapse
  1690.    def update_instant_collapse
  1691.        return if face_can_cancel_method?
  1692.        mog_battle_hud_update_instant_collapse
  1693.    end  
  1694.  
  1695.   #--------------------------------------------------------------------------
  1696.   # ● Face Can Cancel Method
  1697.   #--------------------------------------------------------------------------                                 
  1698.   def face_can_cancel_method?
  1699.       return false if !SceneManager.face_battler?
  1700.       return false if @battler.is_a?(Game_Enemy)
  1701.       self.opacity = 255 ; self.visible = true
  1702.       return true
  1703.   end  
  1704.  
  1705.   #--------------------------------------------------------------------------
  1706.   # ● Update Bitmap
  1707.   #--------------------------------------------------------------------------                                 
  1708.   alias mog_battle_hud_ex_update_bitmap update_bitmap
  1709.   def update_bitmap
  1710.       return if face_can_cancel_method?
  1711.       mog_battle_hud_ex_update_bitmap
  1712.   end  
  1713.  
  1714.   #--------------------------------------------------------------------------
  1715.   # ● Update Position
  1716.   #--------------------------------------------------------------------------                                 
  1717.   alias mog_battle_hud_ex_update_position update_position
  1718.   def update_position
  1719.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  1720.          if !face_sprite_visible? or $game_temp.battle_end
  1721.              self.y = -1000
  1722.              return
  1723.          end
  1724.       end   
  1725.       mog_battle_hud_ex_update_position
  1726.   end  
  1727.  
  1728.   #--------------------------------------------------------------------------
  1729.   # * Sprite Visible
  1730.   #--------------------------------------------------------------------------
  1731.   def face_sprite_visible?
  1732.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  1733.       return false if !$game_temp.battle_hud_visible
  1734.       return true
  1735.   end  
  1736.  
  1737. end
  1738.  
  1739. end
  1740.  
  1741. #==============================================================================
  1742. # ** Window_BattleStatus
  1743. #==============================================================================
  1744. class Window_BattleStatus < Window_Selectable
  1745. include MOG_BATTLE_HUD_EX
  1746.  
  1747.   #--------------------------------------------------------------------------
  1748.   # * Get Window Width
  1749.   #--------------------------------------------------------------------------
  1750.   def window_width
  1751.       ACTOR_WINDOW_SIZE[0]
  1752.   end
  1753.  
  1754. #--------------------------------------------------------------------------
  1755. # * Refresh
  1756. #--------------------------------------------------------------------------   
  1757. alias mog_monogatari_refresh refresh
  1758. def refresh
  1759.      mog_monogatari_refresh
  1760.      self.visible = false
  1761.      self.opacity = 0
  1762.      self.contents_opacity = 0
  1763.      self.y = 1200
  1764. end  
  1765.  
  1766. end  
  1767.  
  1768. #==============================================================================
  1769. # ** Window Actor Command
  1770. #==============================================================================
  1771. class Window_ActorCommand < Window_Command
  1772.  
  1773. #--------------------------------------------------------------------------
  1774. # * Update
  1775. #--------------------------------------------------------------------------   
  1776.   alias mog_hud_battle_hud_ex_turn_sprite_update update
  1777.   def update
  1778.       mog_hud_battle_hud_ex_turn_sprite_update
  1779.       $game_temp.command_visible = self.visible
  1780.   end
  1781.  
  1782. end
  1783.  
  1784. #==============================================================================
  1785. # ** Window_BattleActor
  1786. #==============================================================================
  1787. class Window_BattleActor < Window_BattleStatus
  1788.  
  1789.   #--------------------------------------------------------------------------
  1790.   # * Refresh
  1791.   #--------------------------------------------------------------------------
  1792.   alias mog_battle_hud_ex_actor_w_refresh refresh
  1793.   def refresh
  1794.       mog_battle_hud_ex_actor_w_refresh
  1795.       self.contents_opacity = 255
  1796.       self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1797.       self.visible = true
  1798.   end
  1799.  
  1800. end  
  1801.  
  1802. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1803.  
  1804. #==============================================================================
  1805. # ** Window BattleLog
  1806. #==============================================================================
  1807. class Window_BattleLog < Window_Selectable
  1808.  
  1809.   include MOG_BATTLE_HUD_EX
  1810.  
  1811. #--------------------------------------------------------------------------
  1812. # * Initialize
  1813. #--------------------------------------------------------------------------   
  1814.   alias mog_battle_hud_ex_log_initialize initialize
  1815.   def initialize
  1816.       mog_battle_hud_ex_log_initialize
  1817.       self.x = BATTLE_LOG_POSITION[0]
  1818.       self.y = BATTLE_LOG_POSITION[1]
  1819.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1820.   end
  1821.  
  1822. #--------------------------------------------------------------------------
  1823. # * Create Back Sprite
  1824. #--------------------------------------------------------------------------   
  1825.   alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
  1826.   def create_back_sprite
  1827.       self.x = BATTLE_LOG_POSITION[0]
  1828.       self.y = BATTLE_LOG_POSITION[1]
  1829.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1830.       mog_battle_hud_ex_log_create_back_sprite
  1831.   end
  1832.  
  1833. end  
  1834.  
  1835. #==============================================================================
  1836. # ** Window Actor Command
  1837. #==============================================================================
  1838. class Window_ActorCommand < Window_Command
  1839.  
  1840.   include MOG_BATTLE_HUD_EX
  1841.  
  1842. #--------------------------------------------------------------------------
  1843. # * Initialize
  1844. #--------------------------------------------------------------------------   
  1845. alias mog_monogatari_initialize initialize
  1846. def initialize
  1847.      mog_monogatari_initialize
  1848.      create_layout if $imported[:mog_battle_command_ex] == nil
  1849. end
  1850.  
  1851. #--------------------------------------------------------------------------
  1852. # * Dispose
  1853. #--------------------------------------------------------------------------
  1854. alias mog_monogatari_actor_command_dispose dispose
  1855. def dispose
  1856.      mog_monogatari_actor_command_dispose
  1857.      dispose_layout
  1858. end
  1859.  
  1860. #--------------------------------------------------------------------------
  1861. # * Create Layout
  1862. #--------------------------------------------------------------------------   
  1863. def create_layout
  1864.      return if @layout != nil
  1865.      return if !ACTOR_COMMAND_LAYOUT
  1866.      return if $game_temp.mbhud_window[0]
  1867.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1868.      $game_temp.mbhud_window[0] = true
  1869.      @layout = Sprite.new
  1870.      @layout.bitmap = Cache.battle_hud("Layout_Command")
  1871.      @layout.z = self.z - 1
  1872.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1873.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1874.      @layout.visible = false
  1875. end
  1876.  
  1877. #--------------------------------------------------------------------------
  1878. # * Dispose Layout
  1879. #--------------------------------------------------------------------------
  1880. def dispose_layout
  1881.      return if @layout == nil
  1882.      @layout.dispose
  1883.      @layout = nil
  1884. end
  1885.  
  1886. #--------------------------------------------------------------------------
  1887. # * Refresh Layout
  1888. #--------------------------------------------------------------------------
  1889. def refresh_layout
  1890.      return if @layout == nil
  1891.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1892.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1893.      @layout.visible = self.visible
  1894.      @layout.z = self.z - 1
  1895. end
  1896.  
  1897. #--------------------------------------------------------------------------
  1898. # * Select
  1899. #--------------------------------------------------------------------------  
  1900. alias mog_monogatari_select_actor_command select
  1901. def select(index)
  1902.      mog_monogatari_select_actor_command(index)
  1903.      set_command_position if $imported[:mog_battle_command_ex] == nil
  1904. end   
  1905.  
  1906. #--------------------------------------------------------------------------
  1907. # * Set Command Position
  1908. #--------------------------------------------------------------------------   
  1909. def set_command_position
  1910.      self.viewport = nil
  1911.      self.opacity = ACTOR_COMMAND_OPACITY
  1912.      battler_index = BattleManager.current_index rescue nil
  1913.      battler_index = 0 if battler_index == nil     
  1914.      if @actor != nil and $game_temp.hud_pos[battler_index] != nil
  1915.         if FIXED_COMMAND_POSITION[battler_index] != nil
  1916.            self.x = FIXED_COMMAND_POSITION[battler_index][0]
  1917.            self.y = FIXED_COMMAND_POSITION[battler_index][1]              
  1918.         else  
  1919.            self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
  1920.            self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1921.            self.x = 0 if self.x < 0
  1922.            self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
  1923.         end   
  1924.      end      
  1925.      refresh_layout
  1926. end  
  1927.  
  1928. #--------------------------------------------------------------------------
  1929. # * Refresh
  1930. #--------------------------------------------------------------------------   
  1931. alias mog_battle_hud_ex_refresh refresh
  1932. def refresh
  1933.      mog_battle_hud_ex_refresh
  1934.      $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1935. end
  1936.  
  1937. #--------------------------------------------------------------------------
  1938. # * Update
  1939. #--------------------------------------------------------------------------  
  1940. alias mog_monogatari_actor_commnand_update update
  1941. def update     
  1942.      mog_monogatari_actor_commnand_update
  1943.      if $imported[:mog_battle_command_ex] == nil
  1944.      self.visible = self.active
  1945.      if !@layout.nil?
  1946.         refresh_layout if @layout.visible != self.visible
  1947.         @layout.visible = false if !$game_temp.sprite_visible
  1948.      end        
  1949.      self.visible = false if !$game_temp.sprite_visible     
  1950.      end
  1951. end
  1952.  
  1953. end
  1954.  
  1955. #==============================================================================
  1956. # ** Window_PartyCommand
  1957. #==============================================================================
  1958. class Window_PartyCommand < Window_Command
  1959.  
  1960.   include MOG_BATTLE_HUD_EX
  1961.  
  1962. #--------------------------------------------------------------------------
  1963. # * Initialize
  1964. #--------------------------------------------------------------------------   
  1965.   alias mog_monogatari_party_initialize initialize
  1966.   def initialize
  1967.       mog_monogatari_party_initialize
  1968.     #  self.x = @org_position[0] ; self.y = @org_position[1]
  1969.     #  self.opacity = PARTY_COMMAND_OPACITY   
  1970.       create_layout
  1971.   end
  1972.  
  1973. #--------------------------------------------------------------------------
  1974. # * Dispose
  1975. #--------------------------------------------------------------------------
  1976. alias mog_monogatari_party_window_dispose dispose
  1977. def dispose
  1978.      mog_monogatari_party_window_dispose
  1979.      dispose_layout
  1980. end
  1981.  
  1982. #--------------------------------------------------------------------------
  1983. # * Create Layout
  1984. #--------------------------------------------------------------------------   
  1985. def create_layout
  1986.      return if @layout != nil
  1987.      return if !PARTY_COMMAND_LAYOUT
  1988.      return if $game_temp.mbhud_window[1]
  1989.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1990.      $game_temp.mbhud_window[1] = true
  1991.      @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1992.      @layout = Sprite.new
  1993.      @layout.bitmap = Cache.battle_hud("Layout_Party")
  1994.      @layout.z = self.z - 1
  1995.      refresh_layout
  1996.      @layout.visible = false
  1997. end
  1998.  
  1999. #--------------------------------------------------------------------------
  2000. # * Dispose Layout
  2001. #--------------------------------------------------------------------------
  2002. def dispose_layout
  2003.      return if @layout == nil
  2004.      @layout.dispose
  2005.      @layout = nil
  2006. end
  2007.  
  2008. #--------------------------------------------------------------------------
  2009. # * Refresh Layout
  2010. #--------------------------------------------------------------------------
  2011. def refresh_layout
  2012.      return if @layout == nil
  2013.      @layout.x = @org_position_2[0]
  2014.      @layout.y = @org_position_2[1]
  2015.      @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  2016.      @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  2017.      @layout.visible = self.visible
  2018. end         
  2019.  
  2020. #--------------------------------------------------------------------------
  2021. # * Select
  2022. #--------------------------------------------------------------------------  
  2023. alias mog_monogatari_refresh_partycommand refresh
  2024. def refresh
  2025.      if @org_position == nil
  2026.       @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  2027.                        PARTY_COMMAND_POSITION[1] - (self.height / 2)]  
  2028.      end                  
  2029.      mog_monogatari_refresh_partycommand
  2030.  
  2031.       self.viewport = nil      
  2032.       self.x = @org_position[0] ; self.y = @org_position[1]
  2033.       if PARTY_COMMAND_SLIDE_EFFECT
  2034.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2035.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2036.  
  2037.       end
  2038.       self.opacity = PARTY_COMMAND_OPACITY     
  2039. end   
  2040.  
  2041. def show
  2042.  
  2043. end
  2044.  
  2045. #--------------------------------------------------------------------------
  2046. # * Show
  2047. #--------------------------------------------------------------------------   
  2048.   alias mog_bg_ex_slide_show_party show
  2049.   def show
  2050.       self.viewport = nil
  2051.       self.x = @org_position[0] ; self.y = @org_position[1]
  2052.       if PARTY_COMMAND_SLIDE_EFFECT
  2053.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2054.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2055.  
  2056.       end
  2057.       self.opacity = PARTY_COMMAND_OPACITY
  2058.       mog_bg_ex_slide_show_party
  2059.   end
  2060.  
  2061. #--------------------------------------------------------------------------
  2062. # * Update
  2063. #--------------------------------------------------------------------------  
  2064. alias mog_monogatari_party_window_update update
  2065. def update
  2066.      mog_monogatari_party_window_update  
  2067.      self.visible = self.active
  2068.      if @layout != nil and @layout.visible != self.visible        
  2069.         refresh_layout
  2070.      end
  2071.      execute_slide_effect if self.visible
  2072. end   
  2073.  
  2074. end
  2075.  
  2076. #==============================================================================
  2077. # ** Window_Help
  2078. #==============================================================================
  2079. class Window_Help < Window_Base
  2080.  
  2081.   include MOG_BATTLE_HUD_EX
  2082.  
  2083.   #--------------------------------------------------------------------------
  2084.   # * Object Initialization
  2085.   #--------------------------------------------------------------------------
  2086.   alias mog_monogatari_battle_help_initialize initialize
  2087.   def initialize(line_number = 2)
  2088.       @battle_phase = false
  2089.       mog_monogatari_battle_help_initialize(line_number)
  2090.       @wait_time = 5
  2091.       if SceneManager.scene_is?(Scene_Battle)
  2092.          @battle_phase = true         
  2093.          self.width = HELP_WINDOW_SIZE[0]
  2094.          self.height = HELP_WINDOW_SIZE[1]      
  2095.          @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2096.                           HELP_WINDOW_POSITION[1]]         
  2097.          self.x = @org_position[0]
  2098.          self.y = @org_position[1]  
  2099.          self.opacity = HELP_WINDOW_OPACITY
  2100.          self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2101.          create_layout
  2102.       end     
  2103. end
  2104.  
  2105. #--------------------------------------------------------------------------
  2106. # * Dispose
  2107. #--------------------------------------------------------------------------
  2108. alias mog_monogatari_help_window_dispose dispose
  2109. def dispose
  2110.      mog_monogatari_help_window_dispose
  2111.      dispose_layout
  2112. end
  2113.  
  2114. #--------------------------------------------------------------------------
  2115. # * Create Layout
  2116. #--------------------------------------------------------------------------   
  2117. def create_layout
  2118.      return if @layout != nil
  2119.      return if !HELP_WINDOW_LAYOUT
  2120.      return if $game_temp.mbhud_window[2]
  2121.      return if !SceneManager.scene_is?(Scene_Battle)
  2122.      $game_temp.mbhud_window[2] = true
  2123.      @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2124.      @layout = Sprite.new
  2125.      @layout.bitmap = Cache.battle_hud("Layout_Help")
  2126.      @layout.z = self.z - 1
  2127.      refresh_layout
  2128.      @layout.visible = false
  2129. end
  2130.  
  2131. #--------------------------------------------------------------------------
  2132. # * Dispose Layout
  2133. #--------------------------------------------------------------------------
  2134. def dispose_layout
  2135.      return if @layout == nil
  2136.      @layout.dispose
  2137.      @layout = nil
  2138. end
  2139.  
  2140. #--------------------------------------------------------------------------
  2141. # * Refresh Layout
  2142. #--------------------------------------------------------------------------
  2143. def refresh_layout
  2144.      return if @layout == nil
  2145.      @layout.x = @org_position_2[0]
  2146.      @layout.y = @org_position_2[1]
  2147.      @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2148.      @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2149.      @layout.visible = self.visible  
  2150. end   
  2151.  
  2152. #--------------------------------------------------------------------------
  2153. # * Show
  2154. #--------------------------------------------------------------------------   
  2155.   alias mog_bg_ex_slide_show_help show
  2156.   def show
  2157.       if @battle_phase
  2158.       self.viewport = nil
  2159.       self.x = @org_position[0] ; self.y = @org_position[1]
  2160.       if HELP_WINDOW_SLIDE_EFFECT
  2161.          self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2162.          self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2163.       end
  2164.       self.opacity = HELP_WINDOW_OPACITY
  2165.       end
  2166.       mog_bg_ex_slide_show_help
  2167.   end  
  2168.  
  2169. #--------------------------------------------------------------------------
  2170. # * Update
  2171. #--------------------------------------------------------------------------  
  2172. alias mog_monogatari_help_window_update update
  2173. def update
  2174.      if @wait_time > 0
  2175.         @wait_time -= 1
  2176.         return
  2177.      end   
  2178.      mog_monogatari_help_window_update
  2179.      if SceneManager.scene_is?(Scene_Battle)
  2180.         if @layout != nil           
  2181.            refresh_layout if @layout.visible != self.visible
  2182.            @layout.visible = self.visible
  2183.         end
  2184.         self.visible = false if !$game_temp.sprite_visible
  2185.         execute_slide_effect if self.visible        
  2186.      end
  2187. end   
  2188.  
  2189. end
  2190.  
  2191. #==============================================================================
  2192. # ** Window_BattleActor
  2193. #==============================================================================
  2194. class Window_BattleActor < Window_BattleStatus
  2195.  
  2196.   include MOG_BATTLE_HUD_EX
  2197.  
  2198.   #--------------------------------------------------------------------------
  2199.   # * Initialize
  2200.   #--------------------------------------------------------------------------   
  2201.   alias mog_monogatari_battle_actor_initialize initialize
  2202.   def initialize(info_viewport)
  2203.       @force_hide = can_force_hide?
  2204.       mog_monogatari_battle_actor_initialize(info_viewport)
  2205.       self.width = ACTOR_WINDOW_SIZE[0]
  2206.       self.height = ACTOR_WINDOW_SIZE[1]
  2207.       @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2208.                        ACTOR_WINDOW_POSITION[1] - self.height]
  2209.       @org_position[1] = Graphics.height + 64 if @force_hide
  2210.       self.x = @org_position[0]
  2211.       self.y = @org_position[1]
  2212.       self.opacity = ACTOR_WINDOW_OPACITY
  2213.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2214.       self.viewport = nil
  2215.       create_layout
  2216.   end
  2217.  
  2218.   #--------------------------------------------------------------------------
  2219.   # * Can Force Hide?
  2220.   #--------------------------------------------------------------------------   
  2221.   def can_force_hide?
  2222.       return true if $imported[:ve_target_arrow]
  2223.       return true if $imported[:mog_battle_cursor]
  2224.       return false
  2225.   end
  2226.  
  2227. #--------------------------------------------------------------------------
  2228. # * Dispose
  2229. #--------------------------------------------------------------------------
  2230. alias mog_monogatari_actor_window_dispose dispose
  2231. def dispose
  2232.      mog_monogatari_actor_window_dispose
  2233.      dispose_layout
  2234. end
  2235.  
  2236. #--------------------------------------------------------------------------
  2237. # * Create Layout
  2238. #--------------------------------------------------------------------------   
  2239. def create_layout
  2240.      return if @layout != nil
  2241.      return if !ACTOR_WINDOW_LAYOUT
  2242.      return if $game_temp.mbhud_window[3]
  2243.      $game_temp.mbhud_window[3] = true
  2244.      @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2245.      @layout = Sprite.new
  2246.      @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2247.      @layout.z = self.z - 1
  2248.      refresh_layout
  2249.      @layout.visible = false
  2250. end
  2251.  
  2252. #--------------------------------------------------------------------------
  2253. # * Dispose Layout
  2254. #--------------------------------------------------------------------------
  2255. def dispose_layout
  2256.      return if @layout == nil
  2257.      @layout.dispose
  2258.      @layout = nil
  2259. end
  2260.  
  2261. #--------------------------------------------------------------------------
  2262. # * Refresh Layout
  2263. #--------------------------------------------------------------------------
  2264. def refresh_layout
  2265.      return if @layout == nil
  2266.      @layout.x = @org_position_2[0]
  2267.      @layout.y = @org_position_2[1]
  2268.      @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2269.      @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2270.      @layout.visible = self.visible
  2271. end     
  2272.  
  2273.   if $imported[:ve_target_arrow]
  2274.   #--------------------------------------------------------------------------
  2275.   # * New method: show_actor
  2276.   #--------------------------------------------------------------------------
  2277.   alias mog_battle_hud_ex_show_actor show_actor
  2278.   def show_actor
  2279.       return true if SceneManager.face_battler?
  2280.       mog_battle_hud_ex_show_actor
  2281.   end
  2282.   end
  2283.  
  2284. #--------------------------------------------------------------------------
  2285. # * Show
  2286. #--------------------------------------------------------------------------   
  2287.   alias mog_bg_ex_slide_show_actor show
  2288.   def show
  2289.       self.viewport = nil
  2290.       self.x = @org_position[0] ; self.y = @org_position[1]
  2291.       if ACTOR_WINDOW_SLIDE_EFFECT
  2292.          self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2293.          self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2294.       end
  2295.       self.opacity = ACTOR_WINDOW_OPACITY
  2296.       mog_bg_ex_slide_show_actor
  2297.   end  
  2298.  
  2299. #--------------------------------------------------------------------------
  2300. # * Update
  2301. #--------------------------------------------------------------------------  
  2302. alias mog_monogatari_actor_window_update update
  2303. def update
  2304.      mog_monogatari_actor_window_update   
  2305.      self.visible = self.active
  2306.      self.visible = false if @force_hide
  2307.      if @layout != nil        
  2308.         refresh_layout if @layout.visible != self.visible        
  2309.      end
  2310.      if !$game_temp.sprite_visible   
  2311.         self.visible = false
  2312.         @layout.visible = self.visible if @layout != nil
  2313.      end   
  2314.      execute_slide_effect if self.visible
  2315.   end  
  2316.  
  2317. end
  2318.  
  2319. #==============================================================================
  2320. # ** Window_BattleEnemy
  2321. #==============================================================================
  2322. class Window_BattleEnemy < Window_Selectable
  2323.  
  2324.   include MOG_BATTLE_HUD_EX
  2325.  
  2326.   #--------------------------------------------------------------------------
  2327.   # * Initialize
  2328.   #--------------------------------------------------------------------------   
  2329.   alias mog_monogatari_battle_enemy_initialize initialize
  2330.   def initialize(info_viewport)
  2331.       @force_hide = can_force_hide?
  2332.       mog_monogatari_battle_enemy_initialize(info_viewport)
  2333.       self.width = ENEMY_WINDOW_SIZE[0]
  2334.       self.height = ENEMY_WINDOW_SIZE[1]      
  2335.       @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2336.                        ENEMY_WINDOW_POSITION[1] - self.height]
  2337.       @org_position[1] = Graphics.height + 64 if @force_hide               
  2338.       self.x = @org_position[0]
  2339.       self.y = @org_position[1]      
  2340.       self.opacity = ENEMY_WINDOW_OPACITY
  2341.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2342.       create_layout
  2343.   end  
  2344.  
  2345.   #--------------------------------------------------------------------------
  2346.   # * Can Force Hide?
  2347.   #--------------------------------------------------------------------------   
  2348.   def can_force_hide?
  2349.       return true if $imported[:ve_target_arrow]
  2350.       return true if $imported[:mog_battle_cursor]
  2351.       return false
  2352.   end   
  2353.  
  2354. #--------------------------------------------------------------------------
  2355. # * Dispose
  2356. #--------------------------------------------------------------------------
  2357. alias mog_monogatari_enemy_window_dispose dispose
  2358. def dispose
  2359.      mog_monogatari_enemy_window_dispose
  2360.      dispose_layout
  2361. end
  2362.  
  2363. #--------------------------------------------------------------------------
  2364. # * Create Layout
  2365. #--------------------------------------------------------------------------   
  2366. def create_layout
  2367.      return if @layout != nil
  2368.      return if !ENEMY_WINDOW_LAYOUT
  2369.      return if $game_temp.mbhud_window[4]
  2370.      $game_temp.mbhud_window[4] = true     
  2371.      @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2372.      @layout = Sprite.new
  2373.      @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2374.      @layout.z = self.z - 1
  2375.      refresh_layout
  2376.      @layout.visible = false
  2377. end
  2378.  
  2379. #--------------------------------------------------------------------------
  2380. # * Dispose Layout
  2381. #--------------------------------------------------------------------------
  2382. def dispose_layout
  2383.      return if @layout == nil
  2384.      @layout.dispose
  2385.      @layout = nil
  2386. end
  2387.  
  2388. #--------------------------------------------------------------------------
  2389. # * Refresh Layout
  2390. #--------------------------------------------------------------------------
  2391. def refresh_layout
  2392.      return if @layout == nil
  2393.      @layout.x = @org_position_2[0]
  2394.      @layout.y = @org_position_2[1]
  2395.      @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2396.      @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2397.      @layout.visible = self.visible
  2398. end      
  2399.  
  2400. #--------------------------------------------------------------------------
  2401. # * Show
  2402. #--------------------------------------------------------------------------   
  2403.   alias mog_bg_ex_slide_show_enemy show
  2404.   def show
  2405.       self.viewport = nil
  2406.       self.x = @org_position[0] ; self.y = @org_position[1]
  2407.       if ENEMY_WINDOW_SLIDE_EFFECT
  2408.          self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2409.          self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2410.       end
  2411.       self.opacity = ENEMY_WINDOW_OPACITY
  2412.       mog_bg_ex_slide_show_enemy
  2413.   end  
  2414.  
  2415. #--------------------------------------------------------------------------
  2416. # * Update
  2417. #--------------------------------------------------------------------------  
  2418. alias mog_monogatari_enemy_window_update update
  2419. def update
  2420.      mog_monogatari_enemy_window_update
  2421.      self.visible = false if @force_hide
  2422.      if @layout != nil and @layout.visible != self.visible        
  2423.         refresh_layout
  2424.      end
  2425.      if !$game_temp.sprite_visible   
  2426.         self.visible = false
  2427.         @layout.visible = self.visible if @layout != nil
  2428.      end   
  2429.      execute_slide_effect if self.visible
  2430.   end   
  2431.  
  2432.   if $imported["YEA-BattleEngine"]
  2433.   #--------------------------------------------------------------------------
  2434.   # * Draw Item
  2435.   #--------------------------------------------------------------------------
  2436.   def draw_item(index)
  2437.       change_color(normal_color)
  2438.       name = $game_troop.alive_members[index].name
  2439.       draw_text(item_rect_for_text(index), name)
  2440.   end
  2441.   end
  2442.  
  2443.   #--------------------------------------------------------------------------
  2444.   # * Process Cursor Move
  2445.   #--------------------------------------------------------------------------
  2446.   alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2447.   def process_cursor_move
  2448.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2449.       mog_atb_wenemy_process_cursor_move
  2450.   end
  2451.  
  2452.   #--------------------------------------------------------------------------
  2453.   # * Process Handling
  2454.   #--------------------------------------------------------------------------
  2455.   alias mog_atb_wenemy_process_handling process_handling
  2456.   def process_handling  
  2457.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2458.       mog_atb_wenemy_process_handling
  2459.   end  
  2460.  
  2461. end
  2462.  
  2463. #==============================================================================
  2464. # ** Window_BattleSkill
  2465. #==============================================================================
  2466. class Window_BattleSkill < Window_SkillList
  2467. include MOG_BATTLE_HUD_EX
  2468.  
  2469. #--------------------------------------------------------------------------
  2470. # * Initialize
  2471. #--------------------------------------------------------------------------   
  2472. alias mog_monogatari_battle_skill_initialize initialize
  2473. def initialize(help_window, info_viewport)
  2474.      @force_hide = can_force_hide?
  2475.      @force_hide_active = can_force_hide_active?     
  2476.      mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2477.      self.width = SKILL_WINDOW_SIZE[0]
  2478.      self.height = SKILL_WINDOW_SIZE[1]   
  2479.      @org_position = [SKILL_WINDOW_POSITION[0],
  2480.           Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2481.      self.x = @org_position[0]
  2482.      self.y = @org_position[1]
  2483.      self.opacity = SKILL_WINDOW_OPACITY
  2484.      self.viewport = nil
  2485.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2486.      create_layout
  2487. end
  2488.  
  2489. #--------------------------------------------------------------------------
  2490. # * Col Max
  2491. #--------------------------------------------------------------------------   
  2492.   def col_max
  2493.       return SKILL_COL_MAX
  2494.   end
  2495.  
  2496. #--------------------------------------------------------------------------
  2497. # * Can Force Hide Active?
  2498. #--------------------------------------------------------------------------   
  2499. def can_force_hide_active?
  2500.      return true if $imported[:ve_target_arrow]
  2501.      return true if $imported[:mog_battle_cursor] != nil
  2502.      return false
  2503. end   
  2504.  
  2505.   #--------------------------------------------------------------------------
  2506.   # * Can Force Hide?
  2507.   #--------------------------------------------------------------------------   
  2508.   def can_force_hide?
  2509.       return false
  2510.   end
  2511.  
  2512. #--------------------------------------------------------------------------
  2513. # * Dispose
  2514. #--------------------------------------------------------------------------
  2515. alias mog_monogatari_skill_window_dispose dispose
  2516. def dispose
  2517.      mog_monogatari_skill_window_dispose
  2518.      dispose_layout
  2519. end
  2520.  
  2521. #--------------------------------------------------------------------------
  2522. # * Create Layout
  2523. #--------------------------------------------------------------------------   
  2524. def create_layout
  2525.      return if @layout != nil
  2526.      return if !SKILL_WINDOW_LAYOUT
  2527.      return if $game_temp.mbhud_window[5]
  2528.      $game_temp.mbhud_window[5] = true
  2529.      @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2530.      @layout = Sprite.new
  2531.      @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2532.      @layout.z = self.z - 1
  2533.      refresh_layout
  2534.      @layout.visible = false
  2535. end
  2536.  
  2537. #--------------------------------------------------------------------------
  2538. # * Dispose Layout
  2539. #--------------------------------------------------------------------------
  2540. def dispose_layout
  2541.      return if @layout == nil
  2542.      @layout.dispose
  2543.      @layout = nil
  2544. end
  2545.  
  2546. #--------------------------------------------------------------------------
  2547. # * Refresh Layout
  2548. #--------------------------------------------------------------------------
  2549. def refresh_layout
  2550.      return if @layout == nil
  2551.      @layout.x = @org_position_2[0]
  2552.      @layout.y = @org_position_2[1]
  2553.      @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2554.      @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2555.      @layout.visible = self.visible
  2556. end  
  2557.  
  2558. #--------------------------------------------------------------------------
  2559. # * Show
  2560. #--------------------------------------------------------------------------   
  2561.   alias mog_bg_ex_slide_show_skill show
  2562.   def show
  2563.       self.viewport = nil
  2564.       self.x = @org_position[0] ; self.y = @org_position[1]
  2565.       if SKILL_WINDOW_SLIDE_EFFECT
  2566.          self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2567.          self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2568.       end
  2569.       self.opacity = SKILL_WINDOW_OPACITY
  2570.       mog_bg_ex_slide_show_skill
  2571.   end
  2572.  
  2573. #--------------------------------------------------------------------------
  2574. # * Update
  2575. #--------------------------------------------------------------------------  
  2576. alias mog_monogatari_skill_window_update update
  2577. def update
  2578.      mog_monogatari_skill_window_update
  2579.      self.visible = self.active if @force_hide_active
  2580.      self.visible = false if @force_hide
  2581.      if @layout != nil and @layout.visible != self.visible        
  2582.         refresh_layout
  2583.     end
  2584.     self.visible = false if !$game_temp.sprite_visible
  2585.     execute_slide_effect if self.visible
  2586. end
  2587.  
  2588. end
  2589.  
  2590. #==============================================================================
  2591. # ** Window_BattleItem
  2592. #==============================================================================
  2593. class Window_BattleItem < Window_ItemList
  2594.   include MOG_BATTLE_HUD_EX
  2595.  
  2596. #--------------------------------------------------------------------------
  2597. # * Initialize
  2598. #--------------------------------------------------------------------------  
  2599. alias mog_monogatari_battle_item_initialize initialize
  2600. def initialize(help_window, info_viewport)
  2601.      @force_hide = can_force_hide?
  2602.      @force_hide_active = can_force_hide_active?
  2603.      mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2604.      self.width = ITEM_WINDOW_SIZE[0]
  2605.      self.height = ITEM_WINDOW_SIZE[1]
  2606.      @org_position = [ITEM_WINDOW_POSITION[0],
  2607.           Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2608.      self.x = @org_position[0]
  2609.      self.y = @org_position[1]
  2610.      self.viewport = nil
  2611.      self.opacity = ITEM_WINDOW_OPACITY
  2612.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2613.      create_layout
  2614. end  
  2615.  
  2616. #--------------------------------------------------------------------------
  2617. # * Col Max
  2618. #--------------------------------------------------------------------------   
  2619.   def col_max
  2620.       return ITEM_COL_MAX
  2621.   end  
  2622.  
  2623. #--------------------------------------------------------------------------
  2624. # * Can Force Hide Active?
  2625. #--------------------------------------------------------------------------   
  2626. def can_force_hide_active?
  2627.      return true if $imported[:ve_target_arrow]
  2628.      return true if $imported[:mog_battle_cursor] != nil
  2629.      return false
  2630. end  
  2631.  
  2632. #--------------------------------------------------------------------------
  2633. # * Can Force Hide?
  2634. #--------------------------------------------------------------------------   
  2635. def can_force_hide?
  2636.      return false
  2637. end
  2638.  
  2639. #--------------------------------------------------------------------------
  2640. # * Dispose
  2641. #--------------------------------------------------------------------------
  2642. alias mog_monogatari_item_window_dispose dispose
  2643. def dispose
  2644.      mog_monogatari_item_window_dispose
  2645.      dispose_layout
  2646. end
  2647.  
  2648. #--------------------------------------------------------------------------
  2649. # * Create Layout
  2650. #--------------------------------------------------------------------------   
  2651. def create_layout
  2652.      return if @layout != nil
  2653.      return if !ITEM_WINDOW_LAYOUT
  2654.      return if $game_temp.mbhud_window[6]
  2655.      $game_temp.mbhud_window[6] = true
  2656.      @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2657.      @layout = Sprite.new
  2658.      @layout.bitmap = Cache.battle_hud("Layout_Item")
  2659.      @layout.z = self.z - 1
  2660.      refresh_layout
  2661.      @layout.visible = false
  2662. end
  2663.  
  2664. #--------------------------------------------------------------------------
  2665. # * Dispose Layout
  2666. #--------------------------------------------------------------------------
  2667. def dispose_layout
  2668.      return if @layout == nil
  2669.      @layout.dispose
  2670.      @layout = nil
  2671. end
  2672.  
  2673. #--------------------------------------------------------------------------
  2674. # * Refresh Layout
  2675. #--------------------------------------------------------------------------
  2676. def refresh_layout
  2677.      return if @layout == nil
  2678.      @layout.x = @org_position_2[0]
  2679.      @layout.y = @org_position_2[1]
  2680.      @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2681.      @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2682.      @layout.visible = self.visible
  2683. end  
  2684.  
  2685. #--------------------------------------------------------------------------
  2686. # * Show
  2687. #--------------------------------------------------------------------------   
  2688.   alias mog_bg_ex_slide_show_item show
  2689.   def show
  2690.       self.viewport = nil
  2691.       self.x = @org_position[0] ; self.y = @org_position[1]
  2692.       if ITEM_WINDOW_SLIDE_EFFECT
  2693.          self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2694.          self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2695.       end
  2696.       self.opacity = ITEM_WINDOW_OPACITY
  2697.       mog_bg_ex_slide_show_item      
  2698.   end
  2699.  
  2700. #--------------------------------------------------------------------------
  2701. # * Update
  2702. #--------------------------------------------------------------------------  
  2703. alias mog_monogatari_item_window_update update
  2704. def update
  2705.      mog_monogatari_item_window_update
  2706.      self.visible = self.active if @force_hide_active
  2707.      self.visible = false if @force_hide
  2708.      if @layout != nil
  2709.         refresh_layout if @layout.visible != self.visible
  2710.      end
  2711.      self.visible = false if !$game_temp.sprite_visible
  2712.      execute_slide_effect if self.visible
  2713.   end  
  2714.  
  2715. end
  2716.  
  2717. end
  2718.  
  2719. #--------------------------------------------------------------------------
  2720. #--------------------------------------------------------------------------
  2721. #################################
  2722. if $imported["YEA-BattleEngine"]
  2723. #################################
  2724.  
  2725. #==============================================================================
  2726. # ** Window_BattleStatusAid
  2727. #==============================================================================
  2728. class Window_BattleStatusAid < Window_BattleStatus
  2729.  
  2730. #--------------------------------------------------------------------------
  2731. # * Refresh
  2732. #--------------------------------------------------------------------------   
  2733.   def refresh
  2734.       contents.clear
  2735.       self.visible = false
  2736.   end
  2737.  
  2738. end
  2739.  
  2740. #==============================================================================
  2741. # ** Window_BattleStatus
  2742. #==============================================================================
  2743. class Window_BattleStatus < Window_Selectable
  2744.  
  2745. #--------------------------------------------------------------------------
  2746. # * Update
  2747. #--------------------------------------------------------------------------
  2748. alias mog_monogatari_bhud_yf_update update
  2749. def update
  2750.      mog_monogatari_bhud_yf_update
  2751.      update_visible_yf
  2752. end
  2753.  
  2754. #--------------------------------------------------------------------------
  2755. # * Update Visible Yf
  2756. #--------------------------------------------------------------------------
  2757. def update_visible_yf
  2758.      self.visible = self.active
  2759.      self.visible = false if !$game_temp.sprite_visible
  2760. end
  2761.  
  2762. end  
  2763.  
  2764. #==============================================================================
  2765. # ■ Window ActorCommand
  2766. #==============================================================================
  2767. class Window_ActorCommand < Window_Command
  2768.  
  2769. #--------------------------------------------------------------------------
  2770. # * Show
  2771. #--------------------------------------------------------------------------
  2772.   alias mog_bhud_yf_command_show show
  2773.   def show
  2774.       return if !BattleManager.can_enable_window?
  2775.       mog_bhud_yf_command_show
  2776.   end
  2777.  
  2778. #--------------------------------------------------------------------------
  2779. # * Update
  2780. #--------------------------------------------------------------------------
  2781. alias mog_monogatari_bhud_yf_actorcommand_update update
  2782. def update
  2783.      mog_monogatari_bhud_yf_actorcommand_update
  2784.      update_visible_yf
  2785. end
  2786.  
  2787. #--------------------------------------------------------------------------
  2788. # * Update Visible Yf
  2789. #--------------------------------------------------------------------------
  2790. def update_visible_yf
  2791.      self.visible = self.active
  2792.      self.visible = false if !$game_temp.sprite_visible
  2793. end
  2794.  
  2795. end
  2796.  
  2797. #==============================================================================
  2798. # ** Scene Battle
  2799. #==============================================================================
  2800. class Scene_Battle < Scene_Base
  2801.  
  2802.   include MOG_BATTLE_HUD_EX
  2803.  
  2804.   #--------------------------------------------------------------------------
  2805.   # alias method: create_skill_window
  2806.   #--------------------------------------------------------------------------
  2807.   alias mog_yf_scene_battle_create_skill_window create_skill_window
  2808.   def create_skill_window
  2809.       mog_yf_scene_battle_create_skill_window
  2810.       @skill_window.width = SKILL_WINDOW_SIZE[0]
  2811.       @skill_window.height = SKILL_WINDOW_SIZE[1]
  2812.       @skill_window.x = SKILL_WINDOW_POSITION[0]
  2813.       @skill_window.y = SKILL_WINDOW_POSITION[1]
  2814.   end
  2815.  
  2816.   #--------------------------------------------------------------------------
  2817.   # alias method: create_item_window
  2818.   #--------------------------------------------------------------------------
  2819.   alias mog_yf_scene_battle_create_item_window create_item_window
  2820.   def create_item_window
  2821.       mog_yf_scene_battle_create_item_window
  2822.       @item_window.width = ITEM_WINDOW_SIZE[0]
  2823.       @item_window.height = ITEM_WINDOW_SIZE[1]
  2824.       @item_window.x = ITEM_WINDOW_POSITION[0]
  2825.       @item_window.y = ITEM_WINDOW_POSITION[1]
  2826.   end  
  2827.  
  2828. if !$imported[:mog_atb_system]
  2829. #--------------------------------------------------------------------------
  2830. # * Next Command
  2831. #--------------------------------------------------------------------------
  2832.   def next_command
  2833.     if BattleManager.next_command
  2834.        @status_window.show
  2835.        redraw_current_status
  2836.        @actor_command_window.show
  2837.        @status_aid_window.hide      
  2838.        start_actor_command_selection
  2839.     else
  2840.       turn_start
  2841.     end
  2842.   end
  2843.   end
  2844.  
  2845. #--------------------------------------------------------------------------
  2846. # * STW Can Visible
  2847. #--------------------------------------------------------------------------   
  2848.   def stw_can_visible?
  2849.       return false if !BattleManager.can_enable_window?
  2850.       return false if @item_window.visible
  2851.       return false if @skill_window.visible
  2852.       return true if @actor_window.active
  2853.       return false
  2854.   end
  2855.  
  2856. if $imported["YEA-CommandEquip"]
  2857. #--------------------------------------------------------------------------
  2858. # * Command Equip
  2859. #--------------------------------------------------------------------------   
  2860.   alias mog_yf_command_equip command_equip
  2861.   def command_equip
  2862.       @actor_command_window.visible = false
  2863.       @actor_command_window.update
  2864.       $game_temp.battle_hud_visible_refresh = [true,false]
  2865.       @spriteset.update_battle_hud_ex
  2866.       @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2867.       mog_yf_command_equip
  2868.       $game_temp.battle_hud_visible_refresh = [true,true]
  2869.   end
  2870.   end
  2871.  
  2872. end
  2873.  
  2874. end
  2875. #--------------------------------------------------------------------------
  2876.  
  2877.  
  2878. ######################################
  2879. if $imported["YEA-EnemyTargetInfo"]
  2880. ######################################
  2881.  
  2882. #==============================================================================
  2883. # ■ Window_Comparison
  2884. #==============================================================================
  2885. class Window_Comparison < Window_Base
  2886.  
  2887.   #--------------------------------------------------------------------------
  2888.   # * Refresh
  2889.   #--------------------------------------------------------------------------     
  2890.   alias mog_battle_hud_ex_yf_refresh refresh
  2891.   def refresh
  2892.       mog_battle_hud_ex_yf_refresh
  2893.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2894.       self.viewport = nil
  2895.   end
  2896.  
  2897. end
  2898.  
  2899. #==============================================================================
  2900. # ■ Window_ComparisonHelp
  2901. #==============================================================================
  2902. class Window_ComparisonHelp < Window_Base
  2903.  
  2904.   #--------------------------------------------------------------------------
  2905.   # * Refresh
  2906.   #--------------------------------------------------------------------------     
  2907.   alias mog_battle_hud_ex_yf_refresh refresh
  2908.   def refresh
  2909.       mog_battle_hud_ex_yf_refresh
  2910.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2911.       self.viewport = nil
  2912.   end
  2913.  
  2914. end
  2915. end
  2916. #--------------------------------------------------------------------------
  2917. #--------------------------------------------------------------------------
  2918.  
  2919.  
  2920. #################################
  2921. if $imported["YEA-EnemyTargetInfo"]
  2922. #################################
  2923. class Window_Comparison < Window_Base
  2924.  
  2925.   #--------------------------------------------------------------------------
  2926.   # initialize
  2927.   #--------------------------------------------------------------------------
  2928.   alias mog_battle_hud_yf_wcomparison_initialize initialize
  2929.   def initialize(type)
  2930.       mog_battle_hud_yf_wcomparison_initialize(type)
  2931.       self.z = 102
  2932.   end  
  2933.  
  2934. end
  2935. end
  2936. #--------------------------------------------------------------------------
  2937. #--------------------------------------------------------------------------
  2938.  
  2939. #--------------------------------------------------------------------------
  2940. #--------------------------------------------------------------------------
  2941. #################################
  2942. if $imported["YSA-CATB"]
  2943. #################################
  2944.  
  2945. #==============================================================================
  2946. # ■ Enemy CATB Gauge Viewport
  2947. #==============================================================================
  2948. class Enemy_CATB_Gauge_Viewport < Viewport
  2949.  
  2950.   #--------------------------------------------------------------------------
  2951.   # initialize
  2952.   #--------------------------------------------------------------------------
  2953.   alias mog_battle_hud_ex_yami_initialize initialize
  2954.   def initialize(battler, sprite, type)
  2955.       mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2956.       self.z = 90
  2957.   end
  2958.  
  2959. end
  2960.  
  2961. #==============================================================================
  2962. # ■ Game_Battler
  2963. #==============================================================================
  2964. class Game_Battler < Game_BattlerBase
  2965.  
  2966.   attr_accessor :catb_value  
  2967.   attr_accessor :max_atb
  2968.  
  2969.   #--------------------------------------------------------------------------
  2970.   # * Max ATB
  2971.   #--------------------------------------------------------------------------   
  2972.   def max_atb
  2973.       return MAX_CATB_VALUE
  2974.       return 1
  2975.   end
  2976.  
  2977. end
  2978.  
  2979. end
  2980. #--------------------------------------------------------------------------
  2981. #--------------------------------------------------------------------------
  2982.  
  2983. #==============================================================================
  2984. # ** Window Base
  2985. #==============================================================================
  2986. class Window_Base < Window
  2987.  
  2988. #--------------------------------------------------------------------------
  2989. # * Execute Move W
  2990. #--------------------------------------------------------------------------      
  2991. def execute_move_w(sprite,type,cp,np)
  2992.      sp = 6 + ((cp - np).abs / 10)
  2993.      if cp > np ;    cp -= sp ; cp = np if cp < np
  2994.         elsif cp < np ; cp += sp ; cp = np if cp > np
  2995.      end     
  2996.      sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2997. end
  2998.  
  2999. #--------------------------------------------------------------------------
  3000. # * Set BH EX Font
  3001. #--------------------------------------------------------------------------   
  3002.   def set_bh_ex_font
  3003.       return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  3004.       self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  3005.       self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  3006.       self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  3007.       self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  3008.   end
  3009.  
  3010. #--------------------------------------------------------------------------
  3011. # * Execute Slide Effect
  3012. #--------------------------------------------------------------------------   
  3013. def execute_slide_effect
  3014.      return if @org_position == nil
  3015.      execute_move_w(self,0,self.x,@org_position[0])
  3016.      execute_move_w(self,1,self.y,@org_position[1])
  3017.      return if @layout == nil
  3018.      execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  3019.      execute_move_w(@layout,1,@layout.y,@org_position_2[1])     
  3020. end     
  3021.  
  3022. end
  3023.  
  3024. #==============================================================================
  3025. # ** Window Help
  3026. #==============================================================================
  3027. class Window_Help < Window_Base
  3028.  
  3029. #--------------------------------------------------------------------------
  3030. # * Draw Text
  3031. #--------------------------------------------------------------------------   
  3032.   alias mog_bh_ex_draw_text_help draw_text
  3033.   def draw_text(*args)
  3034.       set_bh_ex_font
  3035.       mog_bh_ex_draw_text_help(*args)
  3036.   end
  3037.  
  3038. end
  3039.  
  3040. #==============================================================================
  3041. # ** Window BattleActor
  3042. #==============================================================================
  3043. class Window_BattleActor < Window_BattleStatus
  3044.  
  3045. #--------------------------------------------------------------------------
  3046. # * Draw Item
  3047. #--------------------------------------------------------------------------   
  3048.   alias mog_bbex_draw_item_actor draw_item
  3049.   def draw_item(index)
  3050.       set_bh_ex_font
  3051.       mog_bbex_draw_item_actor(index)
  3052.   end
  3053.  
  3054. end
  3055.  
  3056. #==============================================================================
  3057. # ** Window BattleEnemy
  3058. #==============================================================================
  3059. class Window_BattleEnemy < Window_Selectable
  3060.  
  3061. #--------------------------------------------------------------------------
  3062. # * Draw Item
  3063. #--------------------------------------------------------------------------   
  3064.   alias mog_bbex_draw_item_enemy draw_item
  3065.   def draw_item(index)
  3066.       set_bh_ex_font
  3067.       mog_bbex_draw_item_enemy(index)
  3068.   end
  3069.  
  3070. end
  3071.  
  3072. #==============================================================================
  3073. # ** Window ItemList
  3074. #==============================================================================
  3075. class Window_ItemList < Window_Selectable
  3076.  
  3077. #--------------------------------------------------------------------------
  3078. # * Draw Item Name
  3079. #--------------------------------------------------------------------------   
  3080.    alias mog_bhex_draw_item_name_item draw_item_name
  3081.    def draw_item_name(item, x, y, enabled = true, width = 172)
  3082.        set_bh_ex_font
  3083.        mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  3084.    end  
  3085.  
  3086. end
  3087.  
  3088. #==============================================================================
  3089. # ** Window SkillList
  3090. #==============================================================================
  3091. class Window_SkillList < Window_Selectable  
  3092.  
  3093. #--------------------------------------------------------------------------
  3094. # * Draw Item Name
  3095. #--------------------------------------------------------------------------   
  3096.    alias mog_bhex_draw_item_name_skill draw_item_name
  3097.    def draw_item_name(item, x, y, enabled = true, width = 172)
  3098.        set_bh_ex_font
  3099.        mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  3100.    end   
  3101.  
  3102. end
  3103.  
  3104. #==============================================================================
  3105. # ** Spriteset_Battle
  3106. #==============================================================================
  3107. class Spriteset_Battle
  3108.  
  3109.   #--------------------------------------------------------------------------
  3110.   # * Initialize
  3111.   #--------------------------------------------------------------------------
  3112.   alias mog_battle_hud_ex_initialize initialize
  3113.   def initialize
  3114.       check_screen_xyz_nil rescue nil
  3115.       mog_battle_hud_ex_initialize
  3116.       create_battle_hud_ex
  3117.   end
  3118.  
  3119.   #--------------------------------------------------------------------------
  3120.   # * Check Screen Xyz
  3121.   #--------------------------------------------------------------------------   
  3122.   def check_screen_xyz_nil
  3123.       return if !SceneManager.face_battler?
  3124.       for actor in $game_party.battle_members
  3125.           actor.screen_x = 0 if actor.screen_x == nil
  3126.           actor.screen_y = 0 if actor.screen_y == nil
  3127.           actor.screen_z = 0 if actor.screen_z == nil
  3128.       end
  3129.   end
  3130.  
  3131.   #--------------------------------------------------------------------------
  3132.   # * Check Screen Xyz after
  3133.   #--------------------------------------------------------------------------     
  3134.   def check_screen_xyz_after
  3135.       return if !SceneManager.face_battler?
  3136.       $game_party.battle_members.each_with_index do |actor, index|
  3137.           actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  3138.           actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  3139.           actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  3140.       end   
  3141.   end
  3142.  
  3143.   #--------------------------------------------------------------------------
  3144.   # * Dispose
  3145.   #--------------------------------------------------------------------------  
  3146.   alias mog_battle_hud_ex_dispose dispose
  3147.   def dispose
  3148.       dispose_battle_hud_ex
  3149.       mog_battle_hud_ex_dispose
  3150.   end
  3151.  
  3152.   #--------------------------------------------------------------------------
  3153.   # * Update
  3154.   #--------------------------------------------------------------------------  
  3155.   alias mog_battle_hud_ex_update update
  3156.   def update
  3157.       mog_battle_hud_ex_update
  3158.       update_battle_hud_ex
  3159.   end
  3160.  
  3161.   #--------------------------------------------------------------------------
  3162.   # * Create Battle Hud EX
  3163.   #--------------------------------------------------------------------------   
  3164.   def create_battle_hud_ex
  3165.       return if @battle_hud_ex != nil
  3166.       $game_temp.battle_hud_visible = true
  3167.       @battle_hud_ex = Monogatari_Bhud.new(nil)
  3168.       check_screen_xyz_after
  3169.   end
  3170.  
  3171.   #--------------------------------------------------------------------------
  3172.   # * Dispose Battle Hud EX
  3173.   #--------------------------------------------------------------------------   
  3174.   def dispose_battle_hud_ex
  3175.       return if @battle_hud_ex == nil
  3176.       @battle_hud_ex.dispose
  3177.       @battle_hud_ex = nil
  3178.       $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3179.   end
  3180.  
  3181.   #--------------------------------------------------------------------------
  3182.   # * Update Battle Hud EX
  3183.   #--------------------------------------------------------------------------   
  3184.   def update_battle_hud_ex
  3185.       refresh_battle_hud if $game_temp.mbhud_force_refresh
  3186.       return if @battle_hud_ex == nil
  3187.       @battle_hud_ex.update
  3188.   end
  3189.  
  3190.   #--------------------------------------------------------------------------
  3191.   # * Refresh Battle Hud
  3192.   #--------------------------------------------------------------------------   
  3193.   def refresh_battle_hud
  3194.       $game_temp.mbhud_force_refresh = false
  3195.       check_screen_xyz_nil rescue nil
  3196.       dispose_battle_hud_ex
  3197.       create_battle_hud_ex
  3198.   end
  3199.  
  3200. end
  3201.  
  3202. #==============================================================================
  3203. # ** Monogatari Bhud
  3204. #==============================================================================
  3205. class Monogatari_Bhud
  3206.  
  3207.   include MOG_BATTLE_HUD_EX
  3208.  
  3209.   #--------------------------------------------------------------------------
  3210.   # * Initialize
  3211.   #--------------------------------------------------------------------------  
  3212.   def initialize(viewport)
  3213.       @battle_hud = [] ; @sprite_visitle_wait = 0
  3214.       $game_party.battle_members.each_with_index do |actor, index|
  3215.       @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3216.       create_turn_sprite(nil)
  3217.       create_screen_layout(nil)      
  3218.   end
  3219.  
  3220.   #--------------------------------------------------------------------------
  3221.   # * Max members
  3222.   #--------------------------------------------------------------------------   
  3223.   def max_members
  3224.       if $game_party.members.size > $game_party.max_battle_members
  3225.          return $game_party.max_battle_members
  3226.       end   
  3227.       return $game_party.members.size
  3228.   end
  3229.  
  3230.   #--------------------------------------------------------------------------
  3231.   # * Dispose
  3232.   #--------------------------------------------------------------------------   
  3233.   def dispose
  3234.       @battle_hud.each {|sprite| sprite.dispose }
  3235.       dispose_turn_sprite
  3236.       dispose_screen_layout
  3237.   end
  3238.  
  3239.   #--------------------------------------------------------------------------
  3240.   # * Update
  3241.   #--------------------------------------------------------------------------   
  3242.   def update
  3243.       @battle_hud.each {|sprite| sprite.update }
  3244.       update_turn_sprite
  3245.       update_screen_layout
  3246.       refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3247.   end
  3248.  
  3249.   #--------------------------------------------------------------------------
  3250.   # * Update
  3251.   #--------------------------------------------------------------------------   
  3252.   def refresh_battle_hud_visible
  3253.       $game_temp.battle_hud_visible_refresh[0] = false
  3254.       @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3255.       @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3256.       @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3257.       @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3258. end
  3259.  
  3260. end
  3261.  
  3262. #==============================================================================
  3263. # ** Monogatari Bhud
  3264. #==============================================================================
  3265. class Monogatari_Bhud
  3266.  
  3267. #--------------------------------------------------------------------------
  3268. # * Can Update Turn Sprite
  3269. #--------------------------------------------------------------------------
  3270.   def can_refresh_turn_sprite?
  3271.       return true if @turn_sprite.visible != $game_temp.command_visible
  3272.       return true if $game_temp.refresh_turn_sprite
  3273.       return false
  3274.   end
  3275.  
  3276. #--------------------------------------------------------------------------
  3277. # * Create Turn Sprite
  3278. #--------------------------------------------------------------------------
  3279.   def create_turn_sprite(viewport)
  3280.       return if !TURN_SPRITE_VISIBLE
  3281.       return if @turn_sprite != nil
  3282.       @turn_sprite = Sprite.new
  3283.       @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3284.       @turn_sprite.viewport = viewport
  3285.       @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3286.       @turn_sprite.visible = false
  3287.       @turn_sprite_update_time = 5
  3288.       @turn_sprite_blink = [0,0]
  3289.   end
  3290.  
  3291. #--------------------------------------------------------------------------
  3292. # * Dispose Turn Sprite
  3293. #--------------------------------------------------------------------------
  3294.   def dispose_turn_sprite
  3295.       return if @turn_sprite == nil
  3296.       @turn_sprite.dispose
  3297.       @turn_sprite = nil
  3298.   end
  3299.  
  3300. #--------------------------------------------------------------------------
  3301. # * Update Turn Sprite
  3302. #--------------------------------------------------------------------------
  3303.   def update_turn_sprite
  3304.       return if @turn_sprite == nil
  3305.       if @turn_sprite_update_time > 0
  3306.          @turn_sprite_update_time -= 1
  3307.          return
  3308.       end  
  3309.       update_turn_visible
  3310.       update_turn_blink
  3311.   end
  3312.  
  3313. #--------------------------------------------------------------------------
  3314. # * Update Turn Visible
  3315. #--------------------------------------------------------------------------   
  3316.   def update_turn_visible   
  3317.       $game_temp.refresh_turn_sprite = false
  3318.       @turn_sprite.visible = can_turn_sprite_visible?
  3319.       return if BattleManager.actor == nil
  3320.       x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3321.       y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3322.       x = -1000 if x == nil ; y = -1000 if y == nil
  3323.       @turn_sprite.x = x ; @turn_sprite.y = y      
  3324. end
  3325.  
  3326. #--------------------------------------------------------------------------
  3327. # * Can Turn Sprite Visible?
  3328. #--------------------------------------------------------------------------   
  3329. def can_turn_sprite_visible?
  3330.      return false if BattleManager.actor == nil
  3331.      return false if $game_temp.battle_end
  3332.      return false if $game_message.visible
  3333.      return true
  3334. end
  3335.  
  3336. #--------------------------------------------------------------------------
  3337. # * Update Turn Blink
  3338. #--------------------------------------------------------------------------   
  3339. def update_turn_blink
  3340.      return if !TURN_BLINK_EFFECT
  3341.      return if !@turn_sprite.visible
  3342.      @turn_sprite_blink[0] += 1
  3343.      case @turn_sprite_blink[0]
  3344.        when 0..30
  3345.           @turn_sprite_blink[1] += 3
  3346.        when 31..60
  3347.           @turn_sprite_blink[1] -= 3
  3348.        else
  3349.          @turn_sprite_blink = [0,0]
  3350.      end
  3351.      @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  3352. end
  3353.  
  3354.  
  3355. end
  3356.  
  3357. #==============================================================================
  3358. # ** Monogatari Bhud
  3359. #==============================================================================
  3360. class Monogatari_Bhud
  3361.  
  3362.   #--------------------------------------------------------------------------
  3363.   # * Create Screen Layout
  3364.   #--------------------------------------------------------------------------   
  3365.   def create_screen_layout(viewport)
  3366.       return if !SCREEN_LAYOUT
  3367.       @screen_layout = Sprite.new
  3368.       @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3369.       @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3370.       @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3371.       @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3372.       @screen_layout.opacity = 0
  3373.       @screen_layout.viewport = viewport
  3374.    end     
  3375.  
  3376.   #--------------------------------------------------------------------------
  3377.   # * Dispose Screen Layout
  3378.   #--------------------------------------------------------------------------
  3379.    def dispose_screen_layout
  3380.        return if @screen_layout == nil
  3381.        @screen_layout.dispose ; @screen_layout = nil     
  3382.    end
  3383.  
  3384.   #--------------------------------------------------------------------------
  3385.   # * Update Screen Layout
  3386.   #--------------------------------------------------------------------------
  3387.    def update_screen_layout
  3388.        return if @screen_layout == nil
  3389.        @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3390.        sprite_visible(@screen_layout)
  3391.    end
  3392.  
  3393.   #--------------------------------------------------------------------------
  3394.   # * Sprite Visible
  3395.   #--------------------------------------------------------------------------
  3396.   def sprite_visible?
  3397.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3398.       return false if !$game_temp.battle_hud_visible
  3399.       return false if !$game_temp.sprite_visible
  3400.       return true
  3401.   end
  3402.  
  3403.   #--------------------------------------------------------------------------
  3404.   # * Sprite Visible
  3405.   #--------------------------------------------------------------------------
  3406.   def sprite_visible(sprite)      
  3407.       if sprite_visible?
  3408.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3409.       else
  3410.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3411.       end
  3412.   end   
  3413.  
  3414. end
  3415.  
  3416. #==============================================================================
  3417. #==============================================================================
  3418. # ** Battle Hud EX
  3419. #==============================================================================
  3420. #==============================================================================
  3421. class Battle_Hud_EX
  3422.   include MOG_BATTLE_HUD_EX
  3423.  
  3424.   #--------------------------------------------------------------------------
  3425.   # * Initialize
  3426.   #--------------------------------------------------------------------------  
  3427.   def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3428.       pre_cache
  3429.       setup(actor,index,max_members)
  3430.       create_sprites(viewport)
  3431.   end
  3432.  
  3433.   #--------------------------------------------------------------------------
  3434.   # * Setup
  3435.   #--------------------------------------------------------------------------   
  3436.   def setup(actor,index,max_members)
  3437.       $game_temp.battle_end = false
  3438.       @actor = actor
  3439.       @actor_index = index
  3440.       @max_members = max_members
  3441.       @actor.face_animation = [0,0,0]
  3442.       @hp_icon_max = -1
  3443.       @hp_icon_old = -1
  3444.       @hp_icon_col_max = HP_ICON_COL_MAX
  3445.       @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3446.       @hp_icon_row_max = HP_ICON_ROW_MAX
  3447.       @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3448.       @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3449.       @mp_icon_max = -1
  3450.       @mp_icon_old = -1
  3451.       @mp_icon_col_max = MP_ICON_COL_MAX
  3452.       @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3453.       @mp_icon_row_max = MP_ICON_ROW_MAX
  3454.       @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3455.       @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3456.       @tp_icon_max = -1
  3457.       @tp_icon_old = -1
  3458.       @tp_icon_col_max = TP_ICON_COL_MAX
  3459.       @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3460.       @tp_icon_row_max = TP_ICON_ROW_MAX
  3461.       @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3462.       @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3463.       @sprite_visible = true
  3464.       @sprite_visitle_wait = 0
  3465.       setup_actor
  3466.       setup_position
  3467.   end
  3468.  
  3469.   #--------------------------------------------------------------------------
  3470.   # * Setup Actor
  3471.   #--------------------------------------------------------------------------   
  3472.   def setup_actor
  3473.       return if @actor == nil
  3474.       @hp_number_refresh = true
  3475.       @hp_number2_refresh = true
  3476.       @hp_number_old = @actor.hp
  3477.       @hp_number2_old = @actor.mhp
  3478.       @hp_old_meter = 0      
  3479.       @mp_number_refresh = true
  3480.       @mp_number2_refresh = true
  3481.       @mp_number_old = @actor.mp
  3482.       @mp_number2_old = @actor.mmp
  3483.       @mp_old_meter = 0      
  3484.       @tp_number_refresh = true
  3485.       @tp_number2_refresh = true
  3486.       @tp_number_old = @actor.tp
  3487.       @tp_number2_old = @actor.max_tp  
  3488.       @tp_old_meter = 0
  3489.       @at_number_refresh = true
  3490.       @at_number2_refresh = true
  3491.       @at_number_old = actor_at
  3492.       @at_number2_old = actor_max_at
  3493.       @at_old_meter = 0
  3494.       catb = ATB::MAX_AP rescue nil
  3495.       @ccwinter_atb = true if catb != nil
  3496.   end  
  3497.  
  3498.   #--------------------------------------------------------------------------
  3499.   # * Terminate
  3500.   #--------------------------------------------------------------------------   
  3501.   def terminate
  3502.       @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3503.   end
  3504.  
  3505.   #--------------------------------------------------------------------------
  3506.   # * AT
  3507.   #--------------------------------------------------------------------------  
  3508.   def actor_at
  3509.       return @actor.atb if $imported[:mog_atb_system]
  3510.       return @actor.atb if $imported[:ve_active_time_battle]
  3511.       return @actor.catb_value if $imported["YSA-CATB"]
  3512.       return @actor.ap if @ccwinter_atb != nil
  3513.       return 0
  3514.   end
  3515.  
  3516.   #--------------------------------------------------------------------------
  3517.   # * Max AT
  3518.   #--------------------------------------------------------------------------  
  3519.   def actor_max_at
  3520.       return @actor.atb_max if $imported[:mog_atb_system]
  3521.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3522.       return @actor.max_atb if $imported["YSA-CATB"]
  3523.       return ATB::MAX_AP if @ccwinter_atb != nil
  3524.       return 1
  3525.   end
  3526.  
  3527.   #--------------------------------------------------------------------------
  3528.   # ● Actor Cast
  3529.   #--------------------------------------------------------------------------            
  3530.   def actor_cast
  3531.       return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3532.       return @actor.atb if $imported[:ve_active_time_battle]
  3533.       return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3534.       return 0
  3535.   end
  3536.  
  3537.   #--------------------------------------------------------------------------
  3538.   # ● Actor Max Cast
  3539.   #--------------------------------------------------------------------------            
  3540.   def actor_max_cast
  3541.       if $imported[:mog_atb_system]
  3542.          return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3543.          return @actor.atb_cast[0].speed.abs
  3544.       end   
  3545.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3546.       return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3547.       return 1
  3548.   end
  3549.  
  3550.   #--------------------------------------------------------------------------
  3551.   # ● Actor Cast?
  3552.   #--------------------------------------------------------------------------            
  3553.   def actor_cast?   
  3554.       if $imported[:mog_atb_system]
  3555.          return true if !@actor.atb_cast.empty?
  3556.       end   
  3557.       if $imported[:ve_active_time_battle]
  3558.          return true if @actor.cast_action?
  3559.       end      
  3560.       if @ccwinter_atb
  3561.          return true if @actor.chanting?
  3562.       end
  3563.       return false
  3564.   end  
  3565.  
  3566.   #--------------------------------------------------------------------------
  3567.   # * Create Sprites
  3568.   #--------------------------------------------------------------------------   
  3569.   def create_sprites(viewport)
  3570.       dispose
  3571.       return if @actor == nil
  3572.       create_layout(viewport)
  3573.       create_layout_2(viewport)
  3574.       create_name(viewport)
  3575.       create_face(viewport)
  3576.       create_hp_number(viewport)
  3577.       create_hp_number_max(viewport)
  3578.       create_hp_meter(viewport)
  3579.       create_hp_icon(viewport)
  3580.       create_hp_icon_ex(viewport)
  3581.       create_hp_icon_number(viewport)
  3582.       create_mp_number(viewport)
  3583.       create_mp_number_max(viewport)
  3584.       create_mp_meter(viewport)
  3585.       create_mp_icon(viewport)
  3586.       create_mp_icon_ex(viewport)
  3587.       create_mp_icon_number(viewport)
  3588.       create_tp_number(viewport)
  3589.       create_tp_number_max(viewport)
  3590.       create_tp_meter(viewport)
  3591.       create_tp_icon(viewport)
  3592.       create_tp_icon_ex(viewport)
  3593.       create_tp_icon_number(viewport)
  3594.       create_at_number(viewport)
  3595.       create_at_number_max(viewport)
  3596.       create_at_meter(viewport)      
  3597.       create_level_number(viewport)
  3598.       create_states(viewport)
  3599.       update
  3600.   end   
  3601.  
  3602.   #--------------------------------------------------------------------------
  3603.   # * Sprite Visible
  3604.   #--------------------------------------------------------------------------
  3605.   def sprite_visible?
  3606.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3607.       return false if !$game_temp.battle_hud_visible
  3608.       return false if !$game_temp.sprite_visible
  3609.       return true
  3610.   end
  3611.  
  3612.   #--------------------------------------------------------------------------
  3613.   # * Sprite Visible
  3614.   #--------------------------------------------------------------------------
  3615.   def sprite_visible(sprite)
  3616.       if @sprite_visible         
  3617.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3618.       else
  3619.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3620.       end
  3621.   end
  3622.  
  3623. end
  3624.  
  3625. #==============================================================================
  3626. #==============================================================================
  3627. # ** Battle Hud EX
  3628. #==============================================================================
  3629. #==============================================================================
  3630. class Battle_Hud_EX
  3631.  
  3632.   #--------------------------------------------------------------------------
  3633.   # * Setup Position
  3634.   #--------------------------------------------------------------------------
  3635.   def setup_position
  3636.       sprite_width = (Graphics.width - 64) / 4
  3637.       sprite_center = sprite_width / 2  
  3638.       if $game_party.battle_members.size > 4
  3639.          members = $game_party.battle_members.size - 4
  3640.          fx = 32 * members
  3641.        else
  3642.          fx = 0
  3643.       end   
  3644.       space_x = MEMBERS_SPACE[0] - fx
  3645.       space_y = MEMBERS_SPACE[1]      
  3646.       center = Graphics.width / 2
  3647.       members_space = (Graphics.width + space_x) / @max_members
  3648.       members_space2 = (members_space * @actor_index)      
  3649.       members_space3 = ((members_space / 2) * (@max_members - 1))
  3650.       members_space_y = space_y * @actor_index
  3651.       x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3652.       screen_resize_y = 0
  3653.       screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3654.       y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3655.       @hud_position = [x,y]
  3656.       $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3657.       $game_temp.hud_pos_real[@actor_index] = [x,y]
  3658.       x2 = x + sprite_center
  3659.       $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3660.       $game_temp.hud_pos[@actor_index] = [x2,y]
  3661.       if FIXED_HUD_POSITION[@actor_index] != nil     
  3662.          @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3663.          $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3664.          $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3665.          $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]   
  3666.       end      
  3667.   end
  3668.  
  3669. end
  3670.  
  3671. #==============================================================================
  3672. # ** Game Temp
  3673. #==============================================================================
  3674. class Game_Temp
  3675.  
  3676.   attr_accessor :cache_bhud_sprites
  3677.  
  3678.   #--------------------------------------------------------------------------
  3679.   # * Cache Battle Hud
  3680.   #--------------------------------------------------------------------------  
  3681.   def cache_battle_hud      
  3682.       execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3683.   end
  3684.  
  3685.   #--------------------------------------------------------------------------
  3686.   # * Execute Cache Bhud Sprites
  3687.   #--------------------------------------------------------------------------  
  3688.   def execute_cache_bhud_sprites
  3689.       @cache_bhud_sprites = []
  3690.       windows = ["Layout_Command","Layout_Party","Layout_Help",
  3691.       "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3692.       "Layout_Item"]
  3693.       for s in windows
  3694.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3695.       end
  3696.       sprites = ["Layout","Layout_2",
  3697.      "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3698.      "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",  
  3699.      "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",  
  3700.      "LV_Number","Turn","Iconset","Layout_Screen"
  3701.       ]
  3702.       for s in sprites
  3703.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3704.       end      
  3705.   end
  3706.  
  3707. end
  3708.  
  3709. #==============================================================================
  3710. # ** Spriteset_Map
  3711. #==============================================================================
  3712. class Spriteset_Map
  3713.  
  3714.   #--------------------------------------------------------------------------
  3715.   # * Initialize
  3716.   #--------------------------------------------------------------------------
  3717.   alias mog_monogatari_bhud_initialize initialize
  3718.   def initialize
  3719.       $game_temp.cache_battle_hud
  3720.       mog_monogatari_bhud_initialize
  3721.   end
  3722.  
  3723. end
  3724.  
  3725. #==============================================================================
  3726. #==============================================================================
  3727. # ** Battle Hud EX
  3728. #==============================================================================
  3729. #==============================================================================
  3730. class Battle_Hud_EX
  3731.  
  3732.   #--------------------------------------------------------------------------
  3733.   # * Pre Cache
  3734.   #--------------------------------------------------------------------------
  3735.   def pre_cache
  3736.       $game_temp.cache_battle_hud
  3737.       @force_hide = false
  3738.       @force_hide_time = 0
  3739.       @fade_hud = false
  3740.       @fade_hud_gold = false     
  3741.       @fade_hud_equip = false
  3742.       @layout_image = Cache.battle_hud("Layout")
  3743.       @layout_cw = @layout_image.width
  3744.       @layout_ch = @layout_image.height
  3745.       @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3746.       @layout2_cw = @layout2_image.width if @layout2_image != nil
  3747.       @layout2_ch = @layout2_image.height if @layout2_image != nil
  3748.       @layout2_cw = 0 if @layout2_cw == nil      
  3749.       #------------------------------------------------
  3750.       # HP
  3751.       #------------------------------------------------
  3752.       if HP_NUMBER_VISIBLE
  3753.          @hp_number_image = Cache.battle_hud("HP_Number")
  3754.          @hp_number_cw = @hp_number_image.width / 10
  3755.          if HP_NUMBER_LOW_COLOR
  3756.             @hp_number_ch = @hp_number_image.height / 2
  3757.          else
  3758.             @hp_number_ch = @hp_number_image.height
  3759.          end   
  3760.          @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3761.          @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number      
  3762.       end
  3763.       if HP_NUMBER_MAX_VISIBLE
  3764.          @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3765.          @hp_number2_cw = @hp_number2_image.width / 10
  3766.          @hp_number2_ch = @hp_number2_image.height
  3767.       end
  3768.       if HP_METER_VISIBLE
  3769.          @hp_meter_image = Cache.battle_hud("HP_Meter")
  3770.          if HP_METER_GRADIENT_ANIMATION
  3771.             @hp_meter_cw = @hp_meter_image.width / 3
  3772.          else   
  3773.             @hp_meter_cw = @hp_meter_image.width
  3774.          end   
  3775.          if HP_METER_REDUCTION_ANIMATION
  3776.             @hp_meter_ch = @hp_meter_image.height / 2
  3777.          else
  3778.             @hp_meter_ch = @hp_meter_image.height
  3779.          end  
  3780.       end
  3781.       if HP_ICON_VISIBLE
  3782.          @hp_icon_image = Cache.battle_hud("HP_Icon")
  3783.          @hp_icon_cw = @hp_icon_image.width / 2
  3784.          @hp_icon_ch = @hp_icon_image.height
  3785.       end
  3786.       if HP_ICON_EX_VISIBLE
  3787.          @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3788.          @hp_icon2_cw = @hp_icon2_image.width
  3789.          @hp_icon2_ch = @hp_icon2_image.height        
  3790.       end      
  3791.       if HP_ICON_NUMBER_VISIBLE
  3792.          @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3793.          @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3794.          @hp_icon_number_ch = @hp_icon_number_image.height        
  3795.       end
  3796.       #------------------------------------------------
  3797.       # MP
  3798.       #------------------------------------------------
  3799.       if MP_NUMBER_VISIBLE
  3800.          @mp_number_image = Cache.battle_hud("MP_Number")
  3801.          @mp_number_cw = @mp_number_image.width / 10
  3802.          if MP_NUMBER_LOW_COLOR
  3803.             @mp_number_ch = @mp_number_image.height / 2
  3804.          else
  3805.             @mp_number_ch = @mp_number_image.height
  3806.         end
  3807.         @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3808.         @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3809.       end
  3810.       if MP_NUMBER_MAX_VISIBLE
  3811.          @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3812.          @mp_number2_cw = @mp_number2_image.width / 10
  3813.          @mp_number2_ch = @mp_number2_image.height
  3814.       end
  3815.       if MP_METER_VISIBLE
  3816.          @mp_meter_image = Cache.battle_hud("MP_Meter")
  3817.          if MP_METER_GRADIENT_ANIMATION
  3818.             @mp_meter_cw = @mp_meter_image.width / 3
  3819.          else   
  3820.             @mp_meter_cw = @mp_meter_image.width
  3821.          end  
  3822.          if MP_METER_REDUCTION_ANIMATION
  3823.             @mp_meter_ch = @mp_meter_image.height / 2
  3824.          else
  3825.             @mp_meter_ch = @mp_meter_image.height
  3826.          end
  3827.       end
  3828.       if MP_ICON_VISIBLE
  3829.          @mp_icon_image = Cache.battle_hud("MP_Icon")
  3830.          @mp_icon_cw = @mp_icon_image.width / 2
  3831.          @mp_icon_ch = @mp_icon_image.height
  3832.       end
  3833.       if MP_ICON_EX_VISIBLE
  3834.          @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3835.          @mp_icon2_cw = @mp_icon2_image.width
  3836.          @mp_icon2_ch = @mp_icon2_image.height        
  3837.       end      
  3838.       if MP_ICON_NUMBER_VISIBLE
  3839.          @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3840.          @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3841.          @mp_icon_number_ch = @mp_icon_number_image.height        
  3842.       end
  3843.       #------------------------------------------------
  3844.       # TP
  3845.       #------------------------------------------------
  3846.       if TP_NUMBER_VISIBLE
  3847.          @tp_number_image = Cache.battle_hud("TP_Number")
  3848.          @tp_number_cw = @tp_number_image.width / 10
  3849.          if TP_NUMBER_LOW_COLOR
  3850.             @tp_number_ch = @tp_number_image.height / 2
  3851.          else
  3852.             @tp_number_ch = @tp_number_image.height
  3853.          end  
  3854.         @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3855.         @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number      
  3856.       end
  3857.       if TP_NUMBER_MAX_VISIBLE
  3858.          @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3859.          @tp_number2_cw = @tp_number2_image.width / 10
  3860.          @tp_number2_ch = @tp_number2_image.height
  3861.       end
  3862.       if TP_METER_VISIBLE
  3863.          @tp_meter_image = Cache.battle_hud("TP_Meter")
  3864.          if TP_METER_GRADIENT_ANIMATION
  3865.             @tp_meter_cw = @tp_meter_image.width / 3
  3866.          else   
  3867.             @tp_meter_cw = @tp_meter_image.width
  3868.          end  
  3869.          if TP_METER_REDUCTION_ANIMATION
  3870.             @tp_meter_ch = @tp_meter_image.height / 2      
  3871.          else
  3872.             @tp_meter_ch = @tp_meter_image.height
  3873.          end   
  3874.       end        
  3875.       if TP_ICON_VISIBLE
  3876.          @tp_icon_image = Cache.battle_hud("TP_Icon")
  3877.          @tp_icon_cw = @tp_icon_image.width / 2
  3878.          @tp_icon_ch = @tp_icon_image.height
  3879.       end  
  3880.       if TP_ICON_EX_VISIBLE
  3881.          @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3882.          @tp_icon2_cw = @tp_icon2_image.width
  3883.          @tp_icon2_ch = @tp_icon2_image.height        
  3884.       end      
  3885.       if TP_ICON_NUMBER_VISIBLE
  3886.          @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3887.          @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3888.          @tp_icon_number_ch = @tp_icon_number_image.height        
  3889.       end
  3890.       #------------------------------------------------
  3891.       # AT
  3892.       #------------------------------------------------
  3893.       if AT_NUMBER_VISIBLE
  3894.          @at_number_image = Cache.battle_hud("AT_Number")
  3895.          @at_number_cw = @at_number_image.width / 10
  3896.          @at_number_ch = @at_number_image.height
  3897.          @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3898.          @at_number_ch += (@at_number_ch / 2) if @at_wave_number      
  3899.       end
  3900.       if AT_NUMBER_MAX_VISIBLE
  3901.          @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3902.          @at_number2_cw = @at_number2_image.width / 10
  3903.          @at_number2_ch = @at_number2_image.height
  3904.       end
  3905.       if AT_METER_VISIBLE
  3906.          @at_meter_image = Cache.battle_hud("AT_Meter")
  3907.          if AT_METER_GRADIENT_ANIMATION
  3908.             @at_meter_cw = @at_meter_image.width / 3
  3909.          else   
  3910.             @at_meter_cw = @at_meter_image.width
  3911.          end   
  3912.          @at_meter_ch = @at_meter_image.height / 3
  3913.       end
  3914.       #------------------------------------------------
  3915.       # LV
  3916.       #------------------------------------------------  
  3917.       if LEVEL_NUMBER_VISIBLE
  3918.          @lv_number_image = Cache.battle_hud("LV_Number")
  3919.          @lv_number_cw = @lv_number_image.width / 10
  3920.          @lv_number_ch = @lv_number_image.height
  3921.       end      
  3922.       #------------------------------------------------
  3923.       # ICON
  3924.       #------------------------------------------------  
  3925.       if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3926.          @icon_image = Cache.system("Iconset")
  3927.       end         
  3928.   end
  3929.  
  3930.   #--------------------------------------------------------------------------
  3931.   # * Check Icon Image
  3932.   #--------------------------------------------------------------------------         
  3933.   def check_icon_image
  3934.       if @icon_image == nil or @icon_image.disposed?
  3935.          @icon_image = Cache.system("Iconset")
  3936.       end   
  3937.   end  
  3938.  
  3939. end
  3940.  
  3941. #==============================================================================
  3942. #==============================================================================
  3943. # ** Battle Hud EX
  3944. #==============================================================================
  3945. #==============================================================================
  3946. class Battle_Hud_EX
  3947.  
  3948.   #--------------------------------------------------------------------------
  3949.   # * Update Number
  3950.   #--------------------------------------------------------------------------   
  3951.   def update_number(type,value)
  3952.       actor_value = @actor.hp if type == 0
  3953.       actor_value = @actor.mp if type == 1
  3954.       actor_value = @actor.tp if type == 2
  3955.       actor_value = @actor.mhp if type == 3
  3956.       actor_value = @actor.mmp if type == 4
  3957.       actor_value = @actor.max_tp if type == 5
  3958.       actor_value = actor_at if type == 6
  3959.       actor_value = actor_max_at if type == 7
  3960.       if value < actor_value
  3961.          value += number_refresh_speed(actor_value,value)
  3962.          value = actor_value if value >= actor_value
  3963.          refresh_sprite_number(type,value)
  3964.      elsif value > actor_value
  3965.          value -= number_refresh_speed(actor_value,value)
  3966.          value = actor_value if value <= actor_value
  3967.          refresh_sprite_number(type,value)
  3968.      end  
  3969.   end
  3970.  
  3971.   #--------------------------------------------------------------------------
  3972.   # * Number Refresh Speed
  3973.   #--------------------------------------------------------------------------      
  3974.   def number_refresh_speed(actor_value,value)
  3975.       n =  1 * (actor_value - value).abs / 10
  3976.       return [[n, 99999999].min,1].max   
  3977.   end
  3978.  
  3979.   #--------------------------------------------------------------------------
  3980.   # * Update Number Fix
  3981.   #--------------------------------------------------------------------------      
  3982.   def update_number_fix(type)
  3983.       if type == 0
  3984.          @hp_number_old =  @actor.hp
  3985.          @hp_number_refresh = true
  3986.       elsif type == 1
  3987.          @mp_number_old =  @actor.mp
  3988.          @mp_number_refresh = true
  3989.       elsif type == 2
  3990.          @tp_number_old =  @actor.tp
  3991.          @tp_number_refresh = true  
  3992.       elsif type == 3
  3993.          @hp_number2_old =  @actor.mhp
  3994.          @hp_number2_refresh = true
  3995.       elsif type == 4
  3996.          @mp_number2_old =  @actor.mmp
  3997.          @mp_number2_refresh = true
  3998.       elsif type == 5
  3999.          @tp_number2_old =  @actor.max_tp
  4000.          @tp_number2_refresh = true  
  4001.       elsif type == 6
  4002.          @at_number_old =  actor_at
  4003.          @at_number_refresh = true         
  4004.       elsif type == 7
  4005.          @at_number2_old = actor_max_at
  4006.          @at_number2_refresh = true            
  4007.       end   
  4008.   end  
  4009.  
  4010.   #--------------------------------------------------------------------------
  4011.   # * Refresh Sprite Number
  4012.   #--------------------------------------------------------------------------   
  4013.   def refresh_sprite_number(type,value)   
  4014.       @hp_number_refresh = true if type == 0
  4015.       @hp_number_old = value if type == 0
  4016.       @mp_number_refresh = true if type == 1
  4017.       @mp_number_old = value if type == 1
  4018.       @tp_number_refresh = true if type == 2
  4019.       @tp_number_old = value if type == 2
  4020.       @hp_number2_refresh = true if type == 3
  4021.       @hp_number2_old = value if type == 3
  4022.       @mp_number2_refresh = true if type == 4
  4023.       @mp_number2_old = value if type == 4
  4024.       @tp_number2_refresh = true if type == 5
  4025.       @tp_number2_old = value if type == 5
  4026.       @at_number_refresh = true if type == 6
  4027.       @at_number_old = value if type == 6
  4028.       @at_number2_refresh = true if type == 7
  4029.       @at_number2_old = value if type == 7
  4030.   end  
  4031.  
  4032.   #--------------------------------------------------------------------------
  4033.   # * Refresh Number
  4034.   #--------------------------------------------------------------------------   
  4035.   def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  4036.       sprite.bitmap.clear
  4037.       clear_number_refresh(type)
  4038.       number_color = low_number_color(type,number_ch)
  4039.       if type == 0 and HP_NUMBER_PERCENTAGE
  4040.          value_max = @actor.mhp
  4041.          value = value.to_f / value_max.to_f * 100
  4042.          value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  4043.       elsif type == 1 and MP_NUMBER_PERCENTAGE
  4044.          value_max = @actor.mmp
  4045.          value = value.to_f / value_max.to_f * 100
  4046.       elsif type == 2 and TP_NUMBER_PERCENTAGE
  4047.          value_max = @actor.max_tp
  4048.          value = value.to_f / value_max.to_f * 100  
  4049.       elsif type == 3 and HP_NUMBER_PERCENTAGE
  4050.          value = 100
  4051.       elsif type == 4 and MP_NUMBER_PERCENTAGE
  4052.          value = 100
  4053.       elsif type == 5 and TP_NUMBER_PERCENTAGE
  4054.          value = 100
  4055.       elsif type == 6 and AT_NUMBER_PERCENTAGE
  4056.          value_max = actor_max_at
  4057.          value = value.to_f / value_max.to_f * 100
  4058.       elsif type == 7 and AT_NUMBER_PERCENTAGE
  4059.          value = 100         
  4060.       end
  4061.       value = 9999999 if value > 9999999
  4062.       number_value = value.truncate.abs.to_s.split(//)
  4063.       wave_h = 0
  4064.       wave_h2 = wave_number ? (number_ch / 3) : 0
  4065.       wave_h3 = number_color != 0 ? wave_h2 : 0
  4066.       for r in 0..number_value.size - 1         
  4067.          number_value_abs = number_value[r].to_i
  4068.          wh = wave_h2 * wave_h
  4069.          wh2 = wave_h == 0 ? wave_h2 : 0
  4070.          nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  4071.          sprite.bitmap.blt(number_cw *  r, wh, image, nsrc_rect)
  4072.          wave_h = wave_h == 0 ? 1 : 0
  4073.       end
  4074.       refresh_number_position(type,number_value.size,number_cw)
  4075.   end
  4076.  
  4077.   #--------------------------------------------------------------------------
  4078.   # * Refresh Number
  4079.   #--------------------------------------------------------------------------     
  4080.   def refresh_number_position(type,number_value,number_cw)
  4081.       cx = number_value * number_cw
  4082.       if type == 0
  4083.          case HP_NUMBER_ALIGN_TYPE
  4084.            when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4085.            when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  4086.            when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  4087.          end            
  4088.       elsif type == 1
  4089.          case MP_NUMBER_ALIGN_TYPE
  4090.            when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4091.            when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  4092.            when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  4093.          end     
  4094.       elsif type == 2  
  4095.          case TP_NUMBER_ALIGN_TYPE
  4096.            when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4097.            when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  4098.            when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  4099.          end           
  4100.       elsif type == 3   
  4101.          case HP_NUMBER_ALIGN_TYPE
  4102.            when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4103.            when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4104.            when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  4105.          end           
  4106.       elsif type ==  4
  4107.          case MP_NUMBER_ALIGN_TYPE
  4108.            when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4109.            when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4110.            when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  4111.          end         
  4112.       elsif type ==  5
  4113.          case TP_NUMBER_ALIGN_TYPE
  4114.            when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4115.            when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4116.            when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  4117.          end
  4118.       elsif type ==  6     
  4119.          case MP_NUMBER_ALIGN_TYPE
  4120.            when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4121.            when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4122.            when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4123.          end            
  4124.       elsif type ==  7     
  4125.          case AT_NUMBER_ALIGN_TYPE
  4126.            when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4127.            when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4128.            when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4129.          end
  4130.       end  
  4131.   end
  4132.  
  4133.   #--------------------------------------------------------------------------
  4134.   # * Low Number Color
  4135.   #--------------------------------------------------------------------------      
  4136.   def low_number_color(type,number_ch)
  4137.       if type == 0
  4138.          if HP_NUMBER_LOW_COLOR
  4139.             return @actor.low_hp? ? number_ch : 0
  4140.          else
  4141.             return 0
  4142.          end  
  4143.       elsif type == 1
  4144.          if MP_NUMBER_LOW_COLOR   
  4145.             return @actor.low_mp? ? number_ch : 0
  4146.          else
  4147.             return 0
  4148.          end         
  4149.       elsif type == 2
  4150.          if TP_NUMBER_LOW_COLOR
  4151.             return @actor.low_tp? ? number_ch : 0
  4152.          else
  4153.             return 0
  4154.          end
  4155.       else   
  4156.          return 0  
  4157.       end     
  4158.   end
  4159.  
  4160.   #--------------------------------------------------------------------------
  4161.   # * Clear Number Refresh
  4162.   #--------------------------------------------------------------------------      
  4163.   def clear_number_refresh(type)
  4164.       @hp_number_refresh = false if type == 0
  4165.       @mp_number_refresh = false if type == 1
  4166.       @tp_number_refresh = false if type == 2
  4167.       @hp_number2_refresh = false if type == 3
  4168.       @mp_number2_refresh = false if type == 4
  4169.       @tp_number2_refresh = false if type == 5
  4170.       @at_number_refresh = false if type == 6
  4171.       @at_number2_refresh = false if type == 7
  4172.   end  
  4173.  
  4174.   #--------------------------------------------------------------------------
  4175.   # * Icon Limit
  4176.   #--------------------------------------------------------------------------      
  4177.   def icon_limit(value,value_max)
  4178.       n1 = value / value_max
  4179.       n2 = value - (n1 * value_max)
  4180.       n2 = value_max if (n2 == 0 and value > 0)
  4181.       return n2
  4182.   end  
  4183.  
  4184. end
  4185.  
  4186. #==============================================================================
  4187. #==============================================================================
  4188. # ** Battle Hud EX
  4189. #==============================================================================
  4190. #==============================================================================
  4191. class Battle_Hud_EX
  4192.  
  4193.   #--------------------------------------------------------------------------
  4194.   # * Create Layout
  4195.   #--------------------------------------------------------------------------   
  4196.   def create_layout(viewport)
  4197.       @layout = Sprite.new
  4198.       @layout.bitmap = @layout_image
  4199.       @layout.z = HUD_Z
  4200.       @layout.x = @hud_position[0]
  4201.       @layout.y = @hud_position[1]
  4202.       @layout.opacity = 0
  4203.       @layout.viewport = viewport
  4204.   end   
  4205.  
  4206.   #--------------------------------------------------------------------------
  4207.   # * Update Layout
  4208.   #--------------------------------------------------------------------------   
  4209.   def update_layout
  4210.       return if @layout == nil
  4211.       sprite_visible(@layout)
  4212.   end
  4213.  
  4214.   #--------------------------------------------------------------------------
  4215.   # * Create Layout
  4216.   #--------------------------------------------------------------------------   
  4217.   def create_layout_2(viewport)
  4218.       return if !SECOND_LAYOUT
  4219.       @layout2 = Sprite.new
  4220.       @layout2.bitmap = @layout2_image
  4221.       @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4222.       @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4223.       @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4224.       @layout2.opacity = 0
  4225.       @layout2.viewport = viewport
  4226.   end   
  4227.  
  4228.   #--------------------------------------------------------------------------
  4229.   # * Update Layout
  4230.   #--------------------------------------------------------------------------   
  4231.   def update_layout_2
  4232.       return if @layout2 == nil
  4233.       sprite_visible(@layout2)
  4234.   end  
  4235.  
  4236. end
  4237.  
  4238. #==============================================================================
  4239. #==============================================================================
  4240. # ** Battle Hud EX
  4241. #==============================================================================
  4242. #==============================================================================
  4243. class Battle_Hud_EX
  4244.  
  4245.   #--------------------------------------------------------------------------
  4246.   # * Create Name
  4247.   #--------------------------------------------------------------------------      
  4248.   def create_name(viewport)
  4249.       return if !NAME_VISIBLE
  4250.       @name = Sprite.new
  4251.       @name.bitmap = Bitmap.new(160,32)
  4252.       @name.bitmap.font.size = NAME_FONT_SIZE
  4253.       @name.bitmap.font.bold = NAME_FONT_BOLD
  4254.       @name.bitmap.font.italic = NAME_FONT_ITALIC
  4255.       @name.bitmap.font.color = NAME_FONT_COLOR
  4256.       @name.z = HUD_Z + NAME_Z
  4257.       @name.x = @hud_position[0] + NAME_POSITION[0]
  4258.       @name.y = @hud_position[1] + NAME_POSITION[1]
  4259.       @name.viewport = viewport
  4260.       @name.opacity = 0
  4261.       refresh_name
  4262.   end
  4263.  
  4264.   #--------------------------------------------------------------------------
  4265.   # * Refresh Name
  4266.   #--------------------------------------------------------------------------      
  4267.   def refresh_name
  4268.       return if @name == nil
  4269.       @name.bitmap.clear
  4270.       if NAME_FONT_SHADOW
  4271.          @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4272.          @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4273.          @name.bitmap.font.color = NAME_FONT_COLOR
  4274.       end   
  4275.       @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4276.   end
  4277.  
  4278.   #--------------------------------------------------------------------------
  4279.   # * Update Name
  4280.   #--------------------------------------------------------------------------        
  4281.   def update_name
  4282.       return if @name == nil
  4283.       sprite_visible(@name)
  4284.   end
  4285.  
  4286. end
  4287.  
  4288. #==============================================================================
  4289. #==============================================================================
  4290. # ** Battle Hud EX
  4291. #==============================================================================
  4292. #==============================================================================
  4293. class Battle_Hud_EX
  4294.  
  4295.   #--------------------------------------------------------------------------
  4296.   # * Create HP Number
  4297.   #--------------------------------------------------------------------------  
  4298.   def create_hp_number(viewport)
  4299.       return if !HP_NUMBER_VISIBLE
  4300.       @hp_number = Sprite.new
  4301.       @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4302.       @hp_number.z = HUD_Z + HP_NUMBER_Z
  4303.       @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4304.       @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4305.       @hp_number.viewport = viewport
  4306.       @hp_number.opacity = 0
  4307.   end
  4308.  
  4309.   #--------------------------------------------------------------------------
  4310.   # * Create HP Number Max
  4311.   #--------------------------------------------------------------------------  
  4312.   def create_hp_number_max(viewport)
  4313.       return if !HP_NUMBER_MAX_VISIBLE
  4314.       @hp_number2 = Sprite.new
  4315.       @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4316.       @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4317.       @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4318.       @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4319.       @hp_number2.viewport = viewport
  4320.       @hp_number2.opacity = 0
  4321.   end  
  4322.  
  4323.   #--------------------------------------------------------------------------
  4324.   # * Create HP Meter
  4325.   #--------------------------------------------------------------------------   
  4326.   def create_hp_meter(viewport)
  4327.       return if !HP_METER_VISIBLE
  4328.       @hp_flow_max = @hp_meter_cw * 2
  4329.       @hp_flow = rand(@hp_flow_max)
  4330.       @hp_meter = Sprite.new
  4331.       @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4332.       @hp_meter.z = HUD_Z + HP_METER_Z
  4333.       @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4334.       @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4335.       @hp_meter.angle = HP_METER_ANGLE
  4336.       @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4337.       @hp_meter.viewport = viewport
  4338.       @hp_meter.opacity = 0
  4339.   end
  4340.  
  4341.   #--------------------------------------------------------------------------
  4342.   # ● Update Flow HP
  4343.   #--------------------------------------------------------------------------            
  4344.   def update_flow_hp
  4345.       @hp_meter.bitmap.clear
  4346.       @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4347.       meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4348.       meter_width = 0 if meter_width == nil
  4349.       execute_hp_damage_flow(meter_width)      
  4350.       meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4351.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)  
  4352.       @hp_flow += 1
  4353.       @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4354.   end  
  4355.  
  4356.   #--------------------------------------------------------------------------
  4357.   # ● Execute HP Damage Flow
  4358.   #--------------------------------------------------------------------------
  4359.   def execute_hp_damage_flow(meter_width)
  4360.       return if !HP_METER_REDUCTION_ANIMATION
  4361.       return if @hp_old_meter == meter_width
  4362.       n = (@hp_old_meter - meter_width).abs * 3 / 100
  4363.       damage_flow = [[n, 2].min,0.5].max
  4364.       @hp_old_meter -= damage_flow
  4365.       @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4366.       src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4367.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)      
  4368.   end
  4369.  
  4370.   #--------------------------------------------------------------------------
  4371.   # * Create HP Icon
  4372.   #--------------------------------------------------------------------------  
  4373.   def create_hp_icon(viewport)
  4374.       return if !HP_ICON_VISIBLE
  4375.       @hp_icon = Sprite.new
  4376.       icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4377.       icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4378.       @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4379.       @hp_icon.z = HUD_Z + HP_ICON_Z
  4380.       @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4381.       @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4382.       @hp_icon.viewport = viewport
  4383.       @hp_icon.opacity = 0
  4384.   end
  4385.  
  4386.   #--------------------------------------------------------------------------
  4387.   # * Refresh HP Icon
  4388.   #--------------------------------------------------------------------------   
  4389.   def refresh_hp_icon
  4390.       @hp_icon_old = @actor.hp
  4391.       @hp_icon.bitmap.clear
  4392.       max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4393.       if @actor.hp > max_value
  4394.          icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4395.       else   
  4396.          icon_max = @actor.mhp
  4397.       end      
  4398.       for i in 0...icon_max
  4399.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4400.           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)
  4401.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4402.           i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4403.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )      
  4404.       end      
  4405.       icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4406.       rx = 0
  4407.       ry = 0
  4408.       for i in 0...icon_max
  4409.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4410.           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)
  4411.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4412.           i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4413.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4414.       end
  4415.       refresh_hp_icon_ex(rx,ry)      
  4416.   end
  4417.  
  4418.   #--------------------------------------------------------------------------
  4419.   # * Create HP Icon EX
  4420.   #--------------------------------------------------------------------------  
  4421.   def create_hp_icon_ex(viewport)
  4422.       return if !HP_ICON_EX_VISIBLE
  4423.       @hp_icon3_anime_phase = 0
  4424.       @hp_icon3 = Sprite.new
  4425.       @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4426.       @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4427.       @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4428.       @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4429.       @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4430.                        @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4431.       @hp_icon3.x = @hp_icon3_org[0]
  4432.       @hp_icon3.y = @hp_icon3_org[1]
  4433.       @hp_icon3.viewport = viewport
  4434.       @hp_icon3.opacity = 0
  4435.   end   
  4436.  
  4437.   #--------------------------------------------------------------------------
  4438.   # * Refresh HP Icon EX
  4439.   #--------------------------------------------------------------------------      
  4440.   def refresh_hp_icon_ex(rx,ry)
  4441.       return if @hp_icon3 == nil
  4442.       @hp_icon3.bitmap.clear
  4443.       return if @actor.hp == 0
  4444.       i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4445.       @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4446.       @hp_icon3.x = @hp_icon3_org[0] + rx
  4447.       @hp_icon3.y = @hp_icon3_org[1] + ry     
  4448.   end
  4449.  
  4450.   #--------------------------------------------------------------------------
  4451.   # * Update Icon HP EX Anime
  4452.   #--------------------------------------------------------------------------  
  4453.   def update_icon_hp_ex_anime
  4454.       return if !HP_ICON_EX_ZOOM_EFFECT
  4455.       if @hp_icon3_anime_phase == 0
  4456.          @hp_icon3.zoom_x += 0.01
  4457.          if @hp_icon3.zoom_x >= 1.30
  4458.             @hp_icon3.zoom_x = 1.30
  4459.             @hp_icon3_anime_phase = 1
  4460.          end  
  4461.       else
  4462.         @hp_icon3.zoom_x -= 0.01
  4463.         if @hp_icon3.zoom_x <= 1.05
  4464.            @hp_icon3.zoom_x = 1.05
  4465.            @hp_icon3_anime_phase = 0
  4466.         end   
  4467.       end  
  4468.       @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4469.   end
  4470.  
  4471.   #--------------------------------------------------------------------------
  4472.   # * Create HP Icon Nummber
  4473.   #--------------------------------------------------------------------------      
  4474.   def create_hp_icon_number(viewport)
  4475.       return if !HP_ICON_NUMBER_VISIBLE
  4476.       @hp_icon_number_old = [-1,-1]
  4477.       @hp_icon_number = Sprite.new
  4478.       @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4479.       @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4480.       @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4481.       @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4482.       @hp_icon_number.viewport = viewport
  4483.       @hp_icon_number.opacity = 0
  4484.   end
  4485.  
  4486.   #--------------------------------------------------------------------------
  4487.   # * Refresh Icon Number HP
  4488.   #--------------------------------------------------------------------------  
  4489.   def refresh_icon_number_hp
  4490.       @hp_icon_number_old[0] = @actor.hp
  4491.       @hp_icon_number_old[1] = @actor.mhp
  4492.       @hp_icon_number.bitmap.clear
  4493.       value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4494.       value = 0 if value < 0
  4495.       number_value = value.truncate.abs.to_s.split(//)
  4496.       for r in 0..number_value.size - 1         
  4497.          number_value_abs = number_value[r].to_i
  4498.          nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4499.          @hp_icon_number.bitmap.blt(@hp_icon_number_cw *  r, 0, @hp_icon_number_image, nsrc_rect)
  4500.       end
  4501.       cx = (number_value.size * @hp_icon_number_cw)
  4502.       case HP_ICON_NUMBER_ALIGN_TYPE
  4503.          when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4504.          when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4505.          when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4506.       end   
  4507.   end
  4508.  
  4509.   #--------------------------------------------------------------------------
  4510.   # * Can Refresh Icon Number HP
  4511.   #--------------------------------------------------------------------------  
  4512.   def can_refresh_icon_number_hp?
  4513.       return true if @hp_icon_number_old[0] != @actor.hp
  4514.       return true if @hp_icon_number_old[1] != @actor.mhp
  4515.       return false
  4516.   end
  4517.  
  4518.   #--------------------------------------------------------------------------
  4519.   # * Update HP
  4520.   #--------------------------------------------------------------------------   
  4521.   def update_hp
  4522.       if @hp_number != nil
  4523.          if HP_NUMBER_ANIMATION
  4524.             update_number(0,@hp_number_old)
  4525.          else   
  4526.             update_number_fix(0) if @hp_number_old != @actor.hp
  4527.          end
  4528.          sprite_visible(@hp_number)  
  4529.          refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4530.       end
  4531.       if @hp_number2 != nil
  4532.          if HP_NUMBER_ANIMATION
  4533.             update_number(3,@hp_number2_old)
  4534.          else   
  4535.             update_number_fix(3) if @hp_number2_old != @actor.mhp
  4536.          end  
  4537.          refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4538.          sprite_visible(@hp_number2)
  4539.       end
  4540.       if @hp_meter != nil
  4541.          sprite_visible(@hp_meter)
  4542.          update_flow_hp
  4543.       end   
  4544.       if @hp_icon != nil
  4545.          sprite_visible(@hp_icon)
  4546.          refresh_hp_icon if @hp_icon_old != @actor.hp
  4547.       end
  4548.       if @hp_icon3 != nil
  4549.          sprite_visible(@hp_icon3)
  4550.          update_icon_hp_ex_anime
  4551.       end      
  4552.       if @hp_icon_number != nil
  4553.          sprite_visible(@hp_icon_number)
  4554.          refresh_icon_number_hp if can_refresh_icon_number_hp?
  4555.       end  
  4556.   end  
  4557.  
  4558. end
  4559.  
  4560. #==============================================================================
  4561. #==============================================================================
  4562. # ** Battle Hud EX
  4563. #==============================================================================
  4564. #==============================================================================
  4565. class Battle_Hud_EX
  4566.  
  4567.   #--------------------------------------------------------------------------
  4568.   # * Create MP Number
  4569.   #--------------------------------------------------------------------------  
  4570.   def create_mp_number(viewport)
  4571.       return if !MP_NUMBER_VISIBLE
  4572.       @mp_number = Sprite.new
  4573.       @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4574.       @mp_number.z = HUD_Z + MP_NUMBER_Z
  4575.       @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4576.       @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4577.       @mp_number.viewport = viewport
  4578.       @mp_number.opacity = 0
  4579.   end
  4580.  
  4581.   #--------------------------------------------------------------------------
  4582.   # * Create MP Number Max
  4583.   #--------------------------------------------------------------------------  
  4584.   def create_mp_number_max(viewport)
  4585.       return if !MP_NUMBER_MAX_VISIBLE
  4586.       @mp_number2 = Sprite.new
  4587.       @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4588.       @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4589.       @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4590.       @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4591.       @mp_number2.viewport = viewport
  4592.       @mp_number2.opacity = 0
  4593.   end  
  4594.  
  4595.   #--------------------------------------------------------------------------
  4596.   # * Create MP Meter
  4597.   #--------------------------------------------------------------------------   
  4598.   def create_mp_meter(viewport)
  4599.       return if !MP_METER_VISIBLE
  4600.       @mp_flow_max = @mp_meter_cw * 2
  4601.       @mp_flow = rand(@mp_flow_max)
  4602.       @mp_meter = Sprite.new
  4603.       @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4604.       @mp_meter.z = HUD_Z + MP_METER_Z
  4605.       @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4606.       @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4607.       @mp_meter.angle = MP_METER_ANGLE
  4608.       @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4609.       @mp_meter.viewport = viewport
  4610.       @mp_meter.opacity = 0
  4611.   end
  4612.  
  4613.   #--------------------------------------------------------------------------
  4614.   # ● Update Flow MP
  4615.   #--------------------------------------------------------------------------            
  4616.   def update_flow_mp
  4617.       @mp_meter.bitmap.clear
  4618.       @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4619.       meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4620.       meter_width = 0 if meter_width == nil
  4621.       execute_mp_damage_flow(meter_width)      
  4622.       meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4623.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)  
  4624.       @mp_flow += 1
  4625.       @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4626.   end  
  4627.  
  4628.   #--------------------------------------------------------------------------
  4629.   # ● Execute MP Damage Flow
  4630.   #--------------------------------------------------------------------------
  4631.   def execute_mp_damage_flow(meter_width)
  4632.       return if !MP_METER_REDUCTION_ANIMATION
  4633.       return if @mp_old_meter == meter_width
  4634.       n = (@mp_old_meter - meter_width).abs * 3 / 100
  4635.       damage_flow = [[n, 2].min,0.5].max
  4636.       @mp_old_meter -= damage_flow      
  4637.       @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4638.       src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4639.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)      
  4640.   end
  4641.  
  4642.   #--------------------------------------------------------------------------
  4643.   # * Create MP Icon
  4644.   #--------------------------------------------------------------------------  
  4645.   def create_mp_icon(viewport)
  4646.       return if !MP_ICON_VISIBLE
  4647.       @mp_icon = Sprite.new
  4648.       icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4649.       icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4650.       @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4651.       @mp_icon.z = HUD_Z + MP_ICON_Z
  4652.       @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4653.       @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4654.       @mp_icon.viewport = viewport
  4655.       @mp_icon.opacity = 0
  4656.   end
  4657.  
  4658.   #--------------------------------------------------------------------------
  4659.   # * Refresh MP Icon
  4660.   #--------------------------------------------------------------------------   
  4661.   def refresh_mp_icon
  4662.       @mp_icon_old = @actor.mp
  4663.       @mp_icon.bitmap.clear
  4664.       max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4665.       if @actor.mp > max_value
  4666.          icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4667.       else   
  4668.          icon_max = @actor.mmp
  4669.       end      
  4670.       for i in 0...icon_max
  4671.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4672.           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)
  4673.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4674.           i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4675.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )      
  4676.       end      
  4677.       icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4678.       rx = 0
  4679.       ry = 0
  4680.       for i in 0...icon_max
  4681.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4682.           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)
  4683.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4684.           i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4685.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4686.       end
  4687.       refresh_mp_icon_ex(rx,ry)      
  4688.   end
  4689.  
  4690.   #--------------------------------------------------------------------------
  4691.   # * Create MP Icon EX
  4692.   #--------------------------------------------------------------------------  
  4693.   def create_mp_icon_ex(viewport)
  4694.       return if !MP_ICON_EX_VISIBLE
  4695.       @mp_icon3_anime_phase = 0
  4696.       @mp_icon3 = Sprite.new
  4697.       @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4698.       @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4699.       @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4700.       @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4701.       @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4702.                        @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4703.       @mp_icon3.x = @mp_icon3_org[0]
  4704.       @mp_icon3.y = @mp_icon3_org[1]
  4705.       @mp_icon3.viewport = viewport
  4706.       @mp_icon3.opacity = 0
  4707.   end   
  4708.  
  4709.   #--------------------------------------------------------------------------
  4710.   # * Refresh MP Icon EX
  4711.   #--------------------------------------------------------------------------      
  4712.   def refresh_mp_icon_ex(rx,ry)
  4713.       return if @mp_icon3 == nil
  4714.       @mp_icon3.bitmap.clear
  4715.       return if @actor.mp == 0
  4716.       i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4717.       @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4718.       @mp_icon3.x = @mp_icon3_org[0] + rx
  4719.       @mp_icon3.y = @mp_icon3_org[1] + ry     
  4720.   end
  4721.  
  4722.   #--------------------------------------------------------------------------
  4723.   # * Update Icon MP EX Anime
  4724.   #--------------------------------------------------------------------------  
  4725.   def update_icon_mp_ex_anime
  4726.       return if !MP_ICON_EX_ZOOM_EFFECT
  4727.       if @mp_icon3_anime_phase == 0
  4728.          @mp_icon3.zoom_x += 0.01
  4729.          if @mp_icon3.zoom_x >= 1.30
  4730.             @mp_icon3.zoom_x = 1.30
  4731.             @mp_icon3_anime_phase = 1
  4732.          end  
  4733.       else
  4734.         @mp_icon3.zoom_x -= 0.01
  4735.         if @mp_icon3.zoom_x <= 1.05
  4736.            @mp_icon3.zoom_x = 1.05
  4737.            @mp_icon3_anime_phase = 0
  4738.         end   
  4739.       end  
  4740.       @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4741.   end  
  4742.  
  4743.   #--------------------------------------------------------------------------
  4744.   # * Create MP Icon Number
  4745.   #--------------------------------------------------------------------------      
  4746.   def create_mp_icon_number(viewport)
  4747.       return if !MP_ICON_NUMBER_VISIBLE
  4748.       @mp_icon_number_old = [-1,-1]
  4749.       @mp_icon_number = Sprite.new
  4750.       @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4751.       @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4752.       @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4753.       @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4754.       @mp_icon_number.viewport = viewport
  4755.       @mp_icon_number.opacity = 0
  4756.   end
  4757.  
  4758.   #--------------------------------------------------------------------------
  4759.   # * Refresh Icon Number MP
  4760.   #--------------------------------------------------------------------------  
  4761.   def refresh_icon_number_mp
  4762.       @mp_icon_number_old[0] = @actor.mp
  4763.       @mp_icon_number_old[1] = @actor.mmp
  4764.       @mp_icon_number.bitmap.clear
  4765.       value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4766.       value = 0 if value < 0
  4767.       number_value = value.truncate.abs.to_s.split(//)
  4768.       for r in 0..number_value.size - 1         
  4769.          number_value_abs = number_value[r].to_i
  4770.          nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4771.          @mp_icon_number.bitmap.blt(@mp_icon_number_cw *  r, 0, @mp_icon_number_image, nsrc_rect)
  4772.       end
  4773.       cx = (number_value.size * @mp_icon_number_cw)
  4774.       case MP_ICON_NUMBER_ALIGN_TYPE
  4775.          when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4776.          when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4777.          when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4778.       end        
  4779.   end
  4780.  
  4781.   #--------------------------------------------------------------------------
  4782.   # * Can Refresh Icon Number MP
  4783.   #--------------------------------------------------------------------------  
  4784.   def can_refresh_icon_number_mp?
  4785.       return true if @mp_icon_number_old[0] != @actor.mp
  4786.       return true if @mp_icon_number_old[1] != @actor.mmp
  4787.       return false
  4788.   end   
  4789.  
  4790.   #--------------------------------------------------------------------------
  4791.   # * Update MP
  4792.   #--------------------------------------------------------------------------   
  4793.   def update_mp
  4794.       if @mp_number != nil
  4795.          sprite_visible(@mp_number)
  4796.          if MP_NUMBER_ANIMATION
  4797.             update_number(1,@mp_number_old)
  4798.          else
  4799.             update_number_fix(1) if @mp_number_old != @actor.mp
  4800.          end  
  4801.          refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4802.       end
  4803.       if @mp_number2 != nil
  4804.          sprite_visible(@mp_number2)
  4805.          if MP_NUMBER_ANIMATION
  4806.             update_number(4,@mp_number2_old)
  4807.          else
  4808.             update_number_fix(4) if @mp_number2_old != @actor.mmp
  4809.          end  
  4810.          refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4811.       end      
  4812.       if @mp_meter != nil
  4813.          sprite_visible(@mp_meter)
  4814.          update_flow_mp
  4815.       end
  4816.       if @mp_icon != nil
  4817.          sprite_visible(@mp_icon)
  4818.          refresh_mp_icon if @mp_icon_old != @actor.mp
  4819.       end
  4820.       if @mp_icon3 != nil
  4821.          sprite_visible(@mp_icon3)
  4822.          update_icon_mp_ex_anime
  4823.       end         
  4824.       if @mp_icon_number != nil
  4825.          sprite_visible(@mp_icon_number)
  4826.          refresh_icon_number_mp if can_refresh_icon_number_mp?
  4827.       end      
  4828.   end  
  4829.  
  4830. end
  4831.  
  4832. #==============================================================================
  4833. #==============================================================================
  4834. # ** Battle Hud EX
  4835. #==============================================================================
  4836. #==============================================================================
  4837. class Battle_Hud_EX
  4838.  
  4839.   #--------------------------------------------------------------------------
  4840.   # * Create TP Number
  4841.   #--------------------------------------------------------------------------  
  4842.   def create_tp_number(viewport)
  4843.       return if !TP_NUMBER_VISIBLE
  4844.       @tp_number = Sprite.new
  4845.       @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4846.       @tp_number.z = HUD_Z + TP_NUMBER_Z
  4847.       @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4848.       @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4849.       @tp_number.viewport = viewport
  4850.       @tp_number.opacity = 0
  4851.   end
  4852.  
  4853.   #--------------------------------------------------------------------------
  4854.   # * Create TP Number MAX
  4855.   #--------------------------------------------------------------------------  
  4856.   def create_tp_number_max(viewport)
  4857.       return if !TP_NUMBER_MAX_VISIBLE
  4858.       @tp_number2 = Sprite.new
  4859.       @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4860.       @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4861.       @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4862.       @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4863.       @tp_number2.viewport = viewport
  4864.       @tp_number2.opacity = 0
  4865.   end  
  4866.  
  4867.   #--------------------------------------------------------------------------
  4868.   # * Create TP Meter
  4869.   #--------------------------------------------------------------------------   
  4870.   def create_tp_meter(viewport)
  4871.       return if !TP_METER_VISIBLE
  4872.       @tp_flow_max = @tp_meter_cw * 2
  4873.       @tp_flow = rand(@tp_flow_max)
  4874.       @tp_meter = Sprite.new
  4875.       @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4876.       @tp_meter.z = HUD_Z + TP_METER_Z
  4877.       @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4878.       @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4879.       @tp_meter.angle = TP_METER_ANGLE
  4880.       @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4881.       @tp_meter.viewport = viewport
  4882.       @tp_meter.opacity = 0
  4883.   end
  4884.  
  4885.   #--------------------------------------------------------------------------
  4886.   # ● Update Flow TP
  4887.   #--------------------------------------------------------------------------            
  4888.   def update_flow_tp
  4889.       @tp_meter.bitmap.clear      
  4890.       @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4891.       meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil  
  4892.       meter_width = 0 if meter_width == nil
  4893.       execute_tp_damage_flow(meter_width)      
  4894.       meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4895.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)  
  4896.       @tp_flow += 1
  4897.       @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4898.   end  
  4899.  
  4900.   #--------------------------------------------------------------------------
  4901.   # ● Execute TP Damage Flow
  4902.   #--------------------------------------------------------------------------
  4903.   def execute_tp_damage_flow(meter_width)
  4904.       return if !TP_METER_REDUCTION_ANIMATION
  4905.       return if @tp_old_meter == meter_width
  4906.       n = (@tp_old_meter - meter_width).abs * 3 / 100
  4907.       damage_flow = [[n, 2].min,0.5].max
  4908.       @tp_old_meter -= damage_flow
  4909.       @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4910.       src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4911.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)      
  4912.   end
  4913.  
  4914.   #--------------------------------------------------------------------------
  4915.   # * Create TP Icon
  4916.   #--------------------------------------------------------------------------  
  4917.   def create_tp_icon(viewport)
  4918.       return if !TP_ICON_VISIBLE
  4919.       @tp_icon = Sprite.new
  4920.       icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4921.       icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4922.       @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4923.       @tp_icon.z = HUD_Z + TP_ICON_Z
  4924.       @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4925.       @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4926.       @tp_icon.viewport = viewport
  4927.       @tp_icon.opacity = 0
  4928.   end
  4929.  
  4930.   #--------------------------------------------------------------------------
  4931.   # * Refresh TP Icon
  4932.   #--------------------------------------------------------------------------   
  4933.   def refresh_tp_icon
  4934.       @tp_icon_old = @actor.tp
  4935.       @tp_icon.bitmap.clear
  4936.       max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4937.       if @actor.mp > max_value
  4938.          icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4939.       else   
  4940.          icon_max = @actor.max_tp
  4941.       end      
  4942.       for i in 0...icon_max
  4943.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4944.           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)
  4945.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4946.           i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4947.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )      
  4948.       end      
  4949.       icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4950.       rx = 0
  4951.       ry = 0
  4952.       for i in 0...icon_max
  4953.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4954.           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)
  4955.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4956.           i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4957.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4958.       end
  4959.       refresh_tp_icon_ex(rx,ry)      
  4960.   end
  4961.  
  4962.   #--------------------------------------------------------------------------
  4963.   # * Create TP Icon EX
  4964.   #--------------------------------------------------------------------------  
  4965.   def create_tp_icon_ex(viewport)
  4966.       return if !TP_ICON_EX_VISIBLE
  4967.       @tp_icon3_anime_phase = 0
  4968.       @tp_icon3 = Sprite.new
  4969.       @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4970.       @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4971.       @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4972.       @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4973.       @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4974.                        @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4975.       @tp_icon3.x = @tp_icon3_org[0]
  4976.       @tp_icon3.y = @tp_icon3_org[1]
  4977.       @tp_icon3.viewport = viewport
  4978.       @tp_icon3.opacity = 0
  4979.   end   
  4980.  
  4981.   #--------------------------------------------------------------------------
  4982.   # * Refresh TP Icon EX
  4983.   #--------------------------------------------------------------------------      
  4984.   def refresh_tp_icon_ex(rx,ry)
  4985.       return if @tp_icon3 == nil
  4986.       @tp_icon3.bitmap.clear
  4987.       return if @actor.tp == 0
  4988.       i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4989.       @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4990.       @tp_icon3.x = @tp_icon3_org[0] + rx
  4991.       @tp_icon3.y = @tp_icon3_org[1] + ry     
  4992.   end
  4993.  
  4994.   #--------------------------------------------------------------------------
  4995.   # * Update Icon TP EX Anime
  4996.   #--------------------------------------------------------------------------  
  4997.   def update_icon_tp_ex_anime
  4998.       return if !MP_ICON_EX_ZOOM_EFFECT
  4999.       if @tp_icon3_anime_phase == 0
  5000.          @tp_icon3.zoom_x += 0.01
  5001.          if @tp_icon3.zoom_x >= 1.30
  5002.             @tp_icon3.zoom_x = 1.30
  5003.             @tp_icon3_anime_phase = 1
  5004.          end  
  5005.       else
  5006.         @tp_icon3.zoom_x -= 0.01
  5007.         if @tp_icon3.zoom_x <= 1.05
  5008.            @tp_icon3.zoom_x = 1.05
  5009.            @tp_icon3_anime_phase = 0
  5010.         end   
  5011.       end  
  5012.       @tp_icon3.zoom_y = @tp_icon3.zoom_x
  5013.   end   
  5014.  
  5015.   #--------------------------------------------------------------------------
  5016.   # * Create HP Icon Number
  5017.   #--------------------------------------------------------------------------      
  5018.   def create_tp_icon_number(viewport)
  5019.       return if !TP_ICON_NUMBER_VISIBLE
  5020.       @tp_icon_number_old = [-1,-1]
  5021.       @tp_icon_number = Sprite.new
  5022.       @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  5023.       @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  5024.       @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5025.       @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  5026.       @tp_icon_number.viewport = viewport
  5027.       @tp_icon_number.opacity = 0
  5028.   end
  5029.  
  5030.   #--------------------------------------------------------------------------
  5031.   # * Refresh Icon Number TP
  5032.   #--------------------------------------------------------------------------  
  5033.   def refresh_icon_number_tp
  5034.       @tp_icon_number_old[0] = @actor.tp
  5035.       @tp_icon_number_old[1] = @actor.max_tp
  5036.       @tp_icon_number.bitmap.clear
  5037.       value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  5038.       value = 0 if value < 0
  5039.       number_value = value.truncate.abs.to_s.split(//)
  5040.       for r in 0..number_value.size - 1         
  5041.          number_value_abs = number_value[r].to_i
  5042.          nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  5043.          @tp_icon_number.bitmap.blt(@tp_icon_number_cw *  r, 0, @tp_icon_number_image, nsrc_rect)
  5044.       end
  5045.       cx = (number_value.size * @tp_icon_number_cw)
  5046.       case TP_ICON_NUMBER_ALIGN_TYPE
  5047.          when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5048.          when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  5049.          when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  5050.       end        
  5051.   end
  5052.  
  5053.   #--------------------------------------------------------------------------
  5054.   # * Can Refresh Icon Number TP
  5055.   #--------------------------------------------------------------------------  
  5056.   def can_refresh_icon_number_tp?
  5057.       return true if @tp_icon_number_old[0] != @actor.tp
  5058.       return true if @tp_icon_number_old[1] != @actor.max_tp
  5059.       return false
  5060.   end   
  5061.  
  5062.   #--------------------------------------------------------------------------
  5063.   # * Update TP
  5064.   #--------------------------------------------------------------------------   
  5065.   def update_tp
  5066.       if @tp_number != nil
  5067.          sprite_visible(@tp_number)
  5068.          if MP_NUMBER_ANIMATION
  5069.             update_number(2,@tp_number_old)
  5070.          else
  5071.             update_number_fix(2) if @tp_number_old != @actor.tp
  5072.          end           
  5073.          refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh         
  5074.       end   
  5075.       if @tp_number2 != nil
  5076.          sprite_visible(@tp_number2)
  5077.          if MP_NUMBER_ANIMATION
  5078.             update_number(5,@tp_number2_old)
  5079.          else
  5080.             update_number_fix(5) if @tp_number2_old != @actor.max_tp
  5081.          end           
  5082.          refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  5083.       end        
  5084.       if @tp_meter != nil
  5085.          sprite_visible(@tp_meter)
  5086.          update_flow_tp
  5087.       end
  5088.       if @tp_icon != nil
  5089.          sprite_visible(@tp_icon)
  5090.          refresh_tp_icon if @tp_icon_old != @actor.tp
  5091.       end
  5092.       if @tp_icon3 != nil
  5093.          sprite_visible(@tp_icon3)
  5094.          update_icon_tp_ex_anime
  5095.       end         
  5096.       if @tp_icon_number != nil
  5097.          sprite_visible(@tp_icon_number)
  5098.          refresh_icon_number_tp if can_refresh_icon_number_tp?
  5099.       end  
  5100.   end  
  5101.  
  5102. end
  5103.  
  5104. #==============================================================================
  5105. #==============================================================================
  5106. # ** Battle Hud EX
  5107. #==============================================================================
  5108. #==============================================================================
  5109. class Battle_Hud_EX
  5110.  
  5111.   #--------------------------------------------------------------------------
  5112.   # * Create AT Number
  5113.   #--------------------------------------------------------------------------  
  5114.   def create_at_number(viewport)
  5115.       return if !AT_NUMBER_VISIBLE
  5116.       @at_number = Sprite.new
  5117.       @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  5118.       @at_number.z = HUD_Z + AT_NUMBER_Z
  5119.       @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  5120.       @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  5121.       @at_number.viewport = viewport
  5122.       @at_number.opacity = 0
  5123.   end
  5124.  
  5125.   #--------------------------------------------------------------------------
  5126.   # * Create AT Number Max
  5127.   #--------------------------------------------------------------------------  
  5128.   def create_at_number_max(viewport)
  5129.       return if !AT_NUMBER_MAX_VISIBLE
  5130.       @at_number2 = Sprite.new
  5131.       @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  5132.       @at_number2.z = HUD_Z + AT_NUMBER_Z
  5133.       @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  5134.       @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  5135.       @at_number2.viewport = viewport
  5136.       @at_number2.opacity = 0
  5137.   end  
  5138.  
  5139.   #--------------------------------------------------------------------------
  5140.   # * Create AT Meter
  5141.   #--------------------------------------------------------------------------   
  5142.   def create_at_meter(viewport)
  5143.       return if !AT_METER_VISIBLE
  5144.       @at_flow_max = @at_meter_cw * 2
  5145.       @at_flow = rand(@at_flow_max)
  5146.       @at_meter = Sprite.new
  5147.       @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  5148.       @at_meter.z = HUD_Z + AT_METER_Z
  5149.       @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  5150.       @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  5151.       @at_meter.angle = AT_METER_ANGLE
  5152.       @at_meter.mirror = AT_METER_MIRROR_EFFECT
  5153.       @at_meter.viewport = viewport
  5154.       @at_meter.opacity = 0
  5155.   end
  5156.  
  5157.   #--------------------------------------------------------------------------
  5158.   # ● Update Flow AT
  5159.   #--------------------------------------------------------------------------            
  5160.   def update_flow_at
  5161.       @at_meter.bitmap.clear
  5162.       @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  5163.       if actor_cast?
  5164.          meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  5165.          meter_width = 0 if meter_width == nil
  5166.          ch = @at_meter_ch * 2
  5167.       else
  5168.          meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  5169.          meter_width = 0 if meter_width == nil         
  5170.          ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  5171.       end   
  5172.       meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  5173.       @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)  
  5174.       @at_flow += 1
  5175.       @at_flow = 0 if @at_flow >= @at_flow_max
  5176.   end  
  5177.  
  5178.   #--------------------------------------------------------------------------
  5179.   # * Update AT
  5180.   #--------------------------------------------------------------------------   
  5181.   def update_at
  5182.       if @at_number != nil
  5183.          sprite_visible(@at_number)
  5184.          if AT_NUMBER_ANIMATION
  5185.             update_number(6,@at_number_old)
  5186.          else   
  5187.             update_number_fix(6) if @at_number_old != actor_at
  5188.          end  
  5189.          refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5190.       end
  5191.       if @at_number2 != nil
  5192.          sprite_visible(@at_number2)
  5193.          if AT_NUMBER_ANIMATION
  5194.             update_number(7,@at_number2_old)
  5195.          else   
  5196.             update_number_fix(7) if @at_number2_old != actor_max_at
  5197.          end  
  5198.          refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5199.       end
  5200.       if @at_meter != nil
  5201.          sprite_visible(@at_meter)
  5202.          update_flow_at
  5203.       end   
  5204.   end  
  5205.  
  5206. end
  5207.  
  5208. #==============================================================================
  5209. #==============================================================================
  5210. # ** Battle Hud EX
  5211. #==============================================================================
  5212. #==============================================================================
  5213. class Battle_Hud_EX
  5214.  
  5215.   #--------------------------------------------------------------------------
  5216.   # * Create Level Number
  5217.   #--------------------------------------------------------------------------   
  5218.   def create_level_number(viewport)
  5219.       return if !LEVEL_NUMBER_VISIBLE
  5220.       @old_level = -1
  5221.       @lv_number = Sprite.new
  5222.       @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5223.       @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5224.       @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5225.       @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5226.       @lv_number.viewport = viewport
  5227.       @lv_number.opacity = 0
  5228.   end
  5229.  
  5230.   #--------------------------------------------------------------------------
  5231.   # * Refresh Level Number
  5232.   #--------------------------------------------------------------------------  
  5233.   def refresh_level_number
  5234.       @lv_number.bitmap.clear
  5235.       @old_level = @actor.level      
  5236.       number_value = @actor.level.abs.to_s.split(//)
  5237.       for r in 0..number_value.size - 1         
  5238.          number_value_abs = number_value[r].to_i
  5239.          nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5240.          @lv_number.bitmap.blt(@lv_number_cw *  r, 0, @lv_number_image, nsrc_rect)
  5241.       end
  5242.       cx = (number_value.size * @lv_number_cw)
  5243.       case LEVEL_NUMBER_ALIGN_TYPE
  5244.            when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5245.            when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5246.            when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5247.       end
  5248.   end
  5249.  
  5250.   #--------------------------------------------------------------------------
  5251.   # * Update Level
  5252.   #--------------------------------------------------------------------------  
  5253.   def update_level
  5254.       return if @lv_number == nil
  5255.       sprite_visible(@lv_number)
  5256.       refresh_level_number if @old_level != @actor.level
  5257.   end
  5258.  
  5259. end
  5260.  
  5261. #==============================================================================
  5262. #==============================================================================
  5263. # ** Battle Hud EX
  5264. #==============================================================================
  5265. #==============================================================================
  5266. class Battle_Hud_EX
  5267.  
  5268.   #--------------------------------------------------------------------------
  5269.   # * Create States
  5270.   #--------------------------------------------------------------------------  
  5271.   def create_states(viewport)
  5272.       return if !STATES_VISIBLE
  5273.       @status_old = nil
  5274.       @status_flow = [-24,0]
  5275.       @status_size_real = 0
  5276.       @status = Sprite.new
  5277.       @status.bitmap = Bitmap.new(24,24)
  5278.       @status.x = @hud_position[0] + STATES_POSITION[0]
  5279.       @status.y = @hud_position[1] + STATES_POSITION[1]
  5280.       @status.z = HUD_Z + STATES_Z
  5281.       @status.angle = STATE_ANGLE
  5282.       @status.viewport = viewport
  5283.       @status.opacity = 0
  5284.   end
  5285.  
  5286.   #--------------------------------------------------------------------------
  5287.   # * Refresh States
  5288.   #--------------------------------------------------------------------------        
  5289.   def refresh_states
  5290.       check_icon_image
  5291.       @status_size_real = set_real_states_size
  5292.       @status_old = @actor.states
  5293.       @status_flow = [0,0]
  5294.       @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5295.       @actor_status.dispose if @actor_status != nil
  5296.       @actor_status = Bitmap.new(@states_size,24)
  5297.       index = 0
  5298.       for i in @actor.states
  5299.          next if HIDE_STATES_ID.include?(i.id)         
  5300.          rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5301.          @actor_status.blt(26 * index , 0, @icon_image, rect)
  5302.          index += 1
  5303.       end
  5304.   end   
  5305.  
  5306.   #--------------------------------------------------------------------------
  5307.   # * Set Real States Size
  5308.   #--------------------------------------------------------------------------        
  5309.   def set_real_states_size
  5310.       n = 0
  5311.       for i in @actor.states
  5312.           next if HIDE_STATES_ID.include?(i.id)  
  5313.           n += 1
  5314.       end
  5315.       return n
  5316.   end
  5317.  
  5318.   #--------------------------------------------------------------------------
  5319.   # * Flow_Status
  5320.   #--------------------------------------------------------------------------         
  5321.   def flow_states
  5322.       return if @actor_status == nil
  5323.       @status.bitmap.clear
  5324.       return if @actor.states.size == 0
  5325.       st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5326.       @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5327.       if STATES_SCROLLING_ANIMATION
  5328.          @status_flow[0] += 1
  5329.          @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5330.       else   
  5331.          @status_flow[1] += 1 unless @actor.states.size <= 1
  5332.          if @status_flow[1] > 30
  5333.             @status_flow[1] = 0
  5334.             @status_flow[0] += 26
  5335.             @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5336.          end   
  5337.      end   
  5338.   end      
  5339.  
  5340.   #--------------------------------------------------------------------------
  5341.   # * Update States
  5342.   #--------------------------------------------------------------------------  
  5343.   def update_states
  5344.       return if @status == nil
  5345.       sprite_visible(@status)
  5346.       refresh_states if @status_old != @actor.states
  5347.       flow_states
  5348.   end  
  5349.  
  5350. end
  5351.  
  5352. #==============================================================================
  5353. #==============================================================================
  5354. # ** Battle Hud EX
  5355. #==============================================================================
  5356. #==============================================================================
  5357. class Battle_Hud_EX
  5358.  
  5359.   #--------------------------------------------------------------------------
  5360.   # * Create Face
  5361.   #--------------------------------------------------------------------------   
  5362.   def create_face(viewport)
  5363.       return if !FACE_VISIBLE
  5364.       @face_old_hp = @actor.hp
  5365.       @face_old_mp = @actor.mp
  5366.       @face_old_tp = @actor.tp
  5367.       @face_name = ""
  5368.       @face = Sprite.new
  5369.       @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5370.       @face.x = @face_org[0]
  5371.       @face.y = @face_org[1]
  5372.       @face.z = HUD_Z + FACE_Z
  5373.       @face.viewport = viewport
  5374.       @face.opacity = 0
  5375.       refresh_face_name
  5376.   end
  5377.  
  5378.   #--------------------------------------------------------------------------
  5379.   # * Refresh Face Name
  5380.   #--------------------------------------------------------------------------      
  5381.   def refresh_face_name      
  5382.       @face_image.dispose if @face_image != nil
  5383.       @face.bitmap.dispose if @face.bitmap != nil
  5384.       return if @actor == nil or @actor.id == nil
  5385.       #追加
  5386.       p @actor.battler_face_name.to_s
  5387.  
  5388.       @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5389.       @face_image = Bitmap.new(32,32) if @face_image == nil
  5390.       @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5391.       @face_ch = @face_image.height
  5392.       @face.ox = @face_cw / 2
  5393.       @face.oy = @face_ch / 2      
  5394.       @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5395.       @face_org = [@hud_position[0] + FACE_POSITION[0],
  5396.                    @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5397.       if $game_temp.battler_face_pos[@actor_index] == nil
  5398.          $game_temp.battler_face_pos[@actor_index] = []
  5399.       end
  5400.       @face.x = @face_org[0]
  5401.       @face.y = @face_org[1]  
  5402.       limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5403.       fy = @face_org[1]
  5404.       if limit_Y > Graphics.height
  5405.          @face.y = Graphics.height - (@face_image.height - @face.oy)
  5406.          fy = Graphics.height - 16
  5407.          @face_org[1] = @face.y
  5408.       end
  5409.       $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5410.       $game_temp.battler_face_pos[@actor_index][1] = fy
  5411.       $game_temp.battler_face_pos[@actor_index][2] = @face.z     
  5412.       clear_face_index
  5413.   end
  5414.  
  5415.   #--------------------------------------------------------------------------
  5416.   # * Refresh Face
  5417.   #--------------------------------------------------------------------------  
  5418.   def refresh_face
  5419.       #追記
  5420.       p "refresh_face"
  5421.       #p @actor.battler_face_name.to_s
  5422.       #def battler_face_name()
  5423.       #@actor.battler_face_name = @battler_face_name(1,"Face_2")
  5424.       #end
  5425.  
  5426.       #@actor.battler_face_name = "Face_2"
  5427.       #追加 戦闘中の立ち絵画像の切り替え
  5428.       #HP60%未満で服破け切替 回復で通常立ち絵へ
  5429.       if $game_actors[1].param(0) * 0.6 > $game_actors[1].hp
  5430.  
  5431.         $game_variables[1] = 1
  5432.  
  5433.         actor = $game_actors[1]
  5434.  
  5435.         if actor.state?(30)
  5436.           $game_variables[1] = 3
  5437.         end
  5438.         if actor.state?(31)
  5439.           $game_variables[1] = 5
  5440.         end
  5441.         if $game_variables[10] == 3
  5442.           $game_variables[1] = 7
  5443.         end
  5444.         if $game_switches[275] == true
  5445.           $game_variables[1] = 9
  5446.         end
  5447.  
  5448.         $game_switches[56] = true
  5449.       end
  5450.       if $game_actors[1].param(0) * 0.6 <= $game_actors[1].hp
  5451.  
  5452.         $game_variables[1] = 0
  5453.         actor = $game_actors[1]
  5454.  
  5455.         if actor.state?(30)
  5456.           $game_variables[1] = 2
  5457.         end
  5458.         if actor.state?(31)
  5459.           $game_variables[1] = 4
  5460.         end
  5461.         if $game_variables[10] == 3
  5462.           $game_variables[1] = 6
  5463.         end
  5464.         if $game_switches[275] == true
  5465.           $game_variables[1] = 8
  5466.         end        
  5467.  
  5468.         $game_switches[56] = false
  5469.       end
  5470.  
  5471.       #通常立ち絵 表示
  5472.       if $game_variables[1] == 0
  5473.         p $game_variables[1]
  5474.         @actor.battler_face_name = "Face_1"
  5475.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5476.       end
  5477.       #ダメージ立ち絵 表示
  5478.       if $game_variables[1] == 1
  5479.         p $game_variables[1]
  5480.         @actor.battler_face_name = "Face_2"
  5481.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5482.       end      
  5483.       #通常立ち絵(スライム) 表示
  5484.       if $game_variables[1] == 2
  5485.         p $game_variables[1]
  5486.         @actor.battler_face_name = "Face_3"
  5487.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5488.       end
  5489.       #ダメージ立ち絵(スライム) 表示
  5490.       if $game_variables[1] == 3
  5491.         p $game_variables[1]
  5492.         @actor.battler_face_name = "Face_4"
  5493.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5494.       end
  5495.       #通常立ち絵(触手) 表示
  5496.       if $game_variables[1] == 4
  5497.         p $game_variables[1]
  5498.         @actor.battler_face_name = "Face_5"
  5499.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5500.       end
  5501.       #ダメージ立ち絵(触手) 表示
  5502.       if $game_variables[1] == 5
  5503.         p $game_variables[1]
  5504.         @actor.battler_face_name = "Face_6"
  5505.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5506.       end
  5507.       #通常立ち絵(手ブラ) 表示
  5508.       if $game_variables[1] == 6
  5509.         p $game_variables[1]
  5510.         @actor.battler_face_name = "Face_7"
  5511.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5512.       end
  5513.       #ダメージ立ち絵(手ブラ) 表示
  5514.       if $game_variables[1] == 7
  5515.         p $game_variables[1]
  5516.         @actor.battler_face_name = "Face_8"
  5517.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5518.       end
  5519.       #通常立ち絵(手ブラ) 表示
  5520.       if $game_variables[1] == 8
  5521.         p $game_variables[1]
  5522.         @actor.battler_face_name = "Face_9"
  5523.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5524.       end
  5525.       #ダメージ立ち絵(手ブラ) 表示
  5526.       if $game_variables[1] == 9
  5527.         p $game_variables[1]
  5528.         @actor.battler_face_name = "Face_10"
  5529.         @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5530.       end      
  5531.  
  5532.  
  5533.       #p @actor.battler_face_name.to_s
  5534.       #p @face_cw.to_s   
  5535.       #追記終わり
  5536.  
  5537.       @face.mirror = false
  5538.       @face.zoom_x = 1.00
  5539.       @face.zoom_y = 1.00
  5540.       @face_index = @actor.face_animation[1]
  5541.       @face.bitmap.clear
  5542.       if !FACE_ANIMATION
  5543.          f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5544.       else
  5545.          f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5546.        end
  5547.       @face.bitmap.blt(0,0,@face_image,f_scr)
  5548.   end
  5549.  
  5550.   #--------------------------------------------------------------------------
  5551.   # * Update Face Duration
  5552.   #--------------------------------------------------------------------------   
  5553.   def update_face_duration
  5554.       return if @actor.face_animation[0] == 0
  5555.       @actor.face_animation[0] -= 1
  5556.       update_face_shake_effect
  5557.       update_face_zoom if @actor.face_animation[1] == 2
  5558.       return if @actor.face_animation[0] > 0
  5559.       clear_face_index
  5560.   end
  5561.  
  5562.   #--------------------------------------------------------------------------
  5563.   # * Clear Face Index
  5564.   #--------------------------------------------------------------------------      
  5565.   def clear_face_index
  5566.       @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5567.       @actor.face_animation[1] = 4 if @actor.dead?
  5568.       refresh_face
  5569.   end
  5570.  
  5571.   #--------------------------------------------------------------------------
  5572.   # * Update Face Zoom
  5573.   #--------------------------------------------------------------------------      
  5574.   def update_face_zoom
  5575.       return if !FACE_ZOOM_ANIMATION
  5576.       case @actor.face_animation[0]
  5577.          when 30..60
  5578.             @face.zoom_x += 0.01
  5579.             @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5580.             @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5581.          when 1..29
  5582.             @face.zoom_x -= 0.01
  5583.             @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5584.             @face.mirror = false
  5585.          else
  5586.             @face.zoom_x = 1.00
  5587.             @face.mirror = false
  5588.       end
  5589.       @face.zoom_y = @face.zoom_x
  5590.   end
  5591.  
  5592.   #--------------------------------------------------------------------------
  5593.   # * Can Refresh Index MP TP?
  5594.   #--------------------------------------------------------------------------     
  5595.   def can_refresh_index_mp_tp?
  5596.       return true if @face_old_mp != @actor.mp
  5597.       return false
  5598.   end
  5599.  
  5600.   #--------------------------------------------------------------------------
  5601.   # * Refresh Face Index HP
  5602.   #--------------------------------------------------------------------------  
  5603.   def refresh_face_index_hp
  5604.       @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5605.       @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5606.       @face_old_hp = @actor.hp
  5607.   end
  5608.  
  5609.   #--------------------------------------------------------------------------
  5610.   # * Refresh Face Index MP TP
  5611.   #--------------------------------------------------------------------------  
  5612.   def refresh_face_index_mp_tp
  5613.       if @face_old_mp < @actor.mp
  5614.          @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5615.          @actor.face_animation[1] = 1
  5616.       end
  5617.       @face_old_mp = @actor.mp
  5618.       @face_old_tp = @actor.tp
  5619.   end  
  5620.  
  5621.   #--------------------------------------------------------------------------
  5622.   # * Update Face Shake Effect
  5623.   #--------------------------------------------------------------------------  
  5624.   def update_face_shake_effect
  5625.       return if !FACE_SHAKE_EFFECT
  5626.       if FACE_ANIMATION
  5627.          update_shake_animated_face
  5628.       else            
  5629.          update_shake_still_face
  5630.       end  
  5631.   end      
  5632.  
  5633.   #--------------------------------------------------------------------------
  5634.   # * Update Shake Still Effect Face
  5635.   #--------------------------------------------------------------------------   
  5636.   def update_shake_still_face
  5637.       if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5638.          @face.x = @face_org[0] - 4 + rand(8)
  5639.       else
  5640.          @face.x = @face_org[0]
  5641.       end     
  5642.   end
  5643.  
  5644.   #--------------------------------------------------------------------------
  5645.   # * Update Shake Animated Face
  5646.   #--------------------------------------------------------------------------   
  5647.   def update_shake_animated_face
  5648.       if @actor.face_animation[0] == 0
  5649.          @face.x = @face_org[0]
  5650.          return
  5651.       end
  5652.       if @actor.face_animation[1] == 3 and @actor.hp > 0
  5653.          @face.x = @face_org[0] - 4 + rand(8)
  5654.       else
  5655.          @face.x = @face_org[0]
  5656.       end         
  5657.   end
  5658.  
  5659.   #--------------------------------------------------------------------------
  5660.   # * Update Face
  5661.   #--------------------------------------------------------------------------   
  5662.   def update_face
  5663.       return if @face == nil
  5664.       sprite_visible(@face)
  5665.       refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5666.       update_face_duration
  5667.       return if !FACE_ANIMATION
  5668.       refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5669.       refresh_face_index_hp if @face_old_hp != @actor.hp
  5670.       refresh_face if @face_index != @actor.face_animation[1]
  5671.   end  
  5672.  
  5673. end
  5674.  
  5675. #==============================================================================
  5676. # ■ Battle Manager
  5677. #==============================================================================
  5678. class << BattleManager
  5679.  
  5680.   #--------------------------------------------------------------------------
  5681.   # ● Battle End
  5682.   #--------------------------------------------------------------------------                    
  5683.   alias mog_battle_hud_battle_process_victory process_victory
  5684.   def process_victory
  5685.       execute_face_effect_end
  5686.       mog_battle_hud_battle_process_victory
  5687.   end
  5688.  
  5689.   #--------------------------------------------------------------------------
  5690.   # ● Execute Face Effect End
  5691.   #--------------------------------------------------------------------------                  
  5692.   def execute_face_effect_end
  5693.       $game_temp.battle_end = true
  5694.       for i in $game_party.members
  5695.           i.face_animation = [120,1,0] if i.hp > 0   
  5696.       end  
  5697.   end
  5698.  
  5699.   #--------------------------------------------------------------------------
  5700.   # * Display EXP Earned
  5701.   #--------------------------------------------------------------------------
  5702.   alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5703.   def process_defeat
  5704.       $game_temp.battle_end = true
  5705.       mog_battle_hud_ex_message_battle_process_defeat
  5706.   end
  5707.  
  5708.   #--------------------------------------------------------------------------
  5709.   # * Process Abort
  5710.   #--------------------------------------------------------------------------
  5711.   alias mog_battle_hud_ex_process_abort process_abort
  5712.   def process_abort
  5713.       $game_temp.battle_end = true
  5714.       mog_battle_hud_ex_process_abort
  5715.   end  
  5716.  
  5717. end
  5718.  
  5719. #==============================================================================
  5720. # ** Scene Battle
  5721. #==============================================================================
  5722. class Scene_Battle < Scene_Base
  5723.  
  5724.   #--------------------------------------------------------------------------
  5725.   # * Use Item
  5726.   #--------------------------------------------------------------------------      
  5727.   alias mog_monogatari_use_item use_item
  5728.   def use_item
  5729.       execute_face_animation
  5730.       mog_monogatari_use_item
  5731.   end
  5732.  
  5733.   #--------------------------------------------------------------------------
  5734.   # * Execute Face Animation
  5735.   #--------------------------------------------------------------------------  
  5736.   def execute_face_animation
  5737.       return if @subject.is_a?(Game_Enemy)
  5738.       @subject.face_animation = [60 ,2,0]   
  5739.   end
  5740.  
  5741. end
  5742.  
  5743. #==============================================================================
  5744. #==============================================================================
  5745. # ** Battle Hud EX
  5746. #==============================================================================
  5747. #==============================================================================
  5748. class Battle_Hud_EX
  5749.  
  5750.   #--------------------------------------------------------------------------
  5751.   # * Dispose
  5752.   #--------------------------------------------------------------------------  
  5753.   def dispose
  5754.       terminate
  5755.       dispose_layout
  5756.       dispose_layout_2
  5757.       dispose_name
  5758.       dispose_face
  5759.       dispose_hp_number
  5760.       dispose_hp_number_max
  5761.       dispose_hp_meter
  5762.       dispose_hp_icon
  5763.       dispose_hp_icon_ex
  5764.       dispose_hp_icon_number
  5765.       dispose_mp_number
  5766.       dispose_mp_number_max
  5767.       dispose_mp_meter
  5768.       dispose_mp_icon
  5769.       dispose_mp_icon_ex
  5770.       dispose_mp_icon_number
  5771.       dispose_tp_number
  5772.       dispose_tp_number_max
  5773.       dispose_tp_meter
  5774.       dispose_tp_icon
  5775.       dispose_tp_icon_ex
  5776.       dispose_tp_icon_number
  5777.       dispose_at_number
  5778.       dispose_at_number_max
  5779.       dispose_at_meter      
  5780.       dispose_lv_number
  5781.       dispose_states
  5782.   end
  5783.  
  5784.   #--------------------------------------------------------------------------
  5785.   # * Dispose Layout
  5786.   #--------------------------------------------------------------------------  
  5787.   def dispose_layout
  5788.       return if @layout == nil
  5789.       @layout.dispose
  5790.       @layout = nil
  5791.   end
  5792.  
  5793.   #--------------------------------------------------------------------------
  5794.   # * Dispose Layout 2
  5795.   #--------------------------------------------------------------------------  
  5796.   def dispose_layout_2
  5797.       return if @layout2 == nil
  5798.       @layout2.dispose
  5799.       @layout2 = nil
  5800.   end  
  5801.  
  5802.   #--------------------------------------------------------------------------
  5803.   # * Dispose Name
  5804.   #--------------------------------------------------------------------------         
  5805.   def dispose_name
  5806.       return if @name == nil
  5807.       @name.bitmap.dispose
  5808.       @name.dispose
  5809.       @name = nil
  5810.   end  
  5811.  
  5812.   #--------------------------------------------------------------------------
  5813.   # * Dispose Face
  5814.   #--------------------------------------------------------------------------        
  5815.   def dispose_face
  5816.       return if @face == nil      
  5817.       @face.bitmap.dispose if @face.bitmap != nil   
  5818.       @face.dispose
  5819.       @face = nil
  5820.       @face_image.dispose if @face_image != nil
  5821.   end  
  5822.  
  5823.   #--------------------------------------------------------------------------
  5824.   # * Dispose HP Number
  5825.   #--------------------------------------------------------------------------   
  5826.   def dispose_hp_number
  5827.       return if @hp_number == nil
  5828.       @hp_number.bitmap.dispose
  5829.       @hp_number.dispose
  5830.       @hp_number = nil
  5831.   end
  5832.  
  5833.   #--------------------------------------------------------------------------
  5834.   # * Dispose HP Number Max
  5835.   #--------------------------------------------------------------------------   
  5836.   def dispose_hp_number_max
  5837.       return if @hp_number2 == nil
  5838.       @hp_number2.bitmap.dispose
  5839.       @hp_number2.dispose
  5840.       @hp_number2 = nil
  5841.   end   
  5842.  
  5843.   #--------------------------------------------------------------------------
  5844.   # * Dispose HP Meter
  5845.   #--------------------------------------------------------------------------     
  5846.   def dispose_hp_meter
  5847.       return if @hp_meter == nil
  5848.       @hp_meter.bitmap.dispose
  5849.       @hp_meter.dispose
  5850.       @hp_meter = nil
  5851.   end   
  5852.  
  5853.   #--------------------------------------------------------------------------
  5854.   # * Dispose HP Icon
  5855.   #--------------------------------------------------------------------------      
  5856.   def dispose_hp_icon
  5857.       return if @hp_icon == nil
  5858.       @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5859.       @hp_icon.dispose
  5860.       @hp_icon = nil
  5861.   end   
  5862.  
  5863.   #--------------------------------------------------------------------------
  5864.   # * Dispose HP Icon EX
  5865.   #--------------------------------------------------------------------------      
  5866.   def dispose_hp_icon_ex
  5867.       return if @hp_icon3 == nil
  5868.       @hp_icon3.bitmap.dispose
  5869.       @hp_icon3.dispose
  5870.       @hp_icon3 = nil
  5871.   end      
  5872.  
  5873.   #--------------------------------------------------------------------------
  5874.   # * Dispose HP Icon Number
  5875.   #--------------------------------------------------------------------------  
  5876.   def dispose_hp_icon_number
  5877.       return if @hp_icon_number == nil
  5878.       @hp_icon_number.bitmap.dispose
  5879.       @hp_icon_number.dispose
  5880.       @hp_icon_number = nil
  5881.   end   
  5882.  
  5883.   #--------------------------------------------------------------------------
  5884.   # * Dispose MP Number
  5885.   #--------------------------------------------------------------------------   
  5886.   def dispose_mp_number
  5887.       return if @mp_number == nil
  5888.       @mp_number.bitmap.dispose
  5889.       @mp_number.dispose
  5890.       @mp_number = nil
  5891.   end   
  5892.  
  5893.   #--------------------------------------------------------------------------
  5894.   # * Dispose MP Number Max
  5895.   #--------------------------------------------------------------------------   
  5896.   def dispose_mp_number_max
  5897.       return if @mp_number2 == nil
  5898.       @mp_number2.bitmap.dispose
  5899.       @mp_number2.dispose
  5900.       @mp_number2 = nil
  5901.   end   
  5902.  
  5903.   #--------------------------------------------------------------------------
  5904.   # * Dispose MP Meter
  5905.   #--------------------------------------------------------------------------     
  5906.   def dispose_mp_meter
  5907.       return if @mp_meter == nil
  5908.       @mp_meter.bitmap.dispose
  5909.       @mp_meter.dispose
  5910.       @mp_meter = nil
  5911.   end     
  5912.  
  5913.   #--------------------------------------------------------------------------
  5914.   # * Dispose MP Icon
  5915.   #--------------------------------------------------------------------------      
  5916.   def dispose_mp_icon
  5917.       return if @mp_icon == nil
  5918.       @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5919.       @mp_icon.dispose
  5920.       @mp_icon = nil
  5921.   end     
  5922.  
  5923.   #--------------------------------------------------------------------------
  5924.   # * Dispose MP Icon EX
  5925.   #--------------------------------------------------------------------------      
  5926.   def dispose_mp_icon_ex
  5927.       return if @mp_icon3 == nil
  5928.       @mp_icon3.bitmap.dispose
  5929.       @mp_icon3.dispose
  5930.       @mp_icon3 = nil
  5931.   end        
  5932.  
  5933.   #--------------------------------------------------------------------------
  5934.   # * Dispose MP Icon Number
  5935.   #--------------------------------------------------------------------------  
  5936.   def dispose_mp_icon_number
  5937.       return if @mp_icon_number == nil
  5938.       @mp_icon_number.bitmap.dispose
  5939.       @mp_icon_number.dispose
  5940.       @mp_icon_number = nil
  5941.   end   
  5942.  
  5943.   #--------------------------------------------------------------------------
  5944.   # * Dispose TP Number
  5945.   #--------------------------------------------------------------------------   
  5946.   def dispose_tp_number
  5947.       return if @tp_number == nil
  5948.       @tp_number.bitmap.dispose
  5949.       @tp_number.dispose
  5950.       @tp_number = nil
  5951.   end
  5952.  
  5953.   #--------------------------------------------------------------------------
  5954.   # * Dispose TP Number Max
  5955.   #--------------------------------------------------------------------------   
  5956.   def dispose_tp_number_max
  5957.       return if @tp_number2 == nil
  5958.       @tp_number2.bitmap.dispose
  5959.       @tp_number2.dispose
  5960.       @tp_number2 = nil
  5961.   end  
  5962.  
  5963.   #--------------------------------------------------------------------------
  5964.   # * Dispose TP Meter
  5965.   #--------------------------------------------------------------------------     
  5966.   def dispose_tp_meter
  5967.       return if @tp_meter == nil
  5968.       @tp_meter.bitmap.dispose
  5969.       @tp_meter.dispose
  5970.       @tp_meter = nil
  5971.   end     
  5972.  
  5973.   #--------------------------------------------------------------------------
  5974.   # * Dispose TP Icon
  5975.   #--------------------------------------------------------------------------      
  5976.   def dispose_tp_icon
  5977.       return if @tp_icon == nil
  5978.       @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5979.       @tp_icon.dispose
  5980.       @tp_icon = nil
  5981.   end   
  5982.  
  5983.   #--------------------------------------------------------------------------
  5984.   # * Dispose TP Icon EX
  5985.   #--------------------------------------------------------------------------      
  5986.   def dispose_tp_icon_ex
  5987.       return if @tp_icon3 == nil
  5988.       @tp_icon3.bitmap.dispose
  5989.       @tp_icon3.dispose
  5990.       @tp_icon3 = nil
  5991.   end   
  5992.  
  5993.   #--------------------------------------------------------------------------
  5994.   # * Dispose TP Icon Number
  5995.   #--------------------------------------------------------------------------  
  5996.   def dispose_tp_icon_number
  5997.       return if @tp_icon_number == nil
  5998.       @tp_icon_number.bitmap.dispose
  5999.       @tp_icon_number.dispose
  6000.       @tp_icon_numbe = nil
  6001.   end     
  6002.  
  6003.   #--------------------------------------------------------------------------
  6004.   # * Dispose AT Number
  6005.   #--------------------------------------------------------------------------   
  6006.   def dispose_at_number
  6007.       return if @at_number == nil
  6008.       @at_number.bitmap.dispose
  6009.       @at_number.dispose
  6010.       @at_number = nil
  6011.   end
  6012.  
  6013.   #--------------------------------------------------------------------------
  6014.   # * Dispose AT Number Max
  6015.   #--------------------------------------------------------------------------   
  6016.   def dispose_at_number_max
  6017.       return if @at_number2 == nil
  6018.       @at_number2.bitmap.dispose
  6019.       @at_number2.dispose
  6020.       @at_number2 = nil
  6021.   end   
  6022.  
  6023.   #--------------------------------------------------------------------------
  6024.   # * Dispose AT Meter
  6025.   #--------------------------------------------------------------------------     
  6026.   def dispose_at_meter
  6027.       return if @at_meter == nil
  6028.       @at_meter.bitmap.dispose
  6029.       @at_meter.dispose
  6030.       @at_meter = nil
  6031.   end     
  6032.  
  6033.   #--------------------------------------------------------------------------
  6034.   # * Dispose Lv Number
  6035.   #--------------------------------------------------------------------------   
  6036.   def dispose_lv_number
  6037.       return if @lv_number == nil
  6038.       @lv_number.bitmap.dispose
  6039.       @lv_number.dispose
  6040.       @lv_number = nil
  6041.   end
  6042.  
  6043.   #--------------------------------------------------------------------------
  6044.   # * Dispose States
  6045.   #--------------------------------------------------------------------------      
  6046.   def dispose_states
  6047.       return if @status == nil
  6048.       @status.bitmap.dispose if @status.bitmap != nil
  6049.       @status.dispose
  6050.       @actor_status.dispose if @actor_status != nil
  6051.       @status = nil
  6052.   end
  6053.  
  6054. end
  6055.  
  6056. #==============================================================================
  6057. #==============================================================================
  6058. # ** Battle Hud EX
  6059. #==============================================================================
  6060. #==============================================================================
  6061. class Battle_Hud_EX
  6062.  
  6063. #--------------------------------------------------------------------------
  6064. # * Refresh Visible
  6065. #--------------------------------------------------------------------------  
  6066. def refresh_visible(vis)
  6067.      @layout.visible = vis if @layout
  6068.      @layout2.visible = vis if @layout2
  6069.      @name.visible = vis if @name
  6070.      @lv_number.visible = vis if @lv_number
  6071.      @status.visible = vis if @status
  6072.      @face.visible = vis if @face     
  6073.      @hp_number.visible = vis if @hp_number
  6074.      @hp_number2.visible = vis if @hp_number2
  6075.      @hp_meter.visible = vis if @hp_meter
  6076.      @hp_icon.visible = vis if @hp_icon
  6077.      @hp_icon3.visible = vis if @hp_icon3
  6078.      @hp_icon_number.visible = vis if @hp_icon_number     
  6079.      @mp_number.visible = vis if @mp_number
  6080.      @mp_number2.visible = vis if @mp_number2
  6081.      @mp_meter.visible = vis if @mp_meter
  6082.      @mp_icon.visible = vis if @mp_icon
  6083.      @mp_icon3.visible = vis if @mp_icon3
  6084.      @mp_icon_number.visible = vis if @mp_icon_number
  6085.      @tp_number.visible = vis if @tp_number
  6086.      @tp_number2.visible = vis if @tp_number2
  6087.      @tp_meter.visible = vis if @tp_meter
  6088.      @tp_icon.visible = vis if @tp_icon
  6089.      @tp_icon3.visible = vis if @tp_icon3
  6090.      @tp_icon_number.visible = vis if @tp_icon_number      
  6091.      @at_number.visible = vis if @at_number
  6092.      @at_number2.visible = vis if @at_number2
  6093.      @at_meter.visible = vis if @at_meter   
  6094.   end  
  6095.  
  6096.   #--------------------------------------------------------------------------
  6097.   # * Update
  6098.   #--------------------------------------------------------------------------  
  6099.   def update
  6100.       return if @actor == nil
  6101.       @sprite_visible = sprite_visible?
  6102.       @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  6103.       update_layout ; update_layout_2 ; update_name
  6104.       update_face ; update_hp ; update_mp ; update_tp
  6105.       update_at ; update_level ; update_states
  6106.   end
  6107.  
  6108. end
  6109.  
  6110. #==============================================================================
  6111. # ■ Sprite Battler
  6112. #==============================================================================
  6113. class Sprite_Battler < Sprite_Base
  6114.  
  6115.   #--------------------------------------------------------------------------
  6116.   # ● Set AV
  6117.   #--------------------------------------------------------------------------      
  6118.   def set_av(a_viewport)
  6119.       @viewport_cm = a_viewport
  6120.   end
  6121.  
  6122.   #--------------------------------------------------------------------------
  6123.   # ● Dispose
  6124.   #--------------------------------------------------------------------------      
  6125.   alias mog_bc_dispose dispose
  6126.   def dispose
  6127.       mog_bc_dispose
  6128.       @viewport_cm.dispose if @viewport_cm != nil
  6129.   end
  6130.  
  6131.   #--------------------------------------------------------------------------
  6132.   # ● Maker Animation Sprites
  6133.   #--------------------------------------------------------------------------      
  6134.   alias mog_bc_make_animation_sprites make_animation_sprites
  6135.   def make_animation_sprites
  6136.       mog_bc_make_animation_sprites
  6137.       set_cm_viewport if $imported[:mog_battle_camera]
  6138.   end
  6139.  
  6140.   #--------------------------------------------------------------------------
  6141.   # ● Set CM Viewpor
  6142.   #--------------------------------------------------------------------------      
  6143.   def set_cm_viewport
  6144.       return if @viewport_cm == nil
  6145.       return if @ani_sprites == nil
  6146.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  6147.          @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  6148.          return
  6149.       end
  6150.       @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  6151.   end
  6152.  
  6153. end
  6154.  
  6155. #==============================================================================
  6156. # ■ Game Temp
  6157. #==============================================================================
  6158. class Spriteset_Battle
  6159.  
  6160.   #--------------------------------------------------------------------------
  6161.   # ● Initialize
  6162.   #--------------------------------------------------------------------------      
  6163.   alias mog_bc_sp_initialize initialize
  6164.   def initialize
  6165.       mog_bc_sp_initialize
  6166.       if $imported[:mog_battle_camera] and @viewport_cm != nil
  6167.          battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  6168.       end
  6169.   end
  6170.  
  6171.   #--------------------------------------------------------------------------
  6172.   # ● Create Viewports
  6173.   #--------------------------------------------------------------------------      
  6174.   alias mog_bc_create_viewports create_viewports
  6175.   def create_viewports
  6176.       mog_bc_create_viewports
  6177.       if $imported[:mog_battle_camera]
  6178.          @viewport_cm = Viewport.new
  6179.          #追加
  6180.          @viewport_cm.z = 100
  6181.       end   
  6182.   end
  6183.  
  6184.   #--------------------------------------------------------------------------
  6185.   # ● Dispose Viewports
  6186.   #--------------------------------------------------------------------------      
  6187.   alias mog_bc_dispose_viewports dispose_viewports
  6188.   def dispose_viewports
  6189.       mog_bc_dispose_viewports
  6190.       @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  6191.   end
  6192.  
  6193.   #--------------------------------------------------------------------------
  6194.   # ● Update Viewports
  6195.   #--------------------------------------------------------------------------      
  6196.   alias mog_bcf_update_viewports update_viewports
  6197.   def update_viewports
  6198.       mog_bcf_update_viewports
  6199.       update_viewport_cm if $imported[:mog_battle_camera]
  6200.   end
  6201.  
  6202.   #--------------------------------------------------------------------------
  6203.   # ● Update Viewport CM
  6204.   #--------------------------------------------------------------------------      
  6205.   def update_viewport_cm
  6206.       return if @viewport_cm == nil  
  6207.       @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  6208.       @viewport_cm.oy = $game_temp.bc_data[1]
  6209.       @viewport_cm.update
  6210.   end
  6211.  
  6212. end

Lv3.寻梦者

梦石
0
星屑
1422
在线时间
245 小时
注册时间
2019-1-18
帖子
190
2
 楼主| 发表于 2024-1-28 14:14:21 | 只看该作者
有大佬能解答一下吗?
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1422
在线时间
245 小时
注册时间
2019-1-18
帖子
190
3
 楼主| 发表于 2024-2-3 23:44:25 | 只看该作者
顶一下,200星屑别白花了
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
566
在线时间
214 小时
注册时间
2023-3-16
帖子
51
4
发表于 2024-2-5 13:54:44 | 只看该作者
老哥要不要考虑把工程搬到MV或者MZ上?MV和MZ都有现成的插件,你可以参考一下https://rpg.blue/thread-493169-1-1.html
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1422
在线时间
245 小时
注册时间
2019-1-18
帖子
190
5
 楼主| 发表于 2024-2-5 18:49:08 | 只看该作者
4887441 发表于 2024-2-5 13:54
老哥要不要考虑把工程搬到MV或者MZ上?MV和MZ都有现成的插件,你可以参考一下https://rpg.blue/thread-4931 ...

mv和mz都没接触过
回复

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-28 16:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表