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

Project1

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

请问谁有宠物小精灵的脚本??

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
50 小时
注册时间
2007-8-9
帖子
45
跳转到指定楼层
1
发表于 2007-12-31 02:11:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题!谁有宠物小精灵的脚本?发给我好吗?共享一下....

版务信息:本贴由楼主自主结贴~
享受游戏的快乐,感受快乐是人生,让一切不美好的事消失!

Lv1.梦旅人

梦石
0
星屑
50
在线时间
50 小时
注册时间
2007-8-9
帖子
45
2
 楼主| 发表于 2007-12-31 02:11:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题!谁有宠物小精灵的脚本?发给我好吗?共享一下....

版务信息:本贴由楼主自主结贴~
享受游戏的快乐,感受快乐是人生,让一切不美好的事消失!
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-28
帖子
340
3
发表于 2007-12-31 02:28:52 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

指引者

梦石
0
星屑
50
在线时间
2 小时
注册时间
2005-10-25
帖子
375
4
发表于 2007-12-31 03:17:25 | 只看该作者
自制菜单脚本
  1. #==============================================================================
  2. # ■ Scene_Menu
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================

  6. class Scene_Menu
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     menu_index : 命令光标的初期位置
  10.   #--------------------------------------------------------------------------
  11.   def initialize(menu_index = 0)
  12.     @menu_index = menu_index
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 主处理
  16.   #--------------------------------------------------------------------------
  17.   def main
  18.     # 生成命令窗口
  19.     s1 = "察看强度"
  20.     s2 = "特技"
  21.     @command_window = Window_Command.new(160, [s1,s2])
  22.     @command_window.index = @menu_index
  23.     @command_window.contents_opacity = 255
  24.     # 同伴人数为 0 的情况下
  25.     #if $game_party.actors.size == 1
  26.       # 物品、特技、装备、状态无效化
  27.      # @command_window.disable_item(0)
  28.       #@command_window.disable_item(1)
  29.     #end
  30.     # 生成游戏时间窗口
  31.     @playtime_window = Window_PlayTime.new
  32.     @playtime_window.x = 0
  33.     @playtime_window.y = 255
  34.     @playtime_window.contents_opacity = 255
  35.     # 生成步数窗口
  36.     @steps_window = Window_Steps.new
  37.     @steps_window.x = 0
  38.     @steps_window.y = 159
  39.     @steps_window.contents_opacity = 255
  40.     # 生成金钱窗口
  41.     @gold_window = Window_Gold.new
  42.     @gold_window.x = 0
  43.     @gold_window.y = 95
  44.     @gold_window.contents_opacity = 255
  45.     # 生成状态窗口
  46.     @status_window = Window_MenuStatus.new
  47.     @status_window.x = 160
  48.     @status_window.y = 0
  49.     @status_window.contents_opacity = 255
  50.     # 执行过渡
  51.     Graphics.transition
  52.     # 主循环
  53.     loop do
  54.       # 刷新游戏画面
  55.       Graphics.update
  56.       # 刷新输入信息
  57.       Input.update
  58.       # 刷新画面
  59.       update
  60.       # 如果切换画面就中断循环
  61.       if $scene != self
  62.         break
  63.       end
  64.     end
  65.     # 准备过渡
  66.     Graphics.freeze
  67.     # 释放窗口
  68.     @command_window.dispose
  69.     @playtime_window.dispose
  70.     @steps_window.dispose
  71.     @gold_window.dispose
  72.     @status_window.dispose
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ● 刷新画面
  76.   #--------------------------------------------------------------------------
  77.   def update
  78.     # 刷新窗口
  79.     @command_window.update
  80.     @playtime_window.update
  81.     @steps_window.update
  82.     @gold_window.update
  83.     @status_window.update
  84.     # 命令窗口被激活的情况下: 调用 update_command
  85.     if @command_window.active
  86.       update_command
  87.       return
  88.     end
  89.     # 状态窗口被激活的情况下: 调用 update_status
  90.     if @status_window.active
  91.       update_status
  92.       return
  93.     end
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 刷新画面 (命令窗口被激活的情况下)
  97.   #--------------------------------------------------------------------------
  98.   def update_command
  99.     # 按下 B 键的情况下
  100.     if Input.trigger?(Input::B)
  101.       # 演奏取消 SE
  102.       $game_system.se_play($data_system.cancel_se)
  103.       # 切换的地图画面
  104.       $scene = Scene_Map.new
  105.       return
  106.     end
  107.     # 按下 C 键的情况下
  108.     if Input.trigger?(Input::C)
  109.       # 命令窗口的光标位置分支
  110.       case @command_window.index
  111.       when 0 # 状态
  112.         # 演奏确定 SE
  113.         $game_system.se_play($data_system.decision_se)
  114.         # 激活状态窗口
  115.         @command_window.active = false
  116.         @status_window.active = true
  117.         @status_window.index = 0
  118.       when 1
  119.         # 演奏确定 SE
  120.         $game_system.se_play($data_system.decision_se)
  121.         # 激活状态窗口
  122.         @command_window.active = false
  123.         @status_window.active = true
  124.         @status_window.index = 0
  125.       end
  126.       return
  127.     end
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 刷新画面 (状态窗口被激活的情况下)
  131.   #--------------------------------------------------------------------------
  132.   def update_status
  133.     # 按下 B 键的情况下
  134.     if Input.trigger?(Input::B)
  135.       # 演奏取消 SE
  136.       $game_system.se_play($data_system.cancel_se)
  137.       # 激活命令窗口
  138.      @command_window.active = true
  139.       @status_window.active = false
  140.      @status_window.index = -1
  141.       return
  142.     end
  143.     # 按下 C 键的情况下
  144.     if Input.trigger?(Input::C)
  145.       # 命令窗口的光标位置分支
  146.       case @command_window.index
  147.       when 0  # 状态
  148.         # 演奏确定 SE
  149.         $game_system.se_play($data_system.decision_se)
  150.         # 切换到状态画面
  151.         $scene = Scene_Status.new(@status_window.index)
  152.       when 1
  153.          # 本角色的行动限制在 2 以上的情况下
  154.         if $game_party.actors[@status_window.index].restriction >= 2
  155.           # 演奏冻结 SE
  156.           $game_system.se_play($data_system.buzzer_se)
  157.           return
  158.         end
  159.         # 演奏确定 SE
  160.         $game_system.se_play($data_system.decision_se)
  161.         # 切换到特技画面
  162.         $scene = Scene_Skill.new(@status_window.index)
  163.       end
  164.       return
  165.     end
  166.   end
  167. end
复制代码


战斗脚本

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

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

  6. #==============================================================================
  7. # □ 初始化定义
  8. #==============================================================================
  9. module XRXS26
  10.   FRONT_MEMBER_LIMIT    = 2        # 战斗参战人数最大值
  11.   BACKWARD_MEMBER_LIMIT = 6        # 待机人数最大值
  12.   BACKWARD_EXP_GAINABLE = true     # 待机人物是否获得经验
  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             = [1]           # 不能移动的角色编号
  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.remove_actor(1)
  130.     $game_party.actors.compact!
  131.     # メイン処理
  132.     xrxs26_main
  133.     # 待機メンバーから復帰
  134.     $game_party.actors.insert(0, $game_actors[1])
  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. # --- XRXS. 第二カーソル 機構 ---
  164. #------------------------------------------------------------------------------
  165. #     ウィンドウに .index2 プロパティを追加します。
  166. #==============================================================================
  167. module XRXS_Cursor2
  168.   #--------------------------------------------------------------------------
  169.   # ● オブジェクト初期化
  170.   #--------------------------------------------------------------------------
  171.   def initialize(x, y, w, h)
  172.     super(x, y, h, w)
  173.     # 補助ウィンドウ(透明)を作成:カーソル専用
  174.     @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
  175.     @xrxsc2_window.opacity = 0
  176.     @xrxsc2_window.active = false
  177.     @xrxsc2_window.index = -1
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ○ 第二カーソルの設置
  181.   #--------------------------------------------------------------------------
  182.   def index2
  183.     return @xrxsc2_window.index
  184.   end
  185.   def index2=(index)
  186.     @xrxsc2_window.index = index
  187.     if index == -1
  188.       @xrxsc2_window.cursor_rect.empty
  189.     else
  190.       @xrxsc2_window.x = self.x
  191.       @xrxsc2_window.y = self.y
  192.       @xrxsc2_window.cursor_rect = self.cursor_rect
  193.     end
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ○ 先頭の行の設定
  197.   #--------------------------------------------------------------------------
  198.   def top_row=(row)
  199.     super
  200.     # 補助ウィンドウの oy を更新
  201.     pre_oy = @xrxsc2_window.oy
  202.     @xrxsc2_window.oy = self.oy
  203.     @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # ○ 解放
  207.   #--------------------------------------------------------------------------
  208.   def dispose
  209.     @xrxsc2_window.dispose
  210.     super
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ○ X, Y 座標
  214.   #--------------------------------------------------------------------------
  215.   def x=(n)
  216.     super
  217.     @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  218.   end
  219.   def y=(n)
  220.     super
  221.     @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  222.   end
  223. end
  224. # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
  225. # by 桜雅 在土

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


复制代码

人物扩张脚本

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

  4. # ▼▲▼ XRXS26BX. +BUZZデザイン ▼▲▼ built 033109
  5. # by 桜雅 在土

  6. #==============================================================================
  7. # □ 初始化定义
  8. #==============================================================================
  9. class Window_MenuStatus < Window_Selectable
  10.   #
  11.   # 不显示能力值的角色编号
  12.   #
  13.   NO_PARAMETER_ACTORS = []
  14. end
  15. #==============================================================================
  16. # ■ Window_MenuStatus
  17. #==============================================================================
  18. class Window_MenuStatus < Window_Selectable
  19.   #--------------------------------------------------------------------------
  20.   # ○ インクルード
  21.   #--------------------------------------------------------------------------
  22.   include XRXS26
  23.   #--------------------------------------------------------------------------
  24.   # ● 公開インスタンス変数
  25.   #--------------------------------------------------------------------------
  26.   attr_reader   :newitem_window
  27.   attr_reader   :bottomkeyhelp_window
  28.   #--------------------------------------------------------------------------
  29.   # ● オブジェクト初期化
  30.   #--------------------------------------------------------------------------
  31.   alias xrxs26bx_initialize initialize
  32.   def initialize
  33.     # 呼び戻す
  34.     xrxs26bx_initialize
  35.     # 寄生してウィンドウを作成
  36.     # ボトルキーヘルプウィンドウ
  37.     @bottomkeyhelp_window = Window_BottomKeyHelp.new
  38.     @bottomkeyhelp_window.visible = false
  39.     # 設定変更
  40.     self.height   = 448
  41.     self.contents = Bitmap.new(width - 32, height - 32)
  42.     refresh
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● リフレッシュ
  46.   #--------------------------------------------------------------------------
  47.   def refresh
  48.     self.contents.clear
  49.     @item_max = $game_party.actors.size
  50.     @column_max = 2
  51.     y = (FRONT_MEMBER_LIMIT+1)/2 * 64 + 28
  52.     self.contents.font.size = 16
  53.     self.contents.font.color = system_color
  54.     self.contents.draw_text(4, 0, 92, 28, "战斗人数")
  55.     self.contents.draw_text(4, y, 92, 28, "待机人数")
  56.     for i in 0...$game_party.actors.size
  57.       x = 64 + i%2 * 224
  58.       y = i/2 *  72 + 24
  59.       actor = $game_party.actors[i]
  60.       if i >= FRONT_MEMBER_LIMIT
  61.         y += 32
  62.         self.contents.font.color = disabled_color
  63.         self.contents.draw_text(x, y, 120, 32, actor.name)
  64.       else
  65.         draw_actor_name(actor   , x     , y     )
  66.       end
  67.       draw_actor_graphic(actor, x - 40, y + 64)
  68.       unless NO_PARAMETER_ACTORS.include?(actor.id)
  69.         draw_actor_level(actor  , x + 94, y     )
  70.         draw_actor_hp(actor     , x, y + 16)
  71.         draw_actor_sp(actor     , x, y + 32)
  72.         draw_actor_state(actor  , x, y + 48)
  73.       end
  74.     end
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ○ フレーム更新
  78.   #--------------------------------------------------------------------------
  79.   def update
  80.     # ウィンドウを更新
  81.     @bottomkeyhelp_window.update
  82.     super
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ○ 解放
  86.   #--------------------------------------------------------------------------
  87.   def dispose
  88.     @bottomkeyhelp_window.dispose
  89.     super
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● カーソルの矩形更新
  93.   #--------------------------------------------------------------------------
  94.   def update_cursor_rect
  95.     if @index < 0
  96.       self.cursor_rect.empty
  97.     else
  98.       y = @index/2 * 72 + 28
  99.       if @index >= FRONT_MEMBER_LIMIT
  100.         y += 32
  101.       end
  102.       self.cursor_rect.set(@index%2 * 224, y, 224, 72)
  103.     end
  104.   end
  105. end
  106. #==============================================================================
  107. # ■ Scene_Menu
  108. #==============================================================================
  109. class Scene_Menu
  110.   #--------------------------------------------------------------------------
  111.   # ● フレーム更新
  112.   #--------------------------------------------------------------------------
  113.   alias xrxs26bx_update update
  114.   def update
  115.     # 登録
  116.     if @bottomkeyhelp_window.nil?
  117.       @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
  118.       @bottomkeyhelp_window.visible = true
  119.       set_keyhelp1
  120.     end
  121.     # 呼び戻す
  122.     xrxs26bx_update
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  126.   #--------------------------------------------------------------------------
  127.   alias xrxs26bx_update_command update_command
  128.   def update_command
  129.     # 呼び戻す
  130.     xrxs26bx_update_command
  131.     # 入れ替え移行キーが押されたとき
  132.     if @command_window.index == -1 and @status_window.active
  133.       set_keyhelp2
  134.     end
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  138.   #--------------------------------------------------------------------------
  139.   alias xrxs26bx_update_status update_status
  140.   def update_status
  141.     # 保存
  142.     last_index = @status_window.index2
  143.     # 呼び戻す
  144.     xrxs26bx_update_status
  145.     #
  146.     if last_index != @status_window.index2
  147.       # 一人目を選択した場合
  148.       if @status_window.index2 >= 0
  149.         set_keyhelp3
  150.       else
  151.         set_keyhelp2
  152.       end
  153.     end
  154.     # 戻った場合
  155.     unless @status_window.active
  156.       set_keyhelp1
  157.     end
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ○ キーヘルプを設定 1
  161.   #--------------------------------------------------------------------------
  162.   def set_keyhelp1
  163.     @bottomkeyhelp_window.clear
  164.     @bottomkeyhelp_window.add("B","关闭本窗口")
  165.     @bottomkeyhelp_window.add("C","确定")
  166.     @bottomkeyhelp_window.add("→","人物顺序调整")
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ○ キーヘルプを設定 2
  170.   #--------------------------------------------------------------------------
  171.   def set_keyhelp2
  172.     @bottomkeyhelp_window.clear
  173.     @bottomkeyhelp_window.add("←,B","返回")
  174.     @bottomkeyhelp_window.add("C","第一个人物确定")
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ○ キーヘルプを設定 3
  178.   #--------------------------------------------------------------------------
  179.   def set_keyhelp3
  180.     @bottomkeyhelp_window.clear
  181.     @bottomkeyhelp_window.add("B","返回")
  182.     @bottomkeyhelp_window.add("C","第二个人物确定")
  183.   end
  184. end



  185. #==============================================================================
  186. # □ Window_BottomKeyHelp
  187. #------------------------------------------------------------------------------
  188. #     画面下で操作説明をする透明なウィンドウです。
  189. #==============================================================================
  190. class Window_BottomKeyHelp < Window_Base
  191.   #--------------------------------------------------------------------------
  192.   # ○ オブジェクト初期化
  193.   #--------------------------------------------------------------------------
  194.   def initialize
  195.     super(0, 432, 640, 64)
  196.     self.contents = Bitmap.new(width - 32, height - 32)
  197.     self.opacity = 0
  198.     clear
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ○ クリア
  202.   #--------------------------------------------------------------------------
  203.   def clear
  204.     self.contents.clear
  205.     @now_x = 608
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ○ 追加
  209.   #--------------------------------------------------------------------------
  210.   def add(key, explanation)
  211.     # 計算
  212.     self.contents.font.size = 20
  213.     x  = self.contents.text_size(key).width
  214.     self.contents.font.size = 16
  215.     x += self.contents.text_size(explanation).width + 8
  216.     @now_x -= x
  217.     # 描写
  218.     self.contents.font.size = 20
  219.     self.contents.font.color = system_color
  220.     self.contents.draw_text(@now_x, 0, x, 32, key, 0)
  221.     self.contents.font.size = 16
  222.     self.contents.font.color = normal_color
  223.     self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
  224.     # 余白
  225.     @now_x -= 32
  226.   end
  227. end

  228. #==============================================================================
  229. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  230. #==============================================================================
复制代码


↓这是啥-- [IMG][/IMG]
回复 支持 反对

使用道具 举报

Lv1.梦旅人

指引者

梦石
0
星屑
50
在线时间
2 小时
注册时间
2005-10-25
帖子
375
5
发表于 2007-12-31 03:17:42 | 只看该作者
图鉴脚本
  1. #==============================================================================
  2. # ◎ 战斗换人脚本主要部分。
  3. #==============================================================================
  4. # 制作by:enghao_lim
  5. #==============================================================================
  6. # 使用方法:
  7. #
  8. # 必须配合人物扩张脚本使用。
  9. #
  10. # 把此脚本插入到main之前。
  11. #
  12. # 根据范例中scene battle 1 及 scene battle 2 的修改方法修改自己的工程。
  13. #
  14. # 默认战斗最大人数为4,如果想更改,将39,41,43,63行的4更改即可。
  15. #==============================================================================

  16. class Scene_Battle

  17.   def update_phase3_actor_select
  18.    
  19.     @actor_window.visible = true

  20.     @actor_window.update

  21.     if Input.trigger?(Input::B)

  22.       $game_system.se_play($data_system.cancel_se)

  23.       end_actor_select
  24.       
  25.       return
  26.       
  27.     end
  28.    
  29.     if Input.trigger?(Input::C)
  30.       
  31.       if @start == 0
  32.         
  33.         if @actor_window.index >= 1
  34.          
  35.           @actor1 = $game_party.backword_actors[@actor_window.index-1]
  36.          
  37.           @actor2 = @actor_window.index-1
  38.          
  39.           @start = 1
  40.          
  41.           @choose_backword = 1
  42.          
  43.         else
  44.          
  45.           @actor1 = $game_party.actors[@actor_window.index]
  46.         
  47.           @actor2 = @actor_window.index
  48.         
  49.           @start = 1
  50.          
  51.           @choose_backword = 0
  52.          
  53.         end
  54.         
  55.       else
  56.         
  57.         if @actor_window.index >= 1
  58.          
  59.           $game_system.se_play($data_system.cancel_se)
  60.          
  61.         else
  62.          
  63.           if @choose_backword == 1
  64.             
  65.             $game_party.backword_actors[@actor2] = $game_party.actors[@actor_window.index]
  66.             
  67.             $game_party.actors[@actor_window.index] = @actor1

  68.           else
  69.             
  70.             $game_party.actors[@actor2] = $game_party.actors[@actor_window.index]
  71.             
  72.             $game_party.actors[@actor_window.index] = @actor1
  73.             
  74.           end
  75.          
  76.           @status_window.refresh
  77.         
  78.           @actor_window.refresh
  79.         
  80.           $game_player.refresh
  81.         
  82.           @start = 0
  83.         
  84.         end
  85.         
  86.       end
  87.       
  88.       return
  89.       
  90.     end
  91.    
  92.   end

  93.   def start_actor_select
  94.    
  95.     @start = 0
  96.    
  97.     @actor1 = 0
  98.    
  99.     @actor2 = 0
  100.    
  101.     @actor_window = Window_ChangeActor.new
  102.    
  103.     @actor_window.help_window = @help_window
  104.    
  105.     @actor_command_window.active = false
  106.    
  107.     @actor_command_window.visible = false
  108.    
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ●
  112.   #--------------------------------------------------------------------------
  113.   def end_actor_select
  114.    
  115.     @actor_window.dispose
  116.    
  117.     @actor_window = nil
  118.    
  119.     @help_window.visible = false
  120.    
  121.     @actor_command_window.active = true
  122.    
  123.     @actor_command_window.visible = true
  124.    
  125.   end
  126.   
  127. end

  128. #------------------------------------------------------------------------------

  129. class Window_ChangeActor < Window_Selectable

  130.   #----------------------------------------------------------------------------
  131.   
  132.   def initialize
  133.    
  134.     super(0, 64, 640, 256)
  135.    
  136.     @item_max = $game_party.actors.size + $game_party.backword_actors.size
  137.    
  138.     @column_max = 2
  139.    
  140.     refresh
  141.    
  142.     self.index = 0
  143.    
  144.     self.back_opacity = 160
  145.   
  146.   end

  147.   #----------------------------------------------------------------------------
  148.   
  149.   def item
  150.    
  151.     return @data[self.index]
  152.    
  153.   end
  154.   
  155.   #----------------------------------------------------------------------------

  156.   def refresh
  157.    
  158.     if self.contents != nil
  159.       
  160.       self.contents.dispose
  161.       
  162.       self.contents = nil
  163.       
  164.     end
  165.    
  166.     @data = []
  167.    
  168.     if $game_party.actors.size != 0
  169.       
  170.       for i in 0...$game_party.actors.size
  171.         
  172.         @data.push($game_actors[$game_party.actors[i].id])
  173.         
  174.       end
  175.       
  176.     end
  177.    
  178.     if $game_party.backword_actors.size != 0
  179.       
  180.       for i in 0...$game_party.backword_actors.size
  181.         
  182.         @data.push($game_actors[$game_party.backword_actors[i].id])
  183.         
  184.       end
  185.       
  186.     end
  187.         
  188.     self.contents = Bitmap.new(width - 32, row_max * 48)
  189.    
  190.     for i in 0...@item_max
  191.       
  192.       draw_item(i)
  193.       
  194.     end

  195.   end

  196.   #----------------------------------------------------------------------------
  197.   
  198.   def draw_item(index)
  199.    
  200.     actor = @data[index]
  201.    
  202.     x = 4 + index % 2 * (288 + 32)
  203.    
  204.     y = index / 2 * 48
  205.    
  206.     rect = Rect.new(x, y, self.width / @column_max - 32, 48)
  207.    
  208.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  209.    
  210.     draw_actor_graphic(actor,x+15,y+48)
  211.    
  212.     self.contents.font.size = 18
  213.    
  214.     self.contents.font.color = crisis_color
  215.    
  216.     self.contents.draw_text(x+42, y, 212, 24, actor.name, 0)
  217.    
  218.     self.contents.font.color = normal_color
  219.    
  220.     self.contents.draw_text(x+42,y+24,242,24,"HP" +"  "+actor.hp.to_s + "/"+ actor.maxhp.to_s)
  221.    
  222.   end
  223.   
  224.   #----------------------------------------------------------------------------
  225.   
  226.   def update_cursor_rect
  227.    
  228.     x = 4 + index % 2 * (288 + 32)
  229.    
  230.     y = index / 2 * 48
  231.    
  232.     self.cursor_rect.set(x-1, y-1, 216, 50)
  233.    
  234.   end
  235.   
  236.   #----------------------------------------------------------------------------
  237.   
  238.   def update_help
  239.    
  240.     @help_window.set_text(@data[index].name)
  241.    
  242.   end
  243.   
  244. end
复制代码



人物仓库脚本

  1. #==============================================================================
  2. # ■ chaochao的人物仓库ver1.02正式版
  3. # 修改了Game_Party
  4. # 功能:
  5. # 用来存放角色的仓库……
  6. # 召唤画面用$scene = Chaochao_Scene_Party.new
  7. # 其它使用说明在代码里已经备注。
  8. #------------------------------------------------------------------------------
  9. # 作者:chaochao
  10. # http://zhuchao.go1.icpcn.com
  11. #==============================================================================
  12. class Chaochao_Window_PartyLeft < Window_Selectable
  13.   def initialize
  14.     super(0, 0, 320, 224)
  15.     self.contents = Bitmap.new(width - 32, height - 32)
  16.     self.index = 0
  17.     refresh
  18.   end
  19.   def actor
  20.     return @actors[self.index]
  21.   end
  22.   def refresh
  23.     if self.contents != nil
  24.       self.contents.dispose
  25.       self.contents = nil
  26.     end
  27.     @actors = []
  28.     for i in 0...$game_party.actors.size
  29.       @actors.push($game_party.actors[i])
  30.     end
  31.    
  32.     @item_max = 7
  33.     if @item_max > 0
  34.       self.contents = Bitmap.new(width - 32, row_max * 32)
  35.       for i in 0...@item_max
  36.         draw_item(i)
  37.       end
  38.     end
  39.   end
  40.   def draw_item(index)
  41.     if @actors[index] != nil
  42.       actor = @actors[index]
  43.       text = @actors[index].name
  44.       lv = @actors[index].level.to_s + " "
  45.       if $game_party.chaochao.include?(actor.id) or $game_party.actors.size <= 2
  46.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  47.       else
  48.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  49.       end
  50.       self.contents.draw_text(4, index * 32, 288, 32, text)
  51.       self.contents.font.color = normal_color
  52.       self.contents.font.size = 16
  53.       self.contents.draw_text(4, index * 32, 288, 32,  "Level:   ", 2)
  54.       colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  55.       colory = [255.0000 / 60 * @actors[index].level,255].min
  56.       self.contents.font.color = Color.new(colorx, colory, 0)
  57.       self.contents.draw_text(4, index * 32, 288, 32,  lv, 2)
  58.       self.contents.font.color = normal_color
  59.       self.contents.font.size = 22
  60.     else
  61.       self.contents.draw_text(4, index * 32, 288, 32,  "--------")
  62.     end
  63.   end
  64.   def update_cursor_rect
  65.     if @index < 0
  66.       self.cursor_rect.empty
  67.       return
  68.     end
  69.     row = @index / @column_max
  70.     if row < self.top_row
  71.       self.top_row = row
  72.     end
  73.     if row > self.top_row + (self.page_row_max - 1)
  74.       self.top_row = row - (self.page_row_max - 1)
  75.     end
  76.     cursor_width = self.width / @column_max - 32
  77.     x = @index % @column_max * (cursor_width + 32)
  78.     y = @index / @column_max * 32 - self.oy
  79.     self.cursor_rect.set(x, y, cursor_width, 32)
  80.   end
  81.   def item_max
  82.     return @item_max
  83.   end
  84.   def actor?(index)
  85.     return @actors[index] == nil ? false : true
  86.   end
  87.   def set_index(x)
  88.     @index = x
  89.   end
  90. end

  91. #------------------------------------------------------------------------------

  92. class Chaochao_Window_PartyRight < Window_Selectable
  93.   def initialize
  94.     super(320, 0, 320, 224)
  95.     self.contents = Bitmap.new(width - 32, height - 32)
  96.     self.index = -1
  97.     refresh
  98.   end
  99.   def actor
  100.     return @actors[self.index]
  101.   end
  102.   def refresh
  103.     if self.contents != nil
  104.       self.contents.dispose
  105.       self.contents = nil
  106.     end
  107.     @actors = []
  108.     for i in 0...$game_party.actors2.size
  109.       @actors.push($game_party.actors2[i])
  110.     end
  111.    
  112.     @item_max = $game_party.actors2.size
  113.     if @item_max > 0
  114.       self.contents = Bitmap.new(width - 32, row_max * 32)
  115.       for i in 0...@item_max
  116.         draw_item(i)
  117.       end
  118.     elsif @item_max == 0
  119.       
  120.     end
  121.   end
  122.   def draw_item(index)
  123.     actor = @actors[index]
  124.     text = @actors[index].name
  125.     lv = @actors[index].level.to_s + " "
  126.     if $game_party.chaochao2.include?(actor.id) or $game_party.actors.size >= 6
  127.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  128.       else
  129.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  130.       end
  131.     self.contents.draw_text(4, index * 32, 288, 32, text)
  132.     self.contents.font.color = normal_color
  133.     self.contents.font.size = 16
  134.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  "Level:   ", 2)
  135.     colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  136.     colory = [255.0000 / 60 * @actors[index].level,255].min
  137.     self.contents.font.color = Color.new(colorx, colory, 0)
  138.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  lv, 2)
  139.     self.contents.font.color = normal_color
  140.     self.contents.font.size = 22
  141.   end
  142.   def update_cursor_rect
  143.     if @index < 0
  144.       self.cursor_rect.empty
  145.       return
  146.     end
  147.     row = @index / @column_max
  148.     if row < self.top_row
  149.       self.top_row = row
  150.     end
  151.     if row > self.top_row + (self.page_row_max - 1)
  152.       self.top_row = row - (self.page_row_max - 1)
  153.     end
  154.     cursor_width = self.width / @column_max - 32
  155.     x = @index % @column_max * (cursor_width + 32)
  156.     y = @index / @column_max * 32 - self.oy
  157.     self.cursor_rect.set(x, y, cursor_width, 32)
  158.   end
  159.   def item_max
  160.     return @item_max
  161.   end
  162.   def actor?(index)
  163.     return @actors[index] == nil ? false : true
  164.   end
  165.   def set_index(x)
  166.     @index = x
  167.   end
  168. end

  169. #------------------------------------------------------------------------------

  170. class Chaochao_Window_PartyData < Window_Base
  171.   
  172.   def initialize
  173.     super(0, 224, 640, 256)
  174.     self.contents = Bitmap.new(width - 32, height - 32)
  175.     @actor = nil
  176.   end
  177.   
  178.   def set_actor(actor)
  179.     self.contents.clear
  180.     draw_actor_name(actor, 4, 0)
  181.     draw_actor_state(actor, 140, 0)
  182.     draw_actor_hp(actor, 284, 0)
  183.     draw_actor_sp(actor, 460, 0)
  184.     @actor = actor
  185.     self.visible = true
  186.   end
  187.   def clear
  188.     self.contents.clear
  189.   end
  190. end

  191. #------------------------------------------------------------------------------

  192. class Game_Party
  193.   attr_reader   :actors2
  194.   attr_reader   :chaochao#不能从队伍向备用角色移动的角色ID
  195.   attr_reader   :chaochao2#不能从备用角色向队伍移动的角色ID
  196.   def initialize
  197.     @actors = []
  198.     @gold = 0
  199.     @steps = 0
  200.     @items = {}
  201.     @weapons = {}
  202.     @armors = {}
  203.     @actors2 = []
  204.     @chaochao = []
  205.     @chaochao2 = []
  206.   end
  207.   def add_actor(actor_id,type=1)#type为1是向队伍中添加,为2则相反。
  208.     case type
  209.     when 1
  210.       if $game_actors[actor_id] != nil
  211.         actor = $game_actors[actor_id]
  212.         #如果队伍没有满和队伍中没有此角色
  213.         if @actors.size < 7 and not @actors.include?(actor) and not @actors2.include?(actor)
  214.           @actors.push(actor)
  215.           $game_player.refresh
  216.         end
  217.       end
  218.     when 2
  219.       if $game_actors[actor_id] != nil
  220.         actor = $game_actors[actor_id]
  221.         #如果角色不在队伍中和不在备用角色队伍中的情况下
  222.         #向备用角色中添加角色
  223.         if not @actors.include?(actor) and not @actors2.include?(actor)
  224.           @actors2.push(actor)
  225.           $game_player.refresh
  226.         end
  227.       end
  228.     end
  229.   end
  230.   
  231.   def huanren(index,type=1)#type为1是从备用角色向队伍中移动,为2则相反。
  232.     actor = $game_actors[index]
  233.     case type
  234.     when 1
  235.       if @actors.size < 7 and @actors2.include?(actor) and not @chaochao2.include?(index) and not @actors.include?(actor)
  236.         @actors.push(actor)
  237.         @actors2.delete(actor)
  238.         $game_system.se_play($data_system.decision_se)
  239.         $game_player.refresh
  240.       end
  241.     when 2
  242.       if @actors.include?(actor) and not @chaochao.include?(index) and not @actors2.include?(actor)
  243.         @actors2.push(actor)
  244.         @actors.delete(actor)
  245.         $game_system.se_play($data_system.decision_se)
  246.         $game_player.refresh
  247.       end
  248.     end
  249.   end
  250.   
  251.   #type1,1是操作队伍中的角色能否向备用队伍移动,2则相反。
  252.   #type2,1是添加不能移动的,2是删除不能移动的。
  253.   def yidong(actor_id,type1,type2=1)
  254.     case type2
  255.     when 1
  256.       case type1
  257.       when 1
  258.         @chaochao.push(actor_id)
  259.       when 2
  260.         @chaochao2.push(actor_id)
  261.       end
  262.     when 2
  263.       case type1
  264.       when 1
  265.         @chaochao.delete(actor_id)
  266.       when 2
  267.         @chaochao2.delete(actor_id)
  268.       end
  269.     end
  270.   end
  271.   
  272.   #type,1从队伍中离开,2从备用角色中离开,3从队伍和备用角色中离开。
  273.   def remove_actor(actor_id,type=1)
  274.     actor = $game_actors[actor_id]
  275.     case type
  276.     when 1
  277.       @actors.delete(actor)
  278.       $game_player.refresh
  279.     when 2
  280.       @actors2.delete(actor)
  281.       $game_player.refresh
  282.     when 3
  283.       @actors.delete(actor)
  284.       @actors2.delete(actor)
  285.       $game_player.refresh
  286.     end
  287.   end
  288.   
  289.   def refresh
  290.     new_actors = []
  291.     new_actors2 = []
  292.     for i in [email protected]
  293.       if $data_actors[@actors[i].id] != nil
  294.         new_actors.push($game_actors[@actors[i].id])
  295.       end
  296.     end
  297.     @actors = new_actors
  298.     for i in [email protected]
  299.       if $data_actors[@actors2[i].id] != nil
  300.         new_actors2.push($game_actors[@actors2[i].id])
  301.       end
  302.     end
  303.     @actors2 = new_actors2
  304.   end
  305. end

  306. #------------------------------------------------------------------------------

  307. class Chaochao_Scene_Party
  308.   def main
  309.     @left_temp_command = 0
  310.     @right_temp_command = 0
  311.     @temp = 0
  312.     @left_window = Chaochao_Window_PartyLeft.new
  313.     @left_window.active = true
  314.     @right_window = Chaochao_Window_PartyRight.new
  315.     @right_window.active = false
  316.     @data_window = Chaochao_Window_PartyData.new
  317.     update_data
  318.     Graphics.transition
  319.     loop do
  320.       Graphics.update
  321.       Input.update
  322.       update
  323.       if $scene != self
  324.         break
  325.       end
  326.     end
  327.     Graphics.freeze
  328.     @left_window.dispose
  329.     @right_window.dispose
  330.     @data_window.dispose
  331.   end
  332.   
  333.   def update
  334.     @left_window.update
  335.     @right_window.update
  336.     @data_window.update
  337.     update_command
  338.     update_data
  339.   end
  340.   
  341.   def update_command
  342.     if Input.trigger?(Input::B)
  343.       $game_system.se_play($data_system.cancel_se)
  344.       #画面切换
  345.       $scene = Scene_Map.new
  346.       return
  347.     end
  348.     if @left_window.active
  349.       update_left
  350.       return
  351.     end
  352.     if @right_window.active
  353.       update_right
  354.       return
  355.     end
  356.   end
  357.   
  358.   def update_left
  359.     if Input.trigger?(Input::RIGHT)
  360.       if @right_window.item_max > 0
  361.         @left_temp_command = @left_window.index
  362.         @left_window.set_index(-1)
  363.         $game_system.se_play($data_system.cursor_se)
  364.         @left_window.active = false
  365.         @right_window.active = true
  366.         @left_window.refresh
  367.         @right_window.refresh
  368.         @right_window.set_index(@right_temp_command)
  369.         return
  370.       else
  371.         $game_system.se_play($data_system.buzzer_se)
  372.         return
  373.       end
  374.     end
  375.     if Input.trigger?(Input::C)
  376.       if @left_window.active and @left_window.actor?(@left_window.index) and $game_party.actors.size > 2 and not $game_party.chaochao.include?($game_party.actors[@left_window.index].id)
  377.         $game_party.huanren($game_party.actors[@left_window.index].id,2)#type为1是从备用角色向队伍中移动,为2则相反。
  378.         @left_window.refresh
  379.         @right_window.refresh
  380.       else
  381.         $game_system.se_play($data_system.buzzer_se)
  382.       end
  383.     end
  384.     return
  385.   end
  386.   
  387.   def update_right
  388.     if Input.trigger?(Input::LEFT)
  389.       if @left_window.item_max > 0
  390.         @right_temp_command = @right_window.index
  391.         @right_window.set_index(-1)
  392.         $game_system.se_play($data_system.cursor_se)
  393.         @left_window.active = true
  394.         @right_window.active = false
  395.         @left_window.refresh
  396.         @right_window.refresh
  397.         @left_window.set_index(@left_temp_command)
  398.         return
  399.       else
  400.         $game_system.se_play($data_system.buzzer_se)
  401.         return
  402.       end
  403.     end
  404.     if Input.trigger?(Input::C)
  405.       if $game_party.actors.size >= 7
  406.         $game_system.se_play($data_system.buzzer_se)
  407.         return
  408.       end
  409.       if @right_window.active and @right_window.actor?(@right_window.index) and not $game_party.chaochao2.include?($game_party.actors2[@right_window.index].id)
  410.         $game_party.huanren($game_party.actors2[@right_window.index].id,1)#type为1是从备用角色向队伍中移动,为2则相反。
  411.         if $game_party.actors2.size == 0
  412.           @right_temp_command = @right_window.index
  413.           @right_window.set_index(-1)
  414.           $game_system.se_play($data_system.cursor_se)
  415.           @left_window.active = true
  416.           @right_window.active = false
  417.           @left_window.refresh
  418.           @right_window.refresh
  419.           @left_window.set_index(@left_temp_command)
  420.         end
  421.         if @right_window.index > 0
  422.           @right_window.set_index(@right_window.index-1)
  423.         end
  424.         @left_window.refresh
  425.         @right_window.refresh
  426.       else
  427.         $game_system.se_play($data_system.buzzer_se)
  428.       end
  429.     end
  430.     return
  431.   end
  432.   
  433.   def update_data
  434.     if @left_window.active
  435.       if $game_party.actors[@left_window.index] != nil
  436.         @data_window.set_actor($game_party.actors[@left_window.index])
  437.       else
  438.         @data_window.clear
  439.       end
  440.       return
  441.     end
  442.     if @right_window.active
  443.       if $game_party.actors2[@right_window.index] != nil
  444.         @data_window.set_actor($game_party.actors2[@right_window.index])
  445.       else
  446.         @data_window.clear
  447.       end
  448.       return
  449.     end
  450.   end
  451. end

复制代码


还有个战斗换人脚本

战斗换人脚本

  1. #==============================================================================
  2. # ◎ 战斗换人脚本主要部分。
  3. #==============================================================================
  4. # 制作by:enghao_lim
  5. #==============================================================================
  6. # 使用方法:
  7. #
  8. # 必须配合人物扩张脚本使用。
  9. #
  10. # 把此脚本插入到main之前。
  11. #
  12. # 根据范例中scene battle 1 及 scene battle 2 的修改方法修改自己的工程。
  13. #
  14. # 默认战斗最大人数为4,如果想更改,将39,41,43,63行的4更改即可。
  15. #==============================================================================

  16. class Scene_Battle

  17.   def update_phase3_actor_select
  18.    
  19.     @actor_window.visible = true

  20.     @actor_window.update

  21.     if Input.trigger?(Input::B)

  22.       $game_system.se_play($data_system.cancel_se)

  23.       end_actor_select
  24.       
  25.       return
  26.       
  27.     end
  28.    
  29.     if Input.trigger?(Input::C)
  30.       
  31.       if @start == 0
  32.         
  33.         if @actor_window.index >= 1
  34.          
  35.           @actor1 = $game_party.backword_actors[@actor_window.index-1]
  36.          
  37.           @actor2 = @actor_window.index-1
  38.          
  39.           @start = 1
  40.          
  41.           @choose_backword = 1
  42.          
  43.         else
  44.          
  45.           @actor1 = $game_party.actors[@actor_window.index]
  46.         
  47.           @actor2 = @actor_window.index
  48.         
  49.           @start = 1
  50.          
  51.           @choose_backword = 0
  52.          
  53.         end
  54.         
  55.       else
  56.         
  57.         if @actor_window.index >= 1
  58.          
  59.           $game_system.se_play($data_system.cancel_se)
  60.          
  61.         else
  62.          
  63.           if @choose_backword == 1
  64.             
  65.             $game_party.backword_actors[@actor2] = $game_party.actors[@actor_window.index]
  66.             
  67.             $game_party.actors[@actor_window.index] = @actor1

  68.           else
  69.             
  70.             $game_party.actors[@actor2] = $game_party.actors[@actor_window.index]
  71.             
  72.             $game_party.actors[@actor_window.index] = @actor1
  73.             
  74.           end
  75.          
  76.           @status_window.refresh
  77.         
  78.           @actor_window.refresh
  79.         
  80.           $game_player.refresh
  81.         
  82.           @start = 0
  83.         
  84.         end
  85.         
  86.       end
  87.       
  88.       return
  89.       
  90.     end
  91.    
  92.   end

  93.   def start_actor_select
  94.    
  95.     @start = 0
  96.    
  97.     @actor1 = 0
  98.    
  99.     @actor2 = 0
  100.    
  101.     @actor_window = Window_ChangeActor.new
  102.    
  103.     @actor_window.help_window = @help_window
  104.    
  105.     @actor_command_window.active = false
  106.    
  107.     @actor_command_window.visible = false
  108.    
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ●
  112.   #--------------------------------------------------------------------------
  113.   def end_actor_select
  114.    
  115.     @actor_window.dispose
  116.    
  117.     @actor_window = nil
  118.    
  119.     @help_window.visible = false
  120.    
  121.     @actor_command_window.active = true
  122.    
  123.     @actor_command_window.visible = true
  124.    
  125.   end
  126.   
  127. end

  128. #------------------------------------------------------------------------------

  129. class Window_ChangeActor < Window_Selectable

  130.   #----------------------------------------------------------------------------
  131.   
  132.   def initialize
  133.    
  134.     super(0, 64, 640, 256)
  135.    
  136.     @item_max = $game_party.actors.size + $game_party.backword_actors.size
  137.    
  138.     @column_max = 2
  139.    
  140.     refresh
  141.    
  142.     self.index = 0
  143.    
  144.     self.back_opacity = 160
  145.   
  146.   end

  147.   #----------------------------------------------------------------------------
  148.   
  149.   def item
  150.    
  151.     return @data[self.index]
  152.    
  153.   end
  154.   
  155.   #----------------------------------------------------------------------------

  156.   def refresh
  157.    
  158.     if self.contents != nil
  159.       
  160.       self.contents.dispose
  161.       
  162.       self.contents = nil
  163.       
  164.     end
  165.    
  166.     @data = []
  167.    
  168.     if $game_party.actors.size != 0
  169.       
  170.       for i in 0...$game_party.actors.size
  171.         
  172.         @data.push($game_actors[$game_party.actors[i].id])
  173.         
  174.       end
  175.       
  176.     end
  177.    
  178.     if $game_party.backword_actors.size != 0
  179.       
  180.       for i in 0...$game_party.backword_actors.size
  181.         
  182.         @data.push($game_actors[$game_party.backword_actors[i].id])
  183.         
  184.       end
  185.       
  186.     end
  187.         
  188.     self.contents = Bitmap.new(width - 32, row_max * 48)
  189.    
  190.     for i in 0...@item_max
  191.       
  192.       draw_item(i)
  193.       
  194.     end

  195.   end

  196.   #----------------------------------------------------------------------------
  197.   
  198.   def draw_item(index)
  199.    
  200.     actor = @data[index]
  201.    
  202.     x = 4 + index % 2 * (288 + 32)
  203.    
  204.     y = index / 2 * 48
  205.    
  206.     rect = Rect.new(x, y, self.width / @column_max - 32, 48)
  207.    
  208.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  209.    
  210.     draw_actor_graphic(actor,x+15,y+48)
  211.    
  212.     self.contents.font.size = 18
  213.    
  214.     self.contents.font.color = crisis_color
  215.    
  216.     self.contents.draw_text(x+42, y, 212, 24, actor.name, 0)
  217.    
  218.     self.contents.font.color = normal_color
  219.    
  220.     self.contents.draw_text(x+42,y+24,242,24,"HP" +"  "+actor.hp.to_s + "/"+ actor.maxhp.to_s)
  221.    
  222.   end
  223.   
  224.   #----------------------------------------------------------------------------
  225.   
  226.   def update_cursor_rect
  227.    
  228.     x = 4 + index % 2 * (288 + 32)
  229.    
  230.     y = index / 2 * 48
  231.    
  232.     self.cursor_rect.set(x-1, y-1, 216, 50)
  233.    
  234.   end
  235.   
  236.   #----------------------------------------------------------------------------
  237.   
  238.   def update_help
  239.    
  240.     @help_window.set_text(@data[index].name)
  241.    
  242.   end
  243.   
  244. end

复制代码

这是战斗换人的范例
http://rpg.blue/upload_program/files/战斗换人范例.zip
小lim写的


系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
↓这是啥-- [IMG][/IMG]
回复 支持 反对

使用道具 举报

Lv1.梦旅人

指引者

梦石
0
星屑
50
在线时间
2 小时
注册时间
2005-10-25
帖子
375
6
发表于 2007-12-31 03:19:49 | 只看该作者
我自己做了一个 要用到好多脚本

有的地方需要自己修改
↓这是啥-- [IMG][/IMG]
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
50 小时
注册时间
2007-8-9
帖子
45
7
 楼主| 发表于 2007-12-31 05:36:19 | 只看该作者
谢谢!各位!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

指引者

梦石
0
星屑
50
在线时间
2 小时
注册时间
2005-10-25
帖子
375
8
发表于 2007-12-31 17:13:04 | 只看该作者
我自己也做了个口袋妖怪RM版
↓这是啥-- [IMG][/IMG]
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-30
帖子
52
9
发表于 2007-12-31 21:14:53 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

很傻很天真

梦石
0
星屑
55
在线时间
3 小时
注册时间
2007-3-13
帖子
3667
10
发表于 2008-1-12 06:37:29 | 只看该作者
LZ   你都谢谢别人了 还不给分..
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 09:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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