赞 | 2 |
VIP | 143 |
好人卡 | 1 |
积分 | 1 |
经验 | 216792 |
最后登录 | 2019-10-10 |
在线时间 | 24 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 61
- 在线时间
- 24 小时
- 注册时间
- 2008-8-5
- 帖子
- 1924
|
第二段腳本應該在前吧,將里面的 item_effect 改為:def item_effect(item, user = nil)
self.critical = false
if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
((item.scope == 5 or item.scope == 6) and self.hp >= 1)
# 过程结束(effective = false)
return false
end
effective = false
effective |= item.common_event_id > 0
hit_result = (rand(100) < item.hit)
effective |= item.hit < 100
if hit_result == true
recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
if recover_hp < 0
recover_hp += self.pdef * item.pdef_f / 20
recover_hp += self.mdef * item.mdef_f / 20
recover_hp = [recover_hp, 0].min
end
recover_hp *= elements_correct(item.element_set)
recover_hp /= 100
recover_sp *= elements_correct(item.element_set)
recover_sp /= 100
if item.variance > 0 and recover_hp.abs > 0
amp = [recover_hp.abs * item.variance / 100, 1].max
recover_hp += rand(amp+1) + rand(amp+1) - amp
end
if item.variance > 0 and recover_sp.abs > 0
amp = [recover_sp.abs * item.variance / 100, 1].max
recover_sp += rand(amp+1) + rand(amp+1) - amp
end
if recover_hp < 0
# 10 号防具装备时投掷伤害变为 5 倍
if user.class == Game_Actor && (user.armor1_id == 10 ||
user.armor2_id == 10 || user.armor3_id == 10 ||
user.armor4_id == 10)
recover_hp *= 5
end
if self.guarding?
recover_hp /= 2
end
end
self.damage = -recover_hp
last_hp = self.hp
last_sp = self.sp
self.hp += recover_hp
self.sp += recover_sp
if recover_sp != 0
self.damage = -recover_sp
end
effective |= self.hp != last_hp
effective |= self.sp != last_sp
@state_changed = false
effective |= states_plus(item.plus_state_set)
effective |= states_minus(item.minus_state_set)
if item.parameter_type > 0 and item.parameter_points != 0
case item.parameter_type
when 1
@maxhp_plus += item.parameter_points
when 2
@maxsp_plus += item.parameter_points
when 3
@str_plus += item.parameter_points
when 4
@dex_plus += item.parameter_points
when 5
@agi_plus += item.parameter_points
when 6
@int_plus += item.parameter_points
end
effective = true
end
if item.recover_hp_rate == 0 and item.recover_hp == 0 and item.recover_sp_rate == 0 and item.recover_sp == 0
self.damage = ""
if item.recover_sp_rate == 0 and item.recover_sp == 0 and
(item.parameter_type == 0 or item.parameter_points == 0)
unless @state_changed
self.damage = "Miss"
end
end
end
else
self.damage = "Miss"
end
unless $game_temp.in_battle
self.damage = nil
end
# 血玲珑
if item.element_set.include?(hp_storage_id)
self.damage = nil
differ_hp = self.maxhp - self.hp
if $game_variables[STORAGE::HP_VAR] > differ_hp
$game_variables[STORAGE::HP_VAR] -= differ_hp
self.damage = -differ_hp if differ_hp !=0
self.hp = self.maxhp
else
self.damage = -$game_variables[STORAGE::HP_VAR] if $game_variables[STORAGE::HP_VAR] != 0
self.hp += $game_variables[STORAGE::HP_VAR]
$game_variables[STORAGE::HP_VAR] = 0
end
num = $game_party.item_number(item.id)
num_remain = [1 + $game_variables[STORAGE::HP_VAR] / STORAGE::HP_MAX, num].min
num_costed = num - num_remain
if $game_variables[STORAGE::HP_VAR] == 0
num_costed = num
end
$game_party.gain_storage(item.id, -num_costed)
effective |= differ_hp > 0
end
# 法玲珑
if item.element_set.include?(sp_storage_id)
self.damage = nil
differ_sp = self.maxsp - self.sp
if $game_variables[STORAGE::SP_VAR] > differ_sp
$game_variables[STORAGE::SP_VAR] -= differ_sp
self.damage = -differ_sp if differ_sp != 0
self.sp = self.maxsp
else
self.damage = -$game_variables[STORAGE::SP_VAR] if $game_variables[STORAGE::SP_VAR] != 0
self.sp += $game_variables[STORAGE::SP_VAR]
$game_variables[STORAGE::SP_VAR] = 0
end
num = $game_party.item_number(item.id)
num_remain = [1 + $game_variables[STORAGE::SP_VAR] / STORAGE::SP_MAX, num].min
num_costed = num - num_remain
if $game_variables[STORAGE::SP_VAR] == 0
num_costed = num
end
$game_party.gain_storage(item.id, -num_costed)
effective |= differ_sp > 0
end
# 过程结束
return effective
end
end
然后把第一段腳本的 item_effect 改為:def item_effect(item, user = nil)
if self.is_a?(Game_Actor) and self.name.include?("幻影")
self.damage = "False"
return
end
ac_item_effect(item, user)
end |
|