赞 | 19 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 7757 |
最后登录 | 2017-9-25 |
在线时间 | 68 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 68 小时
- 注册时间
- 2011-11-12
- 帖子
- 92
|
2楼
楼主 |
发表于 2017-4-30 17:01:30
|
只看该作者
#--------------------------------------------------------------------------
# ● 伤害表示
#--------------------------------------------------------------------------
def hit_count
for i in [email protected]
if @battler.sv.hit == nil
@hit = i
return @battler.sv.hit = @hit
end
end
@hit = @battler.sv.hit.size
@battler.sv.hit.push(@hit)
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_count
#@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 = Sprite.new
if add_file != nil && i == max_num - 1
@num.bitmap = Cache.system(add_file)
cw = (damage % (10 * 10 ** i))/(10 ** i)
sw = 0 if sw == nil
else
@num.bitmap = Cache.system(file)
cw = (damage % (10 * 10 ** i))/(10 ** i)
sw = @num.bitmap.width / 10
@num.src_rect.set(cw * sw, 0, sw, @num.bitmap.height)
end
@num_base = []
@num_base[0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100)
@num_base[1] = -(@num.bitmap.height / 3) - i * 2 - @hit * 2 + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
@num_base[0] -= @num.bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1
@num.z = 1000 + i + @hit * 10
end
@Time = @pop_time = 80
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
return if @time == 0
for i in [email protected] do update_state_move(@st, i) end if @st != nil
for i in [email protected] do update_num_move(@num, i) end if @num != nil
@time -= 1
@action_end = true if @time == 0
end
#--------------------------------------------------------------------------
# ● ステート画像の更新
#--------------------------------------------------------------------------
def update_state_move(state, index)
min = @pop_time - index * 2
case @time
when min-15..min
@st_base[index][0] += @direction
state.opacity += 25
when min-80..min-50
@st_base[index][0] += @direction
state.opacity -= 25
end
state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom
state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom
end
#--------------------------------------------------------------------------
# ● 数値の更新
#--------------------------------------------------------------------------
def update_num_move(num, index)
min = @pop_time - index * 2
case @time
when min-1..min
@num_base[index][0] += @direction * @hit
@num_base[index][1] -= 5 + @hit * 2
when min-3..min-2
@num_base[index][0] += @direction * @hit
@num_base[index][1] -= 4 + @hit * 2
when min-6..min-4
@num_base[index][0] += @direction
@num_base[index][1] -= 3 + @hit * 2
when min-14..min-7
@num_base[index][0] += @direction
@num_base[index][1] += 2
when min-17..min-15
@num_base[index][1] -= 2 + @hit * 2
when min-23..min-18
@num_base[index][1] += 1
when min-27..min-24
@num_base[index][1] -= 1
when min-30..min-28
@num_base[index][1] += 1
when min-33..min-31
@num_base[index][1] -= 1
when min-36..min-34
@num_base[index][1] += 1
end
num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom
num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom
num.opacity = 256 - (12 - @time) * 32
num.visible = false if @time == 0
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
@battler.sv.hit[@hit] = nil if @hit
bitmap.dispose if bitmap
for i in [email protected] do @num.dispose end if @num != nil
for i in [email protected] do @st.dispose end if @st != nil
super
end
end |
|