| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 20703 |  
| 最后登录 | 2016-2-1 |  
| 在线时间 | 1 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间1 小时注册时间2008-5-25帖子274 | 
| 
这陣子我好象都是發一些沒啥用的帖
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  算了..看看能發布嗎??
 
 复制代码#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ 戰鬥中敵人加入血條 - KGC_OnScreenStatus ◆ VX ◆
#_/    ◇ Last update : 2008/01/03 ◇
#_/----------------------------------------------------------------------------
#_/  在戰鬥的畫面上表示敵人的狀態。
#_/
#_/
#_/  [[ 翻譯::雷特爾 ]]
#_/
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ 自行定義之項目 ★
#==============================================================================
module KGC
module OnScreenStatus
  # ◆血條視窗的位置
  #   0..左上角、1..上方正中央、2..右上堕
  WINDOW_ALIGN    = 2
  # ◆敵人血條視窗寛度
  WIDTH_PER_ACTOR = 92
  # ◆敵人 MP 表示開關(true為顯示)
  SHOW_MP    = true
  # ◆敵人狀態的顯示(true為顯示)
  SHOW_STATE = false
  # ◆反映敵人MP被消耗的時機(總覺得有點怪)
  #   0..技能使用時  1..技能使用結束時
  #  (如果 MP為0 時發生錯誤, 請在下方使用1)
  SKILL_MP_COST_APPLY_TIMING = 0
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["OnScreenStatus"] = true
#==============================================================================
# ■ Window_OnScreenBattleStatus
#------------------------------------------------------------------------------
#  戦闘行動中にパーティメンバーのステータスを表示するウィンドウです。
#==============================================================================
class Window_OnScreenBattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    wh = 32 + WLH * 2
    wh += WLH if KGC::OnScreenStatus::SHOW_MP
    wh += WLH if KGC::OnScreenStatus::SHOW_STATE
    super(0, 0, 64, wh, 8)
    @item_max = 0
    @column_max = 1
    refresh
    self.back_opacity = 160
    self.openness = 0
    self.active = false
  end
  #--------------------------------------------------------------------------
  # ● 名前の描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #     width : 幅
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y, width = 108)
    if defined?(draw_actor_od_gauge)
      draw_actor_od_gauge(actor, x, y, width)
    end
    self.contents.font.color = hp_color(actor)
    self.contents.draw_text(x, y, width, WLH, actor.name)
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new(0, 0, KGC::OnScreenStatus::WIDTH_PER_ACTOR, height - 32)
    rect.x = index % @column_max * (rect.width + @spacing)
    return rect
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    last_item_max = @item_max
    @item_max = $game_party.members.size
    if @item_max != last_item_max
      # メンバー数が変化したらウィンドウサイズ変更
      self.width =
        (KGC::OnScreenStatus::WIDTH_PER_ACTOR + @spacing) * @item_max + 32
      @column_max = @item_max
      create_contents
    else
      self.contents.clear
    end
    @item_max.times { |i| draw_item(i) }
    # 表示座標調整
    case KGC::OnScreenStatus::WINDOW_ALIGN
    when 0
      self.x = 0
    when 1
      self.x = (Graphics.width - self.width) / 2
    when 2
      self.x = Graphics.width - self.width
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #     index   : 項目番号
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    actor = $game_party.members[index]
    cw = KGC::OnScreenStatus::WIDTH_PER_ACTOR
    draw_actor_name(actor, rect.x, rect.y, cw)
    rect.y += WLH
    draw_actor_hp(actor, rect.x, rect.y, cw)
    if KGC::OnScreenStatus::SHOW_MP
      rect.y += WLH
      draw_actor_mp(actor, rect.x, rect.y, cw)
    end
    if KGC::OnScreenStatus::SHOW_STATE
      rect.y += WLH
      draw_actor_state(actor, rect.x, rect.y, cw)
    end
  end
  #--------------------------------------------------------------------------
  # ● 再描画
  #     actor : 対象アクター
  #--------------------------------------------------------------------------
  def redraw(actor)
    draw_item(actor.index)
  end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias start_KGC_OnScreenStatus start
  def start
    # オンスクリーンウィンドウを作成
    @onscreen_status_window = Window_OnScreenBattleStatus.new
    @onscreen_status_refresh_request = false
    start_KGC_OnScreenStatus
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  alias terminate_KGC_OnScreenStatus terminate
  def terminate
    @onscreen_status_window.dispose
    terminate_KGC_OnScreenStatus
  end
  #--------------------------------------------------------------------------
  # ● 基本更新処理
  #     main : メインの update メソッドからの呼び出し
  #--------------------------------------------------------------------------
  alias update_basic_KGC_OnScreenStatus update_basic
  def update_basic(main = false)
    update_basic_KGC_OnScreenStatus(main)
    if $game_troop.interpreter.running?
      @onscreen_status_window.close
      @onscreen_status_refresh_request = true
    end
    @onscreen_status_window.update
  end
  #--------------------------------------------------------------------------
  # ● 戦闘処理の実行開始
  #--------------------------------------------------------------------------
  alias start_main_KGC_OnScreenStatus start_main
  def start_main
    @onscreen_status_window.refresh
    start_main_KGC_OnScreenStatus
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の処理
  #--------------------------------------------------------------------------
  alias process_action_KGC_OnScreenStatus process_action
  def process_action
    if @onscreen_status_refresh_request
      @onscreen_status_window.refresh
      @onscreen_status_refresh_request = false
    end
    @onscreen_status_window.open
    process_action_KGC_OnScreenStatus
  end
  #--------------------------------------------------------------------------
  # ● ターン終了
  #--------------------------------------------------------------------------
  alias turn_end_KGC_OnScreenStatus turn_end
  def turn_end
    @onscreen_status_window.close
    turn_end_KGC_OnScreenStatus
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の実行 : スキル
  #--------------------------------------------------------------------------
  alias execute_action_skill_KGC_OnScreenStatus execute_action_skill
  def execute_action_skill
    # 行動前に MP を反映する場合
    if KGC::OnScreenStatus::SKILL_MP_COST_APPLY_TIMING == 0
      # MP を仮消費してステータスを更新
      last_mp = @active_battler.mp
      skill = @active_battler.action.skill
      @active_battler.mp -= @active_battler.calc_mp_cost(skill)
      update_onscreen_status(@active_battler)
      # 消費前に戻す
      @active_battler.mp = last_mp
    end
    execute_action_skill_KGC_OnScreenStatus
    # 行動後に MP を反映する場合
    if KGC::OnScreenStatus::SKILL_MP_COST_APPLY_TIMING == 1
      update_onscreen_status(@active_battler)
    end
  end
  #--------------------------------------------------------------------------
  # ● オンスクリーンステータスを更新
  #     target : 対象者
  #--------------------------------------------------------------------------
  def update_onscreen_status(target)
    if target.is_a?(Game_Actor)
      @onscreen_status_window.redraw(target)
    end
  end
  #--------------------------------------------------------------------------
  # ● HP ダメージ表示
  #     target : 対象者
  #     obj    : スキルまたはアイテム
  #--------------------------------------------------------------------------
  alias display_hp_damage_KGC_OnScreenStatus display_hp_damage
  def display_hp_damage(target, obj = nil)
    update_onscreen_status(target)
    if target.absorbed
      # 吸収の場合は行動者も更新
      update_onscreen_status(@active_battler)
    end
    display_hp_damage_KGC_OnScreenStatus(target, obj)
  end
  #--------------------------------------------------------------------------
  # ● MP ダメージ表示
  #     target : 対象者
  #     obj    : スキルまたはアイテム
  #--------------------------------------------------------------------------
  alias display_mp_damage_KGC_OnScreenStatus display_mp_damage
  def display_mp_damage(target, obj = nil)
    update_onscreen_status(target)
    if target.absorbed
      # 吸収の場合は行動者も更新
      update_onscreen_status(@active_battler)
    end
    display_mp_damage_KGC_OnScreenStatus(target, obj)
  end
  #--------------------------------------------------------------------------
  # ● ステート変化の表示
  #     target : 対象者
  #     obj    : スキルまたはアイテム
  #--------------------------------------------------------------------------
  alias display_state_changes_KGC_OnScreenStatus display_state_changes
  def display_state_changes(target, obj = nil)
    update_onscreen_status(target)
    display_state_changes_KGC_OnScreenStatus(target, obj)
  end
end
 TO 流星大::
 你在VX的問題收集帖也该更新了吧- -"
 | 
 |