=begin #============================================================================== ** 效果: 吸血武器 ------------------------------------------------------------------------------ 为状态添加"吸血武器" 的效果. 当被该状态附加的对象使用攻击或技能命中目标时,吸取目标一定的hp,数值会有点浮动. 使用状态备注 <eff: vampiric_weapon x> 其中 x 代表伤害的百分之多少会被吸收,是一个浮点数 例如: 0.5 代表你会吸收伤害的 50% ,回复自身该数值的hp. #============================================================================== =end $imported = {} if $imported.nil? $imported["Effect_VampiricWeapon"] = true #============================================================================== # ** Rest of the script #============================================================================== module Effect module Vampiric_Weapon Effect_Manager.register_effect(:vampiric_weapon) end end class Game_Battler < Game_BattlerBase def effect_vampiric_weapon(user, obj, effect) return if user == self amount = [@result.hp_damage, @result.old_hp].min amount = (amount * (eval(effect.value1[0]) rescue 1)).to_i return if amount <= 0 user.hp = [user.hp + amount, user.mhp].min self.hp = [self.hp - amount, 0].max @result.effect_results.push("%s 吸取了 %d HP from %s" %[user.name, amount, self.name]) @result.success = true end alias :actor_effect_vampiric_weapon_attack :effect_vampiric_weapon alias :weapon_effect_vampiric_weapon_attack :effect_vampiric_weapon alias :state_effect_vampiric_weapon_attack :effect_vampiric_weapon alias :actor_effect_vampiric_weapon_crit_attack :effect_vampiric_weapon alias :weapon_effect_vampiric_weapon_crit_attack :effect_vampiric_weapon alias :state_effect_vampiric_weapon_crit_attack :effect_vampiric_weapon end
=begin
#==============================================================================
** 效果: 吸血武器
------------------------------------------------------------------------------
为状态添加"吸血武器" 的效果.
当被该状态附加的对象使用攻击或技能命中目标时,吸取目标一定的hp,数值会有点浮动.
使用状态备注
<eff: vampiric_weapon x>
其中 x 代表伤害的百分之多少会被吸收,是一个浮点数
例如: 0.5 代表你会吸收伤害的 50% ,回复自身该数值的hp.
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Effect_VampiricWeapon"] = true
#==============================================================================
# ** Rest of the script
#==============================================================================
module Effect
module Vampiric_Weapon
Effect_Manager.register_effect(:vampiric_weapon)
end
end
class Game_Battler < Game_BattlerBase
def effect_vampiric_weapon(user, obj, effect)
return if user == self
amount = [@result.hp_damage, @result.old_hp].min
amount = (amount * (eval(effect.value1[0]) rescue 1)).to_i
return if amount <= 0
user.hp = [user.hp + amount, user.mhp].min
self.hp = [self.hp - amount, 0].max
@result.effect_results.push("%s 吸取了 %d HP from %s" %[user.name, amount, self.name])
@result.success = true
end
alias :actor_effect_vampiric_weapon_attack :effect_vampiric_weapon
alias :weapon_effect_vampiric_weapon_attack :effect_vampiric_weapon
alias :state_effect_vampiric_weapon_attack :effect_vampiric_weapon
alias :actor_effect_vampiric_weapon_crit_attack :effect_vampiric_weapon
alias :weapon_effect_vampiric_weapon_crit_attack :effect_vampiric_weapon
alias :state_effect_vampiric_weapon_crit_attack :effect_vampiric_weapon
end
|