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

Project1

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

[已经解决] MOG伤害显示脚本字体被压扁了

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1066
在线时间
360 小时
注册时间
2014-4-25
帖子
42
跳转到指定楼层
1
发表于 2022-2-28 19:34:34 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
50星屑



p1是原范例的黑体,p2是我想要使用在游戏里的字体,都是横着被压扁了
T T请问有什么办法优化吗?或者把表示“防御”、“中毒”等状态的文字用图片显示该怎么做?

附上脚本和脚本需要的图片

RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - 战斗 Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. # 可以在战斗画面中显示各种自定义HUD图片。
  8. # 全部图片放在文件夹:
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # 显示或隐藏战斗Hud的脚本
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # 或
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # 改变脸图的脚本
  22. #==============================================================================
  23. #
  24. # battler_face_name( 角色ID, 脸图文件名 )
  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 精灵 (通用)
  57.   #============================================================================
  58.   # 最大战斗角色数.
  59.   #---------------------------------------------------------------------------
  60.   MAX_BATTLE_MEMBERS = 4
  61.   #---------------------------------------------------------------------------
  62.   # hud的Z坐标.
  63.   #---------------------------------------------------------------------------
  64.   HUD_Z = 110
  65.   #---------------------------------------------------------------------------
  66.   # hud的位置.
  67.   #---------------------------------------------------------------------------
  68.   HUD_POSITION = [0,323]
  69.   #---------------------------------------------------------------------------
  70.   # 调整数字间距
  71.   #---------------------------------------------------------------------------
  72.   MEMBERS_SPACE = [0,0]
  73.   #---------------------------------------------------------------------------
  74.   # 修改指定HUD的位置
  75.   #
  76.   # FIXED_POSITION[索引ID] = [X,Y]
  77.   #
  78.   #---------------------------------------------------------------------------
  79.   FIXED_HUD_POSITION = []
  80.   # FIXED_HUD_POSITION[0] = [10,10]
  81.   # FIXED_HUD_POSITION[1] = [410,10]
  82.   # FIXED_HUD_POSITION[2] = [10,320]
  83.   # FIXED_HUD_POSITION[3] = [410,320]
  84.   #---------------------------------------------------------------------------
  85.   # 修改指定指令窗口的位置
  86.   #---------------------------------------------------------------------------
  87.   FIXED_COMMAND_POSITION = []
  88.   #FIXED_COMMAND_POSITION[0] = [130,10]
  89.   # FIXED_COMMAND_POSITION[1] = [300,10]
  90.   # FIXED_COMMAND_POSITION[2] = [130,290]
  91.   # FIXED_COMMAND_POSITION[3] = [300,290]
  92.   #---------------------------------------------------------------------------
  93.   # 是否在显示文章时隐藏HUD.
  94.   #---------------------------------------------------------------------------
  95.   MESSAGE_WINDOW_FADE_HUD = true
  96.   #---------------------------------------------------------------------------
  97.   # 设置视为低数值的百分比,这会影响HP、MP、TP的颜色。有快消耗完时改变值槽颜色的
  98.   # 效果
  99.   #---------------------------------------------------------------------------
  100.   LOW_PARAMETER_PERCENTAGE = 30
  101.   #============================================================================
  102.   #============================================================================
  103.  
  104.  
  105.   #============================================================================
  106.   #============================================================================
  107.   # * 名字
  108.   #============================================================================
  109.   # 是否显示名字的精灵
  110.   #---------------------------------------------------------------------------
  111.   NAME_VISIBLE = false
  112.   #---------------------------------------------------------------------------
  113.   # 名字精灵的Z坐标
  114.   #---------------------------------------------------------------------------  
  115.   NAME_Z = 5
  116.   #---------------------------------------------------------------------------
  117.   # 名字位置. [X,Y]
  118.   #---------------------------------------------------------------------------
  119.   NAME_POSITION = [0,-7]
  120.   #---------------------------------------------------------------------------
  121.   # 设定对齐方式.
  122.   #
  123.   # 0 - 左
  124.   # 1 - 中
  125.   # 2 - 右
  126.   #---------------------------------------------------------------------------  
  127.   NAME_ALIGN_TYPE = 1
  128.   #---------------------------------------------------------------------------
  129.   # 字体
  130.   #---------------------------------------------------------------------------
  131.   NAME_FONT_NAME = "Georgia"
  132.   #---------------------------------------------------------------------------
  133.   # 字体大小
  134.   #---------------------------------------------------------------------------   
  135.   NAME_FONT_SIZE = 16
  136.   #---------------------------------------------------------------------------
  137.   # 是否加粗
  138.   #---------------------------------------------------------------------------   
  139.   NAME_FONT_BOLD = true
  140.   #---------------------------------------------------------------------------
  141.   # 是否斜体
  142.   #---------------------------------------------------------------------------   
  143.   NAME_FONT_ITALIC = true
  144.   #---------------------------------------------------------------------------
  145.   # 字体颜色
  146.   #---------------------------------------------------------------------------     
  147.   NAME_FONT_COLOR = Color.new(255,255,255,255)
  148.   #---------------------------------------------------------------------------
  149.   # 是否显示字体阴影
  150.   #---------------------------------------------------------------------------  
  151.   NAME_FONT_SHADOW = false
  152.   #---------------------------------------------------------------------------
  153.   # 字体阴影的颜色
  154.   #---------------------------------------------------------------------------   
  155.   NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  156.   #---------------------------------------------------------------------------
  157.   # 字体阴影的位置
  158.   #---------------------------------------------------------------------------   
  159.   NAME_FONT_SHADOW_POSITION = [2,2]  
  160.   #============================================================================
  161.   #============================================================================
  162.  
  163.  
  164.   #============================================================================
  165.   #============================================================================
  166.   # * 脸图
  167.   #============================================================================
  168.   # 是否显示脸图.
  169.   # 需要图片:
  170.   #
  171.   # 角色名 + _Face.png
  172.   #
  173.   # Eric_Face.png
  174.   #
  175.   #---------------------------------------------------------------------------
  176.   FACE_VISIBLE = true
  177.   # 是否将角色的脸图作为其战斗图
  178.   # 如果脚本出现问题请设定为"false".
  179.   FACE_BATTLER = true
  180.   #---------------------------------------------------------------------------
  181.   # 脸图的Z坐标.
  182.   #---------------------------------------------------------------------------  
  183.   FACE_Z = -1
  184.   #---------------------------------------------------------------------------
  185.   # 脸图的位置. [X,Y]
  186.   #---------------------------------------------------------------------------
  187.   FACE_POSITION = [68,5]
  188.   #---------------------------------------------------------------------------
  189.   # 是否显示脸图动画.
  190.   # 你需要一张可以分成五分的图片.
  191.   #
  192.   # FACE1/FACE2/FACE3/FACE4
  193.   #
  194.   #---------------------------------------------------------------------------  
  195.   FACE_ANIMATION = true
  196.   #---------------------------------------------------------------------------
  197.   # 是否显示脸图的缩放动画
  198.   #---------------------------------------------------------------------------
  199.   FACE_ZOOM_ANIMATION = true
  200.   #---------------------------------------------------------------------------
  201.   # 是否显示脸图镜像效果.
  202.   #---------------------------------------------------------------------------
  203.   FACE_ZOOM_MIRROR_EFFECT = false
  204.   #---------------------------------------------------------------------------
  205.   # 脸图动画的时间.
  206.   #---------------------------------------------------------------------------  
  207.   FACE_ANIMATION_DURATION = 40
  208.   #---------------------------------------------------------------------------
  209.   # 是否显示脸图震动效果.
  210.   #---------------------------------------------------------------------------  
  211.   FACE_SHAKE_EFFECT = true
  212.   #============================================================================
  213.   #============================================================================
  214.  
  215.  
  216.   #============================================================================
  217.   #============================================================================
  218.   # * 回合数 (实时数值)
  219.   #============================================================================
  220.   # 是否显示回合数的图片
  221.   # 需要图片
  222.   #
  223.   # Turn.png
  224.   #
  225.   #---------------------------------------------------------------------------
  226.   TURN_SPRITE_VISIBLE = true
  227.   #---------------------------------------------------------------------------
  228.   # 回合数图片精灵Z坐标.
  229.   #---------------------------------------------------------------------------   
  230.   TURN_SPRITE_Z = 0
  231.   #---------------------------------------------------------------------------
  232.   # 回合数图片位置
  233.   #---------------------------------------------------------------------------  
  234.   TURN_SPRITE_POSITION = [8,-30]
  235.   #---------------------------------------------------------------------------  
  236.   # 是否显示闪烁效果
  237.   #---------------------------------------------------------------------------  
  238.   TURN_BLINK_EFFECT = true
  239.   #---------------------------------------------------------------------------  
  240.  
  241.  
  242.   #============================================================================
  243.   #============================================================================
  244.   # * HP
  245.   #============================================================================
  246.   # 是否显示HP数字图片
  247.   # 需要图片
  248.   #
  249.   # HP_Number.png
  250.   #
  251.   #---------------------------------------------------------------------------
  252.   HP_NUMBER_VISIBLE = true
  253.   #---------------------------------------------------------------------------
  254.   # Hp数字的Z坐标
  255.   #---------------------------------------------------------------------------   
  256.   HP_NUMBER_Z = 2
  257.   #---------------------------------------------------------------------------
  258.   # HP数字的位置. [X,Y]
  259.   #---------------------------------------------------------------------------  
  260.   HP_NUMBER_POSITION = [117,26]
  261.   #---------------------------------------------------------------------------  
  262.   # 是否显示HP总量数字的图片.
  263.   # 需要图片:
  264.   #
  265.   # HP_Number_Max.png
  266.   #
  267.   #---------------------------------------------------------------------------
  268.   HP_NUMBER_MAX_VISIBLE = false
  269.   #---------------------------------------------------------------------------
  270.   # HP总量数字的位置. [X,Y]
  271.   #---------------------------------------------------------------------------  
  272.   HP_NUMBER_MAX_POSITION = [165,30]
  273.   #---------------------------------------------------------------------------
  274.   # 设定数字对齐方式.
  275.   #
  276.   # 0 - 左
  277.   # 1 - 中
  278.   # 2 - 右
  279.   #---------------------------------------------------------------------------  
  280.   HP_NUMBER_ALIGN_TYPE = 2
  281.   #---------------------------------------------------------------------------
  282.   # 是否显示数字波浪形对齐方式.
  283.   #---------------------------------------------------------------------------
  284.   HP_NUMBER_WAVE_ALIGN_EFFECT = false
  285.   #---------------------------------------------------------------------------
  286.   # 是否以百分比显示数字
  287.   #---------------------------------------------------------------------------   
  288.   HP_NUMBER_PERCENTAGE = false
  289.   #---------------------------------------------------------------------------
  290.   # 是否显示数字动画效果 ("滚动").
  291.   #---------------------------------------------------------------------------  
  292.   HP_NUMBER_ANIMATION = true
  293.   #---------------------------------------------------------------------------
  294.   # 是否在HP低下时显示另一张颜色的图片作为HP数字.
  295.   # 需要一张被分成两帧高的图片
  296.   #
  297.   # 普通颜色
  298.   # 低下时颜色
  299.   #
  300.   # 如果你设定为false则图片会被分成一帧高.
  301.   #---------------------------------------------------------------------------  
  302.   HP_NUMBER_LOW_COLOR = false
  303.   #---------------------------------------------------------------------------
  304.   # 是否使用 HP 条图片.
  305.   # 需要图片.
  306.   #
  307.   # HP_Meter.png
  308.   #  
  309.   #---------------------------------------------------------------------------  
  310.   HP_METER_VISIBLE = true
  311.   #---------------------------------------------------------------------------
  312.   # 设定HP条的Z坐标.
  313.   #---------------------------------------------------------------------------   
  314.   HP_METER_Z = 1
  315.   #---------------------------------------------------------------------------
  316.   # 设定HP条的位置. [X,Y]
  317.   #---------------------------------------------------------------------------  
  318.   HP_METER_POSITION = [38,39]
  319.   #---------------------------------------------------------------------------
  320.   # 设定HP条的倾角.
  321.   #---------------------------------------------------------------------------  
  322.   HP_METER_ANGLE = 0
  323.   #---------------------------------------------------------------------------
  324.   # 是否显示HP条的镜像效果
  325.   #---------------------------------------------------------------------------  
  326.   HP_METER_MIRROR_EFFECT = false
  327.   #---------------------------------------------------------------------------
  328.   # 是否使用HP条在角色受到伤害时显示不同的颜色的效果
  329.   # 需要一张被分成两帧高的图片
  330.   #
  331.   # 普通颜色
  332.   # 受伤颜色
  333.   #
  334.   # 设定为false则显示普通效果.
  335.   #---------------------------------------------------------------------------  
  336.   HP_METER_REDUCTION_ANIMATION = true
  337.   #---------------------------------------------------------------------------
  338.   #是否使用HP条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
  339.   #梯度变化来表现"流动"的效果。
  340.   #设定为false则显示普通效果.
  341.   #---------------------------------------------------------------------------  
  342.   HP_METER_GRADIENT_ANIMATION = true
  343.   #---------------------------------------------------------------------------
  344.   # 是否显示HP图标图片.
  345.   # 需要图片:
  346.   #
  347.   # HP_Icon.png
  348.   #
  349.   #---------------------------------------------------------------------------
  350.   HP_ICON_VISIBLE = false
  351.   #---------------------------------------------------------------------------
  352.   # HP图标的Z坐标
  353.   #---------------------------------------------------------------------------   
  354.   HP_ICON_Z = 1
  355.   #---------------------------------------------------------------------------
  356.   # HP图标的位置.
  357.   #---------------------------------------------------------------------------  
  358.   HP_ICON_POSITION = [200,0]
  359.   #---------------------------------------------------------------------------
  360.   # 是否使用HP图标EX ,其作为HP图标的最后一个图标
  361.   # 需要图片:
  362.   #
  363.   # HP_Icon_EX.png
  364.   #
  365.   #---------------------------------------------------------------------------
  366.   HP_ICON_EX_VISIBLE = false
  367.   #---------------------------------------------------------------------------
  368.   # HP图标EX的位置.
  369.   #---------------------------------------------------------------------------  
  370.   HP_ICON_EX_POSITION = [0,0]
  371.   #---------------------------------------------------------------------------
  372.   # 是否显示HP图标EX的缩放效果.
  373.   #---------------------------------------------------------------------------
  374.   HP_ICON_EX_ZOOM_EFFECT = true
  375.   #---------------------------------------------------------------------------
  376.   # HP图标EX的间隔.
  377.   #---------------------------------------------------------------------------   
  378.   HP_ICON_SPACE = [-10,-10]
  379.   #---------------------------------------------------------------------------
  380.   # 设置水平上图标的最大数量
  381.   #---------------------------------------------------------------------------  
  382.   HP_ICON_COL_MAX = 10
  383.   #---------------------------------------------------------------------------
  384.   # 设置竖直上图标的最大数量
  385.   #---------------------------------------------------------------------------   
  386.   HP_ICON_ROW_MAX = 2
  387.   #---------------------------------------------------------------------------
  388.   # 是否显示HP图标图片
  389.   # 需要图片
  390.   #
  391.   # HP_Icon_Number.png
  392.   #
  393.   #---------------------------------------------------------------------------
  394.   HP_ICON_NUMBER_VISIBLE = false
  395.   #---------------------------------------------------------------------------
  396.   # Hp图标的Z坐标
  397.   #---------------------------------------------------------------------------
  398.   HP_ICON_NUMBER_Z = 4
  399.   #---------------------------------------------------------------------------
  400.   # Posição do número do ícone
  401.   #---------------------------------------------------------------------------  
  402.   HP_ICON_NUMBER_POSITION = [0,0]
  403.   #---------------------------------------------------------------------------
  404.   # 设定图标数字对齐方式.
  405.   #
  406.   # 0 - 左
  407.   # 1 - 中
  408.   # 2 - 右
  409.   #---------------------------------------------------------------------------  
  410.   HP_ICON_NUMBER_ALIGN_TYPE = 0   
  411.   #============================================================================
  412.   #============================================================================
  413.  
  414.  
  415.   #============================================================================
  416.   #============================================================================
  417.   # * MP
  418.   #============================================================================
  419.   # 是否显示MP数字图片
  420.   # 需要图片
  421.   #
  422.   # MP_Number.png
  423.   #  
  424.   #---------------------------------------------------------------------------  
  425.   MP_NUMBER_VISIBLE = true
  426.   #---------------------------------------------------------------------------
  427.   # Mp数字的Z坐标
  428.   #---------------------------------------------------------------------------   
  429.   MP_NUMBER_Z = 2  
  430.   #---------------------------------------------------------------------------
  431.   # MP数字的位置
  432.   #---------------------------------------------------------------------------  
  433.   MP_NUMBER_POSITION = [90,44]
  434.   #---------------------------------------------------------------------------  
  435.   # 是否显示MP总量数字的图片.
  436.   # 需要图片:
  437.   #
  438.   # MP_Number_Max.png
  439.   #
  440.   #---------------------------------------------------------------------------
  441.   MP_NUMBER_MAX_VISIBLE = false
  442.   #---------------------------------------------------------------------------
  443.   # MP总量数字的位置. [X,Y]
  444.   #---------------------------------------------------------------------------  
  445.   MP_NUMBER_MAX_POSITION = [128,53]
  446.   #---------------------------------------------------------------------------
  447.   # 设定数字对齐方式.
  448.   #
  449.   # 0 - 左
  450.   # 1 - 中
  451.   # 2 - 右
  452.   #---------------------------------------------------------------------------  
  453.   MP_NUMBER_ALIGN_TYPE = 2
  454.   #---------------------------------------------------------------------------
  455.   #是否显示数字波浪形对齐方式.
  456.   #---------------------------------------------------------------------------
  457.   MP_NUMBER_WAVE_ALIGN_EFFECT = false   
  458.   #---------------------------------------------------------------------------
  459.   # 是否以百分比显示数字
  460.   #---------------------------------------------------------------------------   
  461.   MP_NUMBER_PERCENTAGE = false
  462.   #---------------------------------------------------------------------------
  463.   # 是否显示数字动画效果 ("滚动").
  464.   #---------------------------------------------------------------------------  
  465.   MP_NUMBER_ANIMATION = true
  466.   #---------------------------------------------------------------------------
  467.   # 是否在HP低下时显示另一张颜色的图片作为MP数字.
  468.   # 需要一张被分成两帧高的图片
  469.   #
  470.   # 普通颜色
  471.   # 低下时颜色
  472.   #
  473.   # 如果你设定为false则图片会被分成一帧高.
  474.   #---------------------------------------------------------------------------  
  475.   MP_NUMBER_LOW_COLOR = false
  476.   #---------------------------------------------------------------------------
  477.   # 是否使用 MP 条图片.
  478.   # 需要图片.
  479.   #
  480.   # MP_Meter.png
  481.   #   
  482.   #---------------------------------------------------------------------------  
  483.   MP_METER_VISIBLE = true
  484.   #---------------------------------------------------------------------------
  485.   # 设定MP条的Z坐标.
  486.   #---------------------------------------------------------------------------   
  487.   MP_METER_Z = 1  
  488.   #---------------------------------------------------------------------------
  489.   # 设定MP条的位置. [X,Y]
  490.   #---------------------------------------------------------------------------  
  491.   MP_METER_POSITION = [9,56]
  492.   #---------------------------------------------------------------------------
  493.   # 设定MP条的倾角.
  494.   #---------------------------------------------------------------------------  
  495.   MP_METER_ANGLE = 0
  496.   #---------------------------------------------------------------------------
  497.   # 是否显示MP条的镜像效果
  498.   #---------------------------------------------------------------------------  
  499.   MP_METER_MIRROR_EFFECT = false
  500.   #---------------------------------------------------------------------------
  501.   # 是否使用MP条在角色受到伤害时显示不同的颜色的效果
  502.   # 需要一张被分成两帧高的图片
  503.   #
  504.   # 普通颜色
  505.   # 受伤颜色
  506.   #
  507.   # 设定为false则显示普通效果.
  508.   #---------------------------------------------------------------------------  
  509.   MP_METER_REDUCTION_ANIMATION = true
  510.   #---------------------------------------------------------------------------
  511.   #是否使用MP条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
  512.   #梯度变化来表现"流动"的效果。
  513.   #设定为false则显示普通效果.
  514.   #---------------------------------------------------------------------------  
  515.   MP_METER_GRADIENT_ANIMATION = true
  516.   #---------------------------------------------------------------------------
  517.   # 是否显示MP图标图片.
  518.   # 需要图片:
  519.   #
  520.   # MP_Icon.png
  521.   #
  522.   #---------------------------------------------------------------------------
  523.   MP_ICON_VISIBLE = false
  524.   #---------------------------------------------------------------------------
  525.   # MP图标的Z坐标
  526.   #---------------------------------------------------------------------------   
  527.   MP_ICON_Z = 1  
  528.   #---------------------------------------------------------------------------
  529.   # MP图标的位置.
  530.   #---------------------------------------------------------------------------  
  531.   MP_ICON_POSITION = [200,64]
  532.   #---------------------------------------------------------------------------
  533.   # 是否使用MP图标EX ,其作为MP图标的最后一个图标
  534.   # 需要图片:
  535.   #
  536.   # MP_Icon_EX.png
  537.   #
  538.   #---------------------------------------------------------------------------
  539.   MP_ICON_EX_VISIBLE = false
  540.   #---------------------------------------------------------------------------
  541.   # MP图标EX的位置.
  542.   #---------------------------------------------------------------------------  
  543.   MP_ICON_EX_POSITION = [0,0]
  544.   #---------------------------------------------------------------------------
  545.   # 是否显示MP图标EX的缩放效果.
  546.   #---------------------------------------------------------------------------
  547.   MP_ICON_EX_ZOOM_EFFECT = true
  548.   #---------------------------------------------------------------------------
  549.   # MP图标EX的间隔.
  550.   #---------------------------------------------------------------------------   
  551.   MP_ICON_SPACE = [-10,-10]
  552.   #---------------------------------------------------------------------------
  553.   # 设置水平上图标的最大数量
  554.   #---------------------------------------------------------------------------  
  555.   MP_ICON_COL_MAX = 10
  556.   #---------------------------------------------------------------------------
  557.   # 设置竖直上图标的最大数量
  558.   #---------------------------------------------------------------------------   
  559.   MP_ICON_ROW_MAX = 2
  560.   #---------------------------------------------------------------------------
  561.   # 是否显示MP图标图片
  562.   # 需要图片
  563.   #
  564.   # MP_Icon_Number.png
  565.   #
  566.   #---------------------------------------------------------------------------
  567.   MP_ICON_NUMBER_VISIBLE = false
  568.   #---------------------------------------------------------------------------
  569.   # Mp图标的Z坐标
  570.   #---------------------------------------------------------------------------
  571.   MP_ICON_NUMBER_Z = 4
  572.   #---------------------------------------------------------------------------
  573.   # MP图标的位置
  574.   #---------------------------------------------------------------------------  
  575.   MP_ICON_NUMBER_POSITION = [0,64]
  576.   #---------------------------------------------------------------------------
  577.   # 设定图标数字对齐方式.
  578.   #
  579.   # 0 - 左
  580.   # 1 - 中
  581.   # 2 - 右
  582.   #---------------------------------------------------------------------------  
  583.   MP_ICON_NUMBER_ALIGN_TYPE = 0   
  584.   #============================================================================
  585.   #============================================================================
  586.  
  587.  
  588.   #============================================================================
  589.   #============================================================================
  590.   # * TP
  591.   #============================================================================
  592.   # 是否显示TP数字图片
  593.   # 需要图片
  594.   #
  595.   # TP_Number.png
  596.   #   
  597.   #---------------------------------------------------------------------------
  598.   TP_NUMBER_VISIBLE = true
  599.   #---------------------------------------------------------------------------
  600.   # Tp数字的Z坐标
  601.   #---------------------------------------------------------------------------
  602.   TP_NUMBER_Z = 5  
  603.   #---------------------------------------------------------------------------
  604.   # TP数字的位置. [X,Y]
  605.   #---------------------------------------------------------------------------  
  606.   TP_NUMBER_POSITION = [19,23]
  607.   #---------------------------------------------------------------------------  
  608.   # 是否显示TP总量数字的图片.
  609.   # 需要图片:
  610.   #
  611.   # TP_Number_Max.png
  612.   #
  613.   #---------------------------------------------------------------------------
  614.   TP_NUMBER_MAX_VISIBLE = false
  615.   #---------------------------------------------------------------------------
  616.   # TP总量数字的位置. [X,Y]
  617.   #---------------------------------------------------------------------------  
  618.   TP_NUMBER_MAX_POSITION = [165,73]
  619.   #---------------------------------------------------------------------------
  620.   # 设定数字对齐方式.
  621.   #
  622.   # 0 - 左
  623.   # 1 - 中
  624.   # 2 - 右
  625.   #---------------------------------------------------------------------------  
  626.   TP_NUMBER_ALIGN_TYPE = 1
  627.   #---------------------------------------------------------------------------
  628.   # 是否显示数字波浪形对齐方式.
  629.   #---------------------------------------------------------------------------
  630.   TP_NUMBER_WAVE_ALIGN_EFFECT = false   
  631.   #---------------------------------------------------------------------------
  632.   # 是否以百分比显示数字
  633.   #---------------------------------------------------------------------------   
  634.   TP_NUMBER_PERCENTAGE = false
  635.   #---------------------------------------------------------------------------
  636.   # 是否显示数字动画效果 ("滚动").
  637.   #---------------------------------------------------------------------------  
  638.   TP_NUMBER_ANIMATION = true
  639.   #---------------------------------------------------------------------------
  640.   # 是否在HP低下时显示另一张颜色的图片作为TP数字.
  641.   # 需要一张被分成两帧高的图片
  642.   #
  643.   # 普通颜色
  644.   # 低下时颜色
  645.   #
  646.   # 如果你设定为false则图片会被分成一帧高.
  647.   #---------------------------------------------------------------------------  
  648.   TP_NUMBER_LOW_COLOR = false
  649.   #---------------------------------------------------------------------------
  650.   # 是否使用 TP 条图片.
  651.   # 需要图片.
  652.   #
  653.   # TP_Meter.png
  654.   #   
  655.   #---------------------------------------------------------------------------  
  656.   TP_METER_VISIBLE = false
  657.   #---------------------------------------------------------------------------
  658.   # 设定TP条的Z坐标.
  659.   #---------------------------------------------------------------------------
  660.   TP_METER_Z = 1  
  661.   #---------------------------------------------------------------------------
  662.   # 设定TP条的位置. [X,Y]
  663.   #---------------------------------------------------------------------------  
  664.   TP_METER_POSITION = [68,74]
  665.   #---------------------------------------------------------------------------
  666.   # 设定TP条的倾角.
  667.   #---------------------------------------------------------------------------  
  668.   TP_METER_ANGLE = 0
  669.   #---------------------------------------------------------------------------
  670.   # 是否显示TP条的镜像效果
  671.   #---------------------------------------------------------------------------  
  672.   TP_METER_MIRROR_EFFECT = false
  673.   #---------------------------------------------------------------------------
  674.   # 是否使用TP条在角色受到伤害时显示不同的颜色的效果
  675.   # 需要一张被分成两帧高的图片
  676.   #
  677.   # 普通颜色
  678.   # 受伤颜色
  679.   #
  680.   # 设定为false则显示普通效果.
  681.   #---------------------------------------------------------------------------  
  682.   TP_METER_REDUCTION_ANIMATION = true
  683.   #---------------------------------------------------------------------------
  684.   #是否使用TP条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
  685.   #梯度变化来表现"流动"的效果。
  686.   #设定为false则显示普通效果.
  687.   #---------------------------------------------------------------------------  
  688.   TP_METER_GRADIENT_ANIMATION = true
  689.   #---------------------------------------------------------------------------
  690.   # 是否显示TP图标图片.
  691.   # 需要图片:
  692.   #
  693.   # TP_Icon.png
  694.   #
  695.   #---------------------------------------------------------------------------
  696.   TP_ICON_VISIBLE = false
  697.   #---------------------------------------------------------------------------
  698.   # TP图标的Z坐标
  699.   #---------------------------------------------------------------------------
  700.   TP_ICON_Z = 1  
  701.   #---------------------------------------------------------------------------
  702.   # TP图标的位置.
  703.   #---------------------------------------------------------------------------  
  704.   TP_ICON_POSITION = [200,128]
  705.   #---------------------------------------------------------------------------
  706.   # 是否使用TP图标EX ,其作为TP图标的最后一个图标
  707.   # 需要图片:
  708.   #
  709.   # TP_Icon_EX.png
  710.   #
  711.   #---------------------------------------------------------------------------
  712.   TP_ICON_EX_VISIBLE = false
  713.   #---------------------------------------------------------------------------
  714.   # TP图标EX的位置.
  715.   #---------------------------------------------------------------------------  
  716.   TP_ICON_EX_POSITION = [0,0]
  717.   #---------------------------------------------------------------------------
  718.   # 是否显示TP图标EX的缩放效果.
  719.   #---------------------------------------------------------------------------
  720.   TP_ICON_EX_ZOOM_EFFECT = true
  721.   #---------------------------------------------------------------------------
  722.   # TP图标EX的间隔.
  723.   #---------------------------------------------------------------------------   
  724.   TP_ICON_SPACE = [-10,-10]
  725.   #---------------------------------------------------------------------------
  726.   # 设置水平上图标的最大数量
  727.   #---------------------------------------------------------------------------  
  728.   TP_ICON_COL_MAX = 10
  729.   #---------------------------------------------------------------------------
  730.   # 设置竖直上图标的最大数量
  731.   #---------------------------------------------------------------------------   
  732.   TP_ICON_ROW_MAX = 2
  733.   #---------------------------------------------------------------------------
  734.   # 是否显示TP图标图片
  735.   # 需要图片
  736.   #
  737.   # TP_Icon_Number.png
  738.   #
  739.   #---------------------------------------------------------------------------
  740.   TP_ICON_NUMBER_VISIBLE = false
  741.   #---------------------------------------------------------------------------
  742.   # Tp图标的Z坐标
  743.   #---------------------------------------------------------------------------
  744.   TP_ICON_NUMBER_Z = 4
  745.   #---------------------------------------------------------------------------
  746.   # TP图标的位置
  747.   #---------------------------------------------------------------------------  
  748.   TP_ICON_NUMBER_POSITION = [0,128]
  749.   #---------------------------------------------------------------------------
  750.   # 设定图标数字对齐方式.
  751.   #
  752.   # 0 - 左
  753.   # 1 - 中
  754.   # 2 - 右
  755.   #---------------------------------------------------------------------------  
  756.   TP_ICON_NUMBER_ALIGN_TYPE = 0   
  757.   #============================================================================
  758.   #============================================================================
  759.  
  760.   #============================================================================
  761.   #============================================================================
  762.   # * AT
  763.   #============================================================================
  764.   # 是否显示At数字图片
  765.   # 需要图片
  766.   #
  767.   # AT_Number.png
  768.   #
  769.   #---------------------------------------------------------------------------
  770.   AT_NUMBER_VISIBLE = false
  771.   #---------------------------------------------------------------------------
  772.   # AT数字的Z坐标
  773.   #---------------------------------------------------------------------------   
  774.   AT_NUMBER_Z = 2
  775.   #---------------------------------------------------------------------------
  776.   # AT数字的位置. [X,Y]
  777.   #---------------------------------------------------------------------------  
  778.   AT_NUMBER_POSITION = [125,-27]
  779.   #---------------------------------------------------------------------------  
  780.   # 是否显示AT总量数字的图片.
  781.   # 需要图片:
  782.   #
  783.   # AT_Number_Max.png
  784.   #
  785.   #---------------------------------------------------------------------------
  786.   AT_NUMBER_MAX_VISIBLE = false
  787.   #---------------------------------------------------------------------------
  788.   # AT总量数字的位置. [X,Y]
  789.   #---------------------------------------------------------------------------  
  790.   AT_NUMBER_MAX_POSITION = [165,-17]
  791.   #---------------------------------------------------------------------------
  792.   # 设定数字对齐方式.
  793.   #
  794.   # 0 - 左
  795.   # 1 - 中
  796.   # 2 - 右
  797.   #---------------------------------------------------------------------------  
  798.   AT_NUMBER_ALIGN_TYPE = 2
  799.   #---------------------------------------------------------------------------
  800.   # 是否显示数字波浪形对齐方式.
  801.   #---------------------------------------------------------------------------
  802.   AT_NUMBER_WAVE_ALIGN_EFFECT = false
  803.   #---------------------------------------------------------------------------
  804.   # 是否以百分比显示数字
  805.   #---------------------------------------------------------------------------   
  806.   AT_NUMBER_PERCENTAGE = true
  807.   #---------------------------------------------------------------------------
  808.   # 是否显示数字动画效果 ("滚动").
  809.   #---------------------------------------------------------------------------  
  810.   AT_NUMBER_ANIMATION = false
  811.   #---------------------------------------------------------------------------
  812.   # 是否使用 AT 条图片.
  813.   # 需要图片.
  814.   #
  815.   # AT_Meter.png
  816.   #  
  817.   #---------------------------------------------------------------------------  
  818.   AT_METER_VISIBLE = true
  819.   #---------------------------------------------------------------------------
  820.   # 设定AT条的Z坐标.
  821.   #---------------------------------------------------------------------------   
  822.   AT_METER_Z = 1
  823.   #---------------------------------------------------------------------------
  824.   # 设定AT条的位置. [X,Y]
  825.   #---------------------------------------------------------------------------  
  826.   AT_METER_POSITION = [38,76]
  827.   #---------------------------------------------------------------------------
  828.   # AT条的倾角.
  829.   #---------------------------------------------------------------------------  
  830.   AT_METER_ANGLE = 0
  831.   #---------------------------------------------------------------------------
  832.   # 是否显示AT条的镜像效果
  833.   #---------------------------------------------------------------------------  
  834.   AT_METER_MIRROR_EFFECT = false
  835.   #---------------------------------------------------------------------------
  836.   #是否使用AT条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
  837.   #梯度变化来表现"流动"的效果。
  838.   #设定为false则显示普通效果.
  839.   #---------------------------------------------------------------------------  
  840.   AT_METER_GRADIENT_ANIMATION = true
  841.   #============================================================================
  842.  
  843.  
  844.   #============================================================================
  845.   #============================================================================
  846.   # * LEVEL
  847.   #============================================================================
  848.   # 是否显示等级数字图片
  849.   # 需要图片
  850.   #
  851.   # LV_Number.png
  852.   #   
  853.   #---------------------------------------------------------------------------
  854.   LEVEL_NUMBER_VISIBLE = false
  855.   #---------------------------------------------------------------------------
  856.   # 等级数字的Z坐标
  857.   #---------------------------------------------------------------------------   
  858.   LEVEL_NUMBER_Z = 2
  859.   #---------------------------------------------------------------------------
  860.   # 等级数字的位置. [X,Y]
  861.   #---------------------------------------------------------------------------  
  862.   LEVEL_NUMBER_POSITION = [84,0]
  863.   #---------------------------------------------------------------------------
  864.   # 设定数字对齐方式.
  865.   #
  866.   # 0 - 左
  867.   # 1 - 中
  868.   # 2 - 右
  869.   #---------------------------------------------------------------------------  
  870.   LEVEL_NUMBER_ALIGN_TYPE = 1     
  871.   #============================================================================
  872.   #============================================================================
  873.  
  874.  
  875.   #============================================================================
  876.   #============================================================================
  877.   # * 状态
  878.   #============================================================================
  879.   # 是否显示状态图标
  880.   #---------------------------------------------------------------------------  
  881.   STATES_VISIBLE = true
  882.   #---------------------------------------------------------------------------
  883.   # 状态精灵Z坐标
  884.   #---------------------------------------------------------------------------   
  885.   STATES_Z = 1
  886.   #---------------------------------------------------------------------------
  887.   # 状态位置. [X,Y]
  888.   #---------------------------------------------------------------------------  
  889.   STATES_POSITION = [7,65]
  890.   #---------------------------------------------------------------------------
  891.   # 是否显示状态滚动动画.
  892.   #---------------------------------------------------------------------------  
  893.   STATES_SCROLLING_ANIMATION = false
  894.   #---------------------------------------------------------------------------
  895.   # 状态倾角.
  896.   #---------------------------------------------------------------------------   
  897.   STATE_ANGLE = 0
  898.   #---------------------------------------------------------------------------
  899.   # 不在hud中显示状态图标的状态.
  900.   # 例子 - HIDE_STATES_ID = [9,10,12,14]
  901.   #---------------------------------------------------------------------------   
  902.   HIDE_STATES_ID = []
  903.   #============================================================================
  904.   #============================================================================
  905.  
  906.   #============================================================================
  907.   #============================================================================
  908.   # * 第二图层 (Overlayer)
  909.   #============================================================================  
  910.   # 是否显示第二图层图片
  911.   # 需要图片
  912.   #
  913.   # Layout_2.png
  914.   #
  915.   #============================================================================  
  916.   SECOND_LAYOUT = false
  917.   #---------------------------------------------------------------------------
  918.   # 第二图层的Z坐标
  919.   #---------------------------------------------------------------------------  
  920.   SECOND_LAYOUT_Z = 4
  921.   #---------------------------------------------------------------------------
  922.   # 第二图层的位置
  923.   #---------------------------------------------------------------------------   
  924.   SECOND_LAYOUT_POSITION = [-5,-10]
  925.   #============================================================================
  926.   #============================================================================
  927.  
  928.   #============================================================================
  929.   #============================================================================
  930.   # * 画面图片
  931.   #============================================================================  
  932.   # 在画面上显示一张图片.
  933.   # 需要图片:
  934.   #
  935.   # Layout_Screen.png
  936.   #
  937.   #============================================================================  
  938.   #是否显示画面图片
  939.   SCREEN_LAYOUT = false
  940.   #---------------------------------------------------------------------------
  941.   #画面图片的位置
  942.   #---------------------------------------------------------------------------
  943.   SCREEN_LAYOUT_POSITION = [0,0]
  944.   #---------------------------------------------------------------------------
  945.   #画面图片的Z坐标
  946.   #---------------------------------------------------------------------------
  947.   SCREEN_LAYOUT_Z = -2   
  948.  
  949. end
  950.  
  951. #============================================================================
  952. #============================================================================
  953. # * 自定义窗口 (通用)
  954. #============================================================================
  955. module MOG_BATTLE_HUD_EX
  956.  
  957. #============================================================================
  958. # * 是否启用自定义窗口
  959. #============================================================================
  960.   ENABLE_CUSTOM_WINDOWS = true
  961.  
  962. #============================================================================
  963. # * 战斗日志窗口
  964. #============================================================================
  965. # 修改战斗日志窗口的位置
  966.   BATTLE_LOG_POSITION = [0,0]
  967. #============================================================================
  968.  
  969. #============================================================================
  970. # * 字体设定
  971. #============================================================================
  972. #是否启用窗口字体
  973. ENABLE_WINDOW_FONT_SET = false
  974. #窗口字体名
  975. WINDOW_FONT_NAME = nil
  976. #窗口字体大小
  977. WINDOW_FONT_SIZE = 18
  978. #窗口字体是否加粗
  979. WINDOW_FONT_BOLD = true
  980. #窗口字体是否斜体
  981. WINDOW_FONT_ITALIC = false
  982.  
  983. #============================================================================
  984. # * 技能窗口
  985. #============================================================================
  986. #技能窗口大小
  987.   SKILL_WINDOW_SIZE = [Graphics.width, 120]
  988. #技能窗口位置.
  989.   SKILL_WINDOW_POSITION = [0,0]
  990. #技能窗口不透明度
  991.   SKILL_WINDOW_OPACITY = 0
  992. #是否显示技能窗口的图片. ("Layout_Skill.png")
  993.   SKILL_WINDOW_LAYOUT = true
  994. #技能窗口图片的位置
  995.   SKILL_WINDOW_LAYOUT_POSITION = [0,-7]
  996. #Definição da quantidade colunas máxima.
  997.   SKILL_COL_MAX = 2
  998.   #是否显示技能窗口的滑动效果
  999.   SKILL_WINDOW_SLIDE_EFFECT = false
  1000.   #技能窗口的滑动位置
  1001.   SKILL_WINDOW_SLIDE_POSITION = [150,150]   
  1002. #============================================================================
  1003.  
  1004. #============================================================================
  1005. # * 物品窗口
  1006. #============================================================================
  1007. #物品窗口大小.  
  1008.   ITEM_WINDOW_SIZE = [Graphics.width, 120]
  1009. #物品窗口的位置.
  1010.   ITEM_WINDOW_POSITION = [0,0]
  1011. #物品窗口不透明度
  1012.   ITEM_WINDOW_OPACITY = 0
  1013. #是否显示物品窗口的图片. ("Layout_Item.png")   
  1014.   ITEM_WINDOW_LAYOUT = true
  1015. #物品窗口图片的位置.  
  1016.   ITEM_WINDOW_LAYOUT_POSITION = [0,-7]   
  1017. #
  1018.   ITEM_COL_MAX = 2
  1019.   #是否显示物品窗口的滑动效果
  1020.   ITEM_WINDOW_SLIDE_EFFECT = false
  1021.   #物品窗口的滑动位置
  1022.   ITEM_WINDOW_SLIDE_POSITION = [150,150]   
  1023. #============================================================================
  1024.  
  1025. #============================================================================
  1026. # * 角色指令窗口(攻击/防御等)
  1027. #============================================================================
  1028. #是否自动调整指令窗口
  1029.   AUTO_ADJUST_ACTOR_COMMAND = true
  1030. #指令窗口的位置
  1031.   ACTOR_COMMAND_POSITION = [0,-50]
  1032. #指令窗口不透明度
  1033.   ACTOR_COMMAND_OPACITY = 0
  1034. #是否使用指令窗口的图片. ("Layout_Command.png")   
  1035.   ACTOR_COMMAND_LAYOUT = true
  1036. #指令窗口图片的位置.   
  1037.   ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
  1038. #============================================================================
  1039.  
  1040. #============================================================================
  1041. # * 帮助窗口
  1042. #============================================================================
  1043. #帮助窗口的大小.   
  1044.   HELP_WINDOW_SIZE = [Graphics.width, 72]
  1045. #帮助窗口的位置.
  1046.   HELP_WINDOW_POSITION = [Graphics.width / 2, 0]  
  1047. #帮助窗口不透明度
  1048.   HELP_WINDOW_OPACITY = 0
  1049. #是否显示帮助窗口的图片. ("Layout_Help.png")   
  1050.   HELP_WINDOW_LAYOUT = true
  1051. #帮助窗口图片的位置.
  1052.   HELP_WINDOW_LAYOUT_POSITION = [0,0]
  1053.   #是否显示帮助窗口的滑动效果
  1054.   HELP_WINDOW_SLIDE_EFFECT = false
  1055.   #帮助窗口的滑动位置
  1056.   HELP_WINDOW_SLIDE_POSITION = [0,-150]   
  1057. #============================================================================
  1058.  
  1059. #============================================================================
  1060. # * 目标角色窗口
  1061. #============================================================================
  1062. #角色窗口的大小.   
  1063.   ACTOR_WINDOW_SIZE = [Graphics.width, 120]  
  1064. #角色窗口的位置.
  1065.   ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1066. #角色窗口不透明度.  
  1067.   ACTOR_WINDOW_OPACITY = 0
  1068. #是否显示角色窗口的图片. ("Layout_Target_Actor.png")
  1069.   ACTOR_WINDOW_LAYOUT = true
  1070. #角色窗口图片的位置.
  1071.   ACTOR_WINDOW_LAYOUT_POSITION = [0,0]
  1072.   #是否显示角色窗口的滑动效果
  1073.   ACTOR_WINDOW_SLIDE_EFFECT = false
  1074.   #角色窗口的滑动位置
  1075.   ACTOR_WINDOW_SLIDE_POSITION = [0,100]  
  1076. #============================================================================
  1077.  
  1078. #============================================================================
  1079. # * 目标敌人窗口
  1080. #============================================================================
  1081. #敌人窗口的大小.
  1082.   ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  1083. #敌人窗口的位置  
  1084.   ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1085. #敌人窗口不透明度.   
  1086.   ENEMY_WINDOW_OPACITY = 0
  1087. #是否显示敌人窗口的图片. ("Layout_Target_Actor.png")
  1088.   ENEMY_WINDOW_LAYOUT = true
  1089. #敌人窗口图片的位置.
  1090.   ENEMY_WINDOW_LAYOUT_POSITION = [0,0]
  1091.   #是否显示敌人窗口的滑动效果
  1092.   ENEMY_WINDOW_SLIDE_EFFECT = false
  1093.   #敌人窗口的滑动位置
  1094.   ENEMY_WINDOW_SLIDE_POSITION = [0,100]      
  1095. #============================================================================
  1096.  
  1097. #============================================================================
  1098. # * 队伍窗口 (战斗/撤退)
  1099. #============================================================================
  1100. #队伍窗口位置  
  1101.   PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  1102. #队伍窗口不透明度   
  1103.   PARTY_COMMAND_OPACITY = 0
  1104. #是否显示队伍窗口的图片 ("Layout_Party.png")  
  1105.   PARTY_COMMAND_LAYOUT = true
  1106. #队伍窗口图片的位置  
  1107.   PARTY_COMMAND_LAYOUT_POSITION = [0,0]
  1108.   #是否显示队伍窗口的滑动效果
  1109.   PARTY_COMMAND_SLIDE_EFFECT = false
  1110.   #队伍窗口的滑动位置
  1111.   PARTY_COMMAND_SLIDE_POSITION = [0,-150]     
  1112. #============================================================================
  1113.  
  1114. end
  1115.  
  1116. #==============================================================================
  1117. # ** 核心
  1118. #==============================================================================
  1119. module Cache
  1120.  
  1121.   #--------------------------------------------------------------------------
  1122.   # * Hud
  1123.   #--------------------------------------------------------------------------
  1124.   def self.battle_hud(filename)
  1125.       load_bitmap("Graphics/Huds/Battle/", filename)
  1126.   end
  1127.  
  1128. end
  1129.  
  1130. #==============================================================================
  1131. # ** Game Temp
  1132. #==============================================================================
  1133. class Game_Temp
  1134.  
  1135.   attr_accessor :battler_face_pos
  1136.   attr_accessor :hud_pos
  1137.   attr_accessor :hud_pos_real
  1138.   attr_accessor :com_pos
  1139.   attr_accessor :mbhud_force_refresh
  1140.   attr_accessor :mbhud_window
  1141.   attr_accessor :command_visible
  1142.   attr_accessor :refresh_turn_sprite
  1143.   attr_accessor :battle_hud_visible
  1144.   attr_accessor :battle_hud_visible_refresh
  1145.   attr_accessor :battle_end
  1146.  
  1147.   #--------------------------------------------------------------------------
  1148.   # * Initialize
  1149.   #--------------------------------------------------------------------------   
  1150.   alias mog_monogatari_bhud_initialize initialize
  1151.   def initialize
  1152.       @battler_face_pos = []
  1153.       @hud_pos = []
  1154.       @hud_pos_real = []
  1155.       @com_pos = []
  1156.       @mbhud_force_refresh = false
  1157.       @mbhud_window = [false,false,false,false,false,false,false]
  1158.       @command_visible = false
  1159.       @refresh_turn_sprite = false
  1160.       @battle_hud_visible = true
  1161.       @battle_hud_visible_refresh = [false,false]
  1162.       @battle_end = false      
  1163.       mog_monogatari_bhud_initialize
  1164.   end
  1165.  
  1166.   #--------------------------------------------------------------------------
  1167.   # * Check Screen Xyz
  1168.   #--------------------------------------------------------------------------   
  1169.   def check_screen_xyz_nil
  1170.       return if !SceneManager.face_battler?
  1171.       for actor in $game_party.battle_members
  1172.           actor.screen_x = 0 if actor.screen_x == nil
  1173.           actor.screen_y = 0 if actor.screen_y == nil
  1174.           actor.screen_z = 0 if actor.screen_z == nil
  1175.       end
  1176.   end  
  1177.  
  1178.   #--------------------------------------------------------------------------
  1179.   # ● Sprite Visible
  1180.   #--------------------------------------------------------------------------   
  1181.   def sprite_visible
  1182.       return false if $game_message.visible
  1183.       return false if $game_temp.battle_end
  1184.       return true
  1185.   end  
  1186.  
  1187. end
  1188.  
  1189. #==============================================================================
  1190. # ** Game Interpreter
  1191. #==============================================================================
  1192. class Game_Interpreter
  1193.  
  1194. #--------------------------------------------------------------------------
  1195. # * Refresh Battle Hud
  1196. #--------------------------------------------------------------------------
  1197. def refresh_battle_hud
  1198.      $game_temp.check_screen_xyz_nil rescue nil
  1199.      $game_temp.mbhud_force_refresh = true
  1200. end
  1201.  
  1202. #--------------------------------------------------------------------------
  1203. # * Battler Face Name
  1204. #--------------------------------------------------------------------------
  1205. def battler_face_name(actor_id,face_name = "")
  1206.      for actor in $game_party.members
  1207.          actor.battler_face_name = face_name if actor.id == actor_id
  1208.      end
  1209.      refresh_battle_hud
  1210. end  
  1211.  
  1212. #--------------------------------------------------------------------------
  1213. # * Battler Hud Visible
  1214. #--------------------------------------------------------------------------
  1215. def battle_hud_visible(value)
  1216.      $game_temp.battle_hud_visible = value
  1217. end
  1218.  
  1219. #--------------------------------------------------------------------------
  1220. # * Command_129
  1221. #--------------------------------------------------------------------------
  1222. alias mog_monogatari_bhud_command_129 command_129
  1223. def command_129
  1224.      mog_monogatari_bhud_command_129     
  1225.      refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1226. end
  1227.  
  1228. end
  1229.  
  1230. #==============================================================================
  1231. # ** Game Actor
  1232. #==============================================================================
  1233. class Game_Actor < Game_Battler
  1234.  
  1235.   attr_accessor :face_animation
  1236.   attr_accessor :battler_face_name
  1237.  
  1238.   #--------------------------------------------------------------------------
  1239.   # * Setup
  1240.   #--------------------------------------------------------------------------
  1241.   alias mog_monogatari_face_animation setup
  1242.   def setup(actor_id)
  1243.       mog_monogatari_face_animation(actor_id)
  1244.       @face_animation = [0,0,0]
  1245.       @battler_face_name = "Face_" + actor_id.to_s
  1246.   end   
  1247.  
  1248.   #--------------------------------------------------------------------------
  1249.   # ● Real Next Level
  1250.   #--------------------------------------------------------------------------  
  1251.   def real_next_level
  1252.       next_level_exp - exp_for_level(level)
  1253.   end
  1254.  
  1255.   #--------------------------------------------------------------------------
  1256.   # ● Remain Exp
  1257.   #--------------------------------------------------------------------------  
  1258.   def remain_exp
  1259.       exp - exp_for_level(level)
  1260.   end
  1261.  
  1262.   #--------------------------------------------------------------------------
  1263.   # ● Gain Exp Test
  1264.   #--------------------------------------------------------------------------
  1265.   def gain_exp_test
  1266.       exp_r = rand(next_level_exp)
  1267.       change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1268.   end   
  1269.  
  1270.   #--------------------------------------------------------------------------
  1271.   # ● Low HP?
  1272.   #--------------------------------------------------------------------------   
  1273.   def low_hp?
  1274.       hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1275.   end
  1276.  
  1277.   #--------------------------------------------------------------------------
  1278.   # ● Low MP?
  1279.   #--------------------------------------------------------------------------   
  1280.   def low_mp?
  1281.       mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1282.   end  
  1283.  
  1284.   #--------------------------------------------------------------------------
  1285.   # ● Low TP?
  1286.   #--------------------------------------------------------------------------   
  1287.   def low_tp?
  1288.       tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1289.   end  
  1290.  
  1291. end
  1292.  
  1293. #==============================================================================
  1294. # ** Game Party
  1295. #==============================================================================
  1296. class Game_Party < Game_Unit
  1297.  
  1298.   #--------------------------------------------------------------------------
  1299.   # * Get Maximum Number of Battle Members
  1300.   #--------------------------------------------------------------------------
  1301.   def max_battle_members
  1302.       return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
  1303.   end
  1304.  
  1305. #--------------------------------------------------------------------------
  1306. # * Swap Order
  1307. #--------------------------------------------------------------------------
  1308. alias mog_bhex_swap_order swap_order
  1309. def swap_order(index1, index2)
  1310.      mog_bhex_swap_order(index1, index2)
  1311.      if SceneManager.scene_is?(Scene_Battle)  
  1312.      $game_temp.check_screen_xyz_nil rescue nil
  1313.      $game_temp.mbhud_force_refresh = true     
  1314.      end
  1315. end  
  1316.  
  1317. end
  1318.  
  1319. #==============================================================================
  1320. # ** BattleManager
  1321. #==============================================================================
  1322. module BattleManager
  1323.  
  1324. #--------------------------------------------------------------------------
  1325. # * Current Index
  1326. #--------------------------------------------------------------------------   
  1327. def self.current_index
  1328.      if $imported[:mog_atb_system]
  1329.         return actor.index if actor
  1330.      end   
  1331.      return 0 if @actor_index == nil
  1332.      return @actor_index != -1 ? @actor_index : 0
  1333. end
  1334.  
  1335. #--------------------------------------------------------------------------
  1336. # * Current Index Real
  1337. #--------------------------------------------------------------------------   
  1338. def self.current_index_real
  1339.      return -1 if @actor_index == nil
  1340.      return @actor_index
  1341. end
  1342.  
  1343.   #--------------------------------------------------------------------------
  1344.   # * Next Actor Avaliable
  1345.   #--------------------------------------------------------------------------
  1346.   def self.next_actor_avaliable?
  1347.       return false if @actor_index == nil
  1348.       next_index = @actor_index + 1
  1349.       return false if next_index >= $game_party.members.size
  1350.       return true
  1351.   end
  1352.  
  1353.   #--------------------------------------------------------------------------
  1354.   # * To Next Command Input
  1355.   #--------------------------------------------------------------------------
  1356.   def self.next_command_avaliable
  1357.     aindex = @actor_index
  1358.     begin      
  1359.       if !actor || !actor.next_command
  1360.         return false if actor == nil
  1361.         aindex += 1
  1362.         return false if aindex >= $game_party.members.size
  1363.       end
  1364.     end until actor.inputable?
  1365.     return true
  1366.   end  
  1367.  
  1368.   #--------------------------------------------------------------------------
  1369.   # * Can Enable Window?
  1370.   #--------------------------------------------------------------------------
  1371.   def self.can_enable_window?
  1372.       max_members = $game_party.members.size
  1373.       index_real = current_index_real + 1
  1374.       return false if index_real > max_members
  1375.       return false if in_turn?
  1376.       return false if $imported[:mog_battle_cursor]
  1377.       return true
  1378.   end
  1379.  
  1380. end
  1381.  
  1382. #==============================================================================
  1383. # ** SceneManager
  1384. #==============================================================================
  1385. module SceneManager
  1386.  
  1387.   #--------------------------------------------------------------------------
  1388.   # * Face Battler
  1389.   #--------------------------------------------------------------------------
  1390.   def self.face_battler?
  1391.       return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1392.       return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
  1393.       return false if $imported[:mog_sprite_actor]
  1394.       return false if $imported[:ve_animated_battle]
  1395.       return false if $imported[:ve_actor_battlers]
  1396.       return false if $imported["YES-BattleSymphony"]
  1397.       return false if $imported["YEA-VisualBattlers"]
  1398.       return false if $imported["Galv_Animated_Battlers"]
  1399.       return false if $imported['KRX-AnimatedBattlers']
  1400.       return false if $imported[:Theo_BasicFuntions]
  1401.       return false if $sv_camera != nil
  1402.       return false if BattleManager.true_surprise != nil rescue nil
  1403.       return false if $imported[:jet][:AnimatedBattlers] rescue nil      
  1404.       return true
  1405.   end
  1406.  
  1407. end
  1408.  
  1409. #==============================================================================
  1410. # ■ Sprite Picture
  1411. #==============================================================================
  1412. class Sprite_Picture < Sprite
  1413.  
  1414.   #--------------------------------------------------------------------------
  1415.   # * Initialize
  1416.   #--------------------------------------------------------------------------
  1417.   alias mog_battle_hud_initialize initialize
  1418.   def initialize(viewport, picture)
  1419.       mog_battle_hud_initialize(viewport, picture)
  1420.       self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
  1421.  
  1422.   end  
  1423.  
  1424.   #--------------------------------------------------------------------------
  1425.   # * Update Position
  1426.   #--------------------------------------------------------------------------
  1427.   alias mog_battle_hud_update_position update_position
  1428.   def update_position
  1429.       mog_battle_hud_update_position
  1430.       self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
  1431.   end
  1432.  
  1433. end
  1434.  
  1435. #==============================================================================
  1436. # ■ Sprite Base
  1437. #==============================================================================
  1438. class Sprite_Base < Sprite
  1439.  
  1440.   #--------------------------------------------------------------------------
  1441.   # * Initialize
  1442.   #--------------------------------------------------------------------------
  1443.   alias mog_bhud_ex_initialize initialize
  1444.   def initialize(viewport = nil)
  1445.       @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
  1446.       mog_bhud_ex_initialize(viewport)
  1447.   end  
  1448.  
  1449.   #--------------------------------------------------------------------------
  1450.   # * Animation Set Sprite
  1451.   #--------------------------------------------------------------------------
  1452.   alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
  1453.   def animation_set_sprites(frame)
  1454.       mog_battle_hud_ex_animation_set_sprites(frame)
  1455.       update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
  1456.   end  
  1457.  
  1458.   #--------------------------------------------------------------------------
  1459.   # * Update Sprite Z Animation
  1460.   #--------------------------------------------------------------------------
  1461.   def update_sprite_z_animation  
  1462.       if $imported[:mog_battle_camera]
  1463.          @ani_sprites.each_with_index do |sprite, i|
  1464.          sprite.z = @ani_x + i end      
  1465.       else
  1466.          @ani_sprites.each_with_index do |sprite, i|
  1467.          sprite.viewport = nil ; sprite.z = @ani_x + i end
  1468.       end   
  1469.   end  
  1470.  
  1471. end
  1472.  
  1473. #==============================================================================
  1474. # ** Spriteset Battle
  1475. #==============================================================================
  1476. class Spriteset_Battle  
  1477.  
  1478.   #--------------------------------------------------------------------------
  1479.   # * Create Actors
  1480.   #--------------------------------------------------------------------------
  1481.   alias mog_battle_hud_create_actors create_actors
  1482.   def create_actors
  1483.       if can_create_max_members?
  1484.          @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  1485.          return
  1486.       end
  1487.       mog_battle_hud_create_actors
  1488.   end
  1489.  
  1490.   #--------------------------------------------------------------------------
  1491.   # * Can Create Max Members
  1492.   #--------------------------------------------------------------------------
  1493.   def can_create_max_members?
  1494.       return false if $imported[:ve_animated_battle]
  1495.       return false if $imported[:ve_actor_battlers]
  1496.       return false if $sv_camera != nil
  1497.       return true
  1498.   end
  1499.  
  1500. end
  1501.  
  1502. #==============================================================================
  1503. # ■ Scene Battle
  1504. #==============================================================================
  1505. class Scene_Battle < Scene_Base
  1506.  
  1507. #--------------------------------------------------------------------------
  1508. # ● Clear All Windows
  1509. #--------------------------------------------------------------------------
  1510.   alias mog_battle_hud_ex_start start
  1511.   def start
  1512.       setup_battle_hud_ex
  1513.       mog_battle_hud_ex_start
  1514.   end
  1515.  
  1516. #--------------------------------------------------------------------------
  1517. # ● Setup Battle Hud EX
  1518. #--------------------------------------------------------------------------
  1519. def setup_battle_hud_ex
  1520.      @force_clear_duration = 0
  1521. end
  1522.  
  1523. #--------------------------------------------------------------------------
  1524. # ● Clear All Windows
  1525. #--------------------------------------------------------------------------
  1526. def clear_all_windows
  1527.      if @actor_window != nil
  1528.         @actor_window.visible = false
  1529.         @actor_window.active = false
  1530.      end   
  1531.      if @status_window != nil
  1532.         @status_window.visible = false
  1533.         @status_window.active = false
  1534.      end   
  1535.      if @actor_command_window != nil
  1536.         @actor_command_window.visible = false
  1537.         @actor_command_window.active = false
  1538.      end
  1539.      if @party_command_window != nil
  1540.         @party_command_window.visible = false
  1541.         @party_command_window.active = false
  1542.      end
  1543.      if @help_window != nil
  1544.         @help_window.visible = false
  1545.      end  
  1546. end   
  1547.  
  1548. #--------------------------------------------------------------------------
  1549. # ● Update
  1550. #--------------------------------------------------------------------------
  1551.   alias mog_battle_hud_ex_update_main update
  1552.   def update
  1553.       mog_battle_hud_ex_update_main
  1554.       update_battle_hud_ex
  1555.   end
  1556.  
  1557. #--------------------------------------------------------------------------
  1558. # ● Update Battle Hud_ex
  1559. #--------------------------------------------------------------------------
  1560.   def update_battle_hud_ex
  1561.       @status_window.visible = false
  1562.   end
  1563.  
  1564.   if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1565.   #--------------------------------------------------------------------------
  1566.   # * On Skill OK
  1567.   #--------------------------------------------------------------------------
  1568.   alias mog_battle_hud_ex_on_skill_ok on_skill_ok
  1569.   def on_skill_ok
  1570.       @skill = @skill_window.item
  1571.       @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  1572.       mog_battle_hud_ex_on_skill_ok
  1573.   end
  1574.  
  1575.   #--------------------------------------------------------------------------
  1576.   # * On Item OK
  1577.   #--------------------------------------------------------------------------
  1578.   alias mog_battle_hud_on_item_ok on_item_ok
  1579.   def on_item_ok
  1580.       @item = @item_window.item
  1581.       @item_window.hide if @item.for_opponent? or @item.for_friend?
  1582.       mog_battle_hud_on_item_ok
  1583.   end     
  1584.  
  1585.   #--------------------------------------------------------------------------
  1586.   # * On Enemy Cancel
  1587.   #--------------------------------------------------------------------------
  1588.   alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
  1589.   def on_enemy_cancel
  1590.       mog_battle_hud_ex_on_enemy_cancel
  1591.       @skill_window.show if @skill_window.active
  1592.       @item_window.show if @item_window.active      
  1593.   end
  1594.  
  1595.   #--------------------------------------------------------------------------
  1596.   # * On Actor Cancel
  1597.   #--------------------------------------------------------------------------
  1598.   alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
  1599.   def on_actor_cancel
  1600.       mog_battle_hud_ex_on_actor_cancel
  1601.       @skill_window.show if @skill_window.active
  1602.       @item_window.show if @item_window.active
  1603.       mog_battle_hud_ex_on_actor_cancel
  1604.   end  
  1605.   end
  1606.  
  1607. end
  1608.  
  1609. if SceneManager.face_battler?
  1610. #==============================================================================
  1611. # ■ Game_Actor
  1612. #==============================================================================
  1613. class Game_Actor < Game_Battler
  1614.  
  1615.   attr_accessor :screen_x
  1616.   attr_accessor :screen_y
  1617.   attr_accessor :screen_z
  1618.  
  1619.  
  1620. #--------------------------------------------------------------------------
  1621. # ● Use Sprite?
  1622. #--------------------------------------------------------------------------
  1623.   def use_sprite?
  1624.       return true
  1625.   end
  1626.  
  1627. end
  1628.  
  1629. #==============================================================================
  1630. # ■ Sprite_Battler
  1631. #==============================================================================
  1632. class Sprite_Battler < Sprite_Base
  1633.   include MOG_BATTLE_HUD_EX
  1634.  
  1635.   #--------------------------------------------------------------------------
  1636.   # ● Update Collapse
  1637.   #--------------------------------------------------------------------------                          
  1638.    alias mog_battle_hud_update_collapse update_collapse
  1639.    def update_collapse
  1640.        return if face_can_cancel_method?
  1641.        mog_battle_hud_update_collapse
  1642.    end  
  1643.  
  1644.   #--------------------------------------------------------------------------
  1645.   # ● Update Instant Collapse
  1646.   #--------------------------------------------------------------------------                             
  1647.    alias mog_battle_hud_update_instant_collapse update_instant_collapse
  1648.    def update_instant_collapse
  1649.        return if face_can_cancel_method?
  1650.        mog_battle_hud_update_instant_collapse
  1651.    end  
  1652.  
  1653.   #--------------------------------------------------------------------------
  1654.   # ● Face Can Cancel Method
  1655.   #--------------------------------------------------------------------------                                 
  1656.   def face_can_cancel_method?
  1657.       return false if !SceneManager.face_battler?
  1658.       return false if @battler.is_a?(Game_Enemy)
  1659.       self.opacity = 255 ; self.visible = true
  1660.       return true
  1661.   end  
  1662.  
  1663.   #--------------------------------------------------------------------------
  1664.   # ● Update Bitmap
  1665.   #--------------------------------------------------------------------------                                 
  1666.   alias mog_battle_hud_ex_update_bitmap update_bitmap
  1667.   def update_bitmap
  1668.       return if face_can_cancel_method?
  1669.       mog_battle_hud_ex_update_bitmap
  1670.   end  
  1671.  
  1672.   #--------------------------------------------------------------------------
  1673.   # ● Update Position
  1674.   #--------------------------------------------------------------------------                                 
  1675.   alias mog_battle_hud_ex_update_position update_position
  1676.   def update_position
  1677.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  1678.          if !face_sprite_visible? or $game_temp.battle_end
  1679.              self.y = -1000
  1680.              return
  1681.          end
  1682.       end   
  1683.       mog_battle_hud_ex_update_position
  1684.   end  
  1685.  
  1686.   #--------------------------------------------------------------------------
  1687.   # * Sprite Visible
  1688.   #--------------------------------------------------------------------------
  1689.   def face_sprite_visible?
  1690.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  1691.       return false if !$game_temp.battle_hud_visible
  1692.       return true
  1693.   end  
  1694.  
  1695. end
  1696.  
  1697. end
  1698.  
  1699. #==============================================================================
  1700. # ** Window_BattleStatus
  1701. #==============================================================================
  1702. class Window_BattleStatus < Window_Selectable
  1703. include MOG_BATTLE_HUD_EX
  1704.  
  1705.   #--------------------------------------------------------------------------
  1706.   # * Get Window Width
  1707.   #--------------------------------------------------------------------------
  1708.   def window_width
  1709.       ACTOR_WINDOW_SIZE[0]
  1710.   end
  1711.  
  1712. #--------------------------------------------------------------------------
  1713. # * Refresh
  1714. #--------------------------------------------------------------------------   
  1715. alias mog_monogatari_refresh refresh
  1716. def refresh
  1717.      mog_monogatari_refresh
  1718.      self.visible = false
  1719.      self.opacity = 0
  1720.      self.contents_opacity = 0
  1721.      self.y = 1200
  1722. end  
  1723.  
  1724. end  
  1725.  
  1726. #==============================================================================
  1727. # ** Window Actor Command
  1728. #==============================================================================
  1729. class Window_ActorCommand < Window_Command
  1730.  
  1731. #--------------------------------------------------------------------------
  1732. # * Update
  1733. #--------------------------------------------------------------------------   
  1734.   alias mog_hud_battle_hud_ex_turn_sprite_update update
  1735.   def update
  1736.       mog_hud_battle_hud_ex_turn_sprite_update
  1737.       $game_temp.command_visible = self.visible
  1738.   end
  1739.  
  1740. end
  1741.  
  1742. #==============================================================================
  1743. # ** Window_BattleActor
  1744. #==============================================================================
  1745. class Window_BattleActor < Window_BattleStatus
  1746.  
  1747.   #--------------------------------------------------------------------------
  1748.   # * Refresh
  1749.   #--------------------------------------------------------------------------
  1750.   alias mog_battle_hud_ex_actor_w_refresh refresh
  1751.   def refresh
  1752.       mog_battle_hud_ex_actor_w_refresh
  1753.       self.contents_opacity = 255
  1754.       self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1755.       self.visible = true
  1756.   end
  1757.  
  1758. end  
  1759.  
  1760. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1761.  
  1762. #==============================================================================
  1763. # ** Window BattleLog
  1764. #==============================================================================
  1765. class Window_BattleLog < Window_Selectable
  1766.  
  1767.   include MOG_BATTLE_HUD_EX
  1768.  
  1769. #--------------------------------------------------------------------------
  1770. # * Initialize
  1771. #--------------------------------------------------------------------------   
  1772.   alias mog_battle_hud_ex_log_initialize initialize
  1773.   def initialize
  1774.       mog_battle_hud_ex_log_initialize
  1775.       self.x = BATTLE_LOG_POSITION[0]
  1776.       self.y = BATTLE_LOG_POSITION[1]
  1777.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1778.   end
  1779.  
  1780. #--------------------------------------------------------------------------
  1781. # * Create Back Sprite
  1782. #--------------------------------------------------------------------------   
  1783.   alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
  1784.   def create_back_sprite
  1785.       self.x = BATTLE_LOG_POSITION[0]
  1786.       self.y = BATTLE_LOG_POSITION[1]
  1787.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1788.       mog_battle_hud_ex_log_create_back_sprite
  1789.   end
  1790.  
  1791. end  
  1792.  
  1793. #==============================================================================
  1794. # ** Window Actor Command
  1795. #==============================================================================
  1796. class Window_ActorCommand < Window_Command
  1797.  
  1798.   include MOG_BATTLE_HUD_EX
  1799.  
  1800. #--------------------------------------------------------------------------
  1801. # * Initialize
  1802. #--------------------------------------------------------------------------   
  1803. alias mog_monogatari_initialize initialize
  1804. def initialize
  1805.      mog_monogatari_initialize
  1806.      create_layout if $imported[:mog_battle_command_ex] == nil
  1807. end
  1808.  
  1809. #--------------------------------------------------------------------------
  1810. # * Dispose
  1811. #--------------------------------------------------------------------------
  1812. alias mog_monogatari_actor_command_dispose dispose
  1813. def dispose
  1814.      mog_monogatari_actor_command_dispose
  1815.      dispose_layout
  1816. end
  1817.  
  1818. #--------------------------------------------------------------------------
  1819. # * Create Layout
  1820. #--------------------------------------------------------------------------   
  1821. def create_layout
  1822.      return if @layout != nil
  1823.      return if !ACTOR_COMMAND_LAYOUT
  1824.      return if $game_temp.mbhud_window[0]
  1825.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1826.      $game_temp.mbhud_window[0] = true
  1827.      @layout = Sprite.new
  1828.      @layout.bitmap = Cache.battle_hud("Layout_Command")
  1829.      @layout.z = self.z - 1
  1830.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1831.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1832.      @layout.visible = false
  1833. end
  1834.  
  1835. #--------------------------------------------------------------------------
  1836. # * Dispose Layout
  1837. #--------------------------------------------------------------------------
  1838. def dispose_layout
  1839.      return if @layout == nil
  1840.      @layout.dispose
  1841.      @layout = nil
  1842. end
  1843.  
  1844. #--------------------------------------------------------------------------
  1845. # * Refresh Layout
  1846. #--------------------------------------------------------------------------
  1847. def refresh_layout
  1848.      return if @layout == nil
  1849.      @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1850.      @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1851.      @layout.visible = self.visible
  1852.      @layout.z = self.z - 1
  1853. end
  1854.  
  1855. #--------------------------------------------------------------------------
  1856. # * Select
  1857. #--------------------------------------------------------------------------  
  1858. alias mog_monogatari_select_actor_command select
  1859. def select(index)
  1860.      mog_monogatari_select_actor_command(index)
  1861.      set_command_position if $imported[:mog_battle_command_ex] == nil
  1862. end   
  1863.  
  1864. #--------------------------------------------------------------------------
  1865. # * Set Command Position
  1866. #--------------------------------------------------------------------------   
  1867. def set_command_position
  1868.      self.viewport = nil
  1869.      self.opacity = ACTOR_COMMAND_OPACITY
  1870.      battler_index = BattleManager.current_index rescue nil
  1871.      battler_index = 0 if battler_index == nil     
  1872.      if @actor != nil and $game_temp.hud_pos[battler_index] != nil
  1873.         if FIXED_COMMAND_POSITION[battler_index] != nil
  1874.            self.x = FIXED_COMMAND_POSITION[battler_index][0]
  1875.            self.y = FIXED_COMMAND_POSITION[battler_index][1]              
  1876.         else  
  1877.            self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
  1878.            self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1879.            self.x = 0 if self.x < 0
  1880.            self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
  1881.         end   
  1882.      end      
  1883.      refresh_layout
  1884. end  
  1885.  
  1886. #--------------------------------------------------------------------------
  1887. # * Refresh
  1888. #--------------------------------------------------------------------------   
  1889. alias mog_battle_hud_ex_refresh refresh
  1890. def refresh
  1891.      mog_battle_hud_ex_refresh
  1892.      $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1893. end
  1894.  
  1895. #--------------------------------------------------------------------------
  1896. # * Update
  1897. #--------------------------------------------------------------------------  
  1898. alias mog_monogatari_actor_commnand_update update
  1899. def update     
  1900.      mog_monogatari_actor_commnand_update
  1901.      if $imported[:mog_battle_command_ex] == nil
  1902.      self.visible = self.active
  1903.      if !@layout.nil?
  1904.         refresh_layout if @layout.visible != self.visible
  1905.         @layout.visible = false if !$game_temp.sprite_visible
  1906.      end        
  1907.      self.visible = false if !$game_temp.sprite_visible     
  1908.      end
  1909. end
  1910.  
  1911. end
  1912.  
  1913. #==============================================================================
  1914. # ** Window_PartyCommand
  1915. #==============================================================================
  1916. class Window_PartyCommand < Window_Command
  1917.  
  1918.   include MOG_BATTLE_HUD_EX
  1919.  
  1920. #--------------------------------------------------------------------------
  1921. # * Initialize
  1922. #--------------------------------------------------------------------------   
  1923.   alias mog_monogatari_party_initialize initialize
  1924.   def initialize
  1925.       mog_monogatari_party_initialize
  1926.     #  self.x = @org_position[0] ; self.y = @org_position[1]
  1927.     #  self.opacity = PARTY_COMMAND_OPACITY   
  1928.       create_layout
  1929.   end
  1930.  
  1931. #--------------------------------------------------------------------------
  1932. # * Dispose
  1933. #--------------------------------------------------------------------------
  1934. alias mog_monogatari_party_window_dispose dispose
  1935. def dispose
  1936.      mog_monogatari_party_window_dispose
  1937.      dispose_layout
  1938. end
  1939.  
  1940. #--------------------------------------------------------------------------
  1941. # * Create Layout
  1942. #--------------------------------------------------------------------------   
  1943. def create_layout
  1944.      return if @layout != nil
  1945.      return if !PARTY_COMMAND_LAYOUT
  1946.      return if $game_temp.mbhud_window[1]
  1947.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1948.      $game_temp.mbhud_window[1] = true
  1949.      @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1950.      @layout = Sprite.new
  1951.      @layout.bitmap = Cache.battle_hud("Layout_Party")
  1952.      @layout.z = self.z - 1
  1953.      refresh_layout
  1954.      @layout.visible = false
  1955. end
  1956.  
  1957. #--------------------------------------------------------------------------
  1958. # * Dispose Layout
  1959. #--------------------------------------------------------------------------
  1960. def dispose_layout
  1961.      return if @layout == nil
  1962.      @layout.dispose
  1963.      @layout = nil
  1964. end
  1965.  
  1966. #--------------------------------------------------------------------------
  1967. # * Refresh Layout
  1968. #--------------------------------------------------------------------------
  1969. def refresh_layout
  1970.      return if @layout == nil
  1971.      @layout.x = @org_position_2[0]
  1972.      @layout.y = @org_position_2[1]
  1973.      @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  1974.      @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  1975.      @layout.visible = self.visible
  1976. end         
  1977.  
  1978. #--------------------------------------------------------------------------
  1979. # * Select
  1980. #--------------------------------------------------------------------------  
  1981. alias mog_monogatari_refresh_partycommand refresh
  1982. def refresh
  1983.      if @org_position == nil
  1984.       @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  1985.                        PARTY_COMMAND_POSITION[1] - (self.height / 2)]  
  1986.      end                  
  1987.      mog_monogatari_refresh_partycommand
  1988.  
  1989.       self.viewport = nil      
  1990.       self.x = @org_position[0] ; self.y = @org_position[1]
  1991.       if PARTY_COMMAND_SLIDE_EFFECT
  1992.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  1993.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  1994.  
  1995.       end
  1996.       self.opacity = PARTY_COMMAND_OPACITY     
  1997. end   
  1998.  
  1999. def show
  2000.  
  2001. end
  2002.  
  2003. #--------------------------------------------------------------------------
  2004. # * Show
  2005. #--------------------------------------------------------------------------   
  2006.   alias mog_bg_ex_slide_show_party show
  2007.   def show
  2008.       self.viewport = nil
  2009.       self.x = @org_position[0] ; self.y = @org_position[1]
  2010.       if PARTY_COMMAND_SLIDE_EFFECT
  2011.          self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2012.          self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2013.  
  2014.       end
  2015.       self.opacity = PARTY_COMMAND_OPACITY
  2016.       mog_bg_ex_slide_show_party
  2017.   end
  2018.  
  2019. #--------------------------------------------------------------------------
  2020. # * Update
  2021. #--------------------------------------------------------------------------  
  2022. alias mog_monogatari_party_window_update update
  2023. def update
  2024.      mog_monogatari_party_window_update  
  2025.      self.visible = self.active
  2026.      if @layout != nil and @layout.visible != self.visible        
  2027.         refresh_layout
  2028.      end
  2029.      execute_slide_effect if self.visible
  2030. end   
  2031.  
  2032. end
  2033.  
  2034. #==============================================================================
  2035. # ** Window_Help
  2036. #==============================================================================
  2037. class Window_Help < Window_Base
  2038.  
  2039.   include MOG_BATTLE_HUD_EX
  2040.  
  2041.   #--------------------------------------------------------------------------
  2042.   # * Object Initialization
  2043.   #--------------------------------------------------------------------------
  2044.   alias mog_monogatari_battle_help_initialize initialize
  2045.   def initialize(line_number = 2)
  2046.       @battle_phase = false
  2047.       mog_monogatari_battle_help_initialize(line_number)
  2048.       @wait_time = 5
  2049.       if SceneManager.scene_is?(Scene_Battle)
  2050.          @battle_phase = true         
  2051.          self.width = HELP_WINDOW_SIZE[0]
  2052.          self.height = HELP_WINDOW_SIZE[1]      
  2053.          @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2054.                           HELP_WINDOW_POSITION[1]]         
  2055.          self.x = @org_position[0]
  2056.          self.y = @org_position[1]  
  2057.          self.opacity = HELP_WINDOW_OPACITY
  2058.          self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2059.          create_layout
  2060.       end     
  2061. end
  2062.  
  2063. #--------------------------------------------------------------------------
  2064. # * Dispose
  2065. #--------------------------------------------------------------------------
  2066. alias mog_monogatari_help_window_dispose dispose
  2067. def dispose
  2068.      mog_monogatari_help_window_dispose
  2069.      dispose_layout
  2070. end
  2071.  
  2072. #--------------------------------------------------------------------------
  2073. # * Create Layout
  2074. #--------------------------------------------------------------------------   
  2075. def create_layout
  2076.      return if @layout != nil
  2077.      return if !HELP_WINDOW_LAYOUT
  2078.      return if $game_temp.mbhud_window[2]
  2079.      return if !SceneManager.scene_is?(Scene_Battle)
  2080.      $game_temp.mbhud_window[2] = true
  2081.      @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2082.      @layout = Sprite.new
  2083.      @layout.bitmap = Cache.battle_hud("Layout_Help")
  2084.      @layout.z = self.z - 1
  2085.      refresh_layout
  2086.      @layout.visible = false
  2087. end
  2088.  
  2089. #--------------------------------------------------------------------------
  2090. # * Dispose Layout
  2091. #--------------------------------------------------------------------------
  2092. def dispose_layout
  2093.      return if @layout == nil
  2094.      @layout.dispose
  2095.      @layout = nil
  2096. end
  2097.  
  2098. #--------------------------------------------------------------------------
  2099. # * Refresh Layout
  2100. #--------------------------------------------------------------------------
  2101. def refresh_layout
  2102.      return if @layout == nil
  2103.      @layout.x = @org_position_2[0]
  2104.      @layout.y = @org_position_2[1]
  2105.      @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2106.      @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2107.      @layout.visible = self.visible  
  2108. end   
  2109.  
  2110. #--------------------------------------------------------------------------
  2111. # * Show
  2112. #--------------------------------------------------------------------------   
  2113.   alias mog_bg_ex_slide_show_help show
  2114.   def show
  2115.       if @battle_phase
  2116.       self.viewport = nil
  2117.       self.x = @org_position[0] ; self.y = @org_position[1]
  2118.       if HELP_WINDOW_SLIDE_EFFECT
  2119.          self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2120.          self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2121.       end
  2122.       self.opacity = HELP_WINDOW_OPACITY
  2123.       end
  2124.       mog_bg_ex_slide_show_help
  2125.   end  
  2126.  
  2127. #--------------------------------------------------------------------------
  2128. # * Update
  2129. #--------------------------------------------------------------------------  
  2130. alias mog_monogatari_help_window_update update
  2131. def update
  2132.      if @wait_time > 0
  2133.         @wait_time -= 1
  2134.         return
  2135.      end   
  2136.      mog_monogatari_help_window_update
  2137.      if SceneManager.scene_is?(Scene_Battle)
  2138.         if @layout != nil           
  2139.            refresh_layout if @layout.visible != self.visible
  2140.            @layout.visible = self.visible
  2141.         end
  2142.         self.visible = false if !$game_temp.sprite_visible
  2143.         execute_slide_effect if self.visible        
  2144.      end
  2145. end   
  2146.  
  2147. end
  2148.  
  2149. #==============================================================================
  2150. # ** Window_BattleActor
  2151. #==============================================================================
  2152. class Window_BattleActor < Window_BattleStatus
  2153.  
  2154.   include MOG_BATTLE_HUD_EX
  2155.  
  2156.   #--------------------------------------------------------------------------
  2157.   # * Initialize
  2158.   #--------------------------------------------------------------------------   
  2159.   alias mog_monogatari_battle_actor_initialize initialize
  2160.   def initialize(info_viewport)
  2161.       @force_hide = can_force_hide?
  2162.       mog_monogatari_battle_actor_initialize(info_viewport)
  2163.       self.width = ACTOR_WINDOW_SIZE[0]
  2164.       self.height = ACTOR_WINDOW_SIZE[1]
  2165.       @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2166.                        ACTOR_WINDOW_POSITION[1] - self.height]
  2167.       @org_position[1] = Graphics.height + 64 if @force_hide
  2168.       self.x = @org_position[0]
  2169.       self.y = @org_position[1]
  2170.       self.opacity = ACTOR_WINDOW_OPACITY
  2171.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2172.       self.viewport = nil
  2173.       create_layout
  2174.   end
  2175.  
  2176.   #--------------------------------------------------------------------------
  2177.   # * Can Force Hide?
  2178.   #--------------------------------------------------------------------------   
  2179.   def can_force_hide?
  2180.       return true if $imported[:ve_target_arrow]
  2181.       return true if $imported[:mog_battle_cursor]
  2182.       return false
  2183.   end
  2184.  
  2185. #--------------------------------------------------------------------------
  2186. # * Dispose
  2187. #--------------------------------------------------------------------------
  2188. alias mog_monogatari_actor_window_dispose dispose
  2189. def dispose
  2190.      mog_monogatari_actor_window_dispose
  2191.      dispose_layout
  2192. end
  2193.  
  2194. #--------------------------------------------------------------------------
  2195. # * Create Layout
  2196. #--------------------------------------------------------------------------   
  2197. def create_layout
  2198.      return if @layout != nil
  2199.      return if !ACTOR_WINDOW_LAYOUT
  2200.      return if $game_temp.mbhud_window[3]
  2201.      $game_temp.mbhud_window[3] = true
  2202.      @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2203.      @layout = Sprite.new
  2204.      @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2205.      @layout.z = self.z - 1
  2206.      refresh_layout
  2207.      @layout.visible = false
  2208. end
  2209.  
  2210. #--------------------------------------------------------------------------
  2211. # * Dispose Layout
  2212. #--------------------------------------------------------------------------
  2213. def dispose_layout
  2214.      return if @layout == nil
  2215.      @layout.dispose
  2216.      @layout = nil
  2217. end
  2218.  
  2219. #--------------------------------------------------------------------------
  2220. # * Refresh Layout
  2221. #--------------------------------------------------------------------------
  2222. def refresh_layout
  2223.      return if @layout == nil
  2224.      @layout.x = @org_position_2[0]
  2225.      @layout.y = @org_position_2[1]
  2226.      @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2227.      @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2228.      @layout.visible = self.visible
  2229. end     
  2230.  
  2231.   if $imported[:ve_target_arrow]
  2232.   #--------------------------------------------------------------------------
  2233.   # * New method: show_actor
  2234.   #--------------------------------------------------------------------------
  2235.   alias mog_battle_hud_ex_show_actor show_actor
  2236.   def show_actor
  2237.       return true if SceneManager.face_battler?
  2238.       mog_battle_hud_ex_show_actor
  2239.   end
  2240.   end
  2241.  
  2242. #--------------------------------------------------------------------------
  2243. # * Show
  2244. #--------------------------------------------------------------------------   
  2245.   alias mog_bg_ex_slide_show_actor show
  2246.   def show
  2247.       self.viewport = nil
  2248.       self.x = @org_position[0] ; self.y = @org_position[1]
  2249.       if ACTOR_WINDOW_SLIDE_EFFECT
  2250.          self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2251.          self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2252.       end
  2253.       self.opacity = ACTOR_WINDOW_OPACITY
  2254.       mog_bg_ex_slide_show_actor
  2255.   end  
  2256.  
  2257. #--------------------------------------------------------------------------
  2258. # * Update
  2259. #--------------------------------------------------------------------------  
  2260. alias mog_monogatari_actor_window_update update
  2261. def update
  2262.      mog_monogatari_actor_window_update   
  2263.      self.visible = self.active
  2264.      self.visible = false if @force_hide
  2265.      if @layout != nil        
  2266.         refresh_layout if @layout.visible != self.visible        
  2267.      end
  2268.      if !$game_temp.sprite_visible   
  2269.         self.visible = false
  2270.         @layout.visible = self.visible if @layout != nil
  2271.      end   
  2272.      execute_slide_effect if self.visible
  2273.   end  
  2274.  
  2275. end
  2276.  
  2277. #==============================================================================
  2278. # ** Window_BattleEnemy
  2279. #==============================================================================
  2280. class Window_BattleEnemy < Window_Selectable
  2281.  
  2282.   include MOG_BATTLE_HUD_EX
  2283.  
  2284.   #--------------------------------------------------------------------------
  2285.   # * Initialize
  2286.   #--------------------------------------------------------------------------   
  2287.   alias mog_monogatari_battle_enemy_initialize initialize
  2288.   def initialize(info_viewport)
  2289.       @force_hide = can_force_hide?
  2290.       mog_monogatari_battle_enemy_initialize(info_viewport)
  2291.       self.width = ENEMY_WINDOW_SIZE[0]
  2292.       self.height = ENEMY_WINDOW_SIZE[1]      
  2293.       @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2294.                        ENEMY_WINDOW_POSITION[1] - self.height]
  2295.       @org_position[1] = Graphics.height + 64 if @force_hide               
  2296.       self.x = @org_position[0]
  2297.       self.y = @org_position[1]      
  2298.       self.opacity = ENEMY_WINDOW_OPACITY
  2299.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2300.       create_layout
  2301.   end  
  2302.  
  2303.   #--------------------------------------------------------------------------
  2304.   # * Can Force Hide?
  2305.   #--------------------------------------------------------------------------   
  2306.   def can_force_hide?
  2307.       return true if $imported[:ve_target_arrow]
  2308.       return true if $imported[:mog_battle_cursor]
  2309.       return false
  2310.   end   
  2311.  
  2312. #--------------------------------------------------------------------------
  2313. # * Dispose
  2314. #--------------------------------------------------------------------------
  2315. alias mog_monogatari_enemy_window_dispose dispose
  2316. def dispose
  2317.      mog_monogatari_enemy_window_dispose
  2318.      dispose_layout
  2319. end
  2320.  
  2321. #--------------------------------------------------------------------------
  2322. # * Create Layout
  2323. #--------------------------------------------------------------------------   
  2324. def create_layout
  2325.      return if @layout != nil
  2326.      return if !ENEMY_WINDOW_LAYOUT
  2327.      return if $game_temp.mbhud_window[4]
  2328.      $game_temp.mbhud_window[4] = true     
  2329.      @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2330.      @layout = Sprite.new
  2331.      @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2332.      @layout.z = self.z - 1
  2333.      refresh_layout
  2334.      @layout.visible = false
  2335. end
  2336.  
  2337. #--------------------------------------------------------------------------
  2338. # * Dispose Layout
  2339. #--------------------------------------------------------------------------
  2340. def dispose_layout
  2341.      return if @layout == nil
  2342.      @layout.dispose
  2343.      @layout = nil
  2344. end
  2345.  
  2346. #--------------------------------------------------------------------------
  2347. # * Refresh Layout
  2348. #--------------------------------------------------------------------------
  2349. def refresh_layout
  2350.      return if @layout == nil
  2351.      @layout.x = @org_position_2[0]
  2352.      @layout.y = @org_position_2[1]
  2353.      @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2354.      @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2355.      @layout.visible = self.visible
  2356. end      
  2357.  
  2358. #--------------------------------------------------------------------------
  2359. # * Show
  2360. #--------------------------------------------------------------------------   
  2361.   alias mog_bg_ex_slide_show_enemy show
  2362.   def show
  2363.       self.viewport = nil
  2364.       self.x = @org_position[0] ; self.y = @org_position[1]
  2365.       if ENEMY_WINDOW_SLIDE_EFFECT
  2366.          self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2367.          self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2368.       end
  2369.       self.opacity = ENEMY_WINDOW_OPACITY
  2370.       mog_bg_ex_slide_show_enemy
  2371.   end  
  2372.  
  2373. #--------------------------------------------------------------------------
  2374. # * Update
  2375. #--------------------------------------------------------------------------  
  2376. alias mog_monogatari_enemy_window_update update
  2377. def update
  2378.      mog_monogatari_enemy_window_update
  2379.      self.visible = false if @force_hide
  2380.      if @layout != nil and @layout.visible != self.visible        
  2381.         refresh_layout
  2382.      end
  2383.      if !$game_temp.sprite_visible   
  2384.         self.visible = false
  2385.         @layout.visible = self.visible if @layout != nil
  2386.      end   
  2387.      execute_slide_effect if self.visible
  2388.   end   
  2389.  
  2390.   if $imported["YEA-BattleEngine"]
  2391.   #--------------------------------------------------------------------------
  2392.   # * Draw Item
  2393.   #--------------------------------------------------------------------------
  2394.   def draw_item(index)
  2395.       change_color(normal_color)
  2396.       name = $game_troop.alive_members[index].name
  2397.       draw_text(item_rect_for_text(index), name)
  2398.   end
  2399.   end
  2400.  
  2401.   #--------------------------------------------------------------------------
  2402.   # * Process Cursor Move
  2403.   #--------------------------------------------------------------------------
  2404.   alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2405.   def process_cursor_move
  2406.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2407.       mog_atb_wenemy_process_cursor_move
  2408.   end
  2409.  
  2410.   #--------------------------------------------------------------------------
  2411.   # * Process Handling
  2412.   #--------------------------------------------------------------------------
  2413.   alias mog_atb_wenemy_process_handling process_handling
  2414.   def process_handling  
  2415.       return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2416.       mog_atb_wenemy_process_handling
  2417.   end  
  2418.  
  2419. end
  2420.  
  2421. #==============================================================================
  2422. # ** Window_BattleSkill
  2423. #==============================================================================
  2424. class Window_BattleSkill < Window_SkillList
  2425. include MOG_BATTLE_HUD_EX
  2426.  
  2427. #--------------------------------------------------------------------------
  2428. # * Initialize
  2429. #--------------------------------------------------------------------------   
  2430. alias mog_monogatari_battle_skill_initialize initialize
  2431. def initialize(help_window, info_viewport)
  2432.      @force_hide = can_force_hide?
  2433.      @force_hide_active = can_force_hide_active?     
  2434.      mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2435.      self.width = SKILL_WINDOW_SIZE[0]
  2436.      self.height = SKILL_WINDOW_SIZE[1]   
  2437.      @org_position = [SKILL_WINDOW_POSITION[0],
  2438.           Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2439.      self.x = @org_position[0]
  2440.      self.y = @org_position[1]
  2441.      self.opacity = SKILL_WINDOW_OPACITY
  2442.      self.viewport = nil
  2443.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2444.      create_layout
  2445. end
  2446.  
  2447. #--------------------------------------------------------------------------
  2448. # * Col Max
  2449. #--------------------------------------------------------------------------   
  2450.   def col_max
  2451.       return SKILL_COL_MAX
  2452.   end
  2453.  
  2454. #--------------------------------------------------------------------------
  2455. # * Can Force Hide Active?
  2456. #--------------------------------------------------------------------------   
  2457. def can_force_hide_active?
  2458.      return true if $imported[:ve_target_arrow]
  2459.      return true if $imported[:mog_battle_cursor] != nil
  2460.      return false
  2461. end   
  2462.  
  2463.   #--------------------------------------------------------------------------
  2464.   # * Can Force Hide?
  2465.   #--------------------------------------------------------------------------   
  2466.   def can_force_hide?
  2467.       return false
  2468.   end
  2469.  
  2470. #--------------------------------------------------------------------------
  2471. # * Dispose
  2472. #--------------------------------------------------------------------------
  2473. alias mog_monogatari_skill_window_dispose dispose
  2474. def dispose
  2475.      mog_monogatari_skill_window_dispose
  2476.      dispose_layout
  2477. end
  2478.  
  2479. #--------------------------------------------------------------------------
  2480. # * Create Layout
  2481. #--------------------------------------------------------------------------   
  2482. def create_layout
  2483.      return if @layout != nil
  2484.      return if !SKILL_WINDOW_LAYOUT
  2485.      return if $game_temp.mbhud_window[5]
  2486.      $game_temp.mbhud_window[5] = true
  2487.      @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2488.      @layout = Sprite.new
  2489.      @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2490.      @layout.z = self.z - 1
  2491.      refresh_layout
  2492.      @layout.visible = false
  2493. end
  2494.  
  2495. #--------------------------------------------------------------------------
  2496. # * Dispose Layout
  2497. #--------------------------------------------------------------------------
  2498. def dispose_layout
  2499.      return if @layout == nil
  2500.      @layout.dispose
  2501.      @layout = nil
  2502. end
  2503.  
  2504. #--------------------------------------------------------------------------
  2505. # * Refresh Layout
  2506. #--------------------------------------------------------------------------
  2507. def refresh_layout
  2508.      return if @layout == nil
  2509.      @layout.x = @org_position_2[0]
  2510.      @layout.y = @org_position_2[1]
  2511.      @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2512.      @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2513.      @layout.visible = self.visible
  2514. end  
  2515.  
  2516. #--------------------------------------------------------------------------
  2517. # * Show
  2518. #--------------------------------------------------------------------------   
  2519.   alias mog_bg_ex_slide_show_skill show
  2520.   def show
  2521.       self.viewport = nil
  2522.       self.x = @org_position[0] ; self.y = @org_position[1]
  2523.       if SKILL_WINDOW_SLIDE_EFFECT
  2524.          self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2525.          self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2526.       end
  2527.       self.opacity = SKILL_WINDOW_OPACITY
  2528.       mog_bg_ex_slide_show_skill
  2529.   end
  2530.  
  2531. #--------------------------------------------------------------------------
  2532. # * Update
  2533. #--------------------------------------------------------------------------  
  2534. alias mog_monogatari_skill_window_update update
  2535. def update
  2536.      mog_monogatari_skill_window_update
  2537.      self.visible = self.active if @force_hide_active
  2538.      self.visible = false if @force_hide
  2539.      if @layout != nil and @layout.visible != self.visible        
  2540.         refresh_layout
  2541.     end
  2542.     self.visible = false if !$game_temp.sprite_visible
  2543.     execute_slide_effect if self.visible
  2544. end
  2545.  
  2546. end
  2547.  
  2548. #==============================================================================
  2549. # ** Window_BattleItem
  2550. #==============================================================================
  2551. class Window_BattleItem < Window_ItemList
  2552.   include MOG_BATTLE_HUD_EX
  2553.  
  2554. #--------------------------------------------------------------------------
  2555. # * Initialize
  2556. #--------------------------------------------------------------------------  
  2557. alias mog_monogatari_battle_item_initialize initialize
  2558. def initialize(help_window, info_viewport)
  2559.      @force_hide = can_force_hide?
  2560.      @force_hide_active = can_force_hide_active?
  2561.      mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2562.      self.width = ITEM_WINDOW_SIZE[0]
  2563.      self.height = ITEM_WINDOW_SIZE[1]
  2564.      @org_position = [ITEM_WINDOW_POSITION[0],
  2565.           Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2566.      self.x = @org_position[0]
  2567.      self.y = @org_position[1]
  2568.      self.viewport = nil
  2569.      self.opacity = ITEM_WINDOW_OPACITY
  2570.      self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2571.      create_layout
  2572. end  
  2573.  
  2574. #--------------------------------------------------------------------------
  2575. # * Col Max
  2576. #--------------------------------------------------------------------------   
  2577.   def col_max
  2578.       return ITEM_COL_MAX
  2579.   end  
  2580.  
  2581. #--------------------------------------------------------------------------
  2582. # * Can Force Hide Active?
  2583. #--------------------------------------------------------------------------   
  2584. def can_force_hide_active?
  2585.      return true if $imported[:ve_target_arrow]
  2586.      return true if $imported[:mog_battle_cursor] != nil
  2587.      return false
  2588. end  
  2589.  
  2590. #--------------------------------------------------------------------------
  2591. # * Can Force Hide?
  2592. #--------------------------------------------------------------------------   
  2593. def can_force_hide?
  2594.      return false
  2595. end
  2596.  
  2597. #--------------------------------------------------------------------------
  2598. # * Dispose
  2599. #--------------------------------------------------------------------------
  2600. alias mog_monogatari_item_window_dispose dispose
  2601. def dispose
  2602.      mog_monogatari_item_window_dispose
  2603.      dispose_layout
  2604. end
  2605.  
  2606. #--------------------------------------------------------------------------
  2607. # * Create Layout
  2608. #--------------------------------------------------------------------------   
  2609. def create_layout
  2610.      return if @layout != nil
  2611.      return if !ITEM_WINDOW_LAYOUT
  2612.      return if $game_temp.mbhud_window[6]
  2613.      $game_temp.mbhud_window[6] = true
  2614.      @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2615.      @layout = Sprite.new
  2616.      @layout.bitmap = Cache.battle_hud("Layout_Item")
  2617.      @layout.z = self.z - 1
  2618.      refresh_layout
  2619.      @layout.visible = false
  2620. end
  2621.  
  2622. #--------------------------------------------------------------------------
  2623. # * Dispose Layout
  2624. #--------------------------------------------------------------------------
  2625. def dispose_layout
  2626.      return if @layout == nil
  2627.      @layout.dispose
  2628.      @layout = nil
  2629. end
  2630.  
  2631. #--------------------------------------------------------------------------
  2632. # * Refresh Layout
  2633. #--------------------------------------------------------------------------
  2634. def refresh_layout
  2635.      return if @layout == nil
  2636.      @layout.x = @org_position_2[0]
  2637.      @layout.y = @org_position_2[1]
  2638.      @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2639.      @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2640.      @layout.visible = self.visible
  2641. end  
  2642.  
  2643. #--------------------------------------------------------------------------
  2644. # * Show
  2645. #--------------------------------------------------------------------------   
  2646.   alias mog_bg_ex_slide_show_item show
  2647.   def show
  2648.       self.viewport = nil
  2649.       self.x = @org_position[0] ; self.y = @org_position[1]
  2650.       if ITEM_WINDOW_SLIDE_EFFECT
  2651.          self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2652.          self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2653.       end
  2654.       self.opacity = ITEM_WINDOW_OPACITY
  2655.       mog_bg_ex_slide_show_item      
  2656.   end
  2657.  
  2658. #--------------------------------------------------------------------------
  2659. # * Update
  2660. #--------------------------------------------------------------------------  
  2661. alias mog_monogatari_item_window_update update
  2662. def update
  2663.      mog_monogatari_item_window_update
  2664.      self.visible = self.active if @force_hide_active
  2665.      self.visible = false if @force_hide
  2666.      if @layout != nil
  2667.         refresh_layout if @layout.visible != self.visible
  2668.      end
  2669.      self.visible = false if !$game_temp.sprite_visible
  2670.      execute_slide_effect if self.visible
  2671.   end  
  2672.  
  2673. end
  2674.  
  2675. end
  2676.  
  2677. #--------------------------------------------------------------------------
  2678. #--------------------------------------------------------------------------
  2679. #################################
  2680. if $imported["YEA-BattleEngine"]
  2681. #################################
  2682.  
  2683. #==============================================================================
  2684. # ** Window_BattleStatusAid
  2685. #==============================================================================
  2686. class Window_BattleStatusAid < Window_BattleStatus
  2687.  
  2688. #--------------------------------------------------------------------------
  2689. # * Refresh
  2690. #--------------------------------------------------------------------------   
  2691.   def refresh
  2692.       contents.clear
  2693.       self.visible = false
  2694.   end
  2695.  
  2696. end
  2697.  
  2698. #==============================================================================
  2699. # ** Window_BattleStatus
  2700. #==============================================================================
  2701. class Window_BattleStatus < Window_Selectable
  2702.  
  2703. #--------------------------------------------------------------------------
  2704. # * Update
  2705. #--------------------------------------------------------------------------
  2706. alias mog_monogatari_bhud_yf_update update
  2707. def update
  2708.      mog_monogatari_bhud_yf_update
  2709.      update_visible_yf
  2710. end
  2711.  
  2712. #--------------------------------------------------------------------------
  2713. # * Update Visible Yf
  2714. #--------------------------------------------------------------------------
  2715. def update_visible_yf
  2716.      self.visible = self.active
  2717.      self.visible = false if !$game_temp.sprite_visible
  2718. end
  2719.  
  2720. end  
  2721.  
  2722. #==============================================================================
  2723. # ■ Window ActorCommand
  2724. #==============================================================================
  2725. class Window_ActorCommand < Window_Command
  2726.  
  2727. #--------------------------------------------------------------------------
  2728. # * Show
  2729. #--------------------------------------------------------------------------
  2730.   alias mog_bhud_yf_command_show show
  2731.   def show
  2732.       return if !BattleManager.can_enable_window?
  2733.       mog_bhud_yf_command_show
  2734.   end
  2735.  
  2736. #--------------------------------------------------------------------------
  2737. # * Update
  2738. #--------------------------------------------------------------------------
  2739. alias mog_monogatari_bhud_yf_actorcommand_update update
  2740. def update
  2741.      mog_monogatari_bhud_yf_actorcommand_update
  2742.      update_visible_yf
  2743. end
  2744.  
  2745. #--------------------------------------------------------------------------
  2746. # * Update Visible Yf
  2747. #--------------------------------------------------------------------------
  2748. def update_visible_yf
  2749.      self.visible = self.active
  2750.      self.visible = false if !$game_temp.sprite_visible
  2751. end
  2752.  
  2753. end
  2754.  
  2755. #==============================================================================
  2756. # ** Scene Battle
  2757. #==============================================================================
  2758. class Scene_Battle < Scene_Base
  2759.  
  2760.   include MOG_BATTLE_HUD_EX
  2761.  
  2762.   #--------------------------------------------------------------------------
  2763.   # alias method: create_skill_window
  2764.   #--------------------------------------------------------------------------
  2765.   alias mog_yf_scene_battle_create_skill_window create_skill_window
  2766.   def create_skill_window
  2767.       mog_yf_scene_battle_create_skill_window
  2768.       @skill_window.width = SKILL_WINDOW_SIZE[0]
  2769.       @skill_window.height = SKILL_WINDOW_SIZE[1]
  2770.       @skill_window.x = SKILL_WINDOW_POSITION[0]
  2771.       @skill_window.y = SKILL_WINDOW_POSITION[1]
  2772.   end
  2773.  
  2774.   #--------------------------------------------------------------------------
  2775.   # alias method: create_item_window
  2776.   #--------------------------------------------------------------------------
  2777.   alias mog_yf_scene_battle_create_item_window create_item_window
  2778.   def create_item_window
  2779.       mog_yf_scene_battle_create_item_window
  2780.       @item_window.width = ITEM_WINDOW_SIZE[0]
  2781.       @item_window.height = ITEM_WINDOW_SIZE[1]
  2782.       @item_window.x = ITEM_WINDOW_POSITION[0]
  2783.       @item_window.y = ITEM_WINDOW_POSITION[1]
  2784.   end  
  2785.  
  2786. if !$imported[:mog_atb_system]
  2787. #--------------------------------------------------------------------------
  2788. # * Next Command
  2789. #--------------------------------------------------------------------------
  2790.   def next_command
  2791.     if BattleManager.next_command
  2792.        @status_window.show
  2793.        redraw_current_status
  2794.        @actor_command_window.show
  2795.        @status_aid_window.hide      
  2796.        start_actor_command_selection
  2797.     else
  2798.       turn_start
  2799.     end
  2800.   end
  2801.   end
  2802.  
  2803. #--------------------------------------------------------------------------
  2804. # * STW Can Visible
  2805. #--------------------------------------------------------------------------   
  2806.   def stw_can_visible?
  2807.       return false if !BattleManager.can_enable_window?
  2808.       return false if @item_window.visible
  2809.       return false if @skill_window.visible
  2810.       return true if @actor_window.active
  2811.       return false
  2812.   end
  2813.  
  2814. if $imported["YEA-CommandEquip"]
  2815. #--------------------------------------------------------------------------
  2816. # * Command Equip
  2817. #--------------------------------------------------------------------------   
  2818.   alias mog_yf_command_equip command_equip
  2819.   def command_equip
  2820.       @actor_command_window.visible = false
  2821.       @actor_command_window.update
  2822.       $game_temp.battle_hud_visible_refresh = [true,false]
  2823.       @spriteset.update_battle_hud_ex
  2824.       @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2825.       mog_yf_command_equip
  2826.       $game_temp.battle_hud_visible_refresh = [true,true]
  2827.   end
  2828.   end
  2829.  
  2830. end
  2831.  
  2832. end
  2833. #--------------------------------------------------------------------------
  2834.  
  2835.  
  2836. ######################################
  2837. if $imported["YEA-EnemyTargetInfo"]
  2838. ######################################
  2839.  
  2840. #==============================================================================
  2841. # ■ Window_Comparison
  2842. #==============================================================================
  2843. class Window_Comparison < Window_Base
  2844.  
  2845.   #--------------------------------------------------------------------------
  2846.   # * Refresh
  2847.   #--------------------------------------------------------------------------     
  2848.   alias mog_battle_hud_ex_yf_refresh refresh
  2849.   def refresh
  2850.       mog_battle_hud_ex_yf_refresh
  2851.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2852.       self.viewport = nil
  2853.   end
  2854.  
  2855. end
  2856.  
  2857. #==============================================================================
  2858. # ■ Window_ComparisonHelp
  2859. #==============================================================================
  2860. class Window_ComparisonHelp < Window_Base
  2861.  
  2862.   #--------------------------------------------------------------------------
  2863.   # * Refresh
  2864.   #--------------------------------------------------------------------------     
  2865.   alias mog_battle_hud_ex_yf_refresh refresh
  2866.   def refresh
  2867.       mog_battle_hud_ex_yf_refresh
  2868.       self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2869.       self.viewport = nil
  2870.   end
  2871.  
  2872. end
  2873. end
  2874. #--------------------------------------------------------------------------
  2875. #--------------------------------------------------------------------------
  2876.  
  2877.  
  2878. #################################
  2879. if $imported["YEA-EnemyTargetInfo"]
  2880. #################################
  2881. class Window_Comparison < Window_Base
  2882.  
  2883.   #--------------------------------------------------------------------------
  2884.   # initialize
  2885.   #--------------------------------------------------------------------------
  2886.   alias mog_battle_hud_yf_wcomparison_initialize initialize
  2887.   def initialize(type)
  2888.       mog_battle_hud_yf_wcomparison_initialize(type)
  2889.       self.z = 102
  2890.   end  
  2891.  
  2892. end
  2893. end
  2894. #--------------------------------------------------------------------------
  2895. #--------------------------------------------------------------------------
  2896.  
  2897. #--------------------------------------------------------------------------
  2898. #--------------------------------------------------------------------------
  2899. #################################
  2900. if $imported["YSA-CATB"]
  2901. #################################
  2902.  
  2903. #==============================================================================
  2904. # ■ Enemy CATB Gauge Viewport
  2905. #==============================================================================
  2906. class Enemy_CATB_Gauge_Viewport < Viewport
  2907.  
  2908.   #--------------------------------------------------------------------------
  2909.   # initialize
  2910.   #--------------------------------------------------------------------------
  2911.   alias mog_battle_hud_ex_yami_initialize initialize
  2912.   def initialize(battler, sprite, type)
  2913.       mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2914.       self.z = 90
  2915.   end
  2916.  
  2917. end
  2918.  
  2919. #==============================================================================
  2920. # ■ Game_Battler
  2921. #==============================================================================
  2922. class Game_Battler < Game_BattlerBase
  2923.  
  2924.   attr_accessor :catb_value  
  2925.   attr_accessor :max_atb
  2926.  
  2927.   #--------------------------------------------------------------------------
  2928.   # * Max ATB
  2929.   #--------------------------------------------------------------------------   
  2930.   def max_atb
  2931.       return MAX_CATB_VALUE
  2932.       return 1
  2933.   end
  2934.  
  2935. end
  2936.  
  2937. end
  2938. #--------------------------------------------------------------------------
  2939. #--------------------------------------------------------------------------
  2940.  
  2941. #==============================================================================
  2942. # ** Window Base
  2943. #==============================================================================
  2944. class Window_Base < Window
  2945.  
  2946. #--------------------------------------------------------------------------
  2947. # * Execute Move W
  2948. #--------------------------------------------------------------------------      
  2949. def execute_move_w(sprite,type,cp,np)
  2950.      sp = 6 + ((cp - np).abs / 10)
  2951.      if cp > np ;    cp -= sp ; cp = np if cp < np
  2952.         elsif cp < np ; cp += sp ; cp = np if cp > np
  2953.      end     
  2954.      sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2955. end
  2956.  
  2957. #--------------------------------------------------------------------------
  2958. # * Set BH EX Font
  2959. #--------------------------------------------------------------------------   
  2960.   def set_bh_ex_font
  2961.       return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2962.       self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2963.       self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2964.       self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2965.       self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2966.   end
  2967.  
  2968. #--------------------------------------------------------------------------
  2969. # * Execute Slide Effect
  2970. #--------------------------------------------------------------------------   
  2971. def execute_slide_effect
  2972.      return if @org_position == nil
  2973.      execute_move_w(self,0,self.x,@org_position[0])
  2974.      execute_move_w(self,1,self.y,@org_position[1])
  2975.      return if @layout == nil
  2976.      execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  2977.      execute_move_w(@layout,1,@layout.y,@org_position_2[1])     
  2978. end     
  2979.  
  2980. end
  2981.  
  2982. #==============================================================================
  2983. # ** Window Help
  2984. #==============================================================================
  2985. class Window_Help < Window_Base
  2986.  
  2987. #--------------------------------------------------------------------------
  2988. # * Draw Text
  2989. #--------------------------------------------------------------------------   
  2990.   alias mog_bh_ex_draw_text_help draw_text
  2991.   def draw_text(*args)
  2992.       set_bh_ex_font
  2993.       mog_bh_ex_draw_text_help(*args)
  2994.   end
  2995.  
  2996. end
  2997.  
  2998. #==============================================================================
  2999. # ** Window BattleActor
  3000. #==============================================================================
  3001. class Window_BattleActor < Window_BattleStatus
  3002.  
  3003. #--------------------------------------------------------------------------
  3004. # * Draw Item
  3005. #--------------------------------------------------------------------------   
  3006.   alias mog_bbex_draw_item_actor draw_item
  3007.   def draw_item(index)
  3008.       set_bh_ex_font
  3009.       mog_bbex_draw_item_actor(index)
  3010.   end
  3011.  
  3012. end
  3013.  
  3014. #==============================================================================
  3015. # ** Window BattleEnemy
  3016. #==============================================================================
  3017. class Window_BattleEnemy < Window_Selectable
  3018.  
  3019. #--------------------------------------------------------------------------
  3020. # * Draw Item
  3021. #--------------------------------------------------------------------------   
  3022.   alias mog_bbex_draw_item_enemy draw_item
  3023.   def draw_item(index)
  3024.       set_bh_ex_font
  3025.       mog_bbex_draw_item_enemy(index)
  3026.   end
  3027.  
  3028. end
  3029.  
  3030. #==============================================================================
  3031. # ** Window ItemList
  3032. #==============================================================================
  3033. class Window_ItemList < Window_Selectable
  3034.  
  3035. #--------------------------------------------------------------------------
  3036. # * Draw Item Name
  3037. #--------------------------------------------------------------------------   
  3038.    alias mog_bhex_draw_item_name_item draw_item_name
  3039.    def draw_item_name(item, x, y, enabled = true, width = 172)
  3040.        set_bh_ex_font
  3041.        mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  3042.    end  
  3043.  
  3044. end
  3045.  
  3046. #==============================================================================
  3047. # ** Window SkillList
  3048. #==============================================================================
  3049. class Window_SkillList < Window_Selectable  
  3050.  
  3051. #--------------------------------------------------------------------------
  3052. # * Draw Item Name
  3053. #--------------------------------------------------------------------------   
  3054.    alias mog_bhex_draw_item_name_skill draw_item_name
  3055.    def draw_item_name(item, x, y, enabled = true, width = 172)
  3056.        set_bh_ex_font
  3057.        mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  3058.    end   
  3059.  
  3060. end
  3061.  
  3062. #==============================================================================
  3063. # ** Spriteset_Battle
  3064. #==============================================================================
  3065. class Spriteset_Battle
  3066.  
  3067.   #--------------------------------------------------------------------------
  3068.   # * Initialize
  3069.   #--------------------------------------------------------------------------
  3070.   alias mog_battle_hud_ex_initialize initialize
  3071.   def initialize
  3072.       check_screen_xyz_nil rescue nil
  3073.       mog_battle_hud_ex_initialize
  3074.       create_battle_hud_ex
  3075.   end
  3076.  
  3077.   #--------------------------------------------------------------------------
  3078.   # * Check Screen Xyz
  3079.   #--------------------------------------------------------------------------   
  3080.   def check_screen_xyz_nil
  3081.       return if !SceneManager.face_battler?
  3082.       for actor in $game_party.battle_members
  3083.           actor.screen_x = 0 if actor.screen_x == nil
  3084.           actor.screen_y = 0 if actor.screen_y == nil
  3085.           actor.screen_z = 0 if actor.screen_z == nil
  3086.       end
  3087.   end
  3088.  
  3089.   #--------------------------------------------------------------------------
  3090.   # * Check Screen Xyz after
  3091.   #--------------------------------------------------------------------------     
  3092.   def check_screen_xyz_after
  3093.       return if !SceneManager.face_battler?
  3094.       $game_party.battle_members.each_with_index do |actor, index|
  3095.           actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  3096.           actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  3097.           actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  3098.       end   
  3099.   end
  3100.  
  3101.   #--------------------------------------------------------------------------
  3102.   # * Dispose
  3103.   #--------------------------------------------------------------------------  
  3104.   alias mog_battle_hud_ex_dispose dispose
  3105.   def dispose
  3106.       dispose_battle_hud_ex
  3107.       mog_battle_hud_ex_dispose
  3108.   end
  3109.  
  3110.   #--------------------------------------------------------------------------
  3111.   # * Update
  3112.   #--------------------------------------------------------------------------  
  3113.   alias mog_battle_hud_ex_update update
  3114.   def update
  3115.       mog_battle_hud_ex_update
  3116.       update_battle_hud_ex
  3117.   end
  3118.  
  3119.   #--------------------------------------------------------------------------
  3120.   # * Create Battle Hud EX
  3121.   #--------------------------------------------------------------------------   
  3122.   def create_battle_hud_ex
  3123.       return if @battle_hud_ex != nil
  3124.       $game_temp.battle_hud_visible = true
  3125.       @battle_hud_ex = Monogatari_Bhud.new(nil)
  3126.       check_screen_xyz_after
  3127.   end
  3128.  
  3129.   #--------------------------------------------------------------------------
  3130.   # * Dispose Battle Hud EX
  3131.   #--------------------------------------------------------------------------   
  3132.   def dispose_battle_hud_ex
  3133.       return if @battle_hud_ex == nil
  3134.       @battle_hud_ex.dispose
  3135.       @battle_hud_ex = nil
  3136.       $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3137.   end
  3138.  
  3139.   #--------------------------------------------------------------------------
  3140.   # * Update Battle Hud EX
  3141.   #--------------------------------------------------------------------------   
  3142.   def update_battle_hud_ex
  3143.       refresh_battle_hud if $game_temp.mbhud_force_refresh
  3144.       return if @battle_hud_ex == nil
  3145.       @battle_hud_ex.update
  3146.   end
  3147.  
  3148.   #--------------------------------------------------------------------------
  3149.   # * Refresh Battle Hud
  3150.   #--------------------------------------------------------------------------   
  3151.   def refresh_battle_hud
  3152.       $game_temp.mbhud_force_refresh = false
  3153.       check_screen_xyz_nil rescue nil
  3154.       dispose_battle_hud_ex
  3155.       create_battle_hud_ex
  3156.   end
  3157.  
  3158. end
  3159.  
  3160. #==============================================================================
  3161. # ** Monogatari Bhud
  3162. #==============================================================================
  3163. class Monogatari_Bhud
  3164.  
  3165.   include MOG_BATTLE_HUD_EX
  3166.  
  3167.   #--------------------------------------------------------------------------
  3168.   # * Initialize
  3169.   #--------------------------------------------------------------------------  
  3170.   def initialize(viewport)
  3171.       @battle_hud = [] ; @sprite_visitle_wait = 0
  3172.       $game_party.battle_members.each_with_index do |actor, index|
  3173.       @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3174.       create_turn_sprite(nil)
  3175.       create_screen_layout(nil)      
  3176.   end
  3177.  
  3178.   #--------------------------------------------------------------------------
  3179.   # * Max members
  3180.   #--------------------------------------------------------------------------   
  3181.   def max_members
  3182.       if $game_party.members.size > $game_party.max_battle_members
  3183.          return $game_party.max_battle_members
  3184.       end   
  3185.       return $game_party.members.size
  3186.   end
  3187.  
  3188.   #--------------------------------------------------------------------------
  3189.   # * Dispose
  3190.   #--------------------------------------------------------------------------   
  3191.   def dispose
  3192.       @battle_hud.each {|sprite| sprite.dispose }
  3193.       dispose_turn_sprite
  3194.       dispose_screen_layout
  3195.   end
  3196.  
  3197.   #--------------------------------------------------------------------------
  3198.   # * Update
  3199.   #--------------------------------------------------------------------------   
  3200.   def update
  3201.       @battle_hud.each {|sprite| sprite.update }
  3202.       update_turn_sprite
  3203.       update_screen_layout
  3204.       refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3205.   end
  3206.  
  3207.   #--------------------------------------------------------------------------
  3208.   # * Update
  3209.   #--------------------------------------------------------------------------   
  3210.   def refresh_battle_hud_visible
  3211.       $game_temp.battle_hud_visible_refresh[0] = false
  3212.       @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3213.       @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3214.       @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3215.       @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3216. end
  3217.  
  3218. end
  3219.  
  3220. #==============================================================================
  3221. # ** Monogatari Bhud
  3222. #==============================================================================
  3223. class Monogatari_Bhud
  3224.  
  3225. #--------------------------------------------------------------------------
  3226. # * Can Update Turn Sprite
  3227. #--------------------------------------------------------------------------
  3228.   def can_refresh_turn_sprite?
  3229.       return true if @turn_sprite.visible != $game_temp.command_visible
  3230.       return true if $game_temp.refresh_turn_sprite
  3231.       return false
  3232.   end
  3233.  
  3234. #--------------------------------------------------------------------------
  3235. # * Create Turn Sprite
  3236. #--------------------------------------------------------------------------
  3237.   def create_turn_sprite(viewport)
  3238.       return if !TURN_SPRITE_VISIBLE
  3239.       return if @turn_sprite != nil
  3240.       @turn_sprite = Sprite.new
  3241.       @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3242.       @turn_sprite.viewport = viewport
  3243.       @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3244.       @turn_sprite.visible = false
  3245.       @turn_sprite_update_time = 5
  3246.       @turn_sprite_blink = [0,0]
  3247.   end
  3248.  
  3249. #--------------------------------------------------------------------------
  3250. # * Dispose Turn Sprite
  3251. #--------------------------------------------------------------------------
  3252.   def dispose_turn_sprite
  3253.       return if @turn_sprite == nil
  3254.       @turn_sprite.dispose
  3255.       @turn_sprite = nil
  3256.   end
  3257.  
  3258. #--------------------------------------------------------------------------
  3259. # * Update Turn Sprite
  3260. #--------------------------------------------------------------------------
  3261.   def update_turn_sprite
  3262.       return if @turn_sprite == nil
  3263.       if @turn_sprite_update_time > 0
  3264.          @turn_sprite_update_time -= 1
  3265.          return
  3266.       end  
  3267.       update_turn_visible
  3268.       update_turn_blink
  3269.   end
  3270.  
  3271. #--------------------------------------------------------------------------
  3272. # * Update Turn Visible
  3273. #--------------------------------------------------------------------------   
  3274.   def update_turn_visible   
  3275.       $game_temp.refresh_turn_sprite = false
  3276.       @turn_sprite.visible = can_turn_sprite_visible?
  3277.       return if BattleManager.actor == nil
  3278.       x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3279.       y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3280.       x = -1000 if x == nil ; y = -1000 if y == nil
  3281.       @turn_sprite.x = x ; @turn_sprite.y = y      
  3282. end
  3283.  
  3284. #--------------------------------------------------------------------------
  3285. # * Can Turn Sprite Visible?
  3286. #--------------------------------------------------------------------------   
  3287. def can_turn_sprite_visible?
  3288.      return false if BattleManager.actor == nil
  3289.      return false if $game_temp.battle_end
  3290.      return false if $game_message.visible
  3291.      return true
  3292. end
  3293.  
  3294. #--------------------------------------------------------------------------
  3295. # * Update Turn Blink
  3296. #--------------------------------------------------------------------------   
  3297. def update_turn_blink
  3298.      return if !TURN_BLINK_EFFECT
  3299.      return if !@turn_sprite.visible
  3300.      @turn_sprite_blink[0] += 1
  3301.      case @turn_sprite_blink[0]
  3302.        when 0..30
  3303.           @turn_sprite_blink[1] += 3
  3304.        when 31..60
  3305.           @turn_sprite_blink[1] -= 3
  3306.        else
  3307.          @turn_sprite_blink = [0,0]
  3308.      end
  3309.      @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  3310. end
  3311.  
  3312.  
  3313. end
  3314.  
  3315. #==============================================================================
  3316. # ** Monogatari Bhud
  3317. #==============================================================================
  3318. class Monogatari_Bhud
  3319.  
  3320.   #--------------------------------------------------------------------------
  3321.   # * Create Screen Layout
  3322.   #--------------------------------------------------------------------------   
  3323.   def create_screen_layout(viewport)
  3324.       return if !SCREEN_LAYOUT
  3325.       @screen_layout = Sprite.new
  3326.       @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3327.       @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3328.       @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3329.       @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3330.       @screen_layout.opacity = 0
  3331.       @screen_layout.viewport = viewport
  3332.    end     
  3333.  
  3334.   #--------------------------------------------------------------------------
  3335.   # * Dispose Screen Layout
  3336.   #--------------------------------------------------------------------------
  3337.    def dispose_screen_layout
  3338.        return if @screen_layout == nil
  3339.        @screen_layout.dispose ; @screen_layout = nil     
  3340.    end
  3341.  
  3342.   #--------------------------------------------------------------------------
  3343.   # * Update Screen Layout
  3344.   #--------------------------------------------------------------------------
  3345.    def update_screen_layout
  3346.        return if @screen_layout == nil
  3347.        @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3348.        sprite_visible(@screen_layout)
  3349.    end
  3350.  
  3351.   #--------------------------------------------------------------------------
  3352.   # * Sprite Visible
  3353.   #--------------------------------------------------------------------------
  3354.   def sprite_visible?
  3355.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3356.       return false if !$game_temp.battle_hud_visible
  3357.       return false if !$game_temp.sprite_visible
  3358.       return true
  3359.   end
  3360.  
  3361.   #--------------------------------------------------------------------------
  3362.   # * Sprite Visible
  3363.   #--------------------------------------------------------------------------
  3364.   def sprite_visible(sprite)      
  3365.       if sprite_visible?
  3366.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3367.       else
  3368.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3369.       end
  3370.   end   
  3371.  
  3372. end
  3373.  
  3374. #==============================================================================
  3375. #==============================================================================
  3376. # ** Battle Hud EX
  3377. #==============================================================================
  3378. #==============================================================================
  3379. class Battle_Hud_EX
  3380.   include MOG_BATTLE_HUD_EX
  3381.  
  3382.   #--------------------------------------------------------------------------
  3383.   # * Initialize
  3384.   #--------------------------------------------------------------------------  
  3385.   def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3386.       pre_cache
  3387.       setup(actor,index,max_members)
  3388.       create_sprites(viewport)
  3389.   end
  3390.  
  3391.   #--------------------------------------------------------------------------
  3392.   # * Setup
  3393.   #--------------------------------------------------------------------------   
  3394.   def setup(actor,index,max_members)
  3395.       $game_temp.battle_end = false
  3396.       @actor = actor
  3397.       @actor_index = index
  3398.       @max_members = max_members
  3399.       @actor.face_animation = [0,0,0]
  3400.       @hp_icon_max = -1
  3401.       @hp_icon_old = -1
  3402.       @hp_icon_col_max = HP_ICON_COL_MAX
  3403.       @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3404.       @hp_icon_row_max = HP_ICON_ROW_MAX
  3405.       @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3406.       @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3407.       @mp_icon_max = -1
  3408.       @mp_icon_old = -1
  3409.       @mp_icon_col_max = MP_ICON_COL_MAX
  3410.       @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3411.       @mp_icon_row_max = MP_ICON_ROW_MAX
  3412.       @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3413.       @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3414.       @tp_icon_max = -1
  3415.       @tp_icon_old = -1
  3416.       @tp_icon_col_max = TP_ICON_COL_MAX
  3417.       @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3418.       @tp_icon_row_max = TP_ICON_ROW_MAX
  3419.       @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3420.       @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3421.       @sprite_visible = true
  3422.       @sprite_visitle_wait = 0
  3423.       setup_actor
  3424.       setup_position
  3425.   end
  3426.  
  3427.   #--------------------------------------------------------------------------
  3428.   # * Setup Actor
  3429.   #--------------------------------------------------------------------------   
  3430.   def setup_actor
  3431.       return if @actor == nil
  3432.       @hp_number_refresh = true
  3433.       @hp_number2_refresh = true
  3434.       @hp_number_old = @actor.hp
  3435.       @hp_number2_old = @actor.mhp
  3436.       @hp_old_meter = 0      
  3437.       @mp_number_refresh = true
  3438.       @mp_number2_refresh = true
  3439.       @mp_number_old = @actor.mp
  3440.       @mp_number2_old = @actor.mmp
  3441.       @mp_old_meter = 0      
  3442.       @tp_number_refresh = true
  3443.       @tp_number2_refresh = true
  3444.       @tp_number_old = @actor.tp
  3445.       @tp_number2_old = @actor.max_tp  
  3446.       @tp_old_meter = 0
  3447.       @at_number_refresh = true
  3448.       @at_number2_refresh = true
  3449.       @at_number_old = actor_at
  3450.       @at_number2_old = actor_max_at
  3451.       @at_old_meter = 0
  3452.       catb = ATB::MAX_AP rescue nil
  3453.       @ccwinter_atb = true if catb != nil
  3454.   end  
  3455.  
  3456.   #--------------------------------------------------------------------------
  3457.   # * Terminate
  3458.   #--------------------------------------------------------------------------   
  3459.   def terminate
  3460.       @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3461.   end
  3462.  
  3463.   #--------------------------------------------------------------------------
  3464.   # * AT
  3465.   #--------------------------------------------------------------------------  
  3466.   def actor_at
  3467.       return @actor.atb if $imported[:mog_atb_system]
  3468.       return @actor.atb if $imported[:ve_active_time_battle]
  3469.       return @actor.catb_value if $imported["YSA-CATB"]
  3470.       return @actor.ap if @ccwinter_atb != nil
  3471.       return 0
  3472.   end
  3473.  
  3474.   #--------------------------------------------------------------------------
  3475.   # * Max AT
  3476.   #--------------------------------------------------------------------------  
  3477.   def actor_max_at
  3478.       return @actor.atb_max if $imported[:mog_atb_system]
  3479.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3480.       return @actor.max_atb if $imported["YSA-CATB"]
  3481.       return ATB::MAX_AP if @ccwinter_atb != nil
  3482.       return 1
  3483.   end
  3484.  
  3485.   #--------------------------------------------------------------------------
  3486.   # ● Actor Cast
  3487.   #--------------------------------------------------------------------------            
  3488.   def actor_cast
  3489.       return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3490.       return @actor.atb if $imported[:ve_active_time_battle]
  3491.       return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3492.       return 0
  3493.   end
  3494.  
  3495.   #--------------------------------------------------------------------------
  3496.   # ● Actor Max Cast
  3497.   #--------------------------------------------------------------------------            
  3498.   def actor_max_cast
  3499.       if $imported[:mog_atb_system]
  3500.          return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3501.          return @actor.atb_cast[0].speed.abs
  3502.       end   
  3503.       return @actor.max_atb if $imported[:ve_active_time_battle]
  3504.       return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3505.       return 1
  3506.   end
  3507.  
  3508.   #--------------------------------------------------------------------------
  3509.   # ● Actor Cast?
  3510.   #--------------------------------------------------------------------------            
  3511.   def actor_cast?   
  3512.       if $imported[:mog_atb_system]
  3513.          return true if !@actor.atb_cast.empty?
  3514.       end   
  3515.       if $imported[:ve_active_time_battle]
  3516.          return true if @actor.cast_action?
  3517.       end      
  3518.       if @ccwinter_atb
  3519.          return true if @actor.chanting?
  3520.       end
  3521.       return false
  3522.   end  
  3523.  
  3524.   #--------------------------------------------------------------------------
  3525.   # * Create Sprites
  3526.   #--------------------------------------------------------------------------   
  3527.   def create_sprites(viewport)
  3528.       dispose
  3529.       return if @actor == nil
  3530.       create_layout(viewport)
  3531.       create_layout_2(viewport)
  3532.       create_name(viewport)
  3533.       create_face(viewport)
  3534.       create_hp_number(viewport)
  3535.       create_hp_number_max(viewport)
  3536.       create_hp_meter(viewport)
  3537.       create_hp_icon(viewport)
  3538.       create_hp_icon_ex(viewport)
  3539.       create_hp_icon_number(viewport)
  3540.       create_mp_number(viewport)
  3541.       create_mp_number_max(viewport)
  3542.       create_mp_meter(viewport)
  3543.       create_mp_icon(viewport)
  3544.       create_mp_icon_ex(viewport)
  3545.       create_mp_icon_number(viewport)
  3546.       create_tp_number(viewport)
  3547.       create_tp_number_max(viewport)
  3548.       create_tp_meter(viewport)
  3549.       create_tp_icon(viewport)
  3550.       create_tp_icon_ex(viewport)
  3551.       create_tp_icon_number(viewport)
  3552.       create_at_number(viewport)
  3553.       create_at_number_max(viewport)
  3554.       create_at_meter(viewport)      
  3555.       create_level_number(viewport)
  3556.       create_states(viewport)
  3557.       update
  3558.   end   
  3559.  
  3560.   #--------------------------------------------------------------------------
  3561.   # * Sprite Visible
  3562.   #--------------------------------------------------------------------------
  3563.   def sprite_visible?
  3564.       return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3565.       return false if !$game_temp.battle_hud_visible
  3566.       return false if !$game_temp.sprite_visible
  3567.       return true
  3568.   end
  3569.  
  3570.   #--------------------------------------------------------------------------
  3571.   # * Sprite Visible
  3572.   #--------------------------------------------------------------------------
  3573.   def sprite_visible(sprite)
  3574.       if @sprite_visible         
  3575.          sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3576.       else
  3577.          sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3578.       end
  3579.   end
  3580.  
  3581. end
  3582.  
  3583. #==============================================================================
  3584. #==============================================================================
  3585. # ** Battle Hud EX
  3586. #==============================================================================
  3587. #==============================================================================
  3588. class Battle_Hud_EX
  3589.  
  3590.   #--------------------------------------------------------------------------
  3591.   # * Setup Position
  3592.   #--------------------------------------------------------------------------
  3593.   def setup_position
  3594.       sprite_width = (Graphics.width - 64) / 4
  3595.       sprite_center = sprite_width / 2  
  3596.       if $game_party.battle_members.size > 4
  3597.          members = $game_party.battle_members.size - 4
  3598.          fx = 32 * members
  3599.        else
  3600.          fx = 0
  3601.       end   
  3602.       space_x = MEMBERS_SPACE[0] - fx
  3603.       space_y = MEMBERS_SPACE[1]      
  3604.       center = Graphics.width / 2
  3605.       members_space = (Graphics.width + space_x) / @max_members
  3606.       members_space2 = (members_space * @actor_index)      
  3607.       members_space3 = ((members_space / 2) * (@max_members - 1))
  3608.       members_space_y = space_y * @actor_index
  3609.       x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3610.       screen_resize_y = 0
  3611.       screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3612.       y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3613.       @hud_position = [x,y]
  3614.       $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3615.       $game_temp.hud_pos_real[@actor_index] = [x,y]
  3616.       x2 = x + sprite_center
  3617.       $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3618.       $game_temp.hud_pos[@actor_index] = [x2,y]
  3619.       if FIXED_HUD_POSITION[@actor_index] != nil     
  3620.          @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3621.          $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3622.          $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3623.          $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]   
  3624.       end      
  3625.   end
  3626.  
  3627. end
  3628.  
  3629. #==============================================================================
  3630. # ** Game Temp
  3631. #==============================================================================
  3632. class Game_Temp
  3633.  
  3634.   attr_accessor :cache_bhud_sprites
  3635.  
  3636.   #--------------------------------------------------------------------------
  3637.   # * Cache Battle Hud
  3638.   #--------------------------------------------------------------------------  
  3639.   def cache_battle_hud      
  3640.       execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3641.   end
  3642.  
  3643.   #--------------------------------------------------------------------------
  3644.   # * Execute Cache Bhud Sprites
  3645.   #--------------------------------------------------------------------------  
  3646.   def execute_cache_bhud_sprites
  3647.       @cache_bhud_sprites = []
  3648.       windows = ["Layout_Command","Layout_Party","Layout_Help",
  3649.       "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3650.       "Layout_Item"]
  3651.       for s in windows
  3652.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3653.       end
  3654.       sprites = ["Layout","Layout_2",
  3655.      "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3656.      "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",  
  3657.      "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",  
  3658.      "LV_Number","Turn","Iconset","Layout_Screen"
  3659.       ]
  3660.       for s in sprites
  3661.           @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3662.       end      
  3663.   end
  3664.  
  3665. end
  3666.  
  3667. #==============================================================================
  3668. # ** Spriteset_Map
  3669. #==============================================================================
  3670. class Spriteset_Map
  3671.  
  3672.   #--------------------------------------------------------------------------
  3673.   # * Initialize
  3674.   #--------------------------------------------------------------------------
  3675.   alias mog_monogatari_bhud_initialize initialize
  3676.   def initialize
  3677.       $game_temp.cache_battle_hud
  3678.       mog_monogatari_bhud_initialize
  3679.   end
  3680.  
  3681. end
  3682.  
  3683. #==============================================================================
  3684. #==============================================================================
  3685. # ** Battle Hud EX
  3686. #==============================================================================
  3687. #==============================================================================
  3688. class Battle_Hud_EX
  3689.  
  3690.   #--------------------------------------------------------------------------
  3691.   # * Pre Cache
  3692.   #--------------------------------------------------------------------------
  3693.   def pre_cache
  3694.       $game_temp.cache_battle_hud
  3695.       @force_hide = false
  3696.       @force_hide_time = 0
  3697.       @fade_hud = false
  3698.       @fade_hud_gold = false     
  3699.       @fade_hud_equip = false
  3700.       @layout_image = Cache.battle_hud("Layout")
  3701.       @layout_cw = @layout_image.width
  3702.       @layout_ch = @layout_image.height
  3703.       @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3704.       @layout2_cw = @layout2_image.width if @layout2_image != nil
  3705.       @layout2_ch = @layout2_image.height if @layout2_image != nil
  3706.       @layout2_cw = 0 if @layout2_cw == nil      
  3707.       #------------------------------------------------
  3708.       # HP
  3709.       #------------------------------------------------
  3710.       if HP_NUMBER_VISIBLE
  3711.          @hp_number_image = Cache.battle_hud("HP_Number")
  3712.          @hp_number_cw = @hp_number_image.width / 10
  3713.          if HP_NUMBER_LOW_COLOR
  3714.             @hp_number_ch = @hp_number_image.height / 2
  3715.          else
  3716.             @hp_number_ch = @hp_number_image.height
  3717.          end   
  3718.          @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3719.          @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number      
  3720.       end
  3721.       if HP_NUMBER_MAX_VISIBLE
  3722.          @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3723.          @hp_number2_cw = @hp_number2_image.width / 10
  3724.          @hp_number2_ch = @hp_number2_image.height
  3725.       end
  3726.       if HP_METER_VISIBLE
  3727.          @hp_meter_image = Cache.battle_hud("HP_Meter")
  3728.          if HP_METER_GRADIENT_ANIMATION
  3729.             @hp_meter_cw = @hp_meter_image.width / 3
  3730.          else   
  3731.             @hp_meter_cw = @hp_meter_image.width
  3732.          end   
  3733.          if HP_METER_REDUCTION_ANIMATION
  3734.             @hp_meter_ch = @hp_meter_image.height / 2
  3735.          else
  3736.             @hp_meter_ch = @hp_meter_image.height
  3737.          end  
  3738.       end
  3739.       if HP_ICON_VISIBLE
  3740.          @hp_icon_image = Cache.battle_hud("HP_Icon")
  3741.          @hp_icon_cw = @hp_icon_image.width / 2
  3742.          @hp_icon_ch = @hp_icon_image.height
  3743.       end
  3744.       if HP_ICON_EX_VISIBLE
  3745.          @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3746.          @hp_icon2_cw = @hp_icon2_image.width
  3747.          @hp_icon2_ch = @hp_icon2_image.height        
  3748.       end      
  3749.       if HP_ICON_NUMBER_VISIBLE
  3750.          @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3751.          @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3752.          @hp_icon_number_ch = @hp_icon_number_image.height        
  3753.       end
  3754.       #------------------------------------------------
  3755.       # MP
  3756.       #------------------------------------------------
  3757.       if MP_NUMBER_VISIBLE
  3758.          @mp_number_image = Cache.battle_hud("MP_Number")
  3759.          @mp_number_cw = @mp_number_image.width / 10
  3760.          if MP_NUMBER_LOW_COLOR
  3761.             @mp_number_ch = @mp_number_image.height / 2
  3762.          else
  3763.             @mp_number_ch = @mp_number_image.height
  3764.         end
  3765.         @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3766.         @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3767.       end
  3768.       if MP_NUMBER_MAX_VISIBLE
  3769.          @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3770.          @mp_number2_cw = @mp_number2_image.width / 10
  3771.          @mp_number2_ch = @mp_number2_image.height
  3772.       end
  3773.       if MP_METER_VISIBLE
  3774.          @mp_meter_image = Cache.battle_hud("MP_Meter")
  3775.          if MP_METER_GRADIENT_ANIMATION
  3776.             @mp_meter_cw = @mp_meter_image.width / 3
  3777.          else   
  3778.             @mp_meter_cw = @mp_meter_image.width
  3779.          end  
  3780.          if MP_METER_REDUCTION_ANIMATION
  3781.             @mp_meter_ch = @mp_meter_image.height / 2
  3782.          else
  3783.             @mp_meter_ch = @mp_meter_image.height
  3784.          end
  3785.       end
  3786.       if MP_ICON_VISIBLE
  3787.          @mp_icon_image = Cache.battle_hud("MP_Icon")
  3788.          @mp_icon_cw = @mp_icon_image.width / 2
  3789.          @mp_icon_ch = @mp_icon_image.height
  3790.       end
  3791.       if MP_ICON_EX_VISIBLE
  3792.          @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3793.          @mp_icon2_cw = @mp_icon2_image.width
  3794.          @mp_icon2_ch = @mp_icon2_image.height        
  3795.       end      
  3796.       if MP_ICON_NUMBER_VISIBLE
  3797.          @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3798.          @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3799.          @mp_icon_number_ch = @mp_icon_number_image.height        
  3800.       end
  3801.       #------------------------------------------------
  3802.       # TP
  3803.       #------------------------------------------------
  3804.       if TP_NUMBER_VISIBLE
  3805.          @tp_number_image = Cache.battle_hud("TP_Number")
  3806.          @tp_number_cw = @tp_number_image.width / 10
  3807.          if TP_NUMBER_LOW_COLOR
  3808.             @tp_number_ch = @tp_number_image.height / 2
  3809.          else
  3810.             @tp_number_ch = @tp_number_image.height
  3811.          end  
  3812.         @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3813.         @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number      
  3814.       end
  3815.       if TP_NUMBER_MAX_VISIBLE
  3816.          @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3817.          @tp_number2_cw = @tp_number2_image.width / 10
  3818.          @tp_number2_ch = @tp_number2_image.height
  3819.       end
  3820.       if TP_METER_VISIBLE
  3821.          @tp_meter_image = Cache.battle_hud("TP_Meter")
  3822.          if TP_METER_GRADIENT_ANIMATION
  3823.             @tp_meter_cw = @tp_meter_image.width / 3
  3824.          else   
  3825.             @tp_meter_cw = @tp_meter_image.width
  3826.          end  
  3827.          if TP_METER_REDUCTION_ANIMATION
  3828.             @tp_meter_ch = @tp_meter_image.height / 2      
  3829.          else
  3830.             @tp_meter_ch = @tp_meter_image.height
  3831.          end   
  3832.       end        
  3833.       if TP_ICON_VISIBLE
  3834.          @tp_icon_image = Cache.battle_hud("TP_Icon")
  3835.          @tp_icon_cw = @tp_icon_image.width / 2
  3836.          @tp_icon_ch = @tp_icon_image.height
  3837.       end  
  3838.       if TP_ICON_EX_VISIBLE
  3839.          @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3840.          @tp_icon2_cw = @tp_icon2_image.width
  3841.          @tp_icon2_ch = @tp_icon2_image.height        
  3842.       end      
  3843.       if TP_ICON_NUMBER_VISIBLE
  3844.          @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3845.          @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3846.          @tp_icon_number_ch = @tp_icon_number_image.height        
  3847.       end
  3848.       #------------------------------------------------
  3849.       # AT
  3850.       #------------------------------------------------
  3851.       if AT_NUMBER_VISIBLE
  3852.          @at_number_image = Cache.battle_hud("AT_Number")
  3853.          @at_number_cw = @at_number_image.width / 10
  3854.          @at_number_ch = @at_number_image.height
  3855.          @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3856.          @at_number_ch += (@at_number_ch / 2) if @at_wave_number      
  3857.       end
  3858.       if AT_NUMBER_MAX_VISIBLE
  3859.          @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3860.          @at_number2_cw = @at_number2_image.width / 10
  3861.          @at_number2_ch = @at_number2_image.height
  3862.       end
  3863.       if AT_METER_VISIBLE
  3864.          @at_meter_image = Cache.battle_hud("AT_Meter")
  3865.          if AT_METER_GRADIENT_ANIMATION
  3866.             @at_meter_cw = @at_meter_image.width / 3
  3867.          else   
  3868.             @at_meter_cw = @at_meter_image.width
  3869.          end   
  3870.          @at_meter_ch = @at_meter_image.height / 3
  3871.       end
  3872.       #------------------------------------------------
  3873.       # LV
  3874.       #------------------------------------------------  
  3875.       if LEVEL_NUMBER_VISIBLE
  3876.          @lv_number_image = Cache.battle_hud("LV_Number")
  3877.          @lv_number_cw = @lv_number_image.width / 10
  3878.          @lv_number_ch = @lv_number_image.height
  3879.       end      
  3880.       #------------------------------------------------
  3881.       # ICON
  3882.       #------------------------------------------------  
  3883.       if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3884.          @icon_image = Cache.system("Iconset")
  3885.       end         
  3886.   end
  3887.  
  3888.   #--------------------------------------------------------------------------
  3889.   # * Check Icon Image
  3890.   #--------------------------------------------------------------------------         
  3891.   def check_icon_image
  3892.       if @icon_image == nil or @icon_image.disposed?
  3893.          @icon_image = Cache.system("Iconset")
  3894.       end   
  3895.   end  
  3896.  
  3897. end
  3898.  
  3899. #==============================================================================
  3900. #==============================================================================
  3901. # ** Battle Hud EX
  3902. #==============================================================================
  3903. #==============================================================================
  3904. class Battle_Hud_EX
  3905.  
  3906.   #--------------------------------------------------------------------------
  3907.   # * Update Number
  3908.   #--------------------------------------------------------------------------   
  3909.   def update_number(type,value)
  3910.       actor_value = @actor.hp if type == 0
  3911.       actor_value = @actor.mp if type == 1
  3912.       actor_value = @actor.tp if type == 2
  3913.       actor_value = @actor.mhp if type == 3
  3914.       actor_value = @actor.mmp if type == 4
  3915.       actor_value = @actor.max_tp if type == 5
  3916.       actor_value = actor_at if type == 6
  3917.       actor_value = actor_max_at if type == 7
  3918.       if value < actor_value
  3919.          value += number_refresh_speed(actor_value,value)
  3920.          value = actor_value if value >= actor_value
  3921.          refresh_sprite_number(type,value)
  3922.      elsif value > actor_value
  3923.          value -= number_refresh_speed(actor_value,value)
  3924.          value = actor_value if value <= actor_value
  3925.          refresh_sprite_number(type,value)
  3926.      end  
  3927.   end
  3928.  
  3929.   #--------------------------------------------------------------------------
  3930.   # * Number Refresh Speed
  3931.   #--------------------------------------------------------------------------      
  3932.   def number_refresh_speed(actor_value,value)
  3933.       n =  1 * (actor_value - value).abs / 10
  3934.       return [[n, 99999999].min,1].max   
  3935.   end
  3936.  
  3937.   #--------------------------------------------------------------------------
  3938.   # * Update Number Fix
  3939.   #--------------------------------------------------------------------------      
  3940.   def update_number_fix(type)
  3941.       if type == 0
  3942.          @hp_number_old =  @actor.hp
  3943.          @hp_number_refresh = true
  3944.       elsif type == 1
  3945.          @mp_number_old =  @actor.mp
  3946.          @mp_number_refresh = true
  3947.       elsif type == 2
  3948.          @tp_number_old =  @actor.tp
  3949.          @tp_number_refresh = true  
  3950.       elsif type == 3
  3951.          @hp_number2_old =  @actor.mhp
  3952.          @hp_number2_refresh = true
  3953.       elsif type == 4
  3954.          @mp_number2_old =  @actor.mmp
  3955.          @mp_number2_refresh = true
  3956.       elsif type == 5
  3957.          @tp_number2_old =  @actor.max_tp
  3958.          @tp_number2_refresh = true  
  3959.       elsif type == 6
  3960.          @at_number_old =  actor_at
  3961.          @at_number_refresh = true         
  3962.       elsif type == 7
  3963.          @at_number2_old = actor_max_at
  3964.          @at_number2_refresh = true            
  3965.       end   
  3966.   end  
  3967.  
  3968.   #--------------------------------------------------------------------------
  3969.   # * Refresh Sprite Number
  3970.   #--------------------------------------------------------------------------   
  3971.   def refresh_sprite_number(type,value)   
  3972.       @hp_number_refresh = true if type == 0
  3973.       @hp_number_old = value if type == 0
  3974.       @mp_number_refresh = true if type == 1
  3975.       @mp_number_old = value if type == 1
  3976.       @tp_number_refresh = true if type == 2
  3977.       @tp_number_old = value if type == 2
  3978.       @hp_number2_refresh = true if type == 3
  3979.       @hp_number2_old = value if type == 3
  3980.       @mp_number2_refresh = true if type == 4
  3981.       @mp_number2_old = value if type == 4
  3982.       @tp_number2_refresh = true if type == 5
  3983.       @tp_number2_old = value if type == 5
  3984.       @at_number_refresh = true if type == 6
  3985.       @at_number_old = value if type == 6
  3986.       @at_number2_refresh = true if type == 7
  3987.       @at_number2_old = value if type == 7
  3988.   end  
  3989.  
  3990.   #--------------------------------------------------------------------------
  3991.   # * Refresh Number
  3992.   #--------------------------------------------------------------------------   
  3993.   def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  3994.       sprite.bitmap.clear
  3995.       clear_number_refresh(type)
  3996.       number_color = low_number_color(type,number_ch)
  3997.       if type == 0 and HP_NUMBER_PERCENTAGE
  3998.          value_max = @actor.mhp
  3999.          value = value.to_f / value_max.to_f * 100
  4000.          value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  4001.       elsif type == 1 and MP_NUMBER_PERCENTAGE
  4002.          value_max = @actor.mmp
  4003.          value = value.to_f / value_max.to_f * 100
  4004.       elsif type == 2 and TP_NUMBER_PERCENTAGE
  4005.          value_max = @actor.max_tp
  4006.          value = value.to_f / value_max.to_f * 100  
  4007.       elsif type == 3 and HP_NUMBER_PERCENTAGE
  4008.          value = 100
  4009.       elsif type == 4 and MP_NUMBER_PERCENTAGE
  4010.          value = 100
  4011.       elsif type == 5 and TP_NUMBER_PERCENTAGE
  4012.          value = 100
  4013.       elsif type == 6 and AT_NUMBER_PERCENTAGE
  4014.          value_max = actor_max_at
  4015.          value = value.to_f / value_max.to_f * 100
  4016.       elsif type == 7 and AT_NUMBER_PERCENTAGE
  4017.          value = 100         
  4018.       end
  4019.       value = 9999999 if value > 9999999
  4020.       number_value = value.truncate.abs.to_s.split(//)
  4021.       wave_h = 0
  4022.       wave_h2 = wave_number ? (number_ch / 3) : 0
  4023.       wave_h3 = number_color != 0 ? wave_h2 : 0
  4024.       for r in 0..number_value.size - 1         
  4025.          number_value_abs = number_value[r].to_i
  4026.          wh = wave_h2 * wave_h
  4027.          wh2 = wave_h == 0 ? wave_h2 : 0
  4028.          nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  4029.          sprite.bitmap.blt(number_cw *  r, wh, image, nsrc_rect)
  4030.          wave_h = wave_h == 0 ? 1 : 0
  4031.       end
  4032.       refresh_number_position(type,number_value.size,number_cw)
  4033.   end
  4034.  
  4035.   #--------------------------------------------------------------------------
  4036.   # * Refresh Number
  4037.   #--------------------------------------------------------------------------     
  4038.   def refresh_number_position(type,number_value,number_cw)
  4039.       cx = number_value * number_cw
  4040.       if type == 0
  4041.          case HP_NUMBER_ALIGN_TYPE
  4042.            when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4043.            when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  4044.            when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  4045.          end            
  4046.       elsif type == 1
  4047.          case MP_NUMBER_ALIGN_TYPE
  4048.            when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4049.            when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  4050.            when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  4051.          end     
  4052.       elsif type == 2  
  4053.          case TP_NUMBER_ALIGN_TYPE
  4054.            when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4055.            when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  4056.            when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  4057.          end           
  4058.       elsif type == 3   
  4059.          case HP_NUMBER_ALIGN_TYPE
  4060.            when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4061.            when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4062.            when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  4063.          end           
  4064.       elsif type ==  4
  4065.          case MP_NUMBER_ALIGN_TYPE
  4066.            when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4067.            when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4068.            when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  4069.          end         
  4070.       elsif type ==  5
  4071.          case TP_NUMBER_ALIGN_TYPE
  4072.            when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4073.            when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4074.            when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  4075.          end
  4076.       elsif type ==  6     
  4077.          case MP_NUMBER_ALIGN_TYPE
  4078.            when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4079.            when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4080.            when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4081.          end            
  4082.       elsif type ==  7     
  4083.          case AT_NUMBER_ALIGN_TYPE
  4084.            when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4085.            when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4086.            when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4087.          end
  4088.       end  
  4089.   end
  4090.  
  4091.   #--------------------------------------------------------------------------
  4092.   # * Low Number Color
  4093.   #--------------------------------------------------------------------------      
  4094.   def low_number_color(type,number_ch)
  4095.       if type == 0
  4096.          if HP_NUMBER_LOW_COLOR
  4097.             return @actor.low_hp? ? number_ch : 0
  4098.          else
  4099.             return 0
  4100.          end  
  4101.       elsif type == 1
  4102.          if MP_NUMBER_LOW_COLOR   
  4103.             return @actor.low_mp? ? number_ch : 0
  4104.          else
  4105.             return 0
  4106.          end         
  4107.       elsif type == 2
  4108.          if TP_NUMBER_LOW_COLOR
  4109.             return @actor.low_tp? ? number_ch : 0
  4110.          else
  4111.             return 0
  4112.          end
  4113.       else   
  4114.          return 0  
  4115.       end     
  4116.   end
  4117.  
  4118.   #--------------------------------------------------------------------------
  4119.   # * Clear Number Refresh
  4120.   #--------------------------------------------------------------------------      
  4121.   def clear_number_refresh(type)
  4122.       @hp_number_refresh = false if type == 0
  4123.       @mp_number_refresh = false if type == 1
  4124.       @tp_number_refresh = false if type == 2
  4125.       @hp_number2_refresh = false if type == 3
  4126.       @mp_number2_refresh = false if type == 4
  4127.       @tp_number2_refresh = false if type == 5
  4128.       @at_number_refresh = false if type == 6
  4129.       @at_number2_refresh = false if type == 7
  4130.   end  
  4131.  
  4132.   #--------------------------------------------------------------------------
  4133.   # * Icon Limit
  4134.   #--------------------------------------------------------------------------      
  4135.   def icon_limit(value,value_max)
  4136.       n1 = value / value_max
  4137.       n2 = value - (n1 * value_max)
  4138.       n2 = value_max if (n2 == 0 and value > 0)
  4139.       return n2
  4140.   end  
  4141.  
  4142. end
  4143.  
  4144. #==============================================================================
  4145. #==============================================================================
  4146. # ** Battle Hud EX
  4147. #==============================================================================
  4148. #==============================================================================
  4149. class Battle_Hud_EX
  4150.  
  4151.   #--------------------------------------------------------------------------
  4152.   # * Create Layout
  4153.   #--------------------------------------------------------------------------   
  4154.   def create_layout(viewport)
  4155.       @layout = Sprite.new
  4156.       @layout.bitmap = @layout_image
  4157.       @layout.z = HUD_Z
  4158.       @layout.x = @hud_position[0]
  4159.       @layout.y = @hud_position[1]
  4160.       @layout.opacity = 0
  4161.       @layout.viewport = viewport
  4162.   end   
  4163.  
  4164.   #--------------------------------------------------------------------------
  4165.   # * Update Layout
  4166.   #--------------------------------------------------------------------------   
  4167.   def update_layout
  4168.       return if @layout == nil
  4169.       sprite_visible(@layout)
  4170.   end
  4171.  
  4172.   #--------------------------------------------------------------------------
  4173.   # * Create Layout
  4174.   #--------------------------------------------------------------------------   
  4175.   def create_layout_2(viewport)
  4176.       return if !SECOND_LAYOUT
  4177.       @layout2 = Sprite.new
  4178.       @layout2.bitmap = @layout2_image
  4179.       @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4180.       @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4181.       @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4182.       @layout2.opacity = 0
  4183.       @layout2.viewport = viewport
  4184.   end   
  4185.  
  4186.   #--------------------------------------------------------------------------
  4187.   # * Update Layout
  4188.   #--------------------------------------------------------------------------   
  4189.   def update_layout_2
  4190.       return if @layout2 == nil
  4191.       sprite_visible(@layout2)
  4192.   end  
  4193.  
  4194. end
  4195.  
  4196. #==============================================================================
  4197. #==============================================================================
  4198. # ** Battle Hud EX
  4199. #==============================================================================
  4200. #==============================================================================
  4201. class Battle_Hud_EX
  4202.  
  4203.   #--------------------------------------------------------------------------
  4204.   # * Create Name
  4205.   #--------------------------------------------------------------------------      
  4206.   def create_name(viewport)
  4207.       return if !NAME_VISIBLE
  4208.       @name = Sprite.new
  4209.       @name.bitmap = Bitmap.new(160,32)
  4210.       @name.bitmap.font.size = NAME_FONT_SIZE
  4211.       @name.bitmap.font.bold = NAME_FONT_BOLD
  4212.       @name.bitmap.font.italic = NAME_FONT_ITALIC
  4213.       @name.bitmap.font.color = NAME_FONT_COLOR
  4214.       @name.z = HUD_Z + NAME_Z
  4215.       @name.x = @hud_position[0] + NAME_POSITION[0]
  4216.       @name.y = @hud_position[1] + NAME_POSITION[1]
  4217.       @name.viewport = viewport
  4218.       @name.opacity = 0
  4219.       refresh_name
  4220.   end
  4221.  
  4222.   #--------------------------------------------------------------------------
  4223.   # * Refresh Name
  4224.   #--------------------------------------------------------------------------      
  4225.   def refresh_name
  4226.       return if @name == nil
  4227.       @name.bitmap.clear
  4228.       if NAME_FONT_SHADOW
  4229.          @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4230.          @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4231.          @name.bitmap.font.color = NAME_FONT_COLOR
  4232.       end   
  4233.       @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4234.   end
  4235.  
  4236.   #--------------------------------------------------------------------------
  4237.   # * Update Name
  4238.   #--------------------------------------------------------------------------        
  4239.   def update_name
  4240.       return if @name == nil
  4241.       sprite_visible(@name)
  4242.   end
  4243.  
  4244. end
  4245.  
  4246. #==============================================================================
  4247. #==============================================================================
  4248. # ** Battle Hud EX
  4249. #==============================================================================
  4250. #==============================================================================
  4251. class Battle_Hud_EX
  4252.  
  4253.   #--------------------------------------------------------------------------
  4254.   # * Create HP Number
  4255.   #--------------------------------------------------------------------------  
  4256.   def create_hp_number(viewport)
  4257.       return if !HP_NUMBER_VISIBLE
  4258.       @hp_number = Sprite.new
  4259.       @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4260.       @hp_number.z = HUD_Z + HP_NUMBER_Z
  4261.       @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4262.       @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4263.       @hp_number.viewport = viewport
  4264.       @hp_number.opacity = 0
  4265.   end
  4266.  
  4267.   #--------------------------------------------------------------------------
  4268.   # * Create HP Number Max
  4269.   #--------------------------------------------------------------------------  
  4270.   def create_hp_number_max(viewport)
  4271.       return if !HP_NUMBER_MAX_VISIBLE
  4272.       @hp_number2 = Sprite.new
  4273.       @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4274.       @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4275.       @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4276.       @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4277.       @hp_number2.viewport = viewport
  4278.       @hp_number2.opacity = 0
  4279.   end  
  4280.  
  4281.   #--------------------------------------------------------------------------
  4282.   # * Create HP Meter
  4283.   #--------------------------------------------------------------------------   
  4284.   def create_hp_meter(viewport)
  4285.       return if !HP_METER_VISIBLE
  4286.       @hp_flow_max = @hp_meter_cw * 2
  4287.       @hp_flow = rand(@hp_flow_max)
  4288.       @hp_meter = Sprite.new
  4289.       @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4290.       @hp_meter.z = HUD_Z + HP_METER_Z
  4291.       @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4292.       @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4293.       @hp_meter.angle = HP_METER_ANGLE
  4294.       @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4295.       @hp_meter.viewport = viewport
  4296.       @hp_meter.opacity = 0
  4297.   end
  4298.  
  4299.   #--------------------------------------------------------------------------
  4300.   # ● Update Flow HP
  4301.   #--------------------------------------------------------------------------            
  4302.   def update_flow_hp
  4303.       @hp_meter.bitmap.clear
  4304.       @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4305.       meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4306.       meter_width = 0 if meter_width == nil
  4307.       execute_hp_damage_flow(meter_width)      
  4308.       meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4309.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)  
  4310.       @hp_flow += 1
  4311.       @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4312.   end  
  4313.  
  4314.   #--------------------------------------------------------------------------
  4315.   # ● Execute HP Damage Flow
  4316.   #--------------------------------------------------------------------------
  4317.   def execute_hp_damage_flow(meter_width)
  4318.       return if !HP_METER_REDUCTION_ANIMATION
  4319.       return if @hp_old_meter == meter_width
  4320.       n = (@hp_old_meter - meter_width).abs * 3 / 100
  4321.       damage_flow = [[n, 2].min,0.5].max
  4322.       @hp_old_meter -= damage_flow
  4323.       @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4324.       src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4325.       @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)      
  4326.   end
  4327.  
  4328.   #--------------------------------------------------------------------------
  4329.   # * Create HP Icon
  4330.   #--------------------------------------------------------------------------  
  4331.   def create_hp_icon(viewport)
  4332.       return if !HP_ICON_VISIBLE
  4333.       @hp_icon = Sprite.new
  4334.       icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4335.       icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4336.       @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4337.       @hp_icon.z = HUD_Z + HP_ICON_Z
  4338.       @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4339.       @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4340.       @hp_icon.viewport = viewport
  4341.       @hp_icon.opacity = 0
  4342.   end
  4343.  
  4344.   #--------------------------------------------------------------------------
  4345.   # * Refresh HP Icon
  4346.   #--------------------------------------------------------------------------   
  4347.   def refresh_hp_icon
  4348.       @hp_icon_old = @actor.hp
  4349.       @hp_icon.bitmap.clear
  4350.       max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4351.       if @actor.hp > max_value
  4352.          icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4353.       else   
  4354.          icon_max = @actor.mhp
  4355.       end      
  4356.       for i in 0...icon_max
  4357.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4358.           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)
  4359.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4360.           i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4361.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )      
  4362.       end      
  4363.       icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4364.       rx = 0
  4365.       ry = 0
  4366.       for i in 0...icon_max
  4367.           break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4368.           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)
  4369.           ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4370.           i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4371.           @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4372.       end
  4373.       refresh_hp_icon_ex(rx,ry)      
  4374.   end
  4375.  
  4376.   #--------------------------------------------------------------------------
  4377.   # * Create HP Icon EX
  4378.   #--------------------------------------------------------------------------  
  4379.   def create_hp_icon_ex(viewport)
  4380.       return if !HP_ICON_EX_VISIBLE
  4381.       @hp_icon3_anime_phase = 0
  4382.       @hp_icon3 = Sprite.new
  4383.       @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4384.       @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4385.       @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4386.       @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4387.       @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4388.                        @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4389.       @hp_icon3.x = @hp_icon3_org[0]
  4390.       @hp_icon3.y = @hp_icon3_org[1]
  4391.       @hp_icon3.viewport = viewport
  4392.       @hp_icon3.opacity = 0
  4393.   end   
  4394.  
  4395.   #--------------------------------------------------------------------------
  4396.   # * Refresh HP Icon EX
  4397.   #--------------------------------------------------------------------------      
  4398.   def refresh_hp_icon_ex(rx,ry)
  4399.       return if @hp_icon3 == nil
  4400.       @hp_icon3.bitmap.clear
  4401.       return if @actor.hp == 0
  4402.       i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4403.       @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4404.       @hp_icon3.x = @hp_icon3_org[0] + rx
  4405.       @hp_icon3.y = @hp_icon3_org[1] + ry     
  4406.   end
  4407.  
  4408.   #--------------------------------------------------------------------------
  4409.   # * Update Icon HP EX Anime
  4410.   #--------------------------------------------------------------------------  
  4411.   def update_icon_hp_ex_anime
  4412.       return if !HP_ICON_EX_ZOOM_EFFECT
  4413.       if @hp_icon3_anime_phase == 0
  4414.          @hp_icon3.zoom_x += 0.01
  4415.          if @hp_icon3.zoom_x >= 1.30
  4416.             @hp_icon3.zoom_x = 1.30
  4417.             @hp_icon3_anime_phase = 1
  4418.          end  
  4419.       else
  4420.         @hp_icon3.zoom_x -= 0.01
  4421.         if @hp_icon3.zoom_x <= 1.05
  4422.            @hp_icon3.zoom_x = 1.05
  4423.            @hp_icon3_anime_phase = 0
  4424.         end   
  4425.       end  
  4426.       @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4427.   end
  4428.  
  4429.   #--------------------------------------------------------------------------
  4430.   # * Create HP Icon Nummber
  4431.   #--------------------------------------------------------------------------      
  4432.   def create_hp_icon_number(viewport)
  4433.       return if !HP_ICON_NUMBER_VISIBLE
  4434.       @hp_icon_number_old = [-1,-1]
  4435.       @hp_icon_number = Sprite.new
  4436.       @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4437.       @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4438.       @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4439.       @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4440.       @hp_icon_number.viewport = viewport
  4441.       @hp_icon_number.opacity = 0
  4442.   end
  4443.  
  4444.   #--------------------------------------------------------------------------
  4445.   # * Refresh Icon Number HP
  4446.   #--------------------------------------------------------------------------  
  4447.   def refresh_icon_number_hp
  4448.       @hp_icon_number_old[0] = @actor.hp
  4449.       @hp_icon_number_old[1] = @actor.mhp
  4450.       @hp_icon_number.bitmap.clear
  4451.       value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4452.       value = 0 if value < 0
  4453.       number_value = value.truncate.abs.to_s.split(//)
  4454.       for r in 0..number_value.size - 1         
  4455.          number_value_abs = number_value[r].to_i
  4456.          nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4457.          @hp_icon_number.bitmap.blt(@hp_icon_number_cw *  r, 0, @hp_icon_number_image, nsrc_rect)
  4458.       end
  4459.       cx = (number_value.size * @hp_icon_number_cw)
  4460.       case HP_ICON_NUMBER_ALIGN_TYPE
  4461.          when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4462.          when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4463.          when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4464.       end   
  4465.   end
  4466.  
  4467.   #--------------------------------------------------------------------------
  4468.   # * Can Refresh Icon Number HP
  4469.   #--------------------------------------------------------------------------  
  4470.   def can_refresh_icon_number_hp?
  4471.       return true if @hp_icon_number_old[0] != @actor.hp
  4472.       return true if @hp_icon_number_old[1] != @actor.mhp
  4473.       return false
  4474.   end
  4475.  
  4476.   #--------------------------------------------------------------------------
  4477.   # * Update HP
  4478.   #--------------------------------------------------------------------------   
  4479.   def update_hp
  4480.       if @hp_number != nil
  4481.          if HP_NUMBER_ANIMATION
  4482.             update_number(0,@hp_number_old)
  4483.          else   
  4484.             update_number_fix(0) if @hp_number_old != @actor.hp
  4485.          end
  4486.          sprite_visible(@hp_number)  
  4487.          refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4488.       end
  4489.       if @hp_number2 != nil
  4490.          if HP_NUMBER_ANIMATION
  4491.             update_number(3,@hp_number2_old)
  4492.          else   
  4493.             update_number_fix(3) if @hp_number2_old != @actor.mhp
  4494.          end  
  4495.          refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4496.          sprite_visible(@hp_number2)
  4497.       end
  4498.       if @hp_meter != nil
  4499.          sprite_visible(@hp_meter)
  4500.          update_flow_hp
  4501.       end   
  4502.       if @hp_icon != nil
  4503.          sprite_visible(@hp_icon)
  4504.          refresh_hp_icon if @hp_icon_old != @actor.hp
  4505.       end
  4506.       if @hp_icon3 != nil
  4507.          sprite_visible(@hp_icon3)
  4508.          update_icon_hp_ex_anime
  4509.       end      
  4510.       if @hp_icon_number != nil
  4511.          sprite_visible(@hp_icon_number)
  4512.          refresh_icon_number_hp if can_refresh_icon_number_hp?
  4513.       end  
  4514.   end  
  4515.  
  4516. end
  4517.  
  4518. #==============================================================================
  4519. #==============================================================================
  4520. # ** Battle Hud EX
  4521. #==============================================================================
  4522. #==============================================================================
  4523. class Battle_Hud_EX
  4524.  
  4525.   #--------------------------------------------------------------------------
  4526.   # * Create MP Number
  4527.   #--------------------------------------------------------------------------  
  4528.   def create_mp_number(viewport)
  4529.       return if !MP_NUMBER_VISIBLE
  4530.       @mp_number = Sprite.new
  4531.       @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4532.       @mp_number.z = HUD_Z + MP_NUMBER_Z
  4533.       @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4534.       @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4535.       @mp_number.viewport = viewport
  4536.       @mp_number.opacity = 0
  4537.   end
  4538.  
  4539.   #--------------------------------------------------------------------------
  4540.   # * Create MP Number Max
  4541.   #--------------------------------------------------------------------------  
  4542.   def create_mp_number_max(viewport)
  4543.       return if !MP_NUMBER_MAX_VISIBLE
  4544.       @mp_number2 = Sprite.new
  4545.       @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4546.       @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4547.       @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4548.       @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4549.       @mp_number2.viewport = viewport
  4550.       @mp_number2.opacity = 0
  4551.   end  
  4552.  
  4553.   #--------------------------------------------------------------------------
  4554.   # * Create MP Meter
  4555.   #--------------------------------------------------------------------------   
  4556.   def create_mp_meter(viewport)
  4557.       return if !MP_METER_VISIBLE
  4558.       @mp_flow_max = @mp_meter_cw * 2
  4559.       @mp_flow = rand(@mp_flow_max)
  4560.       @mp_meter = Sprite.new
  4561.       @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4562.       @mp_meter.z = HUD_Z + MP_METER_Z
  4563.       @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4564.       @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4565.       @mp_meter.angle = MP_METER_ANGLE
  4566.       @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4567.       @mp_meter.viewport = viewport
  4568.       @mp_meter.opacity = 0
  4569.   end
  4570.  
  4571.   #--------------------------------------------------------------------------
  4572.   # ● Update Flow MP
  4573.   #--------------------------------------------------------------------------            
  4574.   def update_flow_mp
  4575.       @mp_meter.bitmap.clear
  4576.       @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4577.       meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4578.       meter_width = 0 if meter_width == nil
  4579.       execute_mp_damage_flow(meter_width)      
  4580.       meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4581.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)  
  4582.       @mp_flow += 1
  4583.       @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4584.   end  
  4585.  
  4586.   #--------------------------------------------------------------------------
  4587.   # ● Execute MP Damage Flow
  4588.   #--------------------------------------------------------------------------
  4589.   def execute_mp_damage_flow(meter_width)
  4590.       return if !MP_METER_REDUCTION_ANIMATION
  4591.       return if @mp_old_meter == meter_width
  4592.       n = (@mp_old_meter - meter_width).abs * 3 / 100
  4593.       damage_flow = [[n, 2].min,0.5].max
  4594.       @mp_old_meter -= damage_flow      
  4595.       @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4596.       src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4597.       @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)      
  4598.   end
  4599.  
  4600.   #--------------------------------------------------------------------------
  4601.   # * Create MP Icon
  4602.   #--------------------------------------------------------------------------  
  4603.   def create_mp_icon(viewport)
  4604.       return if !MP_ICON_VISIBLE
  4605.       @mp_icon = Sprite.new
  4606.       icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4607.       icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4608.       @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4609.       @mp_icon.z = HUD_Z + MP_ICON_Z
  4610.       @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4611.       @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4612.       @mp_icon.viewport = viewport
  4613.       @mp_icon.opacity = 0
  4614.   end
  4615.  
  4616.   #--------------------------------------------------------------------------
  4617.   # * Refresh MP Icon
  4618.   #--------------------------------------------------------------------------   
  4619.   def refresh_mp_icon
  4620.       @mp_icon_old = @actor.mp
  4621.       @mp_icon.bitmap.clear
  4622.       max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4623.       if @actor.mp > max_value
  4624.          icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4625.       else   
  4626.          icon_max = @actor.mmp
  4627.       end      
  4628.       for i in 0...icon_max
  4629.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4630.           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)
  4631.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4632.           i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4633.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )      
  4634.       end      
  4635.       icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4636.       rx = 0
  4637.       ry = 0
  4638.       for i in 0...icon_max
  4639.           break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4640.           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)
  4641.           ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4642.           i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4643.           @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4644.       end
  4645.       refresh_mp_icon_ex(rx,ry)      
  4646.   end
  4647.  
  4648.   #--------------------------------------------------------------------------
  4649.   # * Create MP Icon EX
  4650.   #--------------------------------------------------------------------------  
  4651.   def create_mp_icon_ex(viewport)
  4652.       return if !MP_ICON_EX_VISIBLE
  4653.       @mp_icon3_anime_phase = 0
  4654.       @mp_icon3 = Sprite.new
  4655.       @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4656.       @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4657.       @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4658.       @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4659.       @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4660.                        @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4661.       @mp_icon3.x = @mp_icon3_org[0]
  4662.       @mp_icon3.y = @mp_icon3_org[1]
  4663.       @mp_icon3.viewport = viewport
  4664.       @mp_icon3.opacity = 0
  4665.   end   
  4666.  
  4667.   #--------------------------------------------------------------------------
  4668.   # * Refresh MP Icon EX
  4669.   #--------------------------------------------------------------------------      
  4670.   def refresh_mp_icon_ex(rx,ry)
  4671.       return if @mp_icon3 == nil
  4672.       @mp_icon3.bitmap.clear
  4673.       return if @actor.mp == 0
  4674.       i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4675.       @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4676.       @mp_icon3.x = @mp_icon3_org[0] + rx
  4677.       @mp_icon3.y = @mp_icon3_org[1] + ry     
  4678.   end
  4679.  
  4680.   #--------------------------------------------------------------------------
  4681.   # * Update Icon MP EX Anime
  4682.   #--------------------------------------------------------------------------  
  4683.   def update_icon_mp_ex_anime
  4684.       return if !MP_ICON_EX_ZOOM_EFFECT
  4685.       if @mp_icon3_anime_phase == 0
  4686.          @mp_icon3.zoom_x += 0.01
  4687.          if @mp_icon3.zoom_x >= 1.30
  4688.             @mp_icon3.zoom_x = 1.30
  4689.             @mp_icon3_anime_phase = 1
  4690.          end  
  4691.       else
  4692.         @mp_icon3.zoom_x -= 0.01
  4693.         if @mp_icon3.zoom_x <= 1.05
  4694.            @mp_icon3.zoom_x = 1.05
  4695.            @mp_icon3_anime_phase = 0
  4696.         end   
  4697.       end  
  4698.       @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4699.   end  
  4700.  
  4701.   #--------------------------------------------------------------------------
  4702.   # * Create MP Icon Number
  4703.   #--------------------------------------------------------------------------      
  4704.   def create_mp_icon_number(viewport)
  4705.       return if !MP_ICON_NUMBER_VISIBLE
  4706.       @mp_icon_number_old = [-1,-1]
  4707.       @mp_icon_number = Sprite.new
  4708.       @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4709.       @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4710.       @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4711.       @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4712.       @mp_icon_number.viewport = viewport
  4713.       @mp_icon_number.opacity = 0
  4714.   end
  4715.  
  4716.   #--------------------------------------------------------------------------
  4717.   # * Refresh Icon Number MP
  4718.   #--------------------------------------------------------------------------  
  4719.   def refresh_icon_number_mp
  4720.       @mp_icon_number_old[0] = @actor.mp
  4721.       @mp_icon_number_old[1] = @actor.mmp
  4722.       @mp_icon_number.bitmap.clear
  4723.       value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4724.       value = 0 if value < 0
  4725.       number_value = value.truncate.abs.to_s.split(//)
  4726.       for r in 0..number_value.size - 1         
  4727.          number_value_abs = number_value[r].to_i
  4728.          nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4729.          @mp_icon_number.bitmap.blt(@mp_icon_number_cw *  r, 0, @mp_icon_number_image, nsrc_rect)
  4730.       end
  4731.       cx = (number_value.size * @mp_icon_number_cw)
  4732.       case MP_ICON_NUMBER_ALIGN_TYPE
  4733.          when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4734.          when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4735.          when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4736.       end        
  4737.   end
  4738.  
  4739.   #--------------------------------------------------------------------------
  4740.   # * Can Refresh Icon Number MP
  4741.   #--------------------------------------------------------------------------  
  4742.   def can_refresh_icon_number_mp?
  4743.       return true if @mp_icon_number_old[0] != @actor.mp
  4744.       return true if @mp_icon_number_old[1] != @actor.mmp
  4745.       return false
  4746.   end   
  4747.  
  4748.   #--------------------------------------------------------------------------
  4749.   # * Update MP
  4750.   #--------------------------------------------------------------------------   
  4751.   def update_mp
  4752.       if @mp_number != nil
  4753.          sprite_visible(@mp_number)
  4754.          if MP_NUMBER_ANIMATION
  4755.             update_number(1,@mp_number_old)
  4756.          else
  4757.             update_number_fix(1) if @mp_number_old != @actor.mp
  4758.          end  
  4759.          refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4760.       end
  4761.       if @mp_number2 != nil
  4762.          sprite_visible(@mp_number2)
  4763.          if MP_NUMBER_ANIMATION
  4764.             update_number(4,@mp_number2_old)
  4765.          else
  4766.             update_number_fix(4) if @mp_number2_old != @actor.mmp
  4767.          end  
  4768.          refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4769.       end      
  4770.       if @mp_meter != nil
  4771.          sprite_visible(@mp_meter)
  4772.          update_flow_mp
  4773.       end
  4774.       if @mp_icon != nil
  4775.          sprite_visible(@mp_icon)
  4776.          refresh_mp_icon if @mp_icon_old != @actor.mp
  4777.       end
  4778.       if @mp_icon3 != nil
  4779.          sprite_visible(@mp_icon3)
  4780.          update_icon_mp_ex_anime
  4781.       end         
  4782.       if @mp_icon_number != nil
  4783.          sprite_visible(@mp_icon_number)
  4784.          refresh_icon_number_mp if can_refresh_icon_number_mp?
  4785.       end      
  4786.   end  
  4787.  
  4788. end
  4789.  
  4790. #==============================================================================
  4791. #==============================================================================
  4792. # ** Battle Hud EX
  4793. #==============================================================================
  4794. #==============================================================================
  4795. class Battle_Hud_EX
  4796.  
  4797.   #--------------------------------------------------------------------------
  4798.   # * Create TP Number
  4799.   #--------------------------------------------------------------------------  
  4800.   def create_tp_number(viewport)
  4801.       return if !TP_NUMBER_VISIBLE
  4802.       @tp_number = Sprite.new
  4803.       @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4804.       @tp_number.z = HUD_Z + TP_NUMBER_Z
  4805.       @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4806.       @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4807.       @tp_number.viewport = viewport
  4808.       @tp_number.opacity = 0
  4809.   end
  4810.  
  4811.   #--------------------------------------------------------------------------
  4812.   # * Create TP Number MAX
  4813.   #--------------------------------------------------------------------------  
  4814.   def create_tp_number_max(viewport)
  4815.       return if !TP_NUMBER_MAX_VISIBLE
  4816.       @tp_number2 = Sprite.new
  4817.       @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4818.       @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4819.       @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4820.       @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4821.       @tp_number2.viewport = viewport
  4822.       @tp_number2.opacity = 0
  4823.   end  
  4824.  
  4825.   #--------------------------------------------------------------------------
  4826.   # * Create TP Meter
  4827.   #--------------------------------------------------------------------------   
  4828.   def create_tp_meter(viewport)
  4829.       return if !TP_METER_VISIBLE
  4830.       @tp_flow_max = @tp_meter_cw * 2
  4831.       @tp_flow = rand(@tp_flow_max)
  4832.       @tp_meter = Sprite.new
  4833.       @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4834.       @tp_meter.z = HUD_Z + TP_METER_Z
  4835.       @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4836.       @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4837.       @tp_meter.angle = TP_METER_ANGLE
  4838.       @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4839.       @tp_meter.viewport = viewport
  4840.       @tp_meter.opacity = 0
  4841.   end
  4842.  
  4843.   #--------------------------------------------------------------------------
  4844.   # ● Update Flow TP
  4845.   #--------------------------------------------------------------------------            
  4846.   def update_flow_tp
  4847.       @tp_meter.bitmap.clear      
  4848.       @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4849.       meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil  
  4850.       meter_width = 0 if meter_width == nil
  4851.       execute_tp_damage_flow(meter_width)      
  4852.       meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4853.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)  
  4854.       @tp_flow += 1
  4855.       @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4856.   end  
  4857.  
  4858.   #--------------------------------------------------------------------------
  4859.   # ● Execute TP Damage Flow
  4860.   #--------------------------------------------------------------------------
  4861.   def execute_tp_damage_flow(meter_width)
  4862.       return if !TP_METER_REDUCTION_ANIMATION
  4863.       return if @tp_old_meter == meter_width
  4864.       n = (@tp_old_meter - meter_width).abs * 3 / 100
  4865.       damage_flow = [[n, 2].min,0.5].max
  4866.       @tp_old_meter -= damage_flow
  4867.       @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4868.       src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4869.       @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)      
  4870.   end
  4871.  
  4872.   #--------------------------------------------------------------------------
  4873.   # * Create TP Icon
  4874.   #--------------------------------------------------------------------------  
  4875.   def create_tp_icon(viewport)
  4876.       return if !TP_ICON_VISIBLE
  4877.       @tp_icon = Sprite.new
  4878.       icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4879.       icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4880.       @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)      
  4881.       @tp_icon.z = HUD_Z + TP_ICON_Z
  4882.       @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4883.       @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4884.       @tp_icon.viewport = viewport
  4885.       @tp_icon.opacity = 0
  4886.   end
  4887.  
  4888.   #--------------------------------------------------------------------------
  4889.   # * Refresh TP Icon
  4890.   #--------------------------------------------------------------------------   
  4891.   def refresh_tp_icon
  4892.       @tp_icon_old = @actor.tp
  4893.       @tp_icon.bitmap.clear
  4894.       max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4895.       if @actor.mp > max_value
  4896.          icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4897.       else   
  4898.          icon_max = @actor.max_tp
  4899.       end      
  4900.       for i in 0...icon_max
  4901.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4902.           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)
  4903.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4904.           i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4905.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )      
  4906.       end      
  4907.       icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4908.       rx = 0
  4909.       ry = 0
  4910.       for i in 0...icon_max
  4911.           break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4912.           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)
  4913.           ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4914.           i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4915.           @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4916.       end
  4917.       refresh_tp_icon_ex(rx,ry)      
  4918.   end
  4919.  
  4920.   #--------------------------------------------------------------------------
  4921.   # * Create TP Icon EX
  4922.   #--------------------------------------------------------------------------  
  4923.   def create_tp_icon_ex(viewport)
  4924.       return if !TP_ICON_EX_VISIBLE
  4925.       @tp_icon3_anime_phase = 0
  4926.       @tp_icon3 = Sprite.new
  4927.       @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4928.       @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4929.       @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4930.       @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4931.       @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4932.                        @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4933.       @tp_icon3.x = @tp_icon3_org[0]
  4934.       @tp_icon3.y = @tp_icon3_org[1]
  4935.       @tp_icon3.viewport = viewport
  4936.       @tp_icon3.opacity = 0
  4937.   end   
  4938.  
  4939.   #--------------------------------------------------------------------------
  4940.   # * Refresh TP Icon EX
  4941.   #--------------------------------------------------------------------------      
  4942.   def refresh_tp_icon_ex(rx,ry)
  4943.       return if @tp_icon3 == nil
  4944.       @tp_icon3.bitmap.clear
  4945.       return if @actor.tp == 0
  4946.       i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4947.       @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4948.       @tp_icon3.x = @tp_icon3_org[0] + rx
  4949.       @tp_icon3.y = @tp_icon3_org[1] + ry     
  4950.   end
  4951.  
  4952.   #--------------------------------------------------------------------------
  4953.   # * Update Icon TP EX Anime
  4954.   #--------------------------------------------------------------------------  
  4955.   def update_icon_tp_ex_anime
  4956.       return if !MP_ICON_EX_ZOOM_EFFECT
  4957.       if @tp_icon3_anime_phase == 0
  4958.          @tp_icon3.zoom_x += 0.01
  4959.          if @tp_icon3.zoom_x >= 1.30
  4960.             @tp_icon3.zoom_x = 1.30
  4961.             @tp_icon3_anime_phase = 1
  4962.          end  
  4963.       else
  4964.         @tp_icon3.zoom_x -= 0.01
  4965.         if @tp_icon3.zoom_x <= 1.05
  4966.            @tp_icon3.zoom_x = 1.05
  4967.            @tp_icon3_anime_phase = 0
  4968.         end   
  4969.       end  
  4970.       @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4971.   end   
  4972.  
  4973.   #--------------------------------------------------------------------------
  4974.   # * Create HP Icon Number
  4975.   #--------------------------------------------------------------------------      
  4976.   def create_tp_icon_number(viewport)
  4977.       return if !TP_ICON_NUMBER_VISIBLE
  4978.       @tp_icon_number_old = [-1,-1]
  4979.       @tp_icon_number = Sprite.new
  4980.       @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  4981.       @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  4982.       @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  4983.       @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  4984.       @tp_icon_number.viewport = viewport
  4985.       @tp_icon_number.opacity = 0
  4986.   end
  4987.  
  4988.   #--------------------------------------------------------------------------
  4989.   # * Refresh Icon Number TP
  4990.   #--------------------------------------------------------------------------  
  4991.   def refresh_icon_number_tp
  4992.       @tp_icon_number_old[0] = @actor.tp
  4993.       @tp_icon_number_old[1] = @actor.max_tp
  4994.       @tp_icon_number.bitmap.clear
  4995.       value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  4996.       value = 0 if value < 0
  4997.       number_value = value.truncate.abs.to_s.split(//)
  4998.       for r in 0..number_value.size - 1         
  4999.          number_value_abs = number_value[r].to_i
  5000.          nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  5001.          @tp_icon_number.bitmap.blt(@tp_icon_number_cw *  r, 0, @tp_icon_number_image, nsrc_rect)
  5002.       end
  5003.       cx = (number_value.size * @tp_icon_number_cw)
  5004.       case TP_ICON_NUMBER_ALIGN_TYPE
  5005.          when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5006.          when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  5007.          when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  5008.       end        
  5009.   end
  5010.  
  5011.   #--------------------------------------------------------------------------
  5012.   # * Can Refresh Icon Number TP
  5013.   #--------------------------------------------------------------------------  
  5014.   def can_refresh_icon_number_tp?
  5015.       return true if @tp_icon_number_old[0] != @actor.tp
  5016.       return true if @tp_icon_number_old[1] != @actor.max_tp
  5017.       return false
  5018.   end   
  5019.  
  5020.   #--------------------------------------------------------------------------
  5021.   # * Update TP
  5022.   #--------------------------------------------------------------------------   
  5023.   def update_tp
  5024.       if @tp_number != nil
  5025.          sprite_visible(@tp_number)
  5026.          if MP_NUMBER_ANIMATION
  5027.             update_number(2,@tp_number_old)
  5028.          else
  5029.             update_number_fix(2) if @tp_number_old != @actor.tp
  5030.          end           
  5031.          refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh         
  5032.       end   
  5033.       if @tp_number2 != nil
  5034.          sprite_visible(@tp_number2)
  5035.          if MP_NUMBER_ANIMATION
  5036.             update_number(5,@tp_number2_old)
  5037.          else
  5038.             update_number_fix(5) if @tp_number2_old != @actor.max_tp
  5039.          end           
  5040.          refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  5041.       end        
  5042.       if @tp_meter != nil
  5043.          sprite_visible(@tp_meter)
  5044.          update_flow_tp
  5045.       end
  5046.       if @tp_icon != nil
  5047.          sprite_visible(@tp_icon)
  5048.          refresh_tp_icon if @tp_icon_old != @actor.tp
  5049.       end
  5050.       if @tp_icon3 != nil
  5051.          sprite_visible(@tp_icon3)
  5052.          update_icon_tp_ex_anime
  5053.       end         
  5054.       if @tp_icon_number != nil
  5055.          sprite_visible(@tp_icon_number)
  5056.          refresh_icon_number_tp if can_refresh_icon_number_tp?
  5057.       end  
  5058.   end  
  5059.  
  5060. end
  5061.  
  5062. #==============================================================================
  5063. #==============================================================================
  5064. # ** Battle Hud EX
  5065. #==============================================================================
  5066. #==============================================================================
  5067. class Battle_Hud_EX
  5068.  
  5069.   #--------------------------------------------------------------------------
  5070.   # * Create AT Number
  5071.   #--------------------------------------------------------------------------  
  5072.   def create_at_number(viewport)
  5073.       return if !AT_NUMBER_VISIBLE
  5074.       @at_number = Sprite.new
  5075.       @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  5076.       @at_number.z = HUD_Z + AT_NUMBER_Z
  5077.       @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  5078.       @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  5079.       @at_number.viewport = viewport
  5080.       @at_number.opacity = 0
  5081.   end
  5082.  
  5083.   #--------------------------------------------------------------------------
  5084.   # * Create AT Number Max
  5085.   #--------------------------------------------------------------------------  
  5086.   def create_at_number_max(viewport)
  5087.       return if !AT_NUMBER_MAX_VISIBLE
  5088.       @at_number2 = Sprite.new
  5089.       @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  5090.       @at_number2.z = HUD_Z + AT_NUMBER_Z
  5091.       @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  5092.       @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  5093.       @at_number2.viewport = viewport
  5094.       @at_number2.opacity = 0
  5095.   end  
  5096.  
  5097.   #--------------------------------------------------------------------------
  5098.   # * Create AT Meter
  5099.   #--------------------------------------------------------------------------   
  5100.   def create_at_meter(viewport)
  5101.       return if !AT_METER_VISIBLE
  5102.       @at_flow_max = @at_meter_cw * 2
  5103.       @at_flow = rand(@at_flow_max)
  5104.       @at_meter = Sprite.new
  5105.       @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  5106.       @at_meter.z = HUD_Z + AT_METER_Z
  5107.       @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  5108.       @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  5109.       @at_meter.angle = AT_METER_ANGLE
  5110.       @at_meter.mirror = AT_METER_MIRROR_EFFECT
  5111.       @at_meter.viewport = viewport
  5112.       @at_meter.opacity = 0
  5113.   end
  5114.  
  5115.   #--------------------------------------------------------------------------
  5116.   # ● Update Flow AT
  5117.   #--------------------------------------------------------------------------            
  5118.   def update_flow_at
  5119.       @at_meter.bitmap.clear
  5120.       @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  5121.       if actor_cast?
  5122.          meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  5123.          meter_width = 0 if meter_width == nil
  5124.          ch = @at_meter_ch * 2
  5125.       else
  5126.          meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  5127.          meter_width = 0 if meter_width == nil         
  5128.          ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  5129.       end   
  5130.       meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  5131.       @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)  
  5132.       @at_flow += 1
  5133.       @at_flow = 0 if @at_flow >= @at_flow_max
  5134.   end  
  5135.  
  5136.   #--------------------------------------------------------------------------
  5137.   # * Update AT
  5138.   #--------------------------------------------------------------------------   
  5139.   def update_at
  5140.       if @at_number != nil
  5141.          sprite_visible(@at_number)
  5142.          if AT_NUMBER_ANIMATION
  5143.             update_number(6,@at_number_old)
  5144.          else   
  5145.             update_number_fix(6) if @at_number_old != actor_at
  5146.          end  
  5147.          refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5148.       end
  5149.       if @at_number2 != nil
  5150.          sprite_visible(@at_number2)
  5151.          if AT_NUMBER_ANIMATION
  5152.             update_number(7,@at_number2_old)
  5153.          else   
  5154.             update_number_fix(7) if @at_number2_old != actor_max_at
  5155.          end  
  5156.          refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5157.       end
  5158.       if @at_meter != nil
  5159.          sprite_visible(@at_meter)
  5160.          update_flow_at
  5161.       end   
  5162.   end  
  5163.  
  5164. end
  5165.  
  5166. #==============================================================================
  5167. #==============================================================================
  5168. # ** Battle Hud EX
  5169. #==============================================================================
  5170. #==============================================================================
  5171. class Battle_Hud_EX
  5172.  
  5173.   #--------------------------------------------------------------------------
  5174.   # * Create Level Number
  5175.   #--------------------------------------------------------------------------   
  5176.   def create_level_number(viewport)
  5177.       return if !LEVEL_NUMBER_VISIBLE
  5178.       @old_level = -1
  5179.       @lv_number = Sprite.new
  5180.       @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5181.       @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5182.       @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5183.       @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5184.       @lv_number.viewport = viewport
  5185.       @lv_number.opacity = 0
  5186.   end
  5187.  
  5188.   #--------------------------------------------------------------------------
  5189.   # * Refresh Level Number
  5190.   #--------------------------------------------------------------------------  
  5191.   def refresh_level_number
  5192.       @lv_number.bitmap.clear
  5193.       @old_level = @actor.level      
  5194.       number_value = @actor.level.abs.to_s.split(//)
  5195.       for r in 0..number_value.size - 1         
  5196.          number_value_abs = number_value[r].to_i
  5197.          nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5198.          @lv_number.bitmap.blt(@lv_number_cw *  r, 0, @lv_number_image, nsrc_rect)
  5199.       end
  5200.       cx = (number_value.size * @lv_number_cw)
  5201.       case LEVEL_NUMBER_ALIGN_TYPE
  5202.            when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5203.            when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5204.            when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5205.       end
  5206.   end
  5207.  
  5208.   #--------------------------------------------------------------------------
  5209.   # * Update Level
  5210.   #--------------------------------------------------------------------------  
  5211.   def update_level
  5212.       return if @lv_number == nil
  5213.       sprite_visible(@lv_number)
  5214.       refresh_level_number if @old_level != @actor.level
  5215.   end
  5216.  
  5217. end
  5218.  
  5219. #==============================================================================
  5220. #==============================================================================
  5221. # ** Battle Hud EX
  5222. #==============================================================================
  5223. #==============================================================================
  5224. class Battle_Hud_EX
  5225.  
  5226.   #--------------------------------------------------------------------------
  5227.   # * Create States
  5228.   #--------------------------------------------------------------------------  
  5229.   def create_states(viewport)
  5230.       return if !STATES_VISIBLE
  5231.       @status_old = nil
  5232.       @status_flow = [-24,0]
  5233.       @status_size_real = 0
  5234.       @status = Sprite.new
  5235.       @status.bitmap = Bitmap.new(24,24)
  5236.       @status.x = @hud_position[0] + STATES_POSITION[0]
  5237.       @status.y = @hud_position[1] + STATES_POSITION[1]
  5238.       @status.z = HUD_Z + STATES_Z
  5239.       @status.angle = STATE_ANGLE
  5240.       @status.viewport = viewport
  5241.       @status.opacity = 0
  5242.   end
  5243.  
  5244.   #--------------------------------------------------------------------------
  5245.   # * Refresh States
  5246.   #--------------------------------------------------------------------------        
  5247.   def refresh_states
  5248.       check_icon_image
  5249.       @status_size_real = set_real_states_size
  5250.       @status_old = @actor.states
  5251.       @status_flow = [0,0]
  5252.       @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5253.       @actor_status.dispose if @actor_status != nil
  5254.       @actor_status = Bitmap.new(@states_size,24)
  5255.       index = 0
  5256.       for i in @actor.states
  5257.          next if HIDE_STATES_ID.include?(i.id)         
  5258.          rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5259.          @actor_status.blt(26 * index , 0, @icon_image, rect)
  5260.          index += 1
  5261.       end
  5262.   end   
  5263.  
  5264.   #--------------------------------------------------------------------------
  5265.   # * Set Real States Size
  5266.   #--------------------------------------------------------------------------        
  5267.   def set_real_states_size
  5268.       n = 0
  5269.       for i in @actor.states
  5270.           next if HIDE_STATES_ID.include?(i.id)  
  5271.           n += 1
  5272.       end
  5273.       return n
  5274.   end
  5275.  
  5276.   #--------------------------------------------------------------------------
  5277.   # * Flow_Status
  5278.   #--------------------------------------------------------------------------         
  5279.   def flow_states
  5280.       return if @actor_status == nil
  5281.       @status.bitmap.clear
  5282.       return if @actor.states.size == 0
  5283.       st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5284.       @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5285.       if STATES_SCROLLING_ANIMATION
  5286.          @status_flow[0] += 1
  5287.          @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5288.       else   
  5289.          @status_flow[1] += 1 unless @actor.states.size <= 1
  5290.          if @status_flow[1] > 30
  5291.             @status_flow[1] = 0
  5292.             @status_flow[0] += 26
  5293.             @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5294.          end   
  5295.      end   
  5296.   end      
  5297.  
  5298.   #--------------------------------------------------------------------------
  5299.   # * Update States
  5300.   #--------------------------------------------------------------------------  
  5301.   def update_states
  5302.       return if @status == nil
  5303.       sprite_visible(@status)
  5304.       refresh_states if @status_old != @actor.states
  5305.       flow_states
  5306.   end  
  5307.  
  5308. end
  5309.  
  5310. #==============================================================================
  5311. #==============================================================================
  5312. # ** Battle Hud EX
  5313. #==============================================================================
  5314. #==============================================================================
  5315. class Battle_Hud_EX
  5316.  
  5317.   #--------------------------------------------------------------------------
  5318.   # * Create Face
  5319.   #--------------------------------------------------------------------------   
  5320.   def create_face(viewport)
  5321.       return if !FACE_VISIBLE
  5322.       @face_old_hp = @actor.hp
  5323.       @face_old_mp = @actor.mp
  5324.       @face_old_tp = @actor.tp
  5325.       @face_name = ""
  5326.       @face = Sprite.new
  5327.       @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5328.       @face.x = @face_org[0]
  5329.       @face.y = @face_org[1]
  5330.       @face.z = HUD_Z + FACE_Z
  5331.       @face.viewport = viewport
  5332.       @face.opacity = 0
  5333.       refresh_face_name
  5334.   end
  5335.  
  5336.   #--------------------------------------------------------------------------
  5337.   # * Refresh Face Name
  5338.   #--------------------------------------------------------------------------      
  5339.   def refresh_face_name      
  5340.       @face_image.dispose if @face_image != nil
  5341.       @face.bitmap.dispose if @face.bitmap != nil
  5342.       return if @actor == nil or @actor.id == nil
  5343.       @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5344.       @face_image = Bitmap.new(32,32) if @face_image == nil
  5345.       @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5346.       @face_ch = @face_image.height
  5347.       @face.ox = @face_cw / 2
  5348.       @face.oy = @face_ch / 2      
  5349.       @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5350.       @face_org = [@hud_position[0] + FACE_POSITION[0],
  5351.                    @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5352.       if $game_temp.battler_face_pos[@actor_index] == nil
  5353.          $game_temp.battler_face_pos[@actor_index] = []
  5354.       end
  5355.       @face.x = @face_org[0]
  5356.       @face.y = @face_org[1]  
  5357.       limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5358.       fy = @face_org[1]
  5359.       if limit_Y > Graphics.height
  5360.          @face.y = Graphics.height - (@face_image.height - @face.oy)
  5361.          fy = Graphics.height - 16
  5362.          @face_org[1] = @face.y
  5363.       end
  5364.       $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5365.       $game_temp.battler_face_pos[@actor_index][1] = fy
  5366.       $game_temp.battler_face_pos[@actor_index][2] = @face.z     
  5367.       clear_face_index
  5368.   end
  5369.  
  5370.   #--------------------------------------------------------------------------
  5371.   # * Refresh Face
  5372.   #--------------------------------------------------------------------------  
  5373.   def refresh_face
  5374.       @face.mirror = false
  5375.       @face.zoom_x = 1.00
  5376.       @face.zoom_y = 1.00
  5377.       @face_index = @actor.face_animation[1]
  5378.       @face.bitmap.clear
  5379.       if !FACE_ANIMATION
  5380.          f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5381.       else
  5382.          f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5383.       end
  5384.       @face.bitmap.blt(0,0,@face_image,f_scr)
  5385.   end
  5386.  
  5387.   #--------------------------------------------------------------------------
  5388.   # * Update Face Duration
  5389.   #--------------------------------------------------------------------------   
  5390.   def update_face_duration
  5391.       return if @actor.face_animation[0] == 0
  5392.       @actor.face_animation[0] -= 1
  5393.       update_face_shake_effect
  5394.       update_face_zoom if @actor.face_animation[1] == 2
  5395.       return if @actor.face_animation[0] > 0
  5396.       clear_face_index
  5397.   end
  5398.  
  5399.   #--------------------------------------------------------------------------
  5400.   # * Clear Face Index
  5401.   #--------------------------------------------------------------------------      
  5402.   def clear_face_index
  5403.       @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5404.       @actor.face_animation[1] = 4 if @actor.dead?
  5405.       refresh_face
  5406.   end
  5407.  
  5408.   #--------------------------------------------------------------------------
  5409.   # * Update Face Zoom
  5410.   #--------------------------------------------------------------------------      
  5411.   def update_face_zoom
  5412.       return if !FACE_ZOOM_ANIMATION
  5413.       case @actor.face_animation[0]
  5414.          when 30..60
  5415.             @face.zoom_x += 0.01
  5416.             @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5417.             @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5418.          when 1..29
  5419.             @face.zoom_x -= 0.01
  5420.             @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5421.             @face.mirror = false
  5422.          else
  5423.             @face.zoom_x = 1.00
  5424.             @face.mirror = false
  5425.       end
  5426.       @face.zoom_y = @face.zoom_x
  5427.   end
  5428.  
  5429.   #--------------------------------------------------------------------------
  5430.   # * Can Refresh Index MP TP?
  5431.   #--------------------------------------------------------------------------     
  5432.   def can_refresh_index_mp_tp?
  5433.       return true if @face_old_mp != @actor.mp
  5434.       return false
  5435.   end
  5436.  
  5437.   #--------------------------------------------------------------------------
  5438.   # * Refresh Face Index HP
  5439.   #--------------------------------------------------------------------------  
  5440.   def refresh_face_index_hp
  5441.       @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5442.       @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5443.       @face_old_hp = @actor.hp
  5444.   end
  5445.  
  5446.   #--------------------------------------------------------------------------
  5447.   # * Refresh Face Index MP TP
  5448.   #--------------------------------------------------------------------------  
  5449.   def refresh_face_index_mp_tp
  5450.       if @face_old_mp < @actor.mp
  5451.          @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5452.          @actor.face_animation[1] = 1
  5453.       end
  5454.       @face_old_mp = @actor.mp
  5455.       @face_old_tp = @actor.tp
  5456.   end  
  5457.  
  5458.   #--------------------------------------------------------------------------
  5459.   # * Update Face Shake Effect
  5460.   #--------------------------------------------------------------------------  
  5461.   def update_face_shake_effect
  5462.       return if !FACE_SHAKE_EFFECT
  5463.       if FACE_ANIMATION
  5464.          update_shake_animated_face
  5465.       else            
  5466.          update_shake_still_face
  5467.       end  
  5468.   end      
  5469.  
  5470.   #--------------------------------------------------------------------------
  5471.   # * Update Shake Still Effect Face
  5472.   #--------------------------------------------------------------------------   
  5473.   def update_shake_still_face
  5474.       if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5475.          @face.x = @face_org[0] - 4 + rand(8)
  5476.       else
  5477.          @face.x = @face_org[0]
  5478.       end     
  5479.   end
  5480.  
  5481.   #--------------------------------------------------------------------------
  5482.   # * Update Shake Animated Face
  5483.   #--------------------------------------------------------------------------   
  5484.   def update_shake_animated_face
  5485.       if @actor.face_animation[0] == 0
  5486.          @face.x = @face_org[0]
  5487.          return
  5488.       end
  5489.       if @actor.face_animation[1] == 3 and @actor.hp > 0
  5490.          @face.x = @face_org[0] - 4 + rand(8)
  5491.       else
  5492.          @face.x = @face_org[0]
  5493.       end         
  5494.   end
  5495.  
  5496.   #--------------------------------------------------------------------------
  5497.   # * Update Face
  5498.   #--------------------------------------------------------------------------   
  5499.   def update_face
  5500.       return if @face == nil
  5501.       sprite_visible(@face)
  5502.       refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5503.       update_face_duration
  5504.       return if !FACE_ANIMATION
  5505.       refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5506.       refresh_face_index_hp if @face_old_hp != @actor.hp
  5507.       refresh_face if @face_index != @actor.face_animation[1]
  5508.   end  
  5509.  
  5510. end
  5511.  
  5512. #==============================================================================
  5513. # ■ Battle Manager
  5514. #==============================================================================
  5515. class << BattleManager
  5516.  
  5517.   #--------------------------------------------------------------------------
  5518.   # ● Battle End
  5519.   #--------------------------------------------------------------------------                    
  5520.   alias mog_battle_hud_battle_process_victory process_victory
  5521.   def process_victory
  5522.       execute_face_effect_end
  5523.       mog_battle_hud_battle_process_victory
  5524.   end
  5525.  
  5526.   #--------------------------------------------------------------------------
  5527.   # ● Execute Face Effect End
  5528.   #--------------------------------------------------------------------------                  
  5529.   def execute_face_effect_end
  5530.       $game_temp.battle_end = true
  5531.       for i in $game_party.members
  5532.           i.face_animation = [120,1,0] if i.hp > 0   
  5533.       end  
  5534.   end
  5535.  
  5536.   #--------------------------------------------------------------------------
  5537.   # * Display EXP Earned
  5538.   #--------------------------------------------------------------------------
  5539.   alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5540.   def process_defeat
  5541.       $game_temp.battle_end = true
  5542.       mog_battle_hud_ex_message_battle_process_defeat
  5543.   end
  5544.  
  5545.   #--------------------------------------------------------------------------
  5546.   # * Process Abort
  5547.   #--------------------------------------------------------------------------
  5548.   alias mog_battle_hud_ex_process_abort process_abort
  5549.   def process_abort
  5550.       $game_temp.battle_end = true
  5551.       mog_battle_hud_ex_process_abort
  5552.   end  
  5553.  
  5554. end
  5555.  
  5556. #==============================================================================
  5557. # ** Scene Battle
  5558. #==============================================================================
  5559. class Scene_Battle < Scene_Base
  5560.  
  5561.   #--------------------------------------------------------------------------
  5562.   # * Use Item
  5563.   #--------------------------------------------------------------------------      
  5564.   alias mog_monogatari_use_item use_item
  5565.   def use_item
  5566.       execute_face_animation
  5567.       mog_monogatari_use_item
  5568.   end
  5569.  
  5570.   #--------------------------------------------------------------------------
  5571.   # * Execute Face Animation
  5572.   #--------------------------------------------------------------------------  
  5573.   def execute_face_animation
  5574.       return if @subject.is_a?(Game_Enemy)
  5575.       @subject.face_animation = [60 ,2,0]   
  5576.   end
  5577.  
  5578. end
  5579.  
  5580. #==============================================================================
  5581. #==============================================================================
  5582. # ** Battle Hud EX
  5583. #==============================================================================
  5584. #==============================================================================
  5585. class Battle_Hud_EX
  5586.  
  5587.   #--------------------------------------------------------------------------
  5588.   # * Dispose
  5589.   #--------------------------------------------------------------------------  
  5590.   def dispose
  5591.       terminate
  5592.       dispose_layout
  5593.       dispose_layout_2
  5594.       dispose_name
  5595.       dispose_face
  5596.       dispose_hp_number
  5597.       dispose_hp_number_max
  5598.       dispose_hp_meter
  5599.       dispose_hp_icon
  5600.       dispose_hp_icon_ex
  5601.       dispose_hp_icon_number
  5602.       dispose_mp_number
  5603.       dispose_mp_number_max
  5604.       dispose_mp_meter
  5605.       dispose_mp_icon
  5606.       dispose_mp_icon_ex
  5607.       dispose_mp_icon_number
  5608.       dispose_tp_number
  5609.       dispose_tp_number_max
  5610.       dispose_tp_meter
  5611.       dispose_tp_icon
  5612.       dispose_tp_icon_ex
  5613.       dispose_tp_icon_number
  5614.       dispose_at_number
  5615.       dispose_at_number_max
  5616.       dispose_at_meter      
  5617.       dispose_lv_number
  5618.       dispose_states
  5619.   end
  5620.  
  5621.   #--------------------------------------------------------------------------
  5622.   # * Dispose Layout
  5623.   #--------------------------------------------------------------------------  
  5624.   def dispose_layout
  5625.       return if @layout == nil
  5626.       @layout.dispose
  5627.       @layout = nil
  5628.   end
  5629.  
  5630.   #--------------------------------------------------------------------------
  5631.   # * Dispose Layout 2
  5632.   #--------------------------------------------------------------------------  
  5633.   def dispose_layout_2
  5634.       return if @layout2 == nil
  5635.       @layout2.dispose
  5636.       @layout2 = nil
  5637.   end  
  5638.  
  5639.   #--------------------------------------------------------------------------
  5640.   # * Dispose Name
  5641.   #--------------------------------------------------------------------------         
  5642.   def dispose_name
  5643.       return if @name == nil
  5644.       @name.bitmap.dispose
  5645.       @name.dispose
  5646.       @name = nil
  5647.   end  
  5648.  
  5649.   #--------------------------------------------------------------------------
  5650.   # * Dispose Face
  5651.   #--------------------------------------------------------------------------        
  5652.   def dispose_face
  5653.       return if @face == nil      
  5654.       @face.bitmap.dispose if @face.bitmap != nil   
  5655.       @face.dispose
  5656.       @face = nil
  5657.       @face_image.dispose if @face_image != nil
  5658.   end  
  5659.  
  5660.   #--------------------------------------------------------------------------
  5661.   # * Dispose HP Number
  5662.   #--------------------------------------------------------------------------   
  5663.   def dispose_hp_number
  5664.       return if @hp_number == nil
  5665.       @hp_number.bitmap.dispose
  5666.       @hp_number.dispose
  5667.       @hp_number = nil
  5668.   end
  5669.  
  5670.   #--------------------------------------------------------------------------
  5671.   # * Dispose HP Number Max
  5672.   #--------------------------------------------------------------------------   
  5673.   def dispose_hp_number_max
  5674.       return if @hp_number2 == nil
  5675.       @hp_number2.bitmap.dispose
  5676.       @hp_number2.dispose
  5677.       @hp_number2 = nil
  5678.   end   
  5679.  
  5680.   #--------------------------------------------------------------------------
  5681.   # * Dispose HP Meter
  5682.   #--------------------------------------------------------------------------     
  5683.   def dispose_hp_meter
  5684.       return if @hp_meter == nil
  5685.       @hp_meter.bitmap.dispose
  5686.       @hp_meter.dispose
  5687.       @hp_meter = nil
  5688.   end   
  5689.  
  5690.   #--------------------------------------------------------------------------
  5691.   # * Dispose HP Icon
  5692.   #--------------------------------------------------------------------------      
  5693.   def dispose_hp_icon
  5694.       return if @hp_icon == nil
  5695.       @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5696.       @hp_icon.dispose
  5697.       @hp_icon = nil
  5698.   end   
  5699.  
  5700.   #--------------------------------------------------------------------------
  5701.   # * Dispose HP Icon EX
  5702.   #--------------------------------------------------------------------------      
  5703.   def dispose_hp_icon_ex
  5704.       return if @hp_icon3 == nil
  5705.       @hp_icon3.bitmap.dispose
  5706.       @hp_icon3.dispose
  5707.       @hp_icon3 = nil
  5708.   end      
  5709.  
  5710.   #--------------------------------------------------------------------------
  5711.   # * Dispose HP Icon Number
  5712.   #--------------------------------------------------------------------------  
  5713.   def dispose_hp_icon_number
  5714.       return if @hp_icon_number == nil
  5715.       @hp_icon_number.bitmap.dispose
  5716.       @hp_icon_number.dispose
  5717.       @hp_icon_number = nil
  5718.   end   
  5719.  
  5720.   #--------------------------------------------------------------------------
  5721.   # * Dispose MP Number
  5722.   #--------------------------------------------------------------------------   
  5723.   def dispose_mp_number
  5724.       return if @mp_number == nil
  5725.       @mp_number.bitmap.dispose
  5726.       @mp_number.dispose
  5727.       @mp_number = nil
  5728.   end   
  5729.  
  5730.   #--------------------------------------------------------------------------
  5731.   # * Dispose MP Number Max
  5732.   #--------------------------------------------------------------------------   
  5733.   def dispose_mp_number_max
  5734.       return if @mp_number2 == nil
  5735.       @mp_number2.bitmap.dispose
  5736.       @mp_number2.dispose
  5737.       @mp_number2 = nil
  5738.   end   
  5739.  
  5740.   #--------------------------------------------------------------------------
  5741.   # * Dispose MP Meter
  5742.   #--------------------------------------------------------------------------     
  5743.   def dispose_mp_meter
  5744.       return if @mp_meter == nil
  5745.       @mp_meter.bitmap.dispose
  5746.       @mp_meter.dispose
  5747.       @mp_meter = nil
  5748.   end     
  5749.  
  5750.   #--------------------------------------------------------------------------
  5751.   # * Dispose MP Icon
  5752.   #--------------------------------------------------------------------------      
  5753.   def dispose_mp_icon
  5754.       return if @mp_icon == nil
  5755.       @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5756.       @mp_icon.dispose
  5757.       @mp_icon = nil
  5758.   end     
  5759.  
  5760.   #--------------------------------------------------------------------------
  5761.   # * Dispose MP Icon EX
  5762.   #--------------------------------------------------------------------------      
  5763.   def dispose_mp_icon_ex
  5764.       return if @mp_icon3 == nil
  5765.       @mp_icon3.bitmap.dispose
  5766.       @mp_icon3.dispose
  5767.       @mp_icon3 = nil
  5768.   end        
  5769.  
  5770.   #--------------------------------------------------------------------------
  5771.   # * Dispose MP Icon Number
  5772.   #--------------------------------------------------------------------------  
  5773.   def dispose_mp_icon_number
  5774.       return if @mp_icon_number == nil
  5775.       @mp_icon_number.bitmap.dispose
  5776.       @mp_icon_number.dispose
  5777.       @mp_icon_number = nil
  5778.   end   
  5779.  
  5780.   #--------------------------------------------------------------------------
  5781.   # * Dispose TP Number
  5782.   #--------------------------------------------------------------------------   
  5783.   def dispose_tp_number
  5784.       return if @tp_number == nil
  5785.       @tp_number.bitmap.dispose
  5786.       @tp_number.dispose
  5787.       @tp_number = nil
  5788.   end
  5789.  
  5790.   #--------------------------------------------------------------------------
  5791.   # * Dispose TP Number Max
  5792.   #--------------------------------------------------------------------------   
  5793.   def dispose_tp_number_max
  5794.       return if @tp_number2 == nil
  5795.       @tp_number2.bitmap.dispose
  5796.       @tp_number2.dispose
  5797.       @tp_number2 = nil
  5798.   end  
  5799.  
  5800.   #--------------------------------------------------------------------------
  5801.   # * Dispose TP Meter
  5802.   #--------------------------------------------------------------------------     
  5803.   def dispose_tp_meter
  5804.       return if @tp_meter == nil
  5805.       @tp_meter.bitmap.dispose
  5806.       @tp_meter.dispose
  5807.       @tp_meter = nil
  5808.   end     
  5809.  
  5810.   #--------------------------------------------------------------------------
  5811.   # * Dispose TP Icon
  5812.   #--------------------------------------------------------------------------      
  5813.   def dispose_tp_icon
  5814.       return if @tp_icon == nil
  5815.       @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5816.       @tp_icon.dispose
  5817.       @tp_icon = nil
  5818.   end   
  5819.  
  5820.   #--------------------------------------------------------------------------
  5821.   # * Dispose TP Icon EX
  5822.   #--------------------------------------------------------------------------      
  5823.   def dispose_tp_icon_ex
  5824.       return if @tp_icon3 == nil
  5825.       @tp_icon3.bitmap.dispose
  5826.       @tp_icon3.dispose
  5827.       @tp_icon3 = nil
  5828.   end   
  5829.  
  5830.   #--------------------------------------------------------------------------
  5831.   # * Dispose TP Icon Number
  5832.   #--------------------------------------------------------------------------  
  5833.   def dispose_tp_icon_number
  5834.       return if @tp_icon_number == nil
  5835.       @tp_icon_number.bitmap.dispose
  5836.       @tp_icon_number.dispose
  5837.       @tp_icon_numbe = nil
  5838.   end     
  5839.  
  5840.   #--------------------------------------------------------------------------
  5841.   # * Dispose AT Number
  5842.   #--------------------------------------------------------------------------   
  5843.   def dispose_at_number
  5844.       return if @at_number == nil
  5845.       @at_number.bitmap.dispose
  5846.       @at_number.dispose
  5847.       @at_number = nil
  5848.   end
  5849.  
  5850.   #--------------------------------------------------------------------------
  5851.   # * Dispose AT Number Max
  5852.   #--------------------------------------------------------------------------   
  5853.   def dispose_at_number_max
  5854.       return if @at_number2 == nil
  5855.       @at_number2.bitmap.dispose
  5856.       @at_number2.dispose
  5857.       @at_number2 = nil
  5858.   end   
  5859.  
  5860.   #--------------------------------------------------------------------------
  5861.   # * Dispose AT Meter
  5862.   #--------------------------------------------------------------------------     
  5863.   def dispose_at_meter
  5864.       return if @at_meter == nil
  5865.       @at_meter.bitmap.dispose
  5866.       @at_meter.dispose
  5867.       @at_meter = nil
  5868.   end     
  5869.  
  5870.   #--------------------------------------------------------------------------
  5871.   # * Dispose Lv Number
  5872.   #--------------------------------------------------------------------------   
  5873.   def dispose_lv_number
  5874.       return if @lv_number == nil
  5875.       @lv_number.bitmap.dispose
  5876.       @lv_number.dispose
  5877.       @lv_number = nil
  5878.   end
  5879.  
  5880.   #--------------------------------------------------------------------------
  5881.   # * Dispose States
  5882.   #--------------------------------------------------------------------------      
  5883.   def dispose_states
  5884.       return if @status == nil
  5885.       @status.bitmap.dispose if @status.bitmap != nil
  5886.       @status.dispose
  5887.       @actor_status.dispose if @actor_status != nil
  5888.       @status = nil
  5889.   end
  5890.  
  5891. end
  5892.  
  5893. #==============================================================================
  5894. #==============================================================================
  5895. # ** Battle Hud EX
  5896. #==============================================================================
  5897. #==============================================================================
  5898. class Battle_Hud_EX
  5899.  
  5900. #--------------------------------------------------------------------------
  5901. # * Refresh Visible
  5902. #--------------------------------------------------------------------------  
  5903. def refresh_visible(vis)
  5904.      @layout.visible = vis if @layout
  5905.      @layout2.visible = vis if @layout2
  5906.      @name.visible = vis if @name
  5907.      @lv_number.visible = vis if @lv_number
  5908.      @status.visible = vis if @status
  5909.      @face.visible = vis if @face     
  5910.      @hp_number.visible = vis if @hp_number
  5911.      @hp_number2.visible = vis if @hp_number2
  5912.      @hp_meter.visible = vis if @hp_meter
  5913.      @hp_icon.visible = vis if @hp_icon
  5914.      @hp_icon3.visible = vis if @hp_icon3
  5915.      @hp_icon_number.visible = vis if @hp_icon_number     
  5916.      @mp_number.visible = vis if @mp_number
  5917.      @mp_number2.visible = vis if @mp_number2
  5918.      @mp_meter.visible = vis if @mp_meter
  5919.      @mp_icon.visible = vis if @mp_icon
  5920.      @mp_icon3.visible = vis if @mp_icon3
  5921.      @mp_icon_number.visible = vis if @mp_icon_number
  5922.      @tp_number.visible = vis if @tp_number
  5923.      @tp_number2.visible = vis if @tp_number2
  5924.      @tp_meter.visible = vis if @tp_meter
  5925.      @tp_icon.visible = vis if @tp_icon
  5926.      @tp_icon3.visible = vis if @tp_icon3
  5927.      @tp_icon_number.visible = vis if @tp_icon_number      
  5928.      @at_number.visible = vis if @at_number
  5929.      @at_number2.visible = vis if @at_number2
  5930.      @at_meter.visible = vis if @at_meter   
  5931.   end  
  5932.  
  5933.   #--------------------------------------------------------------------------
  5934.   # * Update
  5935.   #--------------------------------------------------------------------------  
  5936.   def update
  5937.       return if @actor == nil
  5938.       @sprite_visible = sprite_visible?
  5939.       @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5940.       update_layout ; update_layout_2 ; update_name
  5941.       update_face ; update_hp ; update_mp ; update_tp
  5942.       update_at ; update_level ; update_states
  5943.   end
  5944.  
  5945. end
  5946.  
  5947. #==============================================================================
  5948. # ■ Sprite Battler
  5949. #==============================================================================
  5950. class Sprite_Battler < Sprite_Base
  5951.  
  5952.   #--------------------------------------------------------------------------
  5953.   # ● Set AV
  5954.   #--------------------------------------------------------------------------      
  5955.   def set_av(a_viewport)
  5956.       @viewport_cm = a_viewport
  5957.   end
  5958.  
  5959.   #--------------------------------------------------------------------------
  5960.   # ● Dispose
  5961.   #--------------------------------------------------------------------------      
  5962.   alias mog_bc_dispose dispose
  5963.   def dispose
  5964.       mog_bc_dispose
  5965.       @viewport_cm.dispose if @viewport_cm != nil
  5966.   end
  5967.  
  5968.   #--------------------------------------------------------------------------
  5969.   # ● Maker Animation Sprites
  5970.   #--------------------------------------------------------------------------      
  5971.   alias mog_bc_make_animation_sprites make_animation_sprites
  5972.   def make_animation_sprites
  5973.       mog_bc_make_animation_sprites
  5974.       set_cm_viewport if $imported[:mog_battle_camera]
  5975.   end
  5976.  
  5977.   #--------------------------------------------------------------------------
  5978.   # ● Set CM Viewpor
  5979.   #--------------------------------------------------------------------------      
  5980.   def set_cm_viewport
  5981.       return if @viewport_cm == nil
  5982.       return if @ani_sprites == nil
  5983.       if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  5984.          @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  5985.          return
  5986.       end
  5987.       @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  5988.   end
  5989.  
  5990. end
  5991.  
  5992. #==============================================================================
  5993. # ■ Game Temp
  5994. #==============================================================================
  5995. class Spriteset_Battle
  5996.  
  5997.   #--------------------------------------------------------------------------
  5998.   # ● Initialize
  5999.   #--------------------------------------------------------------------------      
  6000.   alias mog_bc_sp_initialize initialize
  6001.   def initialize
  6002.       mog_bc_sp_initialize
  6003.       if $imported[:mog_battle_camera] and @viewport_cm != nil
  6004.          battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  6005.       end
  6006.   end
  6007.  
  6008.   #--------------------------------------------------------------------------
  6009.   # ● Create Viewports
  6010.   #--------------------------------------------------------------------------      
  6011.   alias mog_bc_create_viewports create_viewports
  6012.   def create_viewports
  6013.       mog_bc_create_viewports
  6014.       if $imported[:mog_battle_camera]
  6015.          @viewport_cm = Viewport.new
  6016.          @viewport_cm.z = 100
  6017.       end   
  6018.   end
  6019.  
  6020.   #--------------------------------------------------------------------------
  6021.   # ● Dispose Viewports
  6022.   #--------------------------------------------------------------------------      
  6023.   alias mog_bc_dispose_viewports dispose_viewports
  6024.   def dispose_viewports
  6025.       mog_bc_dispose_viewports
  6026.       @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  6027.   end
  6028.  
  6029.   #--------------------------------------------------------------------------
  6030.   # ● Update Viewports
  6031.   #--------------------------------------------------------------------------      
  6032.   alias mog_bcf_update_viewports update_viewports
  6033.   def update_viewports
  6034.       mog_bcf_update_viewports
  6035.       update_viewport_cm if $imported[:mog_battle_camera]
  6036.   end
  6037.  
  6038.   #--------------------------------------------------------------------------
  6039.   # ● Update Viewport CM
  6040.   #--------------------------------------------------------------------------      
  6041.   def update_viewport_cm
  6042.       return if @viewport_cm == nil  
  6043.       @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  6044.       @viewport_cm.oy = $game_temp.bc_data[1]
  6045.       @viewport_cm.update
  6046.   end
  6047.  
  6048. end


RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - 伤害显示  (v4.5) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. # 用图片显示伤害数字.
  8. #==============================================================================
  9. # 需要以下图片
  10. #
  11. # Critical
  12. # Evaded
  13. # Exp
  14. # Gold
  15. # Level Up
  16. # Missed
  17. # MP
  18. # Number
  19. # TP
  20. #
  21. # 全部放在 /GRAPHICS/DAMAGE/
  22. #==============================================================================
  23.  
  24. #==============================================================================
  25. # 行走图上显示伤害数字 (事件)
  26. #==============================================================================
  27. # 如果你想要在地图上或战斗中手动显示伤害数字,使用以下脚本:
  28. #
  29. # damage_popup(目标ID,数值,"类型")
  30. #
  31. # 目标ID
  32. #      1...999    - 地图上的事件ID
  33. #      0          - 玩家
  34. #      -1...-3    - 队友
  35. #
  36. # 数值
  37. #       显示伤害的数值(可以是负值)或文本.当类型为"States"时为状态的ID,不能为负值
  38. #
  39. # 类型 (可选)
  40. #      "Exp" - 显示EXP.
  41. #      "Gold" - 显示金币.
  42. #      "States" - 显示状态图标.
  43. #
  44. #==============================================================================
  45. #
  46. # damage_popup(1,999)
  47. # damage_popup(4,"存档点.")
  48. # damage_popup(0,"我饿了!!!")     <- 玩家
  49. # damage_popup(-1,"Booo!")        <- 1号队友(离玩家最近的队友,不是ID=1的队友)
  50. # damage_popup(0,2000,"Exp")      <- 显示 2000 Exp
  51. # damage_popup(0,5000,"Gold")     <- 显示 5000 金币
  52. #
  53. #==============================================================================
  54. # 使用以下脚本来在全部队友的头顶显示伤害数字.:
  55. #
  56. # damage_popup_party(目标ID,数值,"类型")
  57. #
  58. #==============================================================================
  59. # 地图上显示/不显示伤害数字.
  60. #==============================================================================
  61. # 使用以下脚本来在地图上显示/不显示伤害数字:
  62. #
  63. # damage_popup_map(true)        -> 或 (false)
  64. #  
  65. #==============================================================================
  66. # ● Histórico (Version History)
  67. #==============================================================================
  68. # v 4.5 - Correção de ativar o dano quando o alvo é morto e o dano é zero.
  69. #==============================================================================
  70.  
  71. $imported = {} if $imported.nil?
  72. $imported[:mog_damage_popup] = true
  73.  
  74. module MOG_DAMAGEPOPUP
  75.   #是否允许在地图上显示伤害数字. (默认)
  76.   DAMAGE_POPUP_MAP = false
  77.   #是否在获得物品时显示该物品图标. (仅在地图上).
  78.   ITEM_POPUP_MAP = true
  79.   #是否允许在敌人身上显示EXP和金币.
  80.   EXP_GOLD_POPUP_BATTLE = true
  81.   EXP_GOLD_POPUP_MAP = true
  82.   #是否显示升级
  83.   LEVEL_POPUP_BATTLE = true
  84.   LEVEL_POPUP_MAP = true
  85.   #是否显示状态图标
  86.   STATES_POPUP_BATTLE = true
  87.   STATES_POPUP_MAP = true
  88.   #设定字体 (物品名/状态名/ etc...).
  89.   FONT_SIZE = 28
  90.   FONT_BOLD = true
  91.   FONT_ITALIC = false
  92.   FONT_COLOR = Color.new(255,255,255)
  93.   FONT_COLOR_ITEM = Color.new(255,255,255)
  94.   FONT_COLOR_STATUS_PLUS = Color.new(155,155,255)
  95.   FONT_COLOR_STATUS_MINUS = Color.new(255,150,150)
  96.   #每条伤害间的距离(竖直距离).
  97.   Y_SPACE = 28
  98.   #伤害数字的Z坐标
  99.   DAMAGE_Z = 151
  100. end
  101.  
  102. #==============================================================================
  103. # ■ Game_System
  104. #==============================================================================
  105. class Game_System
  106.   attr_accessor :damage_popup_map
  107.  
  108.   #--------------------------------------------------------------------------
  109.   # ● Initialize
  110.   #--------------------------------------------------------------------------         
  111.   alias mog_damage_popup_initialize initialize
  112.   def initialize
  113.       @damage_popup_map = MOG_DAMAGEPOPUP::DAMAGE_POPUP_MAP
  114.       mog_damage_popup_initialize
  115.   end
  116.  
  117.   #--------------------------------------------------------------------------
  118.   # ● Damage Popup Clear
  119.   #--------------------------------------------------------------------------         
  120.   def damage_popup_clear
  121.       $game_party.character_members.each {|t|
  122.       t.actor.damage.clear; t.actor.skip_dmg_popup = false ;
  123.       t.damage.clear; t.skip_dmg_popup = false} rescue nil
  124.       $game_map.events.values.each {|t| t.damage.clear ;
  125.       t.skip_dmg_popup = false} rescue nil
  126.   end
  127.  
  128. end  
  129.  
  130. #==============================================================================
  131. # ■ Game Temp
  132. #==============================================================================
  133. class Game_Temp
  134.  
  135.   attr_accessor :battle_end
  136.  
  137.   #--------------------------------------------------------------------------
  138.   # ● Initialize
  139.   #--------------------------------------------------------------------------   
  140.   alias mog_damage_temp_opup_initialize initialize
  141.   def initialize
  142.       @battle_end = false
  143.       mog_damage_temp_opup_initialize
  144.   end
  145.  
  146.   #--------------------------------------------------------------------------
  147.   # ● Sprite Visible
  148.   #--------------------------------------------------------------------------   
  149.   def sprite_visible
  150.       return false if $game_message.visible
  151.       return false if $game_temp.battle_end
  152.       return true
  153.   end
  154.  
  155. end
  156. #==============================================================================
  157. # ■ Game CharacterBase
  158. #==============================================================================
  159. class Game_CharacterBase
  160.  
  161.   attr_accessor :damage ,:battler ,:skip_dmg_popup
  162.  
  163.   #--------------------------------------------------------------------------
  164.   # ● Ini Public Members
  165.   #--------------------------------------------------------------------------         
  166.   alias mog_damage_popup_init_public_members init_public_members
  167.   def init_public_members
  168.       @damage = [] ; @skip_dmg_popup = false
  169.       mog_damage_popup_init_public_members
  170.   end
  171.  
  172.   #--------------------------------------------------------------------------
  173.   # ● Damage Popup
  174.   #--------------------------------------------------------------------------         
  175.   def damage_popup(value,type = "String")      
  176.       @damage.push([value,type])
  177.   end  
  178.  
  179. end
  180.  
  181. #==============================================================================
  182. # ■ Scene Map
  183. #==============================================================================
  184. class Scene_Map < Scene_Base  
  185.   #--------------------------------------------------------------------------
  186.   # ● Start
  187.   #--------------------------------------------------------------------------
  188.   alias mog_damage_popup_start start
  189.   def start
  190.       $game_system.damage_popup_clear ; $game_temp.battle_end = false
  191.       mog_damage_popup_start
  192.   end  
  193. end
  194.  
  195. #==============================================================================
  196. # ■ Game Player
  197. #==============================================================================
  198. class Game_Player < Game_Character   
  199.   #--------------------------------------------------------------------------
  200.   # ● Battler
  201.   #--------------------------------------------------------------------------
  202.   def battler
  203.       actor
  204.   end   
  205. end
  206.  
  207. #==============================================================================
  208. # ■ Game Follower
  209. #==============================================================================
  210. class Game_Follower < Game_Character  
  211.   #--------------------------------------------------------------------------
  212.   # ● Battler
  213.   #--------------------------------------------------------------------------
  214.   def battler
  215.       actor
  216.   end   
  217. end
  218.  
  219. #==============================================================================
  220. # ■ Game_BattlerBase
  221. #==============================================================================
  222. class Game_BattlerBase  
  223.   #--------------------------------------------------------------------------
  224.   # ● Change HP
  225.   #--------------------------------------------------------------------------         
  226.   alias mog_damage_popup_change_hp change_hp
  227.   def change_hp(value, enable_death)
  228.       mog_damage_popup_change_hp(value, enable_death)
  229.       self.damage.push([-value,"Hp"])
  230.   end   
  231. end
  232.  
  233. #==============================================================================
  234. # ■ Game_Battler
  235. #==============================================================================
  236. class Game_Battler < Game_BattlerBase  
  237.   include MOG_DAMAGEPOPUP
  238.   attr_accessor :damage , :skip_dmg_popup
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # ● Initialize
  242.   #--------------------------------------------------------------------------         
  243.   alias mog_damage_sprite_initialize initialize
  244.   def initialize      
  245.       @damage = [] ; @skip_dmg_popup = false
  246.       mog_damage_sprite_initialize
  247.   end  
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # ● Item Apply
  251.   #--------------------------------------------------------------------------  
  252.    alias mog_damage_pop_item_apply item_apply
  253.    def item_apply(user, item)
  254.        mog_damage_pop_item_apply(user, item)
  255.        execute_damage_popup(user,item)
  256.   end
  257.  
  258.   #--------------------------------------------------------------------------
  259.   # ● Execute Damage Popup
  260.   #--------------------------------------------------------------------------
  261.   def execute_damage_popup(user,item)
  262.       if !@result.missed and !@result.evaded and @result.hit?
  263.         self.damage.push([@result.hp_damage,"HP",@result.critical]) if item.damage.to_hp? or @result.hp_damage != 0
  264.         user.damage.push([-@result.hp_drain,"HP",@result.critical]) if item.damage.type == 5
  265.         self.damage.push([@result.mp_damage,"MP",@result.critical]) if item.damage.to_mp? or @result.mp_damage != 0
  266.         user.damage.push([-@result.mp_drain,"MP",@result.critical]) if item.damage.type == 6
  267.         self.damage.push([@result.tp_damage,"TP",@result.critical]) if @result.tp_damage != 0
  268.      elsif !self.dead?
  269.         if @result.missed ; self.damage.push(["Missed","Missed"])
  270.         elsif @result.evaded ; self.damage.push(["Evaded","Evaded"])
  271.         end        
  272.       end
  273.   end
  274.  
  275.   #--------------------------------------------------------------------------
  276.   # ● Regenerate HP
  277.   #--------------------------------------------------------------------------
  278.   alias mog_damage_pop_regenerate_hp regenerate_hp
  279.   def regenerate_hp
  280.       mog_damage_pop_regenerate_hp
  281.       self.damage.push(["Regenerate",""]) if @result.hp_damage < 0  
  282.       self.damage.push([@result.hp_damage,"HP"]) if @result.hp_damage != 0
  283.   end
  284.  
  285.   #--------------------------------------------------------------------------
  286.   # ● Regenerate MP
  287.   #--------------------------------------------------------------------------
  288.   alias mog_damage_pop_regenerate_mp regenerate_mp
  289.   def regenerate_mp
  290.       mog_damage_pop_regenerate_mp
  291.       self.damage.push([@result.mp_damage,"MP"]) if @result.mp_damage != 0
  292.   end
  293.  
  294.   #--------------------------------------------------------------------------
  295.   # ● Regenerate TP
  296.   #--------------------------------------------------------------------------
  297.   alias mog_damage_pop_regenerate_tp regenerate_tp
  298.   def regenerate_tp
  299.       mog_damage_pop_regenerate_tp
  300.       tp_damage = 100 * trg
  301.       self.damage.push([tp_damage,"TP"]) if tp_damage != 0
  302.   end
  303.  
  304.   #--------------------------------------------------------------------------
  305.   # ● Added New State
  306.   #--------------------------------------------------------------------------  
  307.   alias mog_damage_pop_add_new_state add_new_state
  308.   def add_new_state(state_id)
  309.       mog_damage_pop_add_new_state(state_id)
  310.       execute_popup_add_new_state(state_id)
  311.   end
  312.  
  313.   #--------------------------------------------------------------------------
  314.   # ● Execute Popup Add New State
  315.   #--------------------------------------------------------------------------  
  316. def execute_popup_add_new_state(state_id)
  317.       st = $data_states[state_id]
  318.       if self.hp > 0
  319.          unless (SceneManager.scene_is?(Scene_Battle) and !STATES_POPUP_BATTLE) or
  320.                 (SceneManager.scene_is?(Scene_Map) and !STATES_POPUP_MAP)
  321.                 self.damage.push([st.name.to_s,"States Plus",false,st.icon_index])
  322.          end
  323.       end
  324.   end
  325.  
  326.   #--------------------------------------------------------------------------
  327.   # ● Remove State
  328.   #--------------------------------------------------------------------------  
  329.   alias mog_damage_pop_remove_state remove_state
  330.   def remove_state(state_id)
  331.       execute_popup_remove_state(state_id)  
  332.       mog_damage_pop_remove_state(state_id)
  333.   end      
  334.  
  335.   #--------------------------------------------------------------------------
  336.   # ● Execute Popup Remove State
  337.   #--------------------------------------------------------------------------  
  338.   def execute_popup_remove_state(state_id)  
  339.       if state?(state_id) and self.hp > 0
  340.          st = $data_states[state_id]
  341.          unless (SceneManager.scene_is?(Scene_Battle) and !STATES_POPUP_BATTLE) or
  342.                 (SceneManager.scene_is?(Scene_Map) and !STATES_POPUP_MAP)
  343.                 self.damage.push([st.name.to_s,"States Minus",false,st.icon_index]) unless BattleManager.escape?
  344.          end
  345.       end
  346.   end     
  347.  
  348. end
  349.  
  350. #==============================================================================
  351. # ■ BattleManager
  352. #==============================================================================
  353. module BattleManager
  354.   #--------------------------------------------------------------------------
  355.   # ● Escape?
  356.   #--------------------------------------------------------------------------
  357.   def self.escape?
  358.       @phase == nil
  359.   end  
  360. end
  361.  
  362. #==============================================================================
  363. # ■ Game_Temp
  364. #==============================================================================
  365. class Game_Temp
  366.   attr_accessor :dmg_battle_mode
  367.  
  368.   #--------------------------------------------------------------------------
  369.   # ● Initialize
  370.   #--------------------------------------------------------------------------         
  371.   alias mog_damage_popup_initialize initialize
  372.   def initialize
  373.       @dmg_battle_mode = false
  374.       mog_damage_popup_initialize
  375.   end
  376.  
  377. end
  378.  
  379. #==============================================================================
  380. # ■ Scene Battle
  381. #==============================================================================
  382. class Scene_Battle < Scene_Base
  383.  
  384.   #--------------------------------------------------------------------------
  385.   # ● Start
  386.   #--------------------------------------------------------------------------         
  387.   alias mog_damage_popup_start start
  388.   def start
  389.       $game_temp.dmg_battle_mode = true
  390.       mog_damage_popup_start
  391.   end
  392.  
  393.   #--------------------------------------------------------------------------
  394.   # ● Terminate
  395.   #--------------------------------------------------------------------------         
  396.   alias mog_damage_popup_terminate terminate
  397.   def terminate
  398.       mog_damage_popup_terminate
  399.       $game_temp.dmg_battle_mode = false
  400.   end
  401.  
  402. end
  403.  
  404. #==============================================================================
  405. # ■ Game Party
  406. #==============================================================================
  407. class Game_Party < Game_Unit
  408.  
  409.   #--------------------------------------------------------------------------
  410.   # ● Character Members
  411.   #--------------------------------------------------------------------------         
  412.   def character_members
  413.       char_m = [] ; char_m.push($game_player)
  414.       $game_player.followers.each do |f| char_m.push(f) end
  415.       return char_m
  416.   end
  417.  
  418.   #--------------------------------------------------------------------------
  419.   # ● Gain Gold
  420.   #--------------------------------------------------------------------------         
  421.   alias mog_damage_popup_gain_gold gain_gold
  422.   def gain_gold(amount)
  423.       mog_damage_popup_gain_gold(amount)
  424.       $game_party.members[0].damage.push([amount,"Gold"]) if can_damage_popup_gold?
  425.   end  
  426.  
  427.   #--------------------------------------------------------------------------
  428.   # ● Can Damage Popup Gold
  429.   #--------------------------------------------------------------------------         
  430.   def can_damage_popup_gold?
  431.       return false if !SceneManager.scene_is?(Scene_Map)
  432.       return false if $game_temp.dmg_battle_mode
  433.       return false if !MOG_DAMAGEPOPUP::EXP_GOLD_POPUP_MAP
  434.       return false if !$game_system.damage_popup_map
  435.       return false if !$game_party.members[0]
  436.       return true
  437.   end
  438.  
  439. #--------------------------------------------------------------------------
  440. # ● Gain Item
  441. #--------------------------------------------------------------------------
  442. alias mog_damage_popup_gain_item gain_item
  443. def gain_item(item, amount, include_equip = false)
  444.      mog_damage_popup_gain_item(item, amount, include_equip)
  445.      execute_item_popup(item) if can_damage_popup_item?(item)
  446. end
  447.  
  448. #--------------------------------------------------------------------------
  449. # ● Can Damage Poupup Item
  450. #--------------------------------------------------------------------------
  451. def can_damage_popup_item?(item)
  452.      return false if item == nil
  453.      return false if !MOG_DAMAGEPOPUP::ITEM_POPUP_MAP
  454.      return false if !$game_system.damage_popup_map
  455.      return false if SceneManager.scene_is?(Scene_Battle)
  456.      return false if !$game_party.members[0]
  457.      return false if $game_temp.dmg_battle_mode
  458.      return true     
  459. end
  460.  
  461. #--------------------------------------------------------------------------
  462. # ● Execute Item Popup
  463. #--------------------------------------------------------------------------
  464. def execute_item_popup(item)
  465.      it = $data_items[item.id] if item.is_a?(RPG::Item)
  466.      it = $data_weapons[item.id] if item.is_a?(RPG::Weapon)
  467.      it = $data_armors[item.id] if item.is_a?(RPG::Armor)   
  468.      $game_party.members[0].damage.push([it.name.to_s,"Item",false,it.icon_index])
  469. end
  470.  
  471. end
  472.  
  473. #==============================================================================
  474. # ■ Game Interpreter
  475. #==============================================================================
  476. class Game_Interpreter
  477.  
  478. #--------------------------------------------------------------------------
  479. # ● Damage Popup Map
  480. #--------------------------------------------------------------------------
  481.   def damage_popup_map(value)
  482.       $game_system.damage_popup_map = value
  483.   end   
  484.  
  485.   #--------------------------------------------------------------------------
  486.   # ● Damage Popup
  487.   #--------------------------------------------------------------------------
  488.   def damage_popup(target_id, value,type = "")
  489.       return if !$game_system.damage_popup_map
  490.       target = set_target_dmg(target_id) rescue nil
  491.       target.damage.push([value,type]) if target
  492.   end
  493.  
  494.   #--------------------------------------------------------------------------
  495.   # ● Set Target Dmg
  496.   #--------------------------------------------------------------------------
  497.   def set_target_dmg(target)
  498.       return $game_player.battler if target == 0
  499.       return $game_player.followers.battler[(target_id + 1).abs] if target < 0
  500.       $game_map.events.values.each do |event|
  501.       return event.battler if event.id == target_id and event.battler
  502.       return event if event.id == target_id
  503.       end
  504.   end
  505.  
  506.   #--------------------------------------------------------------------------
  507.   # * Change MP
  508.   #--------------------------------------------------------------------------
  509.   alias mog_damage_popup_command_312 command_312
  510.   def command_312
  511.       value = operate_value(@params[2], @params[3], @params[4])
  512.       iterate_actor_var(@params[0], @params[1]) do |actor|
  513.       actor.damage.push([-value,"MP"])
  514.       end   
  515.       mog_damage_popup_command_312
  516.   end  
  517.  
  518. end
  519.  
  520. #==============================================================================
  521. # ■ Game Actor
  522. #==============================================================================
  523. class Game_Actor < Game_Battler
  524.   include MOG_DAMAGEPOPUP
  525.   #--------------------------------------------------------------------------
  526.   # ● Level UP
  527.   #--------------------------------------------------------------------------         
  528.    alias mog_damage_pop_level_up level_up
  529.    def level_up
  530.        mog_damage_pop_level_up      
  531.        execute_level_popup
  532.    end
  533.  
  534.   #--------------------------------------------------------------------------
  535.   # ● Execute Level Popup
  536.   #--------------------------------------------------------------------------         
  537.    def execute_level_popup
  538.        if (SceneManager.scene_is?(Scene_Battle) and LEVEL_POPUP_BATTLE) or
  539.           (SceneManager.scene_is?(Scene_Map) and LEVEL_POPUP_MAP)
  540.           @damage.push(["Level UP","Level_UP"]) unless @skip_dmg_popup
  541.           @skip_dmg_popup = true
  542.        end     
  543.    end
  544.  
  545.   #--------------------------------------------------------------------------
  546.   # ● Change Exp
  547.   #--------------------------------------------------------------------------         
  548.   alias mog_damage_popup_change_exp change_exp
  549.   def change_exp(exp, show)
  550.       n_exp = self.exp
  551.       mog_damage_popup_change_exp(exp, show)
  552.       c_exp = n_exp - self.exp
  553.       @damage.push([c_exp.abs,"Exp"]) if can_popup_exp?(exp)
  554.   end   
  555.  
  556.   #--------------------------------------------------------------------------
  557.   # ● Can Popup EXP
  558.   #--------------------------------------------------------------------------         
  559.   def can_popup_exp?(exp)
  560.       return false if !EXP_GOLD_POPUP_MAP
  561.       return false if exp <= 0
  562.       return false if self.skip_dmg_popup
  563.       return false if self.max_level?
  564.       return true
  565.   end
  566.  
  567. end
  568.  
  569. #==============================================================================
  570. # ■ Scene_Battle
  571. #==============================================================================
  572. class Scene_Battle < Scene_Base
  573.  
  574.   #--------------------------------------------------------------------------
  575.   # ● Invoke Counter Attack
  576.   #--------------------------------------------------------------------------        
  577.   alias mog_damage_popup_invoke_counter_attack invoke_counter_attack
  578.   def invoke_counter_attack(target, item)
  579.       mog_damage_popup_invoke_counter_attack(target, item)
  580.       target.damage.push(["Counter","Counter"])
  581.   end  
  582.  
  583.   #--------------------------------------------------------------------------
  584.   # ● Invoke Counter Attack
  585.   #--------------------------------------------------------------------------        
  586.   alias mog_damage_popup_invoke_magic_reflection invoke_magic_reflection
  587.   def invoke_magic_reflection(target, item)
  588.       mog_damage_popup_invoke_magic_reflection(target, item)
  589.       target.damage.push(["Reflection","Reflection"])
  590.   end  
  591.  
  592. end
  593.  
  594. #==============================================================================
  595. # ■ Cache
  596. #==============================================================================
  597. module Cache
  598.  
  599.   #--------------------------------------------------------------------------
  600.   # * Damage
  601.   #--------------------------------------------------------------------------
  602.   def self.damage(filename)
  603.       load_bitmap("Graphics/Damage/", filename)
  604.   end
  605.  
  606. end
  607.  
  608. #==============================================================================
  609. # ■ Game Temp
  610. #==============================================================================
  611. class Game_Temp
  612.  
  613.   attr_accessor :pre_cache_damage
  614.  
  615.   #--------------------------------------------------------------------------
  616.   # ● Initialize
  617.   #--------------------------------------------------------------------------  
  618.   alias mog_damage_pop_initialize initialize
  619.   def initialize
  620.       mog_damage_pop_initialize
  621.       pre_cache_damage_temp
  622.   end
  623.  
  624.   #--------------------------------------------------------------------------
  625.   # ● Pre Cache Damage Temp
  626.   #--------------------------------------------------------------------------   
  627.   def pre_cache_damage_temp
  628.       return if @pre_cache_damage != nil
  629.       @pre_cache_damage = []
  630.       @pre_cache_damage.push(Cache.damage("HP_Number"))
  631.       @pre_cache_damage.push(Cache.damage("MP"))
  632.       @pre_cache_damage.push(Cache.damage("TP"))
  633.       @pre_cache_damage.push(Cache.damage("Missed"))
  634.       @pre_cache_damage.push(Cache.damage("Evaded"))
  635.       @pre_cache_damage.push(Cache.damage("Critical"))
  636.       @pre_cache_damage.push(Cache.damage("Exp"))
  637.       @pre_cache_damage.push(Cache.damage("Gold"))
  638.       @pre_cache_damage.push(Cache.damage("Level UP"))
  639.       @pre_cache_damage.push(Cache.damage("Counter"))
  640.       @pre_cache_damage.push(Cache.damage("Reflection"))
  641.       @pre_cache_damage.push(Cache.damage("MP_Number"))
  642.       @pre_cache_damage.push(Cache.damage("TP_Number"))
  643.       @pre_cache_damage.push(Cache.damage("EG_Number"))
  644.       @pre_cache_damage.push(Cache.system("Iconset"))
  645.   end
  646.  
  647. end
  648.  
  649. #==============================================================================
  650. # ■ Sprite Base
  651. #==============================================================================
  652. class Sprite_Base < Sprite
  653.  
  654.   #--------------------------------------------------------------------------
  655.   # ● Initialize
  656.   #--------------------------------------------------------------------------  
  657.   alias mog_damage_popup_sprite_initialize initialize
  658.   def initialize(viewport = nil)
  659.       mog_damage_popup_sprite_initialize(viewport)
  660.       damage_popup_setup
  661.   end
  662.  
  663.   #--------------------------------------------------------------------------
  664.   # ● Damage Popup Setup
  665.   #--------------------------------------------------------------------------  
  666.   def damage_popup_setup      
  667.       $game_temp.pre_cache_damage_temp ; @damage_sprites = []
  668.       $game_system.damage_popup_clear
  669.   end
  670.  
  671.   #--------------------------------------------------------------------------
  672.   # ● Dispose
  673.   #--------------------------------------------------------------------------  
  674.   alias mog_damage_popup_sprite_dispose dispose
  675.   def dispose      
  676.       mog_damage_popup_sprite_dispose
  677.       dispose_damage_sprites
  678.   end
  679.  
  680.   #--------------------------------------------------------------------------
  681.   # ● Dispose Damage Sprites
  682.   #--------------------------------------------------------------------------   
  683.   def dispose_damage_sprites
  684.       return if @damage_sprites == nil
  685.       @damage_sprites.each {|sprite| sprite.dispose_damage }
  686.   end  
  687.  
  688.   #--------------------------------------------------------------------------
  689.   # ● Update
  690.   #--------------------------------------------------------------------------  
  691.   alias mog_damage_popup_sprite_update update
  692.   def update
  693.       mog_damage_popup_sprite_update
  694.       update_damage_popup
  695.   end  
  696.  
  697.   #--------------------------------------------------------------------------
  698.   # ● Update Damage Popup
  699.   #--------------------------------------------------------------------------   
  700.   def update_damage_popup
  701.       return if @damage_sprites == nil
  702.       create_damage_sprite if can_create_damage?
  703.       update_damage_sprite if !@damage_sprites.empty?
  704.   end  
  705.  
  706.   #--------------------------------------------------------------------------
  707.   # ● Can Create Damage?
  708.   #--------------------------------------------------------------------------     
  709.   def can_create_damage?      
  710.       return false if $game_message.visible
  711.       if @battler
  712.          return false if @battler.damage == nil
  713.          return false if @battler.damage.empty?
  714.          if $game_temp.battle_end and @battler.is_a?(Game_Actor)
  715.             return false if $game_message.visible
  716.             return false if $imported[:mog_battler_result] and $game_temp.result
  717.          end
  718.       elsif @character
  719.          return false if !$game_system.damage_popup_map
  720.          if @character.battler
  721.             return false if @character.battler.damage == nil
  722.             return false if @character.battler.damage.empty?
  723.          else
  724.             return false if @character.damage == nil
  725.             return false if @character.damage.empty?            
  726.          end  
  727.       end
  728.       return false if @battler == nil and @character == nil      
  729.       return true
  730.   end
  731.  
  732.   #--------------------------------------------------------------------------
  733.   # ● Create Damage Sprite
  734.   #--------------------------------------------------------------------------     
  735.   def create_damage_sprite
  736.       target = @battler ? @battler : @character
  737.       screen_x_available = target.screen_x rescue nil
  738.       return if screen_x_available == nil
  739.       sx = target.screen_x != nil ? target.screen_x : self.x
  740.       sy = target.screen_y != nil ? target.screen_y : self.y
  741.       @damage_sprites = [] if @damage_sprites == nil  
  742.       target = @character.battler if @character and @character.battler
  743.       target.damage.each_with_index do |i, index|
  744.       @damage_sprites.push(Damage_Sprite.new(nil,sx,sy,i,index,@damage_sprites.size,self)) end
  745.       if SceneManager.scene_is?(Scene_Battle)
  746.       @damage_sprites.each_with_index do |i, index| i.set_duration(index) end
  747.       end
  748.       target.damage.clear ; target.skip_dmg_popup = false
  749.   end  
  750.  
  751.   #--------------------------------------------------------------------------
  752.   # ● Update Damage Sprite
  753.   #--------------------------------------------------------------------------     
  754.   def update_damage_sprite
  755.       clear = true
  756.       @damage_sprites.each_with_index do |sprite, i|
  757.           sprite.update_damage(@damage_sprites.size,i,@battler)
  758.           sprite.dispose_damage if sprite.duration <= 0
  759.           clear = false if sprite.duration > 0
  760.       end   
  761.       @damage_sprites.clear if clear
  762.   end  
  763.  
  764. end
  765.  
  766. #==============================================================================
  767. # ■ Damage Sprite
  768. #==============================================================================
  769. class Damage_Sprite < Sprite
  770.    include MOG_DAMAGEPOPUP
  771.    attr_accessor :duration
  772.  
  773.   #--------------------------------------------------------------------------
  774.   # ● Initialize
  775.   #--------------------------------------------------------------------------      
  776.   def initialize(viewport = nil , x,y, value ,index,index_max,target)
  777.       super(viewport)
  778.       dispose_damage ; setup_base(value,x,y,index,index_max,target) ; create_sprites
  779.   end   
  780.  
  781.   #--------------------------------------------------------------------------
  782.   # ● Setup Base
  783.   #--------------------------------------------------------------------------      
  784.   def setup_base(value,x,y,index,index_max,target)
  785.       @target = target ; y2 = 0
  786.       if @target.bitmap != nil ; y2 = SceneManager.scene_is?(Scene_Battle) ? @target.bitmap.height / 2 : 0 ; end
  787.       @animation_type = 0 ; @index = index ; @index_max = index_max + 1
  788.       @image = $game_temp.pre_cache_damage ; self.z = index + DAMAGE_Z
  789.       @cw = @image[0].width / 10 ; @ch = @image[0].height / 2 ; @cw2 = 0
  790.       @x = x ; @y = y - y2 ; @value = value[0] ; @type = value[1] ; @ch2 = 0
  791.       @critical = (value[2] and @value.to_i >= 0) ? true : false; self.opacity = 0
  792.       @state_index = value[3] ; @oxy = [0,0,0,0] ; @org_xy = [0,0] ; @spxy = [0,0]
  793.       @duration = 92 ; @org_oxy = [0,0,0,0]
  794.       self.visible = false ;set_initial_position(index,nil)
  795.   end
  796.  
  797.   #--------------------------------------------------------------------------
  798.   # ● Set Duration
  799.   #--------------------------------------------------------------------------      
  800.   def set_duration(index,pre_index = nil)
  801.       return if @duration != 0
  802.       @duration = 82 + (2 * index) if @animation_type == 0
  803.   end
  804.  
  805.   #--------------------------------------------------------------------------
  806.   # ● Set Initial Position
  807.   #--------------------------------------------------------------------------      
  808.   def set_initial_position(index,old_duration)
  809.       @org_xy = [@x,@y]
  810.       self.zoom_y = self.zoom_x
  811.   end
  812.  
  813.   #--------------------------------------------------------------------------
  814.   # ● Dispose Damage
  815.   #--------------------------------------------------------------------------      
  816.   def dispose_damage
  817.       (self.bitmap.dispose ; self.bitmap = nil) if self.bitmap
  818.       (@sup_sprite.bitmap.dispose ; @sup_sprite.dispose) if @sup_sprite  
  819.       @duration = -1
  820.   end
  821.  
  822.   #--------------------------------------------------------------------------
  823.   # ● Create Sprites
  824.   #--------------------------------------------------------------------------      
  825.   def create_sprites
  826.       if @value.is_a?(Numeric)
  827.          create_number         
  828.       elsif ["Missed","Evaded","Level UP","Counter","Reflection"].include?(@value.to_s)
  829.          create_miss
  830.       else
  831.          create_string
  832.       end      
  833.       set_damage_position
  834.   end
  835.  
  836.   #--------------------------------------------------------------------------
  837.   # ● Set Damage Position
  838.   #--------------------------------------------------------------------------      
  839.   def set_damage_position
  840.       return if self.bitmap == nil
  841.       self.ox = (self.bitmap.width - @cw2) / 2
  842.       self.oy = self.bitmap.height / 2 ; self.x = @x ; self.y = @y
  843.       @org_oxy[0] = self.ox
  844.       @org_oxy[1] = self.oy
  845.       set_animation_type
  846.       if @sup_sprite
  847.          @sup_sprite.ox = self.bitmap.width / 2 ;
  848.          @sup_sprite.oy = self.bitmap.height / 2
  849.          @org_oxy[2] = @sup_sprite.ox
  850.          @org_oxy[3] = @sup_sprite.oy
  851.          if @critical
  852.             @sup_sprite.x = @x - (@sup_sprite.bitmap.width / 2) + ((@cw / 2) * @number_value.size)
  853.             @sup_sprite.y = self.y
  854.          end   
  855.          update_sup_position(@index_max - @index)
  856.       end
  857.   end   
  858.  
  859.   #--------------------------------------------------------------------------
  860.   # ● Set Damage Position
  861.   #--------------------------------------------------------------------------      
  862.   def set_animation_type
  863.       s = rand(2) ; s2 = (rand(10) * 0.1).round(2)
  864.       @oxy[2] = s == 1 ? s2 : -s2
  865.   end
  866.  
  867.   #--------------------------------------------------------------------------
  868.   # ● Create Number
  869.   #--------------------------------------------------------------------------      
  870.   def create_number
  871.       case @type
  872.       when "MP"
  873.       number_image = @image[11] ;h = @value >= 0 ? 0 : @ch ; create_sup_sprite
  874.       when "TP"
  875.       number_image = @image[12] ;h = @value >= 0 ? 0 : @ch ; create_sup_sprite
  876.       when "Exp"
  877.       number_image = @image[13] ;h = 0 ; create_sup_sprite
  878.       when "Gold"
  879.       number_image = @image[13] ;h = @ch ; create_sup_sprite            
  880.       else
  881.       number_image = @image[0] ; h = @value >= 0 ? 0 : @ch
  882.       end
  883.       @number_value = @value.abs.truncate.to_s.split(//)
  884.       self.bitmap = Bitmap.new(@cw * @number_value.size, @ch)
  885.       for r in 0...@number_value.size        
  886.           number_value_abs = @number_value[r].to_i
  887.           src_rect = Rect.new(@cw * number_value_abs, h, @cw, @ch)
  888.           self.bitmap.blt(@cw *  r, 0, number_image, src_rect)
  889.       end   
  890.       create_sup_sprite if @critical
  891.   end
  892.  
  893.   #--------------------------------------------------------------------------
  894.   # ● Create Sup Sprite
  895.   #--------------------------------------------------------------------------      
  896.   def create_sup_sprite
  897.       return if @sup_sprite != nil
  898.       @sup_sprite = Sprite.new ; @sup_sprite.visible = false ; fy = 0 ; sp = [0,0]
  899.       if @type == "MP" ; @sup_sprite.bitmap = @image[1].dup
  900.       elsif @type == "TP" ; @sup_sprite.bitmap = @image[2].dup
  901.       elsif @critical
  902.          @sup_sprite.bitmap = @image[5].dup
  903.          @cw2 = 0 ; @ch2 = @sup_sprite.bitmap.height  
  904.          return
  905.       elsif @type == "Exp"
  906.          @sup_sprite.bitmap = @image[6].dup ; fy = @ch ; sp[1] = 1.0
  907.       elsif @type == "Gold"
  908.          @sup_sprite.bitmap = @image[7].dup ; fy = (@ch * 2) ; sp[1] = 0.5
  909.      end  
  910.      fy = 0 if !SceneManager.scene_is?(Scene_Battle)
  911.      @y += fy ; @org_xy[1] += 0
  912.      @cw2 = @sup_sprite.bitmap.width + @cw
  913.      @spxy = [sp[0],sp[1]]
  914.   end
  915.  
  916.   #--------------------------------------------------------------------------
  917.   # ● Update Sup Position
  918.   #--------------------------------------------------------------------------      
  919.   def update_sup_position(dif_y)
  920.       @sup_sprite.x = self.x - @cw unless @critical
  921.       @sup_sprite.y = @critical ? self.y - @ch2 : self.y
  922.       @sup_sprite.opacity = self.opacity ; @sup_sprite.angle = self.angle
  923.       @sup_sprite.zoom_x = self.zoom_x ; @sup_sprite.zoom_y = self.zoom_y
  924.       @sup_sprite.z = self.z ; @sup_sprite.viewport = self.viewport
  925.       @sup_sprite.visible = self.visible
  926.   end  
  927.  
  928.   #--------------------------------------------------------------------------
  929.   # ● Create Miss
  930.   #--------------------------------------------------------------------------      
  931.   def create_miss
  932.       self.bitmap = @image[3].dup if @value == "Missed"
  933.       self.bitmap = @image[4].dup if @value == "Evaded"
  934.       self.bitmap = @image[8].dup if @value == "Level UP"
  935.       self.bitmap = @image[9].dup if @value == "Counter"
  936.       self.bitmap = @image[10].dup if @value == "Reflection"
  937.   end
  938.  
  939.   #--------------------------------------------------------------------------
  940.   # ● Create Spring
  941.   #--------------------------------------------------------------------------               
  942.   def create_string
  943.       string_size = @value.to_s.split(//) ; fsize = FONT_SIZE > 10 ? FONT_SIZE : 10
  944.       @stg_size = string_size.size > 0 ? ((1 + string_size.size ) * ((fsize / 2) - 2)) : 32      
  945.       self.bitmap = Bitmap.new(@stg_size,32)
  946.       self.bitmap.font.color = FONT_COLOR
  947.       self.bitmap.font.size = fsize ; self.bitmap.font.bold = FONT_BOLD
  948.       self.bitmap.font.italic = FONT_ITALIC
  949.       if @type == "Item"
  950.          self.bitmap.font.color = FONT_COLOR_ITEM
  951.       elsif @type == "States Plus"
  952.          self.bitmap.font.color = FONT_COLOR_STATUS_PLUS
  953.       elsif @type == "States Minus"
  954.          self.bitmap.font.color = FONT_COLOR_STATUS_MINUS
  955.       end      
  956.       self.bitmap.draw_text(0, 0, self.bitmap.width, self.bitmap.height, @value.to_s,0)
  957.       draw_states if @state_index != nil
  958.   end
  959.  
  960.   #--------------------------------------------------------------------------
  961.   # ● Draw States
  962.   #--------------------------------------------------------------------------               
  963.   def draw_states
  964.       @sup_sprite = Sprite.new ; @sup_sprite.bitmap = Bitmap.new(24,24)
  965.       rect = Rect.new(@state_index % 16 * 24, @state_index / 16 * 24, 24, 24)
  966.       @image[14] = Cache.system("Iconset") if @image[14]== nil or @image[14].disposed?
  967.       @sup_sprite.bitmap.blt(0, 0, @image[14].dup, rect)
  968.       (@org_xy[1] += (@ch + 5) ; @y += (@ch + 5)) unless !SceneManager.is_a?(Scene_Battle)
  969.       @cw2 = @sup_sprite.bitmap.width + @cw / 2 ; @sup_sprite.visible = false
  970.   end  
  971.  
  972.   #--------------------------------------------------------------------------
  973.   # ● Update Damage
  974.   #--------------------------------------------------------------------------               
  975.   def update_damage(index_max,index,battler)
  976.       @index_max = index_max ; @index = index
  977.       return if self.bitmap == nil or self.bitmap.disposed?
  978.       @duration -= 1
  979.       self.visible = @duration > 90 ? false : true
  980.       return if !self.visible
  981.       dif_y = (@index_max - @index)
  982.       update_animation(dif_y)
  983.       update_sprite_position(dif_y,battler)
  984.       update_sup_position(dif_y) if @sup_sprite
  985.       dispose_damage if @duration <= 0
  986.   end
  987.  
  988.   #--------------------------------------------------------------------------
  989.   # ● Update Sprite Position
  990.   #--------------------------------------------------------------------------               
  991.   def update_sprite_position(dif_y,battler)
  992.       execute_move(0,self,@org_xy[0] + @oxy[0])
  993.       execute_move(1,self,@org_xy[1] + @oxy[1] - (dif_y * Y_SPACE))
  994.       self.zoom_y = self.zoom_x
  995.       update_battle_camera if oxy_camera?(battler)
  996.   end   
  997.  
  998.   #--------------------------------------------------------------------------
  999.   # ● Update Battle Camera
  1000.   #--------------------------------------------------------------------------               
  1001.   def update_battle_camera
  1002.       self.ox = $game_temp.viewport_oxy[0] + @org_oxy[0]
  1003.       self.oy = $game_temp.viewport_oxy[1] + @org_oxy[1]
  1004.       @sup_sprite.ox = $game_temp.viewport_oxy[0] + @org_oxy[2] if @sup_sprite != nil
  1005.       @sup_sprite.oy = $game_temp.viewport_oxy[1] + @org_oxy[3] if @sup_sprite != nil
  1006.   end  
  1007.  
  1008.   #--------------------------------------------------------------------------
  1009.   # ● OXY_CAMERA
  1010.   #--------------------------------------------------------------------------               
  1011.   def oxy_camera?(battler)
  1012.       return false if $imported[:mog_battle_camera] == nil
  1013.       if battler.is_a?(Game_Actor)
  1014.          return false if $imported[:mog_battle_hud_ex] and SceneManager.face_battler?
  1015.       end
  1016.       return true
  1017.   end
  1018.  
  1019.   #--------------------------------------------------------------------------
  1020.   # ● Execute Move
  1021.   #--------------------------------------------------------------------------      
  1022.   def execute_move(type,sprite,np)
  1023.       cp = type == 0 ? sprite.x : sprite.y
  1024.       sp = 1 + ((cp - np).abs / 10)
  1025.       sp = 1 if @duration < 60
  1026.       if cp > np ;    cp -= sp ; cp = np if cp < np
  1027.       elsif cp < np ; cp += sp ; cp = np if cp > np
  1028.       end     
  1029.       sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  1030.   end   
  1031.  
  1032.   #--------------------------------------------------------------------------
  1033.   # ● Update Animation
  1034.   #--------------------------------------------------------------------------               
  1035.   def update_animation(dif_y)
  1036.      @oxy[1] -= 1
  1037.      case @duration
  1038.      when 60..90 ; self.opacity += 15
  1039.      when 30..60 ; self.opacity = 255
  1040.      when 0..30  ; self.opacity -= 9
  1041.      end
  1042.   end
  1043.  
  1044. end
  1045.  
  1046. #==============================================================================
  1047. # ■ Sprite Battler
  1048. #==============================================================================
  1049. class Sprite_Battler < Sprite_Base
  1050.  
  1051.   #--------------------------------------------------------------------------
  1052.   # ● Update Collapse
  1053.   #--------------------------------------------------------------------------  
  1054.   alias mog_damage_pop_update_collapse update_collapse
  1055.   def update_collapse
  1056.       mog_damage_pop_update_collapse
  1057.       execute_exp_pop
  1058.   end
  1059.  
  1060.   #--------------------------------------------------------------------------
  1061.   # ● Update Instant Collapse
  1062.   #--------------------------------------------------------------------------  
  1063.   alias mog_damage_pop_update_instant_collapse update_instant_collapse
  1064.   def update_instant_collapse
  1065.       mog_damage_pop_update_instant_collapse
  1066.       execute_exp_pop
  1067.   end   
  1068.  
  1069.   #--------------------------------------------------------------------------
  1070.   # ● Update Boss Collapse
  1071.   #--------------------------------------------------------------------------  
  1072.   alias mog_damage_pop_update_boss_collapse update_boss_collapse
  1073.   def update_boss_collapse
  1074.       mog_damage_pop_update_boss_collapse
  1075.       execute_exp_pop
  1076.   end
  1077.  
  1078.   #--------------------------------------------------------------------------
  1079.   # ● Execute Exp Pop
  1080.   #--------------------------------------------------------------------------  
  1081.   def execute_exp_pop
  1082.       return if !MOG_DAMAGEPOPUP::EXP_GOLD_POPUP_BATTLE or @dam_exp != nil
  1083.       return if @battler == nil or @battler.is_a?(Game_Actor)
  1084.       @dam_exp = true
  1085.       if $imported[:mog_active_bonus_gauge] != nil
  1086.          real_exp = $game_troop.bonus_exp? ? @battler.exp * 2 : @battler.exp
  1087.          real_gold = $game_troop.bonus_gold? ? @battler.gold * 2 : @battler.gold
  1088.       else
  1089.          real_exp = @battler.exp ;  real_gold = @battler.gold
  1090.       end
  1091.       @battler.damage.push([real_exp,"Exp"]) if @battler.exp > 0
  1092.       @battler.damage.push([real_gold,"Gold"]) if @battler.gold > 0
  1093.   end   
  1094.  
  1095. end

Graphics.zip

735.95 KB, 下载次数: 16

脚本用到的图片

最佳答案

查看完整内容

搜索draw_text 把宽度width调大

Lv5.捕梦者

梦石
0
星屑
24302
在线时间
5048 小时
注册时间
2016-3-8
帖子
1618
2
发表于 2022-2-28 19:34:35 | 只看该作者
搜索draw_text
把宽度width调大

评分

参与人数 1+1 收起 理由
yz3440080 + 1 成功了!!!太感谢了T T!!

查看全部评分

回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1066
在线时间
360 小时
注册时间
2014-4-25
帖子
42
3
 楼主| 发表于 2022-2-28 21:43:40 | 只看该作者
alexncf125 发表于 2022-2-28 21:12
搜索draw_text
把宽度width调大

宽度解决了!不过一部分字会被截掉T T改了字体大小也不行……

点评

bitmap的宽度也调大试试  发表于 2022-2-28 21:54
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 11:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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