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

Project1

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

[已经解决] 有关这个脚本的问题?求教!

[复制链接]

Lv1.梦旅人

梦石
0
星屑
148
在线时间
209 小时
注册时间
2012-1-9
帖子
169
跳转到指定楼层
1
发表于 2012-1-19 11:16:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================  

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

#==============================================================================
# □ 初始化定义
#==============================================================================
module XRXS26
  FRONT_MEMBER_LIMIT    = 8        # 战斗参战人数最大值
  BACKWARD_MEMBER_LIMIT = 4        # 待机人数最大值
  BACKWARD_EXP_GAINABLE = true     # 待机人物是否获得经验
  MENU_STATUS_STRETCH   = true    # 3人以下的时候,菜单是否拉伸大小
end
#------------------------------------------------------------------------------
# 菜单页面状态
#------------------------------------------------------------------------------
class Window_MenuStatus < Window_Selectable
  # 列数
  COLUMN_MAX = 1
  # 光标高度
  CURSOR_HEIGHT = 96
  # 一行的高度
  LINE_HEIGHT = 116
end
#------------------------------------------------------------------------------
# 菜单场景
#------------------------------------------------------------------------------
class Scene_Menu
  MENU_MEMBER_CHANGE_KEY_GO    = Input::RIGHT # 进入键
  MENU_MEMBER_CHANGE_KEY_END   = Input::LEFT  # 离开键
  MENU_MEMBER_CHANGE_INDEX_MIN = 0            # 可更换角色最小编号
  FORCETOBATTLE_ACTORS         = []           # 不能待机的角色编号
  UMBATTLABLE_ACTORS           = []           # 不能加入战斗的角色编号
  UNMOVABLE_ACTORS             = []           # 不能移动的角色编号
end
#------------------------------------------------------------------------------
#
# 解説
#    Game_Partyの @actors のうち先頭から↑FRONT_MEMBER_LIMIT番目までのアクターを
#   戦闘メンバーとして、それ以上を待機メンバーとして扱います。
#
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party
  #--------------------------------------------------------------------------
  # ○ インクルード
  #--------------------------------------------------------------------------
  include XRXS26
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :backword_actors          # 待機アクター
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs26_initialize initialize
  def initialize
    xrxs26_initialize
    # 待機メンバー配列を初期化
    @backword_actors = []
  end
  #--------------------------------------------------------------------------
  # ● アクターを加える
  #--------------------------------------------------------------------------
  def add_actor(actor_id)
    # アクターを取得
    actor = $game_actors[actor_id]
    # このアクターがパーティにいない場合
    if not @actors.include?(actor)
      # 満員でないならメンバーに追加
      if @actors.size < (FRONT_MEMBER_LIMIT + BACKWARD_MEMBER_LIMIT)
        # アクターを追加
        @actors.push(actor)
        # プレイヤーをリフレッシュ
        $game_player.refresh
      end
    end
  end
end
#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● インクルード
  #--------------------------------------------------------------------------
  include XRXS26
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs26_initialize initialize
  def initialize
    xrxs26_initialize
    #
    # 以下、五人目以降のアクタースプライトの追加処理---
    #
    # アクターが表示されるビューポートを、とりあえず先頭の人から取得しとく(素
    actor_viewport = @actor_sprites[0].viewport
    # 戦闘参加メンバーが5人以上の場合
    if FRONT_MEMBER_LIMIT > 4
      for i in 5..FRONT_MEMBER_LIMIT
        # アクタースプライトを追加
        @actor_sprites.push(Sprite_Battler.new(actor_viewport))
        @actor_sprites[i-1].battler = $game_party.actors[i-1]
      end
    end
    # ビューポートを更新
    actor_viewport.update
  end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● インクルード
  #--------------------------------------------------------------------------
  include XRXS26
  #--------------------------------------------------------------------------
  # ● メイン処理 をパーティメンバー処理ではさむ
  #--------------------------------------------------------------------------
  alias xrxs26_main main
  def main
    # 待機メンバーへ退避----------
    $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
    $game_party.actors.compact!
    # メイン処理
    xrxs26_main
    # 待機メンバーから復帰
    $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
    $game_party.actors.compact!
  end
  #--------------------------------------------------------------------------
  # ● アフターバトルフェーズ開始
  #--------------------------------------------------------------------------
  alias xrxs26_start_phase5 start_phase5
  def start_phase5
    # 「待機メンバー経験値獲得」が有効 and 待機アクターが一人以上いる
    if BACKWARD_EXP_GAINABLE and $game_party.backword_actors.size >= 1
      # 待機メンバーから復帰
      $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
      $game_party.backword_actors.clear
      # 呼び戻す
      xrxs26_start_phase5
      # 待機メンバーへ退避----------
      $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
      $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
      $game_party.actors.compact!
    else
      # 呼び戻す
      xrxs26_start_phase5
    end
  end
end
# ▽△▽ XRXL 4. 第二カーソル 機構 ▽△▽
# by 桜雅 在土

#==============================================================================
# --- XRXS. 第二カーソル 機構 ---
#------------------------------------------------------------------------------
#     ウィンドウに .index2 プロパティを追加します。
#==============================================================================
module XRXS_Cursor2
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(x, y, w, h)
    super(x, y, h, w)
    # 補助ウィンドウ(透明)を作成:カーソル専用
    @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
    @xrxsc2_window.opacity = 0
    @xrxsc2_window.active = false
    @xrxsc2_window.index = -1
  end
  #--------------------------------------------------------------------------
  # ○ 第二カーソルの設置
  #--------------------------------------------------------------------------
  def index2
    return @xrxsc2_window.index
  end
  def index2=(index)
    @xrxsc2_window.index = index
    if index == -1
      @xrxsc2_window.cursor_rect.empty
    else
      @xrxsc2_window.x = self.x
      @xrxsc2_window.y = self.y
      @xrxsc2_window.cursor_rect = self.cursor_rect
    end
  end
  #--------------------------------------------------------------------------
  # ○ 先頭の行の設定
  #--------------------------------------------------------------------------
  def top_row=(row)
    super
    # 補助ウィンドウの oy を更新
    pre_oy = @xrxsc2_window.oy
    @xrxsc2_window.oy = self.oy
    @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  end
  #--------------------------------------------------------------------------
  # ○ 解放
  #--------------------------------------------------------------------------
  def dispose
    @xrxsc2_window.dispose
    super
  end
  #--------------------------------------------------------------------------
  # ○ X, Y 座標
  #--------------------------------------------------------------------------
  def x=(n)
    super
    @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  end
  def y=(n)
    super
    @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  end
end
# ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
# by 桜雅 在土

#==============================================================================
# ■ Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ インクルード
  #--------------------------------------------------------------------------
  include XRXS26
  include XRXS_Cursor2
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :column_max             # 列数
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    h = 480
    if MENU_STATUS_STRETCH
      h = FRONT_MEMBER_LIMIT * 116 + 16
    end
    super(0, 0, 480, h)
    h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
    self.contents = Bitmap.new(width - 32, h)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # ○ 1 ページに表示できる行数の取得
  #--------------------------------------------------------------------------
  def page_row_max
    if MENU_STATUS_STRETCH
      return FRONT_MEMBER_LIMIT          # 戦闘パーティ最大数
    else
      return [FRONT_MEMBER_LIMIT, 4].max # 戦闘パーティ最大数(最低4)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 先頭の行の取得
  #--------------------------------------------------------------------------
  def top_row
    # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
    return self.oy / LINE_HEIGHT
  end
  #--------------------------------------------------------------------------
  # ○ 先頭の行の設定
  #--------------------------------------------------------------------------
  def top_row=(row)
    super
    self.oy = self.oy/32 * LINE_HEIGHT
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
    super
    unless @index < 0
      y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
      self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
    end
  end
end
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  # ○ インクルード
  #--------------------------------------------------------------------------
  include XRXS26
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs26ax_update update
  def update
    # インデックスを保存
    @status_index = @status_window.index
    # 呼び戻す
    xrxs26ax_update
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  alias xrxs26ax_update_command update_command
  def update_command
    # 呼び戻す
    xrxs26ax_update_command
    # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
    if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
       @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      # カーソル位置を記憶
      @command_index_before_menu_member_change = @command_window.index
      # 入れ替えウィンドウへ移行
      @command_window.active = false
      @command_window.index = -1
      @status_window.active = true
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  alias xrxs26ax_update_status update_status
  def update_status
    # 呼び戻す
    if @command_window.index != -1
      xrxs26ax_update_status
      return
    end
    # B ボタンか入れ替え終了キーが押されたとき
    if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
        @status_window.index2 == -1 and
        @status_index%@status_window.column_max == 0)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # コマンドウィンドウをアクティブにする
      @command_window.active = true
      @command_window.index = 0
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # B ボタンが押されたとき
    if Input.trigger?(Input::B) and @status_window.index2 >= 0
      @status_window.index = @status_window.index2
      @status_window.index2 = -1
      return
    end
    # 決定キーが押されたとき
    if Input.trigger?(Input::C)
      if @status_window.index2 == -1
        if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # メンバーの入れ替え一人目の決定
        @status_window.index2 = @status_window.index
      else
        if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
        if (@status_window.index < FRONT_MEMBER_LIMIT or
            @status_window.index2 < FRONT_MEMBER_LIMIT) and
           (UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
            UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
        if (@status_window.index >= FRONT_MEMBER_LIMIT or
            @status_window.index2 >= FRONT_MEMBER_LIMIT) and
           (FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
            FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # メンバーの入れ替え二人目の決定と入れ替えの実行
        actor2 = $game_party.actors[@status_window.index]
        actor = $game_party.actors[@status_window.index2]
        $game_party.actors[@status_window.index2] = actor2
        $game_party.actors[@status_window.index] = actor
        @status_window.index = @status_window.index2
        @status_window.index2 = -1
        # プレイヤーをリフレッシュ
        $game_player.refresh
        # ステータスウィンドウをリフレッシュ
        @status_window.refresh
      end
      return
    end
  end
end

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

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

#==============================================================================
# □ 初始化定义
#==============================================================================
class Window_MenuStatus < Window_Selectable
  #
  # 不显示能力值的角色编号
  #
  NO_PARAMETER_ACTORS = []
end
#==============================================================================
# ■ Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ インクルード
  #--------------------------------------------------------------------------
  include XRXS26
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :newitem_window
  attr_reader   :bottomkeyhelp_window
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs26bx_initialize initialize
  def initialize
    # 呼び戻す
    xrxs26bx_initialize
    # 寄生してウィンドウを作成
    # ボトルキーヘルプウィンドウ
    @bottomkeyhelp_window = Window_BottomKeyHelp.new
    @bottomkeyhelp_window.visible = false
    # 設定変更
    self.height   = 448
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    @column_max = 2
    y = (FRONT_MEMBER_LIMIT+1)/2 * 64 + 28
    self.contents.font.size = 16
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 92, 28, "战斗人数")
    self.contents.draw_text(4, y, 92, 28, "待机人数")
    for i in 0...$game_party.actors.size
      x = 64 + i%2 * 224
      y = i/2 *  72 + 24
      actor = $game_party.actors
      if i >= FRONT_MEMBER_LIMIT
        y += 32
        self.contents.font.color = disabled_color
        self.contents.draw_text(x, y, 120, 32, actor.name)
      else
        draw_actor_name(actor   , x     , y     )
      end
      draw_actor_graphic(actor, x - 40, y + 64)
      unless NO_PARAMETER_ACTORS.include?(actor.id)
        draw_actor_level(actor  , x + 94, y     )
        draw_actor_hp(actor     , x, y + 16)
        draw_actor_sp(actor     , x, y + 32)
        draw_actor_state(actor  , x, y + 48)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  def update
    # ウィンドウを更新
    @bottomkeyhelp_window.update
    super
  end
  #--------------------------------------------------------------------------
  # ○ 解放
  #--------------------------------------------------------------------------
  def dispose
    @bottomkeyhelp_window.dispose
    super
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      y = @index/2 * 72 + 28
      if @index >= FRONT_MEMBER_LIMIT
        y += 32
      end
      self.cursor_rect.set(@index%2 * 224, y, 224, 72)
    end
  end
end
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs26bx_update update
  def update
    # 登録
    if @bottomkeyhelp_window.nil?
      @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
      @bottomkeyhelp_window.visible = true
      set_keyhelp1
    end
    # 呼び戻す
    xrxs26bx_update
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  alias xrxs26bx_update_command update_command
  def update_command
    # 呼び戻す
    xrxs26bx_update_command
    # 入れ替え移行キーが押されたとき
    if @command_window.index == -1 and @status_window.active
      set_keyhelp2
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  alias xrxs26bx_update_status update_status
  def update_status
    # 保存
    last_index = @status_window.index2
    # 呼び戻す
    xrxs26bx_update_status
    #
    if last_index != @status_window.index2
      # 一人目を選択した場合
      if @status_window.index2 >= 0
        set_keyhelp3
      else
        set_keyhelp2
      end
    end
    # 戻った場合
    unless @status_window.active
      set_keyhelp1
    end
  end
  #--------------------------------------------------------------------------
  # ○ キーヘルプを設定 1
  #--------------------------------------------------------------------------
  def set_keyhelp1
    @bottomkeyhelp_window.clear
    @bottomkeyhelp_window.add("B","关闭本窗口")
    @bottomkeyhelp_window.add("C","确定")
    @bottomkeyhelp_window.add("→","人物顺序调整")
  end
  #--------------------------------------------------------------------------
  # ○ キーヘルプを設定 2
  #--------------------------------------------------------------------------
  def set_keyhelp2
    @bottomkeyhelp_window.clear
    @bottomkeyhelp_window.add("←,B","返回")
    @bottomkeyhelp_window.add("C","第一个人物确定")
  end
  #--------------------------------------------------------------------------
  # ○ キーヘルプを設定 3
  #--------------------------------------------------------------------------
  def set_keyhelp3
    @bottomkeyhelp_window.clear
    @bottomkeyhelp_window.add("B","返回")
    @bottomkeyhelp_window.add("C","第二个人物确定")
  end
end



#==============================================================================
# □ Window_BottomKeyHelp
#------------------------------------------------------------------------------
#     画面下で操作説明をする透明なウィンドウです。
#==============================================================================
class Window_BottomKeyHelp < Window_Base
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 432, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    clear
  end
  #--------------------------------------------------------------------------
  # ○ クリア
  #--------------------------------------------------------------------------
  def clear
    self.contents.clear
    @now_x = 608
  end
  #--------------------------------------------------------------------------
  # ○ 追加
  #--------------------------------------------------------------------------
  def add(key, explanation)
    # 計算
    self.contents.font.size = 20
    x  = self.contents.text_size(key).width
    self.contents.font.size = 16
    x += self.contents.text_size(explanation).width + 8
    @now_x -= x
    # 描写
    self.contents.font.size = 20
    self.contents.font.color = system_color
    self.contents.draw_text(@now_x, 0, x, 32, key, 0)
    self.contents.font.size = 16
    self.contents.font.color = normal_color
    self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
    # 余白
    @now_x -= 32
  end
end


这个脚本能加战斗人数!
可是我想要战斗时只有4个人出场,其他人不出来待机,或者在菜单下可以换人,地图上也可以,那么请问用那个脚本
我到现在还没找到···急啊!!!

点评

把脚本用代码方式从新发一遍,你直接黏贴就出现了很多错误的地方  发表于 2012-1-20 09:27

Lv1.梦旅人

虱子

梦石
0
星屑
121
在线时间
1782 小时
注册时间
2010-6-19
帖子
3597
2
发表于 2012-1-19 11:39:44 | 只看该作者
你要找的是不是:人物仓库

点评

可是最多只能显示5个人,加第6个时候,就显示不了了!  发表于 2012-1-20 10:40

http://rpg.blue/thread-175056-1-2.html
PVZ型塔防物一个
http://rpg.blue/thread-155199-1-2.html
RMXP技术讨论区手动认可帖,得到答案请认可
回复

使用道具 举报

Lv4.逐梦者

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
帖子
2402
3
发表于 2012-1-19 13:23:34 | 只看该作者
囡囚囨囚囨図囨囧
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
148
在线时间
209 小时
注册时间
2012-1-9
帖子
169
4
 楼主| 发表于 2012-1-19 19:10:42 | 只看该作者
幻耶 发表于 2012-1-19 13:23
战斗中换人
http://rpg.blue/thread-163143-1-1.html

难道不能在菜单中换人吗?

点评

能先用代码发脚本出来么?[code][/code]  发表于 2012-1-20 10:57
没看错的话,LZ这个脚本就能在菜单里换人了  发表于 2012-1-20 10:25
表达有问题呀,之前要是说的清楚点,我就给你这个脚本了  发表于 2012-1-19 21:59
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3176
在线时间
1442 小时
注册时间
2009-7-27
帖子
1454
5
发表于 2012-1-19 21:57:34 | 只看该作者
嘿嘿一笑 发表于 2012-1-19 19:10
难道不能在菜单中换人吗?

我败给你了我,注释得那么清楚还不会。
开头第二段开始,把 8 改成 4 不就好了。待机人数的多少的 4 改成自己想要的待机人物有多少个不就行了。
  1. FRONT_MEMBER_LIMIT    = 8        # 战斗参战人数最大值
  2.   BACKWARD_MEMBER_LIMIT = 4        # 待机人数最大值
复制代码

点评

直接在菜单按键盘→,不就好了  发表于 2012-1-21 15:18
大哥···这我也知道!可是待机的人看不到啊!也不能换啊!  发表于 2012-1-20 09:14

博客:我的博客
回复

使用道具 举报

Lv1.梦旅人

XYGG

梦石
0
星屑
62
在线时间
115 小时
注册时间
2009-1-20
帖子
340
6
发表于 2012-1-20 10:08:46 | 只看该作者
怎么脚本里还会出现表情,楼主不能用代码呢
路过……酱油……别烦我……
回复

使用道具 举报

Lv2.观梦者 (版主)

迷途知返,恍如隔世

梦石
0
星屑
488
在线时间
1355 小时
注册时间
2011-2-17
帖子
1216

开拓者

7
发表于 2012-1-20 23:36:36 | 只看该作者
本帖最后由 Anson 于 2012-1-20 23:37 编辑
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Scene_Save
  5.   #--------------------------------------------------------------------------
  6.   # ● 写入存档数据
  7.   #     file : 写入用文件对像 (已经打开)
  8.   #--------------------------------------------------------------------------
  9.   def write_save_data(file)
  10.     # 生成描绘存档文件用的角色图形
  11.     characters = []
  12.     for i in 0...[$game_party.actors.size,4].min
  13.       actor = $game_party.actors[i]
  14.       characters.push([actor.character_name, actor.character_hue])
  15.     end
  16.     # 写入描绘存档文件用的角色数据
  17.     Marshal.dump(characters, file)
  18.     # 写入测量游戏时间用画面计数
  19.     Marshal.dump(Graphics.frame_count, file)
  20.     # 增加 1 次存档次数
  21.     $game_system.save_count += 1
  22.     # 保存魔法编号
  23.     # (将编辑器保存的值以随机值替换)
  24.     $game_system.magic_number = $data_system.magic_number
  25.     # 写入各种游戏对像
  26.     Marshal.dump($game_system, file)
  27.     Marshal.dump($game_switches, file)
  28.     Marshal.dump($game_variables, file)
  29.     Marshal.dump($game_self_switches, file)
  30.     Marshal.dump($game_screen, file)
  31.     Marshal.dump($game_actors, file)
  32.     Marshal.dump($game_party, file)
  33.     Marshal.dump($game_troop, file)
  34.     Marshal.dump($game_map, file)
  35.     Marshal.dump($game_player, file)
  36.   end
  37. end

  38. class Scene_Battle
  39.   #--------------------------------------------------------------------------
  40.   # ● 设置物品或特技对像方的战斗者
  41.   #     scope : 特技或者是物品的范围
  42.   #--------------------------------------------------------------------------
  43.   def set_target_battlers(scope)
  44.     # 行动方的战斗者是敌人的情况下
  45.     if @active_battler.is_a?(Game_Enemy)
  46.       # 效果范围分支
  47.       case scope
  48.       when 1  # 敌单体
  49.         index = @active_battler.current_action.target_index
  50.         @target_battlers.push($game_party.smooth_target_actor(index))
  51.       when 2  # 敌全体
  52.         for actor in 0...[$game_party.actors.size,4].min
  53.           if $game_party.actors[actor].exist?
  54.             @target_battlers.push($game_party.actors[actor])
  55.           end
  56.         end
  57.       when 3  # 我方单体
  58.         index = @active_battler.current_action.target_index
  59.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  60.       when 4  # 我方全体
  61.         for enemy in $game_troop.enemies
  62.           if enemy.exist?
  63.             @target_battlers.push(enemy)
  64.           end
  65.         end
  66.       when 5  # 我方单体 (HP 0)
  67.         index = @active_battler.current_action.target_index
  68.         enemy = $game_troop.enemies[index]
  69.         if enemy != nil and enemy.hp0?
  70.           @target_battlers.push(enemy)
  71.         end
  72.       when 6  # 我方全体 (HP 0)
  73.         for enemy in $game_troop.enemies
  74.           if enemy != nil and enemy.hp0?
  75.             @target_battlers.push(enemy)
  76.           end
  77.         end
  78.       when 7  # 使用者
  79.         @target_battlers.push(@active_battler)
  80.       end
  81.     end
  82.     # 行动方的战斗者是角色的情况下
  83.     if @active_battler.is_a?(Game_Actor)
  84.       # 效果范围分支
  85.       case scope
  86.       when 1  # 敌单体
  87.         index = @active_battler.current_action.target_index
  88.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  89.       when 2  # 敌全体
  90.         for enemy in $game_troop.enemies
  91.           if enemy.exist?
  92.             @target_battlers.push(enemy)
  93.           end
  94.         end
  95.       when 3  # 我方单体
  96.         index = @active_battler.current_action.target_index
  97.         @target_battlers.push($game_party.smooth_target_actor(index))
  98.       when 4  # 我方全体
  99.         for actor in 0...[$game_party.actors.size,4].min
  100.           if $game_party.actors[actor].exist?
  101.             @target_battlers.push($game_party.actors[actor])
  102.           end
  103.         end
  104.       when 5  # 我方单体 (HP 0)
  105.         index = @active_battler.current_action.target_index
  106.         actor = $game_party.actors[index]
  107.         if actor != nil and actor.hp0?
  108.           @target_battlers.push(actor)
  109.         end
  110.       when 6  # 我方全体 (HP 0)
  111.         for actor in 0...[$game_party.actors.size,4].min
  112.           if $game_party.actors[actor] != nil and $game_party.actors[actor].hp0?
  113.             @target_battlers.push($game_party.actors[actor])
  114.           end
  115.         end
  116.       when 7  # 使用者
  117.         @target_battlers.push(@active_battler)
  118.       end
  119.     end
  120.   end  
  121.   #--------------------------------------------------------------------------
  122.   # ● 生成行动循序
  123.   #--------------------------------------------------------------------------
  124.   def make_action_orders
  125.     # 初始化序列 @action_battlers
  126.     @action_battlers = []
  127.     # 添加敌人到 @action_battlers 序列
  128.     for enemy in $game_troop.enemies
  129.       @action_battlers.push(enemy)
  130.     end
  131.     # 添加角色到 @action_battlers 序列
  132.     for actor in 0...[$game_party.actors.size,4].min
  133.       @action_battlers.push($game_party.actors[actor])
  134.     end
  135.     # 确定全体的行动速度
  136.     for battler in @action_battlers
  137.       battler.make_action_speed
  138.     end
  139.     # 按照行动速度从大到小排列
  140.     @action_battlers.sort! {|a,b|
  141.       b.current_action.speed - a.current_action.speed }
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● 开始结束战斗回合
  145.   #--------------------------------------------------------------------------
  146.   def start_phase5
  147.     # 转移到回合 5
  148.     @phase = 5
  149.     # 演奏战斗结束 ME
  150.     $game_system.me_play($game_system.battle_end_me)
  151.     # 还原为战斗开始前的 BGM
  152.     $game_system.bgm_play($game_temp.map_bgm)
  153.     # 初始化 EXP、金钱、宝物
  154.     exp = 0
  155.     gold = 0
  156.     treasures = []
  157.     # 循环
  158.     for enemy in $game_troop.enemies
  159.       # 敌人不是隐藏状态的情况下
  160.       unless enemy.hidden
  161.         # 获得 EXP、增加金钱
  162.         exp += enemy.exp
  163.         gold += enemy.gold
  164.         # 出现宝物判定
  165.         if rand(100) < enemy.treasure_prob
  166.           if enemy.item_id > 0
  167.             treasures.push($data_items[enemy.item_id])
  168.           end
  169.           if enemy.weapon_id > 0
  170.             treasures.push($data_weapons[enemy.weapon_id])
  171.           end
  172.           if enemy.armor_id > 0
  173.             treasures.push($data_armors[enemy.armor_id])
  174.           end
  175.         end
  176.       end
  177.     end
  178.     # 限制宝物数为 6 个
  179.     treasures = treasures[0..5]
  180.     # 获得 EXP
  181.     for i in 0...[$game_party.actors.size,4].min
  182.       actor = $game_party.actors[i]
  183.       if actor.cant_get_exp? == false
  184.         last_level = actor.level
  185.         actor.exp += exp
  186.         if actor.level > last_level
  187.           @status_window.level_up(i)
  188.         end
  189.       end
  190.     end
  191.     # 获得金钱
  192.     $game_party.gain_gold(gold)
  193.     # 获得宝物
  194.     for item in treasures
  195.       case item
  196.       when RPG::Item
  197.         $game_party.gain_item(item.id, 1)
  198.       when RPG::Weapon
  199.         $game_party.gain_weapon(item.id, 1)
  200.       when RPG::Armor
  201.         $game_party.gain_armor(item.id, 1)
  202.       end
  203.     end
  204.     # 生成战斗结果窗口
  205.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  206.     # 设置等待计数
  207.     @phase5_wait_count = 100
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 转到输入下一个角色的命令
  211.   #--------------------------------------------------------------------------
  212.   def phase3_next_actor
  213.     # 循环
  214.     begin
  215.       # 角色的明灭效果 OFF
  216.       if @active_battler != nil
  217.         @active_battler.blink = false
  218.       end
  219.       # 最后的角色的情况
  220.       if @actor_index == [$game_party.actors.size-1,3].min
  221.         # 开始主回合
  222.         start_phase4
  223.         return
  224.       end
  225.       # 推进角色索引
  226.       @actor_index += 1
  227.       @active_battler = $game_party.actors[@actor_index]
  228.       @active_battler.blink = true
  229.     # 如果角色是在无法接受指令的状态就再试
  230.     end until @active_battler.inputable?
  231.     # 设置角色的命令窗口
  232.     phase3_setup_command_window
  233.   end
  234. end

  235. class Arrow_Actor < Arrow_Base  
  236.   #--------------------------------------------------------------------------
  237.   # ● 刷新画面
  238.   #--------------------------------------------------------------------------
  239.   def update
  240.     super
  241.     # 光标右
  242.     if Input.repeat?(Input::RIGHT)
  243.       $game_system.se_play($data_system.cursor_se)
  244.       @index += 1
  245.       @index %= [$game_party.actors.size,4].min
  246.     end
  247.     # 光标左
  248.     if Input.repeat?(Input::LEFT)
  249.       $game_system.se_play($data_system.cursor_se)
  250.       @index += $game_party.actors.size - 1
  251.       @index %= [$game_party.actors.size,4].min
  252.     end
  253.     # 设置活动块坐标
  254.     if self.actor != nil
  255.       self.x = self.actor.screen_x
  256.       self.y = self.actor.screen_y
  257.     end
  258.   end
  259. end

  260. #==============================================================================
  261. # ■ Window_Target
  262. #------------------------------------------------------------------------------
  263. #  物品画面与特技画面的、使用对像角色选择窗口。
  264. #==============================================================================

  265. class Window_Target < Window_Selectable
  266. #--------------------------------------------------------------------------
  267. # ● 初始化对像
  268. #--------------------------------------------------------------------------
  269. def initialize
  270.    super(0, 0, 336, 480)
  271.    self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
  272.    self.z += 10
  273.    @item_max = $game_party.actors.size
  274.    @top_row = 0
  275.    refresh
  276. end
  277. #--------------------------------------------------------------------------
  278. # ● 刷新
  279. #--------------------------------------------------------------------------
  280. def refresh
  281.    self.contents.clear
  282.    for i in 0...$game_party.actors.size
  283.      x = 4
  284.      y = i * 112
  285.      actor = $game_party.actors[i]
  286.      draw_actor_name(actor, x, y)
  287.      draw_actor_class(actor, x + 144, y)
  288.      draw_actor_level(actor, x + 8, y + 32)
  289.      draw_actor_state(actor, x + 8, y + 64)
  290.      draw_actor_hp(actor, x + 152, y + 32)
  291.      draw_actor_sp(actor, x + 152, y + 64)
  292.    end
  293. end  
  294. #--------------------------------------------------------------------------
  295. # ● 刷新光标矩形
  296. #--------------------------------------------------------------------------
  297. def update_cursor_rect   
  298.    # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
  299.    if @index <= -2
  300.      self.cursor_rect.set(0, (@index + 10) * 112, self.width - 32, 96)
  301.    elsif @index == -1
  302.      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 112 - 20)
  303.    else
  304.      tpy = @index * 112 - self.oy
  305.      self.cursor_rect.set(0, tpy, self.width - 32, 96)
  306.      if @index < @top_row
  307.        @top_row = @index
  308.        self.oy = @top_row *112
  309.      end
  310.      if @index > @top_row+3
  311.        @top_row = @index-3
  312.        self.oy = @top_row *112
  313.      end
  314.    end   
  315. end
  316. end
  317. #==============================================================================
  318. # ■ Window_MenuStatus
  319. #------------------------------------------------------------------------------
  320. #  显示菜单画面和同伴状态的窗口。
  321. #==============================================================================

  322. class Window_MenuStatus < Window_Selectable
  323.   #--------------------------------------------------------------------------
  324.   # ● 初始化目标
  325.   #--------------------------------------------------------------------------
  326.   def initialize
  327.     super(0, 0, 480, 480)
  328.     self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
  329.     refresh
  330.     @top_row = 0
  331.     self.active = false
  332.     self.index = -1
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 刷新
  336.   #--------------------------------------------------------------------------
  337.   def refresh
  338.     self.contents.clear
  339.     @item_max = $game_party.actors.size
  340.     for i in 0...$game_party.actors.size
  341.       x = 64
  342.       y = i * 112
  343.       if i <=3
  344.         self.contents.font.color = Color.new(255,255,0,255)
  345.         self.contents.draw_text(x,y,340,32,"[出战]",2)
  346.         self.contents.font.color = normal_color
  347.       else
  348.         self.contents.font.color = Color.new(128,128,128,255)
  349.         self.contents.draw_text(x,y,340,32,"[待机]",2)
  350.         self.contents.font.color = normal_color
  351.       end      
  352.       actor = $game_party.actors[i]
  353.       draw_actor_graphic(actor, x - 40, y + 80)
  354.       draw_actor_name(actor, x, y)
  355.       draw_actor_class(actor, x + 144, y)
  356.       draw_actor_level(actor, x, y + 32)
  357.       draw_actor_state(actor, x + 90, y + 32)
  358.       draw_actor_exp(actor, x, y + 64)
  359.       draw_actor_hp(actor, x + 236, y + 32)
  360.       draw_actor_sp(actor, x + 236, y + 64)
  361.     end
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● 刷新光标矩形
  365.   #--------------------------------------------------------------------------
  366.   def update_cursor_rect
  367.     if @index < 0
  368.       self.cursor_rect.empty
  369.     else
  370.       tpy = @index * 112 - self.oy
  371.       self.cursor_rect.set(0, tpy, self.width - 32, 96)
  372.       if @index < @top_row
  373.         @top_row = @index
  374.         self.oy = @top_row *112
  375.       end
  376.       if @index > @top_row+3
  377.         @top_row = @index-3
  378.         self.oy = @top_row *112
  379.       end
  380.     end
  381.   end
  382. end

  383. class Game_Party
  384.   #--------------------------------------------------------------------------
  385.   # ● 全灭判定
  386.   #--------------------------------------------------------------------------
  387.   def all_dead?
  388.     # 同伴人数为 0 的情况下
  389.     if $game_party.actors.size == 0
  390.       return false
  391.     end
  392.     # 同伴中无人 HP 在 0 以上
  393.     for i in 0..3
  394.       if @actors[i] != nil and@actors[i].hp >0
  395.         return false
  396.       end
  397.     end
  398.     # 全灭
  399.     return true
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● 加入同伴
  403.   #     actor_id : 角色 ID
  404.   #--------------------------------------------------------------------------
  405.   def add_actor(actor_id)
  406.     # 获取角色
  407.     actor = $game_actors[actor_id]
  408.     # 同伴人数未满 4 人、本角色不在队伍中的情况下
  409.     if not @actors.include?(actor)
  410.       # 添加角色
  411.       @actors.push(actor)
  412.       # 还原主角
  413.       $game_player.refresh
  414.     end
  415.   end
  416. end
复制代码
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-10-1 15:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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