赞 | 0 |
VIP | 4 |
好人卡 | 43 |
积分 | 94 |
经验 | 75226 |
最后登录 | 2019-3-3 |
在线时间 | 1131 小时 |
Lv4.逐梦者
- 梦石
- 3
- 星屑
- 6420
- 在线时间
- 1131 小时
- 注册时间
- 2007-12-26
- 帖子
- 2402
|
8楼
楼主 |
发表于 2008-6-17 04:22:59
|
只看该作者
不改的话没问题啊,这是我改了之后的脚本,或者哪里改错了??
class Sprite_Pet < RPG::Sprite
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :battler # 战斗者
#--------------------------------------------------------------------------
# ● 初始化对像
# viewport : 显示端口;battler : 战斗者 (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, father_id = 0)
super(viewport)
@father_id = 0
if $game_party.actors[father_id] != nil
if $game_party.actors[father_id].pet_id != 0
@battler = Game_Pet.new($game_party.actors[father_id].pet_id)
@father_id = $game_party.actors[father_id].id
else
@battler = nil
end
end
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 战斗者为 nil 的情况下
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
if self.battler != nil
self.bitmap = RPG::Cache.battler(@battler.battler_name, @battler.battler_hue)
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
if $game_party.actors[@father_id].pet_id == 0
self.battler = nil
collapse
end
end
# 设置活动块的坐标
self.x = $game_party.actors.index($game_party.actors[@father_id]) * 160 + 85
self.y = 400
self.z = 5
self.zoom_x = 0.6
self.zoom_y = 0.6
end
end
|
|