#============================================================ #针对第67号武器:定将军之剑写的吸血脚本 #============================================================ class Game_Battler < Game_BattlerBase def execute_damage(user) on_damage(@result.hp_damage) if @result.hp_damage > 0 #--------------------定将军吸血剑-------------------------- if user.weapons.include?($data_weapons[67]) @result.hp_drain = ([@result.hp_damage,self.hp].min * 0.15).to_i end #--------------------------------------------------------- self.hp -= @result.hp_damage self.mp -= @result.mp_damage user.hp += @result.hp_drain user.mp += @result.mp_drain end end
if user.weapons.include?($data_weapons[67])
@result.hp_drain = (@result.hp_damage * 0.15).to_i
#-------------------------------------------------------------------------- # ● ダメージ表示 #-------------------------------------------------------------------------- def set_damage return @action_end = true if !N03::DAMAGE_POP damage = @battler.result.hp_damage if @battler.result.hp_damage != 0 damage = @battler.result.hp_drain if @battler.result.hp_drain != 0 damage = @battler.result.mp_damage if @battler.result.mp_damage != 0 damage = @battler.result.mp_drain if @battler.result.mp_drain != 0 damage = @battler.result.tp_damage if @battler.result.tp_damage != 0 if !damage or damage == 0 @action_end = true if @st == nil return # ステートだけPOPする設定を考慮して@action_endは返さない end @hit = @battler.sv.hit @battler.sv.hit += 1 if damage > 0 file = N03::DAMAGE_PLUS if damage > 0 file = N03::DAMAGE_MINUS if damage < 0 add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0 add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0 adjust_x = N03::DAMAGE_ADJUST @num = [] @num_base = [] damage = damage.abs max_num = damage.to_s.size max_num += 1 if add_file != nil for i in 0...max_num @num[i] = Sprite.new if add_file != nil && i == max_num - 1 @num[i].bitmap = Cache.system(add_file) cw = (damage % (10 * 10 ** i))/(10 ** i) sw = 0 if sw == nil else @num[i].bitmap = Cache.system(file) cw = (damage % (10 * 10 ** i))/(10 ** i) sw = @num[i].bitmap.width / 10 @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height) end @num_base[i] = [] @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100) @num_base[i][1] = -(@num[i].bitmap.height / 3) - i * 2 - @hit * 2 + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100 @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1 @num[i].z = 1000 + i + @hit * 10 end @time = @pop_time = 80 end
#-------------------------------------------------------------------------- # ● ダメージ表示 #-------------------------------------------------------------------------- def set_damage return @action_end = true if !N03::DAMAGE_POP damage = @battler.result.hp_damage if @battler.result.hp_damage != 0 # damage = @battler.result.hp_drain if @battler.result.hp_drain != 0 damage = @battler.result.mp_damage if @battler.result.mp_damage != 0 damage = @battler.result.mp_drain if @battler.result.mp_drain != 0 damage = @battler.result.tp_damage if @battler.result.tp_damage != 0 if !damage or damage == 0 @action_end = true if @st == nil return # ステートだけPOPする設定を考慮して@action_endは返さない end @hit = @battler.sv.hit @battler.sv.hit += 1 if damage > 0 file = N03::DAMAGE_PLUS if damage > 0 file = N03::DAMAGE_MINUS if damage < 0 add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0 add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0 adjust_x = N03::DAMAGE_ADJUST @num = [] @num_base = [] damage = damage.abs max_num = damage.to_s.size max_num += 1 if add_file != nil for i in 0...max_num @num[i] = Sprite.new if add_file != nil && i == max_num - 1 @num[i].bitmap = Cache.system(add_file) cw = (damage % (10 * 10 ** i))/(10 ** i) sw = 0 if sw == nil else @num[i].bitmap = Cache.system(file) cw = (damage % (10 * 10 ** i))/(10 ** i) sw = @num[i].bitmap.width / 10 @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height) end @num_base[i] = [] @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100) @num_base[i][1] = -(@num[i].bitmap.height / 3) - i * 2 - @hit * 2 + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100 @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1 @num[i].z = 1000 + i + @hit * 10 end @time = @pop_time = 80 end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |