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

Project1

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

唉呀,天气好热呀,在加上出了个难题,热上加热!

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2007-2-7
帖子
388
跳转到指定楼层
1
发表于 2007-6-19 18:13:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
事情是这样的...这件事情说来有点复杂..请容我慢慢讲...
我是一个古代武侠游戏迷,,,所以打算做轩辕剑这一类型的游戏...
我用的脚本比较多,
有 三国群侠 的 3远景 ,有 轩辕剑菜单 . 战斗模式是whrm的 全动画战斗脚本...
可是即时战斗,我想拿 惑 里的的即时战斗脚本!
可是你看马上就出现问题了.


战斗时是好的.



战斗结束后就出现问题了.




经我测试,即时战斗问题是的.可是和我的那些脚本在一起就出问题了!
谁能帮帮我?

  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
  3. # ————————————————————————————————————
  4. # CP条 by:神思   整合by:doranikofu @ acg.cnplayer.com


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

  7. #==============================================================================
  8. # □ カスタマイズポイント
  9. #==============================================================================
  10. module XRXS_BP1
  11. #
  12. # 对齐方式。0:左 1:中央 2:右
  13. #
  14. ALIGN = 0
  15. #
  16. # 人数
  17. #
  18. MAX = 4
  19. end

  20. module RPG
  21.   module Cache
  22.     def self.system(filename)
  23.       self.load_bitmap("Graphics/System/", filename)
  24.     end
  25.   end
  26. end
  27. module SetCP
  28.   ActorBar = {1=>"A_a", 2=>"A_zzh", 3=>"A_fzx"}
  29.   EnemyBar = {
  30.   1=>"E_boss"}
  31. end


  32. class Scene_Battle_CP
  33. #
  34. # 战斗速度
  35. #
  36. BATTLE_SPEED = 1
  37. #
  38. # 战斗开始的时候气槽百分比
  39. #
  40. START_CP_PERCENT = 50
  41. end

  42. class Scene_Battle

  43. # 效果音效,可以自己添加
  44. DATA_SYSTEM_COMMAND_UP_SE = "swdslg_action.ogg"

  45. # 各项数值功能消耗的CP值
  46. CP_COST_BASIC_ACTIONS = 0 # 基础共同
  47. CP_COST_SKILL_ACTION = 65535 # 技能
  48. CP_COST_ITEM_ACTION = 65535 # 物品
  49. CP_COST_BASIC_ATTACK = 55535 # 攻撃
  50. CP_COST_BASIC_GUARD = 32768 # 防御
  51. CP_COST_BASIC_NOTHING = 25535 # 不做任何事情
  52. CP_COST_BASIC_ESCAPE = 45535 # 逃跑
  53. end

  54. #==============================================================================
  55. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  56. #------------------------------------------------------------------------------
  57. # Window_Commandクラスに add_command メソッドを追加します。
  58. #==============================================================================
  59. module XRXS_Window_Command_Add_Command
  60. #--------------------------------------------------------------------------
  61. # ○ コマンドを追加
  62. #--------------------------------------------------------------------------
  63. def add_command(command)
  64. # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  65. #
  66. if @disabled == nil
  67. @disabled = []
  68. end
  69. if @commands.size != @disabled.size
  70. for i in [email protected]
  71. @disabled[i] = false
  72. end
  73. end
  74. #
  75. # 追加
  76. #
  77. @commands.push(command)
  78. @disabled.push(false)
  79. @item_max = @commands.size
  80. self.y -= 32
  81. self.height += 32
  82. self.contents.dispose
  83. self.contents = nil
  84. self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  85. refresh
  86. for i in [email protected]
  87. if @disabled[i]
  88. disable_item(i)
  89. end
  90. end
  91. end
  92. #--------------------------------------------------------------------------
  93. # ○ 項目の無効化
  94. # index : 項目番号
  95. #--------------------------------------------------------------------------
  96. def disable_item(index)
  97. if @disabled == nil
  98. @disabled = []
  99. end
  100. @disabled[index] = true
  101. draw_item(index, disabled_color)
  102. end
  103. end
  104. class Window_Command < Window_Selectable
  105. #--------------------------------------------------------------------------
  106. # ○ インクルード
  107. #--------------------------------------------------------------------------
  108. include XRXS_Window_Command_Add_Command
  109. #--------------------------------------------------------------------------
  110. # ● 項目の無効化
  111. # index : 項目番号
  112. #--------------------------------------------------------------------------
  113. def disable_item(index)
  114. super
  115. end
  116. end
  117. #==============================================================================
  118. # □ Scene_Battle_CP
  119. #==============================================================================
  120. class Scene_Battle_CP
  121. #--------------------------------------------------------------------------
  122. # ○ 公開インスタンス変数
  123. #--------------------------------------------------------------------------
  124.   include SetCP
  125.   attr_accessor :ttbar
  126.   attr_accessor :stop # CP加算ストップ
  127.   attr_accessor :refresh
  128. #----------------------------------------------------------------------------
  129. # ○ オブジェクトの初期化
  130. #----------------------------------------------------------------------------
  131. def initialize
  132. @refresh = Hash.new(false)
  133. @battlers = []
  134. #@cancel = false
  135. @stop = false
  136. @agi_total = 0

  137.     @v = Viewport.new(0, 266, 640, 65)
  138.     @v.z = 60
  139.     @cpbar = Sprite.new(@v)
  140.     @cpbar.bitmap = RPG::Cache.system("atb")
  141.     @ttbar = {}
  142. # 配列 count_battlers を初期化
  143. count_battlers = []
  144. # エネミーを配列 count_battlers に追加
  145. for enemy in $game_troop.enemies
  146. count_battlers.push(enemy)
  147. end
  148. # アクターを配列 count_battlers に追加
  149. for actor in $game_party.actors
  150. count_battlers.push(actor)
  151. end
  152. inum=0
  153. for battler in count_battlers
  154. @agi_total += battler.agi
  155. inum += 1
  156. end
  157. @agi_total /= inum
  158. inum=0
  159. for battler in count_battlers
  160. battler.cp = [[65535 * START_CP_PERCENT * rand(20) *5* battler.agi / @agi_total / 10000, 0].max, 65535].min
  161. #end
  162. #    for battler in $game_party.actors + $game_troop.enemies
  163.       
  164.       @ttbar[battler] = CPSprite.new
  165.       if battler.is_a?(Game_Actor)
  166.         @ttbar[battler].bitmap = RPG::Cache.system("actor").dup
  167.           bitmap = RPG::Cache.system(ActorBar[battler.id])
  168.         @ttbar[battler].bitmap.blt(2,-1,bitmap,bitmap.rect)
  169.       else
  170.         @ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
  171.           bitmap = RPG::Cache.system(EnemyBar[battler.id])
  172.         @ttbar[battler].bitmap.blt(1,-1,bitmap,bitmap.rect)
  173.       end
  174.       @ttbar[battler].y = 289
  175.       @ttbar[battler].z = 151
  176.       @ttbar[battler].visible = false
  177.      end
  178.   #end
  179. end
  180. #----------------------------------------------------------------------------
  181. # ○ CPカウントアップ
  182. #----------------------------------------------------------------------------
  183. def update
  184. # ストップされているならリターン
  185.     @ttbar.each{|key, value|
  186.     if value.disposed?
  187.       @ttbar.delete(key)
  188.       next
  189.     end
  190.     value.update}
  191.     return if @stop
  192.     #return if @stop
  193. #
  194. for battler in $game_party.actors + $game_troop.enemies
  195. # 行動出来なければ無視
  196. if battler.dead? == true or battler.hidden
  197.         if @ttbar.include?(battler) and battler.is_a?(Game_Enemy)
  198.           @ttbar[battler].collapse
  199.           #@ttbar[battler].dispose
  200.           #@ttbar.delete(battler)
  201.         end
  202.         if battler.is_a?(Game_Actor)
  203.           @ttbar[battler].blend_type = 1
  204.           @ttbar[battler].x = 45
  205.         end
  206. battler.cp = 0
  207. next
  208. end
  209. #battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  210. battler.cp = [battler.cp + BATTLE_SPEED * 512 * battler.agi / @agi_total, 65535].min
  211.       if battler.cp == 65535
  212.         @refresh[battler] = false
  213.         case battler
  214.         when Game_Actor
  215.           @ttbar[battler].bitmap = RPG::Cache.system("actor_active").dup
  216.             bitmap = RPG::Cache.system(ActorBar[battler.id]+"_act")
  217.           @ttbar[battler].bitmap.blt(2,-1,bitmap,bitmap.rect)
  218.         when Game_Enemy
  219.           @ttbar[battler].bitmap = RPG::Cache.system("enemy_active").dup
  220.             bitmap = RPG::Cache.system(EnemyBar[battler.id]+"_act")
  221.           @ttbar[battler].bitmap.blt(1,-1,bitmap,bitmap.rect)
  222.         end
  223.         @ttbar[battler].z = 200
  224.       elsif battler.cp < 65535 and @refresh[battler] == true
  225.         @refresh[battler] = false
  226.         case battler
  227.         when Game_Actor
  228.           @ttbar[battler].bitmap = RPG::Cache.system("actor").dup
  229.             bitmap = RPG::Cache.system(ActorBar[battler.id])
  230.           @ttbar[battler].bitmap.blt(2,-1,bitmap,bitmap.rect)
  231.         when Game_Enemy
  232.           @ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
  233.             bitmap = RPG::Cache.system(EnemyBar[battler.id])
  234.           @ttbar[battler].bitmap.blt(1,-1,bitmap,bitmap.rect)
  235.         end
  236.         @ttbar[battler].z = 150
  237.       end        
  238.       @ttbar[battler].visible = true if @ttbar[battler].visible == false
  239.       @ttbar[battler].blend_type = 0 if !battler.dead?
  240.       @ttbar[battler].x  = [514 * battler.cp / 65535 + 45,45].max if !battler.dead?
  241.     end

  242. #end
  243. end
  244. #----------------------------------------------------------------------------
  245. # ○ CPカウントの開始
  246. #----------------------------------------------------------------------------

  247. #def stop
  248. #  @cancel = true
  249.   #if @cp_thread != nil then
  250.   #@cp_thread.join
  251.   #@cp_thread = nil
  252. #end

  253.   def dispose
  254.     @v.dispose
  255.     @cpbar.bitmap.dispose
  256.     @cpbar.dispose

  257.     for v in @ttbar.values
  258.       v.dispose
  259.     end
  260.   end
  261.   def clean ###相当恶心的低级办法在战斗结束清除死亡角色
  262.     for battler in $game_party.actors + $game_troop.enemies
  263.       if battler.dead? == true
  264.         if @ttbar.include?(battler)
  265.           @ttbar[battler].collapse
  266.         end
  267.       end
  268.     end
  269.   end
  270.   class CPSprite < ::Sprite
  271.     def initialize(v=nil)
  272.       super
  273.       @_collapse_duration = 0
  274.     end
  275.     def collapse
  276.       self.blend_type = 1
  277.       self.color.set(255, 64, 64, 255)
  278.       self.opacity = 255
  279.       @_collapse_duration = 10
  280.     end
  281.     def update
  282.       super
  283.       if @_collapse_duration > 0
  284.         @_collapse_duration -= 1
  285.         self.opacity = 250 - (10 - @_collapse_duration) * 25
  286.       end
  287.       if self.opacity == 0
  288.         self.dispose
  289.       end
  290.     end
  291.   end

  292. end

  293. #==============================================================================
  294. # ■ Game_Battler
  295. #==============================================================================
  296. class Game_Battler
  297. attr_accessor :now_guarding # 現在防御中フラグ
  298. attr_accessor :cp # 現在CP
  299. attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  300. #--------------------------------------------------------------------------
  301. # ○ CP の変更
  302. #--------------------------------------------------------------------------
  303. def cp=(p)
  304. @cp = [p, 65535].min
  305. #@cp = [[p, 0].max, 65535].min
  306. end
  307. #--------------------------------------------------------------------------
  308. # ● 防御中判定 [ 再定義 ]
  309. #--------------------------------------------------------------------------
  310. def guarding?
  311. return @now_guarding
  312. end
  313. #--------------------------------------------------------------------------
  314. # ● コマンド入力可能判定
  315. #--------------------------------------------------------------------------
  316. alias xrxs_bp1_inputable? inputable?
  317. def inputable?
  318. bool = xrxs_bp1_inputable?
  319. return (bool and (@cp >= 65535))
  320. end
  321. #--------------------------------------------------------------------------
  322. # ● ステート [スリップダメージ] 判定
  323. #--------------------------------------------------------------------------
  324. alias xrxs_bp1_slip_damage? slip_damage?
  325. def slip_damage?
  326. return false if @slip_state_update_ban
  327. return xrxs_bp1_slip_damage?
  328. end
  329. #--------------------------------------------------------------------------
  330. # ● ステート自然解除 (ターンごとに呼び出し)
  331. #--------------------------------------------------------------------------
  332. alias xrxs_bp1_remove_states_auto remove_states_auto
  333. def remove_states_auto
  334. return if @slip_state_update_ban
  335. xrxs_bp1_remove_states_auto
  336. end
  337. end
  338. #==============================================================================
  339. # ■ Game_Actor
  340. #==============================================================================
  341. class Game_Actor < Game_Battler
  342. #--------------------------------------------------------------------------
  343. # ● セットアップ
  344. #--------------------------------------------------------------------------
  345. alias xrxs_bp1_setup setup
  346. def setup(actor_id)
  347. xrxs_bp1_setup(actor_id)
  348. @cp = 0
  349. @now_guarding = false
  350. @slip_state_update_ban = false
  351. end
  352. end
  353. #==============================================================================
  354. # ■ Game_Enemy
  355. #==============================================================================
  356. class Game_Enemy < Game_Battler
  357. #--------------------------------------------------------------------------
  358. # ● オブジェクト初期化
  359. #--------------------------------------------------------------------------
  360. alias xrxs_bp1_initialize initialize
  361. def initialize(troop_id, member_index)
  362. xrxs_bp1_initialize(troop_id, member_index)
  363. @cp = 0
  364. @now_guarding = false
  365. @slip_state_update_ban = false
  366. end
  367. end


  368. #==============================================================================
  369. # ■ Window_BattleStatus
  370. #==============================================================================
  371. class Window_BattleStatus < Window_Base
  372. #--------------------------------------------------------------------------
  373. # ○ 公開インスタンス変数
  374. #--------------------------------------------------------------------------
  375. attr_accessor :update_cp_only # CPメーターのみの更新
  376. #--------------------------------------------------------------------------
  377. # ● オブジェクト初期化
  378. #--------------------------------------------------------------------------
  379. alias xrxs_bp1_initialize initialize
  380. def initialize
  381. @update_cp_only = false
  382. xrxs_bp1_initialize
  383. end
  384. #--------------------------------------------------------------------------
  385. # ● リフレッシュ
  386. #--------------------------------------------------------------------------
  387. alias xrxs_bp1_refresh refresh
  388. def refresh
  389. unless @update_cp_only
  390. xrxs_bp1_refresh
  391. end
  392. #refresh_cp
  393. end

  394. end
  395. =begin
  396. #--------------------------------------------------------------------------
  397. # ○ リフレッシュ(CPのみ)
  398. #--------------------------------------------------------------------------
  399. def refresh_cp
  400. for i in 0...$game_party.actors.size
  401. actor = $game_party.actors[i]
  402. width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  403. space = 146#self.width / XRXS_BP1::MAX
  404. case XRXS_BP1::ALIGN
  405. when 0
  406. actor_x = i * space + 4
  407. when 1
  408. actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  409. when 2
  410. actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  411. end
  412. actor_x += self.x
  413. draw_actor_cp_meter(actor, actor_x + 19, 98, width, 0)
  414. end
  415. end
  416. #--------------------------------------------------------------------------
  417. # ○ CPメーター の描画
  418. #--------------------------------------------------------------------------
  419. def draw_actor_cp_meter(actor, x, y, width = 100, type = 0) #156
  420. self.contents.font.color = system_color
  421. self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  422. if actor.cp == nil
  423. actor.cp = 0
  424. end
  425. w = width * [actor.cp,65535].min / 65535
  426. self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  427. self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  428. self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  429. self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  430. end
  431. end

  432. =end
  433. #==============================================================================
  434. # ■ Scene_Battle
  435. #==============================================================================
  436. class Scene_Battle



  437. #--------------------------------------------------------------------------
  438. # ● フレーム更新
  439. #--------------------------------------------------------------------------
  440. alias xrxs_bp1_update update
  441. def update
  442. xrxs_bp1_update
  443. # CP更新
  444. @battler_cp.update


  445. #@cp_thread.update

  446. end
  447. #--------------------------------------------------------------------------
  448. # ● バトル終了
  449. # result : 結果 (0:勝利 1:敗北 2:逃走)
  450. #--------------------------------------------------------------------------
  451. alias xrxs_bp1_battle_end battle_end
  452. def battle_end(result)
  453. # CPカウントを停止する
  454. @battler_cp.stop
  455. #@cp_thread.stop
  456. # 呼び戻す
  457. xrxs_bp1_battle_end(result)
  458. end
  459. #--------------------------------------------------------------------------
  460. # ● プレバトルフェーズ開始
  461. #--------------------------------------------------------------------------
  462. alias xrxs_bp1_start_phase1 start_phase1
  463. def start_phase1
  464. @agi_total = 0
  465. # CP加算を開始する
  466. #@cp_thread = Scene_Battle_CP.new
  467. @battler_cp = Scene_Battle_CP.new
  468. # インデックスを計算
  469. @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  470. # アクターコマンドウィンドウに追加
  471. @actor_command_window.add_command("逃跑")
  472. if !$game_temp.battle_can_escape
  473. @actor_command_window.disable_item(@cp_escape_actor_command_index)
  474. end
  475. # 呼び戻す
  476. xrxs_bp1_start_phase1
  477. end
  478. #--------------------------------------------------------------------------
  479. # ● パーティコマンドフェーズ開始
  480. #--------------------------------------------------------------------------
  481. alias xrxs_bp1_start_phase2 start_phase2
  482. def start_phase2
  483. xrxs_bp1_start_phase2
  484. @party_command_window.active = false
  485. @party_command_window.visible = false
  486. # CP加算を再開する
  487. #@cp_thread.stop = false
  488. @battler_cp.stop = false
  489. @status_window.refresh
  490. # 次へ
  491. start_phase3
  492. end
  493. #--------------------------------------------------------------------------
  494. # ● アクターコマンドウィンドウのセットアップ
  495. #--------------------------------------------------------------------------
  496. alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  497. def phase3_setup_command_window
  498. # CPスレッドを一時停止する
  499. #@cp_thread.stop = true
  500. @battler_cp.stop = true
  501. # ウィンドウのCP更新
  502. #@status_window.refresh_cp
  503. # @active_battlerの防御を解除
  504. @active_battler.now_guarding = false

  505. #● 効果音の再生
  506. #● menu pop SE
  507.   if Input.trigger?(Input::B)
  508.    $game_system.se_play($data_system.buzzer_se)
  509.   else
  510.    $game_system.se_play2(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  511.   end
  512. # 呼び戻す
  513. xrxs_bp1_phase3_setup_command_window
  514. end
  515. #--------------------------------------------------------------------------
  516. # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  517. #--------------------------------------------------------------------------
  518. alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  519. def update_phase3_basic_command
  520. @status_window.refresh
  521. # C ボタンが押された場合
  522. if Input.trigger?(Input::C)
  523. # アクターコマンドウィンドウのカーソル位置で分岐
  524. case @actor_command_window.index
  525. when @cp_escape_actor_command_index # 逃げる
  526. if $game_temp.battle_can_escape
  527. # 決定 SE を演奏
  528. $game_system.se_play($data_system.decision_se)
  529. # アクションを設定
  530. @active_battler.current_action.kind = 0
  531. @active_battler.current_action.basic = 4
  532. # 次のアクターのコマンド入力へ
  533. phase3_next_actor
  534. else
  535. # ブザー SE を演奏
  536. $game_system.se_play($data_system.buzzer_se)

  537. end
  538. return
  539. end
  540. end
  541. xrxs_bsp1_update_phase3_basic_command
  542. end
  543. #--------------------------------------------------------------------------
  544. # ● メインフェーズ開始
  545. #--------------------------------------------------------------------------
  546. alias xrxs_bp1_start_phase4 start_phase4
  547. def start_phase4
  548. # 呼び戻す
  549. xrxs_bp1_start_phase4
  550. # CPスレッドを一時停止する
  551. unless @action_battlers.empty?
  552. #@cp_thread.stop = true
  553. @battler_cp.stop = true
  554. $game_temp.battle_turn += 1
  555. end
  556. end
  557. #--------------------------------------------------------------------------
  558. # ● 行動順序作成
  559. #--------------------------------------------------------------------------
  560. alias xrxs_bp1_make_action_orders make_action_orders
  561. def make_action_orders
  562. xrxs_bp1_make_action_orders
  563. # 全員のCPを確認
  564. exclude_battler = []
  565. for battler in @action_battlers
  566. # CPが不足している場合は @action_battlers から除外する
  567. if battler.cp < 65535
  568. exclude_battler.push(battler)
  569. end
  570. end
  571. @action_battlers -= exclude_battler
  572. end
  573. #--------------------------------------------------------------------------
  574. # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  575. #--------------------------------------------------------------------------
  576. alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  577. def update_phase4_step1
  578. # 初期化
  579. @phase4_act_continuation = 0
  580. # 勝敗判定
  581. if judge
  582. #@cp_thread.stop
  583. @battler_cp.stop
  584. # 勝利または敗北の場合 : メソッド終了
  585. return
  586. end
  587. # 未行動バトラー配列の先頭から取得
  588. @active_battler = @action_battlers[0]
  589. # ステータス更新をCPだけに限定。
  590. @status_window.update_cp_only = true
  591. # ステート更新を禁止。
  592. @active_battler.slip_state_update_ban = true if @active_battler != nil
  593. # 戻す
  594. xrxs_bp1_update_phase4_step1
  595. # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  596. if @phase4_step != 2
  597. # リフレッシュ
  598. @status_window.refresh
  599. # 軽量化:たったコレだけΣ(?w?
  600. Graphics.frame_reset
  601. end
  602. # 禁止を解除
  603. @status_window.update_cp_only = false
  604. @active_battler.slip_state_update_ban = false if @active_battler != nil
  605. end
  606. #--------------------------------------------------------------------------
  607. # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  608. #--------------------------------------------------------------------------
  609. alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  610. def update_phase4_step2
  611. # 強制アクションでなければ
  612. unless @active_battler.current_action.forcing
  613. # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  614. if @active_battler.restriction == 2 or @active_battler.restriction == 3
  615. # アクションに攻撃を設定
  616. @active_battler.current_action.kind = 0
  617. @active_battler.current_action.basic = 0
  618. end
  619. # 制約が [行動できない] の場合
  620. if @active_battler.restriction == 4
  621. # アクション強制対象のバトラーをクリア
  622. $game_temp.forcing_battler = nil
  623. if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  624. # ステート自然解除
  625. @active_battler.remove_states_auto
  626. # CP消費
  627. @active_battler.cp -= 65535
  628. # ステータスウィンドウをリフレッシュ
  629. @status_window.refresh
  630. end
  631. # ステップ 1 に移行
  632. @phase4_step = 1
  633. return
  634. end
  635. end
  636. # アクションの種別で分岐
  637. case @active_battler.current_action.kind
  638. when 0
  639. # 攻撃?防御?逃げる?何もしない時の共通消費CP
  640. @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  641. when 1
  642. # スキル使用時の消費CP
  643. @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  644. when 2
  645. # アイテム使用時の消費CP
  646. @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  647. end
  648. # ステート自然解除
  649. @active_battler.remove_states_auto
  650. @status_window.refresh
  651. # 呼び戻す
  652. xrxs_bp1_update_phase4_step2
  653. end
  654. #--------------------------------------------------------------------------
  655. # ● 基本アクション 結果作成
  656. #--------------------------------------------------------------------------
  657. alias xrxs_bp1_make_basic_action_result make_basic_action_result
  658. def make_basic_action_result
  659. # 攻撃の場合
  660. if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  661. @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  662. end
  663. # 防御の場合
  664. if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  665. @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  666. # @active_battlerの防御をON
  667. @active_battler.now_guarding = true
  668. end
  669. # 敵の逃げるの場合
  670. if @active_battler.is_a?(Game_Enemy) and
  671. @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  672. @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  673. end
  674. # 何もしないの場合
  675. if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  676. @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  677. end
  678. # 逃げるの場合
  679. if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  680. @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  681. # 逃走可能ではない場合
  682. if $game_temp.battle_can_escape == false
  683. # ブザー SE を演奏
  684. $game_system.se_play($data_system.buzzer_se)
  685. return
  686. end
  687. # 逃走処理
  688. update_phase2_escape
  689. return
  690. end
  691. # 呼び戻す
  692. xrxs_bp1_make_basic_action_result
  693. end
  694. #--------------------------------------------------------------------------
  695. # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  696. #--------------------------------------------------------------------------
  697. alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  698. def update_phase4_step6
  699. # スリップダメージ
  700. if @active_battler.hp > 0 and @active_battler.slip_damage?
  701. @active_battler.slip_damage_effect
  702. @active_battler.damage_pop = true
  703. # ステータスウィンドウをリフレッシュ

  704. end
  705. @status_window.refresh
  706. # 呼び戻す
  707. xrxs_bp1_update_phase4_step6
  708. end

  709. end
复制代码

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2007-2-7
帖子
388
2
 楼主| 发表于 2007-6-19 18:13:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
事情是这样的...这件事情说来有点复杂..请容我慢慢讲...
我是一个古代武侠游戏迷,,,所以打算做轩辕剑这一类型的游戏...
我用的脚本比较多,
有 三国群侠 的 3远景 ,有 轩辕剑菜单 . 战斗模式是whrm的 全动画战斗脚本...
可是即时战斗,我想拿 惑 里的的即时战斗脚本!
可是你看马上就出现问题了.


战斗时是好的.



战斗结束后就出现问题了.




经我测试,即时战斗问题是的.可是和我的那些脚本在一起就出问题了!
谁能帮帮我?

  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
  3. # ————————————————————————————————————
  4. # CP条 by:神思   整合by:doranikofu @ acg.cnplayer.com


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

  7. #==============================================================================
  8. # □ カスタマイズポイント
  9. #==============================================================================
  10. module XRXS_BP1
  11. #
  12. # 对齐方式。0:左 1:中央 2:右
  13. #
  14. ALIGN = 0
  15. #
  16. # 人数
  17. #
  18. MAX = 4
  19. end

  20. module RPG
  21.   module Cache
  22.     def self.system(filename)
  23.       self.load_bitmap("Graphics/System/", filename)
  24.     end
  25.   end
  26. end
  27. module SetCP
  28.   ActorBar = {1=>"A_a", 2=>"A_zzh", 3=>"A_fzx"}
  29.   EnemyBar = {
  30.   1=>"E_boss"}
  31. end


  32. class Scene_Battle_CP
  33. #
  34. # 战斗速度
  35. #
  36. BATTLE_SPEED = 1
  37. #
  38. # 战斗开始的时候气槽百分比
  39. #
  40. START_CP_PERCENT = 50
  41. end

  42. class Scene_Battle

  43. # 效果音效,可以自己添加
  44. DATA_SYSTEM_COMMAND_UP_SE = "swdslg_action.ogg"

  45. # 各项数值功能消耗的CP值
  46. CP_COST_BASIC_ACTIONS = 0 # 基础共同
  47. CP_COST_SKILL_ACTION = 65535 # 技能
  48. CP_COST_ITEM_ACTION = 65535 # 物品
  49. CP_COST_BASIC_ATTACK = 55535 # 攻撃
  50. CP_COST_BASIC_GUARD = 32768 # 防御
  51. CP_COST_BASIC_NOTHING = 25535 # 不做任何事情
  52. CP_COST_BASIC_ESCAPE = 45535 # 逃跑
  53. end

  54. #==============================================================================
  55. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  56. #------------------------------------------------------------------------------
  57. # Window_Commandクラスに add_command メソッドを追加します。
  58. #==============================================================================
  59. module XRXS_Window_Command_Add_Command
  60. #--------------------------------------------------------------------------
  61. # ○ コマンドを追加
  62. #--------------------------------------------------------------------------
  63. def add_command(command)
  64. # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  65. #
  66. if @disabled == nil
  67. @disabled = []
  68. end
  69. if @commands.size != @disabled.size
  70. for i in [email protected]
  71. @disabled[i] = false
  72. end
  73. end
  74. #
  75. # 追加
  76. #
  77. @commands.push(command)
  78. @disabled.push(false)
  79. @item_max = @commands.size
  80. self.y -= 32
  81. self.height += 32
  82. self.contents.dispose
  83. self.contents = nil
  84. self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  85. refresh
  86. for i in [email protected]
  87. if @disabled[i]
  88. disable_item(i)
  89. end
  90. end
  91. end
  92. #--------------------------------------------------------------------------
  93. # ○ 項目の無効化
  94. # index : 項目番号
  95. #--------------------------------------------------------------------------
  96. def disable_item(index)
  97. if @disabled == nil
  98. @disabled = []
  99. end
  100. @disabled[index] = true
  101. draw_item(index, disabled_color)
  102. end
  103. end
  104. class Window_Command < Window_Selectable
  105. #--------------------------------------------------------------------------
  106. # ○ インクルード
  107. #--------------------------------------------------------------------------
  108. include XRXS_Window_Command_Add_Command
  109. #--------------------------------------------------------------------------
  110. # ● 項目の無効化
  111. # index : 項目番号
  112. #--------------------------------------------------------------------------
  113. def disable_item(index)
  114. super
  115. end
  116. end
  117. #==============================================================================
  118. # □ Scene_Battle_CP
  119. #==============================================================================
  120. class Scene_Battle_CP
  121. #--------------------------------------------------------------------------
  122. # ○ 公開インスタンス変数
  123. #--------------------------------------------------------------------------
  124.   include SetCP
  125.   attr_accessor :ttbar
  126.   attr_accessor :stop # CP加算ストップ
  127.   attr_accessor :refresh
  128. #----------------------------------------------------------------------------
  129. # ○ オブジェクトの初期化
  130. #----------------------------------------------------------------------------
  131. def initialize
  132. @refresh = Hash.new(false)
  133. @battlers = []
  134. #@cancel = false
  135. @stop = false
  136. @agi_total = 0

  137.     @v = Viewport.new(0, 266, 640, 65)
  138.     @v.z = 60
  139.     @cpbar = Sprite.new(@v)
  140.     @cpbar.bitmap = RPG::Cache.system("atb")
  141.     @ttbar = {}
  142. # 配列 count_battlers を初期化
  143. count_battlers = []
  144. # エネミーを配列 count_battlers に追加
  145. for enemy in $game_troop.enemies
  146. count_battlers.push(enemy)
  147. end
  148. # アクターを配列 count_battlers に追加
  149. for actor in $game_party.actors
  150. count_battlers.push(actor)
  151. end
  152. inum=0
  153. for battler in count_battlers
  154. @agi_total += battler.agi
  155. inum += 1
  156. end
  157. @agi_total /= inum
  158. inum=0
  159. for battler in count_battlers
  160. battler.cp = [[65535 * START_CP_PERCENT * rand(20) *5* battler.agi / @agi_total / 10000, 0].max, 65535].min
  161. #end
  162. #    for battler in $game_party.actors + $game_troop.enemies
  163.       
  164.       @ttbar[battler] = CPSprite.new
  165.       if battler.is_a?(Game_Actor)
  166.         @ttbar[battler].bitmap = RPG::Cache.system("actor").dup
  167.           bitmap = RPG::Cache.system(ActorBar[battler.id])
  168.         @ttbar[battler].bitmap.blt(2,-1,bitmap,bitmap.rect)
  169.       else
  170.         @ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
  171.           bitmap = RPG::Cache.system(EnemyBar[battler.id])
  172.         @ttbar[battler].bitmap.blt(1,-1,bitmap,bitmap.rect)
  173.       end
  174.       @ttbar[battler].y = 289
  175.       @ttbar[battler].z = 151
  176.       @ttbar[battler].visible = false
  177.      end
  178.   #end
  179. end
  180. #----------------------------------------------------------------------------
  181. # ○ CPカウントアップ
  182. #----------------------------------------------------------------------------
  183. def update
  184. # ストップされているならリターン
  185.     @ttbar.each{|key, value|
  186.     if value.disposed?
  187.       @ttbar.delete(key)
  188.       next
  189.     end
  190.     value.update}
  191.     return if @stop
  192.     #return if @stop
  193. #
  194. for battler in $game_party.actors + $game_troop.enemies
  195. # 行動出来なければ無視
  196. if battler.dead? == true or battler.hidden
  197.         if @ttbar.include?(battler) and battler.is_a?(Game_Enemy)
  198.           @ttbar[battler].collapse
  199.           #@ttbar[battler].dispose
  200.           #@ttbar.delete(battler)
  201.         end
  202.         if battler.is_a?(Game_Actor)
  203.           @ttbar[battler].blend_type = 1
  204.           @ttbar[battler].x = 45
  205.         end
  206. battler.cp = 0
  207. next
  208. end
  209. #battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  210. battler.cp = [battler.cp + BATTLE_SPEED * 512 * battler.agi / @agi_total, 65535].min
  211.       if battler.cp == 65535
  212.         @refresh[battler] = false
  213.         case battler
  214.         when Game_Actor
  215.           @ttbar[battler].bitmap = RPG::Cache.system("actor_active").dup
  216.             bitmap = RPG::Cache.system(ActorBar[battler.id]+"_act")
  217.           @ttbar[battler].bitmap.blt(2,-1,bitmap,bitmap.rect)
  218.         when Game_Enemy
  219.           @ttbar[battler].bitmap = RPG::Cache.system("enemy_active").dup
  220.             bitmap = RPG::Cache.system(EnemyBar[battler.id]+"_act")
  221.           @ttbar[battler].bitmap.blt(1,-1,bitmap,bitmap.rect)
  222.         end
  223.         @ttbar[battler].z = 200
  224.       elsif battler.cp < 65535 and @refresh[battler] == true
  225.         @refresh[battler] = false
  226.         case battler
  227.         when Game_Actor
  228.           @ttbar[battler].bitmap = RPG::Cache.system("actor").dup
  229.             bitmap = RPG::Cache.system(ActorBar[battler.id])
  230.           @ttbar[battler].bitmap.blt(2,-1,bitmap,bitmap.rect)
  231.         when Game_Enemy
  232.           @ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
  233.             bitmap = RPG::Cache.system(EnemyBar[battler.id])
  234.           @ttbar[battler].bitmap.blt(1,-1,bitmap,bitmap.rect)
  235.         end
  236.         @ttbar[battler].z = 150
  237.       end        
  238.       @ttbar[battler].visible = true if @ttbar[battler].visible == false
  239.       @ttbar[battler].blend_type = 0 if !battler.dead?
  240.       @ttbar[battler].x  = [514 * battler.cp / 65535 + 45,45].max if !battler.dead?
  241.     end

  242. #end
  243. end
  244. #----------------------------------------------------------------------------
  245. # ○ CPカウントの開始
  246. #----------------------------------------------------------------------------

  247. #def stop
  248. #  @cancel = true
  249.   #if @cp_thread != nil then
  250.   #@cp_thread.join
  251.   #@cp_thread = nil
  252. #end

  253.   def dispose
  254.     @v.dispose
  255.     @cpbar.bitmap.dispose
  256.     @cpbar.dispose

  257.     for v in @ttbar.values
  258.       v.dispose
  259.     end
  260.   end
  261.   def clean ###相当恶心的低级办法在战斗结束清除死亡角色
  262.     for battler in $game_party.actors + $game_troop.enemies
  263.       if battler.dead? == true
  264.         if @ttbar.include?(battler)
  265.           @ttbar[battler].collapse
  266.         end
  267.       end
  268.     end
  269.   end
  270.   class CPSprite < ::Sprite
  271.     def initialize(v=nil)
  272.       super
  273.       @_collapse_duration = 0
  274.     end
  275.     def collapse
  276.       self.blend_type = 1
  277.       self.color.set(255, 64, 64, 255)
  278.       self.opacity = 255
  279.       @_collapse_duration = 10
  280.     end
  281.     def update
  282.       super
  283.       if @_collapse_duration > 0
  284.         @_collapse_duration -= 1
  285.         self.opacity = 250 - (10 - @_collapse_duration) * 25
  286.       end
  287.       if self.opacity == 0
  288.         self.dispose
  289.       end
  290.     end
  291.   end

  292. end

  293. #==============================================================================
  294. # ■ Game_Battler
  295. #==============================================================================
  296. class Game_Battler
  297. attr_accessor :now_guarding # 現在防御中フラグ
  298. attr_accessor :cp # 現在CP
  299. attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  300. #--------------------------------------------------------------------------
  301. # ○ CP の変更
  302. #--------------------------------------------------------------------------
  303. def cp=(p)
  304. @cp = [p, 65535].min
  305. #@cp = [[p, 0].max, 65535].min
  306. end
  307. #--------------------------------------------------------------------------
  308. # ● 防御中判定 [ 再定義 ]
  309. #--------------------------------------------------------------------------
  310. def guarding?
  311. return @now_guarding
  312. end
  313. #--------------------------------------------------------------------------
  314. # ● コマンド入力可能判定
  315. #--------------------------------------------------------------------------
  316. alias xrxs_bp1_inputable? inputable?
  317. def inputable?
  318. bool = xrxs_bp1_inputable?
  319. return (bool and (@cp >= 65535))
  320. end
  321. #--------------------------------------------------------------------------
  322. # ● ステート [スリップダメージ] 判定
  323. #--------------------------------------------------------------------------
  324. alias xrxs_bp1_slip_damage? slip_damage?
  325. def slip_damage?
  326. return false if @slip_state_update_ban
  327. return xrxs_bp1_slip_damage?
  328. end
  329. #--------------------------------------------------------------------------
  330. # ● ステート自然解除 (ターンごとに呼び出し)
  331. #--------------------------------------------------------------------------
  332. alias xrxs_bp1_remove_states_auto remove_states_auto
  333. def remove_states_auto
  334. return if @slip_state_update_ban
  335. xrxs_bp1_remove_states_auto
  336. end
  337. end
  338. #==============================================================================
  339. # ■ Game_Actor
  340. #==============================================================================
  341. class Game_Actor < Game_Battler
  342. #--------------------------------------------------------------------------
  343. # ● セットアップ
  344. #--------------------------------------------------------------------------
  345. alias xrxs_bp1_setup setup
  346. def setup(actor_id)
  347. xrxs_bp1_setup(actor_id)
  348. @cp = 0
  349. @now_guarding = false
  350. @slip_state_update_ban = false
  351. end
  352. end
  353. #==============================================================================
  354. # ■ Game_Enemy
  355. #==============================================================================
  356. class Game_Enemy < Game_Battler
  357. #--------------------------------------------------------------------------
  358. # ● オブジェクト初期化
  359. #--------------------------------------------------------------------------
  360. alias xrxs_bp1_initialize initialize
  361. def initialize(troop_id, member_index)
  362. xrxs_bp1_initialize(troop_id, member_index)
  363. @cp = 0
  364. @now_guarding = false
  365. @slip_state_update_ban = false
  366. end
  367. end


  368. #==============================================================================
  369. # ■ Window_BattleStatus
  370. #==============================================================================
  371. class Window_BattleStatus < Window_Base
  372. #--------------------------------------------------------------------------
  373. # ○ 公開インスタンス変数
  374. #--------------------------------------------------------------------------
  375. attr_accessor :update_cp_only # CPメーターのみの更新
  376. #--------------------------------------------------------------------------
  377. # ● オブジェクト初期化
  378. #--------------------------------------------------------------------------
  379. alias xrxs_bp1_initialize initialize
  380. def initialize
  381. @update_cp_only = false
  382. xrxs_bp1_initialize
  383. end
  384. #--------------------------------------------------------------------------
  385. # ● リフレッシュ
  386. #--------------------------------------------------------------------------
  387. alias xrxs_bp1_refresh refresh
  388. def refresh
  389. unless @update_cp_only
  390. xrxs_bp1_refresh
  391. end
  392. #refresh_cp
  393. end

  394. end
  395. =begin
  396. #--------------------------------------------------------------------------
  397. # ○ リフレッシュ(CPのみ)
  398. #--------------------------------------------------------------------------
  399. def refresh_cp
  400. for i in 0...$game_party.actors.size
  401. actor = $game_party.actors[i]
  402. width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  403. space = 146#self.width / XRXS_BP1::MAX
  404. case XRXS_BP1::ALIGN
  405. when 0
  406. actor_x = i * space + 4
  407. when 1
  408. actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  409. when 2
  410. actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  411. end
  412. actor_x += self.x
  413. draw_actor_cp_meter(actor, actor_x + 19, 98, width, 0)
  414. end
  415. end
  416. #--------------------------------------------------------------------------
  417. # ○ CPメーター の描画
  418. #--------------------------------------------------------------------------
  419. def draw_actor_cp_meter(actor, x, y, width = 100, type = 0) #156
  420. self.contents.font.color = system_color
  421. self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  422. if actor.cp == nil
  423. actor.cp = 0
  424. end
  425. w = width * [actor.cp,65535].min / 65535
  426. self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  427. self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  428. self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  429. self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  430. end
  431. end

  432. =end
  433. #==============================================================================
  434. # ■ Scene_Battle
  435. #==============================================================================
  436. class Scene_Battle



  437. #--------------------------------------------------------------------------
  438. # ● フレーム更新
  439. #--------------------------------------------------------------------------
  440. alias xrxs_bp1_update update
  441. def update
  442. xrxs_bp1_update
  443. # CP更新
  444. @battler_cp.update


  445. #@cp_thread.update

  446. end
  447. #--------------------------------------------------------------------------
  448. # ● バトル終了
  449. # result : 結果 (0:勝利 1:敗北 2:逃走)
  450. #--------------------------------------------------------------------------
  451. alias xrxs_bp1_battle_end battle_end
  452. def battle_end(result)
  453. # CPカウントを停止する
  454. @battler_cp.stop
  455. #@cp_thread.stop
  456. # 呼び戻す
  457. xrxs_bp1_battle_end(result)
  458. end
  459. #--------------------------------------------------------------------------
  460. # ● プレバトルフェーズ開始
  461. #--------------------------------------------------------------------------
  462. alias xrxs_bp1_start_phase1 start_phase1
  463. def start_phase1
  464. @agi_total = 0
  465. # CP加算を開始する
  466. #@cp_thread = Scene_Battle_CP.new
  467. @battler_cp = Scene_Battle_CP.new
  468. # インデックスを計算
  469. @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  470. # アクターコマンドウィンドウに追加
  471. @actor_command_window.add_command("逃跑")
  472. if !$game_temp.battle_can_escape
  473. @actor_command_window.disable_item(@cp_escape_actor_command_index)
  474. end
  475. # 呼び戻す
  476. xrxs_bp1_start_phase1
  477. end
  478. #--------------------------------------------------------------------------
  479. # ● パーティコマンドフェーズ開始
  480. #--------------------------------------------------------------------------
  481. alias xrxs_bp1_start_phase2 start_phase2
  482. def start_phase2
  483. xrxs_bp1_start_phase2
  484. @party_command_window.active = false
  485. @party_command_window.visible = false
  486. # CP加算を再開する
  487. #@cp_thread.stop = false
  488. @battler_cp.stop = false
  489. @status_window.refresh
  490. # 次へ
  491. start_phase3
  492. end
  493. #--------------------------------------------------------------------------
  494. # ● アクターコマンドウィンドウのセットアップ
  495. #--------------------------------------------------------------------------
  496. alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  497. def phase3_setup_command_window
  498. # CPスレッドを一時停止する
  499. #@cp_thread.stop = true
  500. @battler_cp.stop = true
  501. # ウィンドウのCP更新
  502. #@status_window.refresh_cp
  503. # @active_battlerの防御を解除
  504. @active_battler.now_guarding = false

  505. #● 効果音の再生
  506. #● menu pop SE
  507.   if Input.trigger?(Input::B)
  508.    $game_system.se_play($data_system.buzzer_se)
  509.   else
  510.    $game_system.se_play2(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  511.   end
  512. # 呼び戻す
  513. xrxs_bp1_phase3_setup_command_window
  514. end
  515. #--------------------------------------------------------------------------
  516. # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  517. #--------------------------------------------------------------------------
  518. alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  519. def update_phase3_basic_command
  520. @status_window.refresh
  521. # C ボタンが押された場合
  522. if Input.trigger?(Input::C)
  523. # アクターコマンドウィンドウのカーソル位置で分岐
  524. case @actor_command_window.index
  525. when @cp_escape_actor_command_index # 逃げる
  526. if $game_temp.battle_can_escape
  527. # 決定 SE を演奏
  528. $game_system.se_play($data_system.decision_se)
  529. # アクションを設定
  530. @active_battler.current_action.kind = 0
  531. @active_battler.current_action.basic = 4
  532. # 次のアクターのコマンド入力へ
  533. phase3_next_actor
  534. else
  535. # ブザー SE を演奏
  536. $game_system.se_play($data_system.buzzer_se)

  537. end
  538. return
  539. end
  540. end
  541. xrxs_bsp1_update_phase3_basic_command
  542. end
  543. #--------------------------------------------------------------------------
  544. # ● メインフェーズ開始
  545. #--------------------------------------------------------------------------
  546. alias xrxs_bp1_start_phase4 start_phase4
  547. def start_phase4
  548. # 呼び戻す
  549. xrxs_bp1_start_phase4
  550. # CPスレッドを一時停止する
  551. unless @action_battlers.empty?
  552. #@cp_thread.stop = true
  553. @battler_cp.stop = true
  554. $game_temp.battle_turn += 1
  555. end
  556. end
  557. #--------------------------------------------------------------------------
  558. # ● 行動順序作成
  559. #--------------------------------------------------------------------------
  560. alias xrxs_bp1_make_action_orders make_action_orders
  561. def make_action_orders
  562. xrxs_bp1_make_action_orders
  563. # 全員のCPを確認
  564. exclude_battler = []
  565. for battler in @action_battlers
  566. # CPが不足している場合は @action_battlers から除外する
  567. if battler.cp < 65535
  568. exclude_battler.push(battler)
  569. end
  570. end
  571. @action_battlers -= exclude_battler
  572. end
  573. #--------------------------------------------------------------------------
  574. # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  575. #--------------------------------------------------------------------------
  576. alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  577. def update_phase4_step1
  578. # 初期化
  579. @phase4_act_continuation = 0
  580. # 勝敗判定
  581. if judge
  582. #@cp_thread.stop
  583. @battler_cp.stop
  584. # 勝利または敗北の場合 : メソッド終了
  585. return
  586. end
  587. # 未行動バトラー配列の先頭から取得
  588. @active_battler = @action_battlers[0]
  589. # ステータス更新をCPだけに限定。
  590. @status_window.update_cp_only = true
  591. # ステート更新を禁止。
  592. @active_battler.slip_state_update_ban = true if @active_battler != nil
  593. # 戻す
  594. xrxs_bp1_update_phase4_step1
  595. # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  596. if @phase4_step != 2
  597. # リフレッシュ
  598. @status_window.refresh
  599. # 軽量化:たったコレだけΣ(?w?
  600. Graphics.frame_reset
  601. end
  602. # 禁止を解除
  603. @status_window.update_cp_only = false
  604. @active_battler.slip_state_update_ban = false if @active_battler != nil
  605. end
  606. #--------------------------------------------------------------------------
  607. # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  608. #--------------------------------------------------------------------------
  609. alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  610. def update_phase4_step2
  611. # 強制アクションでなければ
  612. unless @active_battler.current_action.forcing
  613. # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  614. if @active_battler.restriction == 2 or @active_battler.restriction == 3
  615. # アクションに攻撃を設定
  616. @active_battler.current_action.kind = 0
  617. @active_battler.current_action.basic = 0
  618. end
  619. # 制約が [行動できない] の場合
  620. if @active_battler.restriction == 4
  621. # アクション強制対象のバトラーをクリア
  622. $game_temp.forcing_battler = nil
  623. if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  624. # ステート自然解除
  625. @active_battler.remove_states_auto
  626. # CP消費
  627. @active_battler.cp -= 65535
  628. # ステータスウィンドウをリフレッシュ
  629. @status_window.refresh
  630. end
  631. # ステップ 1 に移行
  632. @phase4_step = 1
  633. return
  634. end
  635. end
  636. # アクションの種別で分岐
  637. case @active_battler.current_action.kind
  638. when 0
  639. # 攻撃?防御?逃げる?何もしない時の共通消費CP
  640. @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  641. when 1
  642. # スキル使用時の消費CP
  643. @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  644. when 2
  645. # アイテム使用時の消費CP
  646. @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  647. end
  648. # ステート自然解除
  649. @active_battler.remove_states_auto
  650. @status_window.refresh
  651. # 呼び戻す
  652. xrxs_bp1_update_phase4_step2
  653. end
  654. #--------------------------------------------------------------------------
  655. # ● 基本アクション 結果作成
  656. #--------------------------------------------------------------------------
  657. alias xrxs_bp1_make_basic_action_result make_basic_action_result
  658. def make_basic_action_result
  659. # 攻撃の場合
  660. if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  661. @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  662. end
  663. # 防御の場合
  664. if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  665. @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  666. # @active_battlerの防御をON
  667. @active_battler.now_guarding = true
  668. end
  669. # 敵の逃げるの場合
  670. if @active_battler.is_a?(Game_Enemy) and
  671. @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  672. @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  673. end
  674. # 何もしないの場合
  675. if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  676. @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  677. end
  678. # 逃げるの場合
  679. if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  680. @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  681. # 逃走可能ではない場合
  682. if $game_temp.battle_can_escape == false
  683. # ブザー SE を演奏
  684. $game_system.se_play($data_system.buzzer_se)
  685. return
  686. end
  687. # 逃走処理
  688. update_phase2_escape
  689. return
  690. end
  691. # 呼び戻す
  692. xrxs_bp1_make_basic_action_result
  693. end
  694. #--------------------------------------------------------------------------
  695. # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  696. #--------------------------------------------------------------------------
  697. alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  698. def update_phase4_step6
  699. # スリップダメージ
  700. if @active_battler.hp > 0 and @active_battler.slip_damage?
  701. @active_battler.slip_damage_effect
  702. @active_battler.damage_pop = true
  703. # ステータスウィンドウをリフレッシュ

  704. end
  705. @status_window.refresh
  706. # 呼び戻す
  707. xrxs_bp1_update_phase4_step6
  708. end

  709. end
复制代码

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1707
在线时间
3039 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

3
发表于 2007-6-19 18:15:19 | 只看该作者
脚本冲突问题- -
这种问题最烦人了。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-6-8
帖子
96
4
发表于 2007-6-19 18:15:59 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2007-2-7
帖子
388
5
 楼主| 发表于 2007-6-19 18:16:39 | 只看该作者
以下引用精灵使者于2007-6-19 10:15:19的发言:

脚本冲突问题- -
这种问题最烦人了。


能把我整合一下吗?
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

脚本盲

梦石
0
星屑
50
在线时间
0 小时
注册时间
2005-11-17
帖子
1753
6
发表于 2007-6-19 18:19:59 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2007-2-7
帖子
388
7
 楼主| 发表于 2007-6-19 18:28:48 | 只看该作者
以下引用暗之影于2007-6-19 10:19:59的发言:

战斗结束时让那个图片消失吗?
具体改哪不知道- -
冲突.....
PS:这里一直下雨,很凉快啊~


[本贴由作者于 2007-6-19 10:23:36 最后编辑]

我找了1`2小时,,不知道怎么弄没.可以帮帮忙吗?
急死我了
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1707
在线时间
3039 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

8
发表于 2007-6-19 18:28:52 | 只看该作者
你找找哪里是不是忘记写dispose了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2007-2-7
帖子
388
9
 楼主| 发表于 2007-6-19 18:40:54 | 只看该作者
这个脚本是正确的.用到我那以后就出现错误了...
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
270
在线时间
1373 小时
注册时间
2005-10-16
帖子
5113

贵宾

10
发表于 2007-6-19 18:44:10 | 只看该作者
看你那个好象是菜单里的人物没有dispose掉
我只个搬答案的
叔叔我已经当爹了~
婚后闪人了……
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-9-21 02:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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