赞 | 44 |
VIP | 0 |
好人卡 | 2 |
积分 | 128 |
经验 | 32788 |
最后登录 | 2023-8-17 |
在线时间 | 1567 小时 |
Lv4.逐梦者
- 梦石
- 8
- 星屑
- 4801
- 在线时间
- 1567 小时
- 注册时间
- 2014-1-9
- 帖子
- 402
|
改好了,这样如何?
- # -----------------------------------------------------------------------------
- # ◆战斗全动态HP,MP,TP(Battle_H.M.T) By.Clov
- # -----------------------------------------------------------------------------
- # Ver:1.0.0 Date:2012.04.08
- # -1.0.0:基本版
- # Ver:1.0.1 Date:2012.04.09
- # -1.0.1:修正逃跑返回不显示问题
- # -----------------------------------------------------------------------------
- #==============================================================================
- # ■ Window_BattleStatus
- #------------------------------------------------------------------------------
- # 战斗画面中,显示[队伍成员状态的窗口。
- #==============================================================================
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, window_height)
- new_hmt unless self.is_a?(Window_BattleActor)
- refresh
- self.openness = 0
- end
- #--------------------------------------------------------------------------
- # ◆ 生成新的动态插槽
- #--------------------------------------------------------------------------
- def new_hmt
- hp1 = Color.new(225, 128, 64, 255)
- hp2 = Color.new(225, 192, 64, 255)
- mp1 = Color.new(64, 128, 192, 255)
- mp2 = Color.new(64, 192, 240, 255)
- tp1 = Color.new(36, 5, 79, 255)
- tp2 = Color.new(231, 90, 145, 255)
- @actor_hp = [];@actor_mp = [];@actor_tp = []
- if $data_system.opt_display_tp
- x = 245;y = 340;w = 88;w2 = 6;h = 10;wx = 76;hx = 24;i = 0
- else
- x = 245;y = 340;w = 99;w2 = 54;h = 10;wx = 90;hx = 24;i = 0
- end
- $game_party.battle_members.each {|actor|
- if $data_system.opt_display_tp
- @actor_tp[i] = DynamicSlot.new(x+i*193,y+4+line_height*2,150,w,h,tp1,tp2,:UD,false)
- @actor_tp[i].slot_dynamic_speed(0.2)
- @actor_tp[i].value_max(100)
- @actor_tp[i].auto_normal_draw(0)
- @actor_tp[i].value_set(2,23)
- @actor_tp[i].value_xy(x-86+i*193,y-8+line_height*2)
- end
- @actor_mp[i] = DynamicSlot.new(x+i*193,y+4+line_height*1,150,w,h,mp1,mp2,:LR,false)
- @actor_mp[i].value_max(actor.mmp)
- @actor_mp[i].auto_normal_draw(actor.mp)
- @actor_mp[i].value_set(2,23)
- @actor_mp[i].value_xy(x-86+i*193,y-8+line_height*1)
- free = i == item_max - 1 ? true : false
- @actor_hp[i] = DynamicSlot.new(x+i*193,y+4+line_height*0,150,w,h,hp1,hp2,:LR,free)
- @actor_hp[i].value_max(actor.mhp)
- @actor_hp[i].auto_normal_draw(actor.hp)
- @actor_hp[i].value_set(2,23)
- @actor_hp[i].value_xy(x-86+i*193,y-8+line_height*0)
- i+=1}
- for i in 0...item_max
- @actor_hp[item_max - 1].free_text(x+i*193,y-8+line_height*0,Vocab::hp_a,0,25,nil,nil,system_color)
- @actor_hp[item_max - 1].free_text(x+i*193,y-8+line_height*1,Vocab::mp_a,0,25,nil,nil,system_color)
- @actor_hp[item_max - 1].free_text(x+i*193,y-8+line_height*2,Vocab::tp_a,0,25,nil,nil,system_color)
- end
- end
- #--------------------------------------------------------------------------
- # ◆ 取得目前动态插槽
- #--------------------------------------------------------------------------
- def now_hmt
- @actor_hp + @actor_mp + @actor_tp
- end
- #--------------------------------------------------------------------------
- # ◆ 刷新、释放动态插槽
- #--------------------------------------------------------------------------
- def update
- super
- unless self.is_a?(Window_BattleActor)
- now_hmt.each{|hmt|hmt.update}
- end
- end
- def dispose
- super
- unless self.is_a?(Window_BattleActor)
- now_hmt.each{|hmt|hmt.dispose}
- end
- end
- #--------------------------------------------------------------------------
- # ● 描画项目
- #--------------------------------------------------------------------------
- def draw_item(index)
- actor = $game_party.battle_members[index]
- draw_basic_area(basic_area_rect(index), actor)
- unless self.is_a?(Window_BattleActor)
- @actor_hp[index].auto_gradually_draw(actor.hp)
- @actor_mp[index].auto_gradually_draw(actor.mp)
- @actor_tp[index].auto_gradually_draw(actor.tp.to_i) if $data_system.opt_display_tp
- end
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #------------------------------------------------------------------------------
- # 战斗画面
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● 移动信息显示的显示端口
- #--------------------------------------------------------------------------
- alias move_info_viewportY move_info_viewport
- def move_info_viewport(ox)
- move_info_viewportY(ox)
- current_ox = @info_viewport.ox
- @status_window.now_hmt.each {|htm|
- htm.VIEWPORT.ox = [ox, current_ox + 16].min if current_ox < ox
- htm.VIEWPORT.ox = [ox, current_ox - 16].max if current_ox > ox }
- end
- #--------------------------------------------------------------------------
- # ● 信息窗口打开时的更新
- # 在状态窗口关闭完成前,信息窗口的打开度设置为 0 。
- #--------------------------------------------------------------------------
- alias update_message_openY update_message_open
- def update_message_open
- update_message_openY
- if !$game_message.busy? && @status_window.close? && !@hmt_vis
- @hmt_vis = true
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
- end
- if $game_message.busy? && !@status_window.close? && @hmt_vis
- @hmt_vis = false
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成状态窗口
- #--------------------------------------------------------------------------
- alias create_status_windowY create_status_window
- def create_status_window
- create_status_windowY
- @hmt_vis = false
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
- end
- #--------------------------------------------------------------------------
- # ● 开始选择队友
- #--------------------------------------------------------------------------
- alias select_actor_selectionY select_actor_selection
- def select_actor_selection
- select_actor_selectionY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
- end
- #--------------------------------------------------------------------------
- # ● 角色[决定]
- #--------------------------------------------------------------------------
- alias on_actor_okY on_actor_ok
- def on_actor_ok
- on_actor_okY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
- end
- #--------------------------------------------------------------------------
- # ● 角色[取消]
- #--------------------------------------------------------------------------
- alias on_actor_cancelY on_actor_cancel
- def on_actor_cancel
- on_actor_cancelY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
- end
- #--------------------------------------------------------------------------
- # ● 开始选择敌人
- #--------------------------------------------------------------------------
- alias select_enemy_selectionY select_enemy_selection
- def select_enemy_selection
- select_enemy_selectionY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
- end
- #--------------------------------------------------------------------------
- # ● 敌方[决定]
- #--------------------------------------------------------------------------
- alias on_enemy_okY on_enemy_ok
- def on_enemy_ok
- on_enemy_okY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
- end
- #--------------------------------------------------------------------------
- # ● 敌方[取消]
- #--------------------------------------------------------------------------
- alias on_enemy_cancelY on_enemy_cancel
- def on_enemy_cancel
- on_enemy_cancelY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
- end
- #--------------------------------------------------------------------------
- # ● 战斗开始
- #--------------------------------------------------------------------------
- alias battle_startY battle_start
- def battle_start
- battle_startY
- @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
- end
- end
复制代码
|
评分
-
查看全部评分
|