赞 | 0 |
VIP | 5 |
好人卡 | 14 |
积分 | 15 |
经验 | 110639 |
最后登录 | 2015-10-15 |
在线时间 | 1157 小时 |
Lv3.寻梦者 小柯的徒弟
- 梦石
- 0
- 星屑
- 1530
- 在线时间
- 1157 小时
- 注册时间
- 2008-5-24
- 帖子
- 3085
|
- class Game_Event < Game_Character
- def name
- return @event.name
- end
- end
- class Sprite_Character
- alias old_initialize initialize
- def initialize(a,b)
- old_initialize(a,b)
- @namesprite = Sprite.new
- @namesprite.bitmap = Bitmap.new(160, 100)
- @namesprite.z = 0
- @namesprite.bitmap.font.name = "黑体"
- @namesprite.bitmap.font.size = 17
- @namesprite.bitmap.font.color.set(255, 255, 255)
- @hp = 0
- @sp = 0
- end
- alias old_update update
- def update
- old_update
- if [email protected]_a?(Game_Player) and @namesprite != nil and (@character.name.include?("Enemy") or
- @character.name.include?("Pet"))
- @namesprite.x = self.x-80
- @namesprite.y = self.y-self.oy-34
- if $game_variables[@character.id*4+1] != @hp or $game_variables[@character.id*4+2] != @sp
- @sp = $game_variables[@character.id*4+2]
- @hp = $game_variables[@character.id*4+1]
- name = @character.name.clone.delete("Enemy")
- name.delete("Pet")
- @namesprite.bitmap.clear
- @namesprite.bitmap.draw_text(0, 8, 160, 36, name, 1)
- width = 40
- x = 60
- y = 55
- @namesprite.bitmap.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
- w = width * @hp / [$game_variables[@character.id*4+3],1].max
- @namesprite.bitmap.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
- @namesprite.bitmap.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
- @namesprite.bitmap.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
- @namesprite.bitmap.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
- width = 40
- x = 60
- y = 60
- @namesprite.bitmap.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
- w = width * @sp / [$game_variables[@character.id*4+4],1].max
- @namesprite.bitmap.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
- @namesprite.bitmap.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
- @namesprite.bitmap.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
- @namesprite.bitmap.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
- end
- else
- return if @namesprite == nil
- @namesprite.x = self.x-80
- @namesprite.y = self.y-self.oy-34
- @sp = $game_party.actors[0].sp
- @hp = $game_party.actors[0].hp
- @namesprite.bitmap.clear
- width = 40
- x = 60
- y = 55
- @namesprite.bitmap.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
- w = width * @hp / [$game_party.actors[0].maxhp,1].max
- @namesprite.bitmap.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
- @namesprite.bitmap.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
- @namesprite.bitmap.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
- @namesprite.bitmap.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
- width = 40
- x = 60
- y = 60
- @namesprite.bitmap.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
- w = width * @sp / [$game_party.actors[0].maxsp,1].max
- @namesprite.bitmap.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
- @namesprite.bitmap.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
- @namesprite.bitmap.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
- @namesprite.bitmap.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
- end
- end
- end
复制代码 不知道怎么解决覆盖问题><等高手 |
|