| 赞 | 0  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 1 | 
 
| 经验 | 5677 | 
 
| 最后登录 | 2018-4-5 | 
 
| 在线时间 | 212 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 70 
 
        - 在线时间
 - 212 小时
 
        - 注册时间
 - 2011-6-22
 
        - 帖子
 - 19
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
我找到了這個腳本,可是我不會用事件中使用這腳本。 
 
我看了日本人的範例,但還是不懂,求步驟教學。 
 
 
#============================================================================== 
# ■ InheritSet 
#------------------------------------------------------------------------------ 
#  2週目引継ぎの各種設定をします。 
#============================================================================== 
 
module InheritSet 
#============================================================================== 
# ○設定項目 
#------------------------------------------------------------------------------ 
# 2週目引継ぎシステムで利用する用語を設定します。 
# 
#   VocabInherit      : タイトル画面で表示されるコマンド名(クリア後表示される) 
#   VocabClearMark    : クリア後セーブ画面に表示されるマーク 
#   VocabLap          : 2週目以降セーブ画面に表示される、何週目かの単位 
#   VocabLoadtMessage : 強くてニューゲムを選択したとき、一番上に表示される文 
#============================================================================== 
  VocabInherit        = "強くてニューゲーム" 
  VocabClearMark      = "★" 
  VocabLap            = "週目" 
  VocabLoadtMessage   = "どのファイルを引き継ぎますか?" 
   
#============================================================================== 
# 2週目に引継ぐ項目を設定します。 
# 
# 引継ぐ場合は「true」 
# 引継がない場合は「false」を設定します。 
# スイッチ及び変数は、引継ぎたい物のみ、[]内にそのIDを羅列してください。 
# IDはカンマ「,」で区切って羅列してください。 
# ・1と5と6のみ引継ぐ場合 [1,5,6] 
# ・何も引継がない場合 [] 
#============================================================================== 
  InheritItem     = true   # アイテム 
  InheritWeapon   = true   # 武器 (待機メンバー等、全装備品も含む) 
  InheritArmor    = true   # 防具 (待機メンバー等、全装備品も含む) 
  InheritStatus   = true   # ステータス(レベル、能力値、経験値、スキル、職業) 
  InheritGold     = true   # 所持金 
  InheritSteps    = true   # 歩数 
  InheritSaves    = true   # セーブ回数 
  InheritTime     = true   # プレイ時間 
  InheritSwitch   =        # スイッチ (引き継ぎたいスイッチIDを羅列) 
    [1,18,19,20,21,22,23,24,25,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76] 
  InheritVariable =        # 変数 (引き継ぎたい変数IDを羅列) 
    [1] 
   
#============================================================================== 
# アイテム類を引継ぐ時、一部のアイテムだけ引継ぎたくない場合の設定です。 
# 
# アイテム、武器、防具の引継ぎたくない物のみ、[]内にそのIDを羅列してください。 
# IDはカンマ「,」で区切って羅列してください。 
# ・1と5と6のみ引継がない場合 [1,5,6] 
# ・全て引継ぐ場合 [] 
#============================================================================== 
  InheritNoItem   =        # アイテム (引き継ぎたくないアイテムIDを羅列) 
    [13,36,37] 
  InheritNoWeapon =        # 武器 (引き継ぎたくないアイテムIDを羅列) 
    [] 
  InheritNoArmor  =        # 防具 (引き継ぎたくないアイテムIDを羅列) 
    [] 
   
#============================================================================== 
# ○設定項目ここまで 
#============================================================================== 
 
 
 
  #-------------------------------------------------------------------------- 
  # ● クリア後セーブデータにフラグを立てるイベントコマンドから呼び出し) 
  #    一度ロードorセーブしていないと無効 
  #-------------------------------------------------------------------------- 
  def self.clear 
    $game_system.clear_flag = true 
    filename = "Save#{$game_temp.last_file_index + 1}.rvdata" 
    if FileTest.exist?(filename) 
      file = File.open(filename, "rb") 
      characters           = Marshal.load(file) 
      Graphics.frame_count = Marshal.load(file) 
      last_bgm             = Marshal.load(file) 
      last_bgs             = Marshal.load(file) 
      game_system          = Marshal.load(file) 
      game_message         = Marshal.load(file) 
      game_switches        = Marshal.load(file) 
      game_variables       = Marshal.load(file) 
      game_self_switches   = Marshal.load(file) 
      game_actors          = Marshal.load(file) 
      game_party           = Marshal.load(file) 
      game_troop           = Marshal.load(file) 
      game_map             = Marshal.load(file) 
      game_player          = Marshal.load(file) 
      file.close 
      game_system.clear_flag = true 
      file = File.open(filename, "wb") 
      Marshal.dump(characters,           file) 
      Marshal.dump(Graphics.frame_count, file) 
      Marshal.dump(last_bgm,             file) 
      Marshal.dump(last_bgs,             file) 
      Marshal.dump(game_system,          file) 
      Marshal.dump(game_message,         file) 
      Marshal.dump(game_switches,        file) 
      Marshal.dump(game_variables,       file) 
      Marshal.dump(game_self_switches,   file) 
      Marshal.dump(game_actors,          file) 
      Marshal.dump(game_party,           file) 
      Marshal.dump(game_troop,           file) 
      Marshal.dump(game_map,             file) 
      Marshal.dump(game_player,          file) 
      file.close 
    end 
  end 
end 
 
#============================================================================== 
# ■ Scene_Title 
#------------------------------------------------------------------------------ 
#  タイトル画面の処理を行うクラスです。 
#============================================================================== 
 
class Scene_Title < Scene_Base 
  #-------------------------------------------------------------------------- 
  # ● 開始処理 
  #-------------------------------------------------------------------------- 
  alias harts_inherit_start start 
  def start 
    super 
    check_inherit 
    harts_inherit_start 
  end 
  #-------------------------------------------------------------------------- 
  # ● 2週目引継ぎの有効判定 
  #-------------------------------------------------------------------------- 
  def check_inherit 
    for i in 0...4 
      @time_stamp = Time.at(0) 
      filename = "Save#{i + 1}.rvdata" 
      @file_exist = FileTest.exist?(filename) 
      if @file_exist 
        file = File.open(filename, "r") 
        @time_stamp = file.mtime 
        begin 
          @characters     = Marshal.load(file) 
          @frame_count    = Marshal.load(file) 
          @last_bgm       = Marshal.load(file) 
          @last_bgs       = Marshal.load(file) 
          @game_system    = Marshal.load(file) 
        rescue 
          @file_exist = false 
        ensure 
          file.close 
        end 
        if @game_system.clear_flag || @game_system.clear_count > 0 
          @inherit_enabled = true 
        end 
      end 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● フレーム更新 
  #-------------------------------------------------------------------------- 
  alias harts_inherit_update update 
  def update 
    super 
    if !@inherit_enabled 
      harts_inherit_update 
    else 
      @command_window.update 
      if Input.trigger?(Input::C) 
        case @command_window.index 
        when 0    # ニューゲーム 
          command_new_game 
        when 1    # 強くてニューゲム 
          command_inherit 
        when 2    # コンティニュー 
          command_continue 
        when 3    # シャットダウン 
          command_shutdown 
        end 
      end 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● コマンドウィンドウの作成 
  #-------------------------------------------------------------------------- 
  alias harts_inherit_create_command_window create_command_window 
  def create_command_window 
    if !@inherit_enabled 
      harts_inherit_create_command_window 
    else 
      s1 = Vocab::new_game 
      s2 = InheritSet::VocabInherit 
      s3 = Vocab::continue 
      s4 = Vocab::shutdown 
      @command_window = Window_Command.new(260,[s1, s2, s3, s4,]) 
      @command_window.x = (640 - @command_window.width) / 2 
      @command_window.y = 300 
      if @continue_enabled                    # コンティニューが有効な場合 
        @command_window.index = 2             # カーソルを合わせる 
      else                                    # 無効な場合 
        @command_window.draw_item(1, false)   # コマンドを半透明表示にする 
      end 
      @command_window.openness = 0 
      @command_window.open 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● コマンド : 強くてニューゲーム 
  #-------------------------------------------------------------------------- 
  def command_inherit 
    Sound.play_decision 
    $scene = Scene_InheritFile.new 
  end 
end 
 
#============================================================================== 
# ■ Game_System 
#------------------------------------------------------------------------------ 
#  システム周りのデータを扱うクラスです。乗り物や BGM などの管理も行います。 
# このクラスのインスタンスは $game_system で参照されます。 
#============================================================================== 
 
class Game_System 
  #-------------------------------------------------------------------------- 
  # ● 公開インスタンス変数 
  #-------------------------------------------------------------------------- 
  attr_accessor :clear_flag               # クリアフラグ 
  attr_accessor :clear_count              # クリア回数 
  #-------------------------------------------------------------------------- 
  # ● オブジェクト初期化 
  #-------------------------------------------------------------------------- 
  alias harts_inherit_initialize initialize 
  def initialize 
    harts_inherit_initialize 
    @clear_flag = false 
    @clear_count = 0 
  end 
end 
 
#============================================================================== 
# ■ Window_SaveFile 
#------------------------------------------------------------------------------ 
#  セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。 
#============================================================================== 
 
class Window_SaveFile < Window_Base 
  #-------------------------------------------------------------------------- 
  # ● 公開インスタンス変数 
  #-------------------------------------------------------------------------- 
  attr_reader   :game_system                # システム情報 
  #-------------------------------------------------------------------------- 
  # ● リフレッシュ 
  #-------------------------------------------------------------------------- 
  alias harts_inherit_refresh refresh 
  def refresh 
    harts_inherit_refresh 
    if @file_exist 
      draw_clear_mark 
      draw_clear_lap 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● クリアマークの描画 
  #-------------------------------------------------------------------------- 
  def draw_clear_mark 
    if @game_system.clear_flag 
      self.contents.font.color = normal_color 
      self.contents.draw_text(5, 32, 95, WLH, InheritSet::VocabClearMark,2) 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 週回の描画 
  #-------------------------------------------------------------------------- 
  def draw_clear_lap 
    if @game_system.clear_count > 0 
      self.contents.font.color = normal_color 
      lap = @game_system.clear_count + 1 
      mes = lap.to_s + InheritSet::VocabLap 
      self.contents.draw_text(0, 0, contents.width - 4, WLH, mes,2) 
    end 
  end 
end 
 
#============================================================================== 
# ■ Scene_InheritFile 
#------------------------------------------------------------------------------ 
#  強くてニューゲムするファイルを選択する画面の処理 
#============================================================================== 
 
class Scene_InheritFile < Scene_Base 
  #-------------------------------------------------------------------------- 
  # ● 開始処理 
  #-------------------------------------------------------------------------- 
  def start 
    super 
    create_menu_background 
    @help_window = Window_Help.new 
    create_savefile_windows 
    @index = self.latest_file_index 
    @help_window.set_text(InheritSet::VocabLoadtMessage) 
    @savefile_windows[@index].selected = true 
  end 
  #-------------------------------------------------------------------------- 
  # ● 終了処理 
  #-------------------------------------------------------------------------- 
  def terminate 
    super 
    dispose_menu_background 
    @help_window.dispose 
    dispose_item_windows 
  end 
  #-------------------------------------------------------------------------- 
  # ● 元の画面へ戻る 
  #-------------------------------------------------------------------------- 
  def return_scene 
    $scene = Scene_Title.new 
  end 
  #-------------------------------------------------------------------------- 
  # ● フレーム更新 
  #-------------------------------------------------------------------------- 
  def update 
    super 
    update_menu_background 
    @help_window.update 
    update_savefile_windows 
    update_savefile_selection 
  end 
  #-------------------------------------------------------------------------- 
  # ● セーブファイルウィンドウの作成 
  #-------------------------------------------------------------------------- 
  def create_savefile_windows 
    @savefile_windows = [] 
    for i in 0..3 
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) 
    end 
    @item_max = 4 
  end 
  #-------------------------------------------------------------------------- 
  # ● セーブファイルウィンドウの解放 
  #-------------------------------------------------------------------------- 
  def dispose_item_windows 
    for window in @savefile_windows 
      window.dispose 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● セーブファイルウィンドウの更新 
  #-------------------------------------------------------------------------- 
  def update_savefile_windows 
    for window in @savefile_windows 
      window.update 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● セーブファイル選択の更新 
  #-------------------------------------------------------------------------- 
  def update_savefile_selection 
    if Input.trigger?(Input::C) 
      determine_savefile 
    elsif Input.trigger?(Input::B) 
      Sound.play_cancel 
      return_scene 
    else 
      last_index = @index 
      if Input.repeat?(Input::DOWN) 
        cursor_down(Input.trigger?(Input::DOWN)) 
      end 
      if Input.repeat?(Input::UP) 
        cursor_up(Input.trigger?(Input::UP)) 
      end 
      if @index != last_index 
        Sound.play_cursor 
        @savefile_windows[last_index].selected = false 
        @savefile_windows[@index].selected = true 
      end 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● セーブファイルの決定 
  #-------------------------------------------------------------------------- 
  def determine_savefile 
    if @savefile_windows[@index].file_exist 
      if @savefile_windows[@index].game_system.clear_flag || @savefile_windows[@index].game_system.clear_count > 0 
        Sound.play_load 
        do_inherit 
      else 
        Sound.play_buzzer 
        return 
      end 
    else 
      Sound.play_buzzer 
      return 
    end 
    $game_temp.last_file_index = 0 
  end 
  #-------------------------------------------------------------------------- 
  # ● カーソルを下に移動 
  #     wrap : ラップアラウンド許可 
  #-------------------------------------------------------------------------- 
  def cursor_down(wrap) 
    if @index < @item_max - 1 or wrap 
      @index = (@index + 1) % @item_max 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● カーソルを上に移動 
  #     wrap : ラップアラウンド許可 
  #-------------------------------------------------------------------------- 
  def cursor_up(wrap) 
    if @index > 0 or wrap 
      @index = (@index - 1 + @item_max) % @item_max 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● ファイル名の作成 
  #     file_index : セーブファイルのインデックス (0~3) 
  #-------------------------------------------------------------------------- 
  def make_filename(file_index) 
    return "Save#{file_index + 1}.rvdata" 
  end 
  #-------------------------------------------------------------------------- 
  # ● タイムスタンプが最新のファイルを選択 
  #-------------------------------------------------------------------------- 
  def latest_file_index 
    index = 0 
    latest_time = Time.at(0) 
    for i in 0...@savefile_windows.size 
      if @savefile_windows.time_stamp > latest_time 
        latest_time = @savefile_windows.time_stamp 
        index = i 
      end 
    end 
    return index 
  end 
  #-------------------------------------------------------------------------- 
  # ● 引継ぎの実行 
  #-------------------------------------------------------------------------- 
  def do_inherit 
    file = File.open(@savefile_windows[@index].filename, "rb") 
    read_save_data(file) 
    file.close 
    inherit_method                                # 引継ぎ処理 
    $game_system.clear_count += 1                 # 何週目か記録 
    $game_party.setup_starting_members            # 初期パーティ 
    $game_map.setup($data_system.start_map_id)    # 初期位置のマップ 
    $game_player.moveto($data_system.start_x, $data_system.start_y) 
    $game_player.refresh 
    $scene = Scene_Map.new 
    RPG::BGM.fade(1500) 
    Graphics.fadeout(60) 
    Graphics.wait(40) 
    RPG::BGM.stop 
    $game_map.autoplay 
  end 
  #-------------------------------------------------------------------------- 
  # ● セーブデータの読み込み 
  #     file : 読み込み用ファイルオブジェクト (オープン済み) 
  #-------------------------------------------------------------------------- 
  def read_save_data(file) 
    characters           = Marshal.load(file) 
    Graphics.frame_count = Marshal.load(file) 
    last_bgm             = Marshal.load(file) 
    last_bgs             = Marshal.load(file) 
    @game_system         = Marshal.load(file) 
    @game_message        = Marshal.load(file) 
    @game_switches       = Marshal.load(file) 
    @game_variables      = Marshal.load(file) 
    @game_self_switches  = Marshal.load(file) 
    @game_actors         = Marshal.load(file) 
    @game_party          = Marshal.load(file) 
    @game_troop          = Marshal.load(file) 
    @game_map            = Marshal.load(file) 
    @game_player         = Marshal.load(file) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 引継ぎ内容処理 
  #-------------------------------------------------------------------------- 
  def inherit_method 
    $game_system.clear_count = @game_system.clear_count 
    $game_party.inherit_item(@game_party) 
    $game_party.inherit_weapon(@game_party, @game_actors) 
    $game_party.inherit_armor(@game_party, @game_actors) 
    $game_party.inherit_gold(@game_party) 
    $game_party.inherit_steps(@game_party) 
    $game_system.save_count = @game_system.save_count if InheritSet::InheritSaves 
    inherit_status 
    inherit_switch 
    inherit_variable 
    Graphics.frame_count = 0 if !InheritSet::InheritTime 
  end 
  #-------------------------------------------------------------------------- 
  # ● ステータスの引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_status 
    if !InheritSet::InheritStatus 
      return 
    end 
    $game_actors = @game_actors 
    for i in 0...$game_actors.data.size 
      if $game_actors.data != nil 
        $game_actors.data.equip_initialize(i) 
      end 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● スイッチの引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_switch 
    for i in 0...InheritSet::InheritSwitch.size 
      $game_switches[InheritSet::InheritSwitch] = @game_switches[InheritSet::InheritSwitch] 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 変数の引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_variable 
    for i in 0...InheritSet::InheritVariable.size 
      $game_variables[InheritSet::InheritVariable] = @game_variables[InheritSet::InheritVariable] 
    end 
  end 
end 
 
#============================================================================== 
# ■ Game_Party 
#------------------------------------------------------------------------------ 
#  パーティを扱うクラスです。ゴールドやアイテムなどの情報が含まれます。このク 
# ラスのインスタンスは $game_party で参照されます。 
#============================================================================== 
 
class Game_Party < Game_Unit 
   
  #-------------------------------------------------------------------------- 
  # ● アイテムの引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_item(load_party) 
    if !InheritSet::InheritItem 
      return 
    end 
    # 引継ぎ 
    for item in load_party.items 
      number = load_party.item_number(item) 
      case item 
      when RPG::Item 
        @items[item.id] = [[number, 0].max, 99].min 
      end 
    end 
    # 引き継がない項目を削除 
    for i in 0...InheritSet::InheritNoItem.size 
      @items[InheritSet::InheritNoItem] = 0 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 武器の引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_weapon(load_party, load_actors) 
    if !InheritSet::InheritWeapon 
      return 
    end 
    # アイテム引継ぎ 
    for item in load_party.items 
      number = load_party.item_number(item) 
      case item 
      when RPG::Weapon 
        @weapons[item.id] = [[number, 0].max, 99].min 
      end 
    end 
    # 装備品引継ぎ 
    for i in 1..load_actors.data.size 
      if load_actors.data != nil 
        if load_actors.data.weapon_id != 0 
          number = @weapons[load_actors.data.weapon_id] 
          number = 0 if number == nil 
          @weapons[load_actors.data.weapon_id] = [[number+1, 0].max, 99].min 
        end 
      end 
    end 
    # 引き継がない項目を削除 
    for i in 0...InheritSet::InheritNoWeapon.size 
      @weapons[InheritSet::InheritNoWeapon] = 0 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 防具の引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_armor(load_party, load_actors) 
    if !InheritSet::InheritArmor 
      return 
    end 
    # アイテム引継ぎ 
    for item in load_party.items 
      number = load_party.item_number(item) 
      case item 
      when RPG::Armor 
        @armors[item.id] = [[number, 0].max, 99].min 
      end 
    end 
    # 装備品引継ぎ 
    for i in 1..load_actors.data.size 
      if load_actors.data != nil 
        if load_actors.data.armor1_id != 0 
          number = @armors[load_actors.data.armor1_id] 
          number = 0 if number == nil 
          @armors[load_actors.data.armor1_id] = [[number+1, 0].max, 99].min 
        end 
        if load_actors.data.armor2_id != 0 
          number = @armors[load_actors.data.armor2_id] 
          number = 0 if number == nil 
          @armors[load_actors.data.armor2_id] = [[number+1, 0].max, 99].min 
        end 
        if load_actors.data.armor3_id != 0 
          number = @armors[load_actors.data.armor3_id] 
          number = 0 if number == nil 
          @armors[load_actors.data.armor3_id] = [[number+1, 0].max, 99].min 
        end 
        if load_actors.data.armor4_id != 0 
          number = @armors[load_actors.data.armor4_id] 
          number = 0 if number == nil 
          @armors[load_actors.data.armor4_id] = [[number+1, 0].max, 99].min 
        end 
      end 
    end 
    # 引き継がない項目を削除 
    for i in 0...InheritSet::InheritNoArmor.size 
      @armors[InheritSet::InheritNoArmor] = 0 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 所持金の引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_gold(load_party) 
    if !InheritSet::InheritGold 
      return 
    end 
    @gold = load_party.gold 
  end 
  #-------------------------------------------------------------------------- 
  # ● 歩数の引継ぎ 
  #-------------------------------------------------------------------------- 
  def inherit_steps(load_party) 
    if !InheritSet::InheritSteps 
      return 
    end 
    @steps = load_party.steps 
  end 
   
end 
 
#============================================================================== 
# ■ Game_Actors 
#------------------------------------------------------------------------------ 
#  アクターの配列を扱うクラスです。このクラスのインスタンスは $game_actors で 
# 参照されます。 
#============================================================================== 
 
class Game_Actors 
  #-------------------------------------------------------------------------- 
  # ● 公開インスタンス変数 
  #-------------------------------------------------------------------------- 
  attr_reader :data              # データ 
end 
 
#============================================================================== 
# ■ Game_Actor 
#------------------------------------------------------------------------------ 
#  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors) 
# の内部で使用され、Game_Party クラス ($game_party) からも参照されます。 
#============================================================================== 
 
class Game_Actor < Game_Battler 
  #-------------------------------------------------------------------------- 
  # ● 装備の初期化 
  #-------------------------------------------------------------------------- 
  def equip_initialize(actor_id) 
    actor = $data_actors[actor_id] 
    @weapon_id = actor.weapon_id 
    @armor1_id = actor.armor1_id 
    @armor2_id = actor.armor2_id 
    @armor3_id = actor.armor3_id 
    @armor4_id = actor.armor4_id 
    recover_all 
  end 
end |   
 
 
 
 |