查看: 3295|回复: 5

[已经过期] 关于CP制和豪华版冷却系统脚本的冲突问题

[复制链接]
梦石
0
星屑
661
在线时间
85 小时
注册时间
2018-11-23
回帖
5
发表于 2020-2-1 20:44:18 | 显示全部楼层 |阅读模式

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

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

×
如题,使用了绿发的Eclair的豪华版技能冷却系统加上CP制....结果因为CP制的人物行动问题,回合乱了...请问,有什么能让这两个脚本兼容的办法么。
  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        = "123"  # スキンファイル名(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/Decision2"
  41.   CPADD_SKILLLIST = {194=>5660,190=>12767 } #新增#用于设定技能的cp跳条值 格式:技能id => cp跳条值
  42. end
  43. #==============================================================================
  44. # --- CP メーターの描画情報の取得 --- (Game_Battlerにインクルードされます)
  45. #==============================================================================
  46. module XRXS_CP
  47.         #--------------------------------------------------------------------------
  48.         # ○ スキンライン (スキンの何行目を使うか)
  49.         #--------------------------------------------------------------------------
  50.         def cp_linetype
  51.                 # CP フルの場合はスキンの 2 行目を使う
  52.                 return 2 if self.cp_full?
  53.                 # 通常はスキンの 1 行目を使う
  54.                 return 1
  55.         end
  56.         #--------------------------------------------------------------------------
  57.         # ○ メーター量[単位:%]
  58.         #--------------------------------------------------------------------------
  59.         def cp_lineamount
  60.                 # 戦闘不能の場合は 0 %として表示させる
  61.                 return 0 if self.dead?
  62.                 # CP値を%値に変換して返却する
  63.                 return 100 * self.cp / self.max_cp
  64.         end
  65. end
  66. #
  67. # カスタマイズポイントここまで。
  68. #------------------------------------------------------------------------------



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

复制代码

(上面是我用的CP制)
  1. #=======================================================================
  2. #  豪华版技能冷却系统 By 绿发的Eclair
  3. #  使用方法:在特技名称后面用半角逗号分割,写上冷却回合数。
  4. #  比如 十字斩,10 就是特技 十字斩 冷却10个回合了。
  5. #  注意这个冷却是敌我通用的,不只是我方,敌人也不会使用冷却中的技能哦。
  6. #  不想让特技窗口中显示冷却回合数, $冷却时间显示 = false 就行了。
  7. #  冲突性:存在,但是除了RTAB外似乎整合难度不大。
  8. #=======================================================================
  9. $冷却时间显示 = true
  10. module RPG
  11.   class Skill
  12.   def cold
  13.     return @name.split(/,/)[1]
  14.   end
  15.   def name(actor = nil)
  16.     if $冷却时间显示 and actor != nil and actor.cold[@id] != nil
  17.       a = (@name.split(/,/)[0] == nil ? 0 : @name.split(/,/)[0])
  18.       return a + "(" + actor.cold[@id].to_s + "回合冷却)"
  19.     else
  20.       return (@name.split(/,/)[0] == nil ? 0 : @name.split(/,/)[0])
  21.     end
  22.   end
  23.   end
  24. end
  25. class Game_Battler
  26.   #--------------------------------------------------------------------------
  27.   # ● 可以使用特技的判定
  28.   #     skill_id : 特技 ID
  29.   #--------------------------------------------------------------------------
  30.    attr_accessor :cold
  31.    alias initialize_cold :initialize
  32.    def initialize
  33.      @cold = {}
  34.      initialize_cold
  35.    end
  36.    def set_cold(key,val)
  37.      return if @cold[key] == nil
  38.      @cold[key] += val
  39.      @cold.delete(key) if @cold[key] <= 0
  40.    end
  41.    alias skill_can_use_addcold :skill_can_use?
  42.   def skill_can_use?(skill_id)
  43.     return false if @cold[skill_id] != nil
  44.     skill_can_use_addcold(skill_id)
  45.   end
  46. end
  47. #==============================================================================
  48. # ■ Scene_Battle
  49. #------------------------------------------------------------------------------
  50. #  处理战斗画面的类。
  51. #==============================================================================

  52. class Scene_Battle
  53.    alias make_skill_action_result_addcold :make_skill_action_result
  54.    def make_skill_action_result
  55.      make_skill_action_result_addcold
  56.      if @skill.cold.to_i != 0
  57.      @active_battler.cold[@skill.id] = @skill.cold.to_i
  58.      end
  59.    end
  60.    alias start_phase4_addcold :start_phase4
  61.    def start_phase4
  62.      start_phase4_addcold
  63.    end   
  64. end
  65. #==============================================================================
  66. # ■ Window_Skill
  67. #------------------------------------------------------------------------------
  68. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  69. #==============================================================================
  70. class Window_Skill < Window_Selectable
  71.      def draw_item(index)
  72.      skill = @data[index]
  73.      if @actor.skill_can_use?(skill.id)
  74.        self.contents.font.color = normal_color
  75. else
  76.        self.contents.font.color = disabled_color
  77.      end
  78.      x = 4 + index % 2 * (288 + 32)
  79.      y = index / 2 * 32
  80.      rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  81.      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  82.      bitmap = RPG::Cache.icon(skill.icon_name)
  83.      opacity = self.contents.font.color == normal_color ? 255 : 128
  84.      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  85.      if $scene.is_a?(Scene_Battle)
  86.      self.contents.draw_text(x + 28, y, 204, 32, skill.name(@actor), 0)
  87.      else
  88.      self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  89.      end
  90.      self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)if skill.occasion !=3
  91.      self.contents.draw_text(x + 232, y, 48, 32, "被动", 2) if skill.occasion == 3
  92.    end
  93. end
  94. #==============================================================================
  95. # ■ Game_Enemy
  96. #------------------------------------------------------------------------------
  97. #  处理敌人的类。本类在 Game_Troop 类 ($game_troop) 的
  98. # 内部使用。
  99. #==============================================================================

  100. class Game_Enemy < Game_Battler
  101.      def make_action
  102.      # 清除当前行动
  103.      self.current_action.clear
  104.      # 无法行动的情况
  105.      unless self.movable?
  106.        # 过程结束
  107.        return
  108.      end
  109.      # 抽取现在有效的行动
  110.      available_actions = []
  111.      rating_max = 0
  112.      for action in self.actions
  113.        # 确认回合条件
  114.        n = $game_temp.battle_turn
  115.        a = action.condition_turn_a
  116.        b = action.condition_turn_b
  117.        if (b == 0 and n != a) or
  118.           (b > 0 and (n < 1 or n < a or n % b != a % b))
  119.          next
  120.        end
  121.        # 确认 HP 条件
  122.        if self.hp * 100.0 / self.maxhp > action.condition_hp
  123.          next
  124.        end
  125.        if self.cold[action.skill_id] != nil
  126.          next
  127.        end
  128.        # 确认等级条件
  129.        if $game_party.max_level < action.condition_level
  130.          next
  131.        end
  132.        # 确认开关条件
  133.        switch_id = action.condition_switch_id
  134.        if switch_id > 0 and $game_switches[switch_id] == false
  135.   next
  136.        end
  137.        # 符合条件 : 添加本行动
  138.        available_actions.push(action)
  139.        if action.rating > rating_max
  140.          rating_max = action.rating
  141.        end
  142.      end
  143.      # 最大概率值作为 3 合计计算(0 除外)
  144.      ratings_total = 0
  145.      for action in available_actions
  146.        if action.rating > rating_max - 3
  147.          ratings_total += action.rating - (rating_max - 3)
  148.        end
  149.      end
  150.      # 概率合计不为 0 的情况下
  151.      if ratings_total > 0
  152.        # 生成随机数
  153.        value = rand(ratings_total)
  154.        # 设置对应生成随机数的当前行动
  155.        for action in available_actions
  156.          if action.rating > rating_max - 3
  157.            if value < action.rating - (rating_max - 3)
  158.              self.current_action.kind = action.kind
  159.              self.current_action.basic = action.basic
  160.              self.current_action.skill_id = action.skill_id
  161.              self.current_action.decide_random_target_for_enemy
  162.              return
  163.            else
  164.              value -= action.rating - (rating_max - 3)
  165.            end
  166.          end
  167.        end
  168.      end
  169.    end
  170. end
  171. #=======================================================================
  172. #豪华版技能冷却系统
  173. #=======================================================================
复制代码

(然后这里是我用的技能冷却系统)
你再猜?
梦石
0
星屑
1433
在线时间
50 小时
注册时间
2020-2-16
回帖
85
发表于 2020-2-17 17:24:56 | 显示全部楼层
请问windowskin 123 是个什么文件
流飘零半生,未逢明主。公若是不弃,流愿拜为义父
回复

使用道具 举报

梦石
0
星屑
1433
在线时间
50 小时
注册时间
2020-2-16
回帖
85
发表于 2020-2-17 17:31:06 | 显示全部楼层
123是个cp条的素材,然后经过一轮测试并没有报错
QQ截图20200217172326.png
QQ截图20200217172658.png
QQ截图20200217172705.png
QQ截图20200217172901.png
流飘零半生,未逢明主。公若是不弃,流愿拜为义父
回复

使用道具 举报

梦石
0
星屑
661
在线时间
85 小时
注册时间
2018-11-23
回帖
5
 楼主| 发表于 2020-2-19 00:13:46 | 显示全部楼层
轩辕合流 发表于 2020-2-17 17:31
123是个cp条的素材,然后经过一轮测试并没有报错

是的,123是cp条的素材.....
你再猜?
回复

使用道具 举报

梦石
0
星屑
946
在线时间
61 小时
注册时间
2019-12-10
回帖
89
发表于 2021-2-10 19:32:47 | 显示全部楼层
轩辕合流 发表于 2020-2-17 17:31
123是个cp条的素材,然后经过一轮测试并没有报错

我用他的冷却,在选技能后出现,43行错误
想玩我做的游戏加我qq947128749
回复

使用道具 举报

梦石
0
星屑
7306
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2022-11-9 15:51:22 | 显示全部楼层
林晨曦2233 发表于 2020-2-19 00:13
是的,123是cp条的素材.....

CP说的是攻击速度值越高越快执行, 而技能冷却说的是冷却值越低越快执行,南辕北辙。要把SPEED改一下
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部