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

Project1

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

[已经解决] 人物扩张系统的问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2323
在线时间
207 小时
注册时间
2019-3-30
帖子
171
跳转到指定楼层
1
发表于 2020-7-21 22:54:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 暴走杀神 于 2020-7-24 21:32 编辑

人物数量超出窗口的时候要换人的时候显示不出来,光标往下调的时候看不到,菜单中使用物品和技能也是如此
想弄成像物品界面显示的那种,找了半天不知道怎么弄
自己改了下脚本的界面


RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url=http://www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================  
  4.  
  5. # ▼▲▼ XRXS26. 人物扩张系统 ver..05 ▼▲▼
  6. # by 桜雅 在土
  7.  
  8. #==============================================================================
  9. # □ 初始化定义
  10. #==============================================================================
  11. module XRXS26
  12.   FRONT_MEMBER_LIMIT    = 4     # 战斗参战人数最大值
  13.   BACKWARD_MEMBER_LIMIT = 99    # 待机人数最大值
  14.   BACKWARD_EXP_GAINABLE = true     # 待机人物是否获得经验
  15.   MENU_STATUS_STRETCH   = false    # 3人以下的时候,菜单是否拉伸大小
  16. end
  17. #------------------------------------------------------------------------------
  18. # 菜单页面状态
  19. #------------------------------------------------------------------------------
  20. class Window_MenuStatus < Window_Selectable
  21.   # 列数
  22.   COLUMN_MAX = 1
  23.   # 光标高度
  24.   CURSOR_HEIGHT = 96
  25.   # 一行的高度
  26.   LINE_HEIGHT = 116
  27. end
  28. #------------------------------------------------------------------------------
  29. # 菜单场景
  30. #------------------------------------------------------------------------------
  31. class Scene_Menu
  32.   MENU_MEMBER_CHANGE_KEY_GO    = Input::RIGHT # 进入键
  33.   MENU_MEMBER_CHANGE_KEY_END   = Input::LEFT  # 离开键
  34.   MENU_MEMBER_CHANGE_INDEX_MIN = 0            # 可更换角色最小编号
  35.   FORCETOBATTLE_ACTORS         = []           # 不能待机的角色编号
  36.   UMBATTLABLE_ACTORS           = []           # 不能加入战斗的角色编号
  37.   UNMOVABLE_ACTORS             = []           # 不能移动的角色编号
  38. end
  39. #------------------------------------------------------------------------------
  40. #
  41. # 解説
  42. #    Game_Partyの @actors のうち先頭から↑FRONT_MEMBER_LIMIT番目までのアクターを
  43. #   戦闘メンバーとして、それ以上を待機メンバーとして扱います。
  44. #
  45. #==============================================================================
  46. # ■ Game_Party
  47. #==============================================================================
  48. class Game_Party
  49.   #--------------------------------------------------------------------------
  50.   # ○ インクルード
  51.   #--------------------------------------------------------------------------
  52.   include XRXS26
  53.   #--------------------------------------------------------------------------
  54.   # ○ 公開インスタンス変数
  55.   #--------------------------------------------------------------------------
  56.   attr_reader   :backword_actors          # 待機アクター
  57.   #--------------------------------------------------------------------------
  58.   # ● オブジェクト初期化
  59.   #--------------------------------------------------------------------------
  60.   alias xrxs26_initialize initialize
  61.   def initialize
  62.     xrxs26_initialize
  63.     # 待機メンバー配列を初期化
  64.     @backword_actors = []
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # ● アクターを加える
  68.   #--------------------------------------------------------------------------
  69.   def add_actor(actor_id)
  70.     # アクターを取得
  71.     actor = $game_actors[actor_id]
  72.     # このアクターがパーティにいない場合
  73.     if not @actors.include?(actor)
  74.       # 満員でないならメンバーに追加
  75.       if @actors.size < (FRONT_MEMBER_LIMIT + BACKWARD_MEMBER_LIMIT)
  76.         # アクターを追加
  77.         @actors.push(actor)
  78.         # プレイヤーをリフレッシュ
  79.         $game_player.refresh
  80.       end
  81.     end
  82.   end
  83. end
  84. #==============================================================================
  85. # ■ Spriteset_Battle
  86. #==============================================================================
  87. class Spriteset_Battle
  88.   #--------------------------------------------------------------------------
  89.   # ● インクルード
  90.   #--------------------------------------------------------------------------
  91.   include XRXS26
  92.   #--------------------------------------------------------------------------
  93.   # ● フレーム更新
  94.   #--------------------------------------------------------------------------
  95.   alias xrxs26_initialize initialize
  96.   def initialize
  97.     xrxs26_initialize
  98.     #
  99.     # 以下、五人目以降のアクタースプライトの追加処理---
  100.     #
  101.     # アクターが表示されるビューポートを、とりあえず先頭の人から取得しとく(素
  102.     actor_viewport = @actor_sprites[0].viewport
  103.     # 戦闘参加メンバーが5人以上の場合
  104.     if FRONT_MEMBER_LIMIT > 4
  105.       for i in 5..FRONT_MEMBER_LIMIT
  106.         # アクタースプライトを追加
  107.         @actor_sprites.push(Sprite_Battler.new(actor_viewport))
  108.         @actor_sprites[i-1].battler = $game_party.actors[i-1]
  109.       end
  110.     end
  111.     # ビューポートを更新
  112.     actor_viewport.update
  113.   end
  114. end
  115. #==============================================================================
  116. # ■ Scene_Battle
  117. #==============================================================================
  118. class Scene_Battle
  119.   #--------------------------------------------------------------------------
  120.   # ● インクルード
  121.   #--------------------------------------------------------------------------
  122.   include XRXS26
  123.   #--------------------------------------------------------------------------
  124.   # ● メイン処理 をパーティメンバー処理ではさむ
  125.   #--------------------------------------------------------------------------
  126.   alias xrxs26_main main
  127.   def main
  128.     # 待機メンバーへ退避----------
  129.     $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
  130.     $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
  131.     $game_party.actors.compact!
  132.     # メイン処理
  133.     xrxs26_main
  134.     # 待機メンバーから復帰
  135.     $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
  136.     $game_party.backword_actors.clear
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● アフターバトルフェーズ開始
  140.   #--------------------------------------------------------------------------
  141.   alias xrxs26_start_phase5 start_phase5
  142.   def start_phase5
  143.     # 「待機メンバー経験値獲得」が有効 and 待機アクターが一人以上いる
  144.     if BACKWARD_EXP_GAINABLE and $game_party.backword_actors.size >= 1
  145.       # 待機メンバーから復帰
  146.       $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
  147.       $game_party.backword_actors.clear
  148.       # 呼び戻す
  149.       xrxs26_start_phase5
  150.       # 待機メンバーへ退避----------
  151.       $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
  152.       $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
  153.       $game_party.actors.compact!
  154.     else
  155.       # 呼び戻す
  156.       xrxs26_start_phase5
  157.     end
  158.   end
  159. end
  160. # ▽△▽ XRXL 4. 第二カーソル 機構 ▽△▽
  161. # by 桜雅 在土
  162.  
  163. #==============================================================================
  164. # --- XRXS. 第二カーソル 機構 ---
  165. #------------------------------------------------------------------------------
  166. #     ウィンドウに .index2 プロパティを追加します。
  167. #==============================================================================
  168. module XRXS_Cursor2
  169.   #--------------------------------------------------------------------------
  170.   # ● オブジェクト初期化
  171.   #--------------------------------------------------------------------------
  172.   def initialize(x, y, w, h)
  173.     super(x, y, h, w)
  174.     # 補助ウィンドウ(透明)を作成:カーソル専用
  175.     @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
  176.     @xrxsc2_window.opacity = 0
  177.     @xrxsc2_window.active = false
  178.     @xrxsc2_window.index = -1
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ○ 第二カーソルの設置
  182.   #--------------------------------------------------------------------------
  183.   def index2
  184.     return @xrxsc2_window.index
  185.   end
  186.   def index2=(index)
  187.     @xrxsc2_window.index = index
  188.     if index == -1
  189.       @xrxsc2_window.cursor_rect.empty
  190.     else
  191.       @xrxsc2_window.x = self.x
  192.       @xrxsc2_window.y = self.y
  193.       @xrxsc2_window.cursor_rect = self.cursor_rect
  194.     end
  195.   end
  196.   #--------------------------------------------------------------------------
  197.   # ○ 先頭の行の設定
  198.   #--------------------------------------------------------------------------
  199.   def top_row=(row)
  200.     super
  201.     # 補助ウィンドウの oy を更新
  202.     pre_oy = @xrxsc2_window.oy
  203.     @xrxsc2_window.oy = self.oy
  204.     @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ○ 解放
  208.   #--------------------------------------------------------------------------
  209.   def dispose
  210.     @xrxsc2_window.dispose
  211.     super
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ○ X, Y 座標
  215.   #--------------------------------------------------------------------------
  216.   def x=(n)
  217.     super
  218.     @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  219.   end
  220.   def y=(n)
  221.     super
  222.     @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  223.   end
  224. end
  225. # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
  226. # by 桜雅 在土
  227.  
  228. #==============================================================================
  229. # ■ Window_MenuStatus
  230. #==============================================================================
  231. class Window_MenuStatus < Window_Selectable
  232.   #--------------------------------------------------------------------------
  233.   # ○ インクルード
  234.   #--------------------------------------------------------------------------
  235.   include XRXS26
  236.   include XRXS_Cursor2
  237.   #--------------------------------------------------------------------------
  238.   # ● 公開インスタンス変数
  239.   #--------------------------------------------------------------------------
  240.   attr_reader   :column_max             # 列数
  241.   #--------------------------------------------------------------------------
  242.   # ● オブジェクト初期化
  243.   #--------------------------------------------------------------------------
  244.   def initialize
  245.     h = 480
  246.     if MENU_STATUS_STRETCH
  247.       h = FRONT_MEMBER_LIMIT * 116 + 16
  248.     end
  249.     super(0, 0, 480, h)
  250.     h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
  251.     self.contents = Bitmap.new(width - 32, h)
  252.     refresh
  253.     self.active = false
  254.     self.index = -1
  255.   end
  256. #--------------------------------------------------------------------------
  257.   # ○ 1 ページに表示できる行数の取得
  258.   #--------------------------------------------------------------------------
  259.   def page_row_max
  260.     if MENU_STATUS_STRETCH
  261.       return FRONT_MEMBER_LIMIT          # 戦闘パーティ最大数
  262.     else
  263.       return [FRONT_MEMBER_LIMIT, 4].max # 戦闘パーティ最大数(最低4)
  264.     end
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ○ 先頭の行の取得
  268.   #--------------------------------------------------------------------------
  269.   def top_row
  270.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
  271.     return self.oy / LINE_HEIGHT
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ○ 先頭の行の設定
  275.   #--------------------------------------------------------------------------
  276.   def top_row=(row)
  277.     super
  278.     self.oy = self.oy/32 * LINE_HEIGHT
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● カーソルの矩形更新
  282.   #--------------------------------------------------------------------------
  283.   def update_cursor_rect
  284.     super
  285.     unless @index < 0
  286.       y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
  287.       self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
  288.     end
  289.   end
  290. end
  291. #==============================================================================
  292. # ■ Scene_Menu
  293. #==============================================================================
  294. class Scene_Menu
  295.   #--------------------------------------------------------------------------
  296.   # ○ インクルード
  297.   #--------------------------------------------------------------------------
  298.   include XRXS26
  299.   #--------------------------------------------------------------------------
  300.   # ● フレーム更新
  301.   #--------------------------------------------------------------------------
  302.   alias xrxs26ax_update update
  303.   def update
  304.     # インデックスを保存
  305.     @status_index = @status_window.index
  306.     # 呼び戻す
  307.     xrxs26ax_update
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  311.   #--------------------------------------------------------------------------
  312.   alias xrxs26ax_update_command update_command
  313.   def update_command
  314.     # 呼び戻す
  315.     xrxs26ax_update_command
  316.     # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
  317.     if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
  318.        @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
  319.       # 決定 SE を演奏
  320.       $game_system.se_play($data_system.decision_se)
  321.       # カーソル位置を記憶
  322.       @command_index_before_menu_member_change = @command_window.index
  323.       # 入れ替えウィンドウへ移行
  324.       @command_window.active = false
  325.       @command_window.index = -1
  326.       @status_window.active = true
  327.       @status_window.index = 0
  328.     end
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  332.   #--------------------------------------------------------------------------
  333.   alias xrxs26ax_update_status update_status
  334.   def update_status
  335.     # 呼び戻す
  336.     if @command_window.index != -1
  337.       xrxs26ax_update_status
  338.       return
  339.     end
  340.     # B ボタンか入れ替え終了キーが押されたとき
  341.     if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
  342.         @status_window.index2 == -1 and
  343.         @status_index%@status_window.column_max == 0)
  344.       # キャンセル SE を演奏
  345.       $game_system.se_play($data_system.cancel_se)
  346.       # コマンドウィンドウをアクティブにする
  347.       @command_window.active = true
  348.       @command_window.index = 0
  349.       @status_window.active = false
  350.       @status_window.index = -1
  351.       return
  352.     end
  353.     # B ボタンが押されたとき
  354.     if Input.trigger?(Input::B) and @status_window.index2 >= 0
  355.       @status_window.index = @status_window.index2
  356.       @status_window.index2 = -1
  357.       return
  358.     end
  359.     # 決定キーが押されたとき
  360.     if Input.trigger?(Input::C)
  361.       if @status_window.index2 == -1
  362.         if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
  363.           # ブザー SE を演奏
  364.           $game_system.se_play($data_system.buzzer_se)
  365.           return
  366.         end
  367.         # 決定 SE を演奏
  368.         $game_system.se_play($data_system.decision_se)
  369.         # メンバーの入れ替え一人目の決定
  370.         @status_window.index2 = @status_window.index
  371.       else
  372.         if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
  373.           # ブザー SE を演奏
  374.           $game_system.se_play($data_system.buzzer_se)
  375.           return
  376.         end
  377.         # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
  378.         if (@status_window.index < FRONT_MEMBER_LIMIT or
  379.             @status_window.index2 < FRONT_MEMBER_LIMIT) and
  380.            (UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
  381.             UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
  382.           # ブザー SE を演奏
  383.           $game_system.se_play($data_system.buzzer_se)
  384.           return
  385.         end
  386.         # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
  387.         if (@status_window.index >= FRONT_MEMBER_LIMIT or
  388.             @status_window.index2 >= FRONT_MEMBER_LIMIT) and
  389.            (FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
  390.             FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
  391.           # ブザー SE を演奏
  392.           $game_system.se_play($data_system.buzzer_se)
  393.           return
  394.         end
  395.         # 決定 SE を演奏
  396.         $game_system.se_play($data_system.decision_se)
  397.         # メンバーの入れ替え二人目の決定と入れ替えの実行
  398.         actor2 = $game_party.actors[@status_window.index]
  399.         actor = $game_party.actors[@status_window.index2]
  400.         $game_party.actors[@status_window.index2] = actor2
  401.         $game_party.actors[@status_window.index] = actor
  402.         @status_window.index = @status_window.index2
  403.         @status_window.index2 = -1
  404.         # プレイヤーをリフレッシュ
  405.         $game_player.refresh
  406.         # ステータスウィンドウをリフレッシュ
  407.         @status_window.refresh
  408.       end
  409.       return
  410.     end
  411.   end
  412. end
  413.  
  414.  
  415.  
  416.  
  417. #============================================================================================
  418. # 本脚本来自[url=http://www.66RPG.com]www.66RPG.com[/url],转载和使用请保留此信息
  419. #============================================================================================
  420.  
  421. # ▼▲▼ XRXS26BX. +BUZZデザイン ▼▲▼ built 033109
  422. # by 桜雅 在土
  423.  
  424. #==============================================================================
  425. # □ 初始化定义
  426. #==============================================================================
  427. class Window_MenuStatus < Window_Selectable
  428.   #
  429.   # 不显示能力值的角色编号
  430.   #
  431.   NO_PARAMETER_ACTORS = []
  432. end
  433. #==============================================================================
  434. # ■ Window_MenuStatus
  435. #==============================================================================
  436. class Window_MenuStatus < Window_Selectable
  437.   #--------------------------------------------------------------------------
  438.   # ○ インクルード
  439.   #--------------------------------------------------------------------------
  440.   include XRXS26
  441.   #--------------------------------------------------------------------------
  442.   # ● 公開インスタンス変数
  443.   #--------------------------------------------------------------------------
  444.   attr_reader   :newitem_window
  445.   attr_reader   :bottomkeyhelp_window
  446.   #--------------------------------------------------------------------------
  447.   # ● オブジェクト初期化
  448.   #--------------------------------------------------------------------------
  449.   alias xrxs26bx_initialize initialize
  450.   def initialize
  451.     # 呼び戻す
  452.     xrxs26bx_initialize
  453.     # 寄生してウィンドウを作成
  454.     # ボトルキーヘルプウィンドウ
  455.     @bottomkeyhelp_window = Window_BottomKeyHelp.new
  456.     @bottomkeyhelp_window.visible = false
  457.     # 設定変更
  458.     self.height   = 448
  459.     self.contents = Bitmap.new(width - 32, height - 32)
  460.     self.opacity = 160
  461.     refresh
  462.   end
  463.   #--------------------------------------------------------------------------
  464.   # ● リフレッシュ
  465.   #--------------------------------------------------------------------------
  466.   def refresh
  467.     self.contents.clear
  468.     @item_max = $game_party.actors.size
  469.     @column_max = 1
  470.     y = (FRONT_MEMBER_LIMIT+1)/2 * 64 + 28
  471.     self.contents.font.size = 16
  472.     self.contents.font.color = system_color
  473.     self.contents.draw_text(4, 0, 92, 28, "战斗人数")
  474.     self.contents.draw_text(4, 320, 92, 28, "待机人数")
  475.     for i in 0...$game_party.actors.size
  476.       x = 64 + i%2 * 0
  477.       y = i/1 *  72 + 30
  478.       actor = $game_party.actors[i]
  479.       if i >= FRONT_MEMBER_LIMIT
  480.         y += 32
  481.         self.contents.font.color = disabled_color
  482.         self.contents.draw_text(x, y, 120, 32, actor.name)
  483.       else
  484.         draw_actor_name(actor   , x + 40, y     )
  485.       end
  486.       draw_actor_graphic(actor, x - 40, y + 64)
  487.       unless NO_PARAMETER_ACTORS.include?(actor.id)
  488.         draw_actor_level(actor  , x + 40, y + 24)
  489.         draw_actor_hp(actor     , x + 120, y + 16)
  490.         draw_actor_sp(actor     , x + 120, y + 32)
  491.         draw_actor_state(actor  , x, y + 48)
  492.       end
  493.     end
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ○ フレーム更新
  497.   #--------------------------------------------------------------------------
  498.   def update
  499.     # ウィンドウを更新
  500.     @bottomkeyhelp_window.update
  501.     super
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ○ 解放
  505.   #--------------------------------------------------------------------------
  506.   def dispose
  507.     @bottomkeyhelp_window.dispose
  508.     super
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● カーソルの矩形更新
  512.   #--------------------------------------------------------------------------
  513.   def update_cursor_rect
  514.     if @index < 0
  515.       self.cursor_rect.empty
  516.     else
  517.       y = @index/1 * 72 + 32
  518.       if @index >= FRONT_MEMBER_LIMIT
  519.         y += 32
  520.       end
  521.       self.cursor_rect.set(@index%1 * 224, y, 448, 72)
  522.     end
  523.   end
  524. end
  525. #==============================================================================
  526. # ■ Scene_Menu
  527. #==============================================================================
  528. class Scene_Menu
  529.   #--------------------------------------------------------------------------
  530.   # ● フレーム更新
  531.   #--------------------------------------------------------------------------
  532.   alias xrxs26bx_update update
  533.   def update
  534.     # 登録
  535.     if @bottomkeyhelp_window.nil?
  536.       @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
  537.       @bottomkeyhelp_window.visible = true
  538.       set_keyhelp1
  539.     end
  540.     # 呼び戻す
  541.     xrxs26bx_update
  542.   end
  543.   #--------------------------------------------------------------------------
  544.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  545.   #--------------------------------------------------------------------------
  546.   alias xrxs26bx_update_command update_command
  547.   def update_command
  548.     # 呼び戻す
  549.     xrxs26bx_update_command
  550.     # 入れ替え移行キーが押されたとき
  551.     if @command_window.index == -1 and @status_window.active
  552.       set_keyhelp2
  553.     end
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  557.   #--------------------------------------------------------------------------
  558.   alias xrxs26bx_update_status update_status
  559.   def update_status
  560.     # 保存
  561.     last_index = @status_window.index2
  562.     # 呼び戻す
  563.     xrxs26bx_update_status
  564.     #
  565.     if last_index != @status_window.index2
  566.       # 一人目を選択した場合
  567.       if @status_window.index2 >= 0
  568.         set_keyhelp3
  569.       else
  570.         set_keyhelp2
  571.       end
  572.     end
  573.     # 戻った場合
  574.     unless @status_window.active
  575.       set_keyhelp1
  576.     end
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # ○ キーヘルプを設定 1
  580.   #--------------------------------------------------------------------------
  581.   def set_keyhelp1
  582.     @bottomkeyhelp_window.clear
  583.     @bottomkeyhelp_window.add("B","关闭本窗口")
  584.     @bottomkeyhelp_window.add("C","确定")
  585.     @bottomkeyhelp_window.add("→","人物顺序调整")
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ○ キーヘルプを設定 2
  589.   #--------------------------------------------------------------------------
  590.   def set_keyhelp2
  591.     @bottomkeyhelp_window.clear
  592.     @bottomkeyhelp_window.add("←,B","返回")
  593.     @bottomkeyhelp_window.add("C","第一个人物确定")
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ○ キーヘルプを設定 3
  597.   #--------------------------------------------------------------------------
  598.   def set_keyhelp3
  599.     @bottomkeyhelp_window.clear
  600.     @bottomkeyhelp_window.add("B","返回")
  601.     @bottomkeyhelp_window.add("C","第二个人物确定")
  602.   end
  603. end
  604.  
  605.  
  606.  
  607. #==============================================================================
  608. # □ Window_BottomKeyHelp
  609. #------------------------------------------------------------------------------
  610. #     画面下で操作説明をする透明なウィンドウです。
  611. #==============================================================================
  612. class Window_BottomKeyHelp < Window_Base
  613.   #--------------------------------------------------------------------------
  614.   # ○ オブジェクト初期化
  615.   #--------------------------------------------------------------------------
  616.   def initialize
  617.     super(0, 432, 640, 64)
  618.     self.contents = Bitmap.new(width - 32, height - 32)
  619.     self.opacity = 0
  620.     clear
  621.   end
  622.   #--------------------------------------------------------------------------
  623.   # ○ クリア
  624.   #--------------------------------------------------------------------------
  625.   def clear
  626.     self.contents.clear
  627.     @now_x = 608
  628.   end
  629.   #--------------------------------------------------------------------------
  630.   # ○ 追加
  631.   #--------------------------------------------------------------------------
  632.   def add(key, explanation)
  633.     # 計算
  634.     self.contents.font.size = 20
  635.     x  = self.contents.text_size(key).width
  636.     self.contents.font.size = 16
  637.     x += self.contents.text_size(explanation).width + 8
  638.     @now_x -= x
  639.     # 描写
  640.     self.contents.font.size = 20
  641.     self.contents.font.color = system_color
  642.     self.contents.draw_text(@now_x, 0, x, 32, key, 0)
  643.     self.contents.font.size = 16
  644.     self.contents.font.color = normal_color
  645.     self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
  646.     # 余白
  647.     @now_x -= 32
  648.   end
  649. end
  650.  
  651. #==============================================================================
  652. # 本脚本来自[url=http://www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息
  653. #==============================================================================

QQ截图20200721223920.png (180.7 KB, 下载次数: 3)

QQ截图20200721223920.png

QQ截图20200721223949.png (206.95 KB, 下载次数: 5)

QQ截图20200721223949.png

QQ截图20200721224003.png (148.05 KB, 下载次数: 2)

QQ截图20200721224003.png

Lv3.寻梦者

梦石
0
星屑
2323
在线时间
207 小时
注册时间
2019-3-30
帖子
171
2
 楼主| 发表于 2020-7-27 20:55:59 | 只看该作者
没人么?看来这个问题很复杂啊
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3065
在线时间
1429 小时
注册时间
2009-7-27
帖子
1448
3
发表于 2020-7-30 10:43:59 | 只看该作者
是不是用了除了这个还有其他同样的脚本了?有些被覆盖了。试试调换一下脚本的上下的位置

博客:我的博客
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2323
在线时间
207 小时
注册时间
2019-3-30
帖子
171
4
 楼主| 发表于 2020-8-1 22:06:12 | 只看该作者
爆焰 发表于 2020-7-30 10:43
是不是用了除了这个还有其他同样的脚本了?有些被覆盖了。试试调换一下脚本的上下的位置 ...

目前就用了这些脚本,按你说的换地方放貌似行不通啊

QQ截图20200801220721.png (280.77 KB, 下载次数: 4)

QQ截图20200801220721.png

点评

帮你改一下,等等  发表于 2020-8-3 01:07
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3065
在线时间
1429 小时
注册时间
2009-7-27
帖子
1448
5
发表于 2020-8-3 01:22:14 | 只看该作者
本帖最后由 爆焰 于 2020-8-3 03:29 编辑

替换掉原来的脚本
暴走杀神 发表于 2020-8-1 22:06
目前就用了这些脚本,按你说的换地方放貌似行不通啊

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================  

  4. # ▼▲▼ XRXS26. 人物扩张系统 ver..05 ▼▲▼
  5. # by 桜雅 在土

  6. #==============================================================================
  7. # □ 初始化定义
  8. #==============================================================================
  9. module XRXS26
  10.   FRONT_MEMBER_LIMIT    = 4        # 战斗参战人数最大值
  11.   BACKWARD_MEMBER_LIMIT = 99        # 待机人数最大值
  12.   BACKWARD_EXP_GAINABLE = false     # 待机人物是否获得经验
  13.   MENU_STATUS_STRETCH   = false    # 3人以下的时候,菜单是否拉伸大小
  14. end
  15. #------------------------------------------------------------------------------
  16. # 菜单页面状态
  17. #------------------------------------------------------------------------------
  18. class Window_MenuStatus < Window_Selectable
  19.   # 列数
  20.   COLUMN_MAX = 1
  21.   # 光标高度
  22.   CURSOR_HEIGHT = 96
  23.   # 一行的高度
  24.   LINE_HEIGHT = 116
  25. end
  26. #------------------------------------------------------------------------------
  27. # 菜单场景
  28. #------------------------------------------------------------------------------
  29. class Scene_Menu
  30.   MENU_MEMBER_CHANGE_KEY_GO    = Input::RIGHT # 进入键
  31.   MENU_MEMBER_CHANGE_KEY_END   = Input::LEFT  # 离开键
  32.   MENU_MEMBER_CHANGE_INDEX_MIN = 0            # 可更换角色最小编号
  33.   FORCETOBATTLE_ACTORS         = []           # 不能待机的角色编号
  34.   UMBATTLABLE_ACTORS           = []           # 不能加入战斗的角色编号
  35.   UNMOVABLE_ACTORS             = []           # 不能移动的角色编号
  36. end
  37. #------------------------------------------------------------------------------
  38. #
  39. # 解説
  40. #    Game_Partyの @actors のうち先頭から↑FRONT_MEMBER_LIMIT番目までのアクターを
  41. #   戦闘メンバーとして、それ以上を待機メンバーとして扱います。
  42. #
  43. #==============================================================================
  44. # ■ Game_Party
  45. #==============================================================================
  46. class Game_Party
  47.   #--------------------------------------------------------------------------
  48.   # ○ インクルード
  49.   #--------------------------------------------------------------------------
  50.   include XRXS26
  51.   #--------------------------------------------------------------------------
  52.   # ○ 公開インスタンス変数
  53.   #--------------------------------------------------------------------------
  54.   attr_reader   :backword_actors          # 待機アクター
  55.   #--------------------------------------------------------------------------
  56.   # ● オブジェクト初期化
  57.   #--------------------------------------------------------------------------
  58.   alias xrxs26_initialize initialize
  59.   def initialize
  60.     xrxs26_initialize
  61.     # 待機メンバー配列を初期化
  62.     @backword_actors = []
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● アクターを加える
  66.   #--------------------------------------------------------------------------
  67.   def add_actor(actor_id)
  68.     # アクターを取得
  69.     actor = $game_actors[actor_id]
  70.     # このアクターがパーティにいない場合
  71.     if not @actors.include?(actor)
  72.       # 満員でないならメンバーに追加
  73.       if @actors.size < (FRONT_MEMBER_LIMIT + BACKWARD_MEMBER_LIMIT)
  74.         # アクターを追加
  75.         @actors.push(actor)
  76.         # プレイヤーをリフレッシュ
  77.         $game_player.refresh
  78.       end
  79.     end
  80.   end
  81. end
  82. #==============================================================================
  83. # ■ Spriteset_Battle
  84. #==============================================================================
  85. class Spriteset_Battle
  86.   #--------------------------------------------------------------------------
  87.   # ● インクルード
  88.   #--------------------------------------------------------------------------
  89.   include XRXS26
  90.   #--------------------------------------------------------------------------
  91.   # ● フレーム更新
  92.   #--------------------------------------------------------------------------
  93.   alias xrxs26_initialize initialize
  94.   def initialize
  95.     xrxs26_initialize
  96.     #
  97.     # 以下、五人目以降のアクタースプライトの追加処理---
  98.     #
  99.     # アクターが表示されるビューポートを、とりあえず先頭の人から取得しとく(素
  100.     actor_viewport = @actor_sprites[0].viewport
  101.     # 戦闘参加メンバーが5人以上の場合
  102.     if FRONT_MEMBER_LIMIT > 4
  103.       for i in 5..FRONT_MEMBER_LIMIT
  104.         # アクタースプライトを追加
  105.         @actor_sprites.push(Sprite_Battler.new(actor_viewport))
  106.         @actor_sprites[i-1].battler = $game_party.actors[i-1]
  107.       end
  108.     end
  109.     # ビューポートを更新
  110.     actor_viewport.update
  111.   end
  112. end
  113. #==============================================================================
  114. # ■ Scene_Battle
  115. #==============================================================================
  116. class Scene_Battle
  117.   #--------------------------------------------------------------------------
  118.   # ● インクルード
  119.   #--------------------------------------------------------------------------
  120.   include XRXS26
  121.   #--------------------------------------------------------------------------
  122.   # ● メイン処理 をパーティメンバー処理ではさむ
  123.   #--------------------------------------------------------------------------
  124.   alias xrxs26_main main
  125.   def main
  126.     # 待機メンバーへ退避----------
  127.     $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
  128.     $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
  129.     $game_party.actors.compact!
  130.     # メイン処理
  131.     xrxs26_main
  132.     # 待機メンバーから復帰
  133.     $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
  134.     $game_party.backword_actors.clear
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● アフターバトルフェーズ開始
  138.   #--------------------------------------------------------------------------
  139.   alias xrxs26_start_phase5 start_phase5
  140.   def start_phase5
  141.     # 「待機メンバー経験値獲得」が有効 and 待機アクターが一人以上いる
  142.     if BACKWARD_EXP_GAINABLE and $game_party.backword_actors.size >= 1
  143.       # 待機メンバーから復帰
  144.       $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
  145.       $game_party.backword_actors.clear
  146.       # 呼び戻す
  147.       xrxs26_start_phase5
  148.       # 待機メンバーへ退避----------
  149.       $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
  150.       $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
  151.       $game_party.actors.compact!
  152.     else
  153.       # 呼び戻す
  154.       xrxs26_start_phase5
  155.     end
  156.   end
  157. end
  158. # ▽△▽ XRXL 4. 第二カーソル 機構 ▽△▽
  159. # by 桜雅 在土

  160. #==============================================================================
  161. # --- XRXS. 第二カーソル 機構 ---
  162. #------------------------------------------------------------------------------
  163. #     ウィンドウに .index2 プロパティを追加します。
  164. #==============================================================================
  165. module XRXS_Cursor2
  166.   #--------------------------------------------------------------------------
  167.   # ● オブジェクト初期化
  168.   #--------------------------------------------------------------------------
  169.   def initialize(x, y, w, h)
  170.     super(x, y, h, w)
  171.     # 補助ウィンドウ(透明)を作成:カーソル専用
  172.     @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
  173.     @xrxsc2_window.opacity = 0
  174.     @xrxsc2_window.active = false
  175.     @xrxsc2_window.index = -1
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ○ 第二カーソルの設置
  179.   #--------------------------------------------------------------------------
  180.   def index2
  181.     return @xrxsc2_window.index
  182.   end
  183.   def index2=(index)
  184.     @xrxsc2_window.index = index
  185.     if index == -1
  186.       @xrxsc2_window.cursor_rect.empty
  187.     else
  188.       @xrxsc2_window.x = self.x
  189.       @xrxsc2_window.y = self.y
  190.       @xrxsc2_window.cursor_rect = self.cursor_rect
  191.     end
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # ○ 先頭の行の設定
  195.   #--------------------------------------------------------------------------
  196.   def top_row=(row)
  197.     super
  198.     # 補助ウィンドウの oy を更新
  199.     pre_oy = @xrxsc2_window.oy
  200.     @xrxsc2_window.oy = self.oy
  201.     @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ○ 解放
  205.   #--------------------------------------------------------------------------
  206.   def dispose
  207.     @xrxsc2_window.dispose
  208.     super
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ X, Y 座標
  212.   #--------------------------------------------------------------------------
  213.   def x=(n)
  214.     super
  215.     @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  216.   end
  217.   def y=(n)
  218.     super
  219.     @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  220.   end
  221. end
  222. # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
  223. # by 桜雅 在土

  224. #==============================================================================
  225. # ■ Window_MenuStatus
  226. #==============================================================================
  227. class Window_MenuStatus < Window_Selectable
  228.   #--------------------------------------------------------------------------
  229.   # ○ インクルード
  230.   #--------------------------------------------------------------------------
  231.   include XRXS26
  232.   include XRXS_Cursor2
  233.   #--------------------------------------------------------------------------
  234.   # ● 公開インスタンス変数
  235.   #--------------------------------------------------------------------------
  236.   attr_reader   :column_max             # 列数
  237.   #--------------------------------------------------------------------------
  238.   # ● オブジェクト初期化
  239.   #--------------------------------------------------------------------------
  240.   def initialize
  241.     h = 480
  242.     if MENU_STATUS_STRETCH
  243.       h = FRONT_MEMBER_LIMIT * 116 + 16
  244.     end
  245.     super(0, 0, 480, h)
  246.     h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
  247.     self.contents = Bitmap.new(width - 32, h)
  248.     refresh
  249.     self.active = false
  250.     self.index = -1
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ○ 1 ページに表示できる行数の取得
  254.   #--------------------------------------------------------------------------
  255.   def page_row_max
  256.     if MENU_STATUS_STRETCH
  257.       return FRONT_MEMBER_LIMIT          # 戦闘パーティ最大数
  258.     else
  259.       return [FRONT_MEMBER_LIMIT, 4].max # 戦闘パーティ最大数(最低4)
  260.     end
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ○ 先頭の行の取得
  264.   #--------------------------------------------------------------------------
  265.   def top_row
  266.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
  267.     return self.oy / LINE_HEIGHT
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ○ 先頭の行の設定
  271.   #--------------------------------------------------------------------------
  272.   def top_row=(row)
  273.     super
  274.     self.oy = self.oy/32 * LINE_HEIGHT
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● カーソルの矩形更新
  278.   #--------------------------------------------------------------------------
  279.   def update_cursor_rect
  280.     super
  281.     unless @index < 0
  282.       y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
  283.       self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
  284.     end
  285.   end
  286. end
  287. #==============================================================================
  288. # ■ Scene_Menu
  289. #==============================================================================
  290. class Scene_Menu
  291.   #--------------------------------------------------------------------------
  292.   # ○ インクルード
  293.   #--------------------------------------------------------------------------
  294.   include XRXS26
  295.   #--------------------------------------------------------------------------
  296.   # ● フレーム更新
  297.   #--------------------------------------------------------------------------
  298.   alias xrxs26ax_update update
  299.   def update
  300.     # インデックスを保存
  301.     @status_index = @status_window.index
  302.     # 呼び戻す
  303.     xrxs26ax_update
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  307.   #--------------------------------------------------------------------------
  308.   alias xrxs26ax_update_command update_command
  309.   def update_command
  310.     # 呼び戻す
  311.     xrxs26ax_update_command
  312.     # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
  313.     if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
  314.        @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
  315.       # 決定 SE を演奏
  316.       $game_system.se_play($data_system.decision_se)
  317.       # カーソル位置を記憶
  318.       @command_index_before_menu_member_change = @command_window.index
  319.       # 入れ替えウィンドウへ移行
  320.       @command_window.active = false
  321.       @command_window.index = -1
  322.       @status_window.active = true
  323.       @status_window.index = 0
  324.     end
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  328.   #--------------------------------------------------------------------------
  329.   alias xrxs26ax_update_status update_status
  330.   def update_status
  331.     # 呼び戻す
  332.     if @command_window.index != -1
  333.       xrxs26ax_update_status
  334.       return
  335.     end
  336.     # B ボタンか入れ替え終了キーが押されたとき
  337.     if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
  338.         @status_window.index2 == -1 and
  339.         @status_index%@status_window.column_max == 0)
  340.       # キャンセル SE を演奏
  341.       $game_system.se_play($data_system.cancel_se)
  342.       # コマンドウィンドウをアクティブにする
  343.       @command_window.active = true
  344.       @command_window.index = 0
  345.       @status_window.active = false
  346.       @status_window.index = -1
  347.       return
  348.     end
  349.     # B ボタンが押されたとき
  350.     if Input.trigger?(Input::B) and @status_window.index2 >= 0
  351.       @status_window.index = @status_window.index2
  352.       @status_window.index2 = -1
  353.       return
  354.     end
  355.     # 決定キーが押されたとき
  356.     if Input.trigger?(Input::C)
  357.       if @status_window.index2 == -1
  358.         if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
  359.           # ブザー SE を演奏
  360.           $game_system.se_play($data_system.buzzer_se)
  361.           return
  362.         end
  363.         # 決定 SE を演奏
  364.         $game_system.se_play($data_system.decision_se)
  365.         # メンバーの入れ替え一人目の決定
  366.         @status_window.index2 = @status_window.index
  367.       else
  368.         if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
  369.           # ブザー SE を演奏
  370.           $game_system.se_play($data_system.buzzer_se)
  371.           return
  372.         end
  373.         # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
  374.         if (@status_window.index < FRONT_MEMBER_LIMIT or
  375.             @status_window.index2 < FRONT_MEMBER_LIMIT) and
  376.            (UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
  377.             UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
  378.           # ブザー SE を演奏
  379.           $game_system.se_play($data_system.buzzer_se)
  380.           return
  381.         end
  382.         # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
  383.         if (@status_window.index >= FRONT_MEMBER_LIMIT or
  384.             @status_window.index2 >= FRONT_MEMBER_LIMIT) and
  385.            (FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
  386.             FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
  387.           # ブザー SE を演奏
  388.           $game_system.se_play($data_system.buzzer_se)
  389.           return
  390.         end
  391.         # 決定 SE を演奏
  392.         $game_system.se_play($data_system.decision_se)
  393.         # メンバーの入れ替え二人目の決定と入れ替えの実行
  394.         actor2 = $game_party.actors[@status_window.index]
  395.         actor = $game_party.actors[@status_window.index2]
  396.         $game_party.actors[@status_window.index2] = actor2
  397.         $game_party.actors[@status_window.index] = actor
  398.         @status_window.index = @status_window.index2
  399.         @status_window.index2 = -1
  400.         # プレイヤーをリフレッシュ
  401.         $game_player.refresh
  402.         # ステータスウィンドウをリフレッシュ
  403.         @status_window.refresh
  404.       end
  405.       return
  406.     end
  407.   end
  408. end


  409. #==============================================================================
  410. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  411. #==============================================================================

  412. class Scene_Save
  413.   #--------------------------------------------------------------------------
  414.   # ● 写入存档数据
  415.   #     file : 写入用文件对像 (已经打开)
  416.   #--------------------------------------------------------------------------
  417.   def write_save_data(file)
  418.     # 生成描绘存档文件用的角色图形
  419.     characters = []
  420.     for i in 0...[$game_party.actors.size,4].min
  421.       actor = $game_party.actors[i]
  422.       characters.push([actor.character_name, actor.character_hue])
  423.     end
  424.     # 写入描绘存档文件用的角色数据
  425.     Marshal.dump(characters, file)
  426.     # 写入测量游戏时间用画面计数
  427.     Marshal.dump(Graphics.frame_count, file)
  428.     # 增加 1 次存档次数
  429.     $game_system.save_count += 1
  430.     # 保存魔法编号
  431.     # (将编辑器保存的值以随机值替换)
  432.     $game_system.magic_number = $data_system.magic_number
  433.     # 写入各种游戏对像
  434.     Marshal.dump($game_system, file)
  435.     Marshal.dump($game_switches, file)
  436.     Marshal.dump($game_variables, file)
  437.     Marshal.dump($game_self_switches, file)
  438.     Marshal.dump($game_screen, file)
  439.     Marshal.dump($game_actors, file)
  440.     Marshal.dump($game_party, file)
  441.     Marshal.dump($game_troop, file)
  442.     Marshal.dump($game_map, file)
  443.     Marshal.dump($game_player, file)
  444.   end
  445. end

  446. class Scene_Battle
  447.   #--------------------------------------------------------------------------
  448.   # ● 设置物品或特技对像方的战斗者
  449.   #     scope : 特技或者是物品的范围
  450.   #--------------------------------------------------------------------------
  451.   def set_target_battlers(scope)
  452.     # 行动方的战斗者是敌人的情况下
  453.     if @active_battler.is_a?(Game_Enemy)
  454.       # 效果范围分支
  455.       case scope
  456.       when 1  # 敌单体
  457.         index = @active_battler.current_action.target_index
  458.         @target_battlers.push($game_party.smooth_target_actor(index))
  459.       when 2  # 敌全体
  460.         for actor in 0...[$game_party.actors.size,4].min
  461.           if $game_party.actors[actor].exist?
  462.             @target_battlers.push($game_party.actors[actor])
  463.           end
  464.         end
  465.       when 3  # 我方单体
  466.         index = @active_battler.current_action.target_index
  467.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  468.       when 4  # 我方全体
  469.         for enemy in $game_troop.enemies
  470.           if enemy.exist?
  471.             @target_battlers.push(enemy)
  472.           end
  473.         end
  474.       when 5  # 我方单体 (HP 0)
  475.         index = @active_battler.current_action.target_index
  476.         enemy = $game_troop.enemies[index]
  477.         if enemy != nil and enemy.hp0?
  478.           @target_battlers.push(enemy)
  479.         end
  480.       when 6  # 我方全体 (HP 0)
  481.         for enemy in $game_troop.enemies
  482.           if enemy != nil and enemy.hp0?
  483.             @target_battlers.push(enemy)
  484.           end
  485.         end
  486.       when 7  # 使用者
  487.         @target_battlers.push(@active_battler)
  488.       end
  489.     end
  490.     # 行动方的战斗者是角色的情况下
  491.     if @active_battler.is_a?(Game_Actor)
  492.       # 效果范围分支
  493.       case scope
  494.       when 1  # 敌单体
  495.         index = @active_battler.current_action.target_index
  496.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  497.       when 2  # 敌全体
  498.         for enemy in $game_troop.enemies
  499.           if enemy.exist?
  500.             @target_battlers.push(enemy)
  501.           end
  502.         end
  503.       when 3  # 我方单体
  504.         index = @active_battler.current_action.target_index
  505.         @target_battlers.push($game_party.smooth_target_actor(index))
  506.       when 4  # 我方全体
  507.         for actor in 0...[$game_party.actors.size,4].min
  508.           if $game_party.actors[actor].exist?
  509.             @target_battlers.push($game_party.actors[actor])
  510.           end
  511.         end
  512.       when 5  # 我方单体 (HP 0)
  513.         index = @active_battler.current_action.target_index
  514.         actor = $game_party.actors[index]
  515.         if actor != nil and actor.hp0?
  516.           @target_battlers.push(actor)
  517.         end
  518.       when 6  # 我方全体 (HP 0)
  519.         for actor in 0...[$game_party.actors.size,4].min
  520.           if $game_party.actors[actor] != nil and $game_party.actors[actor].hp0?
  521.             @target_battlers.push($game_party.actors[actor])
  522.           end
  523.         end
  524.       when 7  # 使用者
  525.         @target_battlers.push(@active_battler)
  526.       end
  527.     end
  528.   end  
  529.   #--------------------------------------------------------------------------
  530.   # ● 生成行动循序
  531.   #--------------------------------------------------------------------------
  532.   def make_action_orders
  533.     # 初始化序列 @action_battlers
  534.     @action_battlers = []
  535.     # 添加敌人到 @action_battlers 序列
  536.     for enemy in $game_troop.enemies
  537.       @action_battlers.push(enemy)
  538.     end
  539.     # 添加角色到 @action_battlers 序列
  540.     for actor in 0...[$game_party.actors.size,4].min
  541.       @action_battlers.push($game_party.actors[actor])
  542.     end
  543.     # 确定全体的行动速度
  544.     for battler in @action_battlers
  545.       battler.make_action_speed
  546.     end
  547.     # 按照行动速度从大到小排列
  548.     @action_battlers.sort! {|a,b|
  549.       b.current_action.speed - a.current_action.speed }
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ● 开始结束战斗回合
  553.   #--------------------------------------------------------------------------
  554.   def start_phase5
  555.     # 转移到回合 5
  556.     @phase = 5
  557.     # 演奏战斗结束 ME
  558.     $game_system.me_play($game_system.battle_end_me)
  559.     # 还原为战斗开始前的 BGM
  560.     $game_system.bgm_play($game_temp.map_bgm)
  561.     # 初始化 EXP、金钱、宝物
  562.     exp = 0
  563.     gold = 0
  564.     treasures = []
  565.     # 循环
  566.     for enemy in $game_troop.enemies
  567.       # 敌人不是隐藏状态的情况下
  568.       unless enemy.hidden
  569.         # 获得 EXP、增加金钱
  570.         exp += enemy.exp
  571.         gold += enemy.gold
  572.         # 出现宝物判定
  573.         if rand(100) < enemy.treasure_prob
  574.           if enemy.item_id > 0
  575.             treasures.push($data_items[enemy.item_id])
  576.           end
  577.           if enemy.weapon_id > 0
  578.             treasures.push($data_weapons[enemy.weapon_id])
  579.           end
  580.           if enemy.armor_id > 0
  581.             treasures.push($data_armors[enemy.armor_id])
  582.           end
  583.         end
  584.       end
  585.     end
  586.     # 限制宝物数为 6 个
  587.     treasures = treasures[0..5]
  588.     # 获得 EXP
  589.     for i in 0...[$game_party.actors.size,4].min
  590.       actor = $game_party.actors[i]
  591.       if actor.cant_get_exp? == false
  592.         last_level = actor.level
  593.         actor.exp += exp
  594.         if actor.level > last_level
  595.           @status_window.level_up(i)
  596.         end
  597.       end
  598.     end
  599.     # 获得金钱
  600.     $game_party.gain_gold(gold)
  601.     # 获得宝物
  602.     for item in treasures
  603.       case item
  604.       when RPG::Item
  605.         $game_party.gain_item(item.id, 1)
  606.       when RPG::Weapon
  607.         $game_party.gain_weapon(item.id, 1)
  608.       when RPG::Armor
  609.         $game_party.gain_armor(item.id, 1)
  610.       end
  611.     end
  612.     # 生成战斗结果窗口
  613.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  614.     # 设置等待计数
  615.     @phase5_wait_count = 100
  616.   end
  617.   #--------------------------------------------------------------------------
  618.   # ● 转到输入下一个角色的命令
  619.   #--------------------------------------------------------------------------
  620.   def phase3_next_actor
  621.     # 循环
  622.     begin
  623.       # 角色的明灭效果 OFF
  624.       if @active_battler != nil
  625.         @active_battler.blink = false
  626.       end
  627.       # 最后的角色的情况
  628.       if @actor_index == [$game_party.actors.size-1,3].min
  629.         # 开始主回合
  630.         start_phase4
  631.         return
  632.       end
  633.       # 推进角色索引
  634.       @actor_index += 1
  635.       @active_battler = $game_party.actors[@actor_index]
  636.       @active_battler.blink = true
  637.     # 如果角色是在无法接受指令的状态就再试
  638.     end until @active_battler.inputable?
  639.     # 设置角色的命令窗口
  640.     phase3_setup_command_window
  641.   end
  642. end

  643. class Arrow_Actor < Arrow_Base  
  644.   #--------------------------------------------------------------------------
  645.   # ● 刷新画面
  646.   #--------------------------------------------------------------------------
  647.   def update
  648.     super
  649.     # 光标右
  650.     if Input.repeat?(Input::RIGHT)
  651.       $game_system.se_play($data_system.cursor_se)
  652.       @index += 1
  653.       @index %= [$game_party.actors.size,4].min
  654.     end
  655.     # 光标左
  656.     if Input.repeat?(Input::LEFT)
  657.       $game_system.se_play($data_system.cursor_se)
  658.       @index += $game_party.actors.size - 1
  659.       @index %= [$game_party.actors.size,4].min
  660.     end
  661.     # 设置活动块坐标
  662.     if self.actor != nil
  663.       self.x = self.actor.screen_x
  664.       self.y = self.actor.screen_y
  665.     end
  666.   end
  667. end

  668. #==============================================================================
  669. # ■ Window_Target
  670. #------------------------------------------------------------------------------
  671. #  物品画面与特技画面的、使用对像角色选择窗口。
  672. #==============================================================================

  673. class Window_Target < Window_Selectable
  674. #--------------------------------------------------------------------------
  675. # ● 初始化对像
  676. #--------------------------------------------------------------------------
  677. def initialize
  678.    super(0, 0, 336, 480)
  679.    self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
  680.    self.z += 10
  681.    @item_max = $game_party.actors.size
  682.    @top_row = 0
  683.    refresh
  684. end
  685. #--------------------------------------------------------------------------
  686. # ● 刷新
  687. #--------------------------------------------------------------------------
  688. def refresh
  689.    self.contents.clear
  690.    for i in 0...$game_party.actors.size
  691.      x = 4
  692.      y = i * 112
  693.      actor = $game_party.actors[i]
  694.      draw_actor_name(actor, x, y)
  695.      draw_actor_class(actor, x + 144, y)
  696.      draw_actor_level(actor, x + 8, y + 32)
  697.      draw_actor_state(actor, x + 8, y + 64)
  698.      draw_actor_hp(actor, x + 152, y + 32)
  699.      draw_actor_sp(actor, x + 152, y + 64)
  700.    end
  701. end  
  702. #--------------------------------------------------------------------------
  703. # ● 刷新光标矩形
  704. #--------------------------------------------------------------------------
  705. def update_cursor_rect   
  706.    # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
  707.    if @index <= -2
  708.      self.cursor_rect.set(0, (@index + 10) * 112, self.width - 32, 96)
  709.    elsif @index == -1
  710.      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 112 - 20)
  711.    else
  712.      tpy = @index * 112 - self.oy
  713.      self.cursor_rect.set(0, tpy, self.width - 32, 96)
  714.      if @index < @top_row
  715.        @top_row = @index
  716.        self.oy = @top_row *112
  717.      end
  718.      if @index > @top_row+3
  719.        @top_row = @index-3
  720.        self.oy = @top_row *112
  721.      end
  722.    end   
  723. end
  724. end
  725. #==============================================================================
  726. # ■ Window_MenuStatus
  727. #------------------------------------------------------------------------------
  728. #  显示菜单画面和同伴状态的窗口。
  729. #==============================================================================

  730. class Window_MenuStatus < Window_Selectable
  731.   #--------------------------------------------------------------------------
  732.   # ● 初始化目标
  733.   #--------------------------------------------------------------------------
  734.   def initialize
  735.     super(0, 0, 480, 480)
  736.     self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
  737.     refresh
  738.     @top_row = 0
  739.     self.active = false
  740.     self.index = -1
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● 刷新
  744.   #--------------------------------------------------------------------------
  745.   def refresh
  746.     self.contents.clear
  747.     @item_max = $game_party.actors.size
  748.     for i in 0...$game_party.actors.size
  749.       x = 64
  750.       y = i * 112
  751.       if i <=3
  752.         self.contents.font.color = Color.new(0,255,0,255)
  753.         self.contents.draw_text(x,y,340,32,"[出战]",2)
  754.         self.contents.font.color = normal_color
  755.       else
  756.         self.contents.font.color = Color.new(128,128,128,255)
  757.         self.contents.draw_text(x,y,340,32,"[待机]",2)
  758.         self.contents.font.color = normal_color
  759.       end
  760.       actor = $game_party.actors[i]
  761.       draw_actor_graphic(actor, x - 40, y + 80)
  762.       draw_actor_name(actor, x, y)
  763.       draw_actor_class(actor, x + 144, y)
  764.       draw_actor_level(actor, x, y + 32)
  765.       draw_actor_state(actor, x + 90, y + 32)
  766.       draw_actor_exp(actor, x, y + 64)
  767.       draw_actor_hp(actor, x + 236, y + 32)
  768.       draw_actor_sp(actor, x + 236, y + 64)
  769.     end
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 刷新光标矩形
  773.   #--------------------------------------------------------------------------
  774.   def update_cursor_rect
  775.     if @index < 0
  776.       self.cursor_rect.empty
  777.     else
  778.       tpy = @index * 112 - self.oy
  779.       self.cursor_rect.set(0, tpy, self.width - 32, 96)
  780.       if @index < @top_row
  781.         @top_row = @index
  782.         self.oy = @top_row *112
  783.       end
  784.       if @index > @top_row+3
  785.         @top_row = @index-3
  786.         self.oy = @top_row *112
  787.       end
  788.     end
  789.   end
  790. end

  791. class Game_Party
  792.   #--------------------------------------------------------------------------
  793.   # ● 全灭判定
  794.   #--------------------------------------------------------------------------
  795.   def all_dead?
  796.     # 同伴人数为 0 的情况下
  797.     if $game_party.actors.size == 0
  798.       return false
  799.     end
  800.     # 同伴中无人 HP 在 0 以上
  801.     for i in 0..3
  802.       if @actors[i] != nil and@actors[i].hp >0
  803.         return false
  804.       end
  805.     end
  806.     # 全灭
  807.     return true
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # ● 加入同伴
  811.   #     actor_id : 角色 ID
  812.   #--------------------------------------------------------------------------
  813.   def add_actor(actor_id)
  814.     # 获取角色
  815.     actor = $game_actors[actor_id]
  816.     # 同伴人数未满 4 人、本角色不在队伍中的情况下
  817.     if not @actors.include?(actor)
  818.       # 添加角色
  819.       @actors.push(actor)
  820.       # 还原主角
  821.       $game_player.refresh
  822.     end
  823.   end
  824. end
复制代码

点评

好像是多出了那段原战斗系统的脚本,我用的RTAB战斗系统。不过我把整队里面的战斗系统那段删了,战斗系统就没问题了  发表于 2020-8-4 12:13
什么样的冲突?这个应该跟战斗系统无关的才对  发表于 2020-8-4 08:58
我又看了下,除了默认战斗系统,这个脚本对于其他的cp制战斗系统还是有冲突的  发表于 2020-8-3 20:24
游戏做好记得给我分享一下O(∩_∩)O  发表于 2020-8-3 13:16
谢了,这个的效果比之前舒服多了  发表于 2020-8-3 12:59

评分

参与人数 2星屑 +50 +2 收起 理由
RyanBern + 50 + 1 认可答案
暴走杀神 + 1 塞糖

查看全部评分


博客:我的博客
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 15:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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