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

Project1

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

[已经解决] 关于CP制战斗脚本和怒气槽脚本的问题,求解答。

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
155
在线时间
61 小时
注册时间
2011-3-9
帖子
92
跳转到指定楼层
1
发表于 2011-3-16 21:29:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
有没有“CP制战斗脚本”可以用的“怒气槽”?
随便问下CP制战斗的脚本怎恶魔修改CP槽的宽度和位置?
附上CP制脚本:
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


# ————————————————————————————————————

# ▼▲▼ XRXS_BP 1. CP制導入 ver..23 ▼▲▼
# by 桜雅 在土, 和希

#==============================================================================
# □ カスタマイズポイント
#==============================================================================
module XRXS_BP1
#
# 对齐方式。0:左 1:中央 2:右
#
ALIGN = 0
#
# 人数
#
MAX = 4
end
class Scene_Battle_CP
#
# 战斗速度
#
BATTLE_SPEED = 3.0
#
# 战斗开始的时候气槽百分比
#
START_CP_PERCENT = 100
end

class Scene_Battle

# 效果音效,可以自己添加
DATA_SYSTEM_COMMAND_UP_SE = ""

# 各项数值功能消耗的CP值
CP_COST_BASIC_ACTIONS = 0 # 基础共同
CP_COST_SKILL_ACTION = 65535 # 技能
CP_COST_ITEM_ACTION = 32768 # 物品
CP_COST_BASIC_ATTACK = 50000 # 攻撃
CP_COST_BASIC_GUARD = 32768 # 防御
CP_COST_BASIC_NOTHING = 32768 # 不做任何事情
CP_COST_BASIC_ESCAPE = 32768 # 逃跑
end

#==============================================================================
# --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
#------------------------------------------------------------------------------
# Window_Commandクラスに add_command メソッドを追加します。
#==============================================================================
module XRXS_Window_Command_Add_Command
#--------------------------------------------------------------------------
# ○ コマンドを追加
#--------------------------------------------------------------------------
def add_command(command)
# 初期化されていない場合、無効化判別用の配列 @disabled の初期化
#
if @disabled == nil
@disabled = []
end
if @commands.size != @disabled.size
for i in [email protected]
@disabled = false
end
end
#
# 追加
#
@commands.push(command)
@disabled.push(false)
@item_max = @commands.size
self.y -= 32
self.height += 32
self.contents.dispose
self.contents = nil
self.contents = Bitmap.new(self.width - 32, @item_max * 32)
refresh
for i in [email protected]
if @disabled
disable_item(i)
end
end
end
#--------------------------------------------------------------------------
# ○ 項目の無効化
# index : 項目番号
#--------------------------------------------------------------------------
def disable_item(index)
if @disabled == nil
@disabled = []
end
@disabled[index] = true
draw_item(index, disabled_color)
end
end
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ○ インクルード
#--------------------------------------------------------------------------
include XRXS_Window_Command_Add_Command
#--------------------------------------------------------------------------
# ● 項目の無効化
# index : 項目番号
#--------------------------------------------------------------------------
def disable_item(index)
super
end
end
#==============================================================================
# □ Scene_Battle_CP
#==============================================================================
class Scene_Battle_CP
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :stop # CP加算ストップ
#----------------------------------------------------------------------------
# ○ オブジェクトの初期化
#----------------------------------------------------------------------------
def initialize
@battlers = []
@cancel = false
@stop = false
@agi_total = 0
# 配列 count_battlers を初期化
count_battlers = []
# エネミーを配列 count_battlers に追加
for enemy in $game_troop.enemies
count_battlers.push(enemy)
end
# アクターを配列 count_battlers に追加
for actor in $game_party.actors
count_battlers.push(actor)
end
for battler in count_battlers
@agi_total += battler.agi
end
for battler in count_battlers
battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
end
end
#----------------------------------------------------------------------------
# ○ CPカウントアップ
#----------------------------------------------------------------------------
def update
# ストップされているならリターン
return if @stop
#
for battler in $game_party.actors + $game_troop.enemies
# 行動出来なければ無視
if battler.dead? == true
battler.cp = 0
next
end
battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
end
end
#----------------------------------------------------------------------------
# ○ CPカウントの開始
#----------------------------------------------------------------------------
def stop
@cancel = true
if @cp_thread != nil then
@cp_thread.join
@cp_thread = nil
end
end
end

#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
attr_accessor :now_guarding # 現在防御中フラグ
attr_accessor :cp # 現在CP
attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
#--------------------------------------------------------------------------
# ○ CP の変更
#--------------------------------------------------------------------------
def cp=(p)
@cp = [[p, 0].max, 65535].min
end
#--------------------------------------------------------------------------
# ● 防御中判定 [ 再定義 ]
#--------------------------------------------------------------------------
def guarding?
return @now_guarding
end
#--------------------------------------------------------------------------
# ● コマンド入力可能判定
#--------------------------------------------------------------------------
alias xrxs_bp1_inputable? inputable?
def inputable?
bool = xrxs_bp1_inputable?
return (bool and (@cp >= 65535))
end
#--------------------------------------------------------------------------
# ● ステート [スリップダメージ] 判定
#--------------------------------------------------------------------------
alias xrxs_bp1_slip_damage? slip_damage?
def slip_damage?
return false if @slip_state_update_ban
return xrxs_bp1_slip_damage?
end
#--------------------------------------------------------------------------
# ● ステート自然解除 (ターンごとに呼び出し)
#--------------------------------------------------------------------------
alias xrxs_bp1_remove_states_auto remove_states_auto
def remove_states_auto
return if @slip_state_update_ban
xrxs_bp1_remove_states_auto
end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● セットアップ
#--------------------------------------------------------------------------
alias xrxs_bp1_setup setup
def setup(actor_id)
xrxs_bp1_setup(actor_id)
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias xrxs_bp1_initialize initialize
def initialize(troop_id, member_index)
xrxs_bp1_initialize(troop_id, member_index)
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end

class Window_All < Window_Base
  def initialize
    super(0,0,640,480)
    self.opacity = 0
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    for actor in $game_troop.enemies
      next if !actor.exist?
      draw_actor_cp_meter(actor, actor.screen_x-50, actor.screen_y-50, 60, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ○ CPメーター の描画
  #--------------------------------------------------------------------------
  def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
    self.contents.font.color = system_color
    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
    if actor.cp == nil
      actor.cp = 0
    end
    w = width * [actor.cp,65535].min / 65535
    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
    self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
    self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  end  
end

#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :update_cp_only # CPメーターのみの更新
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs_bp1_initialize initialize
  def initialize
    @update_cp_only = false
    @wall = Window_All.new
    xrxs_bp1_initialize
  end
  def dispose
    super
    @wall.dispose
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias xrxs_bp1_refresh refresh
  def refresh
    unless @update_cp_only
      xrxs_bp1_refresh
    end
    refresh_cp
    @wall.refresh
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ(CPのみ)
  #--------------------------------------------------------------------------
  def refresh_cp
    for i in 0...$game_party.actors.size
    actor = $game_party.actors
    width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
    space = self.width / XRXS_BP1::MAX
    case XRXS_BP1::ALIGN
    when 0
      actor_x = i * space + 4
    when 1
      actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
    when 2
      actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
    end
      actor_x += self.x
      draw_actor_cp_meter(actor, actor_x, 96, width, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ○ CPメーター の描画
  #--------------------------------------------------------------------------
  def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
    self.contents.font.color = system_color
    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
    if actor.cp == nil
      actor.cp = 0
    end
    w = width * [actor.cp,65535].min / 65535
    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
    self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
    self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias xrxs_bp1_update update
def update
xrxs_bp1_update
# CP更新
@cp_thread.update
end
#--------------------------------------------------------------------------
# ● バトル終了
# result : 結果 (0:勝利 1:敗北 2:逃走)
#--------------------------------------------------------------------------
alias xrxs_bp1_battle_end battle_end
def battle_end(result)
# CPカウントを停止する
@cp_thread.stop
# 呼び戻す
xrxs_bp1_battle_end(result)
end
#--------------------------------------------------------------------------
# ● プレバトルフェーズ開始
#--------------------------------------------------------------------------
alias xrxs_bp1_start_phase1 start_phase1
def start_phase1
@agi_total = 0
# CP加算を開始する
@cp_thread = Scene_Battle_CP.new
# インデックスを計算
@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
# 呼び戻す
xrxs_bp1_start_phase1
end
#--------------------------------------------------------------------------
# ● パーティコマンドフェーズ開始
#--------------------------------------------------------------------------
alias xrxs_bp1_start_phase2 start_phase2
def start_phase2
xrxs_bp1_start_phase2
@party_command_window.active = false
@party_command_window.visible = false
# CP加算を再開する
@cp_thread.stop = false
# 次へ
start_phase3
end
#--------------------------------------------------------------------------
# ● アクターコマンドウィンドウのセットアップ
#--------------------------------------------------------------------------
alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
# CPスレッドを一時停止する
@cp_thread.stop = true
# ウィンドウのCP更新
@status_window.refresh_cp
# @active_battlerの防御を解除
@active_battler.now_guarding = false
# 効果音の再生
Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
# 呼び戻す
xrxs_bp1_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 xrxs_bp1_start_phase4 start_phase4
def start_phase4
# 呼び戻す
xrxs_bp1_start_phase4
# CPスレッドを一時停止する
unless @action_battlers.empty?
@cp_thread.stop = true
end
end
#--------------------------------------------------------------------------
# ● 行動順序作成
#--------------------------------------------------------------------------
alias xrxs_bp1_make_action_orders make_action_orders
def make_action_orders
xrxs_bp1_make_action_orders
# 全員のCPを確認
exclude_battler = []
for battler in @action_battlers
# CPが不足している場合は @action_battlers から除外する
if battler.cp < 65535
exclude_battler.push(battler)
end
end
@action_battlers -= exclude_battler
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase4_step1 update_phase4_step1
def update_phase4_step1
# 初期化
@phase4_act_continuation = 0
# 勝敗判定
if judge
@cp_thread.stop
# 勝利または敗北の場合 : メソッド終了
return
end
# 未行動バトラー配列の先頭から取得
@active_battler = @action_battlers[0]
# ステータス更新をCPだけに限定。
@status_window.update_cp_only = true
# ステート更新を禁止。
@active_battler.slip_state_update_ban = true if @active_battler != nil
# 戻す
xrxs_bp1_update_phase4_step1
# @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
if @phase4_step != 2
# リフレッシュ
@status_window.refresh
# 軽量化:たったコレだけΣ(?w?
Graphics.frame_reset
end
# 禁止を解除
@status_window.update_cp_only = false
@active_battler.slip_state_update_ban = false if @active_battler != nil
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias xrxs_bp1_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# 強制アクションでなければ
unless @active_battler.current_action.forcing
# 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# アクションに攻撃を設定
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# 制約が [行動できない] の場合
if @active_battler.restriction == 4
# アクション強制対象のバトラーをクリア
$game_temp.forcing_battler = nil
if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
# ステート自然解除
@active_battler.remove_states_auto
# CP消費
@active_battler.cp -= 65535
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
# ステップ 1 に移行
@phase4_step = 1
return
end
end
# アクションの種別で分岐
case @active_battler.current_action.kind
when 0
# 攻撃?防御?逃げる?何もしない時の共通消費CP
@active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
when 1
# スキル使用時の消費CP
@active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
when 2
# アイテム使用時の消費CP
@active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
end
# ステート自然解除
@active_battler.remove_states_auto
# 呼び戻す
xrxs_bp1_update_phase4_step2
end
  #--------------------------------------------------------------------------
  # ● 基本アクション 結果作成
  #--------------------------------------------------------------------------
  alias xrxs_bp1_make_basic_action_result make_basic_action_result
  def make_basic_action_result
    # 攻撃の場合
    if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
      @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
    end
    # 防御の場合
    if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
      @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
      # @active_battlerの防御をON
      @active_battler.now_guarding = true
    end
    # 敵の逃げるの場合
    if @active_battler.is_a?(Game_Enemy) and
      @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
      @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
    end
    # 何もしないの場合
    if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
      @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
    end
    # 逃げるの場合
    if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
      @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
      # 逃走可能ではない場合
      if $game_temp.battle_can_escape == false
        # ブザー SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 逃走処理
      update_phase2_escape
      return
    end
    # 呼び戻す
    xrxs_bp1_make_basic_action_result
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  #--------------------------------------------------------------------------
  alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  def update_phase4_step6
    # スリップダメージ
    if @active_battler.hp > 0 and @active_battler.slip_damage?
      @active_battler.slip_damage_effect
      @active_battler.damage_pop = true
      # ステータスウィンドウをリフレッシュ
      @status_window.refresh
    end
    # 呼び戻す
    xrxs_bp1_update_phase4_step6
  end
end


#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================  


我的梦幻让我用双手让他飞翔。

Lv1.梦旅人

梦石
0
星屑
155
在线时间
61 小时
注册时间
2011-3-9
帖子
92
2
 楼主| 发表于 2011-3-18 10:33:54 | 只看该作者
顶上去,再次求解
我的梦幻让我用双手让他飞翔。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
390 小时
注册时间
2008-11-7
帖子
352
3
发表于 2011-3-18 11:46:29 | 只看该作者
本帖最后由 枪胜贤者 于 2011-3-18 11:48 编辑
  1. # ▼▲▼ XRXS65. CP制御ターンシステム ver.β ▼▲▼ built 201120
  2. # by 桜雅 在土

  3. #==============================================================================
  4. # □ カスタマイズポイント
  5. #==============================================================================
  6. module XRXS65
  7.   #
  8.   # 「バトルスピード」(数値が高いほど早い)
  9.   #
  10.   SPEED = 1.0
  11.   #
  12.   # 戦闘開始時 CP。 固定値と占有率
  13.   #
  14.   CP_PRESET_FIXNUM = 0
  15.   CP_PRESET_RATIO  = 2.0
  16.   #
  17.   # ターンコントローラ (nil  : カウント/ターンを有効。
  18.   #                     数値 : そのインデックスをもつエネミーが支配)
  19.   #
  20.   TC = 0
  21.   #
  22.   # カウント/ターン (TCが有効な場合は無視)
  23.   #
  24.   CPT = 40
  25.   #
  26.   # CP スキン
  27.   #
  28.   SKIN        = "asd"  # 窗口图形名称(Graphics/Windowskins中添加)
  29.   LINE_HEIGHT =  6        # スキンの"一行"の縦幅[単位:ピクセル]
  30.   #
  31.   # 表示位置セッティング
  32.   #
  33.   X_OFFSET = 144    # 横位置
  34.   Y_OFFSET = 464    # 縦位置
  35.   ALIGN    =   1    #对齐方式(CP条的位置。0:左对齐 1:中央 2:右对齐)
  36.   MAX      =   4    # 確保するサイズ[単位:~人分]
  37.   #
  38.   # アクターコマンドがポップしたときの効果音
  39.   #
  40.   COMMAND_UP_SE = "Audio/SE/046-Book01.ogg"
  41. end

  42. #==============================================================================
  43. # --- CP メーターの描画情報の取得 --- (Game_Battlerにインクルードされます)
  44. #==============================================================================
  45. module XRXS_CP
  46.   #--------------------------------------------------------------------------
  47.   # ○ スキンライン (スキンの何行目を使うか)
  48.   #--------------------------------------------------------------------------
  49.   def cp_linetype
  50.     # CP フルの場合はスキンの 2 行目を使う
  51.     return 2 if self.cp_full?
  52.     # 通常はスキンの 1 行目を使う
  53.     return 1
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ○ メーター量[単位:%]
  57.   #--------------------------------------------------------------------------
  58.   def cp_lineamount
  59.     # 戦闘不能の場合は 0 %として表示させる
  60.      return 0 if self.dead?
  61.     # CP値を%値に変換して返却する
  62.     return 100 * self.cp / self.max_cp
  63.   end
  64. end
  65. #
  66. # カスタマイズポイントここまで。
  67. #------------------------------------------------------------------------------



  68. #==============================================================================
  69. # --- XRXS. CP機構 ---
  70. #==============================================================================
  71. module XRXS_CP_SYSTEM
  72.   #----------------------------------------------------------------------------
  73.   # ○ 合計 AGI の取得
  74.   #----------------------------------------------------------------------------
  75.   def self.total_agi
  76.     total = 0
  77.     for battler in $game_party.actors + $game_troop.enemies
  78.       total += battler.agi
  79.     end
  80.     return total
  81.   end
  82. end
  83. #==============================================================================
  84. # --- バトラーにCP機能を追加 モジュール ---
  85. #==============================================================================
  86. module XRXS_CP
  87.   #--------------------------------------------------------------------------
  88.   # ○ 最大 CP の取得
  89.   #--------------------------------------------------------------------------
  90.   def max_cp
  91.     return 65535
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ○ CP の取得と設定
  95.   #--------------------------------------------------------------------------
  96.   def cp
  97.     return @cp == nil ? @cp = 0 : @cp
  98.   end
  99.   def cp=(n)
  100.     @cp = [[n.to_i, 0].max, self.max_cp].min
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ○ CP 初期設定
  104.   #--------------------------------------------------------------------------
  105.   def cp_preset
  106.     percent = self.max_cp * XRXS65::CP_PRESET_RATIO * (rand(16) + 16) * self.agi / XRXS_CP_SYSTEM.total_agi / 24
  107.     self.cp = XRXS65::CP_PRESET_FIXNUM + percent
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ○ CP カウントアップ
  111.   #--------------------------------------------------------------------------
  112.   def cp_update
  113.     self.cp += XRXS65::SPEED * 4096 * self.agi / XRXS_CP_SYSTEM.total_agi
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ○ CP 満タン?
  117.   #--------------------------------------------------------------------------
  118.   def cp_full?
  119.     return @cp == self.max_cp
  120.   end
  121. end
  122. class Game_Battler
  123.   include XRXS_CP
  124. end
  125. #==============================================================================
  126. # --- ガード機能 ---
  127. #==============================================================================
  128. class Game_Battler
  129.   #--------------------------------------------------------------------------
  130.   # ○ ガードフラグ
  131.   #--------------------------------------------------------------------------
  132.   def guarding=(n)
  133.     @guarding = n
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 防御中判定 [再定義]
  137.   #--------------------------------------------------------------------------
  138.   def guarding?
  139.     return @guarding
  140.   end
  141. end
  142. #==============================================================================
  143. # --- アクター「コマンド入力可能判定」:CPがないとコマンドしない ---
  144. #==============================================================================
  145. module XRXS_CP_INPUTABLE
  146.   def inputable?
  147.     return (self.cp_full? and super)
  148.   end
  149. end
  150. class Game_Actor < Game_Battler
  151.   include XRXS_CP_INPUTABLE
  152. end
  153. #==============================================================================
  154. # --- エネミー「行動可能判定」:CPがないとコマンドしない ---
  155. #==============================================================================
  156. module XRXS_CP_MOVABLE
  157.   def movable?
  158.     return (self.cp_full? and super)
  159.   end
  160. end
  161. class Game_Enemy < Game_Battler
  162.   include XRXS_CP_MOVABLE
  163. end
  164. #==============================================================================
  165. # --- 戦闘時 CPカウント ---
  166. #==============================================================================
  167. module XRXS_CP_Battle
  168.   #--------------------------------------------------------------------------
  169.   # ○ パーティ全員の CP を初期設定
  170.   #--------------------------------------------------------------------------
  171.   def cp_preset_party
  172.     for actor in $game_party.actors
  173.       actor.cp_preset
  174.     end
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ○ トループ全員の CP を初期設定
  178.   #--------------------------------------------------------------------------
  179.   def cp_preset_troop
  180.     for enemy in $game_troop.enemies
  181.       enemy.cp_preset
  182.     end
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ○ バトラー全員の CP をカウントアップ
  186.   #--------------------------------------------------------------------------
  187.   def cp_update
  188.     for battler in $game_party.actors + $game_troop.enemies
  189.       battler.cp_update
  190.     end
  191.   end
  192. end
  193. class Scene_Battle
  194.   include XRXS_CP_Battle
  195. end
  196. #==============================================================================
  197. # ■ Scene_Battle
  198. #==============================================================================
  199. class Scene_Battle
  200.   #--------------------------------------------------------------------------
  201.   # ● メイン処理
  202.   #--------------------------------------------------------------------------
  203.   alias xrxs65_main main
  204.   def main
  205.     # エクストラスプライトの初期化
  206.     @extra_sprites = [] if @extra_sprites == nil
  207.     # CP の初期化
  208.     cp_preset_party
  209.     # CP メーターの作成
  210.     @cp_meters = CP_Meters.new
  211.     # CP メーターをエクストラスプライトへ登録
  212.     @extra_sprites.push(@cp_meters)
  213.     # 呼び戻す
  214.     xrxs65_main
  215.     # メーターの解放
  216.     @cp_meters.dispose
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● プレバトルフェーズ開始
  220.   #--------------------------------------------------------------------------
  221.   alias xrxs65_start_phase1 start_phase1
  222.   def start_phase1
  223.     # 呼び戻す
  224.     xrxs65_start_phase1
  225.     # CP の初期化
  226.     cp_preset_troop
  227.     # CP メーターの更新
  228.     @cp_meters.refresh
  229.     # インデックスを計算
  230.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  231.     # アクターコマンドウィンドウに追加
  232. #    @actor_command_window.add_command("逃げる")
  233. #    if !$game_temp.battle_can_escape
  234. #      @actor_command_window.disable_item(@cp_escape_actor_command_index)
  235. #    end
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● パーティコマンドフェーズ開始
  239.   #--------------------------------------------------------------------------
  240.   alias xrxs65_start_phase2 start_phase2
  241.   def start_phase2
  242.     # 呼び戻す
  243.     xrxs65_start_phase2
  244.     # パーティコマンドウィンドウを無効化
  245. #    @party_command_window.active  = false
  246. #    @party_command_window.visible = false
  247.     # 強制的にフェイズ 2 を保持
  248.     @phase = 2
  249.     # ただし、既に行動可能者が存在する場合は 3 へ
  250.     start_phase3 if anybody_movable?
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ○ CP制での ターンのカウント
  254.   #--------------------------------------------------------------------------
  255.   def cp_turn_count
  256.     $game_temp.battle_turn += 1
  257.     # バトルイベントの全ページを検索
  258.     for index in 0...$data_troops[@troop_id].pages.size
  259.       # このページのスパンが [ターン] の場合
  260.       if $data_troops[@troop_id].pages[index].span == 1
  261.         # 実行済みフラグをクリア
  262.         $game_temp.battle_event_flags[index] = false
  263.       end
  264.     end
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● フレーム更新 (パーティコマンドフェーズ)
  268.   #--------------------------------------------------------------------------
  269.   alias xrxs65_update_phase2 update_phase2
  270.   def update_phase2
  271.     # パーティコマンドウィンドウのインデックスを無効化
  272. #    @party_command_window.index = -1
  273.     # 呼び戻す
  274.     xrxs65_update_phase2
  275.     # 例外補正
  276.     @turn_count_time = 1 if @turn_count_time == nil
  277.     # ターンのカウント
  278.     if @turn_count_time > 0
  279.       @turn_count_time -= 1
  280.       if @turn_count_time == 0
  281.         cp_turn_count
  282.         @turn_count_time = XRXS65::CPT if XRXS65::TC == nil
  283.       end
  284.     end
  285.     # CP のフレーム更新
  286.     cp_update
  287.     @cp_meters.refresh
  288.     # フル CP のバトラーが存在する場合、ターン開始
  289.     start_phase3 if anybody_movable?
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ○ フル CP バトラーが存在するか?
  293.   #--------------------------------------------------------------------------
  294.   def anybody_movable?
  295.     for battler in $game_party.actors + $game_troop.enemies
  296.       return true if battler.cp_full?
  297.     end
  298.     return false
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # ● アクターコマンドウィンドウのセットアップ
  302.   #--------------------------------------------------------------------------
  303.   alias xrxs65_phase3_setup_command_window phase3_setup_command_window
  304.   def phase3_setup_command_window
  305.     # 効果音の再生
  306.     Audio.se_play(XRXS65::COMMAND_UP_SE) rescue nil
  307.     # 呼び戻す
  308.     xrxs65_phase3_setup_command_window
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  312.   #--------------------------------------------------------------------------
  313.   alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  314.   def update_phase3_basic_command
  315.     # 按下C键的情况下
  316. #    if Input.trigger?(Input::C)
  317.       # 同伴指令窗口光标位置分支
  318. #      case @actor_command_window.index
  319. #      when @cp_escape_actor_command_index # 逃げる
  320. #        if $game_temp.battle_can_escape
  321.           # 決定 SE を演奏
  322. #          $game_system.se_play($data_system.decision_se)
  323.           # アクションを設定
  324. #          @active_battler.current_action.kind = 0
  325. #          @active_battler.current_action.basic = 4
  326.           # 次のアクターのコマンド入力へ
  327. #          phase3_next_actor
  328. #        else
  329.           # ブザー SE を演奏
  330. #          $game_system.se_play($data_system.buzzer_se)
  331. #        end
  332. #        return
  333. #      end
  334. #    end
  335.     # 呼び戻す
  336.     xrxs_bsp1_update_phase3_basic_command
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● メインフェーズ開始
  340.   #--------------------------------------------------------------------------
  341.   alias xrxs65_start_phase4 start_phase4
  342.   def start_phase4
  343.     # ターン数を引くことによって擬似的にカウントに変化を起こさせない
  344.     $game_temp.battle_turn -= 1
  345.     # フラグを退避
  346.     save_flags = $game_temp.battle_event_flags.dup
  347.     # 呼び戻す
  348.     xrxs65_start_phase4
  349.     # フラグを復旧
  350.     $game_temp.battle_event_flags = save_flags
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● 行動順序作成
  354.   #--------------------------------------------------------------------------
  355.   alias xrxs65_make_action_orders make_action_orders
  356.   def make_action_orders
  357.     # 呼び戻す
  358.     xrxs65_make_action_orders
  359.     # CPが不足している場合は @action_battlers から除外する
  360.     for battler in @action_battlers.dup
  361.       @action_battlers.delete(battler) unless battler.cp_full?
  362.     end
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  366.   #--------------------------------------------------------------------------
  367.   alias xrxs65_update_phase4_step2 update_phase4_step2
  368.   def update_phase4_step2
  369.     # ガードの解除
  370.     @active_battler.guarding = false
  371.     # CPの消費
  372.     @active_battler.cp = 0
  373.     # CP メーターの更新
  374.     @cp_meters.refresh
  375.     # 呼び戻す
  376.     xrxs65_update_phase4_step2
  377.     # 例外補正
  378.     return if @active_battler == nil
  379.     # ターンコントローラ
  380.     if @active_battler.is_a?(Game_Enemy) and @active_battler.index == XRXS65::TC
  381.       cp_turn_count
  382.     end
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ● 基本アクション 結果作成
  386.   #--------------------------------------------------------------------------
  387.   alias xrxs65_make_basic_action_result make_basic_action_result
  388.   def make_basic_action_result
  389.     # 呼び戻す
  390.     xrxs65_make_basic_action_result
  391.     # 防御の場合
  392.     @active_battler.guarding = false
  393.     if @active_battler.current_action.basic == 1
  394.       @active_battler.guarding = true
  395.       return
  396.     end
  397.     # パーティの逃亡の場合
  398.     if @active_battler.current_action.basic == 4
  399.       # 逃走可能ではない場合
  400.       if $game_temp.battle_can_escape == false
  401.         # ブザー SE を演奏
  402.         $game_system.se_play($data_system.buzzer_se)
  403.         return
  404.       end
  405.       # パーティ全員の CP をクリア
  406.       for actor in $game_party.actors
  407.         actor.cp = 0
  408.       end
  409.       # CP メーターの更新
  410.       @cp_meters.refresh
  411.       # 逃走処理
  412.       update_phase2_escape
  413.       return
  414.     end
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  418.   #--------------------------------------------------------------------------
  419.   alias xrxs65_update_phase4_step5 update_phase4_step5
  420.   def update_phase4_step5
  421.     # 呼び戻す
  422.     xrxs65_update_phase4_step5
  423.     # CP メーターの更新
  424.     @cp_meters.refresh
  425.   end
  426. end
  427. #==============================================================================
  428. # --- CP メーターをまとめて管理するクラス、表示関係はすべてココ ---
  429. #==============================================================================
  430. class CP_Meters
  431.   #--------------------------------------------------------------------------
  432.   # ○ オブジェクト初期化
  433.   #--------------------------------------------------------------------------
  434.   def initialize
  435.     # メーター群の生成
  436.     @meters = []
  437.     for i in 0...$game_party.actors.size
  438.       make_meter(i)
  439.     end
  440.     refresh
  441.   end
  442.   #--------------------------------------------------------------------------
  443.   # ○ リフレッシュ
  444.   #--------------------------------------------------------------------------
  445.   def refresh
  446.     # 戦闘メンバー数の変更を判別
  447.     for i in @meters.size...$game_party.actors.size
  448.       make_meter(i)
  449.     end
  450.     for i in [email protected]
  451.       @meters[i].dispose
  452.       @meters[i] = nil
  453.     end
  454.     @meters.compact!
  455.     # 表示更新
  456.     for i in 0...$game_party.actors.size
  457.       actor = $game_party.actors[i]
  458.       @meters[i].line   = actor.cp_linetype
  459.       @meters[i].amount = actor.cp_lineamount
  460.     end
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # ○ メーターひとつの生成
  464.   #--------------------------------------------------------------------------
  465.   def make_meter(i)
  466.     # スキンの取得
  467.     skin = RPG::Cache.windowskin(XRXS65::SKIN)
  468.     #
  469.     space = 640 / XRXS65::MAX
  470.     case XRXS65::ALIGN
  471.     when 0
  472.       actor_x = i * space + 4
  473.     when 1
  474.       actor_x = (space * ((XRXS65::MAX - $game_party.actors.size)/2.0 + i)).floor
  475.     when 2
  476.       actor_x = (i + XRXS65::MAX - $game_party.actors.size) * space + 4
  477.     end
  478.     meter = MeterSprite.new(skin, XRXS65::LINE_HEIGHT)
  479.     meter.x = actor_x + XRXS65::X_OFFSET - skin.width
  480.     meter.y = XRXS65::Y_OFFSET
  481.     @meters[i] = meter
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ○ 可視状態
  485.   #--------------------------------------------------------------------------
  486.   def visible=(b)
  487.     @meters.each{|sprite| sprite.visible = b }
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ○ 解放
  491.   #--------------------------------------------------------------------------
  492.   def dispose
  493.     @meters.each{|sprite| sprite.dispose }
  494.   end
  495. end
  496. #==============================================================================
  497. # --- XRXS. レクタンギュラーメーター表示?極 ---
  498. #==============================================================================
  499. class MeterSprite < Sprite
  500.   #--------------------------------------------------------------------------
  501.   # ○ オブジェクト初期化
  502.   #--------------------------------------------------------------------------
  503.   def initialize(skin, line_height)
  504.     @skin   = skin
  505.     @width  = @skin.width
  506.     @height = line_height
  507.     @line   = 1
  508.     @amount = 0
  509.     @base_sprite = Sprite.new
  510.     @base_sprite.bitmap = @skin
  511.     @base_sprite.src_rect.set(0, 0, @width, @height)
  512.     @base_sprite.z = 9000 #601
  513.     super()
  514.     self.z = @base_sprite.z + 1
  515.     self.bitmap = @skin
  516.     self.line = 1
  517.   end
  518.   #--------------------------------------------------------------------------
  519.   # ○ 値の設定
  520.   #--------------------------------------------------------------------------
  521.   def line=(n)
  522.     @line = n
  523.     refresh
  524.   end
  525.   def amount=(n)
  526.     @amount = n
  527.     refresh
  528.   end
  529.   def refresh
  530.     self.src_rect.set(0, @line * @height, @width * @amount / 100, @height)
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ○ 座標の設定
  534.   #--------------------------------------------------------------------------
  535.   def x=(n)
  536.     super
  537.     @base_sprite.x = n
  538.   end
  539.   def y=(n)
  540.     super
  541.     @base_sprite.y = n
  542.   end
  543.   #--------------------------------------------------------------------------
  544.   # ○ 解放
  545.   #--------------------------------------------------------------------------
  546.   def dispose
  547.     @base_sprite.dispose
  548.     super
  549.   end
  550. end
复制代码
修改CP的位置35-37行
  1. # ▽△▽ XRXS. コマンドウィンドウ追加機構 ▽△▽
  2. # by 桜雅 在土

  3. #==============================================================================
  4. # --- XRXS.コマンドウィンドウ追加機構 ---
  5. #==============================================================================
  6. module XRXS_Window_Command
  7.   #--------------------------------------------------------------------------
  8.   # ○ コマンドを追加
  9.   #--------------------------------------------------------------------------
  10.   def add_command(command)
  11.     #
  12.     # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  13.     #
  14.     @disabled = [] if @disabled.nil?
  15.     if @commands.size != @disabled.size
  16.       for i in [email protected]
  17.         @disabled[i] = false
  18.       end
  19.     end
  20.     #
  21.     # 追加
  22.     #
  23.     @commands.push(command)
  24.     @disabled.push(false)
  25.     @item_max = @commands.size
  26.     self.y -= 32
  27.     self.height += 32
  28.     self.contents.dispose
  29.     self.contents = nil
  30.     self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  31.     refresh
  32.     for i in [email protected]
  33.       if @disabled[i]
  34.         disable_item(i)
  35.       end
  36.     end
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ○ 項目の無効化
  40.   #     index : 項目番号
  41.   #--------------------------------------------------------------------------
  42.   def disable_item(index)
  43.     @disabled = [] if @disabled.nil?
  44.     @disabled[index] = true
  45.     draw_item(index, disabled_color)
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ○ 項目の有効化
  49.   #     index : 項目番号
  50.   #--------------------------------------------------------------------------
  51.   def enable_item(index)
  52.     @disabled = [] if @disabled.nil?
  53.     @disabled[index] = false
  54.     draw_item(index, normal_color)
  55.   end
  56. end
  57. class Window_Command < Window_Selectable
  58.   #--------------------------------------------------------------------------
  59.   # ○ インクルード
  60.   #--------------------------------------------------------------------------
  61.   include XRXS_Window_Command
  62.   #--------------------------------------------------------------------------
  63.   # ● 項目の無効化
  64.   #--------------------------------------------------------------------------
  65.   def disable_item(index)
  66.     super
  67.   end
  68. end

复制代码
  1. # ▼▲▼ XRXS65A. CP制御ターンシステム「シンセ・ゲージ」 ▼▲▼ built201202
  2. # by 桜雅 在土

  3. #==============================================================================
  4. # □ カスタマイズポイント
  5. #==============================================================================
  6. class XRXS65A
  7.   #--------------------------------------------------------------------------
  8.   # 「アイコン設定」
  9.   #--------------------------------------------------------------------------
  10.   DEFAULT = "怪物" # 默认的CP图标
  11.   # 角色CP头像设置  記述方式 : 角色ID=>"图标名称"(ICON文件夹中)
  12.   ICONS = {
  13.     1=>"5584-1",
  14.     2=>"凌纱",
  15.     3=>"5585-1",
  16.     4=>"哪吒",
  17.     5=>"5588-1",
  18.     6=>"天河",
  19.     7=>"5586-1",
  20.     8=>"天化",
  21.     9=>"敖衍"
  22.   }
  23.   # アイコンハッシュE  記述方式 : エネミーID=>アイコン名
  24.   ICONE = {
  25.     1=>"018",
  26.     2=>"019",
  27.     3=>"007",
  28.     4=>"006",
  29.     5=>"驮龙兽",
  30.     6=>"067",
  31.     7=>"091",
  32.     8=>"079",
  33.     9=>"吕岳",
  34.     10=>"士兵",
  35.     11=>"黄蜂",
  36.     12=>"蜂蛹",
  37.     13=>"草妖",
  38.     14=>"枯藤",
  39.     15=>"食人藤",
  40.     16=>"红蛇",
  41.     17=>"绿蛇",
  42.     18=>"103",
  43.     19=>"海螺",
  44.     20=>"紫魔人",
  45.     21=>"白虎",
  46.     22=>"022",
  47.     23=>"蜥蜴",
  48.     24=>"毒蝎",
  49.     25=>"023",
  50.     26=>"绿萝仙子",
  51.     27=>"天女",
  52.     28=>"月姬",
  53.     29=>"058",
  54.     30=>"059",
  55.     31=>"天禄",
  56.     32=>"天禄",
  57.     33=>"仙鹤",
  58.     34=>"莲台",
  59.     35=>"归邪",
  60.     36=>"老将",
  61.     37=>"老将",
  62.     38=>"玄霄",
  63.     39=>"海星",
  64.     40=>"利齿狼",
  65.     41=>"毒菇",
  66.     42=>"037",
  67.     43=>"013",
  68.     44=>"015",
  69.     45=>"雷妖",
  70.     46=>"殷郊",
  71.     47=>"038",
  72.     48=>"雷妖",
  73.     49=>"脚妖",
  74.     50=>"白猿",
  75.     51=>"失羽",
  76.     52=>"狐灵",
  77.     53=>"120",
  78.     54=>"剑力士",
  79.     55=>"063",
  80.     56=>"山神·影",
  81.     57=>"风神·影",
  82.     58=>"火神·影",
  83.     59=>"水神·影",
  84.     60=>"雷神·影",
  85.     61=>"龙",
  86.     62=>"夜鹰",
  87.     63=>"094",
  88.     64=>"藤妖",
  89.     65=>"九头蛇",
  90.     66=>"草头妖",
  91.     67=>"危",
  92.     68=>"危",
  93.     69=>"危",
  94.     70=>"危",
  95.     71=>"危",
  96.     72=>"冰蟾",
  97.     73=>"冰晶蜓",
  98.     74=>"单复眼怪",
  99.     75=>"黑毛妖",
  100.     76=>"005",
  101.     77=>"025",
  102.     78=>"火云雾",
  103.     79=>"030",
  104.     80=>"031",
  105.     81=>"符木人",
  106.     82=>"符木人",
  107.     83=>"032",
  108.     84=>"雪灵",
  109.     85=>"赤脚大仙",
  110.     86=>"人面兽",
  111.     87=>"人型蛛",
  112.     88=>"田螺",
  113.     89=>"三人首",
  114.     90=>"瘟神",
  115.     91=>"菜刀婆婆",
  116.     92=>"利爪魔女",
  117.     93=>"051",
  118.     94=>"049",
  119.     95=>"050",
  120.     96=>"050",
  121.     97=>"魔猩猩",
  122.     98=>"昆虫",
  123.     99=>"060",
  124.     100=>"吕岳",
  125.     101=>"道士",
  126.     102=>"老将",
  127.     103=>"道士",
  128.     104=>"道士",
  129.     105=>"鸟人",
  130.     106=>"冰蟾",
  131.     109=>"5629-1",
  132.     110=>"5629-1",
  133.     111=>"5630-1",
  134.     112=>"5628-1",
  135.     113=>"032",
  136.     114=>"032",
  137.     115=>"032",
  138.     116=>"032",
  139.     118=>"5626-1",
  140.     119=>"032",
  141.     121=>"蜥蜴",
  142.     122=>"毒蝎",
  143.     123=>"032",
  144.     124=>"032",
  145.     125=>"121",
  146.     131=>"018",
  147.     132=>"019",
  148.     154=>"乌云",
  149.     155=>"血云雾",
  150.     156=>"绿蛤蟆",
  151.     157=>"树妖",
  152.     158=>"小树妖",
  153.     159=>"虬",
  154.     160=>"蜘蛛",
  155.     161=>"黑无常",
  156.     162=>"白无常",
  157.     163=>"虬",
  158.     164=>"大草团",
  159.     165=>"鼓",
  160.     166=>"虬",
  161.     167=>"鬼",
  162.     168=>"女将"
  163.   }
  164.   #--------------------------------------------------------------------------
  165.   # 「シンセ・ゲージ」
  166.   #--------------------------------------------------------------------------
  167.   SKIN = "123"  # 窗口图形
  168.   X    =  320         # X 座標
  169.   Y    =  4         # Y 座標
  170. end
  171. #==============================================================================
  172. # --- CP メーターをまとめて管理するクラス、表示関係はすべてココ --- [再定義]
  173. #==============================================================================
  174. class CP_Meters
  175.   #--------------------------------------------------------------------------
  176.   # ○ オブジェクト初期化
  177.   #--------------------------------------------------------------------------
  178.   def initialize
  179.     # シンセゲージの生成
  180.     @base = Sprite.new
  181.     @base.bitmap = RPG::Cache.windowskin(XRXS65A::SKIN).dup
  182.     @base.x = XRXS65A::X + 10
  183.     @base.y = XRXS65A::Y + 8
  184.     @base.z = XRXS65A::X + 9000
  185.     @width  = @base.bitmap.width - 20
  186.     @height = @base.bitmap.height
  187.     @icon_set = []
  188.     refresh
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ○ リフレッシュ
  192.   #--------------------------------------------------------------------------
  193.   def refresh
  194.     # 生成すべきバトラーの取得
  195.     need_initializes = []
  196.     for battler in $game_party.actors + $game_troop.enemies
  197.       exist = false
  198.       for set in @icon_set
  199.         exist |= (set[1] == battler)
  200.       end
  201.       need_initializes.push(battler) unless exist
  202.     end
  203.     for battler in need_initializes
  204.       iconname = nil
  205.       if battler.is_a?(Game_Actor)
  206.         iconname = XRXS65A::ICONS[battler.id]
  207.       else
  208.         iconname = XRXS65A::ICONE[battler.id]
  209.       end
  210.       if iconname == nil
  211.         iconname = XRXS65A::DEFAULT
  212.       end
  213.       sprite = Sprite.new
  214.       sprite.bitmap = RPG::Cache.icon(iconname).dup
  215.       sprite.y = XRXS65A::Y + @height / 2 - 19
  216.       @icon_set.push([sprite, battler])
  217.     end
  218.     # 更新
  219.     for set in @icon_set
  220.       set[0].x = XRXS65A::X + @width * set[1].cp / set[1].max_cp - 12
  221.       set[0].z = set[0].x + 9000
  222.       set[0].visible = false if set[1].dead? or !set[1].exist?
  223.       set[0].visible = true unless set[1].dead? or !set[1].exist?
  224.     end
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ○ 可視状態
  228.   #--------------------------------------------------------------------------
  229.   def visible=(b)
  230.     @base.visible = b
  231.     @icon_set.each{|set| set[0].visible = b }
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ○ 解放
  235.   #--------------------------------------------------------------------------
  236.   def dispose
  237.     @base.dispose
  238.     @icon_set.each{|set| set[0].dispose }
  239.   end
  240. end

复制代码
怒气槽和CP没有关系
怒气槽这样做http://rpg.blue/thread-158339-1-1.html

评分

参与人数 1星屑 +400 收起 理由
「旅」 + 400

查看全部评分

2024到此一游
《仙剑奇侠传四外传卷云残曦碎星海》2012-2024跨越12年的制作
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 05:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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