查看: 2207|回复: 2

[已经解决] 求教如何使反击变为先受伤再攻击

[复制链接]
梦石
0
星屑
163
在线时间
73 小时
注册时间
2014-4-10
回帖
96
发表于 2015-7-2 08:10:32 | 显示全部楼层 |阅读模式

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

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

×
        如题,请教一下大大们如何让反击变成反击者先受伤的效果。比如a攻击b,b受到伤害后再反击a。

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-7-2 08:30:55 | 显示全部楼层
[pre lang="ruby"]
class Scene_Battle
  def invoke_item(target, item)
    if rand < target.item_cnt(@subject, item)
      apply_item_effects(target, item) # 加了这行(未测试)
      invoke_counter_attack(target, item)
    elsif rand < target.item_mrf(@subject, item)
      invoke_magic_reflection(target, item)
    else
      apply_item_effects(apply_substitute(target, item), item)
    end
    @subject.last_target_index = target.index
  end
end[/pre]

点评

灰常感谢,测试了一下挺好  发表于 2015-7-2 09:12

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
20 小时
注册时间
2013-2-14
回帖
2
发表于 2016-7-12 14:49:38 | 显示全部楼层
这个脚本确实好用 但是如何才能判定在角色死亡的时候不进行反击呢?
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部