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

Project1

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

[已经过期] 存档继承系统?高手请进了

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2006-7-19
帖子
76
跳转到指定楼层
1
发表于 2013-3-14 23:03:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
有哪位高手解决过啊?代码如下
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Save Engine Add-On: New Game+ v1.00
  4. # -- Last Updated: 2011.12.26
  5. # -- Level: Normal
  6. # -- Requires: YEA - Ace Save Engine v1.01+
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-NewGame+"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2011.12.26 - Started Script and Finished.
  15. #
  16. #==============================================================================
  17. # ▼ Introduction
  18. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19. # 新游戏 + 是为您的游戏提供重播价值的好方法。它可以让播放机 re-experience
  20. # 中以不同的方式与任一游戏结转
  21. # 项目,要结转的党员,要结转的技能,交换机,和即使是
  22. # 变量。有许多选项,以更改新 Game+ 的工作方式# 你的游戏。
  23. #
  24. #==============================================================================
  25. # ▼ Instructions
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # 若要安装此脚本,打开您的脚本编辑器,复制/粘贴此脚本▼ 下面打开插槽
  28. # 材料/素材但 ▼ Main 上面。记住要保存。
  29. #
  30. # -----------------------------------------------------------------------------
  31. # Item Notetags - 这些 notetags 项目 notebox 数据库中去。
  32. # -----------------------------------------------------------------------------
  33. # <no carry over>

  34. # 这将导致此特定项目对扛不超过在新游戏 + 如果项目
  35. # 可以结转。这并不影响任何行为者可能有项# 装备。
  36. #
  37. # -----------------------------------------------------------------------------
  38. # Weapon Notetags - 这些 notetags 在武器 notebox 数据库中去。
  39. # -----------------------------------------------------------------------------
  40. # <no carry over>

  41. # 这将导致此特定项目对扛不超过在新游戏 + 如果项目
  42. # 可以结转。这并不影响任何行为者可能有项# 装备。
  43. #
  44. # -----------------------------------------------------------------------------
  45. # Armour Notetags - 这些 notetags 去盔甲 notebox 在数据库中。
  46. # -----------------------------------------------------------------------------
  47. # <no carry over>

  48. # 这将导致此特定项目对扛不超过在新游戏 + 如果项目
  49. # 可以结转。这并不影响任何行为者可能有项# 装备。
  50. #
  51. #==============================================================================
  52. # ▼ 兼容性
  53. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  54. # 此脚本是作出严格的 rpg 游戏制造商 VX Ace。
  55. # 它是极不可能的它将不调整的情况下运行 rpg 游戏制造商 VX #。
  56. #
  57. # 该脚本需要使用 Yanfly 引擎 Ace-Ace 保存引擎 v1.01 + 和
  58. # 脚本必须放在待 Ace 保存引擎脚本列表中。
  59. #
  60. #==============================================================================

  61. module YEA
  62.   module NEW_GAME_PLUS
  63.    
  64.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  65.     # - 常规设置 -
  66.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  67.     # 说明
  68.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  69.     NGP_SWITCH = 3           # 如果交换机上,游戏的文件有吴 + 标志。
  70.     NGP_TEXT   = "周目"   # 用来显示新的 Game+ 的文本。
  71.    
  72.     # 这是用于新游戏 + 时的帮助窗口文本新的 Game+
  73.     # 突出显示选项。
  74.     NGP_HELP   = "继承新存档."
  75.    
  76.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  77.     # - 结转设置 -
  78.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  79.     # 这些设置调整什么可延伸而哪些不能。
  80.     # 这些设置# 是很具体所以仔细调整它们。
  81.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82.     # 此数组包含所有你想要结转到的交换机
  83.     # 保持。任何不是来这里的交换机将设置为 false。
  84.     CARRY_OVER_SWITCHES = [3, 6, 7,12,15,16,17,18]
  85.    
  86.     # 此数组中包含的所有变量,要结转到
  87.     # 保持。不是来这里的任何变量将被设置为 0。
  88.     CARRY_OVER_VARIABLES = [1,2,3,4,5]
  89.    
  90.     # 如果此设置为 false,然后行为者将被完全重设回
  91.     # 其原始启动国家。如果它已设置为 true,然后将行动者
  92.     # 保持完全按照它们。
  93.     CARRY_OVER_ACTORS = true
  94.    
  95.     # 如果将结转的行动者,则只会使用这些设置。
  96.     # 这一点,您可以限制哪些细节将从各级行动者结转的
  97.     # 以装备的技能。
  98.     CARRY_OVER_LEVELS = true
  99.     CARRY_OVER_EQUIPS = true
  100.     CARRY_OVER_SKILLS = true
  101.    
  102.     # 如果此设置为 false,然后党员将回复到
  103.     # 原始启动党员。如果是 true,然后方安装将
  104.     # 完全保持不变。
  105.     CARRY_OVER_PARTY_MEMBERS = true
  106.    
  107.     # 如果其中的任何设置为 false,然后没有物品、 武器、 或盔甲会
  108.     # 结转。如果它已设置为 true,则将各个项目
  109.     # 结转到较新的游戏。
  110.     CARRY_OVER_GOLD    = true
  111.     CARRY_OVER_ITEMS   = true
  112.     CARRY_OVER_WEAPONS = true
  113.     CARRY_OVER_ARMOURS = true
  114.    
  115.   end # NEW_GAME_PLUS
  116. end # YEA

  117. #==============================================================================
  118. # ▼ Editting anything past this point may potentially result in causing
  119. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  120. # halitosis so edit at your own risk.
  121. #==============================================================================

  122. if $imported["YEA-SaveEngine"]

  123. module YEA
  124.   module NEW_GAME_PLUS
  125.     module_function
  126.     #--------------------------------------------------------------------------
  127.     # convert_integer_array
  128.     #--------------------------------------------------------------------------
  129.     def convert_integer_array(array)
  130.       result = []
  131.       array.each { |i|
  132.         case i
  133.         when Range; result |= i.to_a
  134.         when Integer; result |= [i]
  135.         end }
  136.       return result
  137.     end
  138.     #--------------------------------------------------------------------------
  139.     # converted_contants
  140.     #--------------------------------------------------------------------------
  141.     CARRY_OVER_SWITCHES = convert_integer_array(CARRY_OVER_SWITCHES)
  142.     CARRY_OVER_VARIABLES = convert_integer_array(CARRY_OVER_VARIABLES)
  143.   end # NEW_GAME_PLUS
  144.   module REGEXP
  145.   module BASEITEM
  146.    
  147.     NO_CARRY_OVER = /<(?:NO_CARRY_OVER|no carry over)>/i
  148.    
  149.   end # BASEITEM
  150.   end # REGEXP
  151. end # YEA

  152. #==============================================================================
  153. # ■ DataManager
  154. #==============================================================================

  155. module DataManager
  156.   
  157.   #--------------------------------------------------------------------------
  158.   # alias method: load_database
  159.   #--------------------------------------------------------------------------
  160.   class <<self; alias load_database_ngp load_database; end
  161.   def self.load_database
  162.     load_database_ngp
  163.     load_notetags_ngp
  164.   end
  165.   
  166.   #--------------------------------------------------------------------------
  167.   # new method: load_notetags_ngp
  168.   #--------------------------------------------------------------------------
  169.   def self.load_notetags_ngp
  170.     groups = [$data_items, $data_weapons, $data_armors]
  171.     for group in groups
  172.       for obj in group
  173.         next if obj.nil?
  174.         obj.load_notetags_ngp
  175.       end
  176.     end
  177.   end
  178.   
  179. end # DataManager

  180. #==============================================================================
  181. # ■ RPG::BaseItem
  182. #==============================================================================

  183. class RPG::BaseItem
  184.   
  185.   #--------------------------------------------------------------------------
  186.   # public instance variables
  187.   #--------------------------------------------------------------------------
  188.   attr_accessor :no_carry_over
  189.   
  190.   #--------------------------------------------------------------------------
  191.   # common cache: load_notetags_ngp
  192.   #--------------------------------------------------------------------------
  193.   def load_notetags_ngp
  194.     @no_carry_over = false
  195.     #---
  196.     self.note.split(/[\r\n]+/).each { |line|
  197.       case line
  198.       #---
  199.       when YEA::REGEXP::BASEITEM::NO_CARRY_OVER
  200.         @no_carry_over = true
  201.       end
  202.     } # self.note.split
  203.     #---
  204.   end
  205.   
  206. end # RPG::BaseItem

  207. #==============================================================================
  208. # ■ Switch
  209. #==============================================================================

  210. module Switch
  211.   
  212.   #--------------------------------------------------------------------------
  213.   # self.new_game_plus
  214.   #--------------------------------------------------------------------------
  215.   def self.new_game_plus
  216.     return $game_switches[YEA::NEW_GAME_PLUS::NGP_SWITCH]
  217.   end
  218.   
  219. end # Switch

  220. #==============================================================================
  221. # ■ DataManager
  222. #==============================================================================

  223. module DataManager
  224.   
  225.   #--------------------------------------------------------------------------
  226.   # new method: setup_new_game_plus
  227.   #--------------------------------------------------------------------------
  228.   def self.setup_new_game_plus(index)
  229.     create_new_game_plus_objects(index)
  230.     $game_map.setup($data_system.start_map_id)
  231.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  232.     $game_player.refresh
  233.     Graphics.frame_count = 0
  234.   end
  235.   
  236.   #--------------------------------------------------------------------------
  237.   # new method: create_new_game_plus_objects
  238.   #--------------------------------------------------------------------------
  239.   def self.create_new_game_plus_objects(index)
  240.     load_game_without_rescue(index)
  241.     ngp_reset_switches
  242.     ngp_reset_variables
  243.     ngp_reset_self_switches
  244.     ngp_reset_actors
  245.     ngp_reset_party
  246.   end
  247.   
  248.   #--------------------------------------------------------------------------
  249.   # new method: ngp_reset_switches
  250.   #--------------------------------------------------------------------------
  251.   def self.ngp_reset_switches
  252.     for i in 0...$data_system.switches.size
  253.       next if i <= 0
  254.       next if YEA::NEW_GAME_PLUS::CARRY_OVER_SWITCHES.include?(i)
  255.       $game_switches[i] = false
  256.     end
  257.   end
  258.   
  259.   #--------------------------------------------------------------------------
  260.   # new method: ngp_reset_variables
  261.   #--------------------------------------------------------------------------
  262.   def self.ngp_reset_variables
  263.     for i in 0...$data_system.variables.size
  264.       next if i <= 0
  265.       next if YEA::NEW_GAME_PLUS::CARRY_OVER_VARIABLES.include?(i)
  266.       $game_variables[i] = 0
  267.     end
  268.   end
  269.   
  270.   #--------------------------------------------------------------------------
  271.   # new method: ngp_reset_self_switches
  272.   #--------------------------------------------------------------------------
  273.   def self.ngp_reset_self_switches
  274.     $game_self_switches = Game_SelfSwitches.new
  275.   end
  276.   
  277.   #--------------------------------------------------------------------------
  278.   # new method: ngp_reset_actors
  279.   #--------------------------------------------------------------------------
  280.   def self.ngp_reset_actors
  281.     unless YEA::NEW_GAME_PLUS::CARRY_OVER_ACTORS
  282.       $game_actors = Game_Actors.new
  283.     else
  284.       #---
  285.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_LEVELS
  286.         for i in 0...$data_actors.size
  287.           actor = $game_actors[i]
  288.           next if actor.nil?
  289.           actor.new_game_plus_levels
  290.         end
  291.       end
  292.       #---
  293.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_EQUIPS
  294.         for i in 0...$data_actors.size
  295.           actor = $game_actors[i]
  296.           next if actor.nil?
  297.           actor.new_game_plus_equips
  298.         end
  299.       end
  300.       #---
  301.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_SKILLS
  302.         for i in 0...$data_actors.size
  303.           actor = $game_actors[i]
  304.           next if actor.nil?
  305.           actor.new_game_plus_skills
  306.         end
  307.       end
  308.       #---
  309.     end
  310.   end
  311.   
  312.   #--------------------------------------------------------------------------
  313.   # new method: ngp_reset_party
  314.   #--------------------------------------------------------------------------
  315.   def self.ngp_reset_party
  316.     gold = 0
  317.     items = {}
  318.     members = []
  319.     #---
  320.     if YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
  321.       for member in $game_party.members
  322.         members.push(member.id)
  323.       end
  324.     end
  325.     #---
  326.     gold = $game_party.gold if YEA::NEW_GAME_PLUS::CARRY_OVER_GOLD
  327.     #---
  328.     if YEA::NEW_GAME_PLUS::CARRY_OVER_ITEMS
  329.       for item in $data_items
  330.         next if item.nil?
  331.         next if item.no_carry_over
  332.         items[item] = $game_party.item_number(item)
  333.       end
  334.     end
  335.     #---
  336.     if YEA::NEW_GAME_PLUS::CARRY_OVER_WEAPONS
  337.       for item in $data_weapons
  338.         next if item.nil?
  339.         next if item.no_carry_over
  340.         items[item] = $game_party.item_number(item)
  341.       end
  342.     end
  343.     #---
  344.     if YEA::NEW_GAME_PLUS::CARRY_OVER_ARMOURS
  345.       for item in $data_armors
  346.         next if item.nil?
  347.         next if item.no_carry_over
  348.         items[item] = $game_party.item_number(item)
  349.       end
  350.     end
  351.     #---
  352.     $game_party = Game_Party.new
  353.     unless YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
  354.       $game_party.setup_starting_members
  355.     end
  356.     #---
  357.     for member_id in members
  358.       $game_party.add_actor(member_id)
  359.     end
  360.     $game_party.gain_gold(gold)
  361.     for key in items
  362.       item = key[0]
  363.       next if item.nil?
  364.       $game_party.gain_item(item, key[1])
  365.     end
  366.   end
  367.   
  368. end # DataManager

  369. #==============================================================================
  370. # ■ Game_Actor
  371. #==============================================================================

  372. class Game_Actor < Game_Battler
  373.   
  374.   #--------------------------------------------------------------------------
  375.   # new method: new_game_plus_levels
  376.   #--------------------------------------------------------------------------
  377.   def new_game_plus_levels
  378.     @class_id = actor.class_id
  379.     [url=home.php?mod=space&uid=22147]@level[/url] = actor.initial_level
  380.     [url=home.php?mod=space&uid=13302]@exp[/url] = {}
  381.     if $imported["YEA-ClassSystem"]
  382.       init_unlocked_classes
  383.       init_subclass
  384.     end
  385.     clear_param_plus
  386.     init_exp
  387.     refresh
  388.   end
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # new method: new_game_plus_equips
  392.   #--------------------------------------------------------------------------
  393.   def new_game_plus_equips
  394.     init_equips(actor.equips)
  395.   end
  396.   
  397.   #--------------------------------------------------------------------------
  398.   # new method: new_game_plus_skills
  399.   #--------------------------------------------------------------------------
  400.   def new_game_plus_skills
  401.     init_skills
  402.   end
  403.   
  404. end # Game_Actor

  405. #==============================================================================
  406. # ■ Window_FileAction
  407. #==============================================================================

  408. class Window_FileAction < Window_HorzCommand
  409.   
  410.   #--------------------------------------------------------------------------
  411.   # alias method: add_load_command
  412.   #--------------------------------------------------------------------------
  413.   alias add_load_command_ngp add_load_command
  414.   def add_load_command
  415.     if new_game_plus?
  416.       add_command(YEA::NEW_GAME_PLUS::NGP_TEXT, :new_game_plus)
  417.     else
  418.       add_load_command_ngp
  419.     end
  420.   end
  421.   
  422.   #--------------------------------------------------------------------------
  423.   # new method: new_game_plus?
  424.   #--------------------------------------------------------------------------
  425.   def new_game_plus?
  426.     return false if @header.nil?
  427.     return false if @header[:switches].nil?
  428.     return @header[:switches][YEA::NEW_GAME_PLUS::NGP_SWITCH]
  429.   end
  430.   
  431.   #--------------------------------------------------------------------------
  432.   # alias method: update_help
  433.   #--------------------------------------------------------------------------
  434.   alias update_help_ngp update_help
  435.   def update_help
  436.     case current_symbol
  437.     when :new_game_plus; @help_window.set_text(YEA::NEW_GAME_PLUS::NGP_HELP)
  438.     else; update_help_ngp
  439.     end
  440.   end
  441.   
  442. end # Window_FileAction

  443. #==============================================================================
  444. # ■ Scene_File
  445. #==============================================================================

  446. class Scene_File < Scene_MenuBase
  447.   
  448.   #--------------------------------------------------------------------------
  449.   # alias method: create_action_window
  450.   #--------------------------------------------------------------------------
  451.   alias create_action_window_ngp create_action_window
  452.   def create_action_window
  453.     create_action_window_ngp
  454.     @action_window.set_handler(:new_game_plus, method(:on_action_ngp))
  455.   end
  456.   
  457.   #--------------------------------------------------------------------------
  458.   # new method: on_action_ngp
  459.   #--------------------------------------------------------------------------
  460.   def on_action_ngp
  461.     Sound.play_load
  462.     DataManager.setup_new_game_plus(@file_window.index)
  463.     fadeout_all
  464.     $game_system.on_after_load
  465.     SceneManager.goto(Scene_Map)
  466.   end
  467.   
  468. end # Scene_File

  469. end # $imported["YEA-SaveEngine"]

  470. #==============================================================================
  471. #
  472. # ▼ End of File
  473. #
  474. #==============================================================================
复制代码

Lv2.观梦者

梦石
0
星屑
758
在线时间
2064 小时
注册时间
2011-10-3
帖子
1686
2
发表于 2013-3-16 06:23:50 | 只看该作者
我感觉你应该把没机翻过的脚本发出来……一机翻反而看不懂了

评分

参与人数 1星屑 +1 收起 理由
feizhaodan + 1

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
170
在线时间
227 小时
注册时间
2011-5-19
帖子
736
3
发表于 2013-3-16 17:52:07 | 只看该作者
这脚本系翻译机搞过的吧……
休息中……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2006-7-19
帖子
76
4
 楼主| 发表于 2013-3-16 21:09:46 | 只看该作者
本帖最后由 战圣王子 于 2013-3-16 21:19 编辑

我只是+了中文注解啊。代码:75号下面中文注解,其它都原代码?但是我搞不懂所以才中文注解r .希望高手能解决?

原代码如下: [pre lang="ruby" line="1" file="存档继承"]#==============================================================================
#
# ▼ Yanfly Engine Ace - Save Engine Add-On: New Game+ v1.00
# -- Last Updated: 2011.12.26
# -- Level: Normal
# -- Requires: YEA - Ace Save Engine v1.01+
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-NewGame+"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.26 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# New Game+ is a great way to provide replay value for your game. It lets the
# player re-experience the game in a different way with either carried over
# items, to carried over party members, to carried over skills, switches, and
# variables even. There exists many options to change how New Game+ will work
# for your game.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the items notebox in the database.
# -----------------------------------------------------------------------------
# <no carry over>
# This will cause this specific item to not carry over in New Game+ if the item
# can be carried over. This does not affect any items that actors may have
# equipped.
#
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapons notebox in the database.
# -----------------------------------------------------------------------------
# <no carry over>
# This will cause this specific item to not carry over in New Game+ if the item
# can be carried over. This does not affect any items that actors may have
# equipped.
#
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armours notebox in the database.
# -----------------------------------------------------------------------------
# <no carry over>
# This will cause this specific item to not carry over in New Game+ if the item
# can be carried over. This does not affect any items that actors may have
# equipped.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# This script requires Yanfly Engine Ace - Ace Save Engine v1.01+ and the
# script must be placed under Ace Save Engine in the script listing.
#
#==============================================================================

module YEA
  module NEW_GAME_PLUS
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Description
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    NGP_SWITCH = 203           # If Switch ON, the game file has NG+ flag.
    NGP_TEXT   = "周目"   # Text used to show New Game+.
   
    # This is the help window text used for New Game+ when the New Game+
    # option is highlighted.
    NGP_HELP   = "继承新存档."
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Carry Over Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These settings adjust what carries over and what doesn't. These settings
    # are very specific so adjust them carefully.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # This array contains all of the switches that you want carried over to
    # be maintained. Any switches that aren't here will be set false.
    CARRY_OVER_SWITCHES = [3, 6, 7,12,15,16,17,18]
   
    # This array contains all of the variables that you want carried over to
    # be maintained. Any variables that aren't here will be set to 0.
    CARRY_OVER_VARIABLES = [1,2,3,4,5]
   
    # If this is set to false, then actors will be completely reset back to
    # their original starting states. If it's set to true, then actors will
    # be kept exactly as they are.
    CARRY_OVER_ACTORS = true
   
    # These settings are only used if actors will be carried over. With this,
    # you can limit what specifics will be carried over for actors from levels
    # to equips to skills.
    CARRY_OVER_LEVELS = true
    CARRY_OVER_EQUIPS = true
    CARRY_OVER_SKILLS = true
   
    # If this is set to false, then the party members will revert back to the
    # original starting party members. If it's true, then the party setup will
    # remain exactly the same.
    CARRY_OVER_PARTY_MEMBERS = true
   
    # If any of these are set to false, then no items, weapons, or armours will
    # be carried over. If it's set to true, then the respective items will be
    # carried over to the newer game.
    CARRY_OVER_GOLD    = true
    CARRY_OVER_ITEMS   = true
    CARRY_OVER_WEAPONS = true
    CARRY_OVER_ARMOURS = true
   
  end # NEW_GAME_PLUS
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

if $imported["YEA-SaveEngine"]

module YEA
  module NEW_GAME_PLUS
    module_function
    #--------------------------------------------------------------------------
    # convert_integer_array
    #--------------------------------------------------------------------------
    def convert_integer_array(array)
      result = []
      array.each { |i|
        case i
        when Range; result |= i.to_a
        when Integer; result |=
        end }
      return result
    end
    #--------------------------------------------------------------------------
    # converted_contants
    #--------------------------------------------------------------------------
    CARRY_OVER_SWITCHES = convert_integer_array(CARRY_OVER_SWITCHES)
    CARRY_OVER_VARIABLES = convert_integer_array(CARRY_OVER_VARIABLES)
  end # NEW_GAME_PLUS
  module REGEXP
  module BASEITEM
   
    NO_CARRY_OVER = /<(?:NO_CARRY_OVER|no carry over)>/i
   
  end # BASEITEM
  end # REGEXP
end # YEA

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_ngp load_database; end
  def self.load_database
    load_database_ngp
    load_notetags_ngp
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_ngp
  #--------------------------------------------------------------------------
  def self.load_notetags_ngp
    groups = [$data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_ngp
      end
    end
  end
  
end # DataManager

#==============================================================================
# ■ RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :no_carry_over
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_ngp
  #--------------------------------------------------------------------------
  def load_notetags_ngp
    @no_carry_over = false
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::NO_CARRY_OVER
        @no_carry_over = true
      end
    } # self.note.split
    #---
  end
  
end # RPG::BaseItem

#==============================================================================
# ■ Switch
#==============================================================================

module Switch
  
  #--------------------------------------------------------------------------
  # self.new_game_plus
  #--------------------------------------------------------------------------
  def self.new_game_plus
    return $game_switches[YEA::NEW_GAME_PLUS::NGP_SWITCH]
  end
  
end # Switch

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # new method: setup_new_game_plus
  #--------------------------------------------------------------------------
  def self.setup_new_game_plus(index)
    create_new_game_plus_objects(index)
    $game_map.setup($data_system.start_map_id)
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    Graphics.frame_count = 0
  end
  
  #--------------------------------------------------------------------------
  # new method: create_new_game_plus_objects
  #--------------------------------------------------------------------------
  def self.create_new_game_plus_objects(index)
    load_game_without_rescue(index)
    ngp_reset_switches
    ngp_reset_variables
    ngp_reset_self_switches
    ngp_reset_actors
    ngp_reset_party
  end
  
  #--------------------------------------------------------------------------
  # new method: ngp_reset_switches
  #--------------------------------------------------------------------------
  def self.ngp_reset_switches
    for i in 0...$data_system.switches.size
      next if i <= 0
      next if YEA::NEW_GAME_PLUS::CARRY_OVER_SWITCHES.include?(i)
      $game_switches = false
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: ngp_reset_variables
  #--------------------------------------------------------------------------
  def self.ngp_reset_variables
    for i in 0...$data_system.variables.size
      next if i <= 0
      next if YEA::NEW_GAME_PLUS::CARRY_OVER_VARIABLES.include?(i)
      $game_variables = 0
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: ngp_reset_self_switches
  #--------------------------------------------------------------------------
  def self.ngp_reset_self_switches
    $game_self_switches = Game_SelfSwitches.new
  end
  
  #--------------------------------------------------------------------------
  # new method: ngp_reset_actors
  #--------------------------------------------------------------------------
  def self.ngp_reset_actors
    unless YEA::NEW_GAME_PLUS::CARRY_OVER_ACTORS
      $game_actors = Game_Actors.new
    else
      #---
      unless YEA::NEW_GAME_PLUS::CARRY_OVER_LEVELS
        for i in 0...$data_actors.size
          actor = $game_actors
          next if actor.nil?
          actor.new_game_plus_levels
        end
      end
      #---
      unless YEA::NEW_GAME_PLUS::CARRY_OVER_EQUIPS
        for i in 0...$data_actors.size
          actor = $game_actors
          next if actor.nil?
          actor.new_game_plus_equips
        end
      end
      #---
      unless YEA::NEW_GAME_PLUS::CARRY_OVER_SKILLS
        for i in 0...$data_actors.size
          actor = $game_actors
          next if actor.nil?
          actor.new_game_plus_skills
        end
      end
      #---
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: ngp_reset_party
  #--------------------------------------------------------------------------
  def self.ngp_reset_party
    gold = 0
    items = {}
    members = []
    #---
    if YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
      for member in $game_party.members
        members.push(member.id)
      end
    end
    #---
    gold = $game_party.gold if YEA::NEW_GAME_PLUS::CARRY_OVER_GOLD
    #---
    if YEA::NEW_GAME_PLUS::CARRY_OVER_ITEMS
      for item in $data_items
        next if item.nil?
        next if item.no_carry_over
        items[item] = $game_party.item_number(item)
      end
    end
    #---
    if YEA::NEW_GAME_PLUS::CARRY_OVER_WEAPONS
      for item in $data_weapons
        next if item.nil?
        next if item.no_carry_over
        items[item] = $game_party.item_number(item)
      end
    end
    #---
    if YEA::NEW_GAME_PLUS::CARRY_OVER_ARMOURS
      for item in $data_armors
        next if item.nil?
        next if item.no_carry_over
        items[item] = $game_party.item_number(item)
      end
    end
    #---
    $game_party = Game_Party.new
    unless YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
      $game_party.setup_starting_members
    end
    #---
    for member_id in members
      $game_party.add_actor(member_id)
    end
    $game_party.gain_gold(gold)
    for key in items
      item = key[0]
      next if item.nil?
      $game_party.gain_item(item, key[1])
    end
  end
  
end # DataManager

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  
  #--------------------------------------------------------------------------
  # new method: new_game_plus_levels
  #--------------------------------------------------------------------------
  def new_game_plus_levels
    @class_id = actor.class_id
    @level = actor.initial_level
    @exp = {}
    if $imported["YEA-ClassSystem"]
      init_unlocked_classes
      init_subclass
    end
    clear_param_plus
    init_exp
    refresh
  end
  
  #--------------------------------------------------------------------------
  # new method: new_game_plus_equips
  #--------------------------------------------------------------------------
  def new_game_plus_equips
    init_equips(actor.equips)
  end
  
  #--------------------------------------------------------------------------
  # new method: new_game_plus_skills
  #--------------------------------------------------------------------------
  def new_game_plus_skills
    init_skills
  end
  
end # Game_Actor

#==============================================================================
# ■ Window_FileAction
#==============================================================================

class Window_FileAction < Window_HorzCommand
  
  #--------------------------------------------------------------------------
  # alias method: add_load_command
  #--------------------------------------------------------------------------
  alias add_load_command_ngp add_load_command
  def add_load_command
    if new_game_plus?
      add_command(YEA::NEW_GAME_PLUS::NGP_TEXT, :new_game_plus)
    else
      add_load_command_ngp
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: new_game_plus?
  #--------------------------------------------------------------------------
  def new_game_plus?
    return false if @header.nil?
    return false if @header[:switches].nil?
    return @header[:switches][YEA::NEW_GAME_PLUS::NGP_SWITCH]
  end
  
  #--------------------------------------------------------------------------
  # alias method: update_help
  #--------------------------------------------------------------------------
  alias update_help_ngp update_help
  def update_help
    case current_symbol
    when :new_game_plus; @help_window.set_text(YEA::NEW_GAME_PLUS::NGP_HELP)
    else; update_help_ngp
    end
  end
  
end # Window_FileAction

#==============================================================================
# ■ Scene_File
#==============================================================================

class Scene_File < Scene_MenuBase
  
  #--------------------------------------------------------------------------
  # alias method: create_action_window
  #--------------------------------------------------------------------------
  alias create_action_window_ngp create_action_window
  def create_action_window
    create_action_window_ngp
    @action_window.set_handler(:new_game_plus, method(:on_action_ngp))
  end
  
  #--------------------------------------------------------------------------
  # new method: on_action_ngp
  #--------------------------------------------------------------------------
  def on_action_ngp
    Sound.play_load
    DataManager.setup_new_game_plus(@file_window.index)
    fadeout_all
    $game_system.on_after_load
    SceneManager.goto(Scene_Map)
  end
  
end # Scene_File

end # $imported["YEA-SaveEngine"]

#==============================================================================
#
# ▼ End of File
#
#==============================================================================[/pre]

点评

就是因为注解都成火星文了所以才看不懂啊!  发表于 2013-3-17 12:44
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2006-7-19
帖子
76
5
 楼主| 发表于 2013-3-19 00:10:28 | 只看该作者
未改动代码,希望高手能看懂?

代码如下:
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Save Engine Add-On: New Game+ v1.00
  4. # -- Last Updated: 2011.12.26
  5. # -- Level: Normal
  6. # -- Requires: YEA - Ace Save Engine v1.01+
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-NewGame+"] = true

  11. #==============================================================================
  12. # ▼ 更新
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2011.12.26 - 启动脚本和成品。
  15. #
  16. #==============================================================================
  17. # ▼ 简介
  18. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19. # 新游戏 + 是为您的游戏提供重播价值的好方法。它可以让
  20. # 播放器中以不同的方式与任一游戏结转
  21. # 要结转的党员,要结转的技能,开关,项目和
  22. # 即使变量。有许多选项,以更改新 Game+ 的工作方式你的游戏。
  23. #
  24. #==============================================================================
  25. # ▼ 说明
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # 若要安装此脚本,打开您的脚本编辑器,复制/粘贴此脚本
  28. # 打开插槽下面 ▼ 材料/素材但 ▼ Main 上面。记住要保存。
  29. #
  30. # -----------------------------------------------------------------------------
  31. # 项目 Notetags - These notetags go in the items notebox in the database.
  32. # -----------------------------------------------------------------------------
  33. # <no carry over>
  34. # This will cause this specific item to not carry over in New Game+ if the item
  35. # can be carried over. This does not affect any items that actors may have
  36. # equipped.
  37. #
  38. # -----------------------------------------------------------------------------
  39. # 武器 Notetags - These notetags go in the weapons notebox in the database.
  40. # -----------------------------------------------------------------------------
  41. # <no carry over>
  42. # This will cause this specific item to not carry over in New Game+ if the item
  43. # can be carried over. This does not affect any items that actors may have
  44. # equipped.
  45. #
  46. # -----------------------------------------------------------------------------
  47. # 盔甲 Notetags - These notetags go in the armours notebox in the database.
  48. # -----------------------------------------------------------------------------
  49. # <no carry over>
  50. # This will cause this specific item to not carry over in New Game+ if the item
  51. # can be carried over. This does not affect any items that actors may have
  52. # equipped.
  53. #
  54. #==============================================================================
  55. # ▼ 兼容性
  56. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  57. # 此脚本是作出严格的 rpg 游戏制造商 VX Ace。它是极不可能的
  58. # 它将不调整的情况下运行 rpg 游戏制造商 VX。
  59. #
  60. # 该脚本需要使用 Yanfly 引擎 Ace-Ace 保存引擎 v1.01 + 和
  61. # 脚本必须放在待 Ace 保存引擎脚本列表中。
  62. #
  63. #==============================================================================

  64. module YEA
  65.   module NEW_GAME_PLUS
  66.    
  67.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68.     # - General Settings -
  69.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  70.     # Description
  71.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72.     NGP_SWITCH = 203        # 如果交换机上,游戏的文件有吴 + 标志。
  73.     NGP_TEXT   = "周目"   # 用来显示新的 Game+ 的文本。
  74.    
  75.     # 这是用于新游戏 + 时的帮助窗口文本新的 Game+
  76.     # 突出显示选项。
  77.     NGP_HELP   = "继承新存档."
  78.    
  79.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  80.     # - 结转设置 -
  81.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82.     # 这些设置调整什么可延伸而哪些不能。这些设置
  83.     # 非常具体这么仔细调整它们。
  84.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  85.     # 此数组包含所有你想要结转到的交换机
  86.     # 保持。任何不是来这里的交换机将设置为 false。
  87.     CARRY_OVER_SWITCHES = [3, 6, 7,12,15,16,17,18]
  88.    
  89.     # 此数组中包含的所有变量,要结转到
  90.     # 保持。不是来这里的任何变量将被设置为 0。
  91.     CARRY_OVER_VARIABLES = [1,2,3,4,5]
  92.    
  93.     # If this is set to false, then actors will be completely reset back to
  94.     # their original starting states. If it's set to true, then actors will
  95.     # be kept exactly as they are.
  96.     CARRY_OVER_ACTORS = true
  97.    
  98.     # These settings are only used if actors will be carried over. With this,
  99.     # you can limit what specifics will be carried over for actors from levels
  100.     # to equips to skills.
  101.     CARRY_OVER_LEVELS = true
  102.     CARRY_OVER_EQUIPS = true
  103.     CARRY_OVER_SKILLS = true
  104.    
  105.     # If this is set to false, then the party members will revert back to the
  106.     # original starting party members. If it's true, then the party setup will
  107.     # remain exactly the same.
  108.     CARRY_OVER_PARTY_MEMBERS = true
  109.    
  110.     # If any of these are set to false, then no items, weapons, or armours will
  111.     # be carried over. If it's set to true, then the respective items will be
  112.     # carried over to the newer game.
  113.     CARRY_OVER_GOLD    = true
  114.     CARRY_OVER_ITEMS   = true
  115.     CARRY_OVER_WEAPONS = true
  116.     CARRY_OVER_ARMOURS = true
  117.    
  118.   end # NEW_GAME_PLUS
  119. end # YEA

  120. #==============================================================================
  121. # ▼ Editting anything past this point may potentially result in causing
  122. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  123. # halitosis so edit at your own risk.
  124. #==============================================================================

  125. if $imported["YEA-SaveEngine"]

  126. module YEA
  127.   module NEW_GAME_PLUS
  128.     module_function
  129.     #--------------------------------------------------------------------------
  130.     # convert_integer_array
  131.     #--------------------------------------------------------------------------
  132.     def convert_integer_array(array)
  133.       result = []
  134.       array.each { |i|
  135.         case i
  136.         when Range; result |= i.to_a
  137.         when Integer; result |= [i]
  138.         end }
  139.       return result
  140.     end
  141.     #--------------------------------------------------------------------------
  142.     # converted_contants
  143.     #--------------------------------------------------------------------------
  144.     CARRY_OVER_SWITCHES = convert_integer_array(CARRY_OVER_SWITCHES)
  145.     CARRY_OVER_VARIABLES = convert_integer_array(CARRY_OVER_VARIABLES)
  146.   end # NEW_GAME_PLUS
  147.   module REGEXP
  148.   module BASEITEM
  149.    
  150.     NO_CARRY_OVER = /<(?:NO_CARRY_OVER|no carry over)>/i
  151.    
  152.   end # BASEITEM
  153.   end # REGEXP
  154. end # YEA

  155. #==============================================================================
  156. # ■ DataManager
  157. #==============================================================================

  158. module DataManager
  159.   
  160.   #--------------------------------------------------------------------------
  161.   # alias method: load_database
  162.   #--------------------------------------------------------------------------
  163.   class <<self; alias load_database_ngp load_database; end
  164.   def self.load_database
  165.     load_database_ngp
  166.     load_notetags_ngp
  167.   end
  168.   
  169.   #--------------------------------------------------------------------------
  170.   # new method: load_notetags_ngp
  171.   #--------------------------------------------------------------------------
  172.   def self.load_notetags_ngp
  173.     groups = [$data_items, $data_weapons, $data_armors]
  174.     for group in groups
  175.       for obj in group
  176.         next if obj.nil?
  177.         obj.load_notetags_ngp
  178.       end
  179.     end
  180.   end
  181.   
  182. end # DataManager

  183. #==============================================================================
  184. # ■ RPG::BaseItem
  185. #==============================================================================

  186. class RPG::BaseItem
  187.   
  188.   #--------------------------------------------------------------------------
  189.   # public instance variables
  190.   #--------------------------------------------------------------------------
  191.   attr_accessor :no_carry_over
  192.   
  193.   #--------------------------------------------------------------------------
  194.   # common cache: load_notetags_ngp
  195.   #--------------------------------------------------------------------------
  196.   def load_notetags_ngp
  197.     @no_carry_over = false
  198.     #---
  199.     self.note.split(/[\r\n]+/).each { |line|
  200.       case line
  201.       #---
  202.       when YEA::REGEXP::BASEITEM::NO_CARRY_OVER
  203.         @no_carry_over = true
  204.       end
  205.     } # self.note.split
  206.     #---
  207.   end
  208.   
  209. end # RPG::BaseItem

  210. #==============================================================================
  211. # ■ Switch
  212. #==============================================================================

  213. module Switch
  214.   
  215.   #--------------------------------------------------------------------------
  216.   # self.new_game_plus
  217.   #--------------------------------------------------------------------------
  218.   def self.new_game_plus
  219.     return $game_switches[YEA::NEW_GAME_PLUS::NGP_SWITCH]
  220.   end
  221.   
  222. end # Switch

  223. #==============================================================================
  224. # ■ DataManager
  225. #==============================================================================

  226. module DataManager
  227.   
  228.   #--------------------------------------------------------------------------
  229.   # new method: setup_new_game_plus
  230.   #--------------------------------------------------------------------------
  231.   def self.setup_new_game_plus(index)
  232.     create_new_game_plus_objects(index)
  233.     $game_map.setup($data_system.start_map_id)
  234.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  235.     $game_player.refresh
  236.     Graphics.frame_count = 0
  237.   end
  238.   
  239.   #--------------------------------------------------------------------------
  240.   # new method: create_new_game_plus_objects
  241.   #--------------------------------------------------------------------------
  242.   def self.create_new_game_plus_objects(index)
  243.     load_game_without_rescue(index)
  244.     ngp_reset_switches
  245.     ngp_reset_variables
  246.     ngp_reset_self_switches
  247.     ngp_reset_actors
  248.     ngp_reset_party
  249.   end
  250.   
  251.   #--------------------------------------------------------------------------
  252.   # new method: ngp_reset_switches
  253.   #--------------------------------------------------------------------------
  254.   def self.ngp_reset_switches
  255.     for i in 0...$data_system.switches.size
  256.       next if i <= 0
  257.       next if YEA::NEW_GAME_PLUS::CARRY_OVER_SWITCHES.include?(i)
  258.       $game_switches[i] = false
  259.     end
  260.   end
  261.   
  262.   #--------------------------------------------------------------------------
  263.   # new method: ngp_reset_variables
  264.   #--------------------------------------------------------------------------
  265.   def self.ngp_reset_variables
  266.     for i in 0...$data_system.variables.size
  267.       next if i <= 0
  268.       next if YEA::NEW_GAME_PLUS::CARRY_OVER_VARIABLES.include?(i)
  269.       $game_variables[i] = 0
  270.     end
  271.   end
  272.   
  273.   #--------------------------------------------------------------------------
  274.   # new method: ngp_reset_self_switches
  275.   #--------------------------------------------------------------------------
  276.   def self.ngp_reset_self_switches
  277.     $game_self_switches = Game_SelfSwitches.new
  278.   end
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # new method: ngp_reset_actors
  282.   #--------------------------------------------------------------------------
  283.   def self.ngp_reset_actors
  284.     unless YEA::NEW_GAME_PLUS::CARRY_OVER_ACTORS
  285.       $game_actors = Game_Actors.new
  286.     else
  287.       #---
  288.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_LEVELS
  289.         for i in 0...$data_actors.size
  290.           actor = $game_actors[i]
  291.           next if actor.nil?
  292.           actor.new_game_plus_levels
  293.         end
  294.       end
  295.       #---
  296.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_EQUIPS
  297.         for i in 0...$data_actors.size
  298.           actor = $game_actors[i]
  299.           next if actor.nil?
  300.           actor.new_game_plus_equips
  301.         end
  302.       end
  303.       #---
  304.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_SKILLS
  305.         for i in 0...$data_actors.size
  306.           actor = $game_actors[i]
  307.           next if actor.nil?
  308.           actor.new_game_plus_skills
  309.         end
  310.       end
  311.       #---
  312.     end
  313.   end
  314.   
  315.   #--------------------------------------------------------------------------
  316.   # new method: ngp_reset_party
  317.   #--------------------------------------------------------------------------
  318.   def self.ngp_reset_party
  319.     gold = 0
  320.     items = {}
  321.     members = []
  322.     #---
  323.     if YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
  324.       for member in $game_party.members
  325.         members.push(member.id)
  326.       end
  327.     end
  328.     #---
  329.     gold = $game_party.gold if YEA::NEW_GAME_PLUS::CARRY_OVER_GOLD
  330.     #---
  331.     if YEA::NEW_GAME_PLUS::CARRY_OVER_ITEMS
  332.       for item in $data_items
  333.         next if item.nil?
  334.         next if item.no_carry_over
  335.         items[item] = $game_party.item_number(item)
  336.       end
  337.     end
  338.     #---
  339.     if YEA::NEW_GAME_PLUS::CARRY_OVER_WEAPONS
  340.       for item in $data_weapons
  341.         next if item.nil?
  342.         next if item.no_carry_over
  343.         items[item] = $game_party.item_number(item)
  344.       end
  345.     end
  346.     #---
  347.     if YEA::NEW_GAME_PLUS::CARRY_OVER_ARMOURS
  348.       for item in $data_armors
  349.         next if item.nil?
  350.         next if item.no_carry_over
  351.         items[item] = $game_party.item_number(item)
  352.       end
  353.     end
  354.     #---
  355.     $game_party = Game_Party.new
  356.     unless YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
  357.       $game_party.setup_starting_members
  358.     end
  359.     #---
  360.     for member_id in members
  361.       $game_party.add_actor(member_id)
  362.     end
  363.     $game_party.gain_gold(gold)
  364.     for key in items
  365.       item = key[0]
  366.       next if item.nil?
  367.       $game_party.gain_item(item, key[1])
  368.     end
  369.   end
  370.   
  371. end # DataManager

  372. #==============================================================================
  373. # ■ Game_Actor
  374. #==============================================================================

  375. class Game_Actor < Game_Battler
  376.   
  377.   #--------------------------------------------------------------------------
  378.   # new method: new_game_plus_levels
  379.   #--------------------------------------------------------------------------
  380.   def new_game_plus_levels
  381.     @class_id = actor.class_id
  382.     [url=home.php?mod=space&uid=22147]@level[/url] = actor.initial_level
  383.     [url=home.php?mod=space&uid=13302]@exp[/url] = {}
  384.     if $imported["YEA-ClassSystem"]
  385.       init_unlocked_classes
  386.       init_subclass
  387.     end
  388.     clear_param_plus
  389.     init_exp
  390.     refresh
  391.   end
  392.   
  393.   #--------------------------------------------------------------------------
  394.   # new method: new_game_plus_equips
  395.   #--------------------------------------------------------------------------
  396.   def new_game_plus_equips
  397.     init_equips(actor.equips)
  398.   end
  399.   
  400.   #--------------------------------------------------------------------------
  401.   # new method: new_game_plus_skills
  402.   #--------------------------------------------------------------------------
  403.   def new_game_plus_skills
  404.     init_skills
  405.   end
  406.   
  407. end # Game_Actor

  408. #==============================================================================
  409. # ■ Window_FileAction
  410. #==============================================================================

  411. class Window_FileAction < Window_HorzCommand
  412.   
  413.   #--------------------------------------------------------------------------
  414.   # alias method: add_load_command
  415.   #--------------------------------------------------------------------------
  416.   alias add_load_command_ngp add_load_command
  417.   def add_load_command
  418.     if new_game_plus?
  419.       add_command(YEA::NEW_GAME_PLUS::NGP_TEXT, :new_game_plus)
  420.     else
  421.       add_load_command_ngp
  422.     end
  423.   end
  424.   
  425.   #--------------------------------------------------------------------------
  426.   # new method: new_game_plus?
  427.   #--------------------------------------------------------------------------
  428.   def new_game_plus?
  429.     return false if @header.nil?
  430.     return false if @header[:switches].nil?
  431.     return @header[:switches][YEA::NEW_GAME_PLUS::NGP_SWITCH]
  432.   end
  433.   
  434.   #--------------------------------------------------------------------------
  435.   # alias method: update_help
  436.   #--------------------------------------------------------------------------
  437.   alias update_help_ngp update_help
  438.   def update_help
  439.     case current_symbol
  440.     when :new_game_plus; @help_window.set_text(YEA::NEW_GAME_PLUS::NGP_HELP)
  441.     else; update_help_ngp
  442.     end
  443.   end
  444.   
  445. end # Window_FileAction

  446. #==============================================================================
  447. # ■ Scene_File
  448. #==============================================================================

  449. class Scene_File < Scene_MenuBase
  450.   
  451.   #--------------------------------------------------------------------------
  452.   # alias method: create_action_window
  453.   #--------------------------------------------------------------------------
  454.   alias create_action_window_ngp create_action_window
  455.   def create_action_window
  456.     create_action_window_ngp
  457.     @action_window.set_handler(:new_game_plus, method(:on_action_ngp))
  458.   end
  459.   
  460.   #--------------------------------------------------------------------------
  461.   # new method: on_action_ngp
  462.   #--------------------------------------------------------------------------
  463.   def on_action_ngp
  464.     Sound.play_load
  465.     DataManager.setup_new_game_plus(@file_window.index)
  466.     fadeout_all
  467.     $game_system.on_after_load
  468.     SceneManager.goto(Scene_Map)
  469.   end
  470.   
  471. end # Scene_File

  472. end # $imported["YEA-SaveEngine"]

  473. #==============================================================================
  474. #
  475. # ▼ End of File
  476. #
  477. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-20 00:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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