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

Project1

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

[已经过期] XP怎么实现才能像MZ的战斗即时制

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
跳转到指定楼层
1
发表于 2023-3-3 22:34:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 契约师Vi 于 2023-3-3 22:38 编辑

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

QQ截图20230303223029.png (232.58 KB, 下载次数: 4)

QQ截图20230303223029.png

Lv5.捕梦者

梦石
0
星屑
37759
在线时间
5385 小时
注册时间
2006-11-10
帖子
6545
2
发表于 2023-3-4 18:35:19 | 只看该作者
搜索 RTAB 脚本

不过这个系统冲突相当大, 慎用

点评

确实冲突太多了,如果能单独拿出来就好了,如果能(即时制)这样对玩家反应力也有所考验。  发表于 2023-3-5 19:11
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6241
在线时间
1098 小时
注册时间
2015-8-15
帖子
657
3
发表于 2023-3-7 11:02:51 | 只看该作者
本帖最后由 金芒芒 于 2023-3-7 11:06 编辑

CP制有两种一种是冷却系,一种是事件推动https://rpg.blue/thread-120760-1-1.html这种没冲突不过是战棋的要你自己修改一下

战棋CP.png (100 KB, 下载次数: 1)

战棋CP.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 03:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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