赞 | 22 |
VIP | 917 |
好人卡 | 110 |
积分 | 218 |
经验 | 288474 |
最后登录 | 2022-10-15 |
在线时间 | 6925 小时 |
Lv5.捕梦者 (版主)
- 梦石
- 20
- 星屑
- 1840
- 在线时间
- 6925 小时
- 注册时间
- 2012-12-14
- 帖子
- 11485
|
本帖最后由 美丽晨露 于 2012-12-29 17:25 编辑
有个脚本,不过要自己提供素材
否则会出错的- class Game_Actor < Game_Battler
- def now_exp
- return [url=home.php?mod=space&uid=13302]@exp[/url] - @exp_list[@level]
- end
- def next_exp
- return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
- end
- end
- class Sprite_Bar < Sprite
- def initialize(v,actor)
- super(v)
- self.bitmap = RPG::Cache.picture("人物#{actor.id}")
- self.visible = false
- [url=home.php?mod=space&uid=95897]@actor[/url] = actor
- refresh
- end
- def refresh
- self.bitmap.clear
- self.bitmap.dispose
- self.bitmap = nil
- bar = RPG::Cache.picture("人物#{@actor.id}")
- self.bitmap = bar.dup
- bitmap = RPG::Cache.picture("1")
- hp_w = @actor.hp * bitmap.width / @actor.maxhp
- rect = Rect.new(0, 0, hp_w,bitmap.height)
- self.bitmap.blt(48, 3, bitmap, rect)
-
- bitmap = RPG::Cache.picture("2")
- hp_w = @actor.sp * bitmap.width / @actor.maxsp
- rect = Rect.new(0, 0, hp_w,bitmap.height)
- self.bitmap.blt(48, 16, bitmap, rect)
-
- bitmap = RPG::Cache.picture("3")
- if @actor.next_exp == 0
- hp_w = @actor.now_exp
- else
- hp_w = @actor.now_exp * bitmap.width / @actor.next_exp
- end
- rect = Rect.new(0, 0, hp_w,bitmap.height)
- self.bitmap.blt(48, 29, bitmap, rect)
-
- # 3 16 29
-
- @hp = @actor.hp
- @sp = @actor.sp
- @exp = @actor.now_exp
- end
- def update
- super
- self.visible = $game_switches[2]
- return unless self.visible
- refresh if @hp != @actor.hp || @sp != @actor.sp || @exp != @actor.now_exp
- end
- end
- class Scene_Map
- alias new_main main unless method_defined?("new_main")
- alias new_update update unless method_defined?("new_update")
- def main
- @bar = []
- @vie = []
- for actor in $game_party.actors
- v = Viewport.new(640-((actor.index+1) * 129), 0, 129, 45)
- v.z += 1000
- @bar.push(Sprite_Bar.new(v, actor))
- @vie.push(v)
- end
- new_main
- @bar.each{|bar|bar.dispose}
- @vie.each{|vie|vie.dispose}
- end
- def update
- @bar.each{|bar|bar.update}
- new_update
- end
- end
复制代码 |
评分
-
查看全部评分
|