赞 | 0 |
VIP | 157 |
好人卡 | 6 |
积分 | 1 |
经验 | 113829 |
最后登录 | 2014-1-16 |
在线时间 | 26 小时 |
Lv1.梦旅人 B
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 26 小时
- 注册时间
- 2007-8-26
- 帖子
- 3693
|
- #------------------------------------------------------------------------------
- # 显示战斗画面同伴状态的窗口。
- #==============================================================================
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 416, 128)
- refresh
- self.active = false
- end
- #--------------------------------------------------------------------------
- # ● 释放
- #--------------------------------------------------------------------------
- def dispose
- super
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- for actor in $game_party.members
- x = actor.index * 96 + 2
- y = 2
- draw_actor_face(actor, x, y, 92)
- draw_actor_hp_tinygauge(actor, x, y+859, height = 92)
- draw_actor_mp_tinygauge(actor, x, y+90, height = 92)
- draw_actor_name(actor, x+11, y)
- draw_actor_state(actor, x+2, 66, width = 96)
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新光标
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0 # 没有光标
- self.cursor_rect.empty
- elsif @index < @item_max # 普通
- self.cursor_rect.set( @index * 96, 0, 96, 96)
- elsif @index >= 100 # 自己
- self.cursor_rect.set( (@index - 100) * 96, 0, 96, 96)
- else # 全体
- self.cursor_rect.set( 0, 0, @item_max * 96, 96)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘 HP 槽
- # actor : 角色
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- # height : 高
- #--------------------------------------------------------------------------
- def draw_actor_hp_tinygauge(actor, x, y, height = 92)
- gh = height * actor.hp / actor.maxhp
- gc1 = hp_gauge_color1
- gc2 = hp_gauge_color2
- self.contents.fill_rect(x, y, height,4 , gauge_back_color)
- self.contents.gradient_fill_rect(x, y+(height-gh), gh, 4, gc2, gc1)
- end
- #--------------------------------------------------------------------------
- # ● 描绘 MP 槽
- # actor : 角色
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- # height : 高
- #--------------------------------------------------------------------------
- def draw_actor_mp_tinygauge(actor, x, y, height = 92)
- gh = height * actor.mp / [actor.maxmp, 1].max
- gc1 = mp_gauge_color1
- gc2 = mp_gauge_color2
- self.contents.fill_rect(x, y, height,4 , gauge_back_color)
- self.contents.gradient_fill_rect(x, y+(height-gh), gh, 4, gc2, gc1)
- end
- end
复制代码 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|