Project1
标题:
删一段脚本
[打印本页]
作者:
小和尚
时间:
2013-7-25 20:04
标题:
删一段脚本
module RPG
class Sprite < ::Sprite
def damage2(value)
dispose_damage
damage_string = value.to_s
if value.to_i > 0
damage_string = "+"+damage_string
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
#——字体修改
bitmap.font.size = 32
#——字体修改
#——边框颜色
bitmap.font.color.set(255, 255, 255)
#——边框颜色
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
#——颜色修改
bitmap.font.color.set(0, 185, 185)
#——颜色修改
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
@_damage_sprite2 = ::Sprite.new(self.viewport)
@_damage_sprite2.bitmap = bitmap
#——位置修改
@_damage_sprite2.ox = 80
@_damage_sprite2.oy = 80
@_damage_sprite2.x = self.x
@_damage_sprite2.y = self.y - self.oy / 2 + 15
#——位置修改
@_damage_sprite2.z = 3000
@_damage_duration2 = 40
end
def dispose_damage2
if @_damage_sprite2 != nil
@_damage_sprite2.bitmap.dispose
@_damage_sprite2.dispose
@_damage_sprite2 = nil
@_damage_duration2 = 0
end
end
alias lv24_update update
def update
lv24_update
if @_damage_duration2 > 0
@_damage_duration2 -= 1
case @_damage_duration2
when 38..39
@_damage_sprite2.y -= 4
when 36..37
@_damage_sprite2.y -= 2
when 34..35
@_damage_sprite2.y += 2
when 28..33
@_damage_sprite2.y += 4
end
@_damage_sprite2.opacity = 256 - (12 - @_damage_duration2) * 32
if @_damage_duration2 == 0
dispose_damage
end
end
end
alias lv23_initialize initialize
def initialize(viewport = nil)
lv23_initialize(viewport)
@_damage_duration2 = 0
end
alias lv23_dispose dispose
def dispose
lv23_dispose
dispose_damage2
end
end
end
class Scene_Battle
alias lv23_make_skill_action_result make_skill_action_result
def make_skill_action_result
lv23_make_skill_action_result
@active_battler.damage2 =
[email protected]
_cost
end
alias lv23_make_item_action_result make_item_action_result
def make_item_action_result
a = []
for i in $game_party.actors
a.push(i.sp)
end
for i in $game_troop.enemies
a.push(i.sp)
end
lv23_make_item_action_result
s = 0
for i in $game_party.actors
i.damage2 = i.sp - a[s]
s += 1
end
for i in $game_troop.enemies
i.damage2 = a[s] - i.sp
s += 1
end
end
end
class Game_Actor
attr_accessor :damage2
alias lv23_initialize initialize
def initialize(i)
lv23_initialize(i)
@damage2 = 0
end
end
class Game_Enemy
attr_accessor :damage2
alias lv23_initialize initialize
def initialize(i,i2)
lv23_initialize(i,i2)
@damage2 = 0
end
end
class Sprite_Battler
alias lv23_update update
def update
lv23_update
return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
if @battler.damage2 != 0
damage2(@battler.damage2)
@battler.damage2 = 0
end
end
end
复制代码
这是一个得失SP显示的脚本 我想删掉失去SP显示的部分 保留恢复SP时显示 帮个忙 谢谢
作者:
wwwcctvty
时间:
2013-7-25 20:24
试下在9行下添加:
else
return
作者:
小和尚
时间:
2013-7-25 20:31
wwwcctvty 发表于 2013-7-25 20:24
试下在9行下添加:
else
return
对哦 我怎么没想到= =~ 这个办法好~
对了 还有个小问题 就是这个脚本在恢复SP时是在动画之前恢复 怎么才能在动画之后恢复呢..
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1