Project1

标题: 如何在XP里面设置战斗1V1,其余5人待命! [打印本页]

作者: casey1379    时间: 2013-8-5 17:23
标题: 如何在XP里面设置战斗1V1,其余5人待命!
          看到一个脚本
http://rpg.blue/thread-210619-1-1.html  二楼的,可以改,但是和我用的宠物抓捕,好像有冲突!
还有没人直接在脚本上改的!求教!
我用的宠物脚本是
RUBY 代码复制
  1. #============================================================================
  2. #宠物系统 By Iselia雪
  3. #数据库中可以捕捉的敌人格式这样写 敌人,捕捉后的职业
  4. #捕捉特技的属性下面设定。
  5. #敌人捕捉的几率和这个属性抵抗力反比,和使用者速度+敏捷与目标速度+敏捷比值成正比。
  6. #具体设置参考范例~
  7. #整合了chaochao的人物仓库(新建的宠物$game_party.actors.include?不认?!)
  8. #不过这个难不住我ORZ……^__________^
  9. #捕捉后敌人的行走图和战斗图名字相同,没有行走图则为空。
  10. #============================================================================
  11. $捕捉 = "抓宠物啦"    #设置一个叫做“抓宠物啦”的属性里面可以改
  12. module RPG
  13.   class Skill
  14.     def catch?
  15.       return @element_set.include?($data_system.elements.index($捕捉))
  16.     end
  17.   end
  18. end
  19. module RPG
  20.   class Enemy
  21.     def name
  22.       return @name.split(/,/)[0]
  23.     end
  24.     def mold
  25.       return @name.split(/,/)[1]
  26.     end
  27.   end
  28. end
  29. class Game_Enemy < Game_Battler
  30.   def mold
  31.     return $data_enemies[@enemy_id].mold
  32.   end
  33.   def element_ranks
  34.     return $data_enemies[@enemy_id].element_ranks
  35.   end
  36.   def make_pet
  37.     pet = $data_actors[mold.to_i]
  38.     pet.battler_name = self.battler_name
  39.     pet.battler_hue = self.battler_hue
  40.     begin
  41.       RPG::Cache.character(self.battler_name,self.battler_hue)
  42.       pet.character_name = self.battler_name
  43.       pet.character_hue = self.battler_hue
  44.     rescue Errno::ENOENT
  45.  
  46.     end
  47.     pet.name = self.name
  48.     $data_actors[$data_actors.size] = pet
  49.     pet2 = Game_Actor.new($data_actors.size - 1)
  50.     $game_actors.push(pet2)
  51.     $data_actors.delete_at($data_actors.size)
  52.     p $data_actors[$data_actors.size]
  53.     if $game_party.actors.size == 6      #当宠物达到数后传送到电脑里面!
  54.       $game_party.add_actor($game_actors.size-1,2)
  55.     else
  56.       $game_party.add_actor($game_actors.size-1)
  57.     end
  58.     $scene.status_window.refresh
  59.   end
  60. end
  61. class Game_Actors
  62.   def push(val)
  63.     if @data.size < 999
  64.      @data.push(val)
  65.     end  
  66.   end
  67.   def size
  68.     return @data.size
  69.   end
  70.   def [](actor_id)
  71.     if actor_id > 999
  72.       return nil
  73.     end
  74.     if @data[actor_id] == nil
  75.       @data[actor_id] = Game_Actor.new(actor_id)
  76.     end
  77.     return @data[actor_id]
  78.   end
  79. end
  80. class Game_Battler
  81.   alias skill_effect_iselia :skill_effect
  82.     def skill_effect(user,skill)
  83.       if skill.element_set.include?($data_system.elements.index($捕捉))
  84.         catch(user)
  85.         return true
  86.       end
  87.     skill_effect_iselia(user,skill)
  88.   end
  89.   #捕捉
  90.   def catch(user)
  91.     percent = (user.agi + user.dex) / (self.agi + self.dex) * percent_base
  92.     if self.can_catch and rand(100) < percent
  93.       self.hidden = true
  94.       self.current_action.kind = 3
  95.       make_pet
  96.     end
  97.   end
  98.   #可否捕捉
  99.   def can_catch
  100.     return self.is_a?(Game_Enemy) && self.mold != nil
  101.   end
  102.   #宠物资料
  103.   def percent_base
  104.     return 0 if self.is_a?(Game_Actor)
  105.     return [100,80,60,40,20,10,5][self.element_ranks[$data_system.elements.index($捕捉)]]
  106.   end
  107. end
  108. class Scene_Battle
  109.   attr_accessor :status_window
  110.   def make_skill_action_result
  111.     # 获取特技
  112.     [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[@active_battler.current_action.skill_id]
  113.     # 如果不是强制行动
  114.     unless @active_battler.current_action.forcing
  115.       # 因为 SP 耗尽而无法使用的情况下
  116.       unless @active_battler.skill_can_use?(@skill.id)
  117.         # 清除强制行动对像的战斗者
  118.         $game_temp.forcing_battler = nil
  119.         # 移至步骤 1
  120.         @phase4_step = 1
  121.         return
  122.       end
  123.     end
  124.     # 消耗 SP
  125.     @active_battler.sp -= @skill.sp_cost
  126.     # 刷新状态窗口
  127.     @status_window.refresh
  128.     # 在帮助窗口显示特技名
  129.     @help_window.set_text(@skill.name, 1)
  130.     # 设置动画 ID
  131.     @animation1_id = @skill.animation1_id
  132.     @animation2_id = @skill.animation2_id
  133.     # 设置公共事件 ID
  134.     @common_event_id = @skill.common_event_id
  135.     # 设置对像侧战斗者
  136.     set_target_battlers(@skill.scope)
  137.     if @skill.catch?
  138.       @active_battler.animation_id = @animation1_id
  139.     ($data_animations[@animation1_id].frame_max + 8).times do
  140.       Graphics.update
  141.       @spriteset.update
  142.     end
  143.     @target_battlers.each do |v|
  144.       v.animation_id = @animation2_id
  145.     end
  146.     ($data_animations[@animation2_id].frame_max + 8).times do
  147.       Graphics.update
  148.       @spriteset.update
  149.     end
  150.     end
  151.     # 应用特技效果
  152.     for target in @target_battlers
  153.       target.skill_effect(@active_battler, @skill)
  154.     end
  155.     if @skill.catch?
  156.     @phase4_step = 5
  157.     end
  158.   end
  159. end

作者: 弗雷德    时间: 2013-8-5 18:13
既然楼主知道跟宠物抓捕有冲突,那就应该把宠物抓捕的脚本也发上来吧,不然别人怎么修改……
作者: casey1379    时间: 2013-8-5 18:18
这个是修改战斗1人,待命几个人不参战的,
  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 = 8     # 待机人数最大值
  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             = []           # 不能移动的角色编号
  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 [url=home.php?mod=space&uid=370741]@Index[/url] < 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. # ▼▲▼ XRXS26BX. +BUZZデザイン ▼▲▼ built 033109
  413. # by 桜雅 在土

  414. #==============================================================================
  415. # □ 初始化定义
  416. #==============================================================================
  417. class Window_MenuStatus < Window_Selectable
  418.   #
  419.   # 不显示能力值的角色编号
  420.   #
  421.   NO_PARAMETER_ACTORS = []
  422. end
  423. #==============================================================================
  424. # ■ Window_MenuStatus
  425. #==============================================================================
  426. class Window_MenuStatus < Window_Selectable
  427.   #--------------------------------------------------------------------------
  428.   # ○ インクルード
  429.   #--------------------------------------------------------------------------
  430.   include XRXS26
  431.   #--------------------------------------------------------------------------
  432.   # ● 公開インスタンス変数
  433.   #--------------------------------------------------------------------------
  434.   attr_reader   :newitem_window
  435.   attr_reader   :bottomkeyhelp_window
  436.   #--------------------------------------------------------------------------
  437.   # ● オブジェクト初期化
  438.   #--------------------------------------------------------------------------
  439.   alias xrxs26bx_initialize initialize
  440.   def initialize
  441.     # 呼び戻す
  442.     xrxs26bx_initialize
  443.     # 寄生してウィンドウを作成
  444.     # ボトルキーヘルプウィンドウ
  445.     @bottomkeyhelp_window = Window_BottomKeyHelp.new
  446.     @bottomkeyhelp_window.visible = false
  447.     # 設定変更
  448.     self.height   = 448
  449.     self.contents = Bitmap.new(width - 32, height - 32)
  450.     refresh
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ● リフレッシュ
  454.   #--------------------------------------------------------------------------
  455.   def refresh
  456.     self.contents.clear
  457.     @item_max = $game_party.actors.size
  458.     @column_max = 2
  459.     y = (FRONT_MEMBER_LIMIT+1)/2 * 64 + 28
  460.     self.contents.font.size = 16
  461.     self.contents.font.color = system_color
  462.     self.contents.draw_text(4, 0, 92, 28, "战斗人数")
  463.     self.contents.draw_text(4, y, 92, 28, "待机人数")
  464.     for i in 0...$game_party.actors.size
  465.       x = 64 + i%2 * 224
  466.       y = i/2 *  72 + 24
  467.       actor = $game_party.actors[i]
  468.       if i >= FRONT_MEMBER_LIMIT
  469.         y += 32
  470.         self.contents.font.color = disabled_color
  471.         self.contents.draw_text(x, y, 120, 32, actor.name)
  472.       else
  473.         draw_actor_name(actor   , x     , y     )
  474.       end
  475.       draw_actor_graphic(actor, x - 40, y + 64)
  476.       unless NO_PARAMETER_ACTORS.include?(actor.id)
  477.         draw_actor_level(actor  , x + 94, y     )
  478.         draw_actor_hp(actor     , x, y + 16)
  479.         draw_actor_sp(actor     , x, y + 32)
  480.         draw_actor_state(actor  , x, y + 48)
  481.       end
  482.     end
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ○ フレーム更新
  486.   #--------------------------------------------------------------------------
  487.   def update
  488.     # ウィンドウを更新
  489.     @bottomkeyhelp_window.update
  490.     super
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ○ 解放
  494.   #--------------------------------------------------------------------------
  495.   def dispose
  496.     @bottomkeyhelp_window.dispose
  497.     super
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● カーソルの矩形更新
  501.   #--------------------------------------------------------------------------
  502.   def update_cursor_rect
  503.     if @index < 0
  504.       self.cursor_rect.empty
  505.     else
  506.       y = @index/2 * 72 + 28
  507.       if @index >= FRONT_MEMBER_LIMIT
  508.         y += 32
  509.       end
  510.       self.cursor_rect.set(@index%2 * 224, y, 224, 72)
  511.     end
  512.   end
  513. end
  514. #==============================================================================
  515. # ■ Scene_Menu
  516. #==============================================================================
  517. class Scene_Menu
  518.   #--------------------------------------------------------------------------
  519.   # ● フレーム更新
  520.   #--------------------------------------------------------------------------
  521.   alias xrxs26bx_update update
  522.   def update
  523.     # 登録
  524.     if @bottomkeyhelp_window.nil?
  525.       @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
  526.       @bottomkeyhelp_window.visible = true
  527.       set_keyhelp1
  528.     end
  529.     # 呼び戻す
  530.     xrxs26bx_update
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  534.   #--------------------------------------------------------------------------
  535.   alias xrxs26bx_update_command update_command
  536.   def update_command
  537.     # 呼び戻す
  538.     xrxs26bx_update_command
  539.     # 入れ替え移行キーが押されたとき
  540.     if @command_window.index == -1 and @status_window.active
  541.       set_keyhelp2
  542.     end
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  546.   #--------------------------------------------------------------------------
  547.   alias xrxs26bx_update_status update_status
  548.   def update_status
  549.     # 保存
  550.     last_index = @status_window.index2
  551.     # 呼び戻す
  552.     xrxs26bx_update_status
  553.     #
  554.     if last_index != @status_window.index2
  555.       # 一人目を選択した場合
  556.       if @status_window.index2 >= 0
  557.         set_keyhelp3
  558.       else
  559.         set_keyhelp2
  560.       end
  561.     end
  562.     # 戻った場合
  563.     unless @status_window.active
  564.       set_keyhelp1
  565.     end
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ○ キーヘルプを設定 1
  569.   #--------------------------------------------------------------------------
  570.   def set_keyhelp1
  571.     @bottomkeyhelp_window.clear
  572.     @bottomkeyhelp_window.add("B","关闭本窗口")
  573.     @bottomkeyhelp_window.add("C","确定")
  574.     @bottomkeyhelp_window.add("→","人物顺序调整")
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ○ キーヘルプを設定 2
  578.   #--------------------------------------------------------------------------
  579.   def set_keyhelp2
  580.     @bottomkeyhelp_window.clear
  581.     @bottomkeyhelp_window.add("←,B","返回")
  582.     @bottomkeyhelp_window.add("C","第一个人物确定")
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ○ キーヘルプを設定 3
  586.   #--------------------------------------------------------------------------
  587.   def set_keyhelp3
  588.     @bottomkeyhelp_window.clear
  589.     @bottomkeyhelp_window.add("B","返回")
  590.     @bottomkeyhelp_window.add("C","第二个人物确定")
  591.   end
  592. end



  593. #==============================================================================
  594. # □ Window_BottomKeyHelp
  595. #------------------------------------------------------------------------------
  596. #     画面下で操作説明をする透明なウィンドウです。
  597. #==============================================================================
  598. class Window_BottomKeyHelp < Window_Base
  599.   #--------------------------------------------------------------------------
  600.   # ○ オブジェクト初期化
  601.   #--------------------------------------------------------------------------
  602.   def initialize
  603.     super(0, 432, 640, 64)
  604.     self.contents = Bitmap.new(width - 32, height - 32)
  605.     self.opacity = 0
  606.     clear
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # ○ クリア
  610.   #--------------------------------------------------------------------------
  611.   def clear
  612.     self.contents.clear
  613.     @now_x = 608
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # ○ 追加
  617.   #--------------------------------------------------------------------------
  618.   def add(key, explanation)
  619.     # 計算
  620.     self.contents.font.size = 20
  621.     x  = self.contents.text_size(key).width
  622.     self.contents.font.size = 16
  623.     x += self.contents.text_size(explanation).width + 8
  624.     @now_x -= x
  625.     # 描写
  626.     self.contents.font.size = 20
  627.     self.contents.font.color = system_color
  628.     self.contents.draw_text(@now_x, 0, x, 32, key, 0)
  629.     self.contents.font.size = 16
  630.     self.contents.font.color = normal_color
  631.     self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
  632.     # 余白
  633.     @now_x -= 32
  634.   end
  635. end

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

作者: casey1379    时间: 2013-8-5 18:19
这个是抓宠物的系统!麻烦大家了
  1. #============================================================================
  2. #宠物系统 By Iselia雪
  3. #数据库中可以捕捉的敌人格式这样写 敌人,捕捉后的职业
  4. #捕捉特技的属性下面设定。
  5. #敌人捕捉的几率和这个属性抵抗力反比,和使用者速度+敏捷与目标速度+敏捷比值成正比。
  6. #具体设置参考范例~
  7. #整合了chaochao的人物仓库(新建的宠物$game_party.actors.include?不认?!)
  8. #不过这个难不住我ORZ……^__________^
  9. #捕捉后敌人的行走图和战斗图名字相同,没有行走图则为空。
  10. #============================================================================
  11. $捕捉 = "抓宠物啦"    #设置一个叫做“抓宠物啦”的属性里面可以改
  12. module RPG
  13.   class Skill
  14.     def catch?
  15.       return @element_set.include?($data_system.elements.index($捕捉))
  16.     end
  17.   end
  18. end
  19. module RPG
  20.   class Enemy
  21.     def name
  22.       return @name.split(/,/)[0]
  23.     end
  24.     def mold
  25.       return @name.split(/,/)[1]
  26.     end
  27.   end
  28. end
  29. class Game_Enemy < Game_Battler
  30.   def mold
  31.     return $data_enemies[@enemy_id].mold
  32.   end
  33.   def element_ranks
  34.     return $data_enemies[@enemy_id].element_ranks
  35.   end
  36.   def make_pet
  37.     pet = $data_actors[mold.to_i]
  38.     pet.battler_name = self.battler_name
  39.     pet.battler_hue = self.battler_hue
  40.     begin
  41.       RPG::Cache.character(self.battler_name,self.battler_hue)
  42.       pet.character_name = self.battler_name
  43.       pet.character_hue = self.battler_hue
  44.     rescue Errno::ENOENT
  45.       
  46.     end
  47.     pet.name = self.name
  48.     $data_actors[$data_actors.size] = pet
  49.     pet2 = Game_Actor.new($data_actors.size - 1)
  50.     $game_actors.push(pet2)
  51.     $data_actors.delete_at($data_actors.size)
  52.     p $data_actors[$data_actors.size]
  53.     if $game_party.actors.size == 6      #当宠物达到数后传送到电脑里面!
  54.       $game_party.add_actor($game_actors.size-1,2)
  55.     else
  56.       $game_party.add_actor($game_actors.size-1)
  57.     end
  58.     $scene.status_window.refresh
  59.   end
  60. end
  61. class Game_Actors
  62.   def push(val)
  63.     if @data.size < 999
  64.      @data.push(val)
  65.     end  
  66.   end
  67.   def size
  68.     return @data.size
  69.   end
  70.   def [](actor_id)
  71.     if actor_id > 999
  72.       return nil
  73.     end
  74.     if @data[actor_id] == nil
  75.       @data[actor_id] = Game_Actor.new(actor_id)
  76.     end
  77.     return @data[actor_id]
  78.   end
  79. end
  80. class Game_Battler
  81.   alias skill_effect_iselia :skill_effect
  82.     def skill_effect(user,skill)
  83.       if skill.element_set.include?($data_system.elements.index($捕捉))
  84.         catch(user)
  85.         return true
  86.       end
  87.     skill_effect_iselia(user,skill)
  88.   end
  89.   #捕捉
  90.   def catch(user)
  91.     percent = (user.agi + user.dex) / (self.agi + self.dex) * percent_base
  92.     if self.can_catch and rand(100) < percent
  93.       self.hidden = true
  94.       self.current_action.kind = 3
  95.       make_pet
  96.     end
  97.   end
  98.   #可否捕捉
  99.   def can_catch
  100.     return self.is_a?(Game_Enemy) && self.mold != nil
  101.   end
  102.   #宠物资料
  103.   def percent_base
  104.     return 0 if self.is_a?(Game_Actor)
  105.     return [100,80,60,40,20,10,5][self.element_ranks[$data_system.elements.index($捕捉)]]
  106.   end
  107. end
  108. class Scene_Battle
  109.   attr_accessor :status_window
  110.   def make_skill_action_result
  111.     # 获取特技
  112.     @skill = $data_skills[@active_battler.current_action.skill_id]
  113.     # 如果不是强制行动
  114.     unless @active_battler.current_action.forcing
  115.       # 因为 SP 耗尽而无法使用的情况下
  116.       unless @active_battler.skill_can_use?(@skill.id)
  117.         # 清除强制行动对像的战斗者
  118.         $game_temp.forcing_battler = nil
  119.         # 移至步骤 1
  120.         @phase4_step = 1
  121.         return
  122.       end
  123.     end
  124.     # 消耗 SP
  125.     @active_battler.sp -= @skill.sp_cost
  126.     # 刷新状态窗口
  127.     @status_window.refresh
  128.     # 在帮助窗口显示特技名
  129.     @help_window.set_text(@skill.name, 1)
  130.     # 设置动画 ID
  131.     @animation1_id = @skill.animation1_id
  132.     @animation2_id = @skill.animation2_id
  133.     # 设置公共事件 ID
  134.     @common_event_id = @skill.common_event_id
  135.     # 设置对像侧战斗者
  136.     set_target_battlers(@skill.scope)
  137.     if @skill.catch?
  138.       @active_battler.animation_id = @animation1_id
  139.     ($data_animations[@animation1_id].frame_max + 8).times do
  140.       Graphics.update
  141.       @spriteset.update
  142.     end
  143.     @target_battlers.each do |v|
  144.       v.animation_id = @animation2_id
  145.     end
  146.     ($data_animations[@animation2_id].frame_max + 8).times do
  147.       Graphics.update
  148.       @spriteset.update
  149.     end
  150.     end
  151.     # 应用特技效果
  152.     for target in @target_battlers
  153.       target.skill_effect(@active_battler, @skill)
  154.     end
  155.     if @skill.catch?
  156.     @phase4_step = 5
  157.     end
  158.   end
  159. end
复制代码

作者: casey1379    时间: 2013-8-5 18:23
宠物系统是和2个仓库系统一起的仓库系统在http://www.66rpg.com/search_resu ... 3%E5%BA%93&st=0 里面
单独用都能实现,宠物和仓库用起很舒服,但是加了一个修改参战限制就不行了!!我做的是PM的1人参战,然后5宠待命




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1