Project1

标题: 如何显示备注栏的文字(手动解决) [打印本页]

作者: 饿啊    时间: 2016-8-20 22:22
标题: 如何显示备注栏的文字(手动解决)
本帖最后由 饿啊 于 2016-9-18 22:25 编辑

本人新想法,因为测试的时候看着那干巴巴的技能说明就觉得有些无聊,故想多写一点好玩的说明,它只有停留了较久后可以和以下脚本所显示的内容一起显示出来,故再次求教诸位...
(ps:可以独立写出一个脚本,也可以改动原脚本,反正不做商业用途...)
注:楼主已使用以下脚本:
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 技能物品说明增强 蓝本:wyongcan
  4. # 修改 :VIPArcher
  5. #
  6. # 改动说明:
  7. # 改用新的帮助窗口和新定义draw_text_vip方法来增强兼容性
  8. # 更改初始化数据时机以支持跳过标题
  9. # 追加对普通物品和技能的说明内容
  10. # 修改了对帮助窗口行数的计算以支持控制符
  11. # 加上了各种颜色的设置,具体更高级的玩法自己领悟吧
  12. # 改成光标不动一段时间后才会出现帮助窗口
  13. #
  14. #  -- 本脚本来自 [url]https://rpg.blue[/url] 使用或转载请保留以上信息。
  15. #==============================================================================
  16. $VIPArcherScript ||= {};$VIPArcherScript[:help_ex] = 20141007
  17. $VIPArcherScript[:equip_limit] = false #是否使用了后知后觉的装备能力限制
  18. class << DataManager
  19.   alias_method :vip_load_database, :load_database
  20.   #--------------------------------------------------------------------------
  21.   # ● 读取数据库
  22.   #--------------------------------------------------------------------------
  23.   def load_database
  24.     vip_load_database
  25.     VIPArcher::Equipplus.equiphelpready
  26.   end
  27. end
  28. module VIPArcher;end
  29. module VIPArcher::Equipplus
  30.   TIME = 90 #帮助窗口自动出现的时间(单位帧
  31.   Font_Name = Font.default_name # 推荐"微软雅黑"
  32.   Font_Size = 14                # "微软雅黑"的话就20号字体
  33.   UP   = 24 #能力值提升颜色编号
  34.   DOWN = 25 #能力值下降颜色编号
  35.   VIP  = 14 #特殊能力颜色编号
  36.   MP   = 23
  37.   TP   = 29
  38.   CODE ={
  39.     11 => "属性抗性",
  40.     12 => "弱化抗性",
  41.     13 => "状态抗性",
  42.     14 => "状态免疫",
  43.     21 => "普通能力",
  44.     22 => "添加能力",
  45.     23 => "特殊能力",
  46.     31 => "附带属性",
  47.     32 => "附带状态",
  48.     33 => "攻击速度",
  49.     34 => "添加攻击次数",
  50.     41 => "添加技能类型",
  51.     42 => "禁用技能类型",
  52.     43 => "添加技能",
  53.     44 => "禁用技能",
  54.     51 => "可装备武器类型",
  55.     52 => "可装备护甲类型",
  56.     53 => "固定装备",
  57.     54 => "禁用装备",
  58.     55 => "装备风格",
  59.     61 => "添加行动次数",
  60.     62 => "特殊标志",
  61.     63 => "消失效果",
  62.     64 => "队伍能力"}
  63.   #特殊标志
  64.   FLAG ={
  65.     0 => "自动战斗",
  66.     1 => "擅长防御",
  67.     2 => "保护弱者",
  68.     3 => "特技专注"}
  69.   #技能效果范围
  70.   SCOPE ={
  71.     0 => "无",
  72.     1 => "单个敌人",
  73.     2 => "全体敌人",
  74.     3 => "一个随机敌人",
  75.     4 => "两个随机敌人",
  76.     5 => "三个随机敌人",
  77.     6 => "四个随机敌人",
  78.     7 => "单个队友",
  79.     8 => "全体队友",
  80.     9 => "单个队友(濒死)",
  81.     10 => "全体队友(濒死)",
  82.     11 => "使用者" }
  83.   #技能命中类型
  84.   HIT ={
  85.     0 => "必定命中",
  86.     1 => "物理攻击",
  87.     2 => "魔法攻击"}
  88.   #使用限制
  89.   OCCASION ={
  90.     0 => "随时可用",
  91.     1 => "仅战斗中",
  92.     2 => "仅菜单中",
  93.     3 => "不能使用"}
  94.   #添加能力
  95.   XPARAM ={
  96.     0 => "物理命中几率:",
  97.     1 => "物理闪避几率:",
  98.     2 => "必杀几率:",
  99.     3 => "必杀闪避几率:",
  100.     4 => "魔法闪避几率:",
  101.     5 => "魔法反射几率:",
  102.     6 => "物理反击几率:",
  103.     7 => "体力值再生速度:",
  104.     8 => "魔力值再生速度:",
  105.     9 => "特技值再生速度:"}
  106.   #特殊能力
  107.   SPARAM ={
  108.     0 => "受到攻击的几率",
  109.     1 => "防御效果比率",
  110.     2 => "恢复效果比率",
  111.     3 => "药理知识",
  112.     4 => "MP消费率",
  113.     5 => "TP消耗率",
  114.     6 => "物理伤害加成",
  115.     7 => "魔法伤害加成",
  116.     8 => "地形伤害加成",
  117.     9 => "经验获得加成"}
  118.   #装备风格  require 装备风格扩展脚本
  119.   SLOT_TYPE ={
  120.     0 => "普通",
  121.     1 => "双持武器",
  122.     2 => "索爷三刀流",
  123.     3 => "NPC",
  124.     4 => "233",
  125.     5 => "论坛@的BUG好烦啊"}
  126.   #队伍能力
  127.   PARTY_ABILITY ={
  128.     0 => "遇敌几率减半",
  129.     1 => "随机遇敌无效",
  130.     2 => "敌人偷袭无效",
  131.     3 => "先制攻击几率上升",
  132.     4 => "获得金钱数量双倍",
  133.     5 => "物品掉落几率双倍"}
  134.   #伤害类型
  135.   DAMAGE_TYPE = {
  136.     0 => "无",
  137.     1 => "体力值伤害",
  138.     2 => "魔力值伤害",
  139.     3 => "体力值恢复",
  140.     4 => "魔力值恢复",
  141.     5 => "体力值吸收",
  142.     6 => "魔力值吸收"}
  143.   #普通能力
  144.   #这只是个示范,你也可以依照个人喜好对这些用语添加颜色控制符
  145.   @params ={
  146.     0 => "\\c[17]最大HP",
  147.     1 => "\\c[16]最大MP",
  148.     2 => "\\c[20]物攻",
  149.     3 => "\\c[21]物防",
  150.     4 => "\\c[30]魔攻",
  151.     5 => "\\c[31]魔防",
  152.     6 => "\\c[14]敏捷",
  153.     7 => "\\c[17]幸运"}
  154.   #我举例技能类型的原因就是因为它 短
  155.   @skill_types = { # 这个和下面equiphelpready里注释掉的做的是一样的事
  156.                    # 只是下面是读取数据库添加用语,这里是手动枚举
  157.     1 => "\\c[1]特技",
  158.     2 => "\\c[2]魔法",
  159.     3 => "\\c[3]绝技",
  160.     4 => "\\c[5]卖萌"}
  161.   #初始化数据,当然如果你要用上面那样的控制符改变颜色的话
  162.   #欢迎枚举格式就是上面这样用Hash,用ID做键把用语对应起来
  163.   def self.equiphelpready
  164.     params = $data_system.terms.params
  165.     elements = $data_system.elements
  166.     weapon_types = $data_system.weapon_types
  167.     armor_types = $data_system.armor_types
  168.     etypes = $data_system.terms.etypes
  169.     skill_types = $data_system.skill_types
  170.     @states       ||= {}
  171.     @params       ||= {}
  172.     @weapon_types ||= {}
  173.     @armor_types  ||= {}
  174.     @etypes       ||= {}
  175.     @skill_types  ||= {}
  176.     @elements     ||= {}
  177.     skill_types.each_with_index{|x,y| @skill_types[y] = x if !x.nil?} if @skill_types == {}
  178.     $data_states.each{|x| @states[x.id] = x.name if !x.nil?} if @states == {}
  179.     elements.each_with_index{|x,y| @elements[y] = x if !x.nil?} if @elements == {}
  180.     weapon_types.each_with_index{|x,y| @weapon_types[y] = x if !x.nil?} if @weapon_types == {}
  181.     armor_types.each_with_index{|x,y| @armor_types[y] = x if !x.nil?} if @armor_types == {}
  182.     etypes.each_with_index{|x,y| @etypes[y] = x} if @etypes == {}
  183.     params.each_with_index{|x,y| @params[y] = x} if @params == {}
  184.   end
  185.   #获取装备帮助内容
  186.   def self.getequiphelp(equip)
  187.     help = ""
  188.     param = []
  189.     help += "\\c[16]装备位置:#{Vocab::etype(equip.etype_id)}\\c[0]\n"
  190.     if $VIPArcherScript[:equip_limit] #装备能力限制
  191.       help += "\\c[16]等级需求:#{equip.level_limit}\n" if equip.level_limit > 0
  192.       param_limit = []
  193.       for i in 0..7
  194.         if equip.params_limit(i) != 0
  195.           help += "\\c[16]#{@params[i]}需求:#{equip.params_limit(i)}\\c[0]\n"
  196.         end
  197.       end
  198.     end
  199.     equip.params.each_with_index{|x,y| param.push([@params[y],x])}
  200.     param = param.select{|x| x[1] != 0}
  201.     param.each{|x| help += "\\c[#{x[1]>0? UP : DOWN}]#{x[0]}:\\c[#{x[1]>0? UP : DOWN}]#{""if x[1]>0}#{x[1].to_int.to_s}\\c[0]\n"}
  202.     features = equip.features
  203.     featuresparam = []
  204.     featuresparam.push features.select{|x| x.code == 21}
  205.     featuresparam.push features.select{|x| x.code == 22}
  206.     featuresparam.push features.select{|x| x.code == 23}
  207.     featuresparam[0].each{|x| help += "\\c[#{x.value<0?DOWN: UP}]#{@params[x.data_id]}#{x.value<0?"":""}#{(x.value.abs*100).to_i}%\n"}
  208.     featuresparam[1].each{|x| help += "\\c[#{x.value<0?DOWN: UP}]#{XPARAM[x.data_id]}#{x.value<0?"":""}#{(x.value.abs*100).to_i}%\n"}
  209.     featuresparam[2].each{|x| help += "\\c[#{x.value<0?DOWN: UP}]#{SPARAM[x.data_id]}#{x.value<0?"":""}#{(x.value.abs*100).to_i}%\n"}
  210.     if $VIPArcherScript[:slot_type]
  211.       help += "\\c[#{VIP}]#{CODE[55]}:#{SLOT_TYPE[$1.to_i]}\\c[0]\n" if equip.note =~ /<slot_type\s*[:](.*)>/i
  212.     else
  213.       features.select{|x| x.code == 55}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:双持武器\\c[0]\n"}
  214.     end
  215.     features.select{|x| x.code == 11}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@elements[x.data_id]}×#{(x.value*100).to_i}%\\c[0]\n"}
  216.     features.select{|x| x.code == 12}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@params[x.data_id]}×#{(x.value*100).to_i}%\\c[0]\n"}
  217.     features.select{|x| x.code == 13}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@states[x.data_id]}×#{(x.value*100).to_i}%\\c[0]\n"}
  218.     features.select{|x| x.code == 14}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{@states[x.data_id]}\\c[0]\n"}
  219.     features.select{|x| x.code == 31}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@elements[x.data_id]}\\c[0]\n"}
  220.     features.select{|x| x.code == 32}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@states[x.data_id]}#{(x.value*100).to_i}%\\c[0]\n"}
  221.     features.select{|x| x.code == 33}.each{|x| help += "\\c[#{x.value>0? UP : DOWN}]#{CODE[x.code]}:#{x.value}\\c[0]\n"}
  222.     features.select{|x| x.code == 34}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{x.value}\\c[0]\n"}
  223.     features.select{|x| x.code == 41}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@skill_types[x.data_id]}\\c[0]\n"}
  224.     features.select{|x| x.code == 42}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{@skill_types[x.data_id]}\\c[0]\n"}
  225.     features.select{|x| x.code == 43}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{$data_skills[x.data_id].name}\\c[0]\n"}
  226.     features.select{|x| x.code == 44}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{$data_skills[x.data_id].name}\\c[0]\n"}
  227.     features.select{|x| x.code == 51}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@weapon_types[x.data_id]}\\c[0]\n"}
  228.     features.select{|x| x.code == 52}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@armor_types[x.data_id]}\\c[0]\n"}
  229.     features.select{|x| x.code == 53}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{@etypes[x.data_id]}\\c[0]\n"}
  230.     features.select{|x| x.code == 54}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{@etypes[x.data_id]}\\c[0]\n"}
  231.     features.select{|x| x.code == 61}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{x.value}\\c[0]\n"}
  232.     features.select{|x| x.code == 62}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{FLAG[x.data_id]}\\c[0]\n"}
  233.     features.select{|x| x.code == 64}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{PARTY_ABILITY[x.data_id]}\\c[0]\n"}
  234.     help
  235.   end
  236.   #获取技能帮助内容
  237.   def self.getskillhelp(skill)
  238.     help = ""
  239.     effects = skill.effects
  240.     damage  = skill.damage
  241.     r = [skill.required_wtype_id1,skill.required_wtype_id2]
  242.     help += "\\c[16]消耗:\\c[#{MP}]MP:#{skill.mp_cost.to_s} \\c[#{TP}]TP:#{skill.tp_cost.to_s}\\c[0]\n" if skill.mp_cost > 0 && skill.tp_cost > 0
  243.     help += "\\c[16]消耗:\\c[#{MP}]MP:#{skill.mp_cost.to_s}\\c[0]\n" if skill.mp_cost > 0 && skill.tp_cost <= 0
  244.     help += "\\c[16]消耗:\\c[#{TP}]TP:#{skill.tp_cost.to_s}\\c[0]\n" if skill.tp_cost > 0 && skill.mp_cost <= 0
  245.     help += "\\c[#{skill.speed<0?DOWN: UP}]速度修正:#{skill.speed}\\c[0]\n" if skill.speed != 0
  246.     help += "\\c[#{DOWN}]成功率:#{skill.success_rate}%\\c[0]\n" if skill.success_rate != 100
  247.     help += "\\c[16]类型:#{HIT[skill.hit_type]}\\c[0]\n"
  248.     help += "\\c[16]范围:#{SCOPE[skill.scope]}\\c[0]\n" if skill.scope != 0
  249.     help += "\\c[16]效果:#{@elements[damage.element_id]}#{DAMAGE_TYPE[damage.type]}\\c[0]\n" if damage.type != 0
  250.     effects.select{|x| x.code == 31}.each{|x| help += "\\c[#{UP}]强化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  251.     effects.select{|x| x.code == 32}.each{|x| help += "\\c[#{UP}]弱化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  252.     effects.select{|x| x.code == 33}.each{|x| help += "\\c[#{UP}]解除:强化#{@params[x.data_id]}\n"}
  253.     effects.select{|x| x.code == 34}.each{|x| help += "\\c[#{UP}]解除:弱化#{@params[x.data_id]}\n"}
  254.     effects.select{|x| x.code == 21}.each{|x| help += "\\c[#{UP}]附加:#{x.data_id == 0 ? "普通攻击" : @states[x.data_id]} #{(x.value1*100).to_i}%\\c[0]\n"}
  255.     effects.select{|x| x.code == 22}.each{|x| help += "\\c[#{UP}]解除:#{@states[x.data_id]} #{(x.value1*100).to_i}%\\c[0]\n"}
  256.     effects.select{|x| x.code == 41}.each{|x| help += "\\c[#{VIP}]特殊效果:撤退\n"}
  257.     effects.select{|x| x.code == 42}.each{|x| help += "\\c[#{UP}]提升:#{@params[x.data_id]}#{x.value1.to_i}点\\c[0]\n"}
  258.     effects.select{|x| x.code == 43}.each{|x| help += "\\c[#{VIP}]学会:#{$data_skills[x.data_id].name}\\c[0]\n"}
  259.     help += "\\c[16]场合:#{OCCASION[skill.occasion]}\n"
  260.     help += "\\c[#{DOWN}]限制:#{$data_system.weapon_types[r[0]] if r[0] != 0} #{$data_system.weapon_types[r[1]] if r[1] != 0}\\c[0]\n" if r != [0,0]
  261.     help
  262.   end
  263.   #获取道具帮助内容
  264.   def self.getitemhelp(item)
  265.     help = ""
  266.     effects = item.effects
  267.     damage  = item.damage
  268.     help += "\\c[16]类型:\\c[#{VIP}]#{"贵重物品  "if item.itype_id != 1}\\c[#{DOWN}]#{item.consumable ? "消耗品":"非消耗品"}\\c[0]\n"
  269.     help += "\\c[16]范围:#{SCOPE[item.scope]}\\c[0]\n" if item.scope != 0
  270.     help += "\\c[16]效果:#{@elements[damage.element_id]}#{DAMAGE_TYPE[damage.type]}\\c[0]\n" if damage.type != 0
  271.     effects.select{|x| x.code == 31}.each{|x| help += "\\c[#{UP}]强化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  272.     effects.select{|x| x.code == 32}.each{|x| help += "\\c[#{UP}]弱化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  273.     effects.select{|x| x.code == 33}.each{|x| help += "\\c[#{UP}]解除:强化#{@params[x.data_id]}\\c[0]\n"}
  274.     effects.select{|x| x.code == 34}.each{|x| help += "\\c[#{UP}]解除:弱化#{@params[x.data_id]}\\c[0]\n"}
  275.     effects.select{|x| x.code == 21}.each{|x| help += "\\c[#{UP}]附加:#{x.data_id == 0 ? "普通攻击" : @states[x.data_id]} #{(x.value1*100).to_i}%\\c[0]\n"}
  276.     effects.select{|x| x.code == 22}.each{|x| help += "\\c[#{UP}]解除:#{@states[x.data_id]} #{(x.value1*100).to_i}%\\c[0]\n"}
  277.     effects.select{|x| x.code == 41}.each{|x| help += "\\c[#{VIP}]特殊效果:撤退\n"}
  278.     effects.select{|x| x.code == 42}.each{|x| help += "\\c[#{VIP}]提升:#{@params[x.data_id]}#{x.value1.to_i}点\\c[0]\n"}
  279.     effects.select{|x| x.code == 43}.each{|x| help += "\\c[#{VIP}]学会:#{$data_skills[x.data_id].name}\\c[0]\n"}
  280.     help += "\\c[16]场合:#{OCCASION[item.occasion]}\\c[0]\n"
  281.     help
  282.   end
  283.   #计算行数(有些字体的汉字和[字母,数字,符号]的宽度不同,
  284.   #有可能会照成行数计算不对,尽量用宽度相同的字体吧)
  285.   def self.getline(text,maxtext)
  286.     text_new = ""
  287.     xtext = []
  288.     line = 0
  289.     text.each_line{|x| text_new += x.gsub(/\\\S\[\d+\]/i){}} #去掉控制符
  290.     text_new.each_line{|x| xtext.push x.gsub(/\n/){}}        #去掉换行符
  291.     xtext.each{|x| line += (x.size / (maxtext.to_f + 1).to_i) + 1}
  292.     line
  293.   end
  294. end
  295. #==============================================================================
  296. # ■ Window_Help_Ex
  297. #------------------------------------------------------------------------------
  298. #  加强显示特技和物品等的说明
  299. #==============================================================================
  300.  
  301. class Window_Help_Ex < Window_Base
  302.   include VIPArcher::Equipplus
  303.   #--------------------------------------------------------------------------
  304.   # ● 初始化对象
  305.   #--------------------------------------------------------------------------
  306.   def initialize(line_number = 0)
  307.     super(0, 0, 210, 0)
  308.     self.z = 150
  309.     contents.font.size = Font_Size
  310.     [url=home.php?mod=space&uid=134219]@Time[/url] = 0
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # ● 设置内容
  314.   #--------------------------------------------------------------------------
  315.   def set_text(text)
  316.     @text = text
  317.     refresh
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 清除
  321.   #--------------------------------------------------------------------------
  322.   def clear
  323.     set_text("")
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 更新帮助位置
  327.   #--------------------------------------------------------------------------
  328.   def uppos(index,rect,window)
  329.     self.height = fitting_height_vip(VIPArcher::Equipplus.getline(@xtext,13))
  330.     create_contents
  331.     contents.font.name = Font_Name
  332.     contents.font.size = Font_Size
  333.     rect.x -= window.ox
  334.     rect.y -= window.oy
  335.     ax = rect.x + rect.width + 10
  336.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
  337.     ax += window.x
  338.     ax = 0 if ax < 0
  339.     ay = rect.y + rect.height
  340.     ay = rect.y - self.height if ay + self.height > window.height
  341.     ay += window.y
  342.     ay = 0 if ay < 0
  343.     self.x = ax
  344.     self.y = ay
  345.     set_text(@xtext)
  346.     @time = TIME
  347.     self.show
  348.     self.openness = 0
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ● 设置物品
  352.   #     item : 技能、物品等
  353.   #--------------------------------------------------------------------------
  354.   def set_item(item)
  355.     if item == nil
  356.       set_text("")
  357.       return
  358.     end
  359.     @xtext = ""
  360.     if $VIPArcherScript[:itemcolor] # require 物品描绘颜色脚本
  361.       @xtext = "\\c[16]名称:\\c[#{VIPArcher::ItemColor::Color_Lv[item.color]}]" +
  362.       "#{item.name}  #{item.color if item.color != 0}#{"" if item.color != 0}\\c[0]\n"
  363.     else
  364.       @xtext = "\\c[16]名称:\\c[0]#{item.name}\n"
  365.     end
  366.     @xtext += "\\c[16]介绍:\\c[0]#{item.description}\n"
  367.     if $VIPArcherScript[:load]      # require 队伍负重脚本
  368.       @xtext += "\\c[16]售价:#{item.price} 重量:#{item.load}\\c[0]\n"
  369.     else
  370.       @xtext += item.price == 0 ? "\\c[16]售价:\\c[14]无法出售\\c[0]\n":"\\c[16]售价:#{item.price}\\c[0]\n"
  371.     end if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
  372.     @xtext += VIPArcher::Equipplus.getequiphelp(item) if item.is_a?(RPG::EquipItem)
  373.     @xtext += VIPArcher::Equipplus.getskillhelp(item) if item.is_a?(RPG::Skill)
  374.     @xtext += VIPArcher::Equipplus.getitemhelp(item) if item.is_a?(RPG::Item)
  375.     if $VIPArcherScript[:exdrop_rate]   # require 队伍掉率扩展
  376.       @xtext += "\\c[#{$2.to_i > 0 ? UP : DOWN}]#{$1}掉率: #{$2}%\\c[0]\n" if
  377.       item.note =~ /<(\W+)掉率:\s*([0-9+.-]+)%>/i
  378.     end if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Skill)
  379.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ● 刷新
  383.   #--------------------------------------------------------------------------
  384.   def refresh
  385.     contents.clear
  386.     self.hide if @text == ""
  387.     draw_text_vip(4, 0, @text,width,40,false)
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ● 更新画面
  391.   #--------------------------------------------------------------------------
  392.   def update
  393.     super
  394.     @time -= 1 if @time > 0
  395.     self.open if @time == 0
  396.   end
  397. end
  398. class Window_Base < Window
  399.   #--------------------------------------------------------------------------
  400.   # ● 计算窗口显示指定行数时的应用高度2*************************
  401.   #--------------------------------------------------------------------------
  402.   def fitting_height_vip(line_number)
  403.     line_number * contents.font.size + standard_padding * 2
  404.   end
  405.   # draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  406.   #--------------------------------------------------------------------------
  407.   # ● 绘制带有控制符的文本内容
  408.   #   如果传递了width参数的话,会自动换行
  409.   #--------------------------------------------------------------------------
  410.   def draw_text_vip(x, y, text, width = nil,textwidth = nil,normalfont = true)
  411.     reset_font_settings if normalfont == true
  412.     text = convert_escape_characters(text)
  413.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  414.     if width != nil
  415.       pos[:height] = contents.font.size
  416.       pos[:width] = width
  417.       pos[:textwidth] = textwidth
  418.     end
  419.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 文字的处理
  423.   #     c    : 文字
  424.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  425.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  426.   #--------------------------------------------------------------------------
  427.   def process_character(c, text, pos)
  428.     case c
  429.     when "\r"   # 回车
  430.       return
  431.     when "\n"   # 换行
  432.       process_new_line(text, pos)
  433.     when "\f"   # 翻页
  434.       process_new_page(text, pos)
  435.     when "\e"   # 控制符
  436.       process_escape_character(obtain_escape_code(text), text, pos)
  437.     else        # 普通文字
  438.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
  439.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
  440.         process_new_line(text, pos)
  441.       end
  442.       process_normal_character(c, pos)
  443.     end
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ● 处理换行文字
  447.   #--------------------------------------------------------------------------
  448.   alias vip_20141007_process_new_line process_new_line
  449.   def process_new_line(text, pos)
  450.     vip_20141007_process_new_line(text, pos)
  451.     pos[:height] = contents.font.size if pos[:width] != nil
  452.   end
  453. end
  454.  
  455. #==============================================================================
  456. # ■ 设置帮助增强窗口
  457. #==============================================================================
  458. class Window_Selectable < Window_Base
  459.   attr_reader   :help_ex_window
  460.   #--------------------------------------------------------------------------
  461.   # ● 调用帮助窗口的更新方法
  462.   #--------------------------------------------------------------------------
  463.   alias help_ex_call_update_help call_update_help
  464.   def call_update_help
  465.     help_ex_call_update_help
  466.     update_ex_help if active && @help_ex_window
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ● 更新帮助内容
  470.   #--------------------------------------------------------------------------
  471.   def update_ex_help
  472.     @help_ex_window.set_item(item) if @help_ex_window
  473.     if index != -1 && item != nil
  474.       @help_ex_window.uppos(index,item_rect(index),self)
  475.     end
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● 设置帮助增强窗口
  479.   #--------------------------------------------------------------------------
  480.   def help_ex_window=(help_ex_window)
  481.     @help_ex_window = help_ex_window
  482.   end
  483. end
  484. #==============================================================================
  485. # ■ 在各场景处理帮助窗口
  486. #==============================================================================
  487. class Scene_Base
  488.   #--------------------------------------------------------------------------
  489.   # ● 生成帮助增强窗口
  490.   #--------------------------------------------------------------------------
  491.   def create_help_ex
  492.     @help_ex_window  = Window_Help_Ex.new
  493.     @help_ex_window .viewport = @viewport
  494.     @item_window.help_ex_window  = @help_ex_window if @item_window
  495.     @slot_window.help_ex_window  = @help_ex_window if @slot_window
  496.     @skill_window.help_ex_window = @help_ex_window if @skill_window
  497.     @buy_window.help_ex_window   = @help_ex_window if @buy_window
  498.     @sell_window.help_ex_window  = @help_ex_window if @sell_window
  499.   end
  500. end
  501. #道具栏
  502. class Scene_Item < Scene_ItemBase
  503.   #--------------------------------------------------------------------------
  504.   # ● 开始处理
  505.   #--------------------------------------------------------------------------
  506.   alias help_ex_start start
  507.   def start
  508.     help_ex_start
  509.     create_help_ex
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ● 物品“取消”
  513.   #--------------------------------------------------------------------------
  514.   alias help_ex_on_item_cancel on_item_cancel
  515.   def on_item_cancel
  516.     help_ex_on_item_cancel
  517.     @help_ex_window.hide
  518.   end
  519. end
  520. #装备栏
  521. class Scene_Equip < Scene_MenuBase
  522.   #--------------------------------------------------------------------------
  523.   # ● 开始处理
  524.   #--------------------------------------------------------------------------
  525.   alias help_ex_start start
  526.   def start
  527.     help_ex_start
  528.     create_help_ex
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● 装备栏“取消”
  532.   #--------------------------------------------------------------------------
  533.   alias help_ex_on_slot_cancel on_slot_cancel
  534.   def on_slot_cancel
  535.     help_ex_on_slot_cancel
  536.     @help_ex_window.hide
  537.   end
  538. end
  539. #技能栏
  540. class Scene_Skill < Scene_ItemBase
  541.   #--------------------------------------------------------------------------
  542.   # ● 开始处理
  543.   #--------------------------------------------------------------------------
  544.   alias help_ex_start start
  545.   def start
  546.     help_ex_start
  547.     create_help_ex
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # ● 物品“确定”
  551.   #--------------------------------------------------------------------------
  552.   alias help_ex_on_item_ok on_item_ok
  553.   def on_item_ok
  554.     help_ex_on_item_ok
  555.     @help_ex_window.hide
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # ● 物品“取消”
  559.   #--------------------------------------------------------------------------
  560.   alias help_ex_on_item_cancel on_item_cancel
  561.   def on_item_cancel
  562.     help_ex_on_item_cancel
  563.     @help_ex_window.hide
  564.   end
  565. end
  566. #战斗界面
  567. class Scene_Battle < Scene_Base
  568.   #--------------------------------------------------------------------------
  569.   # ● 开始处理
  570.   #--------------------------------------------------------------------------
  571.   alias help_ex_start start
  572.   def start
  573.     help_ex_start
  574.     create_help_ex
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● 技能“确定”
  578.   #--------------------------------------------------------------------------
  579.   alias help_ex_on_skill_ok on_skill_ok
  580.   def on_skill_ok
  581.     help_ex_on_skill_ok
  582.     @help_ex_window.hide
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● 技能“取消”
  586.   #--------------------------------------------------------------------------
  587.   alias help_ex_on_skill_cancel on_skill_cancel
  588.   def on_skill_cancel
  589.     help_ex_on_skill_cancel
  590.     @help_ex_window.hide
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● 物品“确定”
  594.   #--------------------------------------------------------------------------
  595.   alias help_ex_on_item_ok on_item_ok
  596.   def on_item_ok
  597.     help_ex_on_item_ok
  598.     @help_ex_window.hide
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # ● 物品“取消”
  602.   #--------------------------------------------------------------------------
  603.   alias help_ex_on_item_cancel on_item_cancel
  604.   def on_item_cancel
  605.     help_ex_on_item_cancel
  606.     @help_ex_window.hide
  607.   end
  608. end
  609. #商店界面
  610. class Scene_Shop < Scene_MenuBase
  611.   #--------------------------------------------------------------------------
  612.   # ● 开始处理
  613.   #--------------------------------------------------------------------------
  614.   alias help_ex_start start
  615.   def start
  616.     help_ex_start
  617.     create_help_ex
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # ● 买入“确定”
  621.   #--------------------------------------------------------------------------
  622.   alias help_ex_on_buy_ok on_buy_ok
  623.   def on_buy_ok
  624.     help_ex_on_buy_ok
  625.     @help_ex_window.hide
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● 买入“取消”
  629.   #--------------------------------------------------------------------------
  630.   alias help_ex_on_buy_cancel on_buy_cancel
  631.   def on_buy_cancel
  632.     help_ex_on_buy_cancel
  633.     @help_ex_window.hide
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # ● 卖出“确定”
  637.   #--------------------------------------------------------------------------
  638.   alias help_ex_on_sell_ok on_sell_ok
  639.   def on_sell_ok
  640.     help_ex_on_sell_ok
  641.     @help_ex_window.hide
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # ● 卖出“取消”
  645.   #--------------------------------------------------------------------------
  646.   alias help_ex_on_sell_cancel on_sell_cancel
  647.   def on_sell_cancel
  648.     help_ex_on_sell_cancel
  649.     @help_ex_window.hide
  650.   end
  651. end

作者: 饿啊    时间: 2016-8-24 14:01
自顶一下...
作者: 喵呜喵5    时间: 2016-8-25 13:59
234行:
  1. help + equip.note
复制代码

261行:
  1. help + skill.note
复制代码

281行:
  1. help + item.note
复制代码


未测试,基本的思路如上

针对这个思路去调整即可
作者: 饿啊    时间: 2016-8-25 16:16
本帖最后由 饿啊 于 2016-8-26 23:32 编辑

谢喵大,不过如何能把备注栏里面我用的其他脚本的代码去除掉? @喵呜喵5
图中指令对应脚本:
RUBY 代码复制
  1. #==============================================================================
  2. # ■ 此脚本来自 [url]www.66rpg.com[/url]
  3. #------------------------------------------------------------------------------
  4. #   名称:横版战斗模板
  5. #   作者:后知后觉([email][email protected][/email])
  6. #   版本:v1.7  2012-02-09
  7. #   使用协议:在保留此脚本相关信息的情况下
  8. #             可任意使用、修改及修改后发布.
  9. #             如是修改后发布.请在作者标注那里加上 某某某改 等信息
  10. #             感谢你来这里谈谈你对这个工程的看法或报告BUG.
  11. #               [url]http://rpg.blue/thread-216673-1-1.html[/url]
  12. #   使用说明:
  13. #       请来发布帖查看:
  14. #           [url]http://rpg.blue/thread-216673-1-1.html[/url]
  15. #==============================================================================
  16.  
  17. module Hzhj
  18.   module HorizontalBattleSystem
  19.     # 取得参战角色的最大数.如果要改大.需要在下面的坐标设置里增加对应的条目
  20.     MaxBattleMembers = 4
  21.  
  22.     ActorsBattlePosition = {}
  23.     # 设置角色战斗图形的坐标
  24.     # 等号左边的[]号里面的1 2 3 4 表示角色在队伍里的位置
  25.     # 等号右边的[]号里面的两个数字分别表示 X坐标 Y坐标
  26.     # 每次进入战斗的时候都会以这里设置的信息作为初始化位置.
  27.     # 如果你把上面的 MaxBattleMembers 改大了.比如改成了 5.
  28.     # 那么你需要在下面新增一行代码设置队伍中第5位置的坐标.
  29.     # 就像这样 ActorsBattlePosition[5] = [X坐标, Y坐标]
  30.     ActorsBattlePosition[1] = [378, 228]
  31.     ActorsBattlePosition[2] = [422, 272]
  32.     ActorsBattlePosition[3] = [466, 228]
  33.     ActorsBattlePosition[4] = [510, 272]
  34.  
  35.     # 设置伤害值图形的色相 取值范围 0~360
  36.     DamageBitmapHue = 0
  37.     # 伤害值分段显示的标志SE文件名
  38.     DamageSectionDisplaySEName = "DamageSection"
  39.  
  40.     # 动画 Z 坐标值默认变化量
  41.     DefaultAniAddZ = 768
  42.  
  43.     # 状态动画 Z 坐标值默认变化量
  44.     DefaultLoopAniAddZ = 20
  45.  
  46.     # 战斗中角色的面向
  47.     ActorDirection = 4
  48.  
  49.     # 真位移的帧数
  50.     RealMoveDuration = 20
  51.     # 真位移移动前会计算目标点.会获取攻防双方战斗图大小来进行计算.
  52.     # 下面2个是对战斗图 width height 进行修正.
  53.     # 为正则扩大 为负则缩小.单位 像素.
  54.     # 一般来说不必修改.只有像梦幻群侠传那种战斗图四边有很多透明区域时才修正.
  55.     RealMoveBmpAddW = 0
  56.     RealMoveBmpAddH = 0
  57.  
  58.     # 使用技能、物品的过程默认使用RMVA模式
  59.     # 在该模式下.本脚本提供的很多功能受限无法使用.
  60.     DefaultUseRmvaMode = false
  61.  
  62.     # 默认显示敌人的HP条、MP条、TP条
  63.     DefaultDisplayEnemyBar = true
  64.  
  65.     # 一张战斗图中有几个样式(帧、格)
  66.     DynamicPatternMax = 1
  67.     # 一张战斗图中的一个样式持续多少帧
  68.     OnePatternDuration = 15
  69.  
  70.     # 角色使用战斗死亡图形
  71.     UseActorDeadGraphic = false
  72.     # 敌人使用战斗死亡图形
  73.     UseEnemyDeadGraphic = false
  74.  
  75.     # 使用挨打图形
  76.     UseBeatenGraphic = false
  77.     # 挨打图形维持帧数
  78.     BeatenGraphicDuration = 30
  79.  
  80.     # 是否使用角色防御图 只有同时使用了挨打图.此项才有效.
  81.     UseActorGuardGraphic = false
  82.     # 是否使用敌人防御图 只有同时使用了挨打图.此项才有效.
  83.     UseEnemyGuardGraphic = false
  84.  
  85.     # 角色是否使用挨打SE
  86.     UseActorWBSE = false
  87.     # 敌人是否使用挨打SE
  88.     UseEnemyWBSE = false
  89.     # 角色是否使用防御SE
  90.     UseActorGDSE = false
  91.     # 敌人是否使用防御SE
  92.     UseEnemyGDSE = false
  93.   end
  94. end
  95.  
  96. class RPG::Actor < RPG::BaseItem
  97.   def battler_name
  98.     return @battler_name unless @battler_name.nil?
  99.     if /@btname\[(.+?)\]/ =~ @note
  100.       return (@battler_name = $1.clone)
  101.     else
  102.       return (@battler_name = "#{@name}_#{@nickname}")
  103.     end
  104.   end
  105.   def battler_hue
  106.     return @battler_hue unless @battler_hue.nil?
  107.     if /@bthue\[([0-9]+?)\]/ =~ @note
  108.       return (@battler_hue = $1.to_i.abs)
  109.     else
  110.       return (@battler_hue = 0)
  111.     end
  112.   end
  113.   attr_writer :battler_name
  114.   attr_writer :battler_hue
  115. end
  116. #==============================================================================
  117. # ■ Game_Actor
  118. #==============================================================================
  119. class Game_Actor < Game_Battler
  120.   #--------------------------------------------------------------------------
  121.   # ● 属性(新增定义)
  122.   #--------------------------------------------------------------------------
  123.   attr_writer   :battler_name             # 战斗图形文件名
  124.   attr_writer   :battler_hue              # 战斗图形色相
  125.   #--------------------------------------------------------------------------
  126.   # ● 设置(追加定义)
  127.   #--------------------------------------------------------------------------
  128.   alias hzhj_old_setup_for_add_actor_battle_graphic setup
  129.   def setup(actor_id)
  130.     hzhj_old_setup_for_add_actor_battle_graphic(actor_id)
  131.     @battler_name = actor.battler_name
  132.     @battler_hue = actor.battler_hue
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● 是否使用活动块(重定义)
  136.   #--------------------------------------------------------------------------
  137.   def use_sprite?
  138.     return true
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● 取得战斗画面 X 坐标(新增定义)
  142.   #--------------------------------------------------------------------------
  143.   def screen_x
  144.     return ActorsBattlePosition[index + 1][0]
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 取得战斗画面 Y 坐标(新增定义)
  148.   #--------------------------------------------------------------------------
  149.   def screen_y
  150.     return ActorsBattlePosition[index + 1][1]
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 取得战斗画面 Z 坐标(新增定义)
  154.   #--------------------------------------------------------------------------
  155.   def screen_z
  156.     return real_screen_y + 100
  157.   end
  158. end
  159. #==============================================================================
  160. # ■ Game_Enemy
  161. #==============================================================================
  162. class Game_Enemy < Game_Battler
  163.   #--------------------------------------------------------------------------
  164.   # ● 属性(新增定义)
  165.   #--------------------------------------------------------------------------
  166.   attr_writer   :battler_name             # 战斗图形文件名
  167.   attr_writer   :battler_hue              # 战斗图形色相
  168.   #--------------------------------------------------------------------------
  169.   # ● 取得战斗画面 Z 坐标(重定义)
  170.   #--------------------------------------------------------------------------
  171.   def screen_z
  172.     return real_screen_y + 100
  173.   end
  174. end
  175. #==============================================================================
  176. # ■ Game_Party
  177. #==============================================================================
  178. class Game_Party < Game_Unit
  179.   include Hzhj::HorizontalBattleSystem
  180.   #--------------------------------------------------------------------------
  181.   # ● 取得参战角色的最大数(重定义)
  182.   #--------------------------------------------------------------------------
  183.   def max_battle_members
  184.     return MaxBattleMembers
  185.   end
  186. end
  187.  
  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 !@subject.current_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 !@subject.current_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 !@subject.current_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.  
  524. class RPG::Animation
  525.   include Hzhj::HorizontalBattleSystem
  526.   def ani_z_correction
  527.     return @ani_z_correction unless @ani_z_correction.nil?
  528.     if /@az\[(\-??\d+?)\]/ =~ @name
  529.       return (@ani_z_correction = $1.to_i)
  530.     else
  531.       return (@ani_z_correction = DefaultAniAddZ)
  532.     end
  533.   end
  534.   def loop_z_correction
  535.     return @loop_z_correction unless @loop_z_correction.nil?
  536.     if /@lz\[(\-??\d+?)\]/ =~ @name
  537.       return (@loop_z_correction = $1.to_i)
  538.     else
  539.       return (@loop_z_correction = DefaultLoopAniAddZ)
  540.     end
  541.   end
  542.   attr_writer :ani_z_correction
  543.   attr_writer :loop_z_correction
  544. end
  545. class RPG::State < RPG::BaseItem
  546.   def animation_id
  547.     return @animation_id unless @animation_id.nil?
  548.     if /@aid\[(\d+?)\]/ =~ @note
  549.       return (@animation_id = $1.to_i)
  550.     else
  551.       return (@animation_id = 0)
  552.     end
  553.   end
  554.   attr_writer :animation_id
  555. end
  556. #==============================================================================
  557. # ■ Game_BattlerBase
  558. #==============================================================================
  559. class Game_BattlerBase
  560.   #--------------------------------------------------------------------------
  561.   # ● 实例变量(新增定义)
  562.   #--------------------------------------------------------------------------
  563.   attr_reader   :hzhj_add_state_id
  564.   attr_reader   :hzhj_remove_state_id
  565.   attr_accessor :need_update_state_animation
  566.   #--------------------------------------------------------------------------
  567.   # ● 初始化(追加定义)
  568.   #--------------------------------------------------------------------------
  569.   alias hzhj_old_init_for_state_ani_game_battler_base initialize
  570.   def initialize
  571.     @hzhj_add_state_id = []
  572.     @hzhj_remove_state_id = []
  573.     @need_update_state_animation = false
  574.     @states = []
  575.     @state_turns = {}
  576.     @state_steps = {}
  577.     hzhj_old_init_for_state_ani_game_battler_base
  578.   end
  579.   #--------------------------------------------------------------------------
  580.   # ● 清除状态信息(追加定义)
  581.   #--------------------------------------------------------------------------
  582.   alias hzhj_old_clear_states_for_state_ani_game_battler_base clear_states
  583.   def clear_states
  584.     old_states = @states.clone
  585.     hzhj_old_clear_states_for_state_ani_game_battler_base
  586.     bingji = old_states | @states
  587.     return if bingji.empty?
  588.     set_add_state_id(bingji & @states)
  589.     set_remove_state_id(bingji & old_states)
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● 消除状态(追加定义)
  593.   #--------------------------------------------------------------------------
  594.   alias hzhj_old_erase_state_for_state_ani_game_battler_base erase_state
  595.   def erase_state(state_id)
  596.     old_states = @states.clone
  597.     hzhj_old_erase_state_for_state_ani_game_battler_base(state_id)
  598.     bingji = old_states | @states
  599.     return if bingji.empty?
  600.     set_add_state_id(bingji & @states)
  601.     set_remove_state_id(bingji & old_states)
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # ● 设置增加的状态(新增定义)
  605.   #--------------------------------------------------------------------------
  606.   def set_add_state_id(zjdzt)
  607.     for i in zjdzt
  608.       if $data_states[i].animation_id > 0
  609.         if not @hzhj_add_state_id.include?(i)
  610.           @hzhj_add_state_id.push(i)
  611.         end
  612.       end
  613.     end
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # ● 设置解除的状态(新增定义)
  617.   #--------------------------------------------------------------------------
  618.   def set_remove_state_id(jsdzt)
  619.     for i in jsdzt
  620.       if $data_states[i].animation_id > 0
  621.         if not @hzhj_remove_state_id.include?(i)
  622.           ani_id = $data_states[i].animation_id
  623.           not_end_loop_animation = false
  624.           for state in self.states
  625.             if state.animation_id == ani_id
  626.               not_end_loop_animation = true
  627.               break
  628.             end
  629.           end
  630.           unless not_end_loop_animation
  631.             @hzhj_remove_state_id.push(i)
  632.           end
  633.         end
  634.       end
  635.     end
  636.   end
  637. end
  638. #==============================================================================
  639. # ■ Game_Battler
  640. #==============================================================================
  641. class Game_Battler < Game_BattlerBase
  642.   #--------------------------------------------------------------------------
  643.   # ● 附加新的状态(追加定义)
  644.   #--------------------------------------------------------------------------
  645.   alias hzhj_old_add_new_state_for_state_ani_game_battler add_new_state
  646.   def add_new_state(state_id)
  647.     old_states = @states.clone
  648.     hzhj_old_add_new_state_for_state_ani_game_battler(state_id)
  649.     bingji = old_states | @states
  650.     return if bingji.empty?
  651.     set_add_state_id(bingji & @states)
  652.     set_remove_state_id(bingji & old_states)
  653.   end
  654. end
  655. #==============================================================================
  656. # ■ Sprite_Base
  657. #==============================================================================
  658. class Sprite_Base < Sprite
  659.   #--------------------------------------------------------------------------
  660.   # ● 初始化(追加定义)
  661.   #--------------------------------------------------------------------------
  662.   alias hzhj_old_init_for_state_ani_spr_base initialize
  663.   def initialize(*args)
  664.     hzhj_old_init_for_state_ani_spr_base(*args)
  665.     @hzhj_loop_animations = []
  666.     @hzhj_loop_durations = {}
  667.     @hzhj_loop_sprites = {}
  668.     @hzhj_loop_bitmap1s = {}
  669.     @hzhj_loop_bitmap2s = {}
  670.     @hzhj_loop_ani_oxs = {}
  671.     @hzhj_loop_ani_oys = {}
  672.     @flash_nil_duration = 0
  673.   end
  674.   #--------------------------------------------------------------------------
  675.   # ● 释放(追加定义)
  676.   #--------------------------------------------------------------------------
  677.   alias hzhj_old_dispose_for_state_ani_spr_base dispose
  678.   def dispose
  679.     dispose_loop_animation
  680.     hzhj_old_dispose_for_state_ani_spr_base
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ● 设定动画的活动块(追加定义)
  684.   #--------------------------------------------------------------------------
  685.   alias hzhj_old_ani_set_spr_for_state_ani_spr_base animation_set_sprites
  686.   def animation_set_sprites(*args)
  687.     hzhj_old_ani_set_spr_for_state_ani_spr_base(*args)
  688.     @ani_sprites.each{|sprite|sprite.z += @animation.ani_z_correction}
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # ● 判断是否有循环动画(新增定义)
  692.   #--------------------------------------------------------------------------
  693.   def loop_animation?
  694.     return (not @hzhj_loop_animations.empty?)
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ● 开始播放循环动画(新增定义)
  698.   #--------------------------------------------------------------------------
  699.   def start_loop_animation(animation)
  700.     return if @hzhj_loop_animations.include?(animation)
  701.     if animation.nil?
  702.       dispose_loop_animation
  703.       return
  704.     end
  705.     set_animation_rate
  706.     @hzhj_loop_animations.push(animation)
  707.     init_loop_animation_duration(animation)
  708.     load_loop_animation_bitmap(animation)
  709.     make_loop_animation_sprites(animation)
  710.     set_loop_animation_origin(animation)
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # ● 初始化循环动画播放位置(新增定义)
  714.   #--------------------------------------------------------------------------
  715.   def init_loop_animation_duration(animation)
  716.     @hzhj_loop_durations[animation] = animation.frame_max * @ani_rate + 1
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ● 读取循环动画图像(新增定义)
  720.   #--------------------------------------------------------------------------
  721.   def load_loop_animation_bitmap(animation)
  722.     animation1_name = animation.animation1_name
  723.     animation1_hue = animation.animation1_hue
  724.     animation2_name = animation.animation2_name
  725.     animation2_hue = animation.animation2_hue
  726.     bitmap1 = Cache.animation(animation1_name, animation1_hue)
  727.     bitmap2 = Cache.animation(animation2_name, animation2_hue)
  728.     if @@_reference_count.include?(bitmap1)
  729.       @@_reference_count[bitmap1] += 1
  730.     else
  731.       @@_reference_count[bitmap1] = 1
  732.     end
  733.     if @@_reference_count.include?(bitmap2)
  734.       @@_reference_count[bitmap2] += 1
  735.     else
  736.       @@_reference_count[bitmap2] = 1
  737.     end
  738.     @hzhj_loop_bitmap1s[animation] = bitmap1
  739.     @hzhj_loop_bitmap2s[animation] = bitmap2
  740.     Graphics.frame_reset
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● 生成循环动画活动块(新增定义)
  744.   #--------------------------------------------------------------------------
  745.   def make_loop_animation_sprites(animation)
  746.     sprites = []
  747.     if @use_sprite
  748.       16.times do
  749.         sprite = ::Sprite.new(viewport)
  750.         sprite.visible = false
  751.         sprites.push(sprite)
  752.       end
  753.     end
  754.     @hzhj_loop_sprites[animation] = sprites
  755.   end
  756.   #--------------------------------------------------------------------------
  757.   # ● 设定循环动画的原点(新增定义)
  758.   #--------------------------------------------------------------------------
  759.   def set_loop_animation_origin(animation)
  760.     if animation.position == 3
  761.       if viewport == nil
  762.         ani_ox = Graphics.width / 2
  763.         ani_oy = Graphics.height / 2
  764.       else
  765.         ani_ox = viewport.rect.width / 2
  766.         ani_oy = viewport.rect.height / 2
  767.       end
  768.     else
  769.       ani_ox = x - ox + width / 2
  770.       ani_oy = y - oy + height / 2
  771.       if animation.position == 0
  772.         ani_oy -= height / 2
  773.       elsif animation.position == 2
  774.         ani_oy += height / 2
  775.       end
  776.     end
  777.     @hzhj_loop_ani_oxs[animation] = ani_ox
  778.     @hzhj_loop_ani_oys[animation] = ani_oy
  779.   end
  780.   #--------------------------------------------------------------------------
  781.   # ● 释放所有循环动画(新增定义)
  782.   #--------------------------------------------------------------------------
  783.   def dispose_loop_animation
  784.     return unless loop_animation?
  785.     for animation in @hzhj_loop_animations.clone
  786.       end_loop_animation(animation)
  787.     end
  788.     @hzhj_loop_durations.clear
  789.     @hzhj_loop_sprites.clear
  790.     @hzhj_loop_bitmap1s.clear
  791.     @hzhj_loop_bitmap2s.clear
  792.     @hzhj_loop_ani_oxs.clear
  793.     @hzhj_loop_ani_oys.clear
  794.     @hzhj_loop_animations.clear
  795.   end
  796.   #--------------------------------------------------------------------------
  797.   # ● 结束某个循环动画(新增定义)
  798.   #--------------------------------------------------------------------------
  799.   def end_loop_animation(animation)
  800.     return if not @hzhj_loop_animations.include?(animation)
  801.     bitmap1 = @hzhj_loop_bitmap1s[animation]
  802.     @@_reference_count[bitmap1] -= 1
  803.     if @@_reference_count[bitmap1] == 0
  804.       @@_reference_count.delete(bitmap1)
  805.       bitmap1.dispose
  806.     end
  807.     bitmap2 = @hzhj_loop_bitmap2s[animation]
  808.     @@_reference_count[bitmap2] -= 1
  809.     if @@_reference_count[bitmap2] == 0
  810.       @@_reference_count.delete(bitmap2)
  811.       bitmap2.dispose
  812.     end
  813.     sprites = @hzhj_loop_sprites[animation]
  814.     for sprite in sprites
  815.       sprite.dispose
  816.     end
  817.     @hzhj_loop_durations.delete(animation)
  818.     @hzhj_loop_sprites.delete(animation)
  819.     @hzhj_loop_bitmap1s.delete(animation)
  820.     @hzhj_loop_bitmap2s.delete(animation)
  821.     @hzhj_loop_ani_oxs.delete(animation)
  822.     @hzhj_loop_ani_oys.delete(animation)
  823.     @hzhj_loop_animations.delete(animation)
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● 刷新(追加定义)
  827.   #--------------------------------------------------------------------------
  828.   alias hzhj_old_update_for_state_ani_spr_base update
  829.   def update
  830.     hzhj_old_update_for_state_ani_spr_base
  831.     update_loop_animation
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 刷新循环动画(新增定义)
  835.   #--------------------------------------------------------------------------
  836.   def update_loop_animation
  837.     @flash_nil_duration -= 1 if @flash_nil_duration > 0
  838.     return unless loop_animation?
  839.     for animation in @hzhj_loop_animations
  840.       @hzhj_loop_durations[animation] -= 1
  841.       duration = @hzhj_loop_durations[animation]
  842.       if duration % @ani_rate == 0
  843.         if duration > 0
  844.           set_loop_animation_origin(animation)
  845.           frame_index = animation.frame_max
  846.           frame_index -= (duration + @ani_rate - 1) / @ani_rate
  847.           args = []
  848.           args[0] = @hzhj_loop_sprites[animation]
  849.           args[1] = @hzhj_loop_bitmap1s[animation]
  850.           args[2] = @hzhj_loop_bitmap2s[animation]
  851.           args[3] = @hzhj_loop_ani_oxs[animation]
  852.           args[4] = @hzhj_loop_ani_oys[animation]
  853.           args[5] = animation.loop_z_correction
  854.           args[6] = ((not flash_nil? or animation.to_screen?) and visible)
  855.           loop_animation_set_sprites(animation.frames[frame_index], args)
  856.           animation.timings.each do |timing|
  857.             loop_animation_process_timing(timing) if timing.frame == frame_index
  858.           end
  859.         else
  860.           init_loop_animation_duration(animation)
  861.           redo
  862.         end
  863.       end
  864.     end
  865.   end
  866.   #--------------------------------------------------------------------------
  867.   # ● 设定循环动画的活动块(新增定义)
  868.   #--------------------------------------------------------------------------
  869.   def loop_animation_set_sprites(frame, args)
  870.     sprites = args[0]
  871.     bitmap1 = args[1]
  872.     bitmap2 = args[2]
  873.     ani_ox = args[3]
  874.     ani_oy = args[4]
  875.     loop_z_correction = args[5]
  876.     state_visible = args[6]
  877.     cell_data = frame.cell_data
  878.     sprites.each_with_index do |sprite, i|
  879.       next unless sprite
  880.       pattern = cell_data[i, 0]
  881.       if !pattern || pattern < 0
  882.         sprite.visible = false
  883.         next
  884.       end
  885.       sprite.bitmap = pattern < 100 ? bitmap1 : bitmap2
  886.       sprite.visible = state_visible
  887.       sprite.src_rect.set(pattern % 5 * 192,
  888.         pattern % 100 / 5 * 192, 192, 192)
  889.       sprite.x = ani_ox + cell_data[i, 1]
  890.       sprite.y = ani_oy + cell_data[i, 2]
  891.       sprite.angle = cell_data[i, 4]
  892.       sprite.mirror = (cell_data[i, 5] == 1)
  893.       if loop_z_correction > 9999
  894.         sprite.z = loop_z_correction % 10000 + i
  895.       elsif loop_z_correction < -9999
  896.         sprite.z = loop_z_correction % -10000 + i
  897.       else
  898.         sprite.z = self.z + loop_z_correction + i
  899.       end
  900.       sprite.ox = 96
  901.       sprite.oy = 96
  902.       sprite.zoom_x = cell_data[i, 3] / 100.0
  903.       sprite.zoom_y = cell_data[i, 3] / 100.0
  904.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  905.       sprite.blend_type = cell_data[i, 7]
  906.     end
  907.   end
  908.   #--------------------------------------------------------------------------
  909.   # ● 循环动画SE 和闪烁时机的处理(新增定义)
  910.   #--------------------------------------------------------------------------
  911.   def loop_animation_process_timing(timing)
  912.     timing.se.play
  913.     case timing.flash_scope
  914.     when 1
  915.       self.flash(timing.flash_color, timing.flash_duration * @ani_rate)
  916.     when 2
  917.       if viewport
  918.         viewport.flash(timing.flash_color, timing.flash_duration * @ani_rate)
  919.       end
  920.     when 3
  921.       self.flash(nil, timing.flash_duration * @ani_rate)
  922.     end
  923.   end
  924.   #--------------------------------------------------------------------------
  925.   # ● 设置闪烁(追加定义)
  926.   #--------------------------------------------------------------------------
  927.   alias hzhj_old_flash_for_state_ani_spr_base flash
  928.   def flash(*args)
  929.     if args[0].nil?
  930.       @flash_nil_duration = args[1]
  931.     else
  932.       @flash_nil_duration = 0
  933.     end
  934.     hzhj_old_flash_for_state_ani_spr_base(*args)
  935.   end
  936.   #--------------------------------------------------------------------------
  937.   # ● 判断是否正处于【隐藏目标】(新增定义)
  938.   #--------------------------------------------------------------------------
  939.   def flash_nil?
  940.     return (@flash_nil_duration > 0)
  941.   end
  942. end
  943. #==============================================================================
  944. # ■ Sprite_Battler
  945. #==============================================================================
  946. class Sprite_Battler < Sprite_Base
  947.   #--------------------------------------------------------------------------
  948.   # ● 初始化(追加定义)
  949.   #--------------------------------------------------------------------------
  950.   alias hzhj_old_init_for_state_ani_spr_battler initialize
  951.   def initialize(*args)
  952.     hzhj_old_init_for_state_ani_spr_battler(*args)
  953.     init_battler_add_state_id
  954.   end
  955.   #--------------------------------------------------------------------------
  956.   # ● 初始化战斗者要播放状态动画的状态(新增定义)
  957.   #--------------------------------------------------------------------------
  958.   def init_battler_add_state_id
  959.     if @battler.nil?
  960.       dispose_loop_animation
  961.     else
  962.       @battler.hzhj_add_state_id.clear
  963.       @battler.hzhj_remove_state_id.clear
  964.       @battler.need_update_state_animation = true
  965.       for state in @battler.states
  966.         next if state.nil?
  967.         next if $data_animations[state.animation_id].nil?
  968.         @battler.hzhj_add_state_id.push(state.id)
  969.       end
  970.     end
  971.   end
  972.   #--------------------------------------------------------------------------
  973.   # ● 设置战斗者(追加定义)
  974.   #--------------------------------------------------------------------------
  975.   alias hzhj_old_battlerdy_for_state_ani_spr_battler battler=
  976.   def battler=(value)
  977.     old_battler = @battler
  978.     hzhj_old_battlerdy_for_state_ani_spr_battler(value)
  979.     if old_battler != @battler
  980.       init_battler_add_state_id
  981.     end
  982.   end
  983.   #--------------------------------------------------------------------------
  984.   # ● 刷新(追加定义)
  985.   #--------------------------------------------------------------------------
  986.   alias hzhj_old_update_for_state_ani_spr_battler update
  987.   def update
  988.     hzhj_old_update_for_state_ani_spr_battler
  989.     if @battler
  990.       if @battler.need_update_state_animation
  991.         @battler.need_update_state_animation = false
  992.         if not @battler.hzhj_add_state_id.empty?
  993.           for i in @battler.hzhj_add_state_id
  994.             if @battler.state?(i)
  995.               ani_id = $data_states[i].animation_id
  996.               animation = $data_animations[ani_id]
  997.               start_loop_animation(animation) if not animation.nil?
  998.             end
  999.           end
  1000.           @battler.hzhj_add_state_id.clear
  1001.         end
  1002.         if not @battler.hzhj_remove_state_id.empty?
  1003.           for i in @battler.hzhj_remove_state_id
  1004.             if not @battler.state?(i)
  1005.               ani_id = $data_states[i].animation_id
  1006.               animation = $data_animations[ani_id]
  1007.               end_loop_animation(animation) if not animation.nil?
  1008.             end
  1009.           end
  1010.           @battler.hzhj_remove_state_id.clear
  1011.         end
  1012.       end
  1013.     end
  1014.   end
  1015. end
  1016. #==============================================================================
  1017. # ■ Window_BattleLog
  1018. #==============================================================================
  1019. class Window_BattleLog < Window_Selectable
  1020.   #--------------------------------------------------------------------------
  1021.   # ● 显示状态附加/解除(追加定义)
  1022.   #--------------------------------------------------------------------------
  1023.   alias hzhj_old_display_status_for_state_ani_wnd_btlog display_changed_states
  1024.   def display_changed_states(target)
  1025.     target.need_update_state_animation = true
  1026.     hzhj_old_display_status_for_state_ani_wnd_btlog(target)
  1027.   end
  1028. end
  1029.  
  1030. #==============================================================================
  1031. # ■ Sprite_Damage (新增类)
  1032. #==============================================================================
  1033. class Sprite_Damage < Sprite
  1034.   include Hzhj::HorizontalBattleSystem
  1035.   #--------------------------------------------------------------------------
  1036.   # ● 获取/生成伤害值源图
  1037.   #--------------------------------------------------------------------------
  1038.   @@obmp = nil
  1039.   def self.obmp
  1040.     if @@obmp.nil? or @@obmp.disposed?
  1041.       @@obmp = Bitmap.new(180, 256)
  1042.       @@obmp.font.bold = true
  1043.       @@obmp.font.shadow = false
  1044.       @@obmp.font.outline = true
  1045.       @@obmp.font.out_color = Color.new(255, 255, 255, 255)
  1046.       @@obmp.font.size = 32
  1047.       colors = []
  1048.       colors.push(Color.new(255,   0,   0, 255))
  1049.       colors.push(Color.new(255, 128, 128, 255))
  1050.       colors.push(Color.new(  0,   0, 255, 255))
  1051.       colors.push(Color.new(128, 128, 255, 255))
  1052.       colors.push(Color.new(  0, 255,   0, 255))
  1053.       colors.push(Color.new(128, 255, 128, 255))
  1054.       colors.each_with_index do |color, hi|
  1055.         @@obmp.font.color = color
  1056.         for wi in 0..9
  1057.           @@obmp.draw_text(wi * 18, hi * 32, 18, 32, "#{wi}", 1)
  1058.         end
  1059.       end
  1060.       @@obmp.font.size = 20
  1061.       @@obmp.font.italic = true
  1062.       @@obmp.font.out_color = Color.new(0, 0, 0, 255)
  1063.       @@obmp.font.color = Color.new(255, 255, 255, 255)
  1064.       @@obmp.draw_text( 0, 192, 90, 32, "Critical", 1)
  1065.       @@obmp.draw_text(90, 192, 90, 32, "Miss", 1)
  1066.       @@obmp.draw_text( 0, 224, 90, 32, "Evasion", 1)
  1067.       @@obmp.hue_change(DamageBitmapHue)
  1068.     end
  1069.     return @@obmp
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # ● 初始化
  1073.   #--------------------------------------------------------------------------
  1074.   def initialize(viewport, args)
  1075.     super(viewport)
  1076.     @type = args[0]
  1077.     @value = args[1]
  1078.     @critical = args[2]
  1079.     self.x = args[4]
  1080.     self.y = args[5]
  1081.     self.z = args[6] + Graphics.height * 5
  1082.     make_move(args[3])
  1083.     refresh
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # ● 生成移动数据
  1087.   #--------------------------------------------------------------------------
  1088.   def make_move(battler_obj_class)
  1089.     @move = []
  1090.     case battler_obj_class
  1091.     when :actor
  1092.       make_move_actor
  1093.     when :enemy
  1094.       make_move_enemy
  1095.     else
  1096.       make_move_default
  1097.     end
  1098.   end
  1099.   #--------------------------------------------------------------------------
  1100.   # ● 生成移动数据 默认
  1101.   #--------------------------------------------------------------------------
  1102.   def make_move_default
  1103.     45.times do |n|
  1104.       if n % 3 == 0
  1105.         ady = n < 21 ? -6 : -1
  1106.         opa = n < 21 ? 255 : 255-(n-21)*6
  1107.         @move.push([0, ady, opa])
  1108.       else
  1109.         @move.push([0, 0, -1])
  1110.       end
  1111.     end
  1112.   end
  1113.   #--------------------------------------------------------------------------
  1114.   # ● 生成移动数据 角色
  1115.   #--------------------------------------------------------------------------
  1116.   def make_move_actor
  1117.     make_move_default
  1118.   end
  1119.   #--------------------------------------------------------------------------
  1120.   # ● 生成移动数据 敌人
  1121.   #--------------------------------------------------------------------------
  1122.   def make_move_enemy
  1123.     make_move_default
  1124.   end
  1125.   #--------------------------------------------------------------------------
  1126.   # ● 描绘
  1127.   #--------------------------------------------------------------------------
  1128.   def refresh
  1129.     if not self.bitmap.nil?
  1130.       self.bitmap.dispose
  1131.       self.bitmap = nil
  1132.     end
  1133.     begin
  1134.       @obmp = Cache.animation("damage", DamageBitmapHue)
  1135.     rescue Errno::ENOENT
  1136.       @obmp = Sprite_Damage.obmp
  1137.     end
  1138.     @numw = @obmp.width / 10
  1139.     @numh = @obmp.height / 8
  1140.     @strw = @obmp.width / 2
  1141.     case @value
  1142.     when Numeric
  1143.       blt_obmp_numeric
  1144.     when Symbol
  1145.       blt_obmp_text
  1146.     end
  1147.   end
  1148.   #--------------------------------------------------------------------------
  1149.   # ● 通过源图描绘数字
  1150.   #--------------------------------------------------------------------------
  1151.   def blt_obmp_numeric
  1152.     nums = @value.to_i.abs.to_s.split("")
  1153.     nbmpw = nums.size * @numw
  1154.     bmph = @numh
  1155.     cbmpw = 0
  1156.     crect = nil
  1157.     dy = 0
  1158.     if @critical
  1159.       cbmpw = @strw
  1160.       bmph *= 2
  1161.       crect = Rect.new(0, @numh * 6, @strw, @numh)
  1162.       dy = @numh
  1163.     end
  1164.     self.bitmap = Bitmap.new([nbmpw, cbmpw, 32].max, [bmph, 32].max)
  1165.     self.ox = bitmap.width / 2
  1166.     self.oy = bmph /2
  1167.     bitmap.blt((bitmap.width - cbmpw) / 2, 0, @obmp, crect) if crect
  1168.     dx = (bitmap.width - nbmpw) / 2
  1169.     ry = 0
  1170.     case @type
  1171.     when :hp
  1172.       ry = @value >= 0 ? 0 : @numh
  1173.     when :mp
  1174.       ry = @value >= 0 ? @numh * 2 : @numh * 3
  1175.     when :tp
  1176.       ry = @value >= 0 ? @numh * 4 : @numh * 5
  1177.     else
  1178.       return
  1179.     end
  1180.     rect = Rect.new(0, ry, @numw, @numh)
  1181.     nums.each_with_index do |str, i|
  1182.       rect.x = str.to_i * @numw
  1183.       bitmap.blt(dx, dy, @obmp, rect)
  1184.       dx += @numw
  1185.     end
  1186.   end
  1187.   #--------------------------------------------------------------------------
  1188.   # ● 通过源图描绘文字
  1189.   #--------------------------------------------------------------------------
  1190.   def blt_obmp_text
  1191.     self.bitmap = Bitmap.new([@strw, 32].max, [@numh, 32].max)
  1192.     self.ox = @strw / 2
  1193.     self.oy = @numh / 2
  1194.     rx = ry = 0
  1195.     case @type
  1196.     when :miss
  1197.       rx = @strw
  1198.       ry = @numh * 6
  1199.     when :eva
  1200.       ry = @numh * 7
  1201.     else
  1202.       return
  1203.     end
  1204.     rect = Rect.new(rx, ry, @strw, @numh)
  1205.     bitmap.blt(0, 0, @obmp, rect)
  1206.   end
  1207.   #--------------------------------------------------------------------------
  1208.   # ● 释放
  1209.   #--------------------------------------------------------------------------
  1210.   def dispose
  1211.     bitmap.dispose if bitmap
  1212.     super
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ● 移动中判定
  1216.   #--------------------------------------------------------------------------
  1217.   def moving?
  1218.     return (not @move.empty?)
  1219.   end
  1220.   #--------------------------------------------------------------------------
  1221.   # ● 刷新
  1222.   #--------------------------------------------------------------------------
  1223.   def update
  1224.     super
  1225.     if moving?
  1226.       ary = @move.shift
  1227.       self.x += ary[0]
  1228.       self.y += ary[1]
  1229.       self.opacity = ary[2] if ary[2] >= 0
  1230.     end
  1231.   end
  1232. end
  1233. #==============================================================================
  1234. # ■ Game_BattlerBase
  1235. #==============================================================================
  1236. class Game_BattlerBase
  1237.   #--------------------------------------------------------------------------
  1238.   # ● 实例变量(新增定义)
  1239.   #--------------------------------------------------------------------------
  1240.   attr_accessor :hzhj_damage
  1241.   #--------------------------------------------------------------------------
  1242.   # ● 初始化(追加定义)
  1243.   #--------------------------------------------------------------------------
  1244.   alias hzhj_old_init_for_display_damage_game_battler_base initialize
  1245.   def initialize
  1246.     @hzhj_damage = []
  1247.     hzhj_old_init_for_display_damage_game_battler_base
  1248.   end
  1249. end
  1250. #==============================================================================
  1251. # ■ Sprite_Base
  1252. #==============================================================================
  1253. class Sprite_Base < Sprite
  1254.   #--------------------------------------------------------------------------
  1255.   # ● 初始化(追加定义)
  1256.   #--------------------------------------------------------------------------
  1257.   alias hzhj_old_init_for_display_damage_spr_base initialize
  1258.   def initialize(*args)
  1259.     hzhj_old_init_for_display_damage_spr_base(*args)
  1260.     @hzhj_damage_sprites = []
  1261.   end
  1262.   #--------------------------------------------------------------------------
  1263.   # ● 释放(追加定义)
  1264.   #--------------------------------------------------------------------------
  1265.   alias hzhj_old_dispose_for_display_damage_spr_base dispose
  1266.   def dispose
  1267.     hzhj_old_dispose_for_display_damage_spr_base
  1268.     dispose_damage
  1269.   end
  1270.   #--------------------------------------------------------------------------
  1271.   # ● 判断是否有伤害在显示(新增定义)
  1272.   #--------------------------------------------------------------------------
  1273.   def damage?
  1274.     return (not @hzhj_damage_sprites.empty?)
  1275.   end
  1276.   #--------------------------------------------------------------------------
  1277.   # ● 开始显示伤害(新增定义)
  1278.   #--------------------------------------------------------------------------
  1279.   def start_damage(args)
  1280.     args[4] = x - ox + width / 2
  1281.     args[5] = y - oy + height / 2
  1282.     args[6] = z
  1283.     @hzhj_damage_sprites.push(Sprite_Damage.new(viewport, args))
  1284.   end
  1285.   #--------------------------------------------------------------------------
  1286.   # ● 释放所有伤害显示(新增定义)
  1287.   #--------------------------------------------------------------------------
  1288.   def dispose_damage
  1289.     return unless damage?
  1290.     @hzhj_damage_sprites.each{|sprite|sprite.dispose}
  1291.     @hzhj_damage_sprites.clear
  1292.   end
  1293.   #--------------------------------------------------------------------------
  1294.   # ● 刷新(追加定义)
  1295.   #--------------------------------------------------------------------------
  1296.   alias hzhj_old_update_for_display_damage_spr_base update
  1297.   def update
  1298.     hzhj_old_update_for_display_damage_spr_base
  1299.     update_damage
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # ● 刷新显示伤害(新增定义)
  1303.   #--------------------------------------------------------------------------
  1304.   def update_damage
  1305.     return unless damage?
  1306.     @hzhj_damage_sprites.each_with_index do |sprite, i|
  1307.       if sprite.moving?
  1308.         sprite.update
  1309.       else
  1310.         sprite.dispose
  1311.         @hzhj_damage_sprites[i] = nil
  1312.       end
  1313.     end
  1314.     @hzhj_damage_sprites.delete(nil)
  1315.   end
  1316. end
  1317. #==============================================================================
  1318. # ■ Sprite_Battler
  1319. #==============================================================================
  1320. class Sprite_Battler < Sprite_Base
  1321.   #--------------------------------------------------------------------------
  1322.   # ● 刷新(追加定义)
  1323.   #--------------------------------------------------------------------------
  1324.   alias hzhj_old_update_for_display_damage_spr_battler update
  1325.   def update
  1326.     hzhj_old_update_for_display_damage_spr_battler
  1327.     if @battler
  1328.       if not @battler.hzhj_damage.empty?
  1329.         unless @battler.damage_section_displayed
  1330.           args = @battler.hzhj_damage.clone
  1331.           args[3] = @battler.actor? ? :actor : (@battler.enemy? ? :enemy : nil)
  1332.           start_damage(args)
  1333.         end
  1334.         @battler.hzhj_damage.clear
  1335.       end
  1336.     end
  1337.   end
  1338. end
  1339. #==============================================================================
  1340. # ■ Window_BattleLog
  1341. #==============================================================================
  1342. class Window_BattleLog < Window_Selectable
  1343.   #--------------------------------------------------------------------------
  1344.   # ● 显示 MISS (追加定义)
  1345.   #--------------------------------------------------------------------------
  1346.   alias hzhj_old_display_miss_for_display_damage_wnd_btlog display_miss
  1347.   def display_miss(target, item)
  1348.     target.hzhj_damage = [:miss, :miss, false]
  1349.     hzhj_old_display_miss_for_display_damage_wnd_btlog(target, item)
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 显示回避 (追加定义)
  1353.   #--------------------------------------------------------------------------
  1354.   alias hzhj_old_display_evasion_for_display_damage_wnd_btlog display_evasion
  1355.   def display_evasion(target, item)
  1356.     target.hzhj_damage = [:eva, :evasion, false]
  1357.     hzhj_old_display_evasion_for_display_damage_wnd_btlog(target, item)
  1358.   end
  1359.   #--------------------------------------------------------------------------
  1360.   # ● 显示 HP 伤害 (追加定义)
  1361.   #--------------------------------------------------------------------------
  1362.   alias hzhj_old_display_hp_damage_for_display_damage_wnd_btlog display_hp_damage
  1363.   def display_hp_damage(target, item)
  1364.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  1365.     value = target.result.hp_damage
  1366.     critical = target.result.critical
  1367.     target.hzhj_damage = [:hp, value, critical]
  1368.     hzhj_old_display_hp_damage_for_display_damage_wnd_btlog(target, item)
  1369.   end
  1370.   #--------------------------------------------------------------------------
  1371.   # ● 显示 MP 伤害 (追加定义)
  1372.   #--------------------------------------------------------------------------
  1373.   alias hzhj_old_display_mp_damage_for_display_damage_wnd_btlog display_mp_damage
  1374.   def display_mp_damage(target, item)
  1375.     return if target.dead? || target.result.mp_damage == 0
  1376.     value = target.result.mp_damage
  1377.     critical = target.result.critical
  1378.     target.hzhj_damage = [:mp, value, critical]
  1379.     hzhj_old_display_mp_damage_for_display_damage_wnd_btlog(target, item)
  1380.   end
  1381.   #--------------------------------------------------------------------------
  1382.   # ● 显示 TP 伤害 (追加定义)
  1383.   #--------------------------------------------------------------------------
  1384.   alias hzhj_old_display_tp_damage_for_display_damage_wnd_btlog display_tp_damage
  1385.   def display_tp_damage(target, item)
  1386.     return if target.dead? || target.result.tp_damage == 0
  1387.     value = target.result.tp_damage
  1388.     critical = target.result.critical
  1389.     target.hzhj_damage = [:tp, value, critical]
  1390.     hzhj_old_display_tp_damage_for_display_damage_wnd_btlog(target, item)
  1391.   end
  1392. end
  1393.  
  1394. class RPG::Animation
  1395.   def need_move
  1396.     return @need_move unless @need_move.nil?
  1397.     if /@[Rr][Mm]/ =~ @name
  1398.       return (@need_move = true)
  1399.     else
  1400.       return (@need_move = false)
  1401.     end
  1402.   end
  1403.   def move_se
  1404.     return @move_se unless @move_se.nil?
  1405.     @move_se = RPG::SE.new
  1406.     if /@[Ss][Ee]\[(.+?)\]/ =~ @name
  1407.       @move_se.name = $1.clone
  1408.     end
  1409.     return @move_se
  1410.   end
  1411.   attr_writer :need_move
  1412.   attr_writer :move_se
  1413. end
  1414. #==============================================================================
  1415. # ■ Game_Battler
  1416. #==============================================================================
  1417. class Game_Battler < Game_BattlerBase
  1418.   include Hzhj::HorizontalBattleSystem
  1419.   #--------------------------------------------------------------------------
  1420.   # ● 属性
  1421.   #--------------------------------------------------------------------------
  1422.   attr_accessor :add_x                    # X 坐标变化量
  1423.   attr_accessor :add_y                    # Y 坐标变化量
  1424.   attr_accessor :move_speed_x             # 战斗图 X 移动速度
  1425.   attr_accessor :move_speed_y             # 战斗图 Y 移动速度
  1426.   #--------------------------------------------------------------------------
  1427.   # ● 初始化(追加定义)
  1428.   #--------------------------------------------------------------------------
  1429.   alias hzhj_old_init_for_real_move_game_battler initialize
  1430.   def initialize
  1431.     @add_x = 0
  1432.     @add_y = 0
  1433.     @move_speed_x = 0
  1434.     @move_speed_y = 0
  1435.     hzhj_old_init_for_real_move_game_battler
  1436.   end
  1437.   #--------------------------------------------------------------------------
  1438.   # ● 真实 X 坐标(新增定义)
  1439.   #--------------------------------------------------------------------------
  1440.   def real_screen_x
  1441.     return screen_x + add_x
  1442.   end
  1443.   #--------------------------------------------------------------------------
  1444.   # ● 真实 Y 坐标(新增定义)
  1445.   #--------------------------------------------------------------------------
  1446.   def real_screen_y
  1447.     return screen_y + add_y
  1448.   end
  1449.   #--------------------------------------------------------------------------
  1450.   # ● 返回自己的战斗位置(新增定义)
  1451.   #--------------------------------------------------------------------------
  1452.   def come_back_self_position(duration)
  1453.     return if dead?
  1454.     tx = screen_x
  1455.     ty = screen_y
  1456.     addx = tx - real_screen_x
  1457.     addy = ty - real_screen_y
  1458.     return if addx == 0 && addy == 0
  1459.     @add_x = 0
  1460.     @add_y = 0
  1461.     @move_speed_x = [(addx.abs / duration.to_f).ceil, 1].max
  1462.     @move_speed_y = [(addy.abs / duration.to_f).ceil, 1].max
  1463.   end
  1464.   #--------------------------------------------------------------------------
  1465.   # ● 设置移动信息(新增定义)
  1466.   #--------------------------------------------------------------------------
  1467.   def setup_move_info(target_battler, duration, move_se)
  1468.     return if dead?
  1469.     tbmp = Cache.battler(target_battler.battler_name, target_battler.battler_hue)
  1470.     sbmp = Cache.battler(@battler_name, @battler_hue)
  1471.     tbw = tbmp.width / DynamicPatternMax + RealMoveBmpAddW
  1472.     sbw = sbmp.width / DynamicPatternMax + RealMoveBmpAddW
  1473.     tbh = tbmp.height + RealMoveBmpAddH
  1474.     sbh = sbmp.height + RealMoveBmpAddH
  1475.     d = actor? ? ActorDirection : 10 - ActorDirection
  1476.     tx = target_battler.real_screen_x
  1477.     ty = target_battler.real_screen_y
  1478.     case d
  1479.     when 1
  1480.       tx = tx + tbw / 2 + sbw / 2
  1481.       ty = ty - sbh / 2
  1482.     when 2
  1483.       ty = ty - sbh / 2
  1484.     when 3
  1485.       tx = tx - tbw / 2 - sbw / 2
  1486.       ty = ty - sbh / 2
  1487.     when 4
  1488.       tx = tx + tbw / 2 + sbw / 2
  1489.     when 6
  1490.       tx = tx - tbw / 2 - sbw / 2
  1491.     when 7
  1492.       tx = tx + tbw / 2 + sbw / 2
  1493.       ty = ty + sbh / 2
  1494.     when 8
  1495.       ty = ty + sbh / 2
  1496.     when 9
  1497.       tx = tx - tbw / 2 - sbw / 2
  1498.       ty = ty + sbh / 2
  1499.     end
  1500.     addx = tx - real_screen_x
  1501.     addy = ty - real_screen_y
  1502.     return if addx == 0 && addy == 0
  1503.     @add_x = tx - screen_x if addx != 0
  1504.     @add_y = ty - screen_y if addy != 0
  1505.     @move_speed_x = [(addx.abs / duration.to_f).ceil, 1].max
  1506.     @move_speed_y = [(addy.abs / duration.to_f).ceil, 1].max
  1507.     move_se.play
  1508.   end
  1509. end
  1510. #==============================================================================
  1511. # ■ Sprite_Battler
  1512. #==============================================================================
  1513. class Sprite_Battler < Sprite_Base
  1514.   #--------------------------------------------------------------------------
  1515.   # ● 初始化(追加定义)
  1516.   #--------------------------------------------------------------------------
  1517.   alias hzhj_old_init_for_real_move_spr_battler initialize
  1518.   def initialize(viewport, battler = nil)
  1519.     hzhj_old_init_for_real_move_spr_battler(viewport, battler)
  1520.     init_position(@battler) if @battler
  1521.   end
  1522.   #--------------------------------------------------------------------------
  1523.   # ● 设置战斗者(追加定义)
  1524.   #--------------------------------------------------------------------------
  1525.   alias hzhj_old_set_battler_for_real_move_spr_battler battler=
  1526.   def battler=(value)
  1527.     if @battler != value && value
  1528.       init_position(value)
  1529.     end
  1530.     hzhj_old_set_battler_for_real_move_spr_battler(value)
  1531.   end
  1532.   #--------------------------------------------------------------------------
  1533.   # ● 初始化位置(新增定义)
  1534.   #--------------------------------------------------------------------------
  1535.   def init_position(battler)
  1536.     battler.add_x = 0
  1537.     battler.add_y = 0
  1538.     self.x = battler.real_screen_x
  1539.     self.y = battler.real_screen_y
  1540.     self.z = battler.screen_z
  1541.   end
  1542.   #--------------------------------------------------------------------------
  1543.   # ● 移动中判定(新增定义)
  1544.   #--------------------------------------------------------------------------
  1545.   def moving?
  1546.     return false unless @battler
  1547.     (x != @battler.real_screen_x or y != @battler.real_screen_y) && @battler
  1548.   end
  1549.   #--------------------------------------------------------------------------
  1550.   # ● 位置的更新(重定义)
  1551.   #--------------------------------------------------------------------------
  1552.   def update_position
  1553.     if !@battler.dead?
  1554.       if x < @battler.real_screen_x
  1555.         self.x = [x + @battler.move_speed_x, @battler.real_screen_x].min
  1556.       elsif x > @battler.real_screen_x
  1557.         self.x = [x - @battler.move_speed_x, @battler.real_screen_x].max
  1558.       end
  1559.       if y < @battler.real_screen_y
  1560.         self.y = [y + @battler.move_speed_y, @battler.real_screen_y].min
  1561.       elsif y > @battler.real_screen_y
  1562.         self.y = [y - @battler.move_speed_y, @battler.real_screen_y].max
  1563.       end
  1564.       self.z = y + 100
  1565.     end
  1566.   end
  1567. end
  1568. #==============================================================================
  1569. # ■ Spriteset_Battle
  1570. #==============================================================================
  1571. class Spriteset_Battle
  1572.   #--------------------------------------------------------------------------
  1573.   # ● 判定是否移动中(新增定义)
  1574.   #--------------------------------------------------------------------------
  1575.   def moving?
  1576.     battler_sprites.any? {|sprite| sprite.moving? }
  1577.   end
  1578. end
  1579. #==============================================================================
  1580. # ■ Scene_Battle
  1581. #==============================================================================
  1582. class Scene_Battle < Scene_Base
  1583.   #--------------------------------------------------------------------------
  1584.   # ● 等待战斗图移动的结束(新增定义)
  1585.   #--------------------------------------------------------------------------
  1586.   def wait_for_move
  1587.     update_for_wait
  1588.     update_for_wait while @spriteset.moving?
  1589.   end
  1590. end
  1591.  
  1592. class RPG::Troop
  1593.   include Hzhj::HorizontalBattleSystem
  1594.   def display_enemy_bar
  1595.     return @display_enemy_bar unless @display_enemy_bar.nil?
  1596.     if /@ebar/i =~ @name
  1597.       return (@display_enemy_bar = !DefaultDisplayEnemyBar)
  1598.     else
  1599.       return (@display_enemy_bar = DefaultDisplayEnemyBar)
  1600.     end
  1601.   end
  1602.   attr_writer :display_enemy_bar
  1603. end
  1604. #==============================================================================
  1605. # ■ Game_Troop
  1606. #==============================================================================
  1607. class Game_Troop < Game_Unit
  1608.   attr_accessor :display_enemy_bar      # 是否显示敌人HP条、MP条、TP条
  1609.   #--------------------------------------------------------------------------
  1610.   # ● 设置
  1611.   #--------------------------------------------------------------------------
  1612.   alias hzhj_old_setup_for_display_enemy_bar_game_troop setup
  1613.   def setup(troop_id)
  1614.     hzhj_old_setup_for_display_enemy_bar_game_troop(troop_id)
  1615.     @display_enemy_bar = troop.display_enemy_bar
  1616.   end
  1617. end
  1618. #==============================================================================
  1619. # ■ Window_BattleEnemy
  1620. #==============================================================================
  1621. class Window_BattleEnemy < Window_Selectable
  1622.   #--------------------------------------------------------------------------
  1623.   # ● 取得列数
  1624.   #--------------------------------------------------------------------------
  1625.   def col_max
  1626.     if $game_troop.display_enemy_bar
  1627.       return 1
  1628.     else
  1629.       return 2
  1630.     end
  1631.   end
  1632.   #--------------------------------------------------------------------------
  1633.   # ● 刷新
  1634.   #--------------------------------------------------------------------------
  1635.   def refresh
  1636.     create_contents
  1637.     super
  1638.   end
  1639.   #--------------------------------------------------------------------------
  1640.   # ● 描画项目
  1641.   #--------------------------------------------------------------------------
  1642.   def draw_item(index)
  1643.     if $game_troop.display_enemy_bar
  1644.       enemy = $game_troop.alive_members[index]
  1645.       draw_basic_area(basic_area_rect(index), enemy)
  1646.       draw_gauge_area(gauge_area_rect(index), enemy)
  1647.     else
  1648.       change_color(normal_color)
  1649.       name = $game_troop.alive_members[index].name
  1650.       draw_text(item_rect_for_text(index), name)
  1651.     end
  1652.   end
  1653.   #--------------------------------------------------------------------------
  1654.   # ● 取得基本区域的矩形
  1655.   #--------------------------------------------------------------------------
  1656.   def basic_area_rect(index)
  1657.     rect = item_rect_for_text(index)
  1658.     rect.width -= gauge_area_width + 10
  1659.     rect
  1660.   end
  1661.   #--------------------------------------------------------------------------
  1662.   # ● 取得值槽区域的矩形
  1663.   #--------------------------------------------------------------------------
  1664.   def gauge_area_rect(index)
  1665.     rect = item_rect_for_text(index)
  1666.     rect.x += rect.width - gauge_area_width
  1667.     rect.width = gauge_area_width
  1668.     rect
  1669.   end
  1670.   #--------------------------------------------------------------------------
  1671.   # ● 取得值槽区域的宽度
  1672.   #--------------------------------------------------------------------------
  1673.   def gauge_area_width
  1674.     return 220
  1675.   end
  1676.   #--------------------------------------------------------------------------
  1677.   # ● 描画基本区域
  1678.   #--------------------------------------------------------------------------
  1679.   def draw_basic_area(rect, actor)
  1680.     draw_actor_name(actor, rect.x + 0, rect.y, 100)
  1681.     draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
  1682.   end
  1683.   #--------------------------------------------------------------------------
  1684.   # ● 描画值槽区域
  1685.   #--------------------------------------------------------------------------
  1686.   def draw_gauge_area(rect, actor)
  1687.     if $data_system.opt_display_tp
  1688.       draw_gauge_area_with_tp(rect, actor)
  1689.     else
  1690.       draw_gauge_area_without_tp(rect, actor)
  1691.     end
  1692.   end
  1693.   #--------------------------------------------------------------------------
  1694.   # ● 描画值槽区域(包括 TP 值)
  1695.   #--------------------------------------------------------------------------
  1696.   def draw_gauge_area_with_tp(rect, actor)
  1697.     draw_actor_hp(actor, rect.x + 0, rect.y, 72)
  1698.     draw_actor_mp(actor, rect.x + 82, rect.y, 64)
  1699.     draw_actor_tp(actor, rect.x + 156, rect.y, 64)
  1700.   end
  1701.   #--------------------------------------------------------------------------
  1702.   # ● 描画值槽区域(不包括 TP 值)
  1703.   #--------------------------------------------------------------------------
  1704.   def draw_gauge_area_without_tp(rect, actor)
  1705.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  1706.     draw_actor_mp(actor, rect.x + 144,  rect.y, 76)
  1707.   end
  1708. end
  1709.  
  1710. #==============================================================================
  1711. # ■ Sprite_Battler
  1712. #==============================================================================
  1713. class Sprite_Battler < Sprite_Base
  1714.   include Hzhj::HorizontalBattleSystem
  1715.   #--------------------------------------------------------------------------
  1716.   # ● 初始化(追加定义)
  1717.   #--------------------------------------------------------------------------
  1718.   alias hzhj_old_init_for_dynamic_spr_battler initialize
  1719.   def initialize(viewport, battler = nil)
  1720.     hzhj_old_init_for_dynamic_spr_battler(viewport, battler)
  1721.     @dynamic_duration = 0
  1722.     @dynamic_duration_max = DynamicPatternMax * OnePatternDuration
  1723.   end
  1724.   #--------------------------------------------------------------------------
  1725.   # ● 源位图(Source Bitmap)的更新(重定义)
  1726.   #--------------------------------------------------------------------------
  1727.   def update_bitmap
  1728.     new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
  1729.     if bitmap != new_bitmap
  1730.       self.bitmap = new_bitmap
  1731.       init_visibility
  1732.       @dynamic_duration = 0
  1733.       @sx = 0
  1734.       @sw = bitmap.width / DynamicPatternMax
  1735.       @sh = bitmap.height
  1736.       self.ox = @sw / 2
  1737.       self.oy = @sh
  1738.       src_rect.set(@sx, 0, @sw, @sh)
  1739.     end
  1740.   end
  1741.   #--------------------------------------------------------------------------
  1742.   # ● 原点的更新(重定义)
  1743.   #--------------------------------------------------------------------------
  1744.   def update_origin
  1745.     if bitmap
  1746.       @dynamic_duration += 1
  1747.       @dynamic_duration %= @dynamic_duration_max
  1748.       @sx = @dynamic_duration / OnePatternDuration * @sw
  1749.       src_rect.set(@sx, 0, @sw, @sh)
  1750.     end
  1751.   end
  1752.   #--------------------------------------------------------------------------
  1753.   # ● 返回普通设定(追加定义)
  1754.   #--------------------------------------------------------------------------
  1755.   alias hzhj_old_revert_to_normal_for_dynamic_spr_battler revert_to_normal
  1756.   def revert_to_normal
  1757.     hzhj_old_revert_to_normal_for_dynamic_spr_battler
  1758.     self.ox = @sw / 2 if bitmap
  1759.   end
  1760.   #--------------------------------------------------------------------------
  1761.   # ● BOSS 战败(崩坏)效果的更新(追加定义)
  1762.   #--------------------------------------------------------------------------
  1763.   alias hzhj_old_update_boss_col_for_dynamic_spr_battler update_boss_collapse
  1764.   def update_boss_collapse
  1765.     hzhj_old_update_boss_col_for_dynamic_spr_battler
  1766.     self.ox = @sw / 2 + @effect_duration % 2 * 4 - 2
  1767.   end
  1768. end
  1769.  
  1770. #==============================================================================
  1771. # ■ Game_Battler
  1772. #==============================================================================
  1773. class Game_Battler < Game_BattlerBase
  1774.   def set_normal_battler_name
  1775.     @battler_name = @battler_name.split(/★/)[0]
  1776.   end
  1777.   def set_beaten_battler_name
  1778.     if guard?
  1779.       if (UseActorGuardGraphic && actor?) or
  1780.          (UseEnemyGuardGraphic && enemy?)
  1781.         set_guard_battler_name
  1782.         return
  1783.       end
  1784.     end
  1785.     @battler_name = @battler_name.split(/★/)[0] + "★1"
  1786.     if UseActorWBSE && actor?
  1787.       Audio.se_play("Audio/SE/AWBSE_#{id}", 100, 100)
  1788.     elsif UseEnemyWBSE && enemy?
  1789.       Audio.se_play("Audio/SE/EWBSE_#{enemy_id}", 100, 100)
  1790.     end
  1791.   end
  1792.   def set_dead_battler_name
  1793.     @battler_name = @battler_name.split(/★/)[0] + "★2"
  1794.   end
  1795.   def set_guard_battler_name
  1796.     @battler_name = @battler_name.split(/★/)[0] + "★3"
  1797.     if UseActorGDSE && actor?
  1798.       Audio.se_play("Audio/SE/AGDSE_#{id}", 100, 100)
  1799.     elsif UseEnemyGDSE && enemy?
  1800.       Audio.se_play("Audio/SE/EGDSE_#{enemy_id}", 100, 100)
  1801.     end
  1802.   end
  1803. end
  1804. #==============================================================================
  1805. # ■ Sprite_Battler
  1806. #==============================================================================
  1807. class Sprite_Battler < Sprite_Base
  1808.   #--------------------------------------------------------------------------
  1809.   # ● 初始化(追加定义)
  1810.   #--------------------------------------------------------------------------
  1811.   alias hzhj_old_init_for_dead_spr_battler initialize
  1812.   def initialize(viewport, battler = nil)
  1813.     hzhj_old_init_for_dead_spr_battler(viewport, battler)
  1814.     @dead_graphic_used = false
  1815.     if @battler
  1816.       @battler.set_normal_battler_name
  1817.       if @battler.dead?
  1818.         if (UseActorDeadGraphic && @battler.actor?) or
  1819.            (UseEnemyDeadGraphic && @battler.enemy?)
  1820.           @battler.set_dead_battler_name
  1821.           @dead_graphic_used = true
  1822.         end
  1823.       end
  1824.     end
  1825.     @beaten_duration = -1
  1826.   end
  1827.   #--------------------------------------------------------------------------
  1828.   # ● 设置战斗者(追加定义)
  1829.   #--------------------------------------------------------------------------
  1830.   alias hzhj_old_set_battler_for_dead_spr_battler battler=
  1831.   def battler=(value)
  1832.     if @battler != value
  1833.       @dead_graphic_used = false
  1834.       if value
  1835.         value.set_normal_battler_name
  1836.         if value.dead?
  1837.           if (UseActorDeadGraphic && value.actor?) or
  1838.              (UseEnemyDeadGraphic && value.enemy?)
  1839.             value.set_dead_battler_name
  1840.             @dead_graphic_used = true
  1841.           end
  1842.         end
  1843.       end
  1844.       @beaten_duration = -1
  1845.     end
  1846.     hzhj_old_set_battler_for_dead_spr_battler(value)
  1847.   end
  1848.   #--------------------------------------------------------------------------
  1849.   # ● 源位图(Source Bitmap)的更新(重定义)
  1850.   #--------------------------------------------------------------------------
  1851.   alias hzhj_old_update_bitmap_for_was_beaten_spr_battler update_bitmap
  1852.   def update_bitmap
  1853.     if @beaten_duration > 0
  1854.       @beaten_duration -= 1
  1855.     elsif @beaten_duration == 0
  1856.       @beaten_duration = -1
  1857.       set_bitmap(:normal)
  1858.     end
  1859.     hzhj_old_update_bitmap_for_was_beaten_spr_battler
  1860.   end
  1861.   #--------------------------------------------------------------------------
  1862.   # ● 初始化可视状态(追加定义)
  1863.   #--------------------------------------------------------------------------
  1864.   alias hzhj_old_visibility_for_dead_spr_battler init_visibility
  1865.   def init_visibility
  1866.     hzhj_old_visibility_for_dead_spr_battler
  1867.     if @battler.dead?
  1868.       if (UseActorDeadGraphic && @battler.actor?) or
  1869.          (UseEnemyDeadGraphic && @battler.enemy?)
  1870.         self.opacity = 255
  1871.       end
  1872.     end
  1873.   end
  1874.   #--------------------------------------------------------------------------
  1875.   # ● 效果开始(追加定义)
  1876.   #--------------------------------------------------------------------------
  1877.   alias hzhj_old_start_effect_for_dead_spr_battler start_effect
  1878.   def start_effect(effect_type)
  1879.     if effect_type == :appear
  1880.       if @dead_graphic_used
  1881.         set_bitmap(:normal)
  1882.         @effect_type = nil
  1883.         @effect_duration = 0
  1884.         @dead_graphic_used = false
  1885.         @battler_visible = true
  1886.         return
  1887.       end
  1888.     elsif effect_type == :collapse or
  1889.           effect_type == :boss_collapse or
  1890.           effect_type == :instant_collapse
  1891.       if @beaten_duration >= 0
  1892.         @beaten_duration = -1
  1893.         set_bitmap(:normal)
  1894.       end
  1895.       if (UseActorDeadGraphic && @battler.actor?) or
  1896.          (UseEnemyDeadGraphic && @battler.enemy?)
  1897.         set_bitmap(:dead)
  1898.         @effect_type = nil
  1899.         @effect_duration = 0
  1900.         @dead_graphic_used = true
  1901.         @battler_visible = false
  1902.         return
  1903.       end
  1904.     end
  1905.     hzhj_old_start_effect_for_dead_spr_battler(effect_type)
  1906.   end
  1907.   #--------------------------------------------------------------------------
  1908.   # ● 设置新的位图(新增定义)
  1909.   #--------------------------------------------------------------------------
  1910.   def set_bitmap(sym)
  1911.     case sym
  1912.     when :normal
  1913.       @battler.set_normal_battler_name
  1914.     when :was_beaten
  1915.       @battler.set_beaten_battler_name
  1916.     when :dead
  1917.       @battler.set_dead_battler_name
  1918.     else
  1919.       return
  1920.     end
  1921.     new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
  1922.     if bitmap != new_bitmap
  1923.       self.bitmap = new_bitmap
  1924.       @dynamic_duration = 0
  1925.       @sx = 0
  1926.       @sw = bitmap.width / DynamicPatternMax
  1927.       @sh = bitmap.height
  1928.       self.ox = @sw / 2
  1929.       self.oy = @sh
  1930.       src_rect.set(@sx, 0, @sw, @sh)
  1931.     end
  1932.     update_origin
  1933.     update_position
  1934.   end
  1935. end
  1936.  
  1937. #==============================================================================
  1938. # ■ Scene_Battle
  1939. #==============================================================================
  1940. class Scene_Battle < Scene_Base
  1941.   #--------------------------------------------------------------------------
  1942.   # ● 发动技能/物品(新增定义)
  1943.   #--------------------------------------------------------------------------
  1944.   def hzhj_invoke_item(target, item, damage_target)
  1945.     refresh_status
  1946.     @log_window.display_action_results(damage_target, item)
  1947.     @subject.damage_section_displayed = false
  1948.     @subject.last_target_index = target.index
  1949.     return if target.dead?
  1950.     if rand < target.item_cnt(@subject, item)
  1951.       hzhj_invoke_counter_attack(target, item)
  1952.     elsif rand < target.item_mrf(@subject, item)
  1953.       hzhj_invoke_magic_reflection(target, item)
  1954.     end
  1955.   end
  1956.   #--------------------------------------------------------------------------
  1957.   # ● 发动物理反击(新增定义)
  1958.   #--------------------------------------------------------------------------
  1959.   def hzhj_invoke_counter_attack(target, item)
  1960.     @log_window.display_counter(target, item)
  1961.     attack_skill = $data_skills[target.attack_skill_id]
  1962.     @subject.item_apply(target, attack_skill)
  1963.     need_move = false
  1964.     animation1 = $data_animations[target.animation1_id]
  1965.     need_move = animation1.need_move if animation1
  1966.     ary = [@subject]
  1967.     if need_move
  1968.       target.setup_move_info(@subject, RealMoveDuration, animation1.move_se)
  1969.       wait_for_move
  1970.     end
  1971.     @subject.damage_section_displayed = false
  1972.     @subject.not_damage_section = false
  1973.     show_subject_animation(target.animation1_id, target)
  1974.     show_normal_animation(ary, target.atk_animation_id1, false)
  1975.     show_normal_animation(ary, target.atk_animation_id2, true)
  1976.     @log_window.wait
  1977.     wait_for_animation
  1978.     if need_move && target.alive?
  1979.       target.come_back_self_position(RealMoveDuration)
  1980.       wait_for_move
  1981.     end
  1982.     refresh_status
  1983.     @log_window.display_action_results(@subject, attack_skill)
  1984.   end
  1985.   #--------------------------------------------------------------------------
  1986.   # ● 发动魔法反射(新增定义)
  1987.   #--------------------------------------------------------------------------
  1988.   def hzhj_invoke_magic_reflection(target, item)
  1989.     @subject.damage_section_displayed = false
  1990.     @subject.not_damage_section = false
  1991.     @log_window.display_reflection(target, item)
  1992.     @subject.item_apply(@subject, item)
  1993.     refresh_status
  1994.     @log_window.display_action_results(@subject, item)
  1995.   end
  1996. end
  1997.  
  1998. #==============================================================================
  1999. # ■ Game_Battler
  2000. #==============================================================================
  2001. class Game_Battler < Game_BattlerBase
  2002.   attr_accessor :damage_section_displayed
  2003.   attr_accessor :not_damage_section
  2004. end
  2005. #==============================================================================
  2006. # ■ Game_Actor
  2007. #==============================================================================
  2008. class Game_Actor < Game_Battler
  2009.   #--------------------------------------------------------------------------
  2010.   # ● 执行伤害效果
  2011.   #--------------------------------------------------------------------------
  2012.   alias hzhj_old_per_damage_for_damage_section_game_actor perform_damage_effect
  2013.   def perform_damage_effect
  2014.     unless damage_section_displayed
  2015.       hzhj_old_per_damage_for_damage_section_game_actor
  2016.     end
  2017.   end
  2018. end
  2019. #==============================================================================
  2020. # ■ Game_Enemy
  2021. #==============================================================================
  2022. class Game_Enemy < Game_Battler
  2023.   #--------------------------------------------------------------------------
  2024.   # ● 执行伤害效果
  2025.   #--------------------------------------------------------------------------
  2026.   alias hzhj_old_per_damage_for_damage_section_game_enemy perform_damage_effect
  2027.   def perform_damage_effect
  2028.     unless damage_section_displayed
  2029.       hzhj_old_per_damage_for_damage_section_game_enemy
  2030.     end
  2031.   end
  2032. end
  2033. #==============================================================================
  2034. # ■ Sprite_Battler
  2035. #==============================================================================
  2036. class Sprite_Battler < Sprite_Base
  2037.   #--------------------------------------------------------------------------
  2038.   # ● SE 和闪烁时机的处理
  2039.   #--------------------------------------------------------------------------
  2040.   def animation_process_timing(timing)
  2041.     if timing.se.name == DamageSectionDisplaySEName
  2042.       hp_value = @battler.result.hp_damage
  2043.       mp_value = @battler.result.mp_damage
  2044.       tp_value = @battler.result.tp_damage
  2045.       value = args = nil
  2046.       was_beaten = false
  2047.       if hp_value != 0 && !@battler.not_damage_section
  2048.         was_beaten = true if hp_value > 0
  2049.         value = hp_value * timing.flash_color.red.to_i / 100
  2050.         critical = @battler.result.critical
  2051.         args = [:hp, value, critical]
  2052.       elsif mp_value != 0 && !@battler.not_damage_section
  2053.         was_beaten = true if mp_value > 0
  2054.         value = mp_value * timing.flash_color.red.to_i / 100
  2055.         critical = @battler.result.critical
  2056.         args = [:mp, value, critical]
  2057.       elsif tp_value != 0 && !@battler.not_damage_section
  2058.         was_beaten = true if tp_value > 0
  2059.         value = tp_value * timing.flash_color.red.to_i / 100
  2060.         critical = @battler.result.critical
  2061.         args = [:tp, value, critical]
  2062.       end
  2063.       if value && args
  2064.         args[3] = @battler.actor? ? :actor : (@battler.enemy? ? :enemy : nil)
  2065.         @battler.damage_section_displayed = true
  2066.         start_damage(args)
  2067.         if UseBeatenGraphic && was_beaten
  2068.           set_bitmap(:was_beaten)
  2069.           @beaten_duration = BeatenGraphicDuration
  2070.         end
  2071.       end
  2072.       return
  2073.     end
  2074.     super(timing)
  2075.   end
  2076. end
  2077. #==============================================================================
  2078. # ■ Scene_Battle
  2079. #==============================================================================
  2080. class Scene_Battle < Scene_Base
  2081.   #--------------------------------------------------------------------------
  2082.   # ● 应用技能/物品效果(新增定义)
  2083.   #--------------------------------------------------------------------------
  2084.   def hzhj_apply_item_effects(target, item)
  2085.     target.damage_section_displayed = false
  2086.     target.not_damage_section = false
  2087.     target = apply_substitute(target, item)
  2088.     target.damage_section_displayed = false
  2089.     target.not_damage_section = false
  2090.     target.item_apply(@subject, item)
  2091.     return target
  2092.   end
  2093. end
  2094. #==============================================================================
  2095. # ■ 此脚本来自 [url]www.66rpg.com[/url]
  2096. #==============================================================================

QQ截图20160825161343.png (160.45 KB, 下载次数: 13)

如何去掉A1ID之类

如何去掉A1ID之类





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1