赞 | 0 |
VIP | 1 |
好人卡 | 0 |
积分 | 1 |
经验 | 1773 |
最后登录 | 2014-4-18 |
在线时间 | 8 小时 |
Lv1.梦旅人 ℃ake
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 8 小时
- 注册时间
- 2009-6-6
- 帖子
- 787
|
本帖最后由 奶油Da蛋糕 于 2009-11-14 22:47 编辑
血条
- #=================
- #血条 By后知后觉
- #=================
- #血条图片宽度和高度
- $cake_图片宽度 = 49
- $cake_图片高度 = 49
- #血条图片名称
- $cake_图片名称 = "血条" #Graphics/Pictures/血条
- #蓝条图片宽度和高度
- $cake_图片宽度2 = 49
- $cake_图片高度2 = 49
- #蓝条图片名称
- $cake_图片名称2 = "蓝条" #Graphics/Pictures/蓝条
- class Window_BattleStatus < Window_Base
- alias initialize_cake initialize
- def initialize(hpsp_window = nil)
- @hpsp_window = hpsp_window
- initialize_cake
- end
- alias refresh_cake refresh
- def refresh
- refresh_cake
- unless @hpsp_window.nil?
- @hpsp_window.refresh
- end
- end
- alias update_cake update
- def update
- update_cake
- unless @hpsp_window.nil?
- @hpsp_window.update
- end
- end
- end
- class Window_HPSP < Window_Base
- def initialize
- super(-16,-16,672,512)
- self.contents = Bitmap.new(640, 480)
- self.opacity = 0
- refresh
- end
- def refresh
- self.contents.clear
- actors = $game_party.actors
- return if actors.size == 0
- scr_z = 0
- for actor in actors
- if scr_z < actor.screen_z
- scr_z = actor.screen_z
- end
- end
- self.z = scr_z + 10
- for i in 0...actors.size
- x = actors[i].screen_x
- y = actors[i].screen_y
- draw_actor_hp_bar(actors[i], x, y)
- draw_actor_sp_bar(actors[i], x, y)
- end
- end
- def draw_actor_hp_bar(actor, x, y)
- bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
- new_x = x - bitmap.width / 4
- new_y = y - bitmap.height
- w = $cake_图片宽度 * actor.hp / actor.maxhp
- @rect = Rect.new(0,0,w,$cake_图片高度)
- self.contents.blt(new_x, new_y, RPG::Cache.picture($cake_图片名称),@rect)
- end
- def draw_actor_sp_bar(actor, x, y)
- bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
- new_x = x - bitmap.width / 4
- new_y = y - bitmap.height
- new_y += 10
- w = $cake_图片宽度2 * actor.sp / actor.maxsp
- @rect = Rect.new(0,0,w,$cake_图片高度2)
- self.contents.blt(new_x, new_y, RPG::Cache.picture($cake_图片名称2),@rect)
- end
- end
- class Scene_Battle
- alias main_cake main
- def main
- @hpsp_window = Window_HPSP.new
- @status_window = Window_BattleStatus.new(@hpsp_window)
- main_cake
- @hpsp_window.dispose
- end
- end
复制代码 插入到MAIN前,同时找到Scene_Battle 1,删除第49行@status_window = Window_BattleStatus.new的内容即可(只有这样才可以做到0冲突)。 |
|