Project1
标题:
升级图片跳出
[打印本页]
作者:
oОS+WEi
时间:
2010-9-12 00:35
标题:
升级图片跳出
RTAB_sixRice_016b.rar
(961.19 KB, 下载次数: 92)
2010-9-12 00:31 上传
点击文件名下载附件
这个范例的升级图片跳出后消失很好看
我想让我的范例也能有这个效果,只限定于升级有这个特效 然后我下面那个也设置了我需要的的图片,只是升级的时候是固定的,所以想请人帮忙改下效果
Project1.rar
(900.75 KB, 下载次数: 48)
2010-9-12 00:34 上传
点击文件名下载附件
作者:
逸豫
时间:
2010-9-12 21:11
https://dl.dropbox.com/u/322483/Project4.rar
喵的这脚本真难整合……
那个Level up之所以能够有弹跳效果是因为它是用damage做的……所以需要用到RTAB的damage方法
作者:
oОS+WEi
时间:
2010-9-14 13:54
谢谢你帮忙整合了个脚本,效果不错,但是好像和其他脚本并用就有点怪怪的
Project4.rar
(473.96 KB, 下载次数: 46)
2010-9-14 13:54 上传
点击文件名下载附件
你试试看让1P使出秒杀技能,要是没加那2个脚本,原本是用完怪死后再出现技能遗忘窗口的
现在变成了,技能窗口先弹出怪才死,所以还有我另一个脚本是升级提示的也是怪没死就先显示了,因为有一些问题还没来得及加进去给你看
所以想请你帮忙看下,怎么改
作者:
逸豫
时间:
2010-9-15 22:52
module RPG
class Sprite < ::Sprite
alias i initialize
def initialize(*arg)
i(*arg)
@_damage = []
@coll_time = 0
end
WIDTH = 18 # 文字幅
HEIGHT = 20 # クリティカルの文字・高さ
def dispose_damage
for damage in @_damage.reverse
damage[0].bitmap.dispose
damage[0].dispose
@_damage.delete(damage)
end
end
def collapse
@coll.dispose if @coll != nil
@coll = Sprite.new
@coll.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
@coll.ox = self.ox
@coll.oy = self.oy
@coll.opacity = 100
@coll.z = 0
@coll.blend_type = 1
@coll.x = self.x
@coll.y = self.y
@coll_time = 42
@_whiten_duration = 0
@_appear_duration = 0
@_escape_duration = 0
end
alias u update
def update
u
#if @_whiten_duration > 0
# @_whiten_duration -= 1
# self.color.alpha = 128 - (16 - @_whiten_duration) * 10
#end
#if @_appear_duration > 0
# @_appear_duration -= 1
# self.opacity = (16 - @_appear_duration) * 16
#end
#if @_escape_duration > 0
# @_escape_duration -= 1
# self.opacity = 256 - (32 - @_escape_duration) * 10
#end
#if @_collapse_duration > 0
# @_collapse_duration -= 1
# self.opacity = 256 - (48 - @_collapse_duration) * 6
#end
for damage in @_damage
if damage[1] > 0
damage[1] -= 1
damage[4] -= 3
damage[2] -= damage[4]
if self.battler.is_a?(Game_Actor)
damage[0].x = self.x + (40 - damage[1]) * damage[3] / 10
damage[0].y = self.y - self.oy / 2 + damage[2] / 10
else
damage[0].x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2 +
(40 - damage[1]) * damage[3] / 10
damage[0].y = self.y - self.oy * self.zoom_y / 2 +
self.viewport.rect.y + damage[2] / 10
damage[0].zoom_x = self.zoom_x
damage[0].zoom_y = self.zoom_y
end
damage[0].z = 2960 + damage[1]
damage[0].opacity = 256 - (12 - damage[1]) * 32
if damage[1] == 0
damage[0].bitmap.dispose
damage[0].dispose
@_damage.delete(damage)
end
end
end
if @_whiten_duration > 0
@_whiten_duration -= 1
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
end
if @_appear_duration > 0
@_appear_duration -= 1
self.opacity = (16 - @_appear_duration) * 16
end
if @_escape_duration > 0
@_escape_duration -= 1
self.opacity = 256 - (32 - @_escape_duration) * 10
end
if @coll_time > 0
@coll_time -= 1
@coll.y = self.y - (48 - @coll_time) * 6
self.opacity = 256 - (48 - @coll_time) * 6
if @coll_time == 0
@coll.dispose
end
end
#for anime in @_animation
# if (Graphics.frame_count % 2 == 0)
# anime[2] -= 1
# update_animation(anime)
# end
#end
#if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
# update_loop_animation
# @_loop_animation_index += 1
# @_loop_animation_index %= @_loop_animation.frame_max
#end
#if @_blink
## if @_blink_count < 16
# alpha = (16 - @_blink_count) * 6
# else
# alpha = (@_blink_count - 16) * 6
# end
# self.color.set(255, 255, 255, alpha)
#end
#@@_animations.clear
end
def effect?
@_whiten_duration > 0 or
@_appear_duration > 0 or
@_escape_duration > 0 or
@_collapse_duration > 0 or
@_damage_duration > 0 or
@_animation_duration > 0 or
@coll_time > 0
end
def damage(value, critical, type = 0)
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
if value.is_a?(Numeric) and value >= 0
if type == 0
if critical
d_bitmap = draw_damage(value, 1)
else
d_bitmap = draw_damage(value, 0)
end
else
d_bitmap = draw_damage(value, 2)
end
else
if type == 0
d_bitmap = draw_damage(value, 3)
else
d_bitmap = draw_damage(value, 4)
end
end
if type == 2
d_bitmap = draw_damage(value, 5)
end
num = @_damage.size
if type != 2
@_damage.push([::Sprite.new, 40, 0, rand(40) - 20, rand(30) + 50])
else
@_damage.push([::Sprite.new, 40, 0, rand(20) - 10, rand(20) + 60])
end
@_damage[num][0].bitmap = d_bitmap
@_damage[num][0].ox = d_bitmap.width / 2
@_damage[num][0].oy = d_bitmap.height / 2
if self.battler.is_a?(Game_Actor)
@_damage[num][0].x = self.x + self.viewport.ox
@_damage[num][0].y = self.y - self.oy / 2
else
@_damage[num][0].x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
@_damage[num][0].y = self.y - self.oy * self.zoom_y / 2 +
self.viewport.rect.y
@_damage[num][0].zoom_x = self.zoom_x
@_damage[num][0].zoom_y = self.zoom_y
@_damage[num][0].z = 3000
end
end
def draw_damage(value, element)
width = 0
if value.is_a?(Numeric)
value = value.abs
fig = value.to_s.size - 1
file = RPG::Cache.numeric("num")
d_width = WIDTH * fig + file.rect.width / 10
if element == 1
critical = RPG::Cache.numeric("critical")
d_width = [d_width, critical.rect.width].max
d_bitmap = Bitmap.new(d_width+36, HEIGHT + file.rect.height / 5)
d_x = 0#(width - critical.rect.width / 10) / 2
d_bitmap.blt(d_x+fig*(fig/1.6), 0, critical, critical.rect)
Audio.se_play("Audio/SE/"+"Clip10",100,100)
# $game_screen.start_flash(Color.new(255,255,255),2)
$game_screen.start_shake(3,9,2)
else
d_bitmap = Bitmap.new(d_width, HEIGHT + file.rect.height / 5)
end
d_x = ((d_width) - (WIDTH * fig + file.rect.width / 10)) / 2
while fig >= 0
d_bitmap.blt(d_x, HEIGHT, file, Rect.new((value / (10 ** fig)) *
file.rect.width / 10, element * file.rect.height / 5,
file.rect.width / 10, file.rect.height / 5))
d_x += WIDTH
value %= 10 ** fig
fig -= 1
end
else
case value
when "Miss"
file = RPG::Cache.numeric("miss")
when "Level up!"
file = RPG::Cache.numeric("levelup")
when "New Skill!"
file = RPG::Cache.numeric("newskill")
when "Learning!"
file = RPG::Cache.numeric("learning")
else
return Bitmap.new(1, 1)
end
d_bitmap = file
end
return d_bitmap
end
end
module Cache
def self.numeric(filename)
self.load_bitmap("Graphics/String/", filename)
end
end
end
复制代码
用此脚本覆盖Damage重定义
然后删除死亡特效脚本
作者:
OWOWOW
时间:
2010-9-16 18:15
LZ可以参看我之前做的一个东东~
http://rpg.blue/forum.php?mod=vi ... 47279&from=home
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1