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

Project1

 找回密码
 注册会员
搜索
楼主: Sion
打印 上一主题 下一主题

[RMVA发布] VA鼠标脚本 6/9 更新 v2.32 by Sion

  [复制链接]

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
101
发表于 2013-11-14 22:58:49 | 只看该作者
您好这个和分辨率脚本不兼容,怎么解决?   这个错误@sprite.z = 9999

点评

哪个分辨率脚本?  发表于 2013-11-14 23:52
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
68
在线时间
208 小时
注册时间
2013-8-8
帖子
1296
102
发表于 2013-11-15 21:30:00 | 只看该作者
有个问题……
最早那个输入名称处理时,按右键可以撤销先前字体。为啥现在不行?
(顺便说:要是鼠标移到选择按钮时,按钮字体放大,就好了。望增加此功能)

点评

修正了,那个奇怪的功能就算了,还要自己写放大的算法 - -b  发表于 2013-11-15 22:16
我已经没有兴趣认真做游戏了……只能胡扯
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
103
发表于 2013-11-17 22:11:42 | 只看该作者
#与这个分辨率脚本冲突了
#encoding:utf-8
#==============================================================================
# ■ String
#------------------------------------------------------------------------------
#  String 类追加定义。
#==============================================================================

class String
  #----------------------------------------------------------------------------
  # ● API
  #----------------------------------------------------------------------------
  @@MultiByteToWideChar  = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i')
  @@WideCharToMultiByte  = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i')
  #----------------------------------------------------------------------------
  # ● UTF-8 转 Unicode
  #----------------------------------------------------------------------------
  def u2w
    i = @@MultiByteToWideChar.call(65001, 0 , self, -1, nil,0)
    buffer = "\0" * (i*2)
    @@MultiByteToWideChar.call(65001, 0 , self, -1, buffer, i)
    buffer.chop!
    return buffer
  end  
  #----------------------------------------------------------------------------
  # ● UTF-8 转系统编码
  #----------------------------------------------------------------------------
  def u2s
    i = @@MultiByteToWideChar.call(65001, 0 , self, -1, nil,0)
    buffer = "\0" * (i*2)
    @@MultiByteToWideChar.call(65001, 0 , self, -1, buffer, i)
    i = @@WideCharToMultiByte.call(0, 0, buffer, -1, nil, 0, nil, nil)
    result = "\0" * i
    @@WideCharToMultiByte.call(0, 0, buffer, -1, result, i, nil, nil)
    result.chop!
    return result
  end
  #----------------------------------------------------------------------------
  # ● 系统编码转 UTF-8
  #----------------------------------------------------------------------------
  def s2u
    i = @@MultiByteToWideChar.call(0, 0, self, -1, nil, 0)
    buffer = "\0" * (i*2)
    @@MultiByteToWideChar.call(0, 0, self, -1, buffer, buffer.size / 2)
    i = @@WideCharToMultiByte.call(65001, 0, buffer, -1, nil, 0, nil, nil)
    result = "\0" * i
    @@WideCharToMultiByte.call(65001, 0, buffer, -1, result, result.size, nil, nil)
    result.chop!
    return result
  end
end

#==============================================================================
# ■ AceResolutionMemoryPatch
#------------------------------------------------------------------------------
#  用于调整RMACE分辨率的内存补丁脚本,免修改DLL。
#
#   by 灼眼的夏娜(感谢fux2君提供内存地址)
#==============================================================================
# 更多脚本请转到 www.66rpg.com
#==============================================================================
module AceResolutionMemoryPatch

  GetModuleFileName       = Win32API.new("kernel32", "GetModuleFileName", "lpl", "l")
  GetPrivateProfileString = Win32API.new("kernel32", "GetPrivateProfileString", "pppplp", "l")
  GetModuleHandle         = Win32API.new("kernel32", "GetModuleHandle", "p", "l")
  RtlMoveMemory           = Win32API.new("kernel32", "RtlMoveMemory", "pli", "v")
  RtlMoveMemoryLP         = Win32API.new("kernel32", "RtlMoveMemory", "lpi", "v")
  VirtualProtect          = Win32API.new("kernel32", "VirtualProtect", "lllp", "i")
  FindWindow              = Win32API.new("user32", "FindWindow", "pp", "l")

  module_function

  def patch(width = 800, height = 600)
    # 获取句柄
    path = 0.chr * 256
    return false if 0 == GetModuleFileName.call(0, path, path.size)
    path = path.s2u.gsub!(/.exe/ ,".ini").u2s
    buff = 0.chr * 256
    return false if 0 == GetPrivateProfileString.call("Game", "Library", nil, buff, buff.size, path)
    buff.delete!("\0")
    rgsshandle = GetModuleHandle.call(buff)
    # 获取标题名和脚本名字
    title = 0.chr * 256
    return false if 0 == GetPrivateProfileString.call("Game", "Title", nil, title, title.size, path)
    title = title.s2u.delete("\0").u2s
    scripts = 0.chr * 256
    return false if 0 == GetPrivateProfileString.call("Game", "Scripts", nil, scripts, scripts.size, path)
    scripts = scripts.s2u.delete("\0").u2w
    # 地址表
    addr =
    {
      # 直接宽度替换
      :w0 => [0x000016EE, 0x000020F6, 0x000020FF, 0x0010DFED, 0x0010E025, 0x0010E059, 0x0010E08D, 0x000019AA, 0x00001A5B, 0x0001C528, 0x0001F49C, 0x0010E7E7, 0x0010EFE9],
      # 直接高度替换
      :h0 => [0x000016E9, 0x00002106, 0x0000210F, 0x0010DFE8, 0x0010E020, 0x0010E054, 0x0010E088, 0x000019A5, 0x00001A56, 0x0001C523, 0x0001F497, 0x0010E803, 0x0010EFF9],

      # 宽度+32
      :w1 => [0x000213E4],
      # 高度+32
      :h1 => [0x000213DF],

      # 最大宽度/32+1
      :w2 => [0x00021FE1],
      # 最大高度/32+1
      :h2 => [0x00021F5D]
    }
    # 更新
    w0 = [width].pack("L")
    addr[:w0].each{|ofs| return false if !write_memory(rgsshandle + ofs, w0)}
    h0 = [height].pack("L")
    addr[:h0].each{|ofs| return false if !write_memory(rgsshandle + ofs, h0)}
    w1 = [width + 32].pack("L")
    addr[:w1].each{|ofs| return false if !write_memory(rgsshandle + ofs, w1)}
    h1 = [height + 32].pack("L")
    addr[:h1].each{|ofs| return false if !write_memory(rgsshandle + ofs, h1)}
    w2 = [width / 32 + 1].pack("C")
    addr[:w2].each{|ofs| return false if !write_memory(rgsshandle + ofs, w2)}
    h2 = [height / 32 + 1].pack("C")
    addr[:h2].each{|ofs| return false if !write_memory(rgsshandle + ofs, h2)}
    # 重启
    rgssgamemain = Win32API.new(buff, "RGSSGameMain", "ipp", "v")
    rgssgamemain.call(FindWindow.call("RGSS Player", title), scripts, "")
    # 补丁成功
    return true
  end

  def write_memory(addr, str)
    old = 0.chr * 4
    return false if 0 == VirtualProtect.call(addr, str.size, 0x40, old)
    RtlMoveMemoryLP.call(addr, str, str.size)
    return false if 0 == VirtualProtect.call(addr, str.size, old.unpack("L").first, old)
    return true
  end
  private_class_method :write_memory

  def read_byte(addr)
    dst = 0.chr * 1
    RtlMoveMemory.call(dst, addr, dst.size)
    return dst.unpack("C").first
  end
  private_class_method :read_byte

  def read_dword(addr)
    dst = 0.chr * 4
    RtlMoveMemory.call(dst, addr, dst.size)
    return dst.unpack("L").first
  end
  private_class_method :read_dword

end

unless $ace_patched
  $ace_patched = true
  raise "应用分辨率补丁失败!" unless AceResolutionMemoryPatch.patch
  #raise RGSSReset.new
end

Graphics.resize_screen(800, 600)

点评

这个我不懂,没法解决。你用这个改分辨率吧 http://bbs.66rpg.com/forum.php?mod=viewthread&tid=216674,使用时将RMVA安装目录下的 dll 替换掉比较方便,记得备份。   发表于 2013-11-17 23:14
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
104
发表于 2013-11-17 23:16:18 | 只看该作者
谢谢,不用了,我直接在main那里改了。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
105
发表于 2013-11-18 20:37:59 | 只看该作者
发现了一个BUG,选择敌人的那个脚本,用 后知后觉的横版战斗系统,将敌人打死后,在下回合选择攻击时,一点击死亡的敌人,就卡住了...怎么解决。能帮改为判断,这个敌人HP<=0? 随机攻击其他敌人 如果这个敌人中途复活,则继续攻击它

点评

主楼那个敌人的脚本更新了  发表于 2013-11-24 22:24
有提问区的啊,可以去提问区问,请S叔过来不就好了嘛。版主还会给帮助你的S叔发好人卡,多好。  发表于 2013-11-20 21:08
http://pan.baidu.com/s/1vKPHu 我不敢回复了,怕被扣分  发表于 2013-11-20 20:50
传个可以直接运行测试的工程给我,脚本兼容的问题很麻烦,有空再弄的。  发表于 2013-11-18 23:05

评分

参与人数 2星屑 0 收起 理由
Sion + 20
怪蜀黍 -20 连帖违规,新人注意遵守版规

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者 (暗夜天使)

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
帖子
2309

贵宾

106
 楼主| 发表于 2013-11-23 22:05:47 | 只看该作者
夕仔 发表于 2013-11-18 20:37
发现了一个BUG,选择敌人的那个脚本,用 后知后觉的横版战斗系统,将敌人打死后,在下回合选择攻击时,一点 ...


那个BUG是早就修复了,主楼的脚本有更新。
你的传工程我今天才看到 - -b

点评

谢谢  发表于 2013-11-26 20:28
没看到呀...发给链接给我吧  发表于 2013-11-24 20:41
谢谢  发表于 2013-11-24 20:38
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
107
发表于 2013-11-26 20:31:02 | 只看该作者
在用魔法\特技的时候,那个选择技能的框框能不能隐藏?不然敌人看不太清楚,不方便点击

点评

速度真快,谢谢  发表于 2013-11-27 21:28
更新了  发表于 2013-11-27 11:22
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
108
发表于 2013-11-27 21:38:18 | 只看该作者
又出错了, 脚本“选择敌人”第105行:发生TypeError。  no implicit conversion from nil to integer

点评

这些功能原系统本来就没有提供,我也没时间去搞这些了。  发表于 2013-11-29 10:10
拜托啦..  发表于 2013-11-28 22:18
如果,被点击的 阵亡敌人 中途 复活,则继续打这个选定的敌人  发表于 2013-11-28 22:17
没有bug了,但是那个死了的敌人不能被点击了,怎么样弄才可以被点击? 我前面也有提到过,就是若点击已阵亡的敌人,则随机攻击其他敌人。  发表于 2013-11-28 22:16
谢谢,你太牛B了  发表于 2013-11-28 22:04
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
109
发表于 2013-12-5 21:30:49 | 只看该作者
您好能看下这个脚本吗?作者后知后觉比较忙可能不在吧。。问他都没反应的
你帮我看看呗
就是 设置多个角色时,多余的角色无法显示,但是这个角色还是存在的,就是不能显示出来。。  原版是4人
我改成5人,第五个人就是隐形的,但攻击的时候还可以播放动画,敌人也可以打到他。
  1. #==============================================================================
  2. # ■ 此脚本来自 www.66rpg.com
  3. #------------------------------------------------------------------------------
  4. #   名称:横版战斗模板
  5. #   作者:后知后觉([email protected])
  6. #   版本:v1.7  2012-02-09
  7. #   使用协议:在保留此脚本相关信息的情况下
  8. #             可任意使用、修改及修改后发布.
  9. #             如是修改后发布.请在作者标注那里加上 某某某改 等信息
  10. #             感谢你来这里谈谈你对这个工程的看法或报告BUG.
  11. #               http://rpg.blue/thread-216673-1-1.html
  12. #   使用说明:
  13. #       请来发布帖查看:
  14. #           http://rpg.blue/thread-216673-1-1.html
  15. #==============================================================================

  16. module Hzhj
  17.   module HorizontalBattleSystem
  18.     # 取得参战角色的最大数.如果要改大.需要在下面的坐标设置里增加对应的条目
  19.     MaxBattleMembers = 5
  20.    
  21.     ActorsBattlePosition = {}
  22.     # 设置角色战斗图形的坐标
  23.     # 等号左边的[]号里面的1 2 3 4 表示角色在队伍里的位置
  24.     # 等号右边的[]号里面的两个数字分别表示 X坐标 Y坐标
  25.     # 每次进入战斗的时候都会以这里设置的信息作为初始化位置.
  26.     # 如果你把上面的 MaxBattleMembers 改大了.比如改成了 5.
  27.     # 那么你需要在下面新增一行代码设置队伍中第5位置的坐标.
  28.     # 就像这样 ActorsBattlePosition[5] = [X坐标, Y坐标]
  29.     ActorsBattlePosition[1] = [424, 297]
  30.     ActorsBattlePosition[2] = [480, 229]
  31.     ActorsBattlePosition[3] = [527, 167]
  32.     ActorsBattlePosition[4] = [581, 103] #510,272
  33.     ActorsBattlePosition[5] = [360, 235]
  34.   
  35.    
  36.    
  37.     # 设置伤害值图形的色相 取值范围 0~360
  38.     DamageBitmapHue = 0
  39.     # 伤害值分段显示的标志SE文件名
  40.     DamageSectionDisplaySEName = "DamageSection"
  41.    
  42.     # 动画 Z 坐标值默认变化量
  43.     DefaultAniAddZ = 768
  44.    
  45.     # 状态动画 Z 坐标值默认变化量
  46.     DefaultLoopAniAddZ = 20
  47.    
  48.     # 战斗中角色的面向
  49.     ActorDirection = 4
  50.    
  51.     # 真位移的帧数
  52.     RealMoveDuration = 20
  53.     # 真位移移动前会计算目标点.会获取攻防双方战斗图大小来进行计算.
  54.     # 下面2个是对战斗图 width height 进行修正.
  55.     # 为正则扩大 为负则缩小.单位 像素.
  56.     # 一般来说不必修改.只有像梦幻群侠传那种战斗图四边有很多透明区域时才修正.
  57.     RealMoveBmpAddW = 0
  58.     RealMoveBmpAddH = 0
  59.    
  60.     # 使用技能、物品的过程默认使用RMVA模式
  61.     # 在该模式下.本脚本提供的很多功能受限无法使用.
  62.     DefaultUseRmvaMode = false
  63.    
  64.     # 默认显示敌人的HP条、MP条、TP条
  65.     DefaultDisplayEnemyBar = true
  66.    
  67.     # 一张战斗图中有几个样式(帧、格)
  68.     DynamicPatternMax = 4
  69.     # 一张战斗图中的一个样式持续多少帧
  70.     OnePatternDuration = 15
  71.    
  72.     # 角色使用战斗死亡图形
  73.     UseActorDeadGraphic = true
  74.     # 敌人使用战斗死亡图形
  75.     UseEnemyDeadGraphic = true
  76.    
  77.     # 使用挨打图形
  78.     UseBeatenGraphic = true
  79.     # 挨打图形维持帧数
  80.     BeatenGraphicDuration = 30
  81.    
  82.     # 是否使用角色防御图 只有同时使用了挨打图.此项才有效.
  83.     UseActorGuardGraphic = true
  84.     # 是否使用敌人防御图 只有同时使用了挨打图.此项才有效.
  85.     UseEnemyGuardGraphic = false
  86.    
  87.     # 角色是否使用挨打SE
  88.     UseActorWBSE = true
  89.     # 敌人是否使用挨打SE
  90.     UseEnemyWBSE = true
  91.     # 角色是否使用防御SE
  92.     UseActorGDSE = true
  93.     # 敌人是否使用防御SE
  94.     UseEnemyGDSE = false
  95.   end
  96. end

  97. class RPG::Actor < RPG::BaseItem
  98.   def battler_name
  99.     return @battler_name unless @battler_name.nil?
  100.     if /@btname\[(.+?)\]/ =~ @note
  101.       return (@battler_name = $1.clone)
  102.     else
  103.       return (@battler_name = "#{@name}_#{@nickname}")
  104.     end
  105.   end
  106.   def battler_hue
  107.     return @battler_hue unless @battler_hue.nil?
  108.     if /@bthue\[([0-9]+?)\]/ =~ @note
  109.       return (@battler_hue = $1.to_i.abs)
  110.     else
  111.       return (@battler_hue = 0)
  112.     end
  113.   end
  114.   attr_writer :battler_name
  115.   attr_writer :battler_hue
  116. end
  117. #==============================================================================
  118. # ■ Game_Actor
  119. #==============================================================================
  120. class Game_Actor < Game_Battler
  121.   #--------------------------------------------------------------------------
  122.   # ● 属性(新增定义)
  123.   #--------------------------------------------------------------------------
  124.   attr_writer   :battler_name             # 战斗图形文件名
  125.   attr_writer   :battler_hue              # 战斗图形色相
  126.   #--------------------------------------------------------------------------
  127.   # ● 设置(追加定义)
  128.   #--------------------------------------------------------------------------
  129.   alias hzhj_old_setup_for_add_actor_battle_graphic setup
  130.   def setup(actor_id)
  131.     hzhj_old_setup_for_add_actor_battle_graphic(actor_id)
  132.     @battler_name = actor.battler_name
  133.     @battler_hue = actor.battler_hue
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 是否使用活动块(重定义)
  137.   #--------------------------------------------------------------------------
  138.   def use_sprite?
  139.     return true
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 取得战斗画面 X 坐标(新增定义)
  143.   #--------------------------------------------------------------------------
  144.   def screen_x
  145.     return ActorsBattlePosition[index + 1][0]
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 取得战斗画面 Y 坐标(新增定义)
  149.   #--------------------------------------------------------------------------
  150.   def screen_y
  151.     return ActorsBattlePosition[index + 1][1]
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● 取得战斗画面 Z 坐标(新增定义)
  155.   #--------------------------------------------------------------------------
  156.   def screen_z
  157.     return real_screen_y + 100
  158.   end
  159. end
  160. #==============================================================================
  161. # ■ Game_Enemy
  162. #==============================================================================
  163. class Game_Enemy < Game_Battler
  164.   #--------------------------------------------------------------------------
  165.   # ● 属性(新增定义)
  166.   #--------------------------------------------------------------------------
  167.   attr_writer   :battler_name             # 战斗图形文件名
  168.   attr_writer   :battler_hue              # 战斗图形色相
  169.   #--------------------------------------------------------------------------
  170.   # ● 取得战斗画面 Z 坐标(重定义)
  171.   #--------------------------------------------------------------------------
  172.   def screen_z
  173.     return real_screen_y + 100
  174.   end
  175. end
  176. #==============================================================================
  177. # ■ Game_Party
  178. #==============================================================================
  179. class Game_Party < Game_Unit
  180.   include Hzhj::HorizontalBattleSystem
  181.   #--------------------------------------------------------------------------
  182.   # ● 取得参战角色的最大数(重定义)
  183.   #--------------------------------------------------------------------------
  184.   def max_battle_members
  185.     return MaxBattleMembers
  186.   end
  187. end

  188. class RPG::Animation
  189.   def wait_subject_duration
  190.     return @wait_subject_duration unless @wait_subject_duration.nil?
  191.     if /@w\[(\-??\d+?)\]/ =~ @name
  192.       @wait_subject_duration = $1.to_i
  193.     else
  194.       @wait_subject_duration = 0
  195.     end
  196.     return @wait_subject_duration
  197.   end
  198.   attr_writer :wait_subject_duration
  199. end
  200. class RPG::UsableItem < RPG::BaseItem
  201.   include Hzhj::HorizontalBattleSystem
  202.   def animation1_id
  203.     return @animation1_id unless @animation1_id.nil?
  204.     if /@a1id\[(\d+?)\]/i =~ @note
  205.       return (@animation1_id = $1.to_i)
  206.     else
  207.       return (@animation1_id = 0)
  208.     end
  209.   end
  210.   def wljn
  211.     return @wljn unless @wljn.nil?
  212.     if /@wljn/i =~ @note
  213.       return (@wljn = true)
  214.     else
  215.       return (@wljn = false)
  216.     end
  217.   end
  218.   def rmva_mode
  219.     return @rmva_mode unless @rmva_mode.nil?
  220.     if /@rmva/i =~ @note
  221.       return (@rmva_mode = !DefaultUseRmvaMode)
  222.     else
  223.       return (@rmva_mode = DefaultUseRmvaMode)
  224.     end
  225.   end
  226.   attr_writer :animation1_id
  227.   attr_writer :wljn
  228.   attr_writer :rmva_mode
  229. end
  230. class RPG::Weapon < RPG::EquipItem
  231.   def animation1_id
  232.     return @animation1_id unless @animation1_id.nil?
  233.     if /@a1id\[(\d+?)\]/ =~ @note
  234.       return (@animation1_id = $1.to_i)
  235.     else
  236.       return (@animation1_id = 0)
  237.     end
  238.   end
  239.   attr_writer :animation1_id
  240. end
  241. class RPG::Enemy < RPG::BaseItem
  242.   def animation1_id
  243.     return @animation1_id unless @animation1_id.nil?
  244.     if /@a1id\[(\d+?)\]/ =~ @note
  245.       return (@animation1_id = $1.to_i)
  246.     else
  247.       return (@animation1_id = 0)
  248.     end
  249.   end
  250.   def animation2_id
  251.     return @animation2_id unless @animation2_id.nil?
  252.     if /@a2id\[(\d+?)\]/ =~ @note
  253.       return (@animation2_id = $1.to_i)
  254.     else
  255.       return (@animation2_id = 0)
  256.     end
  257.   end
  258.   def animation3_id
  259.     return @animation3_id unless @animation3_id.nil?
  260.     if /@a3id\[(\d+?)\]/ =~ @note
  261.       return (@animation3_id = $1.to_i)
  262.     else
  263.       return (@animation3_id = 0)
  264.     end
  265.   end
  266.   attr_writer :animation1_id
  267.   attr_writer :animation2_id
  268.   attr_writer :animation3_id
  269. end
  270. #==============================================================================
  271. # ■ Game_Actor
  272. #==============================================================================
  273. class Game_Actor < Game_Battler
  274.   #--------------------------------------------------------------------------
  275.   # ● 取得普通攻击的行动方动画 ID (新增定义)
  276.   #--------------------------------------------------------------------------
  277.   def animation1_id
  278.     if dual_wield?
  279.       return weapons[0].animation1_id if weapons[0]
  280.       return weapons[1] ? weapons[1].animation1_id : 0
  281.     else
  282.       return weapons[0] ? weapons[0].animation1_id : 0
  283.     end
  284.   end
  285. end
  286. #==============================================================================
  287. # ■ Game_Enemy
  288. #==============================================================================
  289. class Game_Enemy < Game_Battler
  290.   #--------------------------------------------------------------------------
  291.   # ● 取得普通攻击的行动方动画 ID (新增定义)
  292.   #--------------------------------------------------------------------------
  293.   def animation1_id
  294.     return enemy.animation1_id
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● 取得普通攻击的动画 ID (新增定义)
  298.   #--------------------------------------------------------------------------
  299.   def atk_animation_id1
  300.     return enemy.animation2_id
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # ● 取得普通攻击的动画 ID (二刀流:武器2)(新增定义)
  304.   #--------------------------------------------------------------------------
  305.   def atk_animation_id2
  306.     return enemy.animation3_id
  307.   end
  308. end
  309. #==============================================================================
  310. # ■ Scene_Battle
  311. #==============================================================================
  312. class Scene_Battle < Scene_Base
  313.   include Hzhj::HorizontalBattleSystem
  314.   #--------------------------------------------------------------------------
  315.   # ● 使用技能/物品(重定义)
  316.   #--------------------------------------------------------------------------
  317.   def use_item
  318.     item = @subject.current_action.item
  319.     @log_window.display_use_item(@subject, item)
  320.     @subject.use_item(item)
  321.     refresh_status
  322.     targets = @subject.current_action.make_targets.compact
  323.     show_animation(targets, item.animation_id)
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 显示动画(重定义)
  327.   #--------------------------------------------------------------------------
  328.   def show_animation(targets, animation_id)
  329.     item = @subject.current_action.item
  330.     if item.rmva_mode
  331.       show_rmva_animation(targets, animation_id, item)
  332.     else
  333.       show_hzhj_animation(targets, animation_id, item)
  334.     end
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● RMVA模式显示动画(新增定义)
  338.   #--------------------------------------------------------------------------
  339.   def show_rmva_animation(targets, animation_id, item)
  340.     @subject.damage_section_displayed = false
  341.     @subject.not_damage_section = true
  342.     targets.each do |target|
  343.       target.damage_section_displayed = false
  344.       target.not_damage_section = true
  345.     end
  346.     if animation_id < 0
  347.       show_attack_animation(targets)
  348.     else
  349.       show_rmva_usable_animation(targets, animation_id, item)
  350.     end
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● HZHJ模式显示动画(新增定义)
  354.   #--------------------------------------------------------------------------
  355.   def show_hzhj_animation(targets, animation_id, item)
  356.     if animation_id < 0
  357.       show_hzhj_attack_animation(targets, item)
  358.     else
  359.       if item.wljn
  360.         show_wljn_skill_animation(targets, animation_id, item)
  361.       else
  362.         show_magic_skill_animation(targets, animation_id, item)
  363.       end
  364.     end
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ● HZHJ模式显示攻击动画(重定义)
  368.   #--------------------------------------------------------------------------
  369.   def show_hzhj_attack_animation(targets, item)
  370.     ary = []
  371.     need_move = false
  372.     animation1 = $data_animations[@subject.animation1_id]
  373.     need_move = animation1.need_move if animation1
  374.     come_back = true
  375.     targets.each_with_index do |target, i|
  376.       ary[0] = target
  377.       item.repeats.times do
  378.         next if target.dead? && item.damage.type == 1
  379.         next if @subject.dead?
  380.         next if [email protected]_action
  381.         if need_move && come_back
  382.           come_back = false
  383.           @subject.setup_move_info(target, RealMoveDuration, animation1.move_se)
  384.           wait_for_move
  385.         end
  386.         damage_target = hzhj_apply_item_effects(target, item)
  387.         show_subject_animation(@subject.animation1_id)
  388.         show_normal_animation(ary, @subject.atk_animation_id1, false)
  389.         show_normal_animation(ary, @subject.atk_animation_id2, true)
  390.         @log_window.wait
  391.         wait_for_animation
  392.         hzhj_invoke_item(target, item, damage_target)
  393.       end
  394.       if need_move
  395.         if target != targets[i+1] or target.dead?
  396.           come_back = true
  397.           @subject.come_back_self_position(RealMoveDuration)
  398.           wait_for_move
  399.         else
  400.           come_back = false
  401.         end
  402.       end
  403.     end
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● HZHJ模式显示物理技能类动画(新增定义)
  407.   #--------------------------------------------------------------------------
  408.   def show_wljn_skill_animation(targets, animation_id, item)
  409.     ary = []
  410.     need_move = false
  411.     animation1 = $data_animations[item.animation1_id]
  412.     need_move = animation1.need_move if animation1
  413.     come_back = true
  414.     targets.each_with_index do |target, i|
  415.       ary[0] = target
  416.       item.repeats.times do
  417.         next if target.dead? && item.damage.type == 1
  418.         next if @subject.dead?
  419.         next if [email protected]_action
  420.         if need_move && come_back
  421.           come_back = false
  422.           @subject.setup_move_info(target, RealMoveDuration, animation1.move_se)
  423.           wait_for_move
  424.         end
  425.         damage_target = hzhj_apply_item_effects(target, item)
  426.         show_subject_animation(item.animation1_id)
  427.         show_normal_animation(ary, animation_id, false)
  428.         @log_window.wait
  429.         wait_for_animation
  430.         hzhj_invoke_item(target, item, damage_target)
  431.       end
  432.       if need_move
  433.         if target != targets[i+1] or target.dead?
  434.           come_back = true
  435.           @subject.come_back_self_position(RealMoveDuration)
  436.           wait_for_move
  437.         else
  438.           come_back = false
  439.         end
  440.       end
  441.     end
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● HZHJ模式显示魔法技能类动画(新增定义)
  445.   #--------------------------------------------------------------------------
  446.   def show_magic_skill_animation(targets, animation_id, item)
  447.     ary = []
  448.     damage_targets = {}
  449.     item.repeats.times do
  450.       next if @subject.dead?
  451.       next if [email protected]_action
  452.       ary.clear
  453.       damage_targets.clear
  454.       targets.each do |target|
  455.         next if target.dead? && item.damage.type == 1
  456.         ary << target
  457.         damage_targets[target] = hzhj_apply_item_effects(target, item)
  458.       end
  459.       next if ary.empty?
  460.       show_subject_animation(item.animation1_id)
  461.       show_normal_animation(ary, animation_id)
  462.       @log_window.wait
  463.       wait_for_animation
  464.       ary.each do |target|
  465.         hzhj_invoke_item(target, item, damage_targets[target])
  466.       end
  467.       if [9, 10].include?(item.scope)
  468.         ary.each do |target|
  469.           if target.alive?
  470.             target.come_back_self_position(RealMoveDuration)
  471.           end
  472.         end
  473.         wait_for_move
  474.       end
  475.     end
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● RMVA模式显示攻击动画(重定义)
  479.   #--------------------------------------------------------------------------
  480.   def show_attack_animation(targets)
  481.     item = @subject.current_action.item
  482.     show_subject_animation(@subject.animation1_id)
  483.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  484.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  485.     @log_window.wait
  486.     wait_for_animation
  487.     targets.each {|target| item.repeats.times { invoke_item(target, item) } }
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ● RMVA模式显示技能、物品动画 (新增定义)
  491.   #--------------------------------------------------------------------------
  492.   def show_rmva_usable_animation(targets, animation_id, item)
  493.     show_subject_animation(item.animation1_id)
  494.     show_normal_animation(targets, animation_id)
  495.     @log_window.wait
  496.     wait_for_animation
  497.     targets.each {|target| item.repeats.times { invoke_item(target, item) } }
  498.     if [9, 10].include?(item.scope)
  499.       targets.each do |target|
  500.         if target.alive?
  501.           target.come_back_self_position(RealMoveDuration)
  502.         end
  503.       end
  504.       wait_for_move
  505.     end
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ● 显示行动方动画(新增定义)
  509.   #--------------------------------------------------------------------------
  510.   def show_subject_animation(animation_id, subject = @subject, mirror = false)
  511.     animation = $data_animations[animation_id]
  512.     if animation
  513.       subject.animation_id = animation_id
  514.       subject.animation_mirror = mirror
  515.       if animation.wait_subject_duration < 0
  516.         wait_for_animation
  517.       elsif animation.wait_subject_duration > 0
  518.         animation.wait_subject_duration.times{update_for_wait}
  519.       end
  520.     end
  521.   end
  522. end

  523. class RPG::Animation
  524.   include Hzhj::HorizontalBattleSystem
  525.   def ani_z_correction
  526.     return @ani_z_correction unless @ani_z_correction.nil?
  527.     if /@az\[(\-??\d+?)\]/ =~ @name
  528.       return (@ani_z_correction = $1.to_i)
  529.     else
  530.       return (@ani_z_correction = DefaultAniAddZ)
  531.     end
  532.   end
  533.   def loop_z_correction
  534.     return @loop_z_correction unless @loop_z_correction.nil?
  535.     if /@lz\[(\-??\d+?)\]/ =~ @name
  536.       return (@loop_z_correction = $1.to_i)
  537.     else
  538.       return (@loop_z_correction = DefaultLoopAniAddZ)
  539.     end
  540.   end
  541.   attr_writer :ani_z_correction
  542.   attr_writer :loop_z_correction
  543. end
  544. class RPG::State < RPG::BaseItem
  545.   def animation_id
  546.     return @animation_id unless @animation_id.nil?
  547.     if /@aid\[(\d+?)\]/ =~ @note
  548.       return (@animation_id = $1.to_i)
  549.     else
  550.       return (@animation_id = 0)
  551.     end
  552.   end
  553.   attr_writer :animation_id
  554. end
  555. #==============================================================================
  556. # ■ Game_BattlerBase
  557. #==============================================================================
  558. class Game_BattlerBase
  559.   #--------------------------------------------------------------------------
  560.   # ● 实例变量(新增定义)
  561.   #--------------------------------------------------------------------------
  562.   attr_reader   :hzhj_add_state_id
  563.   attr_reader   :hzhj_remove_state_id
  564.   attr_accessor :need_update_state_animation
  565.   #--------------------------------------------------------------------------
  566.   # ● 初始化(追加定义)
  567.   #--------------------------------------------------------------------------
  568.   alias hzhj_old_init_for_state_ani_game_battler_base initialize
  569.   def initialize
  570.     @hzhj_add_state_id = []
  571.     @hzhj_remove_state_id = []
  572.     @need_update_state_animation = false
  573.     @states = []
  574.     @state_turns = {}
  575.     @state_steps = {}
  576.     hzhj_old_init_for_state_ani_game_battler_base
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # ● 清除状态信息(追加定义)
  580.   #--------------------------------------------------------------------------
  581.   alias hzhj_old_clear_states_for_state_ani_game_battler_base clear_states
  582.   def clear_states
  583.     old_states = @states.clone
  584.     hzhj_old_clear_states_for_state_ani_game_battler_base
  585.     bingji = old_states | @states
  586.     return if bingji.empty?
  587.     set_add_state_id(bingji & @states)
  588.     set_remove_state_id(bingji & old_states)
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ● 消除状态(追加定义)
  592.   #--------------------------------------------------------------------------
  593.   alias hzhj_old_erase_state_for_state_ani_game_battler_base erase_state
  594.   def erase_state(state_id)
  595.     old_states = @states.clone
  596.     hzhj_old_erase_state_for_state_ani_game_battler_base(state_id)
  597.     bingji = old_states | @states
  598.     return if bingji.empty?
  599.     set_add_state_id(bingji & @states)
  600.     set_remove_state_id(bingji & old_states)
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● 设置增加的状态(新增定义)
  604.   #--------------------------------------------------------------------------
  605.   def set_add_state_id(zjdzt)
  606.     for i in zjdzt
  607.       if $data_states[i].animation_id > 0
  608.         if not @hzhj_add_state_id.include?(i)
  609.           @hzhj_add_state_id.push(i)
  610.         end
  611.       end
  612.     end
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● 设置解除的状态(新增定义)
  616.   #--------------------------------------------------------------------------
  617.   def set_remove_state_id(jsdzt)
  618.     for i in jsdzt
  619.       if $data_states[i].animation_id > 0
  620.         if not @hzhj_remove_state_id.include?(i)
  621.           ani_id = $data_states[i].animation_id
  622.           not_end_loop_animation = false
  623.           for state in self.states
  624.             if state.animation_id == ani_id
  625.               not_end_loop_animation = true
  626.               break
  627.             end
  628.           end
  629.           unless not_end_loop_animation
  630.             @hzhj_remove_state_id.push(i)
  631.           end
  632.         end
  633.       end
  634.     end
  635.   end
  636. end
  637. #==============================================================================
  638. # ■ Game_Battler
  639. #==============================================================================
  640. class Game_Battler < Game_BattlerBase
  641.   #--------------------------------------------------------------------------
  642.   # ● 附加新的状态(追加定义)
  643.   #--------------------------------------------------------------------------
  644.   alias hzhj_old_add_new_state_for_state_ani_game_battler add_new_state
  645.   def add_new_state(state_id)
  646.     old_states = @states.clone
  647.     hzhj_old_add_new_state_for_state_ani_game_battler(state_id)
  648.     bingji = old_states | @states
  649.     return if bingji.empty?
  650.     set_add_state_id(bingji & @states)
  651.     set_remove_state_id(bingji & old_states)
  652.   end
  653. end
  654. #==============================================================================
  655. # ■ Sprite_Base
  656. #==============================================================================
  657. class Sprite_Base < Sprite
  658.   #--------------------------------------------------------------------------
  659.   # ● 初始化(追加定义)
  660.   #--------------------------------------------------------------------------
  661.   alias hzhj_old_init_for_state_ani_spr_base initialize
  662.   def initialize(*args)
  663.     hzhj_old_init_for_state_ani_spr_base(*args)
  664.     @hzhj_loop_animations = []
  665.     @hzhj_loop_durations = {}
  666.     @hzhj_loop_sprites = {}
  667.     @hzhj_loop_bitmap1s = {}
  668.     @hzhj_loop_bitmap2s = {}
  669.     @hzhj_loop_ani_oxs = {}
  670.     @hzhj_loop_ani_oys = {}
  671.     @flash_nil_duration = 0
  672.   end
  673.   #--------------------------------------------------------------------------
  674.   # ● 释放(追加定义)
  675.   #--------------------------------------------------------------------------
  676.   alias hzhj_old_dispose_for_state_ani_spr_base dispose
  677.   def dispose
  678.     dispose_loop_animation
  679.     hzhj_old_dispose_for_state_ani_spr_base
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # ● 设定动画的活动块(追加定义)
  683.   #--------------------------------------------------------------------------
  684.   alias hzhj_old_ani_set_spr_for_state_ani_spr_base animation_set_sprites
  685.   def animation_set_sprites(*args)
  686.     hzhj_old_ani_set_spr_for_state_ani_spr_base(*args)
  687.     @ani_sprites.each{|sprite|sprite.z += @animation.ani_z_correction}
  688.   end
  689.   #--------------------------------------------------------------------------
  690.   # ● 判断是否有循环动画(新增定义)
  691.   #--------------------------------------------------------------------------
  692.   def loop_animation?
  693.     return (not @hzhj_loop_animations.empty?)
  694.   end
  695.   #--------------------------------------------------------------------------
  696.   # ● 开始播放循环动画(新增定义)
  697.   #--------------------------------------------------------------------------
  698.   def start_loop_animation(animation)
  699.     return if @hzhj_loop_animations.include?(animation)
  700.     if animation.nil?
  701.       dispose_loop_animation
  702.       return
  703.     end
  704.     set_animation_rate
  705.     @hzhj_loop_animations.push(animation)
  706.     init_loop_animation_duration(animation)
  707.     load_loop_animation_bitmap(animation)
  708.     make_loop_animation_sprites(animation)
  709.     set_loop_animation_origin(animation)
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # ● 初始化循环动画播放位置(新增定义)
  713.   #--------------------------------------------------------------------------
  714.   def init_loop_animation_duration(animation)
  715.     @hzhj_loop_durations[animation] = animation.frame_max * @ani_rate + 1
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ● 读取循环动画图像(新增定义)
  719.   #--------------------------------------------------------------------------
  720.   def load_loop_animation_bitmap(animation)
  721.     animation1_name = animation.animation1_name
  722.     animation1_hue = animation.animation1_hue
  723.     animation2_name = animation.animation2_name
  724.     animation2_hue = animation.animation2_hue
  725.     bitmap1 = Cache.animation(animation1_name, animation1_hue)
  726.     bitmap2 = Cache.animation(animation2_name, animation2_hue)
  727.     if @@_reference_count.include?(bitmap1)
  728.       @@_reference_count[bitmap1] += 1
  729.     else
  730.       @@_reference_count[bitmap1] = 1
  731.     end
  732.     if @@_reference_count.include?(bitmap2)
  733.       @@_reference_count[bitmap2] += 1
  734.     else
  735.       @@_reference_count[bitmap2] = 1
  736.     end
  737.     @hzhj_loop_bitmap1s[animation] = bitmap1
  738.     @hzhj_loop_bitmap2s[animation] = bitmap2
  739.     Graphics.frame_reset
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # ● 生成循环动画活动块(新增定义)
  743.   #--------------------------------------------------------------------------
  744.   def make_loop_animation_sprites(animation)
  745.     sprites = []
  746.     if @use_sprite
  747.       16.times do
  748.         sprite = ::Sprite.new(viewport)
  749.         sprite.visible = false
  750.         sprites.push(sprite)
  751.       end
  752.     end
  753.     @hzhj_loop_sprites[animation] = sprites
  754.   end
  755.   #--------------------------------------------------------------------------
  756.   # ● 设定循环动画的原点(新增定义)
  757.   #--------------------------------------------------------------------------
  758.   def set_loop_animation_origin(animation)
  759.     if animation.position == 3
  760.       if viewport == nil
  761.         ani_ox = Graphics.width / 2
  762.         ani_oy = Graphics.height / 2
  763.       else
  764.         ani_ox = viewport.rect.width / 2
  765.         ani_oy = viewport.rect.height / 2
  766.       end
  767.     else
  768.       ani_ox = x - ox + width / 2
  769.       ani_oy = y - oy + height / 2
  770.       if animation.position == 0
  771.         ani_oy -= height / 2
  772.       elsif animation.position == 2
  773.         ani_oy += height / 2
  774.       end
  775.     end
  776.     @hzhj_loop_ani_oxs[animation] = ani_ox
  777.     @hzhj_loop_ani_oys[animation] = ani_oy
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ● 释放所有循环动画(新增定义)
  781.   #--------------------------------------------------------------------------
  782.   def dispose_loop_animation
  783.     return unless loop_animation?
  784.     for animation in @hzhj_loop_animations.clone
  785.       end_loop_animation(animation)
  786.     end
  787.     @hzhj_loop_durations.clear
  788.     @hzhj_loop_sprites.clear
  789.     @hzhj_loop_bitmap1s.clear
  790.     @hzhj_loop_bitmap2s.clear
  791.     @hzhj_loop_ani_oxs.clear
  792.     @hzhj_loop_ani_oys.clear
  793.     @hzhj_loop_animations.clear
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● 结束某个循环动画(新增定义)
  797.   #--------------------------------------------------------------------------
  798.   def end_loop_animation(animation)
  799.     return if not @hzhj_loop_animations.include?(animation)
  800.     bitmap1 = @hzhj_loop_bitmap1s[animation]
  801.     @@_reference_count[bitmap1] -= 1
  802.     if @@_reference_count[bitmap1] == 0
  803.       @@_reference_count.delete(bitmap1)
  804.       bitmap1.dispose
  805.     end
  806.     bitmap2 = @hzhj_loop_bitmap2s[animation]
  807.     @@_reference_count[bitmap2] -= 1
  808.     if @@_reference_count[bitmap2] == 0
  809.       @@_reference_count.delete(bitmap2)
  810.       bitmap2.dispose
  811.     end
  812.     sprites = @hzhj_loop_sprites[animation]
  813.     for sprite in sprites
  814.       sprite.dispose
  815.     end
  816.     @hzhj_loop_durations.delete(animation)
  817.     @hzhj_loop_sprites.delete(animation)
  818.     @hzhj_loop_bitmap1s.delete(animation)
  819.     @hzhj_loop_bitmap2s.delete(animation)
  820.     @hzhj_loop_ani_oxs.delete(animation)
  821.     @hzhj_loop_ani_oys.delete(animation)
  822.     @hzhj_loop_animations.delete(animation)
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # ● 刷新(追加定义)
  826.   #--------------------------------------------------------------------------
  827.   alias hzhj_old_update_for_state_ani_spr_base update
  828.   def update
  829.     hzhj_old_update_for_state_ani_spr_base
  830.     update_loop_animation
  831.   end
  832.   #--------------------------------------------------------------------------
  833.   # ● 刷新循环动画(新增定义)
  834.   #--------------------------------------------------------------------------
  835.   def update_loop_animation
  836.     @flash_nil_duration -= 1 if @flash_nil_duration > 0
  837.     return unless loop_animation?
  838.     for animation in @hzhj_loop_animations
  839.       @hzhj_loop_durations[animation] -= 1
  840.       duration = @hzhj_loop_durations[animation]
  841.       if duration % @ani_rate == 0
  842.         if duration > 0
  843.           set_loop_animation_origin(animation)
  844.           frame_index = animation.frame_max
  845.           frame_index -= (duration + @ani_rate - 1) / @ani_rate
  846.           args = []
  847.           args[0] = @hzhj_loop_sprites[animation]
  848.           args[1] = @hzhj_loop_bitmap1s[animation]
  849.           args[2] = @hzhj_loop_bitmap2s[animation]
  850.           args[3] = @hzhj_loop_ani_oxs[animation]
  851.           args[4] = @hzhj_loop_ani_oys[animation]
  852.           args[5] = animation.loop_z_correction
  853.           args[6] = ((not flash_nil? or animation.to_screen?) and visible)
  854.           loop_animation_set_sprites(animation.frames[frame_index], args)
  855.           animation.timings.each do |timing|
  856.             loop_animation_process_timing(timing) if timing.frame == frame_index
  857.           end
  858.         else
  859.           init_loop_animation_duration(animation)
  860.           redo
  861.         end
  862.       end
  863.     end
  864.   end
  865.   #--------------------------------------------------------------------------
  866.   # ● 设定循环动画的活动块(新增定义)
  867.   #--------------------------------------------------------------------------
  868.   def loop_animation_set_sprites(frame, args)
  869.     sprites = args[0]
  870.     bitmap1 = args[1]
  871.     bitmap2 = args[2]
  872.     ani_ox = args[3]
  873.     ani_oy = args[4]
  874.     loop_z_correction = args[5]
  875.     state_visible = args[6]
  876.     cell_data = frame.cell_data
  877.     sprites.each_with_index do |sprite, i|
  878.       next unless sprite
  879.       pattern = cell_data[i, 0]
  880.       if !pattern || pattern < 0
  881.         sprite.visible = false
  882.         next
  883.       end
  884.       sprite.bitmap = pattern < 100 ? bitmap1 : bitmap2
  885.       sprite.visible = state_visible
  886.       sprite.src_rect.set(pattern % 5 * 192,
  887.         pattern % 100 / 5 * 192, 192, 192)
  888.       sprite.x = ani_ox + cell_data[i, 1]
  889.       sprite.y = ani_oy + cell_data[i, 2]
  890.       sprite.angle = cell_data[i, 4]
  891.       sprite.mirror = (cell_data[i, 5] == 1)
  892.       if loop_z_correction > 9999
  893.         sprite.z = loop_z_correction % 10000 + i
  894.       elsif loop_z_correction < -9999
  895.         sprite.z = loop_z_correction % -10000 + i
  896.       else
  897.         sprite.z = self.z + loop_z_correction + i
  898.       end
  899.       sprite.ox = 96
  900.       sprite.oy = 96
  901.       sprite.zoom_x = cell_data[i, 3] / 100.0
  902.       sprite.zoom_y = cell_data[i, 3] / 100.0
  903.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  904.       sprite.blend_type = cell_data[i, 7]
  905.     end
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # ● 循环动画SE 和闪烁时机的处理(新增定义)
  909.   #--------------------------------------------------------------------------
  910.   def loop_animation_process_timing(timing)
  911.     timing.se.play
  912.     case timing.flash_scope
  913.     when 1
  914.       self.flash(timing.flash_color, timing.flash_duration * @ani_rate)
  915.     when 2
  916.       if viewport
  917.         viewport.flash(timing.flash_color, timing.flash_duration * @ani_rate)
  918.       end
  919.     when 3
  920.       self.flash(nil, timing.flash_duration * @ani_rate)
  921.     end
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # ● 设置闪烁(追加定义)
  925.   #--------------------------------------------------------------------------
  926.   alias hzhj_old_flash_for_state_ani_spr_base flash
  927.   def flash(*args)
  928.     if args[0].nil?
  929.       @flash_nil_duration = args[1]
  930.     else
  931.       @flash_nil_duration = 0
  932.     end
  933.     hzhj_old_flash_for_state_ani_spr_base(*args)
  934.   end
  935.   #--------------------------------------------------------------------------
  936.   # ● 判断是否正处于【隐藏目标】(新增定义)
  937.   #--------------------------------------------------------------------------
  938.   def flash_nil?
  939.     return (@flash_nil_duration > 0)
  940.   end
  941. end
  942. #==============================================================================
  943. # ■ Sprite_Battler
  944. #==============================================================================
  945. class Sprite_Battler < Sprite_Base
  946.   #--------------------------------------------------------------------------
  947.   # ● 初始化(追加定义)
  948.   #--------------------------------------------------------------------------
  949.   alias hzhj_old_init_for_state_ani_spr_battler initialize
  950.   def initialize(*args)
  951.     hzhj_old_init_for_state_ani_spr_battler(*args)
  952.     init_battler_add_state_id
  953.   end
  954.   #--------------------------------------------------------------------------
  955.   # ● 初始化战斗者要播放状态动画的状态(新增定义)
  956.   #--------------------------------------------------------------------------
  957.   def init_battler_add_state_id
  958.     if @battler.nil?
  959.       dispose_loop_animation
  960.     else
  961.       @battler.hzhj_add_state_id.clear
  962.       @battler.hzhj_remove_state_id.clear
  963.       @battler.need_update_state_animation = true
  964.       for state in @battler.states
  965.         next if state.nil?
  966.         next if $data_animations[state.animation_id].nil?
  967.         @battler.hzhj_add_state_id.push(state.id)
  968.       end
  969.     end
  970.   end
  971.   #--------------------------------------------------------------------------
  972.   # ● 设置战斗者(追加定义)
  973.   #--------------------------------------------------------------------------
  974.   alias hzhj_old_battlerdy_for_state_ani_spr_battler battler=
  975.   def battler=(value)
  976.     old_battler = @battler
  977.     hzhj_old_battlerdy_for_state_ani_spr_battler(value)
  978.     if old_battler != @battler
  979.       init_battler_add_state_id
  980.     end
  981.   end
  982.   #--------------------------------------------------------------------------
  983.   # ● 刷新(追加定义)
  984.   #--------------------------------------------------------------------------
  985.   alias hzhj_old_update_for_state_ani_spr_battler update
  986.   def update
  987.     hzhj_old_update_for_state_ani_spr_battler
  988.     if @battler
  989.       if @battler.need_update_state_animation
  990.         @battler.need_update_state_animation = false
  991.         if not @battler.hzhj_add_state_id.empty?
  992.           for i in @battler.hzhj_add_state_id
  993.             if @battler.state?(i)
  994.               ani_id = $data_states[i].animation_id
  995.               animation = $data_animations[ani_id]
  996.               start_loop_animation(animation) if not animation.nil?
  997.             end
  998.           end
  999.           @battler.hzhj_add_state_id.clear
  1000.         end
  1001.         if not @battler.hzhj_remove_state_id.empty?
  1002.           for i in @battler.hzhj_remove_state_id
  1003.             if not @battler.state?(i)
  1004.               ani_id = $data_states[i].animation_id
  1005.               animation = $data_animations[ani_id]
  1006.               end_loop_animation(animation) if not animation.nil?
  1007.             end
  1008.           end
  1009.           @battler.hzhj_remove_state_id.clear
  1010.         end
  1011.       end
  1012.     end
  1013.   end
  1014. end
  1015. #==============================================================================
  1016. # ■ Window_BattleLog
  1017. #==============================================================================
  1018. class Window_BattleLog < Window_Selectable
  1019.   #--------------------------------------------------------------------------
  1020.   # ● 显示状态附加/解除(追加定义)
  1021.   #--------------------------------------------------------------------------
  1022.   alias hzhj_old_display_status_for_state_ani_wnd_btlog display_changed_states
  1023.   def display_changed_states(target)
  1024.     target.need_update_state_animation = true
  1025.     hzhj_old_display_status_for_state_ani_wnd_btlog(target)
  1026.   end
  1027. end

  1028. #==============================================================================
  1029. # ■ Sprite_Damage (新增类)
  1030. #==============================================================================
  1031. class Sprite_Damage < Sprite
  1032.   include Hzhj::HorizontalBattleSystem
  1033.   #--------------------------------------------------------------------------
  1034.   # ● 获取/生成伤害值源图
  1035.   #--------------------------------------------------------------------------
  1036.   @@obmp = nil
  1037.   def self.obmp
  1038.     if @@obmp.nil? or @@obmp.disposed?
  1039.       @@obmp = Bitmap.new(180, 256)
  1040.       @@obmp.font.bold = true
  1041.       @@obmp.font.shadow = false
  1042.       @@obmp.font.outline = true
  1043.       @@obmp.font.out_color = Color.new(255, 255, 255, 255)
  1044.       @@obmp.font.size = 32
  1045.       colors = []
  1046.       colors.push(Color.new(255,   0,   0, 255))
  1047.       colors.push(Color.new(255, 128, 128, 255))
  1048.       colors.push(Color.new(  0,   0, 255, 255))
  1049.       colors.push(Color.new(128, 128, 255, 255))
  1050.       colors.push(Color.new(  0, 255,   0, 255))
  1051.       colors.push(Color.new(128, 255, 128, 255))
  1052.       colors.each_with_index do |color, hi|
  1053.         @@obmp.font.color = color
  1054.         for wi in 0..9
  1055.           @@obmp.draw_text(wi * 18, hi * 32, 18, 32, "#{wi}", 1)
  1056.         end
  1057.       end
  1058.       @@obmp.font.size = 20
  1059.       @@obmp.font.italic = true
  1060.       @@obmp.font.out_color = Color.new(0, 0, 0, 255)
  1061.       @@obmp.font.color = Color.new(255, 255, 255, 255)
  1062.       @@obmp.draw_text( 0, 192, 90, 32, "Critical", 1)
  1063.       @@obmp.draw_text(90, 192, 90, 32, "Miss", 1)
  1064.       @@obmp.draw_text( 0, 224, 90, 32, "Evasion", 1)
  1065.       @@obmp.hue_change(DamageBitmapHue)
  1066.     end
  1067.     return @@obmp
  1068.   end
  1069.   #--------------------------------------------------------------------------
  1070.   # ● 初始化
  1071.   #--------------------------------------------------------------------------
  1072.   def initialize(viewport, args)
  1073.     super(viewport)
  1074.     @type = args[0]
  1075.     @value = args[1]
  1076.     @critical = args[2]
  1077.     self.x = args[4]
  1078.     self.y = args[5]
  1079.     self.z = args[6] + Graphics.height * 5
  1080.     make_move(args[3])
  1081.     refresh
  1082.   end
  1083.   #--------------------------------------------------------------------------
  1084.   # ● 生成移动数据
  1085.   #--------------------------------------------------------------------------
  1086.   def make_move(battler_obj_class)
  1087.     @move = []
  1088.     case battler_obj_class
  1089.     when :actor
  1090.       make_move_actor
  1091.     when :enemy
  1092.       make_move_enemy
  1093.     else
  1094.       make_move_default
  1095.     end
  1096.   end
  1097.   #--------------------------------------------------------------------------
  1098.   # ● 生成移动数据 默认
  1099.   #--------------------------------------------------------------------------
  1100.   def make_move_default
  1101.     45.times do |n|
  1102.       if n % 3 == 0
  1103.         ady = n < 21 ? -6 : -1
  1104.         opa = n < 21 ? 255 : 255-(n-21)*6
  1105.         @move.push([0, ady, opa])
  1106.       else
  1107.         @move.push([0, 0, -1])
  1108.       end
  1109.     end
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 生成移动数据 角色
  1113.   #--------------------------------------------------------------------------
  1114.   def make_move_actor
  1115.     make_move_default
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # ● 生成移动数据 敌人
  1119.   #--------------------------------------------------------------------------
  1120.   def make_move_enemy
  1121.     make_move_default
  1122.   end
  1123.   #--------------------------------------------------------------------------
  1124.   # ● 描绘
  1125.   #--------------------------------------------------------------------------
  1126.   def refresh
  1127.     if not self.bitmap.nil?
  1128.       self.bitmap.dispose
  1129.       self.bitmap = nil
  1130.     end
  1131.     begin
  1132.       @obmp = Cache.animation("damage", DamageBitmapHue)
  1133.     rescue Errno::ENOENT
  1134.       @obmp = Sprite_Damage.obmp
  1135.     end
  1136.     @numw = @obmp.width / 10
  1137.     @numh = @obmp.height / 8
  1138.     @strw = @obmp.width / 2
  1139.     case @value
  1140.     when Numeric
  1141.       blt_obmp_numeric
  1142.     when Symbol
  1143.       blt_obmp_text
  1144.     end
  1145.   end
  1146.   #--------------------------------------------------------------------------
  1147.   # ● 通过源图描绘数字
  1148.   #--------------------------------------------------------------------------
  1149.   def blt_obmp_numeric
  1150.     nums = @value.to_i.abs.to_s.split("")
  1151.     nbmpw = nums.size * @numw
  1152.     bmph = @numh
  1153.     cbmpw = 0
  1154.     crect = nil
  1155.     dy = 0
  1156.     if @critical
  1157.       cbmpw = @strw
  1158.       bmph *= 2
  1159.       crect = Rect.new(0, @numh * 6, @strw, @numh)
  1160.       dy = @numh
  1161.     end
  1162.     self.bitmap = Bitmap.new([nbmpw, cbmpw, 32].max, [bmph, 32].max)
  1163.     self.ox = bitmap.width / 2
  1164.     self.oy = bmph /2
  1165.     bitmap.blt((bitmap.width - cbmpw) / 2, 0, @obmp, crect) if crect
  1166.     dx = (bitmap.width - nbmpw) / 2
  1167.     ry = 0
  1168.     case @type
  1169.     when :hp
  1170.       ry = @value >= 0 ? 0 : @numh
  1171.     when :mp
  1172.       ry = @value >= 0 ? @numh * 2 : @numh * 3
  1173.     when :tp
  1174.       ry = @value >= 0 ? @numh * 4 : @numh * 5
  1175.     else
  1176.       return
  1177.     end
  1178.     rect = Rect.new(0, ry, @numw, @numh)
  1179.     nums.each_with_index do |str, i|
  1180.       rect.x = str.to_i * @numw
  1181.       bitmap.blt(dx, dy, @obmp, rect)
  1182.       dx += @numw
  1183.     end
  1184.   end
  1185.   #--------------------------------------------------------------------------
  1186.   # ● 通过源图描绘文字
  1187.   #--------------------------------------------------------------------------
  1188.   def blt_obmp_text
  1189.     self.bitmap = Bitmap.new([@strw, 32].max, [@numh, 32].max)
  1190.     self.ox = @strw / 2
  1191.     self.oy = @numh / 2
  1192.     rx = ry = 0
  1193.     case @type
  1194.     when :miss
  1195.       rx = @strw
  1196.       ry = @numh * 6
  1197.     when :eva
  1198.       ry = @numh * 7
  1199.     else
  1200.       return
  1201.     end
  1202.     rect = Rect.new(rx, ry, @strw, @numh)
  1203.     bitmap.blt(0, 0, @obmp, rect)
  1204.   end
  1205.   #--------------------------------------------------------------------------
  1206.   # ● 释放
  1207.   #--------------------------------------------------------------------------
  1208.   def dispose
  1209.     bitmap.dispose if bitmap
  1210.     super
  1211.   end
  1212.   #--------------------------------------------------------------------------
  1213.   # ● 移动中判定
  1214.   #--------------------------------------------------------------------------
  1215.   def moving?
  1216.     return (not @move.empty?)
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # ● 刷新
  1220.   #--------------------------------------------------------------------------
  1221.   def update
  1222.     super
  1223.     if moving?
  1224.       ary = @move.shift
  1225.       self.x += ary[0]
  1226.       self.y += ary[1]
  1227.       self.opacity = ary[2] if ary[2] >= 0
  1228.     end
  1229.   end
  1230. end
  1231. #==============================================================================
  1232. # ■ Game_BattlerBase
  1233. #==============================================================================
  1234. class Game_BattlerBase
  1235.   #--------------------------------------------------------------------------
  1236.   # ● 实例变量(新增定义)
  1237.   #--------------------------------------------------------------------------
  1238.   attr_accessor :hzhj_damage
  1239.   #--------------------------------------------------------------------------
  1240.   # ● 初始化(追加定义)
  1241.   #--------------------------------------------------------------------------
  1242.   alias hzhj_old_init_for_display_damage_game_battler_base initialize
  1243.   def initialize
  1244.     @hzhj_damage = []
  1245.     hzhj_old_init_for_display_damage_game_battler_base
  1246.   end
  1247. end
  1248. #==============================================================================
  1249. # ■ Sprite_Base
  1250. #==============================================================================
  1251. class Sprite_Base < Sprite
  1252.   #--------------------------------------------------------------------------
  1253.   # ● 初始化(追加定义)
  1254.   #--------------------------------------------------------------------------
  1255.   alias hzhj_old_init_for_display_damage_spr_base initialize
  1256.   def initialize(*args)
  1257.     hzhj_old_init_for_display_damage_spr_base(*args)
  1258.     @hzhj_damage_sprites = []
  1259.   end
  1260.   #--------------------------------------------------------------------------
  1261.   # ● 释放(追加定义)
  1262.   #--------------------------------------------------------------------------
  1263.   alias hzhj_old_dispose_for_display_damage_spr_base dispose
  1264.   def dispose
  1265.     hzhj_old_dispose_for_display_damage_spr_base
  1266.     dispose_damage
  1267.   end
  1268.   #--------------------------------------------------------------------------
  1269.   # ● 判断是否有伤害在显示(新增定义)
  1270.   #--------------------------------------------------------------------------
  1271.   def damage?
  1272.     return (not @hzhj_damage_sprites.empty?)
  1273.   end
  1274.   #--------------------------------------------------------------------------
  1275.   # ● 开始显示伤害(新增定义)
  1276.   #--------------------------------------------------------------------------
  1277.   def start_damage(args)
  1278.     args[4] = x - ox + width / 2
  1279.     args[5] = y - oy + height / 2
  1280.     args[6] = z
  1281.     @hzhj_damage_sprites.push(Sprite_Damage.new(viewport, args))
  1282.   end
  1283.   #--------------------------------------------------------------------------
  1284.   # ● 释放所有伤害显示(新增定义)
  1285.   #--------------------------------------------------------------------------
  1286.   def dispose_damage
  1287.     return unless damage?
  1288.     @hzhj_damage_sprites.each{|sprite|sprite.dispose}
  1289.     @hzhj_damage_sprites.clear
  1290.   end
  1291.   #--------------------------------------------------------------------------
  1292.   # ● 刷新(追加定义)
  1293.   #--------------------------------------------------------------------------
  1294.   alias hzhj_old_update_for_display_damage_spr_base update
  1295.   def update
  1296.     hzhj_old_update_for_display_damage_spr_base
  1297.     update_damage
  1298.   end
  1299.   #--------------------------------------------------------------------------
  1300.   # ● 刷新显示伤害(新增定义)
  1301.   #--------------------------------------------------------------------------
  1302.   def update_damage
  1303.     return unless damage?
  1304.     @hzhj_damage_sprites.each_with_index do |sprite, i|
  1305.       if sprite.moving?
  1306.         sprite.update
  1307.       else
  1308.         sprite.dispose
  1309.         @hzhj_damage_sprites[i] = nil
  1310.       end
  1311.     end
  1312.     @hzhj_damage_sprites.delete(nil)
  1313.   end
  1314. end
  1315. #==============================================================================
  1316. # ■ Sprite_Battler
  1317. #==============================================================================
  1318. class Sprite_Battler < Sprite_Base
  1319.   #--------------------------------------------------------------------------
  1320.   # ● 刷新(追加定义)
  1321.   #--------------------------------------------------------------------------
  1322.   alias hzhj_old_update_for_display_damage_spr_battler update
  1323.   def update
  1324.     hzhj_old_update_for_display_damage_spr_battler
  1325.     if @battler
  1326.       if not @battler.hzhj_damage.empty?
  1327.         unless @battler.damage_section_displayed
  1328.           args = @battler.hzhj_damage.clone
  1329.           args[3] = @battler.actor? ? :actor : (@battler.enemy? ? :enemy : nil)
  1330.           start_damage(args)
  1331.         end
  1332.         @battler.hzhj_damage.clear
  1333.       end
  1334.     end
  1335.   end
  1336. end
  1337. #==============================================================================
  1338. # ■ Window_BattleLog
  1339. #==============================================================================
  1340. class Window_BattleLog < Window_Selectable
  1341.   #--------------------------------------------------------------------------
  1342.   # ● 显示 MISS (追加定义)
  1343.   #--------------------------------------------------------------------------
  1344.   alias hzhj_old_display_miss_for_display_damage_wnd_btlog display_miss
  1345.   def display_miss(target, item)
  1346.     target.hzhj_damage = [:miss, :miss, false]
  1347.     hzhj_old_display_miss_for_display_damage_wnd_btlog(target, item)
  1348.   end
  1349.   #--------------------------------------------------------------------------
  1350.   # ● 显示回避 (追加定义)
  1351.   #--------------------------------------------------------------------------
  1352.   alias hzhj_old_display_evasion_for_display_damage_wnd_btlog display_evasion
  1353.   def display_evasion(target, item)
  1354.     target.hzhj_damage = [:eva, :evasion, false]
  1355.     hzhj_old_display_evasion_for_display_damage_wnd_btlog(target, item)
  1356.   end
  1357.   #--------------------------------------------------------------------------
  1358.   # ● 显示 HP 伤害 (追加定义)
  1359.   #--------------------------------------------------------------------------
  1360.   alias hzhj_old_display_hp_damage_for_display_damage_wnd_btlog display_hp_damage
  1361.   def display_hp_damage(target, item)
  1362.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  1363.     value = target.result.hp_damage
  1364.     critical = target.result.critical
  1365.     target.hzhj_damage = [:hp, value, critical]
  1366.     hzhj_old_display_hp_damage_for_display_damage_wnd_btlog(target, item)
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ● 显示 MP 伤害 (追加定义)
  1370.   #--------------------------------------------------------------------------
  1371.   alias hzhj_old_display_mp_damage_for_display_damage_wnd_btlog display_mp_damage
  1372.   def display_mp_damage(target, item)
  1373.     return if target.dead? || target.result.mp_damage == 0
  1374.     value = target.result.mp_damage
  1375.     critical = target.result.critical
  1376.     target.hzhj_damage = [:mp, value, critical]
  1377.     hzhj_old_display_mp_damage_for_display_damage_wnd_btlog(target, item)
  1378.   end
  1379.   #--------------------------------------------------------------------------
  1380.   # ● 显示 TP 伤害 (追加定义)
  1381.   #--------------------------------------------------------------------------
  1382.   alias hzhj_old_display_tp_damage_for_display_damage_wnd_btlog display_tp_damage
  1383.   def display_tp_damage(target, item)
  1384.     return if target.dead? || target.result.tp_damage == 0
  1385.     value = target.result.tp_damage
  1386.     critical = target.result.critical
  1387.     target.hzhj_damage = [:tp, value, critical]
  1388.     hzhj_old_display_tp_damage_for_display_damage_wnd_btlog(target, item)
  1389.   end
  1390. end

  1391. class RPG::Animation
  1392.   def need_move
  1393.     return @need_move unless @need_move.nil?
  1394.     if /@[Rr][Mm]/ =~ @name
  1395.       return (@need_move = true)
  1396.     else
  1397.       return (@need_move = false)
  1398.     end
  1399.   end
  1400.   def move_se
  1401.     return @move_se unless @move_se.nil?
  1402.     @move_se = RPG::SE.new
  1403.     if /@[Ss][Ee]\[(.+?)\]/ =~ @name
  1404.       @move_se.name = $1.clone
  1405.     end
  1406.     return @move_se
  1407.   end
  1408.   attr_writer :need_move
  1409.   attr_writer :move_se
  1410. end
  1411. #==============================================================================
  1412. # ■ Game_Battler
  1413. #==============================================================================
  1414. class Game_Battler < Game_BattlerBase
  1415.   include Hzhj::HorizontalBattleSystem
  1416.   #--------------------------------------------------------------------------
  1417.   # ● 属性
  1418.   #--------------------------------------------------------------------------
  1419.   attr_accessor :add_x                    # X 坐标变化量
  1420.   attr_accessor :add_y                    # Y 坐标变化量
  1421.   attr_accessor :move_speed_x             # 战斗图 X 移动速度
  1422.   attr_accessor :move_speed_y             # 战斗图 Y 移动速度
  1423.   #--------------------------------------------------------------------------
  1424.   # ● 初始化(追加定义)
  1425.   #--------------------------------------------------------------------------
  1426.   alias hzhj_old_init_for_real_move_game_battler initialize
  1427.   def initialize
  1428.     @add_x = 0
  1429.     @add_y = 0
  1430.     @move_speed_x = 0
  1431.     @move_speed_y = 0
  1432.     hzhj_old_init_for_real_move_game_battler
  1433.   end
  1434.   #--------------------------------------------------------------------------
  1435.   # ● 真实 X 坐标(新增定义)
  1436.   #--------------------------------------------------------------------------
  1437.   def real_screen_x
  1438.     return screen_x + add_x
  1439.   end
  1440.   #--------------------------------------------------------------------------
  1441.   # ● 真实 Y 坐标(新增定义)
  1442.   #--------------------------------------------------------------------------
  1443.   def real_screen_y
  1444.     return screen_y + add_y
  1445.   end
  1446.   #--------------------------------------------------------------------------
  1447.   # ● 返回自己的战斗位置(新增定义)
  1448.   #--------------------------------------------------------------------------
  1449.   def come_back_self_position(duration)
  1450.     return if dead?
  1451.     tx = screen_x
  1452.     ty = screen_y
  1453.     addx = tx - real_screen_x
  1454.     addy = ty - real_screen_y
  1455.     return if addx == 0 && addy == 0
  1456.     @add_x = 0
  1457.     @add_y = 0
  1458.     @move_speed_x = [(addx.abs / duration.to_f).ceil, 1].max
  1459.     @move_speed_y = [(addy.abs / duration.to_f).ceil, 1].max
  1460.   end
  1461.   #--------------------------------------------------------------------------
  1462.   # ● 设置移动信息(新增定义)
  1463.   #--------------------------------------------------------------------------
  1464.   def setup_move_info(target_battler, duration, move_se)
  1465.     return if dead?
  1466.     tbmp = Cache.battler(target_battler.battler_name, target_battler.battler_hue)
  1467.     sbmp = Cache.battler(@battler_name, @battler_hue)
  1468.     tbw = tbmp.width / DynamicPatternMax + RealMoveBmpAddW
  1469.     sbw = sbmp.width / DynamicPatternMax + RealMoveBmpAddW
  1470.     tbh = tbmp.height + RealMoveBmpAddH
  1471.     sbh = sbmp.height + RealMoveBmpAddH
  1472.     d = actor? ? ActorDirection : 10 - ActorDirection
  1473.     tx = target_battler.real_screen_x
  1474.     ty = target_battler.real_screen_y
  1475.     case d
  1476.     when 1
  1477.       tx = tx + tbw / 2 + sbw / 2
  1478.       ty = ty - sbh / 2
  1479.     when 2
  1480.       ty = ty - sbh / 2
  1481.     when 3
  1482.       tx = tx - tbw / 2 - sbw / 2
  1483.       ty = ty - sbh / 2
  1484.     when 4
  1485.       tx = tx + tbw / 2 + sbw / 2
  1486.     when 6
  1487.       tx = tx - tbw / 2 - sbw / 2
  1488.     when 7
  1489.       tx = tx + tbw / 2 + sbw / 2
  1490.       ty = ty + sbh / 2
  1491.     when 8
  1492.       ty = ty + sbh / 2
  1493.     when 9
  1494.       tx = tx - tbw / 2 - sbw / 2
  1495.       ty = ty + sbh / 2
  1496.     end
  1497.     addx = tx - real_screen_x
  1498.     addy = ty - real_screen_y
  1499.     return if addx == 0 && addy == 0
  1500.     @add_x = tx - screen_x if addx != 0
  1501.     @add_y = ty - screen_y if addy != 0
  1502.     @move_speed_x = [(addx.abs / duration.to_f).ceil, 1].max
  1503.     @move_speed_y = [(addy.abs / duration.to_f).ceil, 1].max
  1504.     move_se.play
  1505.   end
  1506. end
  1507. #==============================================================================
  1508. # ■ Sprite_Battler
  1509. #==============================================================================
  1510. class Sprite_Battler < Sprite_Base
  1511.   #--------------------------------------------------------------------------
  1512.   # ● 初始化(追加定义)
  1513.   #--------------------------------------------------------------------------
  1514.   alias hzhj_old_init_for_real_move_spr_battler initialize
  1515.   def initialize(viewport, battler = nil)
  1516.     hzhj_old_init_for_real_move_spr_battler(viewport, battler)
  1517.     init_position(@battler) if @battler
  1518.   end
  1519.   #--------------------------------------------------------------------------
  1520.   # ● 设置战斗者(追加定义)
  1521.   #--------------------------------------------------------------------------
  1522.   alias hzhj_old_set_battler_for_real_move_spr_battler battler=
  1523.   def battler=(value)
  1524.     if @battler != value && value
  1525.       init_position(value)
  1526.     end
  1527.     hzhj_old_set_battler_for_real_move_spr_battler(value)
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● 初始化位置(新增定义)
  1531.   #--------------------------------------------------------------------------
  1532.   def init_position(battler)
  1533.     battler.add_x = 0
  1534.     battler.add_y = 0
  1535.     self.x = battler.real_screen_x
  1536.     self.y = battler.real_screen_y
  1537.     self.z = battler.screen_z
  1538.   end
  1539.   #--------------------------------------------------------------------------
  1540.   # ● 移动中判定(新增定义)
  1541.   #--------------------------------------------------------------------------
  1542.   def moving?
  1543.     return false unless @battler
  1544.     (x != @battler.real_screen_x or y != @battler.real_screen_y) && @battler
  1545.   end
  1546.   #--------------------------------------------------------------------------
  1547.   # ● 位置的更新(重定义)
  1548.   #--------------------------------------------------------------------------
  1549.   def update_position
  1550.     if [email protected]?
  1551.       if x < @battler.real_screen_x
  1552.         self.x = [x + @battler.move_speed_x, @battler.real_screen_x].min
  1553.       elsif x > @battler.real_screen_x
  1554.         self.x = [x - @battler.move_speed_x, @battler.real_screen_x].max
  1555.       end
  1556.       if y < @battler.real_screen_y
  1557.         self.y = [y + @battler.move_speed_y, @battler.real_screen_y].min
  1558.       elsif y > @battler.real_screen_y
  1559.         self.y = [y - @battler.move_speed_y, @battler.real_screen_y].max
  1560.       end
  1561.       self.z = y + 100
  1562.     end
  1563.   end
  1564. end
  1565. #==============================================================================
  1566. # ■ Spriteset_Battle
  1567. #==============================================================================
  1568. class Spriteset_Battle
  1569.   #--------------------------------------------------------------------------
  1570.   # ● 判定是否移动中(新增定义)
  1571.   #--------------------------------------------------------------------------
  1572.   def moving?
  1573.     battler_sprites.any? {|sprite| sprite.moving? }
  1574.   end
  1575. end
  1576. #==============================================================================
  1577. # ■ Scene_Battle
  1578. #==============================================================================
  1579. class Scene_Battle < Scene_Base
  1580.   #--------------------------------------------------------------------------
  1581.   # ● 等待战斗图移动的结束(新增定义)
  1582.   #--------------------------------------------------------------------------
  1583.   def wait_for_move
  1584.     update_for_wait
  1585.     update_for_wait while @spriteset.moving?
  1586.   end
  1587. end

  1588. class RPG::Troop
  1589.   include Hzhj::HorizontalBattleSystem
  1590.   def display_enemy_bar
  1591.     return @display_enemy_bar unless @display_enemy_bar.nil?
  1592.     if /@ebar/i =~ @name
  1593.       return (@display_enemy_bar = !DefaultDisplayEnemyBar)
  1594.     else
  1595.       return (@display_enemy_bar = DefaultDisplayEnemyBar)
  1596.     end
  1597.   end
  1598.   attr_writer :display_enemy_bar
  1599. end
  1600. #==============================================================================
  1601. # ■ Game_Troop
  1602. #==============================================================================
  1603. class Game_Troop < Game_Unit
  1604.   attr_accessor :display_enemy_bar      # 是否显示敌人HP条、MP条、TP条
  1605.   #--------------------------------------------------------------------------
  1606.   # ● 设置
  1607.   #--------------------------------------------------------------------------
  1608.   alias hzhj_old_setup_for_display_enemy_bar_game_troop setup
  1609.   def setup(troop_id)
  1610.     hzhj_old_setup_for_display_enemy_bar_game_troop(troop_id)
  1611.     @display_enemy_bar = troop.display_enemy_bar
  1612.   end
  1613. end
  1614. #==============================================================================
  1615. # ■ Window_BattleEnemy
  1616. #==============================================================================
  1617. class Window_BattleEnemy < Window_Selectable
  1618.   #--------------------------------------------------------------------------
  1619.   # ● 取得列数
  1620.   #--------------------------------------------------------------------------
  1621.   def col_max
  1622.     if $game_troop.display_enemy_bar
  1623.       return 1
  1624.     else
  1625.       return 2
  1626.     end
  1627.   end
  1628.   #--------------------------------------------------------------------------
  1629.   # ● 刷新
  1630.   #--------------------------------------------------------------------------
  1631.   def refresh
  1632.     create_contents
  1633.     super
  1634.   end
  1635.   #--------------------------------------------------------------------------
  1636.   # ● 描画项目
  1637.   #--------------------------------------------------------------------------
  1638.   def draw_item(index)
  1639.     if $game_troop.display_enemy_bar
  1640.       enemy = $game_troop.alive_members[index]
  1641.       draw_basic_area(basic_area_rect(index), enemy)
  1642.       draw_gauge_area(gauge_area_rect(index), enemy)
  1643.     else
  1644.       change_color(normal_color)
  1645.       name = $game_troop.alive_members[index].name
  1646.       draw_text(item_rect_for_text(index), name)
  1647.     end
  1648.   end
  1649.   #--------------------------------------------------------------------------
  1650.   # ● 取得基本区域的矩形
  1651.   #--------------------------------------------------------------------------
  1652.   def basic_area_rect(index)
  1653.     rect = item_rect_for_text(index)
  1654.     rect.width -= gauge_area_width + 10
  1655.     rect
  1656.   end
  1657.   #--------------------------------------------------------------------------
  1658.   # ● 取得值槽区域的矩形
  1659.   #--------------------------------------------------------------------------
  1660.   def gauge_area_rect(index)
  1661.     rect = item_rect_for_text(index)
  1662.     rect.x += rect.width - gauge_area_width
  1663.     rect.width = gauge_area_width
  1664.     rect
  1665.   end
  1666.   #--------------------------------------------------------------------------
  1667.   # ● 取得值槽区域的宽度
  1668.   #--------------------------------------------------------------------------
  1669.   def gauge_area_width
  1670.     return 220
  1671.   end
  1672.   #--------------------------------------------------------------------------
  1673.   # ● 描画基本区域
  1674.   #--------------------------------------------------------------------------
  1675.   def draw_basic_area(rect, actor)
  1676.     draw_actor_name(actor, rect.x + 0, rect.y, 100)
  1677.     draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
  1678.   end
  1679.   #--------------------------------------------------------------------------
  1680.   # ● 描画值槽区域
  1681.   #--------------------------------------------------------------------------
  1682.   def draw_gauge_area(rect, actor)
  1683.     if $data_system.opt_display_tp
  1684.       draw_gauge_area_with_tp(rect, actor)
  1685.     else
  1686.       draw_gauge_area_without_tp(rect, actor)
  1687.     end
  1688.   end
  1689.   #--------------------------------------------------------------------------
  1690.   # ● 描画值槽区域(包括 TP 值)
  1691.   #--------------------------------------------------------------------------
  1692.   def draw_gauge_area_with_tp(rect, actor)
  1693.     draw_actor_hp(actor, rect.x + 0, rect.y, 72)
  1694.     draw_actor_mp(actor, rect.x + 82, rect.y, 64)
  1695.     draw_actor_tp(actor, rect.x + 156, rect.y, 64)
  1696.   end
  1697.   #--------------------------------------------------------------------------
  1698.   # ● 描画值槽区域(不包括 TP 值)
  1699.   #--------------------------------------------------------------------------
  1700.   def draw_gauge_area_without_tp(rect, actor)
  1701.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  1702.     draw_actor_mp(actor, rect.x + 144,  rect.y, 76)
  1703.   end
  1704. end

  1705. #==============================================================================
  1706. # ■ Sprite_Battler
  1707. #==============================================================================
  1708. class Sprite_Battler < Sprite_Base
  1709.   include Hzhj::HorizontalBattleSystem
  1710.   #--------------------------------------------------------------------------
  1711.   # ● 初始化(追加定义)
  1712.   #--------------------------------------------------------------------------
  1713.   alias hzhj_old_init_for_dynamic_spr_battler initialize
  1714.   def initialize(viewport, battler = nil)
  1715.     hzhj_old_init_for_dynamic_spr_battler(viewport, battler)
  1716.     @dynamic_duration = 0
  1717.     @dynamic_duration_max = DynamicPatternMax * OnePatternDuration
  1718.   end
  1719.   #--------------------------------------------------------------------------
  1720.   # ● 源位图(Source Bitmap)的更新(重定义)
  1721.   #--------------------------------------------------------------------------
  1722.   def update_bitmap
  1723.     new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
  1724.     if bitmap != new_bitmap
  1725.       self.bitmap = new_bitmap
  1726.       init_visibility
  1727.       @dynamic_duration = 0
  1728.       @sx = 0
  1729.       @sw = bitmap.width / DynamicPatternMax
  1730.       @sh = bitmap.height
  1731.       self.ox = @sw / 2
  1732.       self.oy = @sh
  1733.       src_rect.set(@sx, 0, @sw, @sh)
  1734.     end
  1735.   end
  1736.   #--------------------------------------------------------------------------
  1737.   # ● 原点的更新(重定义)
  1738.   #--------------------------------------------------------------------------
  1739.   def update_origin
  1740.     if bitmap
  1741.       @dynamic_duration += 1
  1742.       @dynamic_duration %= @dynamic_duration_max
  1743.       @sx = @dynamic_duration / OnePatternDuration * @sw
  1744.       src_rect.set(@sx, 0, @sw, @sh)
  1745.     end
  1746.   end
  1747.   #--------------------------------------------------------------------------
  1748.   # ● 返回普通设定(追加定义)
  1749.   #--------------------------------------------------------------------------
  1750.   alias hzhj_old_revert_to_normal_for_dynamic_spr_battler revert_to_normal
  1751.   def revert_to_normal
  1752.     hzhj_old_revert_to_normal_for_dynamic_spr_battler
  1753.     self.ox = @sw / 2 if bitmap
  1754.   end
  1755.   #--------------------------------------------------------------------------
  1756.   # ● BOSS 战败(崩坏)效果的更新(追加定义)
  1757.   #--------------------------------------------------------------------------
  1758.   alias hzhj_old_update_boss_col_for_dynamic_spr_battler update_boss_collapse
  1759.   def update_boss_collapse
  1760.     hzhj_old_update_boss_col_for_dynamic_spr_battler
  1761.     self.ox = @sw / 2 + @effect_duration % 2 * 4 - 2
  1762.   end
  1763. end

  1764. #==============================================================================
  1765. # ■ Game_Battler
  1766. #==============================================================================
  1767. class Game_Battler < Game_BattlerBase
  1768.   def set_normal_battler_name
  1769.     @battler_name = @battler_name.split(/★/)[0]
  1770.   end
  1771.   def set_beaten_battler_name
  1772.     if guard?
  1773.       if (UseActorGuardGraphic && actor?) or
  1774.          (UseEnemyGuardGraphic && enemy?)
  1775.         set_guard_battler_name
  1776.         return
  1777.       end
  1778.     end
  1779.     @battler_name = @battler_name.split(/★/)[0] + "★1"
  1780.     if UseActorWBSE && actor?
  1781.       Audio.se_play("Audio/SE/AWBSE_#{id}", 100, 100)
  1782.     elsif UseEnemyWBSE && enemy?
  1783.       Audio.se_play("Audio/SE/EWBSE_#{enemy_id}", 100, 100)
  1784.     end
  1785.   end
  1786.   def set_dead_battler_name
  1787.     @battler_name = @battler_name.split(/★/)[0] + "★2"
  1788.   end
  1789.   def set_guard_battler_name
  1790.     @battler_name = @battler_name.split(/★/)[0] + "★3"
  1791.     if UseActorGDSE && actor?
  1792.       Audio.se_play("Audio/SE/AGDSE_#{id}", 100, 100)
  1793.     elsif UseEnemyGDSE && enemy?
  1794.       Audio.se_play("Audio/SE/EGDSE_#{enemy_id}", 100, 100)
  1795.     end
  1796.   end
  1797. end
  1798. #==============================================================================
  1799. # ■ Sprite_Battler
  1800. #==============================================================================
  1801. class Sprite_Battler < Sprite_Base
  1802.   #--------------------------------------------------------------------------
  1803.   # ● 初始化(追加定义)
  1804.   #--------------------------------------------------------------------------
  1805.   alias hzhj_old_init_for_dead_spr_battler initialize
  1806.   def initialize(viewport, battler = nil)
  1807.     hzhj_old_init_for_dead_spr_battler(viewport, battler)
  1808.     @dead_graphic_used = false
  1809.     if @battler
  1810.       @battler.set_normal_battler_name
  1811.       if @battler.dead?
  1812.         if (UseActorDeadGraphic && @battler.actor?) or
  1813.            (UseEnemyDeadGraphic && @battler.enemy?)
  1814.           @battler.set_dead_battler_name
  1815.           @dead_graphic_used = true
  1816.         end
  1817.       end
  1818.     end
  1819.     @beaten_duration = -1
  1820.   end
  1821.   #--------------------------------------------------------------------------
  1822.   # ● 设置战斗者(追加定义)
  1823.   #--------------------------------------------------------------------------
  1824.   alias hzhj_old_set_battler_for_dead_spr_battler battler=
  1825.   def battler=(value)
  1826.     if @battler != value
  1827.       @dead_graphic_used = false
  1828.       if value
  1829.         value.set_normal_battler_name
  1830.         if value.dead?
  1831.           if (UseActorDeadGraphic && value.actor?) or
  1832.              (UseEnemyDeadGraphic && value.enemy?)
  1833.             value.set_dead_battler_name
  1834.             @dead_graphic_used = true
  1835.           end
  1836.         end
  1837.       end
  1838.       @beaten_duration = -1
  1839.     end
  1840.     hzhj_old_set_battler_for_dead_spr_battler(value)
  1841.   end
  1842.   #--------------------------------------------------------------------------
  1843.   # ● 源位图(Source Bitmap)的更新(重定义)
  1844.   #--------------------------------------------------------------------------
  1845.   alias hzhj_old_update_bitmap_for_was_beaten_spr_battler update_bitmap
  1846.   def update_bitmap
  1847.     if @beaten_duration > 0
  1848.       @beaten_duration -= 1
  1849.     elsif @beaten_duration == 0
  1850.       @beaten_duration = -1
  1851.       set_bitmap(:normal)
  1852.     end
  1853.     hzhj_old_update_bitmap_for_was_beaten_spr_battler
  1854.   end
  1855.   #--------------------------------------------------------------------------
  1856.   # ● 初始化可视状态(追加定义)
  1857.   #--------------------------------------------------------------------------
  1858.   alias hzhj_old_visibility_for_dead_spr_battler init_visibility
  1859.   def init_visibility
  1860.     hzhj_old_visibility_for_dead_spr_battler
  1861.     if @battler.dead?
  1862.       if (UseActorDeadGraphic && @battler.actor?) or
  1863.          (UseEnemyDeadGraphic && @battler.enemy?)
  1864.         self.opacity = 255
  1865.       end
  1866.     end
  1867.   end
  1868.   #--------------------------------------------------------------------------
  1869.   # ● 效果开始(追加定义)
  1870.   #--------------------------------------------------------------------------
  1871.   alias hzhj_old_start_effect_for_dead_spr_battler start_effect
  1872.   def start_effect(effect_type)
  1873.     if effect_type == :appear
  1874.       if @dead_graphic_used
  1875.         set_bitmap(:normal)
  1876.         @effect_type = nil
  1877.         @effect_duration = 0
  1878.         @dead_graphic_used = false
  1879.         @battler_visible = true
  1880.         return
  1881.       end
  1882.     elsif effect_type == :collapse or
  1883.           effect_type == :boss_collapse or
  1884.           effect_type == :instant_collapse
  1885.       if @beaten_duration >= 0
  1886.         @beaten_duration = -1
  1887.         set_bitmap(:normal)
  1888.       end
  1889.       if (UseActorDeadGraphic && @battler.actor?) or
  1890.          (UseEnemyDeadGraphic && @battler.enemy?)
  1891.         set_bitmap(:dead)
  1892.         @effect_type = nil
  1893.         @effect_duration = 0
  1894.         @dead_graphic_used = true
  1895.         @battler_visible = false
  1896.         return
  1897.       end
  1898.     end
  1899.     hzhj_old_start_effect_for_dead_spr_battler(effect_type)
  1900.   end
  1901.   #--------------------------------------------------------------------------
  1902.   # ● 设置新的位图(新增定义)
  1903.   #--------------------------------------------------------------------------
  1904.   def set_bitmap(sym)
  1905.     case sym
  1906.     when :normal
  1907.       @battler.set_normal_battler_name
  1908.     when :was_beaten
  1909.       @battler.set_beaten_battler_name
  1910.     when :dead
  1911.       @battler.set_dead_battler_name
  1912.     else
  1913.       return
  1914.     end
  1915.     new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
  1916.     if bitmap != new_bitmap
  1917.       self.bitmap = new_bitmap
  1918.       @dynamic_duration = 0
  1919.       @sx = 0
  1920.       @sw = bitmap.width / DynamicPatternMax
  1921.       @sh = bitmap.height
  1922.       self.ox = @sw / 2
  1923.       self.oy = @sh
  1924.       src_rect.set(@sx, 0, @sw, @sh)
  1925.     end
  1926.     update_origin
  1927.     update_position
  1928.   end
  1929. end

  1930. #==============================================================================
  1931. # ■ Scene_Battle
  1932. #==============================================================================
  1933. class Scene_Battle < Scene_Base
  1934.   #--------------------------------------------------------------------------
  1935.   # ● 发动技能/物品(新增定义)
  1936.   #--------------------------------------------------------------------------
  1937.   def hzhj_invoke_item(target, item, damage_target)
  1938.     refresh_status
  1939.     @log_window.display_action_results(damage_target, item)
  1940.     @subject.damage_section_displayed = false
  1941.     @subject.last_target_index = target.index
  1942.     return if target.dead?
  1943.     if rand < target.item_cnt(@subject, item)
  1944.       hzhj_invoke_counter_attack(target, item)
  1945.     elsif rand < target.item_mrf(@subject, item)
  1946.       hzhj_invoke_magic_reflection(target, item)
  1947.     end
  1948.   end
  1949.   #--------------------------------------------------------------------------
  1950.   # ● 发动物理反击(新增定义)
  1951.   #--------------------------------------------------------------------------
  1952.   def hzhj_invoke_counter_attack(target, item)
  1953.     @log_window.display_counter(target, item)
  1954.     attack_skill = $data_skills[target.attack_skill_id]
  1955.     @subject.item_apply(target, attack_skill)
  1956.     need_move = false
  1957.     animation1 = $data_animations[target.animation1_id]
  1958.     need_move = animation1.need_move if animation1
  1959.     ary = [@subject]
  1960.     if need_move
  1961.       target.setup_move_info(@subject, RealMoveDuration, animation1.move_se)
  1962.       wait_for_move
  1963.     end
  1964.     @subject.damage_section_displayed = false
  1965.     @subject.not_damage_section = false
  1966.     show_subject_animation(target.animation1_id, target)
  1967.     show_normal_animation(ary, target.atk_animation_id1, false)
  1968.     show_normal_animation(ary, target.atk_animation_id2, true)
  1969.     @log_window.wait
  1970.     wait_for_animation
  1971.     if need_move && target.alive?
  1972.       target.come_back_self_position(RealMoveDuration)
  1973.       wait_for_move
  1974.     end
  1975.     refresh_status
  1976.     @log_window.display_action_results(@subject, attack_skill)
  1977.   end
  1978.   #--------------------------------------------------------------------------
  1979.   # ● 发动魔法反射(新增定义)
  1980.   #--------------------------------------------------------------------------
  1981.   def hzhj_invoke_magic_reflection(target, item)
  1982.     @subject.damage_section_displayed = false
  1983.     @subject.not_damage_section = false
  1984.     @log_window.display_reflection(target, item)
  1985.     @subject.item_apply(@subject, item)
  1986.     refresh_status
  1987.     @log_window.display_action_results(@subject, item)
  1988.   end
  1989. end

  1990. #==============================================================================
  1991. # ■ Game_Battler
  1992. #==============================================================================
  1993. class Game_Battler < Game_BattlerBase
  1994.   attr_accessor :damage_section_displayed
  1995.   attr_accessor :not_damage_section
  1996. end
  1997. #==============================================================================
  1998. # ■ Game_Actor
  1999. #==============================================================================
  2000. class Game_Actor < Game_Battler
  2001.   #--------------------------------------------------------------------------
  2002.   # ● 执行伤害效果
  2003.   #--------------------------------------------------------------------------
  2004.   alias hzhj_old_per_damage_for_damage_section_game_actor perform_damage_effect
  2005.   def perform_damage_effect
  2006.     unless damage_section_displayed
  2007.       hzhj_old_per_damage_for_damage_section_game_actor
  2008.     end
  2009.   end
  2010. end
  2011. #==============================================================================
  2012. # ■ Game_Enemy
  2013. #==============================================================================
  2014. class Game_Enemy < Game_Battler
  2015.   #--------------------------------------------------------------------------
  2016.   # ● 执行伤害效果
  2017.   #--------------------------------------------------------------------------
  2018.   alias hzhj_old_per_damage_for_damage_section_game_enemy perform_damage_effect
  2019.   def perform_damage_effect
  2020.     unless damage_section_displayed
  2021.       hzhj_old_per_damage_for_damage_section_game_enemy
  2022.     end
  2023.   end
  2024. end
  2025. #==============================================================================
  2026. # ■ Sprite_Battler
  2027. #==============================================================================
  2028. class Sprite_Battler < Sprite_Base
  2029.   #--------------------------------------------------------------------------
  2030.   # ● SE 和闪烁时机的处理
  2031.   #--------------------------------------------------------------------------
  2032.   def animation_process_timing(timing)
  2033.     if timing.se.name == DamageSectionDisplaySEName
  2034.       hp_value = @battler.result.hp_damage
  2035.       mp_value = @battler.result.mp_damage
  2036.       tp_value = @battler.result.tp_damage
  2037.       value = args = nil
  2038.       was_beaten = false
  2039.       if hp_value != 0 && [email protected]_damage_section
  2040.         was_beaten = true if hp_value > 0
  2041.         value = hp_value * timing.flash_color.red.to_i / 100
  2042.         critical = @battler.result.critical
  2043.         args = [:hp, value, critical]
  2044.       elsif mp_value != 0 && [email protected]_damage_section
  2045.         was_beaten = true if mp_value > 0
  2046.         value = mp_value * timing.flash_color.red.to_i / 100
  2047.         critical = @battler.result.critical
  2048.         args = [:mp, value, critical]
  2049.       elsif tp_value != 0 && [email protected]_damage_section
  2050.         was_beaten = true if tp_value > 0
  2051.         value = tp_value * timing.flash_color.red.to_i / 100
  2052.         critical = @battler.result.critical
  2053.         args = [:tp, value, critical]
  2054.       end
  2055.       if value && args
  2056.         args[3] = @battler.actor? ? :actor : (@battler.enemy? ? :enemy : nil)
  2057.         @battler.damage_section_displayed = true
  2058.         start_damage(args)
  2059.         if UseBeatenGraphic && was_beaten
  2060.           set_bitmap(:was_beaten)
  2061.           @beaten_duration = BeatenGraphicDuration
  2062.         end
  2063.       end
  2064.       return
  2065.     end
  2066.     super(timing)
  2067.   end
  2068. end
  2069. #==============================================================================
  2070. # ■ Scene_Battle
  2071. #==============================================================================
  2072. class Scene_Battle < Scene_Base
  2073.   #--------------------------------------------------------------------------
  2074.   # ● 应用技能/物品效果(新增定义)
  2075.   #--------------------------------------------------------------------------
  2076.   def hzhj_apply_item_effects(target, item)
  2077.     target.damage_section_displayed = false
  2078.     target.not_damage_section = false
  2079.     target = apply_substitute(target, item)
  2080.     target.damage_section_displayed = false
  2081.     target.not_damage_section = false
  2082.     target.item_apply(@subject, item)
  2083.     return target
  2084.   end
  2085. end
  2086. #==============================================================================
  2087. # ■ 此脚本来自 www.66rpg.com
  2088. #==============================================================================
复制代码

点评

没事,你先忙你的,有空再看,你肯帮就太感谢了  发表于 2013-12-6 19:45
.....过几天有空再说吧  发表于 2013-12-6 18:33
回复 支持 反对

使用道具 举报

Lv2.观梦者 (暗夜天使)

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
帖子
2309

贵宾

110
 楼主| 发表于 2013-12-9 22:08:38 | 只看该作者
夕仔 发表于 2013-12-5 21:30
您好能看下这个脚本吗?作者后知后觉比较忙可能不在吧。。问他都没反应的
你帮我看看呗
就是 设置多个角色 ...

加这一句就可以了
  1. class Spriteset_Battle
  2.   def create_actors
  3.     @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  4.   end
  5. end
复制代码

点评

谢谢,辛苦了  发表于 2013-12-9 23:18
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-7 23:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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