查看: 2216|回复: 2

[已经解决] 用吸血的脚本,技能miss报错

[复制链接]
梦石
0
星屑
195
在线时间
0 小时
注册时间
2010-7-7
回帖
1
发表于 2010-7-7 20:21:37 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 759668102 于 2010-7-7 21:00 编辑

在论坛找到的一个技能吸血的脚本,不过当使用技能出现miss后程序会报错。请教下该如何修改。
$吸血技能id数组 = [105]


class Scene_Battle
  alias old_main main
  def main
    @drink_blood = 999
    old_main
  end
  alias msar make_skill_action_result
  def make_skill_action_result
    msar
    if $吸血技能id数组.include?(@skill.id)
      temp_hp = 0
      for target in @target_battlers
        temp_hp += target.damage
      end
      @active_battler.damage = -temp_hp
      @active_battler.hp += temp_hp
      @target_battlers.push(@active_battler)
      @drink_blood = @target_battlers.index(@active_battler)
    end
  end
  alias ups4 update_phase4_step4
  def update_phase4_step4
    ups4
    @target_battlers[@drink_blood].animation_id = 0 if @target_battlers[@drink_blood] != nil
    @target_battlers[@drink_blood].animation_hit = false if @target_battlers[@drink_blood] != nil
  end
end

宛若

梦石
0
星屑
1888
在线时间
529 小时
注册时间
2007-8-19
回帖
1466

极短24参与开拓者

发表于 2010-7-7 20:34:41 | 显示全部楼层
这不是咱那个脚本么……
  temp_hp += target.damage改为
  temp_hp += target.damage if target.damage.is_a?(Fixnum)

评分

参与人数 1星屑 +200 收起 理由
「旅」 + 200 认可答案

查看全部评分

[url=http://rpg.blue/thread-219730-1-1.html]http://unhero.sinaapp.com/wi.php[/url]
[color=Red]如你所见这是个死坑,没错这就是打我的脸用的[/color]
回复

使用道具 举报

梦石
0
星屑
195
在线时间
0 小时
注册时间
2010-7-7
回帖
1
 楼主| 发表于 2010-7-7 21:00:21 | 显示全部楼层
这不是咱那个脚本么……
  temp_hp += target.damage改为
  temp_hp += target.damage if target.damage.is ...
逸豫 发表于 2010-7-7 20:34


谢谢的说哦。呃。。。。看你那贴子写了可以使用的。。。。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部