设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1177|回复: 7
打印 上一主题 下一主题

怎么样才能使CP条向下层移(如图)

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
180
在线时间
229 小时
注册时间
2008-7-8
帖子
233
跳转到指定楼层
1
发表于 2008-7-27 18:26:55 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
因为它在技能.物品.和如图窗口的上面↑
怎么样才能使CP条向下层移?
版务信息:本贴由楼主自主结贴~
A man chooses; a slave obeys.

Lv1.梦旅人

梦石
0
星屑
180
在线时间
229 小时
注册时间
2008-7-8
帖子
233
8
 楼主| 发表于 2008-7-28 16:43:23 | 只看该作者
这样也可以
谢谢
A man chooses; a slave obeys.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
7
发表于 2008-7-28 09:41:14 | 只看该作者
是不是LZ帖错脚本了?
我找了下没找到绘制cp条和显示人物头像的代码

  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 640, 480)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     @level_up_flags = [false, false, false, false]
  14.     #........................................................................
  15.     self.opacity = 0
  16.     @sta_back = []
  17.     @sta_output = []
  18.    # @cp_output = []
  19.    # @hp_bitmap = RPG::Cache.picture("../system/battle/hmcp/hp_bar.png")
  20.     #@mp_bitmap = RPG::Cache.picture("../system/battle/hmcp/mp_bar.png")
  21.    # @bitmap3 = RPG::Cache.picture("../system/battle/hmcp/底.png")
  22.     # @cp_bitmap = RPG::Cache.picture("../system/battle/hmcp/cp_bar.png")
  23.    # @cp_output = []
  24.    # @cp_back_bar = Sprite.new
  25.     #@cp_back_bar.bitmap = Bitmap.new("Graphics/system/battle/hmcp/cp_back_bar")
  26.    ## @cp_back_bar.x = 450
  27.    # @cp_back_bar.y = 25
  28.     #@cp_back_bar.z = self.z + 1
  29.    # @actor_cp_sprite = []
  30.    # @actor_cp_sprite_back = []

  31.     for actor_index in 1..$game_party.actors.size
  32. #      @cp_output[actor_index] = Sprite.new
  33.      # @cp_output[actor_index].bitmap = Bitmap.new(133, 78)
  34.     #  @cp_output[actor_index].x = 100 + (actor_index - 1) * 133
  35.     #  @cp_output[actor_index].y = 480 - 78 - 10
  36.     #  @cp_output[actor_index].z = self.z + 2
  37. #      @cp_output[actor_index].bitmap.clear
  38.       @sta_back[actor_index] = Sprite.new
  39.       @sta_back[actor_index].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index - 1].name + "战斗.png")
  40.       @sta_back[actor_index].x = 10
  41.       @sta_back[actor_index].y = 220 + (actor_index - 1) * 80
  42.       @sta_back[actor_index].z = self.z + 1
  43.       @sta_output[actor_index] = Sprite.new
  44.       @sta_output[actor_index].bitmap = Bitmap.new(133, 78)
  45.       @sta_output[actor_index].x = 75
  46.       @sta_output[actor_index].y = 232 + (actor_index - 1) * 80
  47.       @sta_output[actor_index].z = self.z + 2
  48.       @sta_output[actor_index].bitmap.clear
  49.       @sta_output[actor_index].bitmap.font.size = 10
  50.       @sta_output[actor_index].bitmap.font.name = "黑体"
  51.      # hp_width = $game_party.actors[actor_index - 1].hp * @hp_bitmap.width/$game_party.actors[actor_index - 1].maxhp
  52.      # hp_rect = Rect.new(0, 0, hp_width, 5)
  53.      # mp_width = $game_party.actors[actor_index - 1].sp * @mp_bitmap.width/$game_party.actors[actor_index - 1].maxsp
  54.     #  mp_rect = Rect.new(0, 0, mp_width, 5)
  55.       
  56.      # @src_rect3 = Rect.new(0,0,@bitmap3.width, @bitmap3.height)
  57.      # self.contents.blt(10,220, @bitmap3, @src_rect3)
  58.       
  59.      # @sta_output[actor_index].bitmap.blt(66, 44, @hp_bitmap, hp_rect)
  60.      # @sta_output[actor_index].bitmap.blt(66, 64, @mp_bitmap, mp_rect)
  61.      # @sta_output[actor_index].bitmap.blt(66, 54, @bitmap3, @src_rect3)
  62.       
  63.       @sta_output[actor_index].bitmap.font.color.set(255, 0, 0)
  64.       @sta_output[actor_index].bitmap.draw_text(80, 31, 77, 11,$game_party.actors[actor_index - 1].hp.to_s + "/" + $game_party.actors[actor_index - 1].maxhp.to_s)
  65.       @sta_output[actor_index].bitmap.font.color.set(0, 0, 255)
  66.       @sta_output[actor_index].bitmap.draw_text(80, 51, 77, 11,$game_party.actors[actor_index - 1].sp.to_s + "/" + $game_party.actors[actor_index - 1].maxsp.to_s)
  67.     end
  68.     #........................................................................
  69.     refresh
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 释放
  73.   #--------------------------------------------------------------------------
  74.   def dispose
  75.     super
  76. #    @hp_bitmap.bitmap.dispose
  77.    # @hp_bitmap.dispose
  78.   #  @mp_bitmap.bitmap.dispose
  79.    # @mp_bitmap.dispose
  80.     #@cp_bitmap.bitmap.dispose
  81.    # @cp_bitmap.dispose
  82.     for actor_index in 1..$game_party.actors.size
  83.       @sta_back[actor_index].bitmap.dispose
  84.       @sta_back[actor_index].dispose
  85.       @sta_output[actor_index].bitmap.dispose
  86.       @sta_output[actor_index].dispose
  87.      # @cp_output[actor_index].bitmap.dispose
  88.      # @cp_output[actor_index].dispose
  89.     end
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● 设置升级标志
  93.   #     actor_index : 角色索引
  94.   #--------------------------------------------------------------------------
  95.   def level_up(actor_index)
  96.     @level_up_flags[actor_index] = true
  97.   end
  98.   #......................................................................
  99.   #--------------------------------------------------------------------------
  100.   # ● 设置正在攻击标志
  101.   #     actor_index : 角色索引
  102.   #--------------------------------------------------------------------------
  103.   def in_atk(actor_index)
  104.     @sta_back[actor_index + 1].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗1.png")
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 设置不在攻击标志
  108.   #     actor_index : 角色索引
  109.   #--------------------------------------------------------------------------
  110.   def out_atk(actor_index)
  111.     @sta_back[actor_index + 1].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗.png")
  112.   end
  113.   #......................................................................
  114.   #--------------------------------------------------------------------------
  115.   # ● 刷新
  116.   #--------------------------------------------------------------------------
  117.   def refresh
  118.     self.contents.clear
  119.     @item_max = $game_party.actors.size
  120.     for i in 0...$game_party.actors.size
  121.       actor = $game_party.actors[i]
  122.       #......................................................................
  123.        actor_x = i * 160 + 145
  124.        actor_y = i * 80 + 220
  125.       @sta_output[i + 1].bitmap.clear
  126. #      hp_width = $game_party.actors[i].hp * @hp_bitmap.width/$game_party.actors[i].maxhp
  127.      # hp_rect = Rect.new(0, 0, hp_width, 5)
  128.     #  mp_width = $game_party.actors[i].sp * @mp_bitmap.width/$game_party.actors[i].maxsp
  129.     #  mp_rect = Rect.new(0, 0, mp_width, 5)
  130. #      @sta_output[i + 1].bitmap.blt(66, 44, @hp_bitmap, hp_rect)
  131.     #  @sta_output[i + 1].bitmap.blt(66, 64, @mp_bitmap, mp_rect)
  132.       @sta_output[i + 1].bitmap.font.color.set(255, 0, 0)
  133.       @sta_output[i + 1].bitmap.draw_text(80, 31, 77, 11,$game_party.actors[i].hp.to_s + "/" + $game_party.actors[i].maxhp.to_s)
  134.       @sta_output[i + 1].bitmap.font.color.set(0, 0, 255)
  135.       @sta_output[i + 1].bitmap.draw_text(80, 51, 77, 11,$game_party.actors[i].sp.to_s + "/" + $game_party.actors[i].maxsp.to_s)
  136.       #......................................................................
  137.       if @level_up_flags[i]
  138.         self.contents.font.color = normal_color
  139.         self.contents.draw_text(0, 0, 640 , 480, "LEVEL UP!")
  140.       else
  141.         draw_actor_state(actor, 120, actor_y)
  142.       end
  143.     end
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 刷新画面
  147.   #--------------------------------------------------------------------------
  148.   def update
  149.     super
  150. #     主界面的不透明度下降
  151.     if $game_temp.battle_main_phase
  152.       self.contents_opacity = 255 #if self.contents_opacity > 1
  153.     else
  154.       self.contents_opacity = 255 #if self.contents_opacity < 255
  155.     end
  156.   end
  157. end
复制代码

这个可以实现LZ要的CP条(把部分#去掉)
# @cp_bitmap = RPG::Cache.picture("../system/battle/hmcp/cp_bar.png")
例如这句显示cp条的

来自游戏石焚刃暖

系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
180
在线时间
229 小时
注册时间
2008-7-8
帖子
233
6
 楼主| 发表于 2008-7-27 20:41:00 | 只看该作者
不行啊
回复 支持 反对

使用道具 举报

Lv3.寻梦者

孤独守望

梦石
0
星屑
3133
在线时间
1535 小时
注册时间
2006-10-16
帖子
4321

开拓者贵宾

5
发表于 2008-7-27 20:15:35 | 只看该作者
把常量Y_OFFSET = 464改掉试试
菩提本非树,明镜本非台。回头自望路漫漫。不求姻缘,但求再见。
本来无一物,何处惹尘埃。风打浪吹雨不来。荒庭遍野,扶摇难接。
不知道多久更新一次的博客
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
180
在线时间
229 小时
注册时间
2008-7-8
帖子
233
4
 楼主| 发表于 2008-7-27 20:11:11 | 只看该作者
腳本是
[# ▼▲▼ XRXS65. CP制御ターンシステム ver.β ▼▲▼ built 201120
# by 桜雅 在土

#==============================================================================
# □ カスタマイズポイント
#==============================================================================
module XRXS65
  #
  # 「バトルスピード」(数値が高いほど早い)
  #
  SPEED = 4.0
  #
  # 戦闘開始時 CP。 固定値と占有率
  #
  CP_PRESET_FIXNUM = 0
  CP_PRESET_RATIO  = 2.0
  #
  # ターンコントローラ (nil  : カウント/ターンを有効。
  #                     数値 : そのインデックスをもつエネミーが支配)
  #
  TC = 0
  #
  # カウント/ターン (TCが有効な場合は無視)
  #
  CPT = 40
  #
  # CP スキン
  #
  SKIN        = "123"  # 窗口图形名称(Graphics/Windowskins中添加)
  LINE_HEIGHT =  6        # スキンの"一行"の縦幅[単位:ピクセル]
  #
  # 表示位置セッティング
  #
  X_OFFSET = 144    # 横位置
  Y_OFFSET = 464    # 縦位置
  ALIGN    =   1    #对齐方式(CP条的位置。0:左对齐 1:中央 2:右对齐)
  MAX      =   4    # 確保するサイズ[単位:~人分]
  #
  # アクターコマンドがポップしたときの効果音
  #
  COMMAND_UP_SE = "Audio/SE/046-Book01.ogg"
end
#==============================================================================
# --- CP メーターの描画情報の取得 --- (Game_Battlerにインクルードされます)
#==============================================================================
module XRXS_CP
  #--------------------------------------------------------------------------
  # ○ スキンライン (スキンの何行目を使うか)
  #--------------------------------------------------------------------------
  def cp_linetype
    # CP フルの場合はスキンの 2 行目を使う
    return 2 if self.cp_full?
    # 通常はスキンの 1 行目を使う
    return 1
  end
  #--------------------------------------------------------------------------
  # ○ メーター量[単位:%]
  #--------------------------------------------------------------------------
  def cp_lineamount
    # 戦闘不能の場合は 0 %として表示させる
     return 0 if self.dead?
    # CP値を%値に変換して返却する
    return 100 * self.cp / self.max_cp
  end
end
#
# カスタマイズポイントここまで。
#------------------------------------------------------------------------------



#==============================================================================
# --- XRXS. CP機構 ---
#==============================================================================
module XRXS_CP_SYSTEM
  #----------------------------------------------------------------------------
  # ○ 合計 AGI の取得
  #----------------------------------------------------------------------------
  def self.total_agi
    total = 0
    for battler in $game_party.actors + $game_troop.enemies
      total += battler.agi
    end
    return total
  end
end
#==============================================================================
# --- バトラーにCP機能を追加 モジュール ---
#==============================================================================
module XRXS_CP
  #--------------------------------------------------------------------------
  # ○ 最大 CP の取得
  #--------------------------------------------------------------------------
  def max_cp
    return 65535
  end
  #--------------------------------------------------------------------------
  # ○ CP の取得と設定
  #--------------------------------------------------------------------------
  def cp
    return @cp == nil ? @cp = 0 : @cp
  end
  def cp=(n)
    @cp = [[n.to_i, 0].max, self.max_cp].min
  end
  #--------------------------------------------------------------------------
  # ○ CP 初期設定
  #--------------------------------------------------------------------------
  def cp_preset
    percent = self.max_cp * XRXS65::CP_PRESET_RATIO * (rand(16) + 16) * self.agi / XRXS_CP_SYSTEM.total_agi / 24
    self.cp = XRXS65::CP_PRESET_FIXNUM + percent
  end
  #--------------------------------------------------------------------------
  # ○ CP カウントアップ
  #--------------------------------------------------------------------------
  def cp_update
    self.cp += XRXS65::SPEED * 4096 * self.agi / XRXS_CP_SYSTEM.total_agi
  end
  #--------------------------------------------------------------------------
  # ○ CP 満タン?
  #--------------------------------------------------------------------------
  def cp_full?
    return @cp == self.max_cp
  end
end
class Game_Battler
  include XRXS_CP
end
#==============================================================================
# --- ガード機能 ---
#==============================================================================
class Game_Battler
  #--------------------------------------------------------------------------
  # ○ ガードフラグ
  #--------------------------------------------------------------------------
  def guarding=(n)
    @guarding = n
  end
  #--------------------------------------------------------------------------
  # ● 防御中判定 [再定義]
  #--------------------------------------------------------------------------
  def guarding?
    return @guarding
  end
end
#==============================================================================
# --- アクター「コマンド入力可能判定」:CPがないとコマンドしない ---
#==============================================================================
module XRXS_CP_INPUTABLE
  def inputable?
    return (self.cp_full? and super)
  end
end
class Game_Actor < Game_Battler
  include XRXS_CP_INPUTABLE
end
#==============================================================================
# --- エネミー「行動可能判定」:CPがないとコマンドしない ---
#==============================================================================
module XRXS_CP_MOVABLE
  def movable?
    return (self.cp_full? and super)
  end
end
class Game_Enemy < Game_Battler
  include XRXS_CP_MOVABLE
end
#==============================================================================
# --- 戦闘時 CPカウント ---
#==============================================================================
module XRXS_CP_Battle
  #--------------------------------------------------------------------------
  # ○ パーティ全員の CP を初期設定
  #--------------------------------------------------------------------------
  def cp_preset_party
    for actor in $game_party.actors
      actor.cp_preset
    end
  end
  #--------------------------------------------------------------------------
  # ○ トループ全員の CP を初期設定
  #--------------------------------------------------------------------------
  def cp_preset_troop
    for enemy in $game_troop.enemies
      enemy.cp_preset
    end
  end
  #--------------------------------------------------------------------------
  # ○ バトラー全員の CP をカウントアップ
  #--------------------------------------------------------------------------
  def cp_update
    for battler in $game_party.actors + $game_troop.enemies
      battler.cp_update
    end
  end
end
class Scene_Battle
  include XRXS_CP_Battle
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  alias xrxs65_main main
  def main
    # エクストラスプライトの初期化
    @extra_sprites = [] if @extra_sprites == nil
    # CP の初期化
    cp_preset_party
    # CP メーターの作成
    @cp_meters = CP_Meters.new
    # CP メーターをエクストラスプライトへ登録
    @extra_sprites.push(@cp_meters)
    # 呼び戻す
    xrxs65_main
    # メーターの解放
    @cp_meters.dispose
  end
  #--------------------------------------------------------------------------
  # ● プレバトルフェーズ開始
  #--------------------------------------------------------------------------
  alias xrxs65_start_phase1 start_phase1
  def start_phase1
    # 呼び戻す
    xrxs65_start_phase1
    # CP の初期化
    cp_preset_troop
    # CP メーターの更新
    @cp_meters.refresh
    # インデックスを計算
    @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
    # アクターコマンドウィンドウに追加
#    @actor_command_window.add_command("逃げる")
#    if !$game_temp.battle_can_escape
#      @actor_command_window.disable_item(@cp_escape_actor_command_index)
#    end
  end
  #--------------------------------------------------------------------------
  # ● パーティコマンドフェーズ開始
  #--------------------------------------------------------------------------
  alias xrxs65_start_phase2 start_phase2
  def start_phase2
    # 呼び戻す
    xrxs65_start_phase2
    # パーティコマンドウィンドウを無効化
#    @party_command_window.active  = false
#    @party_command_window.visible = false
    # 強制的にフェイズ 2 を保持
    @phase = 2
    # ただし、既に行動可能者が存在する場合は 3 へ
    start_phase3 if anybody_movable?
  end
  #--------------------------------------------------------------------------
  # ○ CP制での ターンのカウント
  #--------------------------------------------------------------------------
  def cp_turn_count
    $game_temp.battle_turn += 1
    # バトルイベントの全ページを検索
    for index in 0...$data_troops[@troop_id].pages.size
      # このページのスパンが [ターン] の場合
      if $data_troops[@troop_id].pages[index].span == 1
        # 実行済みフラグをクリア
        $game_temp.battle_event_flags[index] = false
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (パーティコマンドフェーズ)
  #--------------------------------------------------------------------------
  alias xrxs65_update_phase2 update_phase2
  def update_phase2
    # パーティコマンドウィンドウのインデックスを無効化
#    @party_command_window.index = -1
    # 呼び戻す
    xrxs65_update_phase2
    # 例外補正
    @turn_count_time = 1 if @turn_count_time == nil
    # ターンのカウント
    if @turn_count_time > 0
      @turn_count_time -= 1
      if @turn_count_time == 0
        cp_turn_count
        @turn_count_time = XRXS65::CPT if XRXS65::TC == nil
      end
    end
    # CP のフレーム更新
    cp_update
    @cp_meters.refresh
    # フル CP のバトラーが存在する場合、ターン開始
    start_phase3 if anybody_movable?
  end
  #--------------------------------------------------------------------------
  # ○ フル CP バトラーが存在するか?
  #--------------------------------------------------------------------------
  def anybody_movable?
    for battler in $game_party.actors + $game_troop.enemies
      return true if battler.cp_full?
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● アクターコマンドウィンドウのセットアップ
  #--------------------------------------------------------------------------
  alias xrxs65_phase3_setup_command_window phase3_setup_command_window
  def phase3_setup_command_window
    # 効果音の再生
    Audio.se_play(XRXS65::COMMAND_UP_SE) rescue nil
    # 呼び戻す
    xrxs65_phase3_setup_command_window
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  #--------------------------------------------------------------------------
  alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  def update_phase3_basic_command
    # 按下C键的情况下
#    if Input.trigger?(Input::C)
      # 同伴指令窗口光标位置分支
#      case @actor_command_window.index
#      when @cp_escape_actor_command_index # 逃げる
#        if $game_temp.battle_can_escape
          # 決定 SE を演奏
#          $game_system.se_play($data_system.decision_se)
          # アクションを設定
#          @active_battler.current_action.kind = 0
#          @active_battler.current_action.basic = 4
          # 次のアクターのコマンド入力へ
#          phase3_next_actor
#        else
          # ブザー SE を演奏
#          $game_system.se_play($data_system.buzzer_se)
#        end
#        return
#      end
#    end
    # 呼び戻す
    xrxs_bsp1_update_phase3_basic_command
  end
  #--------------------------------------------------------------------------
  # ● メインフェーズ開始
  #--------------------------------------------------------------------------
  alias xrxs65_start_phase4 start_phase4
  def start_phase4
    # ターン数を引くことによって擬似的にカウントに変化を起こさせない
    $game_temp.battle_turn -= 1
    # フラグを退避
    save_flags = $game_temp.battle_event_flags.dup
    # 呼び戻す
    xrxs65_start_phase4
    # フラグを復旧
    $game_temp.battle_event_flags = save_flags
  end
  #--------------------------------------------------------------------------
  # ● 行動順序作成
  #--------------------------------------------------------------------------
  alias xrxs65_make_action_orders make_action_orders
  def make_action_orders
    # 呼び戻す
    xrxs65_make_action_orders
    # CPが不足している場合は @action_battlers から除外する
    for battler in @action_battlers.dup
      @action_battlers.delete(battler) unless battler.cp_full?
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  #--------------------------------------------------------------------------
  alias xrxs65_update_phase4_step2 update_phase4_step2
  def update_phase4_step2
    # ガードの解除
    @active_battler.guarding = false
    # CPの消費
    @active_battler.cp = 0
    # CP メーターの更新
    @cp_meters.refresh
    # 呼び戻す
    xrxs65_update_phase4_step2
    # 例外補正
    return if @active_battler == nil
    # ターンコントローラ
    if @active_battler.is_a?(Game_Enemy) and @active_battler.index == XRXS65::TC
      cp_turn_count
    end
  end
  #--------------------------------------------------------------------------
  # ● 基本アクション 結果作成
  #--------------------------------------------------------------------------
  alias xrxs65_make_basic_action_result make_basic_action_result
  def make_basic_action_result
    # 呼び戻す
    xrxs65_make_basic_action_result
    # 防御の場合
    @active_battler.guarding = false
    if @active_battler.current_action.basic == 1
      @active_battler.guarding = true
      return
    end
    # パーティの逃亡の場合
    if @active_battler.current_action.basic == 4
      # 逃走可能ではない場合
      if $game_temp.battle_can_escape == false
        # ブザー SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # パーティ全員の CP をクリア
      for actor in $game_party.actors
        actor.cp = 0
      end
      # CP メーターの更新
      @cp_meters.refresh
      # 逃走処理
      update_phase2_escape
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  #--------------------------------------------------------------------------
  alias xrxs65_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
    # 呼び戻す
    xrxs65_update_phase4_step5
    # CP メーターの更新
    @cp_meters.refresh
  end
end
#==============================================================================
# --- CP メーターをまとめて管理するクラス、表示関係はすべてココ ---
#==============================================================================
class CP_Meters
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    # メーター群の生成
    @meters = []
    for i in 0...$game_party.actors.size
      make_meter(i)
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    # 戦闘メンバー数の変更を判別
    for i in @meters.size...$game_party.actors.size
      make_meter(i)
    end
    for i in [email protected]
      @meters.dispose
      @meters = nil
    end
    @meters.compact!
    # 表示更新
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      @meters.line   = actor.cp_linetype
      @meters.amount = actor.cp_lineamount
    end
  end
  #--------------------------------------------------------------------------
  # ○ メーターひとつの生成
  #--------------------------------------------------------------------------
  def make_meter(i)
    # スキンの取得
    skin = RPG::Cache.windowskin(XRXS65::SKIN)
    #
    space = 640 / XRXS65::MAX
    case XRXS65::ALIGN
    when 0
      actor_x = i * space + 4
    when 1
      actor_x = (space * ((XRXS65::MAX - $game_party.actors.size)/2.0 + i)).floor
    when 2
      actor_x = (i + XRXS65::MAX - $game_party.actors.size) * space + 4
    end
    meter = MeterSprite.new(skin, XRXS65::LINE_HEIGHT)
    meter.x = actor_x + XRXS65::X_OFFSET - skin.width
    meter.y = XRXS65::Y_OFFSET
    @meters = meter
  end
  #--------------------------------------------------------------------------
  # ○ 可視状態
  #--------------------------------------------------------------------------
  def visible=(b)
    @meters.each{|sprite| sprite.visible = b }
  end
  #--------------------------------------------------------------------------
  # ○ 解放
  #--------------------------------------------------------------------------
  def dispose
    @meters.each{|sprite| sprite.dispose }
  end
end
#==============================================================================
# --- XRXS. レクタンギュラーメーター表示・極 ---
#==============================================================================
class MeterSprite < Sprite
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(skin, line_height)
    @skin   = skin
    @width  = @skin.width
    @height = line_height
    @line   = 1
    @amount = 0
    @base_sprite = Sprite.new
    @base_sprite.bitmap = @skin
    @base_sprite.src_rect.set(0, 0, @width, @height)
    @base_sprite.z = 9000 #601
    super()
    self.z = @base_sprite.z + 1
    self.bitmap = @skin
    self.line = 1
  end
  #--------------------------------------------------------------------------
  # ○ 値の設定
  #--------------------------------------------------------------------------
  def line=(n)
    @line = n
    refresh
  end
  def amount=(n)
    @amount = n
    refresh
  end
  def refresh
    self.src_rect.set(0, @line * @height, @width * @amount / 100, @height)
  end
  #--------------------------------------------------------------------------
  # ○ 座標の設定
  #--------------------------------------------------------------------------
  def x=(n)
    super
    @base_sprite.x = n
  end
  def y=(n)
    super
    @base_sprite.y = n
  end
  #--------------------------------------------------------------------------
  # ○ 解放
  #--------------------------------------------------------------------------
  def dispose
    @base_sprite.dispose
    super
  end
end

A man chooses; a slave obeys.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
3
发表于 2008-7-27 19:43:07 | 只看该作者
  @cp_output[actor_index] = Sprite.new
      @cp_output[actor_index].bitmap = Bitmap.new(133, 78)
      @cp_output[actor_index].x = 100 + (actor_index - 1) * 133
      @cp_output[actor_index].y = 480 - 78 - 10
      @cp_output[actor_index].z = self.z + 2
      @cp_output[actor_index].bitmap.clear

是不是这个?
修改xy值
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

Lv1.梦旅人

冰王子

梦石
0
星屑
50
在线时间
34 小时
注册时间
2008-1-27
帖子
1875
2
发表于 2008-7-27 19:39:05 | 只看该作者
建议贴出脚本
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-8-10 04:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表