查看: 1370|回复: 5

[已经过期] cp槽的问题

[复制链接]
梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
发表于 2015-12-4 09:55:04 | 显示全部楼层 |阅读模式

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

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

×
怎样能使人物在CP槽前面显示,CP槽压住人物,看起来不太舒服
333333.jpg

素材区好人

梦石
5
星屑
12564
在线时间
4347 小时
注册时间
2011-7-21
回帖
2264

超评测参与极短28参与极短27参与极短26参与极短25参与极短24参与极短23参与极短22参与极短21参与

发表于 2015-12-4 17:12:32 | 显示全部楼层
具体你想怎么做?
现在不是已经在最前面显示了吗?
回复

使用道具 举报

梦石
0
星屑
9716
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2015-12-4 17:43:37 | 显示全部楼层
起码把CP槽的脚本贴上来吧……
回复

使用道具 举报

梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
 楼主| 发表于 2015-12-4 18:44:50 | 显示全部楼层
本帖最后由 fjm 于 2015-12-4 18:47 编辑

CP槽把人物头遮住了,看起来很不舒服
  1. #========================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #========================================================================
  4. #========================================================================
  5. # ▼▲▼ XRXS_BP 1. CP制導入 ver..23 ▼▲▼
  6. # by 桜雅 在土, 和希
  7. #------------------------------------------------------------------------
  8. # □ カスタマイズポイント
  9. #========================================================================
  10. module XRXS_BP1
  11.   #
  12.   # 对齐方式。0:左 1:中央 2:右
  13.   #
  14.   ALIGN = 0
  15.   #
  16.   # 人数
  17.   #
  18.   MAX = 4
  19. end
  20. class Scene_Battle_CP
  21.   #
  22.   # 战斗速度
  23.   #
  24.   BATTLE_SPEED = 2.0
  25.   #
  26.   # 战斗开始的时候气槽百分比
  27.   #
  28.   START_CP_PERCENT = 0
  29. end
  30. class Scene_Battle
  31.   # 效果音效,可以自己添加
  32.   DATA_SYSTEM_COMMAND_UP_SE = ""
  33.   # 各项数值功能消耗的CP值
  34.   CP_COST_BASIC_ACTIONS = 0 # 基础共同
  35.   CP_COST_SKILL_ACTION = 65535 # 技能
  36.   CP_COST_ITEM_ACTION = 65535 # 物品
  37.   CP_COST_BASIC_ATTACK = 65535 # 攻撃
  38.   CP_COST_BASIC_GUARD = 32768 # 防御
  39.   CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
  40.   CP_COST_BASIC_ESCAPE = 65535 # 逃跑
  41. end
  42. #========================================================================
  43. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  44. #------------------------------------------------------------------------
  45. # Window_Commandクラスに add_command メソッドを追加します。
  46. #========================================================================
  47. module XRXS_Window_Command_Add_Command
  48.   #----------------------------------------------------------------------
  49.   # ○ コマンドを追加
  50.   #----------------------------------------------------------------------
  51.   def add_command(command)
  52.     # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  53.     #
  54.     if @disabled == nil
  55.       @disabled = []
  56.     end
  57.     if @commands.size != @disabled.size
  58.       for i in 0...@commands.size
  59.         @disabled[i] = false
  60.       end
  61.     end
  62.     #
  63.     # 追加
  64.     #
  65.     @commands.push(command)
  66.     @disabled.push(false)
  67.     @item_max = @commands.size
  68.     self.y -= 32
  69.     self.height += 32
  70.     self.contents.dispose
  71.     self.contents = nil
  72.     self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  73.     refresh
  74.     for i in 0...@commands.size
  75.       if @disabled[i]
  76.         disable_item(i)
  77.       end
  78.     end
  79.   end
  80.   #----------------------------------------------------------------------
  81.   # ○ 項目の無効化
  82.   # index : 項目番号
  83.   #----------------------------------------------------------------------
  84.   def disable_item(index)
  85.     if @disabled == nil
  86.       @disabled = []
  87.     end
  88.     @disabled[index] = true
  89.     draw_item(index, disabled_color)
  90.   end
  91. end
  92. class Window_Command < Window_Selectable
  93.   #----------------------------------------------------------------------
  94.   # ○ インクルード
  95.   #----------------------------------------------------------------------
  96.   include XRXS_Window_Command_Add_Command
  97.   #----------------------------------------------------------------------
  98.   # ● 項目の無効化
  99.   # index : 項目番号
  100.   #----------------------------------------------------------------------
  101.   def disable_item(index)
  102.     super
  103.   end
  104. end
  105. #========================================================================
  106. # □ Scene_Battle_CP
  107. #========================================================================
  108. class Scene_Battle_CP
  109.   #----------------------------------------------------------------------
  110.   # ○ 公開インスタンス変数
  111.   #----------------------------------------------------------------------
  112.   attr_accessor :stop # CP加算ストップ
  113.   #----------------------------------------------------------------------
  114.   # ○ オブジェクトの初期化
  115.   #----------------------------------------------------------------------
  116.   def initialize
  117.     @battlers = []
  118.     @cancel = false
  119.     @stop = false
  120.     @agi_total = 0
  121.     # 配列 count_battlers を初期化
  122.     count_battlers = []
  123.     # エネミーを配列 count_battlers に追加
  124.     for enemy in $game_troop.enemies
  125.       count_battlers.push(enemy)
  126.     end
  127.     # アクターを配列 count_battlers に追加
  128.     for actor in $game_party.actors
  129.       count_battlers.push(actor)
  130.     end
  131.     for battler in count_battlers
  132.       @agi_total += battler.agi
  133.     end
  134.     for battler in count_battlers
  135.       battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
  136.     end
  137.   end
  138.   #----------------------------------------------------------------------
  139.   # ○ CPカウントアップ
  140.   #----------------------------------------------------------------------
  141.   def update
  142.     # ストップされているならリターン
  143.     return if @stop
  144.     #
  145.     for battler in $game_party.actors + $game_troop.enemies
  146.       # 行動出来なければ無視
  147.       if battler.dead? == true
  148.         battler.cp = 0
  149.         next
  150.       end
  151.       battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  152.     end
  153.   end
  154.   #----------------------------------------------------------------------
  155.   # ○ CPカウントの開始
  156.   #----------------------------------------------------------------------
  157.   def stop
  158.     @cancel = true
  159.     if @cp_thread != nil then
  160.       @cp_thread.join
  161.       @cp_thread = nil
  162.     end
  163.   end
  164. end
  165. #========================================================================
  166. # ■ Game_Battler
  167. #========================================================================
  168. class Game_Battler
  169.   attr_accessor :now_guarding # 現在防御中フラグ
  170.   attr_accessor :cp # 現在CP
  171.   attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  172.   #----------------------------------------------------------------------
  173.   # ○ CP の変更
  174.   #-----------------------------------------------------------------------
  175.   def cp=(p)
  176.     @cp = [[p, 0].max, 65535].min
  177.   end
  178.   #----------------------------------------------------------------------
  179.   # ● 防御中判定 [ 再定義 ]
  180.   #----------------------------------------------------------------------
  181.   def guarding?
  182.     return @now_guarding
  183.   end
  184.   #----------------------------------------------------------------------
  185.   # ● コマンド入力可能判定
  186.   #----------------------------------------------------------------------
  187.   alias xrxs_bp1_inputable? inputable?
  188.   def inputable?
  189.     bool = xrxs_bp1_inputable?
  190.     return (bool and (@cp >= 65535))
  191.   end
  192.   #----------------------------------------------------------------------
  193.   # ● ステート [スリップダメージ] 判定
  194.   #----------------------------------------------------------------------
  195.   alias xrxs_bp1_slip_damage? slip_damage?
  196.   def slip_damage?
  197.     return false if @slip_state_update_ban
  198.     return xrxs_bp1_slip_damage?
  199.   end
  200.   #----------------------------------------------------------------------
  201.   # ● ステート自然解除 (ターンごとに呼び出し)
  202.   #----------------------------------------------------------------------
  203.   alias xrxs_bp1_remove_states_auto remove_states_auto
  204.   def remove_states_auto
  205.     return if @slip_state_update_ban
  206.     xrxs_bp1_remove_states_auto
  207.   end
  208. end
  209. #========================================================================
  210. # ■ Game_Actor
  211. #========================================================================
  212. class Game_Actor < Game_Battler
  213.   #----------------------------------------------------------------------
  214.   # ● セットアップ
  215.   #----------------------------------------------------------------------
  216.   alias xrxs_bp1_setup setup
  217.   def setup(actor_id)
  218.     xrxs_bp1_setup(actor_id)
  219.     @cp = 0
  220.     @now_guarding = false
  221.     @slip_state_update_ban = false
  222.   end
  223. end
  224. #========================================================================
  225. # ■ Game_Enemy
  226. #========================================================================
  227. class Game_Enemy < Game_Battler
  228.   #----------------------------------------------------------------------
  229.   # ● オブジェクト初期化
  230.   #----------------------------------------------------------------------
  231.   alias xrxs_bp1_initialize initialize
  232.   def initialize(troop_id, member_index)
  233.     xrxs_bp1_initialize(troop_id, member_index)
  234.     @cp = 0
  235.     @now_guarding = false
  236.     @slip_state_update_ban = false
  237.   end
  238. end
  239. class Window_All < Window_Base
  240.   def initialize
  241.     super(0,0,640,480)
  242.    self.opacity = 0
  243.     self.contents = Bitmap.new(width - 32, height - 32)
  244.     refresh
  245.   end
  246.   def refresh
  247.     self.contents.clear
  248.     for actor in $game_troop.enemies
  249.       next if !actor.exist?
  250.       draw_actor_cp_meter(actor, actor.screen_x-50, actor.screen_y-50, 60, 0)
  251.     end
  252.   end
  253.   #----------------------------------------------------------------------
  254.   # ○ CPメーター の描画
  255.   #----------------------------------------------------------------------
  256.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  257.     self.contents.font.color = system_color
  258.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  259.     if actor.cp == nil
  260.       actor.cp = 0
  261.     end
  262.     w = width * [actor.cp,65535].min / 65535
  263.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  264.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  265.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  266.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  267.   end  
  268. end
  269. #========================================================================
  270. # ■ Window_BattleStatus
  271. #========================================================================
  272. class Window_BattleStatus < Window_Base
  273.   #-----------------------------------------------------------------------
  274.   # ○ 公開インスタンス変数
  275.   #----------------------------------------------------------------------
  276.   attr_accessor :update_cp_only # CPメーターのみの更新
  277.   #----------------------------------------------------------------------
  278.   # ● オブジェクト初期化
  279.   #----------------------------------------------------------------------
  280.   alias xrxs_bp1_initialize initialize
  281.   def initialize
  282.     @update_cp_only = false
  283.     @wall = Window_All.new
  284.     xrxs_bp1_initialize
  285.   end
  286.   def dispose
  287.     super
  288.     @wall.dispose
  289.   end
  290.   #----------------------------------------------------------------------
  291.   # ● リフレッシュ
  292.   #----------------------------------------------------------------------
  293.   alias xrxs_bp1_refresh refresh
  294.   def refresh
  295.     unless @update_cp_only
  296.       xrxs_bp1_refresh
  297.     end
  298.     refresh_cp
  299.     @wall.refresh
  300.   end
  301.   #----------------------------------------------------------------------
  302.   # ○ リフレッシュ(CPのみ)
  303.   #----------------------------------------------------------------------
  304.   def refresh_cp
  305.     for i in 0...$game_party.actors.size
  306.       actor = $game_party.actors[i]
  307.       width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  308.       space = self.width / XRXS_BP1::MAX
  309.       case XRXS_BP1::ALIGN
  310.       when 0
  311.         actor_x = i * space + 4
  312.       when 1
  313.         actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  314.       when 2
  315.         actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  316.       end
  317.       actor_x += self.x
  318.       draw_actor_cp_meter(actor, actor_x, 96, width, 0)
  319.     end
  320.   end
  321.   #----------------------------------------------------------------------
  322.   # ○ CPメーター の描画
  323.   #----------------------------------------------------------------------
  324.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  325.     self.contents.font.color = system_color
  326.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  327.     if actor.cp == nil
  328.       actor.cp = 0
  329.     end
  330.     w = width * [actor.cp,65535].min / 65535
  331.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  332.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  333.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  334.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  335.   end
  336. end
  337. #========================================================================
  338. # ■ Scene_Battle
  339. #========================================================================
  340. class Scene_Battle
  341.   #----------------------------------------------------------------------
  342.   # ● フレーム更新
  343.   #----------------------------------------------------------------------
  344.   alias xrxs_bp1_update update
  345.   def update
  346.     xrxs_bp1_update
  347.     # CP更新
  348.     @cp_thread.update
  349.   end
  350.   #----------------------------------------------------------------------
  351.   # ● バトル終了
  352.   # result : 結果 (0:勝利 1:敗北 2:逃走)
  353.   #----------------------------------------------------------------------
  354.   alias xrxs_bp1_battle_end battle_end
  355.   def battle_end(result)
  356.     # CPカウントを停止する
  357.     @cp_thread.stop
  358.     # 呼び戻す
  359.     xrxs_bp1_battle_end(result)
  360.   end
  361.   #----------------------------------------------------------------------
  362.   # ● プレバトルフェーズ開始
  363.   #----------------------------------------------------------------------
  364.   alias xrxs_bp1_start_phase1 start_phase1
  365.   def start_phase1
  366.     @agi_total = 0
  367.     # CP加算を開始する
  368.     @cp_thread = Scene_Battle_CP.new
  369.     # インデックスを計算
  370.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  371.     # アクターコマンドウィンドウに追加
  372.     @actor_command_window.add_command("逃跑")
  373.     if !$game_temp.battle_can_escape
  374.       @actor_command_window.disable_item(@cp_escape_actor_command_index)
  375.     end
  376.     # 呼び戻す
  377.     xrxs_bp1_start_phase1
  378.   end
  379.   #----------------------------------------------------------------------
  380.   # ● パーティコマンドフェーズ開始
  381.   #----------------------------------------------------------------------
  382.   alias xrxs_bp1_start_phase2 start_phase2
  383.   def start_phase2
  384.     xrxs_bp1_start_phase2
  385.     @party_command_window.active = false
  386.     @party_command_window.visible = false
  387.     # CP加算を再開する
  388.     @cp_thread.stop = false
  389.     # 次へ
  390.     start_phase3
  391.   end
  392.   #----------------------------------------------------------------------
  393.   # ● アクターコマンドウィンドウのセットアップ
  394.   #----------------------------------------------------------------------
  395.   alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  396.   def phase3_setup_command_window
  397.     # CPスレッドを一時停止する
  398.     @cp_thread.stop = true
  399.     # ウィンドウのCP更新
  400.     @status_window.refresh_cp
  401.     # @active_battlerの防御を解除
  402.     @active_battler.now_guarding = false
  403.     # 効果音の再生
  404.     Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  405.     # 呼び戻す
  406.     xrxs_bp1_phase3_setup_command_window
  407.   end
  408.   #----------------------------------------------------------------------
  409.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  410.   #----------------------------------------------------------------------
  411.   alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  412.   def update_phase3_basic_command
  413.     # C ボタンが押された場合
  414.     if Input.trigger?(Input::C)
  415.       # アクターコマンドウィンドウのカーソル位置で分岐
  416.       case @actor_command_window.index
  417.       when @cp_escape_actor_command_index # 逃げる
  418.         if $game_temp.battle_can_escape
  419.           # 決定 SE を演奏
  420.           $game_system.se_play($data_system.decision_se)
  421.           # アクションを設定
  422.           @active_battler.current_action.kind = 0
  423.           @active_battler.current_action.basic = 4
  424.           # 次のアクターのコマンド入力へ
  425.           phase3_next_actor
  426.         else
  427.           # ブザー SE を演奏
  428.           $game_system.se_play($data_system.buzzer_se)
  429.         end
  430.         return
  431.       end
  432.     end
  433.     xrxs_bsp1_update_phase3_basic_command
  434.   end
  435.   #----------------------------------------------------------------------
  436.   # ● メインフェーズ開始
  437.   #----------------------------------------------------------------------
  438.   alias xrxs_bp1_start_phase4 start_phase4
  439.   def start_phase4
  440.     # 呼び戻す
  441.     xrxs_bp1_start_phase4
  442.     # CPスレッドを一時停止する
  443.     unless @action_battlers.empty?
  444.       @cp_thread.stop = true
  445.     end
  446.   end
  447.   #----------------------------------------------------------------------
  448.   # ● 行動順序作成
  449.   #----------------------------------------------------------------------
  450.   alias xrxs_bp1_make_action_orders make_action_orders
  451.   def make_action_orders
  452.     xrxs_bp1_make_action_orders
  453.     # 全員のCPを確認
  454.     exclude_battler = []
  455.     for battler in @action_battlers
  456.       # CPが不足している場合は @action_battlers から除外する
  457.       if battler.cp < 65535
  458.         exclude_battler.push(battler)
  459.       end
  460.     end
  461.     @action_battlers -= exclude_battler
  462.   end
  463.   #----------------------------------------------------------------------
  464.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  465.   #----------------------------------------------------------------------
  466.   alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  467.   def update_phase4_step1
  468.     # 初期化
  469.     @phase4_act_continuation = 0
  470.     # 勝敗判定
  471.     if judge
  472.       @cp_thread.stop
  473.       # 勝利または敗北の場合 : メソッド終了
  474.       return
  475.     end
  476.     # 未行動バトラー配列の先頭から取得
  477.     @active_battler = @action_battlers[0]
  478.     # ステータス更新をCPだけに限定。
  479.     @status_window.update_cp_only = true
  480.     # ステート更新を禁止。
  481.     @active_battler.slip_state_update_ban = true if @active_battler != nil
  482.     # 戻す
  483.     xrxs_bp1_update_phase4_step1
  484.     # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  485.     if @phase4_step != 2
  486.       # リフレッシュ
  487.       @status_window.refresh
  488.       # 軽量化:たったコレだけΣ(?w?
  489.       Graphics.frame_reset
  490.     end
  491.     # 禁止を解除
  492.     @status_window.update_cp_only = false
  493.     @active_battler.slip_state_update_ban = false if @active_battler != nil
  494.   end
  495.   #----------------------------------------------------------------------
  496.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  497.   #----------------------------------------------------------------------
  498.   alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  499.   def update_phase4_step2
  500.     # 強制アクションでなければ
  501.     unless @active_battler.current_action.forcing
  502.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  503.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  504.         # アクションに攻撃を設定
  505.         @active_battler.current_action.kind = 0
  506.         @active_battler.current_action.basic = 0
  507.       end
  508.       # 制約が [行動できない] の場合
  509.       if @active_battler.restriction == 4
  510.         # アクション強制対象のバトラーをクリア
  511.         $game_temp.forcing_battler = nil
  512.         if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  513.           # ステート自然解除
  514.           @active_battler.remove_states_auto
  515.           # CP消費
  516.           @active_battler.cp -= 65535
  517.           # ステータスウィンドウをリフレッシュ
  518.           @status_window.refresh
  519.         end
  520.         # ステップ 1 に移行
  521.         @phase4_step = 1
  522.         return
  523.       end
  524.     end
  525.     # アクションの種別で分岐
  526.     case @active_battler.current_action.kind
  527.     when 0
  528.       # 攻撃?防御?逃げる?何もしない時の共通消費CP
  529.       @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  530.     when 1
  531.       # スキル使用時の消費CP
  532.       @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  533.     when 2
  534.       # アイテム使用時の消費CP
  535.       @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  536.     end
  537.     # ステート自然解除
  538.     @active_battler.remove_states_auto
  539.     # 呼び戻す
  540.     xrxs_bp1_update_phase4_step2
  541.   end
  542.   #----------------------------------------------------------------------
  543.   # ● 基本アクション 結果作成
  544.   #----------------------------------------------------------------------
  545.   alias xrxs_bp1_make_basic_action_result make_basic_action_result
  546.   def make_basic_action_result
  547.     # 攻撃の場合
  548.     if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  549.       @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  550.     end
  551.     # 防御の場合
  552.     if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  553.       @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  554.       # @active_battlerの防御をON
  555.       @active_battler.now_guarding = true
  556.     end
  557.     # 敵の逃げるの場合
  558.     if @active_battler.is_a?(Game_Enemy) and
  559.         @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  560.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  561.     end
  562.     # 何もしないの場合
  563.     if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  564.       @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  565.     end
  566.     # 逃げるの場合
  567.     if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  568.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  569.       # 逃走可能ではない場合
  570.       if $game_temp.battle_can_escape == false
  571.         # ブザー SE を演奏
  572.         $game_system.se_play($data_system.buzzer_se)
  573.         return
  574.       end
  575.       # 逃走処理
  576.       update_phase2_escape
  577.       return
  578.     end
  579.     # 呼び戻す
  580.     xrxs_bp1_make_basic_action_result
  581.   end
  582.   #----------------------------------------------------------------------
  583.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  584.   #----------------------------------------------------------------------
  585.   alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  586.   def update_phase4_step6
  587.     # スリップダメージ
  588.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  589.       @active_battler.slip_damage_effect
  590.       @active_battler.damage_pop = true
  591.       # ステータスウィンドウをリフレッシュ
  592.       @status_window.refresh
  593.     end
  594.     # 呼び戻す
  595.     xrxs_bp1_update_phase4_step6
  596.   end
  597. end
  598. #======================================================================
  599. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  600. #======================================================================
复制代码
回复

使用道具 举报

梦石
0
星屑
9716
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2015-12-4 22:24:40 | 显示全部楼层
本帖最后由 cinderelmini 于 2015-12-4 22:30 编辑

XP的Window类从Window_Base开始就抛弃惹Viewport……
窝居然不知道……还不能直接用【self.viewport = 】来赋值……
折腾了半天总算找到原因…………

添加了一个类和一些方法,改变了敌人的cp槽生成方式,
修改了Window_Base的initialize的super,可以传viewport进去了。
修改了原脚本的Window_Battlestatus的initialize,传个viewport到敌人CP槽总窗过去,再分别传到各个子窗里。
Scene_Battle的【main】的建立活动块和状态窗口的部分做了一点调整,
都在脚本里了:
替换原来的CP系统脚本(在这之前请备份原来的)
  1. #========================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #========================================================================
  4. #========================================================================
  5. # ▼▲▼ XRXS_BP 1. CP制導入 ver..23 ▼▲▼
  6. # by 桜雅 在土, 和希
  7. #------------------------------------------------------------------------
  8. # □ カスタマイズポイント
  9. #========================================================================
  10. module XRXS_BP1
  11.   #
  12.   # 对齐方式。0:左 1:中央 2:右
  13.   #
  14.   ALIGN = 0
  15.   #
  16.   # 人数
  17.   #
  18.   MAX = 4
  19. end
  20. class Scene_Battle_CP
  21.   #
  22.   # 战斗速度
  23.   #
  24.   BATTLE_SPEED = 2.0
  25.   #
  26.   # 战斗开始的时候气槽百分比
  27.   #
  28.   START_CP_PERCENT = 0
  29. end
  30. class Scene_Battle
  31.   # 效果音效,可以自己添加
  32.   DATA_SYSTEM_COMMAND_UP_SE = ""
  33.   # 各项数值功能消耗的CP值
  34.   CP_COST_BASIC_ACTIONS = 0 # 基础共同
  35.   CP_COST_SKILL_ACTION = 65535 # 技能
  36.   CP_COST_ITEM_ACTION = 65535 # 物品
  37.   CP_COST_BASIC_ATTACK = 65535 # 攻撃
  38.   CP_COST_BASIC_GUARD = 32768 # 防御
  39.   CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
  40.   CP_COST_BASIC_ESCAPE = 65535 # 逃跑
  41. end
  42. #========================================================================
  43. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  44. #------------------------------------------------------------------------
  45. # Window_Commandクラスに add_command メソッドを追加します。
  46. #========================================================================
  47. module XRXS_Window_Command_Add_Command
  48.   #----------------------------------------------------------------------
  49.   # ○ コマンドを追加
  50.   #----------------------------------------------------------------------
  51.   def add_command(command)
  52.     # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  53.     #
  54.     if @disabled == nil
  55.       @disabled = []
  56.     end
  57.     if @commands.size != @disabled.size
  58.       for i in 0...@commands.size
  59.         @disabled[i] = false
  60.       end
  61.     end
  62.     #
  63.     # 追加
  64.     #
  65.     @commands.push(command)
  66.     @disabled.push(false)
  67.     @item_max = @commands.size
  68.     self.y -= 32
  69.     self.height += 32
  70.     self.contents.dispose
  71.     self.contents = nil
  72.     self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  73.     refresh
  74.     for i in 0...@commands.size
  75.       if @disabled[i]
  76.         disable_item(i)
  77.       end
  78.     end
  79.   end
  80.   #----------------------------------------------------------------------
  81.   # ○ 項目の無効化
  82.   # index : 項目番号
  83.   #----------------------------------------------------------------------
  84.   def disable_item(index)
  85.     if @disabled == nil
  86.       @disabled = []
  87.     end
  88.     @disabled[index] = true
  89.     draw_item(index, disabled_color)
  90.   end
  91. end
  92. class Window_Command < Window_Selectable
  93.   #----------------------------------------------------------------------
  94.   # ○ インクルード
  95.   #----------------------------------------------------------------------
  96.   include XRXS_Window_Command_Add_Command
  97.   #----------------------------------------------------------------------
  98.   # ● 項目の無効化
  99.   # index : 項目番号
  100.   #----------------------------------------------------------------------
  101.   def disable_item(index)
  102.     super
  103.   end
  104. end
  105. #========================================================================
  106. # □ Scene_Battle_CP
  107. #========================================================================
  108. class Scene_Battle_CP
  109.   #----------------------------------------------------------------------
  110.   # ○ 公開インスタンス変数
  111.   #----------------------------------------------------------------------
  112.   attr_accessor :stop # CP加算ストップ
  113.   #----------------------------------------------------------------------
  114.   # ○ オブジェクトの初期化
  115.   #----------------------------------------------------------------------
  116.   def initialize
  117.     @battlers = []
  118.     @cancel = false
  119.     @stop = false
  120.     @agi_total = 0
  121.     # 配列 count_battlers を初期化
  122.     count_battlers = []
  123.     # エネミーを配列 count_battlers に追加
  124.     for enemy in $game_troop.enemies
  125.       count_battlers.push(enemy)
  126.     end
  127.     # アクターを配列 count_battlers に追加
  128.     for actor in $game_party.actors
  129.       count_battlers.push(actor)
  130.     end
  131.     for battler in count_battlers
  132.       @agi_total += battler.agi
  133.     end
  134.     for battler in count_battlers
  135.       battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
  136.     end
  137.   end
  138.   #----------------------------------------------------------------------
  139.   # ○ CPカウントアップ
  140.   #----------------------------------------------------------------------
  141.   def update
  142.     # ストップされているならリターン
  143.     return if @stop
  144.     #
  145.     for battler in $game_party.actors + $game_troop.enemies
  146.       # 行動出来なければ無視
  147.       if battler.dead? == true
  148.         battler.cp = 0
  149.         next
  150.       end
  151.       battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  152.     end
  153.   end
  154.   #----------------------------------------------------------------------
  155.   # ○ CPカウントの開始
  156.   #----------------------------------------------------------------------
  157.   def stop
  158.     @cancel = true
  159.     if @cp_thread != nil then
  160.       @cp_thread.join
  161.       @cp_thread = nil
  162.     end
  163.   end
  164. end
  165. #========================================================================
  166. # ■ Game_Battler
  167. #========================================================================
  168. class Game_Battler
  169.   attr_accessor :now_guarding # 現在防御中フラグ
  170.   attr_accessor :cp # 現在CP
  171.   attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  172.   #----------------------------------------------------------------------
  173.   # ○ CP の変更
  174.   #-----------------------------------------------------------------------
  175.   def cp=(p)
  176.     @cp = [[p, 0].max, 65535].min
  177.   end
  178.   #----------------------------------------------------------------------
  179.   # ● 防御中判定 [ 再定義 ]
  180.   #----------------------------------------------------------------------
  181.   def guarding?
  182.     return @now_guarding
  183.   end
  184.   #----------------------------------------------------------------------
  185.   # ● コマンド入力可能判定
  186.   #----------------------------------------------------------------------
  187.   alias xrxs_bp1_inputable? inputable?
  188.   def inputable?
  189.     bool = xrxs_bp1_inputable?
  190.     return (bool and (@cp >= 65535))
  191.   end
  192.   #----------------------------------------------------------------------
  193.   # ● ステート [スリップダメージ] 判定
  194.   #----------------------------------------------------------------------
  195.   alias xrxs_bp1_slip_damage? slip_damage?
  196.   def slip_damage?
  197.     return false if @slip_state_update_ban
  198.     return xrxs_bp1_slip_damage?
  199.   end
  200.   #----------------------------------------------------------------------
  201.   # ● ステート自然解除 (ターンごとに呼び出し)
  202.   #----------------------------------------------------------------------
  203.   alias xrxs_bp1_remove_states_auto remove_states_auto
  204.   def remove_states_auto
  205.     return if @slip_state_update_ban
  206.     xrxs_bp1_remove_states_auto
  207.   end
  208. end
  209. #========================================================================
  210. # ■ Game_Actor
  211. #========================================================================
  212. class Game_Actor < Game_Battler
  213.   #----------------------------------------------------------------------
  214.   # ● セットアップ
  215.   #----------------------------------------------------------------------
  216.   alias xrxs_bp1_setup setup
  217.   def setup(actor_id)
  218.     xrxs_bp1_setup(actor_id)
  219.     @cp = 0
  220.     @now_guarding = false
  221.     @slip_state_update_ban = false
  222.   end
  223. end
  224. #========================================================================
  225. # ■ Game_Enemy
  226. #========================================================================
  227. class Game_Enemy < Game_Battler
  228.   #----------------------------------------------------------------------
  229.   # ● オブジェクト初期化
  230.   #----------------------------------------------------------------------
  231.   alias xrxs_bp1_initialize initialize
  232.   def initialize(troop_id, member_index)
  233.     xrxs_bp1_initialize(troop_id, member_index)
  234.     @cp = 0
  235.     @now_guarding = false
  236.     @slip_state_update_ban = false
  237.   end
  238. end
  239. class Window_All < Window_Base
  240.   def initialize(viewport)
  241.     super(0,0,640,480)
  242.     @viewport = viewport
  243.     self.opacity = 0
  244.     self.contents = Bitmap.new(width - 32, height - 32)
  245.     @cps = nil
  246.     refresh
  247.   end
  248.   def dispose
  249.     super
  250.     dispose_cps
  251.   end
  252.   def dispose_cps
  253.     return if @cps.nil?
  254.     return if @cps.size <= 0
  255.     @cps.each{|cp| cp.dispose unless cp.nil?}
  256.   end
  257.   def alive_size
  258.     size = 0; $game_troop.enemies.each{|enemy| size += 1 if enemy.exist?}
  259.     return size
  260.   end
  261.   def refresh
  262.     if @cps.nil? || @cps.size != alive_size
  263.       create_cps
  264.     else
  265.       refresh_cps
  266.     end
  267.   end
  268.   def create_cps
  269.     dispose_cps
  270.     @cps = []
  271.     for i in 0...$game_troop.enemies.size
  272.       enemy = $game_troop.enemies[i]
  273.       next if !enemy.exist?
  274.       @cps[i] = Enemy_CP_Hito.new(enemy, @viewport)
  275.     end
  276.   end
  277.   def refresh_cps
  278.     return if @cps.nil?
  279.     return if @cps.size <= 0
  280.     @cps.each{|cp| cp.refresh}
  281.   end
  282. end
  283. class Enemy_CP_Hito < Window_Base
  284.   def initialize(enemy, viewport)
  285.     @enemy = enemy
  286.     super(enemy_x,enemy_y,cp_width + 32,cp_height + 32, viewport)
  287.     self.opacity = 0
  288.     self.contents = Bitmap.new(width - 32, height - 32)
  289.     self.z = enemy_z
  290.     refresh
  291.   end
  292.   def cp_width; return 60; end
  293.   def cp_height; return 6; end
  294.   def enemy_x; return 0 if @enemy.nil?; return @enemy.screen_x - 50; end
  295.   def enemy_y; return 0 if @enemy.nil?; return @enemy.screen_y - 25; end
  296.   def enemy_z; return 0 if @enemy.nil?; return @enemy.screen_z; end
  297.   def refresh(enemy = @enemy)
  298.     self.contents.clear
  299.     @enemy = enemy
  300.     draw_actor_cp_meter(@enemy, 0, 0, cp_width, cp_height)
  301.   end
  302.   #----------------------------------------------------------------------
  303.   # ○ CPメーター の描画
  304.   #----------------------------------------------------------------------
  305.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  306.     self.contents.font.color = system_color
  307.     self.contents.fill_rect(x, y, width,6, Color.new(0, 0, 0, 255))
  308.     if actor.cp == nil
  309.       actor.cp = 0
  310.     end
  311.     w = (width - 2) * [actor.cp,65535].min / 65535
  312.     self.contents.fill_rect(x+1, y+1, w,1, Color.new(255, 255, 128, 255))
  313.     self.contents.fill_rect(x+1, y+2, w,1, Color.new(255, 255, 0, 255))
  314.     self.contents.fill_rect(x+1, y+3, w,1, Color.new(192, 192, 0, 255))
  315.     self.contents.fill_rect(x+1, y+4, w,1, Color.new(128, 128, 0, 255))
  316.   end
  317. end
  318. class Window_Base < Window
  319.   #--------------------------------------------------------------------------
  320.   # ● 初始化对像
  321.   #     x      : 窗口的 X 坐标
  322.   #     y      : 窗口的 Y 坐标
  323.   #     width  : 窗口的宽
  324.   #     height : 窗口的宽
  325.   #--------------------------------------------------------------------------
  326.   def initialize(x, y, width, height, viewport = nil)
  327.     if viewport.nil?
  328.       super()
  329.     else
  330.       super(viewport)
  331.     end
  332.     @windowskin_name = $game_system.windowskin_name
  333.     self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  334.     self.x = x
  335.     self.y = y
  336.     self.width = width
  337.     self.height = height
  338.     self.z = 100
  339.   end
  340. end



  341. #========================================================================
  342. # ■ Window_BattleStatus
  343. #========================================================================
  344. class Window_BattleStatus < Window_Base
  345.   #-----------------------------------------------------------------------
  346.   # ○ 公開インスタンス変数
  347.   #----------------------------------------------------------------------
  348.   attr_accessor :update_cp_only # CPメーターのみの更新
  349.   #----------------------------------------------------------------------
  350.   # ● オブジェクト初期化
  351.   #----------------------------------------------------------------------
  352.   alias xrxs_bp1_initialize initialize
  353.   def initialize(enemy_viewport)
  354.     @update_cp_only = false
  355.     @wall = Window_All.new(enemy_viewport)
  356.     xrxs_bp1_initialize
  357.   end
  358.   def dispose
  359.     super
  360.     @wall.dispose
  361.   end
  362.   #----------------------------------------------------------------------
  363.   # ● リフレッシュ
  364.   #----------------------------------------------------------------------
  365.   alias xrxs_bp1_refresh refresh
  366.   def refresh
  367.     unless @update_cp_only
  368.       xrxs_bp1_refresh
  369.     end
  370.     refresh_cp
  371.     @wall.refresh
  372.   end
  373.   #----------------------------------------------------------------------
  374.   # ○ リフレッシュ(CPのみ)
  375.   #----------------------------------------------------------------------
  376.   def refresh_cp
  377.     for i in 0...$game_party.actors.size
  378.       actor = $game_party.actors[i]
  379.       width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  380.       space = self.width / XRXS_BP1::MAX
  381.       case XRXS_BP1::ALIGN
  382.       when 0
  383.         actor_x = i * space + 4
  384.       when 1
  385.         actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  386.       when 2
  387.         actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  388.       end
  389.       actor_x += self.x
  390.       draw_actor_cp_meter(actor, actor_x, 96, width, 0)
  391.     end
  392.   end
  393.   #----------------------------------------------------------------------
  394.   # ○ CPメーター の描画
  395.   #----------------------------------------------------------------------
  396.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  397.     self.contents.font.color = system_color
  398.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  399.     if actor.cp == nil
  400.       actor.cp = 0
  401.     end
  402.     w = width * [actor.cp,65535].min / 65535
  403.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  404.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  405.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  406.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  407.   end
  408. end
  409. #========================================================================
  410. # ■ Scene_Battle
  411. #========================================================================
  412. class Scene_Battle
  413. ################################################
  414.   #--------------------------------------------------------------------------
  415.   # ● 主处理
  416.   #--------------------------------------------------------------------------
  417.   def main
  418.     # 初始化战斗用的各种暂时数据
  419.     $game_temp.in_battle = true
  420.     $game_temp.battle_turn = 0
  421.     $game_temp.battle_event_flags.clear
  422.     $game_temp.battle_abort = false
  423.     $game_temp.battle_main_phase = false
  424.     $game_temp.battleback_name = $game_map.battleback_name
  425.     $game_temp.forcing_battler = nil
  426.     # 初始化战斗用事件解释器
  427.     $game_system.battle_interpreter.setup(nil, 0)
  428.     # 准备队伍
  429.     @troop_id = $game_temp.battle_troop_id
  430.     $game_troop.setup(@troop_id)
  431.     # 生成角色命令窗口
  432.     s1 = $data_system.words.attack
  433.     s2 = $data_system.words.skill
  434.     s3 = $data_system.words.guard
  435.     s4 = $data_system.words.item
  436.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  437.     @actor_command_window.y = 160
  438.     @actor_command_window.back_opacity = 160
  439.     @actor_command_window.active = false
  440.     @actor_command_window.visible = false
  441.     # 生成其它窗口
  442.     @party_command_window = Window_PartyCommand.new
  443.     @help_window = Window_Help.new
  444.     @help_window.back_opacity = 160
  445.     @help_window.visible = false
  446. ################
  447. # 活动块放到状态窗口之上生成
  448.     # 生成活动块
  449.     @spriteset = Spriteset_Battle.new
  450. # 加括弧里的内容
  451.     @status_window = Window_BattleStatus.new(@spriteset.viewport1)
  452. ################
  453.     @message_window = Window_Message.new
  454.     # 初始化等待计数
  455.     @wait_count = 0
  456.     # 执行过渡
  457.     if $data_system.battle_transition == ""
  458.       Graphics.transition(20)
  459.     else
  460.       Graphics.transition(40, "Graphics/Transitions/" +
  461.         $data_system.battle_transition)
  462.     end
  463.     # 开始自由战斗回合
  464.     start_phase1
  465.     # 主循环
  466.     loop do
  467.       # 刷新游戏画面
  468.       Graphics.update
  469.       # 刷新输入信息
  470.       Input.update
  471.       # 刷新画面
  472.       update
  473.       # 如果画面切换的话就中断循环
  474.       if $scene != self
  475.         break
  476.       end
  477.     end
  478.     # 刷新地图
  479.     $game_map.refresh
  480.     # 准备过渡
  481.     Graphics.freeze
  482.     # 释放窗口
  483.     @actor_command_window.dispose
  484.     @party_command_window.dispose
  485.     @help_window.dispose
  486.     @status_window.dispose
  487.     @message_window.dispose
  488.     if @skill_window != nil
  489.       @skill_window.dispose
  490.     end
  491.     if @item_window != nil
  492.       @item_window.dispose
  493.     end
  494.     if @result_window != nil
  495.       @result_window.dispose
  496.     end
  497.     # 释放活动块
  498.     @spriteset.dispose
  499.     # 标题画面切换中的情况
  500.     if $scene.is_a?(Scene_Title)
  501.       # 淡入淡出画面
  502.       Graphics.transition
  503.       Graphics.freeze
  504.     end
  505.     # 战斗测试或者游戏结束以外的画面切换中的情况
  506.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  507.       $scene = nil
  508.     end
  509.   end
  510. ################################################
  511.   #----------------------------------------------------------------------
  512.   # ● フレーム更新
  513.   #----------------------------------------------------------------------
  514.   alias xrxs_bp1_update update
  515.   def update
  516.     xrxs_bp1_update
  517.     # CP更新
  518.     @cp_thread.update
  519.   end
  520.   #----------------------------------------------------------------------
  521.   # ● バトル終了
  522.   # result : 結果 (0:勝利 1:敗北 2:逃走)
  523.   #----------------------------------------------------------------------
  524.   alias xrxs_bp1_battle_end battle_end
  525.   def battle_end(result)
  526.     # CPカウントを停止する
  527.     @cp_thread.stop
  528.     # 呼び戻す
  529.     xrxs_bp1_battle_end(result)
  530.   end
  531.   #----------------------------------------------------------------------
  532.   # ● プレバトルフェーズ開始
  533.   #----------------------------------------------------------------------
  534.   alias xrxs_bp1_start_phase1 start_phase1
  535.   def start_phase1
  536.     @agi_total = 0
  537.     # CP加算を開始する
  538.     @cp_thread = Scene_Battle_CP.new
  539.     # インデックスを計算
  540.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  541.     # アクターコマンドウィンドウに追加
  542.     @actor_command_window.add_command("逃跑")
  543.     if !$game_temp.battle_can_escape
  544.       @actor_command_window.disable_item(@cp_escape_actor_command_index)
  545.     end
  546.     # 呼び戻す
  547.     xrxs_bp1_start_phase1
  548.   end
  549.   #----------------------------------------------------------------------
  550.   # ● パーティコマンドフェーズ開始
  551.   #----------------------------------------------------------------------
  552.   alias xrxs_bp1_start_phase2 start_phase2
  553.   def start_phase2
  554.     xrxs_bp1_start_phase2
  555.     @party_command_window.active = false
  556.     @party_command_window.visible = false
  557.     # CP加算を再開する
  558.     @cp_thread.stop = false
  559.     # 次へ
  560.     start_phase3
  561.   end
  562.   #----------------------------------------------------------------------
  563.   # ● アクターコマンドウィンドウのセットアップ
  564.   #----------------------------------------------------------------------
  565.   alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  566.   def phase3_setup_command_window
  567.     # CPスレッドを一時停止する
  568.     @cp_thread.stop = true
  569.     # ウィンドウのCP更新
  570.     @status_window.refresh_cp
  571.     # @active_battlerの防御を解除
  572.     @active_battler.now_guarding = false
  573.     # 効果音の再生
  574.     Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  575.     # 呼び戻す
  576.     xrxs_bp1_phase3_setup_command_window
  577.   end
  578.   #----------------------------------------------------------------------
  579.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  580.   #----------------------------------------------------------------------
  581.   alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  582.   def update_phase3_basic_command
  583.     # C ボタンが押された場合
  584.     if Input.trigger?(Input::C)
  585.       # アクターコマンドウィンドウのカーソル位置で分岐
  586.       case @actor_command_window.index
  587.       when @cp_escape_actor_command_index # 逃げる
  588.         if $game_temp.battle_can_escape
  589.           # 決定 SE を演奏
  590.           $game_system.se_play($data_system.decision_se)
  591.           # アクションを設定
  592.           @active_battler.current_action.kind = 0
  593.           @active_battler.current_action.basic = 4
  594.           # 次のアクターのコマンド入力へ
  595.           phase3_next_actor
  596.         else
  597.           # ブザー SE を演奏
  598.           $game_system.se_play($data_system.buzzer_se)
  599.         end
  600.         return
  601.       end
  602.     end
  603.     xrxs_bsp1_update_phase3_basic_command
  604.   end
  605.   #----------------------------------------------------------------------
  606.   # ● メインフェーズ開始
  607.   #----------------------------------------------------------------------
  608.   alias xrxs_bp1_start_phase4 start_phase4
  609.   def start_phase4
  610.     # 呼び戻す
  611.     xrxs_bp1_start_phase4
  612.     # CPスレッドを一時停止する
  613.     unless @action_battlers.empty?
  614.       @cp_thread.stop = true
  615.     end
  616.   end
  617.   #----------------------------------------------------------------------
  618.   # ● 行動順序作成
  619.   #----------------------------------------------------------------------
  620.   alias xrxs_bp1_make_action_orders make_action_orders
  621.   def make_action_orders
  622.     xrxs_bp1_make_action_orders
  623.     # 全員のCPを確認
  624.     exclude_battler = []
  625.     for battler in @action_battlers
  626.       # CPが不足している場合は @action_battlers から除外する
  627.       if battler.cp < 65535
  628.         exclude_battler.push(battler)
  629.       end
  630.     end
  631.     @action_battlers -= exclude_battler
  632.   end
  633.   #----------------------------------------------------------------------
  634.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  635.   #----------------------------------------------------------------------
  636.   alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  637.   def update_phase4_step1
  638.     # 初期化
  639.     @phase4_act_continuation = 0
  640.     # 勝敗判定
  641.     if judge
  642.       @cp_thread.stop
  643.       # 勝利または敗北の場合 : メソッド終了
  644.       return
  645.     end
  646.     # 未行動バトラー配列の先頭から取得
  647.     @active_battler = @action_battlers[0]
  648.     # ステータス更新をCPだけに限定。
  649.     @status_window.update_cp_only = true
  650.     # ステート更新を禁止。
  651.     @active_battler.slip_state_update_ban = true if @active_battler != nil
  652.     # 戻す
  653.     xrxs_bp1_update_phase4_step1
  654.     # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  655.     if @phase4_step != 2
  656.       # リフレッシュ
  657.       @status_window.refresh
  658.       # 軽量化:たったコレだけΣ(?w?
  659.       Graphics.frame_reset
  660.     end
  661.     # 禁止を解除
  662.     @status_window.update_cp_only = false
  663.     @active_battler.slip_state_update_ban = false if @active_battler != nil
  664.   end
  665.   #----------------------------------------------------------------------
  666.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  667.   #----------------------------------------------------------------------
  668.   alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  669.   def update_phase4_step2
  670.     # 強制アクションでなければ
  671.     unless @active_battler.current_action.forcing
  672.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  673.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  674.         # アクションに攻撃を設定
  675.         @active_battler.current_action.kind = 0
  676.         @active_battler.current_action.basic = 0
  677.       end
  678.       # 制約が [行動できない] の場合
  679.       if @active_battler.restriction == 4
  680.         # アクション強制対象のバトラーをクリア
  681.         $game_temp.forcing_battler = nil
  682.         if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  683.           # ステート自然解除
  684.           @active_battler.remove_states_auto
  685.           # CP消費
  686.           @active_battler.cp -= 65535
  687.           # ステータスウィンドウをリフレッシュ
  688.           @status_window.refresh
  689.         end
  690.         # ステップ 1 に移行
  691.         @phase4_step = 1
  692.         return
  693.       end
  694.     end
  695.     # アクションの種別で分岐
  696.     case @active_battler.current_action.kind
  697.     when 0
  698.       # 攻撃?防御?逃げる?何もしない時の共通消費CP
  699.       @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  700.     when 1
  701.       # スキル使用時の消費CP
  702.       @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  703.     when 2
  704.       # アイテム使用時の消費CP
  705.       @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  706.     end
  707.     # ステート自然解除
  708.     @active_battler.remove_states_auto
  709.     # 呼び戻す
  710.     xrxs_bp1_update_phase4_step2
  711.   end
  712.   #----------------------------------------------------------------------
  713.   # ● 基本アクション 結果作成
  714.   #----------------------------------------------------------------------
  715.   alias xrxs_bp1_make_basic_action_result make_basic_action_result
  716.   def make_basic_action_result
  717.     # 攻撃の場合
  718.     if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  719.       @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  720.     end
  721.     # 防御の場合
  722.     if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  723.       @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  724.       # @active_battlerの防御をON
  725.       @active_battler.now_guarding = true
  726.     end
  727.     # 敵の逃げるの場合
  728.     if @active_battler.is_a?(Game_Enemy) and
  729.         @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  730.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  731.     end
  732.     # 何もしないの場合
  733.     if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  734.       @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  735.     end
  736.     # 逃げるの場合
  737.     if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  738.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  739.       # 逃走可能ではない場合
  740.       if $game_temp.battle_can_escape == false
  741.         # ブザー SE を演奏
  742.         $game_system.se_play($data_system.buzzer_se)
  743.         return
  744.       end
  745.       # 逃走処理
  746.       update_phase2_escape
  747.       return
  748.     end
  749.     # 呼び戻す
  750.     xrxs_bp1_make_basic_action_result
  751.   end
  752.   #----------------------------------------------------------------------
  753.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  754.   #----------------------------------------------------------------------
  755.   alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  756.   def update_phase4_step6
  757.     # スリップダメージ
  758.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  759.       @active_battler.slip_damage_effect
  760.       @active_battler.damage_pop = true
  761.       # ステータスウィンドウをリフレッシュ
  762.       @status_window.refresh
  763.     end
  764.     # 呼び戻す
  765.     xrxs_bp1_update_phase4_step6
  766.   end
  767. end
  768. #======================================================================
  769. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  770. #======================================================================
复制代码

   
回复

使用道具 举报

梦石
0
星屑
2245
在线时间
1015 小时
注册时间
2015-10-17
回帖
1077
 楼主| 发表于 2015-12-4 23:00:18 | 显示全部楼层
cinderelmini 发表于 2015-12-4 22:24
XP的Window类从Window_Base开始就抛弃惹Viewport……
窝居然不知道……还不能直接用【self.viewport = 】来 ...


非常感谢,问题解决了,现在战斗看起来舒服了

点评

这样的话感觉有些敌人会遮住CP槽看不见…………  发表于 2015-12-4 23:04
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部