查看: 2726|回复: 5

[已经解决] cp制战斗和吟唱整合bug:can't clone TrueClass

[复制链接]
梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 2019-2-26 17:14:09 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 紫英晓狼1130 于 2019-2-26 17:30 编辑

这是一个cp制战斗和吟唱整合
在站里找到的远古产物
技能设置成敌群体就会跳出“can't clone TrueClass”
敌单体就没有这样的bug

测试.rar

194.39 KB, 下载次数: 48

《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴

聪仔

梦石
0
星屑
6187
在线时间
3077 小时
注册时间
2013-12-26
回帖
3076
发表于 2019-2-26 17:15:36 | 显示全部楼层
又没工程又没链接的怎么帮你...

点评

已经上传附件  发表于 2019-2-26 17:31
聪聪全国第三帅...
他们都叫我【人赢聪】
我的RM能力雷达图:

回复

使用道具 举报

聪仔

梦石
0
星屑
6187
在线时间
3077 小时
注册时间
2013-12-26
回帖
3076
发表于 2019-2-26 20:34:04 | 显示全部楼层
跟着原作者的思路走了一遍脚本,研究发现原脚本作者认为一定是选择敌人目标完毕之后才算技能选择结束,忽略了不需要选择敌人目标的技能,例如群攻的情形,例如选择队友的情形...
所以出现群攻时自然就报错了...
测试.rar (192.39 KB, 下载次数: 59)

删掉的地方已备注 # 删删删删删删删删删删删删删删删删删删删
添加的地方已备注 # 加加加加加加加加加加加加加加加加加加加
  1. #~########################################################################
  2. #~特技吟唱+CP制战斗 by goahead

  3. #~说明:
  4. #~增加吟唱特技要填两个内容,一个是特技ID,一个是吟唱时间
  5. #~我的脚本里以帕吉尔的扫荡(ID:61)为例。
  6. #~########################################################################

  7. class Scene_Battle
  8.   
  9.   #--------------------------------------------------------------------------
  10.   def goahead_recite(battler)
  11.     return if battler == nil
  12.     case battler.current_action.skill_id
  13.     when 61 ########扫荡特技的ID
  14.       battler.cp -= 140000 #########这个技能需要多长吟唱时间,CP最大65535
  15.       battler.goahead_recite = true
  16.     else
  17.       battler.goahead_recite = nil
  18.     end
  19.   end
  20.   #--------------------------------------------------------------------------
  21.   def phase3_next_actor
  22.     begin
  23.       if @active_battler != nil
  24.         @active_battler.blink = false
  25.       end
  26.       if @actor_index == $game_party.actors.size-1
  27.         start_phase4
  28.         return
  29.       end
  30.       @actor_index += 1
  31.       @active_battler = $game_party.actors[@actor_index]
  32.       @active_battler.blink = true
  33.     end until @active_battler.inputable?
  34.     if @active_battler.goahead_recite != nil
  35.       @active_battler.current_action = @active_battler.goahead_recite.clone
  36.       @active_battler.goahead_recite = nil
  37.       start_phase4
  38.     else
  39.       phase3_setup_command_window
  40.     end
  41.   end
  42.   
  43.   #--------------------------------------------------------------------------
  44.   def update_phase3_skill_select
  45.     @skill_window.visible = true
  46.     @skill_window.update
  47.     if Input.trigger?(Input::B)
  48.       $game_system.se_play($data_system.cancel_se)
  49.       end_skill_select
  50.       return
  51.     end
  52.     if Input.trigger?(Input::C)
  53.       @skill = @skill_window.skill
  54.       if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
  55.         $game_system.se_play($data_system.buzzer_se)
  56.         return
  57.       end
  58.       $game_system.se_play($data_system.decision_se)
  59.       @active_battler.current_action.skill_id = @skill.id
  60.       goahead_recite @active_battler
  61.       @skill_window.visible = false
  62.       if @skill.scope == 1
  63.         start_enemy_select
  64.       elsif @skill.scope == 3 or @skill.scope == 5
  65.         start_actor_select
  66.       else
  67.         end_skill_select
  68.         phase3_next_actor
  69.       end
  70.       return
  71.     end
  72.   end
  73.   
  74.   #--------------------------------------------------------------------------
  75.   def update_phase3_enemy_select
  76.     @enemy_arrow.update
  77.     if Input.trigger?(Input::B)
  78.       $game_system.se_play($data_system.cancel_se)
  79.       end_enemy_select
  80.       return
  81.     end
  82.     if Input.trigger?(Input::C)
  83.       $game_system.se_play($data_system.decision_se)
  84.       @active_battler.current_action.target_index = @enemy_arrow.index
  85.       end_enemy_select
  86.       if @skill_window != nil
  87.         # 删删删删删删删删删删删删删删删删删删删
  88.         #if @active_battler.goahead_recite != nil
  89.         #  @active_battler.goahead_recite=@active_battler.current_action.clone
  90.         #end
  91.         end_skill_select
  92.       end
  93.       if @item_window != nil
  94.         end_item_select
  95.       end
  96.       phase3_next_actor
  97.     end
  98.   end
  99.   
  100.   #--------------------------------------------------------------------------
  101.   # 加加加加加加加加加加加加加加加加加加加
  102.   def end_skill_select
  103.     # 释放特技窗口
  104.     @skill_window.dispose
  105.     @skill_window = nil
  106.     # 隐藏帮助窗口
  107.     @help_window.visible = false
  108.     # 有效化角色指令窗口
  109.     @actor_command_window.active = true
  110.     @actor_command_window.visible = true
  111.     if @active_battler.goahead_recite != nil
  112.       @active_battler.goahead_recite = @active_battler.current_action.clone
  113.     end
  114.   end
  115. end

  116. class Game_Battler
  117.   attr_accessor :goahead_recite
  118.   attr_accessor :current_action
  119. end

  120. # ———————————————————————————————

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

  123. #===================================================================
  124. # □ カスタマイズポイント
  125. #====================================================================
  126. module XRXS_BP1
  127.   # 对齐方式。0:左 1:中央 2:右
  128.   ALIGN = 0
  129.   # 人数
  130.   MAX = 4
  131. end

  132. class Scene_Battle_CP
  133.   # 战斗速度
  134.   BATTLE_SPEED = 2.0
  135.   # 战斗开始的时候气槽百分比
  136.   START_CP_PERCENT = 100
  137. end

  138. class Scene_Battle
  139.   # 效果音效,可以自己添加
  140.   DATA_SYSTEM_COMMAND_UP_SE = ""
  141.   # 各项数值功能消耗的CP值
  142.   CP_COST_BASIC_ACTIONS = 0 # 基础共同
  143.   CP_COST_SKILL_ACTION = 65535 # 技能
  144.   CP_COST_ITEM_ACTION = 65535 # 物品
  145.   CP_COST_BASIC_ATTACK = 65535 # 攻撃
  146.   CP_COST_BASIC_GUARD = 32768 # 防御
  147.   CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
  148.   CP_COST_BASIC_ESCAPE = 65535 # 逃跑
  149. end

  150. #============================================================
  151. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  152. #-----------------------------------------------------------
  153. # Window_Commandクラスに add_command メソッドを追加します。
  154. #=============================================================
  155. module XRXS_Window_Command_Add_Command
  156.   #-------------------------------------------------
  157.   # ○ コマンドを追加
  158.   #----------------------------------------------------
  159.   def add_command(command)
  160.     # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  161.     if @disabled == nil
  162.       @disabled = []
  163.     end
  164.     if @commands.size != @disabled.size
  165.       for i in 0...@commands.size
  166.         @disabled[i] = false
  167.       end
  168.     end
  169.     # 追加
  170.     @commands.push(command)
  171.     @disabled.push(false)
  172.     @item_max = @commands.size
  173.     self.y -= 32
  174.     self.height += 32
  175.     self.contents.dispose
  176.     self.contents = nil
  177.     self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  178.     refresh
  179.     for i in 0...@commands.size
  180.       if @disabled[i]
  181.         disable_item(i)
  182.       end
  183.     end
  184.   end
  185.   #-------------------------------------------------------
  186.   # ○ 項目の無効化
  187.   # index : 項目番号
  188.   #----------------------------------------------------
  189.   def disable_item(index)
  190.     if @disabled == nil
  191.       @disabled = []
  192.     end
  193.     @disabled[index] = true
  194.     draw_item(index, disabled_color)
  195.   end
  196. end

  197. class Window_Command < Window_Selectable
  198.   #------------------------------------------------------
  199.   # ○ インクルード
  200.   #------------------------------------------------
  201.   include XRXS_Window_Command_Add_Command
  202.   #---------------------------------------------------------
  203.   # ● 項目の無効化
  204.   # index : 項目番号
  205.   #------------------------------------------------------
  206.   def disable_item(index)
  207.     super
  208.   end
  209. end

  210. #==============================================================
  211. # □ Scene_Battle_CP
  212. #==============================================================
  213. class Scene_Battle_CP
  214.   #----------------------------------------------------------
  215.   # ○ 公開インスタンス変数
  216.   #-------------------------------------------------------
  217.   attr_accessor :stop # CP加算ストップ
  218.   #-------------------------------------------------------------
  219.   # ○ オブジェクトの初期化
  220.   #-----------------------------------------------------------
  221.   def initialize
  222.     @battlers = []
  223.     @cancel = false
  224.     @stop = false
  225.     @agi_total = 0
  226.     # 配列 count_battlers を初期化
  227.     count_battlers = []
  228.     # エネミーを配列 count_battlers に追加
  229.     for enemy in $game_troop.enemies
  230.       count_battlers.push(enemy)
  231.     end
  232.     # アクターを配列 count_battlers に追加
  233.     for actor in $game_party.actors
  234.       count_battlers.push(actor)
  235.     end
  236.     for battler in count_battlers
  237.       @agi_total += battler.agi
  238.     end
  239.     for battler in count_battlers
  240.       battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
  241.     end
  242.   end
  243.   #---------------------------------------------------------------
  244.   # ○ CPカウントアップ
  245.   #--------------------------------------------------------------
  246.   def update
  247.     # ストップされているならリターン
  248.     return if @stop
  249.     for battler in $game_party.actors + $game_troop.enemies
  250.     # 行動出来なければ無視
  251.       if battler.dead? == true
  252.         battler.cp = 0
  253.         next
  254.       end
  255.     battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  256.     end
  257.   end
  258.   #--------------------------------------------------------------
  259.   # ○ CPカウントの開始
  260.   #---------------------------------------------------------------
  261.   def stop
  262.     @cancel = true
  263.     if @cp_thread != nil then
  264.     @cp_thread.join
  265.     @cp_thread = nil
  266.     end
  267.   end
  268. end

  269. #===================================================================
  270. # ■ Game_Battler
  271. #=================================================================
  272. class Game_Battler
  273.   attr_accessor :now_guarding # 現在防御中フラグ
  274.   attr_accessor :cp # 現在CP
  275.   attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  276.   #-------------------------------------------------------------
  277.   # ○ CP の変更
  278.   #------------------------------------------------------------
  279.   def cp=(p)
  280.     @cp = [[p, 0].max, 65535].min
  281.   end
  282.   #----------------------------------------------------------
  283.   # ● 防御中判定 [ 再定義 ]
  284.   #---------------------------------------------------------
  285.   def guarding?
  286.     return @now_guarding
  287.   end
  288.   #------------------------------------------------------------
  289.   # ● コマンド入力可能判定
  290.   #---------------------------------------------------------
  291.   alias xrxs_bp1_inputable? inputable?
  292.   def inputable?
  293.     bool = xrxs_bp1_inputable?
  294.     return (bool and (@cp >= 65535))
  295.   end
  296.   #------------------------------------------------------------
  297.   # ● ステート [スリップダメージ] 判定
  298.   #-------------------------------------------------------------
  299.   alias xrxs_bp1_slip_damage? slip_damage?
  300.   def slip_damage?
  301.     return false if @slip_state_update_ban
  302.     return xrxs_bp1_slip_damage?
  303.   end
  304.   #--------------------------------------------------------------
  305.   # ● ステート自然解除 (ターンごとに呼び出し)
  306.   #----------------------------------------------------------
  307.   alias xrxs_bp1_remove_states_auto remove_states_auto
  308.   def remove_states_auto
  309.     return if @slip_state_update_ban
  310.     xrxs_bp1_remove_states_auto
  311.   end
  312. end
  313. #==================================================================
  314. # ■ Game_Actor
  315. #==================================================================
  316. class Game_Actor < Game_Battler
  317.   #---------------------------------------------------------
  318.   # ● セットアップ
  319.   #--------------------------------------------------------
  320.   alias xrxs_bp1_setup setup
  321.   def setup(actor_id)
  322.     xrxs_bp1_setup(actor_id)
  323.     @cp = 0
  324.     @now_guarding = false
  325.     @slip_state_update_ban = false
  326.   end
  327. end
  328. #===================================================================
  329. # ■ Game_Enemy
  330. #===================================================================
  331. class Game_Enemy < Game_Battler
  332.   #-----------------------------------------------------------
  333.   # ● オブジェクト初期化
  334.   #----------------------------------------------------------
  335.   alias ge_xrxs_bp1_initialize initialize
  336.   def initialize(troop_id, member_index)
  337.     ge_xrxs_bp1_initialize(troop_id, member_index)
  338.     @cp = 0
  339.     @now_guarding = false
  340.     @slip_state_update_ban = false
  341.   end
  342. end
  343. #==================================================================
  344. # ■ Window_BattleStatus
  345. #==================================================================
  346. class Window_BattleStatus < Window_Base
  347.   #---------------------------------------------------------
  348.   # ○ 公開インスタンス変数
  349.   #------------------------------------------------------------
  350.   attr_accessor :update_cp_only # CPメーターのみの更新
  351.   #------------------------------------------------------------
  352.   # ● オブジェクト初期化
  353.   #-------------------------------------------------------------
  354.   alias wb_xrxs_bp1_initialize initialize
  355.   def initialize
  356.     @update_cp_only = false
  357.     wb_xrxs_bp1_initialize
  358.   end
  359.   #------------------------------------------------------------
  360.   # ● リフレッシュ
  361.   #-------------------------------------------------------------
  362.   alias xrxs_bp1_refresh refresh
  363.   def refresh
  364.     unless @update_cp_only
  365.       xrxs_bp1_refresh
  366.     end
  367.     refresh_cp
  368.   end
  369.   #---------------------------------------------------------------
  370.   # ○ リフレッシュ(CPのみ)
  371.   #------------------------------------------------------------
  372.   def refresh_cp
  373.     for i in 0...$game_party.actors.size
  374.       actor = $game_party.actors[i]
  375.       width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  376.       space = self.width / XRXS_BP1::MAX
  377.       case XRXS_BP1::ALIGN
  378.       when 0
  379.         actor_x = i * space + 4
  380.       when 1
  381.         actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  382.       when 2
  383.         actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  384.       end
  385.       actor_x += self.x
  386.       draw_actor_cp_meter(actor, actor_x, 96, width, 0)
  387.     end
  388.   end
  389.   #-----------------------------------------------------------
  390.   # ○ CPメーター の描画
  391.   #-------------------------------------------------------------
  392.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  393.     self.contents.font.color = system_color
  394.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  395.     if actor.cp == nil
  396.       actor.cp = 0
  397.     end
  398.     w = width * [actor.cp,65535].min / 65535
  399.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  400.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  401.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  402.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  403.   end
  404. end
  405. #==================================================================
  406. # ■ Scene_Battle
  407. #==================================================================
  408. class Scene_Battle
  409.   #------------------------------------------------------------
  410.   # ● フレーム更新
  411.   #---------------------------------------------------------------
  412.   alias xrxs_bp1_update update
  413.   def update
  414.     xrxs_bp1_update
  415.     # CP更新
  416.     @cp_thread.update
  417.   end
  418.   #------------------------------------------------------------
  419.   # ● バトル終了
  420.   # result : 結果 (0:勝利 1:敗北 2:逃走)
  421.   #-------------------------------------------------------------
  422.   alias xrxs_bp1_battle_end battle_end
  423.   def battle_end(result)
  424.     # CPカウントを停止する
  425.     @cp_thread.stop
  426.     # 呼び戻す
  427.     xrxs_bp1_battle_end(result)
  428.   end
  429.   #------------------------------------------------------------
  430.   # ● プレバトルフェーズ開始
  431.   #----------------------------------------------------------
  432.   alias xrxs_bp1_start_phase1 start_phase1
  433.   def start_phase1
  434.     @agi_total = 0
  435.     # CP加算を開始する
  436.     @cp_thread = Scene_Battle_CP.new
  437.     # インデックスを計算
  438.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  439.     # アクターコマンドウィンドウに追加
  440.     @actor_command_window.add_command("逃跑")
  441.     if !$game_temp.battle_can_escape
  442.       @actor_command_window.disable_item(@cp_escape_actor_command_index)
  443.     end
  444.     # 呼び戻す
  445.     xrxs_bp1_start_phase1
  446.   end
  447.   #---------------------------------------------------------------
  448.   # ● パーティコマンドフェーズ開始
  449.   #----------------------------------------------------------
  450.   alias xrxs_bp1_start_phase2 start_phase2
  451.   def start_phase2
  452.     xrxs_bp1_start_phase2
  453.     @party_command_window.active = false
  454.     @party_command_window.visible = false
  455.     # CP加算を再開する
  456.     @cp_thread.stop = false
  457.     # 次へ
  458.     start_phase3
  459.   end
  460.   #---------------------------------------------------------
  461.   # ● アクターコマンドウィンドウのセットアップ
  462.   #----------------------------------------------------------
  463.   alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  464.   def phase3_setup_command_window
  465.     # CPスレッドを一時停止する
  466.     @cp_thread.stop = true
  467.     # ウィンドウのCP更新
  468.     @status_window.refresh_cp
  469.     # @active_battlerの防御を解除
  470.     @active_battler.now_guarding = false
  471.     # 効果音の再生
  472.     Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  473.     # 呼び戻す
  474.     xrxs_bp1_phase3_setup_command_window
  475.   end
  476.   #---------------------------------------------------------
  477.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  478.   #--------------------------------------------------------
  479.   alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  480.   def update_phase3_basic_command
  481.     # C ボタンが押された場合
  482.     if Input.trigger?(Input::C)
  483.       # アクターコマンドウィンドウのカーソル位置で分岐
  484.       case @actor_command_window.index
  485.       when @cp_escape_actor_command_index # 逃げる
  486.         if $game_temp.battle_can_escape
  487.           # 決定 SE を演奏
  488.           $game_system.se_play($data_system.decision_se)
  489.           # アクションを設定
  490.           @active_battler.current_action.kind = 0
  491.           @active_battler.current_action.basic = 4
  492.           # 次のアクターのコマンド入力へ
  493.           phase3_next_actor
  494.         else
  495.           # ブザー SE を演奏
  496.           $game_system.se_play($data_system.buzzer_se)
  497.         end
  498.       return
  499.       end
  500.     end
  501.     xrxs_bsp1_update_phase3_basic_command
  502.   end
  503.   #-------------------------------------------------------------
  504.   # ● メインフェーズ開始
  505.   #-------------------------------------------------------------
  506.   alias xrxs_bp1_start_phase4 start_phase4
  507.   def start_phase4
  508.     # 呼び戻す
  509.     xrxs_bp1_start_phase4
  510.     # CPスレッドを一時停止する
  511.     unless @action_battlers.empty?
  512.       @cp_thread.stop = true
  513.     end
  514.   end
  515.   #-------------------------------------------------------
  516.   # ● 行動順序作成
  517.   #-------------------------------------------------------
  518.   alias xrxs_bp1_make_action_orders make_action_orders
  519.   def make_action_orders
  520.     xrxs_bp1_make_action_orders
  521.     # 全員のCPを確認
  522.     exclude_battler = []
  523.     for battler in @action_battlers
  524.       # CPが不足している場合は @action_battlers から除外する
  525.       if battler.cp < 65535
  526.         exclude_battler.push(battler)
  527.       end
  528.     end
  529.     @action_battlers -= exclude_battler
  530.   end
  531.   #-----------------------------------------------------------
  532.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  533.   #------------------------------------------------------------
  534.   alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  535.   def update_phase4_step1
  536.     # 初期化
  537.     @phase4_act_continuation = 0
  538.     # 勝敗判定
  539.     if judge
  540.       @cp_thread.stop
  541.       # 勝利または敗北の場合 : メソッド終了
  542.       return
  543.     end
  544.     # 未行動バトラー配列の先頭から取得
  545.     @active_battler = @action_battlers[0]
  546.     # ステータス更新をCPだけに限定。
  547.     @status_window.update_cp_only = true
  548.     # ステート更新を禁止。
  549.     @active_battler.slip_state_update_ban = true if @active_battler != nil
  550.     # 戻す
  551.     xrxs_bp1_update_phase4_step1
  552.     # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  553.     if @phase4_step != 2
  554.       # リフレッシュ
  555.       @status_window.refresh
  556.       # 軽量化:たったコレだけΣ(?w?
  557.       Graphics.frame_reset
  558.     end
  559.     # 禁止を解除
  560.     @status_window.update_cp_only = false
  561.     @active_battler.slip_state_update_ban = false if @active_battler != nil
  562.   end
  563.   #-------------------------------------------------------------
  564.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  565.   #----------------------------------------------------------
  566.   alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  567.   def update_phase4_step2
  568.     # 強制アクションでなければ
  569.     unless @active_battler.current_action.forcing
  570.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  571.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  572.         # アクションに攻撃を設定
  573.         @active_battler.current_action.kind = 0
  574.         @active_battler.current_action.basic = 0
  575.       end
  576.       # 制約が [行動できない] の場合
  577.       if @active_battler.restriction == 4
  578.         # アクション強制対象のバトラーをクリア
  579.         $game_temp.forcing_battler = nil
  580.         if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  581.           # ステート自然解除
  582.           @active_battler.remove_states_auto
  583.           # CP消費
  584.           @active_battler.cp -= 65535
  585.           # ステータスウィンドウをリフレッシュ
  586.           @status_window.refresh
  587.         end
  588.         # ステップ 1 に移行
  589.         @phase4_step = 1
  590.         return
  591.       end
  592.     end
  593.     # アクションの種別で分岐
  594.     case @active_battler.current_action.kind
  595.     when 0
  596.       # 攻撃?防御?逃げる?何もしない時の共通消費CP
  597.       @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  598.     when 1
  599.       # スキル使用時の消費CP
  600.       @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  601.     when 2
  602.       # アイテム使用時の消費CP
  603.       @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  604.     end
  605.     # ステート自然解除
  606.     @active_battler.remove_states_auto
  607.     # 呼び戻す
  608.     xrxs_bp1_update_phase4_step2
  609.   end
  610.   #-----------------------------------------------------------
  611.   # ● 基本アクション 結果作成
  612.   #-----------------------------------------------------------
  613.   alias xrxs_bp1_make_basic_action_result make_basic_action_result
  614.   def make_basic_action_result
  615.     # 攻撃の場合
  616.     if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  617.       @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  618.     end
  619.     # 防御の場合
  620.     if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  621.       @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  622.       # @active_battlerの防御をON
  623.       @active_battler.now_guarding = true
  624.     end
  625.     # 敵の逃げるの場合
  626.     if @active_battler.is_a?(Game_Enemy) and
  627.       @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  628.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  629.     end
  630.     # 何もしないの場合
  631.     if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  632.       @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  633.     end
  634.     # 逃げるの場合
  635.     if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  636.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  637.       # 逃走可能ではない場合
  638.       if $game_temp.battle_can_escape == false
  639.         # ブザー SE を演奏
  640.         $game_system.se_play($data_system.buzzer_se)
  641.         return
  642.       end
  643.       # 逃走処理
  644.       update_phase2_escape
  645.       return
  646.     end
  647.     # 呼び戻す
  648.     xrxs_bp1_make_basic_action_result
  649.   end
  650.   #-------------------------------------------------------------
  651.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  652.   #-----------------------------------------------------------
  653.   alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  654.   def update_phase4_step6
  655.     # スリップダメージ
  656.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  657.       @active_battler.slip_damage_effect
  658.       @active_battler.damage_pop = true
  659.       # ステータスウィンドウをリフレッシュ
  660.       @status_window.refresh
  661.     end
  662.     # 呼び戻す
  663.     xrxs_bp1_update_phase4_step6
  664.   end
  665. end
  666. #==============================================================
  667. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  668. #==============================================================
复制代码

点评

感激不尽!  发表于 2019-2-27 14:51

评分

参与人数 1星屑 +200 赞 +1 收起 理由
RyanBern + 200 + 1 认可答案

查看全部评分

聪聪全国第三帅...
他们都叫我【人赢聪】
我的RM能力雷达图:

回复

使用道具 举报

梦石
0
星屑
311
在线时间
34 小时
注册时间
2017-10-31
回帖
9
发表于 2019-3-7 10:47:10 | 显示全部楼层
那问下这个脚本怎么添加第二个技能呢........我试了加上第二个第一个就没效果了= =
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部