加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
经过测试,在无法照成伤害或只有部分队友miss则可以正常使用,但是如果所以成员全部miss仍然会报错
虽然这种情况概率不算高,但仍然不想就这样放着不管,请问该如何解决?
$xh ={} $xh[187] =[330,200] $xh[215] =[330,200] $xh[306] =[330,300] $xh[328] =[330,200] class Scene_Battle def update_phase4_step5 # 隐藏帮助窗口 @help_window.visible = false # 刷新状态窗口 @status_window.refresh # 显示伤害 for target in @target_battlers if target.damage != nil target.damage_pop = true end end # 条件分歧 开始 当角色使用吸收HP技能 if $xh.include?(@active_battler.current_action.skill_id) # 条件分歧 开始 当原始伤害不为nil和大于1 if target.damage != nil and target.damage > 1 # 播放动画 @active_battler.animation_id =$xh[@active_battler.current_action.skill_id][0] # 显示回血 @active_battler.damage = -(target.damage * $xh[@active_battler.current_action.skill_id][1] /100.0 ).truncate #额,好吧,弄成整数就行了. @active_battler.damage_pop = true # 恢复HP @active_battler.hp += (target.damage * $xh[@active_battler.current_action.skill_id][1] /100.0 ).truncate #额,好吧,弄成整数就行了. # 条件分歧 结束 end # 条件分歧 结束 end # 移至步骤 6 @phase4_step = 6 end end
$xh ={}
$xh[187] =[330,200]
$xh[215] =[330,200]
$xh[306] =[330,300]
$xh[328] =[330,200]
class Scene_Battle
def update_phase4_step5
# 隐藏帮助窗口
@help_window.visible = false
# 刷新状态窗口
@status_window.refresh
# 显示伤害
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
end
# 条件分歧 开始 当角色使用吸收HP技能
if $xh.include?(@active_battler.current_action.skill_id)
# 条件分歧 开始 当原始伤害不为nil和大于1
if target.damage != nil and target.damage > 1
# 播放动画
@active_battler.animation_id =$xh[@active_battler.current_action.skill_id][0]
# 显示回血
@active_battler.damage = -(target.damage * $xh[@active_battler.current_action.skill_id][1] /100.0 ).truncate #额,好吧,弄成整数就行了.
@active_battler.damage_pop = true
# 恢复HP
@active_battler.hp += (target.damage * $xh[@active_battler.current_action.skill_id][1] /100.0 ).truncate #额,好吧,弄成整数就行了.
# 条件分歧 结束
end
# 条件分歧 结束
end
# 移至步骤 6
@phase4_step = 6
end
end
|