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

Project1

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

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3836
在线时间
1965 小时
注册时间
2013-1-3
帖子
9536
跳转到指定楼层
1
发表于 2019-2-26 17:14:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

测试.rar

194.39 KB, 下载次数: 48

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

Lv4.逐梦者 (版主)

聪仔

梦石
0
星屑
6182
在线时间
3077 小时
注册时间
2013-12-26
帖子
3145
2
发表于 2019-2-26 17:15:36 | 只看该作者
又没工程又没链接的怎么帮你...

点评

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

回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

聪仔

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

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

点评

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

评分

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

查看全部评分

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

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
311
在线时间
34 小时
注册时间
2017-10-31
帖子
12
4
发表于 2019-3-7 10:47:10 | 只看该作者
那问下这个脚本怎么添加第二个技能呢........我试了加上第二个第一个就没效果了= =
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 21:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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