赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1405 |
最后登录 | 2013-5-30 |
在线时间 | 57 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 57 小时
- 注册时间
- 2007-9-4
- 帖子
- 72
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
这个是会心一击的被动技能脚本:
會心一擊率上昇40%:
class Game_Battler
def skill?(skill_id)
@skills||=[]
return @skills.include?(skill_id)
end
end
class Game_Battler
#--------------------------------------------------------------------------
# ● 应用通常攻击效果
# attacker : 攻击者 (battler)
#--------------------------------------------------------------------------
def attack_effect(attacker)
# 清除会心一击标志
self.critical = false
# 第一命中判定
hit_result = (rand(100) < attacker.hit)
# 命中的情况下
if hit_result == true
# 计算基本伤害
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# 属性修正
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# 伤害符号正确的情况下
if self.damage > 0
#=-----------------------------------------------------------------
# 会心一击修正
hit_rate = 4 * attacker.dex / self.agi
if attacker.is_a?(Game_Actor)
if self.skill?(57)
if rand(100 + hit_rate) < (hit_rate + 40)
self.damage[attacker] *= 2
self.critical[attacker] = true
end
end
else
if rand(100) < hit_rate
self.damage[attacker] *= 2
self.critical[attacker] = true
end
#=-----------------------------------------------------------------
# 防御修正
if self.guarding?
self.damage /= 2
end
end
# 分散
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 第二命中判定
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# 命中的情况下
if hit_result == true
# 状态冲击解除
remove_states_shock
# HP 的伤害计算
self.hp -= self.damage
# 状态变化
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# Miss 的情况下
else
# 伤害设置为 "Miss"
self.damage = "Miss"
# 清除会心一击标志
self.critical = false
end
# 过程结束
return true
end
end
但是使用了以后会出现:syntax error 本人脚本盲,不知道错在哪儿,望高手相助! 版务信息:本贴由楼主自主结贴~ |
|