赞 | 0 |
VIP | 136 |
好人卡 | 4 |
积分 | 1 |
经验 | 2058 |
最后登录 | 2013-1-17 |
在线时间 | 142 小时 |
Lv1.梦旅人 辉瑞中国首席研究员<
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 142 小时
- 注册时间
- 2008-1-18
- 帖子
- 2129
|
这样改即可,已成功
class Sprite_Pet < RPG::Sprite
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :battler # 战斗者
#--------------------------------------------------------------------------
# ● 初始化对像
# viewport : 显示端口;battler : 战斗者 (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, father_id = 0)
super(viewport)
@father_id = father_id
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].maseter_id_position = father_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[@father_id].maseter_id_position * 160 + 85
self.y = 400
self.z = 5
self.zoom_x = 0.6
self.zoom_y = 0.6
end
end 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|