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

Project1

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

[已经解决] 用变量来记录杀敌数的问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

跳转到指定楼层
1
发表于 2015-11-14 22:24:00 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 踢腿水上飘 于 2015-11-14 22:46 编辑

我在敌群的事件页里设置敌人血量低于0%的时候变量+1
结果发现我撤退变量也会涨- -没法准确统计,而且很麻烦,每个敌群都要设置,所以估计要求助于脚本了,特来求助- -
如果能有一个我方战斗不能次数的统计就更好了

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21631
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

2
发表于 2015-11-14 22:50:19 | 只看该作者
https://rpg.blue/home.php?mod=sp ... o=blog&id=14685

(只有杀敌数,没有我方不能战斗统计)
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

3
 楼主| 发表于 2015-11-14 22:58:36 | 只看该作者
本帖最后由 踢腿水上飘 于 2015-11-14 23:03 编辑
喵呜喵5 发表于 2015-11-14 22:50
https://rpg.blue/home.php?mod=sp ... o=blog&id=14685

(只有杀敌数,没有我方不能战斗统 ...


我在变量操作里面输入M5EC20151114[1],结果报错- -
这里必须要输入敌人ID吗?想统计各种敌人的击杀总数的话怎么办?



回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21631
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

4
发表于 2015-11-14 23:07:15 | 只看该作者
踢腿水上飘 发表于 2015-11-14 22:58
我在变量操作里面输入M5EC20151114[1],结果报错- -
这里必须要输入敌人ID吗?想统计各种敌人的击杀总数 ...

你插入脚本了吗……= =

统计击杀总数就一个敌人一个敌人的加上去呗
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

5
 楼主| 发表于 2015-11-14 23:12:26 | 只看该作者
喵呜喵5 发表于 2015-11-14 23:07
你插入脚本了吗……= =

统计击杀总数就一个敌人一个敌人的加上去呗

饿,对没加入脚本,统计总数是像M5EC20151114[1,2,3,4,5,6,7] 这样吗- -
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21631
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

6
发表于 2015-11-14 23:14:48 | 只看该作者
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

7
 楼主| 发表于 2015-11-14 23:36:32 | 只看该作者
嗯,我设置好了,但是并没有记录下来呀- -#
杀了敌人,但杀敌数还是0- -
我怕是脚本冲突,特地新建了一个工程
但也是一样的结果呀,帮忙看看是哪里出的问题吧~
Project1.rar (1.42 MB, 下载次数: 67)
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21631
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

8
发表于 2015-11-14 23:43:05 | 只看该作者
击杀数是每次需要时通过M5EC20151114[敌人的ID]获取的……
你要实时更新的话那个事件不能只执行一次,而应该设置成并行处理
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

9
 楼主| 发表于 2015-11-14 23:59:36 | 只看该作者
额- -那就有点想得复杂了- - 我想的东西很简单- -就是死一个怪物 变量0003就+1,不用单独统计打了哪个ID多少次之类的- -
我在想能不能在公共事件里设置 有敌人战斗不能,变量0003就+1,但是好像不行- -
搜索了一下,VX哪里有人在Game_Troop
的def exp_total 里面加上一行
$game_variables[变量ID] += 1 unless enemy.hidden
就搞定了,但是这是VX的,VA用不了似乎- -,求教能改改用吗?

点评

敌人每死一次,M5EC20151114[敌人的ID] 获得的值自动加1,你要是想要指定变量自动加1就扔一个并行事件实时更新这个变量  发表于 2015-11-15 00:42
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

10
 楼主| 发表于 2015-11-16 20:56:51 | 只看该作者
对了
@喵呜喵5

这个脚本和存档强化继承脚本有冲突- -,看不出是哪里额





脚本如下

RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ?\ Yanfly Engine Ace - Ace Save Engine v1.03
  4. # -- Last Updated: 2012.07.22
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-SaveEngine"] = true
  12.  
  13. #==============================================================================
  14. # ?\ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.07.22 - Fixed: Location Drawing.
  17. # 2012.01.23 - Anti-crash method added for removed maps.
  18. # 2011.12.26 - Compatibility Update: New Game+
  19. # 2011.12.26 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ?\ Introduction
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # This script provides a new save interface for the player. Along with a new
  25. # interface, the player can also load and delete saves straight from the menu
  26. # itself. This will in turn make the save command from the Main Menu always
  27. # available, but the save option within the new save menu will be enabled
  28. # depending on whether or not it is allowed or disallowed. From the interface,
  29. # the player is given more information regarding the save file including the
  30. # the location the player saved at, the amount of gold available, and any
  31. # variables that you want to show the player as well.
  32. #
  33. #==============================================================================
  34. # ?\ Instructions
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # To install this script, open up your script editor and copy/paste this script
  37. # to an open slot below ?\ Materials/ef?T but above ?\ Main. Remember to save.
  38. #
  39. # For first time installers, be warned that loading this script the first time
  40. # may not display all information in the status window for save files made
  41. # before the installation of this script. To remedy this, just load up the save
  42. # and save the file again.
  43. #
  44. #==============================================================================
  45. # ?\ Compatibility
  46. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  47. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  48. # it will run with RPG Maker VX without adjusting.
  49. #
  50. #==============================================================================
  51.  
  52. module YEA
  53.   module SAVE
  54.  
  55.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56.     # - Slot Window Settings -
  57.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58.     # This section adjusts how the slot window appears on the left side of the
  59.     # screen. This also adjusts the maximum number of saves a player can make,
  60.     # the way the slot names appear, and the icons used.
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     MAX_FILES = 24         # Maximum saves a player can make. Default: 16
  63.     SLOT_NAME = "存档 %s"  # How the file slots will be named.
  64.  
  65.     # These are the icons
  66.     SAVE_ICON  = 368       # Icon used to indicate a save is present.
  67.     EMPTY_ICON = 375       # Icon used to indicate an empty file.
  68.  
  69.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  70.     # - Action Window Settings -
  71.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72.     # This section adjusts how the action window appears, the sound effect
  73.     # played when deleting files, and what appears in the help window above.
  74.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  75.     ACTION_LOAD   = "读档"           # Text used for loading games.
  76.     ACTION_SAVE   = "存档"           # Text used for saving games.
  77.     ACTION_DELETE = "删除"         # Text used for deleting games.
  78.     DELETE_SOUND  = RPG::SE.new("Collapse3", 100, 100) # Sound for deleting.
  79.  
  80.     # These text settings adjust what displays in the help window.
  81.     SELECT_HELP = "请选择一个存档位置。"
  82.     LOAD_HELP   = "读取你的游戏进度。"
  83.     SAVE_HELP   = "储存你的游戏进度。"
  84.     DELETE_HELP = "删除你的游戏进度。"
  85.  
  86.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  87.     # - Status Window Settings -
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     # This section adjusts how the status window appears in the middle of the
  90.     # screen (that displays the game's data) such as the total playtime, total
  91.     # times saved, total gold, the party's current location, and the variables
  92.     # to be displayed.
  93.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94.     EMPTY_TEXT = "没有存档"      # Text used when no save data is present.
  95.     PLAYTIME   = "游戏时间"          # Text used for total playtime.
  96.     TOTAL_SAVE = "Total Saves: "     # Text used to indicate total saves.
  97.     TOTAL_GOLD = "持有金钱:"      # Text used to indicate total gold.
  98.     LOCATION   = "存档地点:"        # Text used to indicate current location.
  99.  
  100.     # These variables will be shown in each of the two columns for those who
  101.     # would want to display more information than just what's shown. Input the
  102.     # variables into the arrays below to designate what data will be shown.
  103.     COLUMN1_VARIABLES = [1, 2, 3]
  104.     COLUMN2_VARIABLES = [4, 5, 6]
  105.  
  106.   end # SAVE
  107. end # YEA
  108.  
  109. #==============================================================================
  110. # ?\ Editting anything past this point may potentially result in causing
  111. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  112. # halitosis so edit at your own risk.
  113. #==============================================================================
  114.  
  115. #==============================================================================
  116. # ?! Icon
  117. #==============================================================================
  118.  
  119. module Icon
  120.  
  121.   #--------------------------------------------------------------------------
  122.   # self.save_icon
  123.   #--------------------------------------------------------------------------
  124.   def self.save_icon; return YEA::SAVE::SAVE_ICON; end
  125.  
  126.   #--------------------------------------------------------------------------
  127.   # self.empty_icon
  128.   #--------------------------------------------------------------------------
  129.   def self.empty_icon; return YEA::SAVE::EMPTY_ICON; end
  130.  
  131. end # Icon
  132.  
  133. #==============================================================================
  134. # ?! Numeric
  135. #==============================================================================
  136.  
  137. class Numeric
  138.  
  139.   #--------------------------------------------------------------------------
  140.   # new method: group_digits
  141.   #--------------------------------------------------------------------------
  142.   unless $imported["YEA-CoreEngine"]
  143.   def group; return self.to_s; end
  144.   end # $imported["YEA-CoreEngine"]
  145.  
  146. end # Numeric
  147.  
  148. #==============================================================================
  149. # ?! DataManager
  150. #==============================================================================
  151.  
  152. module DataManager
  153.  
  154.   #--------------------------------------------------------------------------
  155.   # overwrite method: savefile_max
  156.   #--------------------------------------------------------------------------
  157.   def self.savefile_max
  158.     return YEA::SAVE::MAX_FILES
  159.   end
  160.  
  161.   #--------------------------------------------------------------------------
  162.   # overwrite method: self.make_save_header
  163.   #--------------------------------------------------------------------------
  164.   def self.make_save_header
  165.     header = {}
  166.     header[:characters]    = $game_party.characters_for_savefile
  167.     header[:playtime_s]    = $game_system.playtime_s
  168.     header[:system]        = Marshal.load(Marshal.dump($game_system))
  169.     header[:timer]         = Marshal.load(Marshal.dump($game_timer))
  170.     header[:message]       = Marshal.load(Marshal.dump($game_message))
  171.     header[:switches]      = Marshal.load(Marshal.dump($game_switches))
  172.     header[:variables]     = Marshal.load(Marshal.dump($game_variables))
  173.     header[:self_switches] = Marshal.load(Marshal.dump($game_self_switches))
  174.     header[:actors]        = Marshal.load(Marshal.dump($game_actors))
  175.     header[:party]         = Marshal.load(Marshal.dump($game_party))
  176.     header[:troop]         = Marshal.load(Marshal.dump($game_troop))
  177.     header[:map]           = Marshal.load(Marshal.dump($game_map))
  178.     header[:player]        = Marshal.load(Marshal.dump($game_player))
  179.     header
  180.   end
  181.  
  182. end # DataManager
  183.  
  184. #==============================================================================
  185. # ?! Window_MenuCommand
  186. #==============================================================================
  187.  
  188. class Window_MenuCommand < Window_Command
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # overwrite method: save_enabled
  192.   #--------------------------------------------------------------------------
  193.   def save_enabled; return true; end
  194.  
  195. end # Window_MenuCommand
  196.  
  197. #==============================================================================
  198. # ?! Window_FileList
  199. #==============================================================================
  200.  
  201. class Window_FileList < Window_Selectable
  202.  
  203.   #--------------------------------------------------------------------------
  204.   # initialize
  205.   #--------------------------------------------------------------------------
  206.   def initialize(dx, dy)
  207.     super(dx, dy, 128, Graphics.height - dy)
  208.     refresh
  209.     activate
  210.     select(SceneManager.scene.first_savefile_index)
  211.   end
  212.  
  213.   #--------------------------------------------------------------------------
  214.   # item_max
  215.   #--------------------------------------------------------------------------
  216.   def item_max; return DataManager.savefile_max; end
  217.  
  218.   #--------------------------------------------------------------------------
  219.   # current_item_enabled?
  220.   #--------------------------------------------------------------------------
  221.   def current_item_enabled?
  222.     header = DataManager.load_header(index)
  223.     return false if header.nil? && SceneManager.scene_is?(Scene_Load)
  224.     return true
  225.   end
  226.  
  227.   #--------------------------------------------------------------------------
  228.   # refresh
  229.   #--------------------------------------------------------------------------
  230.   def refresh
  231.     create_contents
  232.     draw_all_items
  233.   end
  234.  
  235.   #--------------------------------------------------------------------------
  236.   # draw_item
  237.   #--------------------------------------------------------------------------
  238.   def draw_item(index)
  239.     header = DataManager.load_header(index)
  240.     enabled = !header.nil?
  241.     rect = item_rect(index)
  242.     rect.width -= 4
  243.     draw_icon(save_icon?(header), rect.x, rect.y, enabled)
  244.     change_color(normal_color, enabled)
  245.     text = sprintf(YEA::SAVE::SLOT_NAME, (index + 1).group)
  246.     draw_text(rect.x+24, rect.y, rect.width-24, line_height, text)
  247.   end
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # save_icon?
  251.   #--------------------------------------------------------------------------
  252.   def save_icon?(header)
  253.     return Icon.empty_icon if header.nil?
  254.     return Icon.save_icon
  255.   end
  256.  
  257. end # Window_FileList
  258.  
  259. #==============================================================================
  260. # ?! Window_FileStatus
  261. #==============================================================================
  262.  
  263. class Window_FileStatus < Window_Base
  264.  
  265.   #--------------------------------------------------------------------------
  266.   # initialize
  267.   #--------------------------------------------------------------------------
  268.   def initialize(dx, dy, file_window)
  269.     super(dx, dy, Graphics.width - dx, Graphics.height - dy)
  270.     @file_window = file_window
  271.     @current_index = @file_window.index
  272.     refresh
  273.   end
  274.  
  275.   #--------------------------------------------------------------------------
  276.   # update
  277.   #--------------------------------------------------------------------------
  278.   def update
  279.     super
  280.     return if @file_window.index < 0
  281.     return if @current_index == @file_window.index
  282.     @current_index = @file_window.index
  283.     refresh
  284.   end
  285.  
  286.   #--------------------------------------------------------------------------
  287.   # refresh
  288.   #--------------------------------------------------------------------------
  289.   def refresh
  290.     contents.clear
  291.     reset_font_settings
  292.     @header = DataManager.load_header(@file_window.index)
  293.     if @header.nil?
  294.       draw_empty
  295.     else
  296.       draw_save_contents
  297.     end
  298.   end
  299.  
  300.   #--------------------------------------------------------------------------
  301.   # draw_empty
  302.   #--------------------------------------------------------------------------
  303.   def draw_empty
  304.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  305.     rect = Rect.new(0, 0, contents.width, contents.height)
  306.     contents.fill_rect(rect, colour)
  307.     text = YEA::SAVE::EMPTY_TEXT
  308.     change_color(system_color)
  309.     draw_text(rect, text, 1)
  310.   end
  311.  
  312.   #--------------------------------------------------------------------------
  313.   # draw_save_slot
  314.   #--------------------------------------------------------------------------
  315.   def draw_save_slot(dx, dy, dw)
  316.     reset_font_settings
  317.     change_color(system_color)
  318.     text = sprintf(YEA::SAVE::SLOT_NAME, "")
  319.     draw_text(dx, dy, dw, line_height, text)
  320.     cx = text_size(text).width
  321.     change_color(normal_color)
  322.     draw_text(dx+cx, dy, dw-cx, line_height, (@file_window.index+1).group)
  323.   end
  324.  
  325.   #--------------------------------------------------------------------------
  326.   # draw_save_playtime
  327.   #--------------------------------------------------------------------------
  328.   def draw_save_playtime(dx, dy, dw)
  329.     return if @header[:playtime_s].nil?
  330.     reset_font_settings
  331.     change_color(system_color)
  332.     draw_text(dx, dy, dw, line_height, YEA::SAVE::PLAYTIME, 0)
  333.     change_color(normal_color)
  334.     draw_text(dx, dy, dw, line_height, @header[:playtime_s], 2)
  335.   end
  336.  
  337.   #--------------------------------------------------------------------------
  338.   # draw_save_total_saves
  339.   #--------------------------------------------------------------------------
  340.   def draw_save_total_saves(dx, dy, dw)
  341.     return if @header[:system].nil?
  342.     reset_font_settings
  343.     change_color(system_color)
  344.     text = YEA::SAVE::TOTAL_SAVE
  345.     draw_text(dx, dy, dw, line_height, text)
  346.     cx = text_size(text).width
  347.     change_color(normal_color)
  348.     draw_text(dx+cx, dy, dw-cx, line_height, @header[:system].save_count.group)
  349.   end
  350.  
  351.   #--------------------------------------------------------------------------
  352.   # draw_save_gold
  353.   #--------------------------------------------------------------------------
  354.   def draw_save_gold(dx, dy, dw)
  355.     return if @header[:party].nil?
  356.     reset_font_settings
  357.     change_color(system_color)
  358.     draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)
  359.     text = Vocab::currency_unit
  360.     draw_text(dx, dy, dw, line_height, text, 2)
  361.     cx = text_size(text).width
  362.     change_color(normal_color)
  363.     text = @header[:party].gold.group
  364.     draw_text(dx, dy, dw-cx, line_height, text, 2)
  365.   end
  366.  
  367.   #--------------------------------------------------------------------------
  368.   # draw_save_location
  369.   #--------------------------------------------------------------------------
  370.   def draw_save_location(dx, dy, dw)
  371.     return if @header[:map].nil?
  372.     reset_font_settings
  373.     change_color(system_color)
  374.     draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION)
  375.     change_color(normal_color)
  376.     cx = text_size(YEA::SAVE::LOCATION).width
  377.     return if $data_mapinfos[@header[:map].map_id].nil?
  378.     text = @header[:map].display_name
  379.     text = $data_mapinfos[@header[:map].map_id].name if text == ""
  380.     draw_text(dx+cx, dy, dw-cx, line_height, text)
  381.   end
  382.  
  383.   #--------------------------------------------------------------------------
  384.   # draw_save_characters
  385.   #--------------------------------------------------------------------------
  386.   def draw_save_characters(dx, dy)
  387.     return if @header[:party].nil?
  388.     reset_font_settings
  389.     make_font_smaller
  390.     dw = (contents.width - dx) / @header[:party].max_battle_members
  391.     dx += dw/2
  392.     for member in @header[:party].battle_members
  393.       next if member.nil?
  394.       member = @header[:actors][member.id]
  395.       change_color(normal_color)
  396.       draw_actor_graphic(member, dx, dy)
  397.       text = member.name
  398.       draw_text(dx-dw/2, dy, dw, line_height, text, 1)
  399.       text = member.level.group
  400.       draw_text(dx-dw/2, dy-line_height, dw-4, line_height, text, 2)
  401.       cx = text_size(text).width
  402.       change_color(system_color)
  403.       text = Vocab::level_a
  404.       draw_text(dx-dw/2, dy-line_height, dw-cx-4, line_height, text, 2)
  405.       dx += dw
  406.     end
  407.   end
  408.  
  409.   #--------------------------------------------------------------------------
  410.   # draw_save_column1
  411.   #--------------------------------------------------------------------------
  412.   def draw_save_column1(dx, dy, dw)
  413.     data = YEA::SAVE::COLUMN1_VARIABLES
  414.     draw_column_data(data, dx, dy, dw)
  415.   end
  416.  
  417.   #--------------------------------------------------------------------------
  418.   # draw_save_column2
  419.   #--------------------------------------------------------------------------
  420.   def draw_save_column2(dx, dy, dw)
  421.     data = YEA::SAVE::COLUMN2_VARIABLES
  422.     draw_column_data(data, dx, dy, dw)
  423.   end
  424.  
  425.   #--------------------------------------------------------------------------
  426.   # draw_column_data
  427.   #--------------------------------------------------------------------------
  428.   def draw_column_data(data, dx, dy, dw)
  429.     return if @header[:variables].nil?
  430.     reset_font_settings
  431.     for variable_id in data
  432.       next if $data_system.variables[variable_id].nil?
  433.       change_color(system_color)
  434.       name = $data_system.variables[variable_id]
  435.       draw_text(dx, dy, dw, line_height, name, 0)
  436.       value = @header[:variables][variable_id].group
  437.       change_color(normal_color)
  438.       draw_text(dx, dy, dw, line_height, value, 2)
  439.       dy += line_height
  440.     end
  441.   end
  442.  
  443.   #--------------------------------------------------------------------------
  444.   # draw_save_contents
  445.   #--------------------------------------------------------------------------
  446.   def draw_save_contents
  447.     draw_save_slot(4, 0, contents.width/2-8)
  448.     draw_save_playtime(contents.width/2+4, 0, contents.width/2-8)
  449.     draw_save_total_saves(4, line_height, contents.width/2-8)
  450.     draw_save_gold(contents.width/2+4, line_height, contents.width/2-8)
  451.     draw_save_location(4, line_height*2, contents.width-8)
  452.     draw_save_characters(0, line_height*5 + line_height/3)
  453.     draw_save_column1(16, line_height*7, contents.width/2-48)
  454.     draw_save_column2(contents.width/2+16, line_height*7, contents.width/2-48)
  455.   end
  456.  
  457. end # Window_FileStatus
  458.  
  459. #==============================================================================
  460. # ?! Window_FileAction
  461. #==============================================================================
  462.  
  463. class Window_FileAction < Window_HorzCommand
  464.  
  465.   #--------------------------------------------------------------------------
  466.   # initialize
  467.   #--------------------------------------------------------------------------
  468.   def initialize(dx, dy, file_window)
  469.     @file_window = file_window
  470.     super(dx, dy)
  471.     deactivate
  472.     unselect
  473.   end
  474.  
  475.   #--------------------------------------------------------------------------
  476.   # window_width
  477.   #--------------------------------------------------------------------------
  478.   def window_width; Graphics.width - 128; end
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # col_max
  482.   #--------------------------------------------------------------------------
  483.   def col_max; return 3; end
  484.  
  485.   #--------------------------------------------------------------------------
  486.   # update
  487.   #--------------------------------------------------------------------------
  488.   def update
  489.     super
  490.     return if @file_window.index < 0
  491.     return if @current_index == @file_window.index
  492.     @current_index = @file_window.index
  493.     refresh
  494.   end
  495.  
  496.   #--------------------------------------------------------------------------
  497.   # make_command_list
  498.   #--------------------------------------------------------------------------
  499.   def make_command_list
  500.     @header = DataManager.load_header(@file_window.index)
  501.     add_load_command
  502.     add_save_command
  503.     add_delete_command
  504.   end
  505.  
  506.   #--------------------------------------------------------------------------
  507.   # add_load_command
  508.   #--------------------------------------------------------------------------
  509.   def add_load_command
  510.     add_command(YEA::SAVE::ACTION_LOAD, :load, load_enabled?)
  511.   end
  512.  
  513.   #--------------------------------------------------------------------------
  514.   # load_enabled?
  515.   #--------------------------------------------------------------------------
  516.   def load_enabled?
  517.     return false if @header.nil?
  518.     return true
  519.   end
  520.  
  521.   #--------------------------------------------------------------------------
  522.   # add_save_command
  523.   #--------------------------------------------------------------------------
  524.   def add_save_command
  525.     add_command(YEA::SAVE::ACTION_SAVE, :save, save_enabled?)
  526.   end
  527.  
  528.   #--------------------------------------------------------------------------
  529.   # save_enabled?
  530.   #--------------------------------------------------------------------------
  531.   def save_enabled?
  532.     return false if @header.nil? && SceneManager.scene_is?(Scene_Load)
  533.     return false if SceneManager.scene_is?(Scene_Load)
  534.     return false if $game_system.save_disabled
  535.     return true
  536.   end
  537.  
  538.   #--------------------------------------------------------------------------
  539.   # add_delete_command
  540.   #--------------------------------------------------------------------------
  541.   def add_delete_command
  542.     add_command(YEA::SAVE::ACTION_DELETE, :delete, delete_enabled?)
  543.   end
  544.  
  545.   #--------------------------------------------------------------------------
  546.   # delete_enabled?
  547.   #--------------------------------------------------------------------------
  548.   def delete_enabled?
  549.     return false if @header.nil?
  550.     return true
  551.   end
  552.  
  553.   #--------------------------------------------------------------------------
  554.   # update_help
  555.   #--------------------------------------------------------------------------
  556.   def update_help
  557.     case current_symbol
  558.     when :load; @help_window.set_text(YEA::SAVE::LOAD_HELP)
  559.     when :save; @help_window.set_text(YEA::SAVE::SAVE_HELP)
  560.     when :delete; @help_window.set_text(YEA::SAVE::DELETE_HELP)
  561.     end
  562.   end
  563.  
  564. end # Window_FileAction
  565.  
  566. #==============================================================================
  567. # ?! Scene_File
  568. #==============================================================================
  569.  
  570. class Scene_File < Scene_MenuBase
  571.  
  572.   #--------------------------------------------------------------------------
  573.   # overwrite method: start
  574.   #--------------------------------------------------------------------------
  575.   def start
  576.     super
  577.     create_all_windows
  578.   end
  579.  
  580.   #--------------------------------------------------------------------------
  581.   # overwrite method: terminate
  582.   #--------------------------------------------------------------------------
  583.   def terminate
  584.     super
  585.   end
  586.  
  587.   #--------------------------------------------------------------------------
  588.   # overwrite method: update
  589.   #--------------------------------------------------------------------------
  590.   def update
  591.     super
  592.   end
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # new method: create_all_windows
  596.   #--------------------------------------------------------------------------
  597.   def create_all_windows
  598.     create_help_window
  599.     create_file_window
  600.     create_action_window
  601.     create_status_window
  602.   end
  603.  
  604.   #--------------------------------------------------------------------------
  605.   # overwrite method: create_help_window
  606.   #--------------------------------------------------------------------------
  607.   def create_help_window
  608.     @help_window = Window_Help.new
  609.     @help_window.set_text(YEA::SAVE::SELECT_HELP)
  610.   end
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # new method: create_file_window
  614.   #--------------------------------------------------------------------------
  615.   def create_file_window
  616.     wy = @help_window.height
  617.     @file_window = Window_FileList.new(0, wy)
  618.     @file_window.set_handler(:ok, method(:on_file_ok))
  619.     @file_window.set_handler(:cancel, method(:return_scene))
  620.   end
  621.  
  622.   #--------------------------------------------------------------------------
  623.   # new method: create_action_window
  624.   #--------------------------------------------------------------------------
  625.   def create_action_window
  626.     wx = @file_window.width
  627.     wy = @help_window.height
  628.     @action_window = Window_FileAction.new(wx, wy, @file_window)
  629.     @action_window.help_window = @help_window
  630.     @action_window.set_handler(:cancel, method(:on_action_cancel))
  631.     @action_window.set_handler(:load, method(:on_action_load))
  632.     @action_window.set_handler(:save, method(:on_action_save))
  633.     @action_window.set_handler(:delete, method(:on_action_delete))
  634.   end
  635.  
  636.   #--------------------------------------------------------------------------
  637.   # new method: create_status_window
  638.   #--------------------------------------------------------------------------
  639.   def create_status_window
  640.     wx = @action_window.x
  641.     wy = @action_window.y + @action_window.height
  642.     @status_window = Window_FileStatus.new(wx, wy, @file_window)
  643.   end
  644.  
  645.   #--------------------------------------------------------------------------
  646.   # new method: on_file_ok
  647.   #--------------------------------------------------------------------------
  648.   def on_file_ok
  649.     @action_window.activate
  650.     index = SceneManager.scene_is?(Scene_Load) ? 0 : 1
  651.     @action_window.select(index)
  652.   end
  653.  
  654.   #--------------------------------------------------------------------------
  655.   # new method: on_action_cancel
  656.   #--------------------------------------------------------------------------
  657.   def on_action_cancel
  658.     @action_window.unselect
  659.     @file_window.activate
  660.     @help_window.set_text(YEA::SAVE::SELECT_HELP)
  661.   end
  662.  
  663.   #--------------------------------------------------------------------------
  664.   # new method: on_action_load
  665.   #--------------------------------------------------------------------------
  666.   def on_action_load
  667.     if DataManager.load_game(@file_window.index)
  668.       on_load_success
  669.     else
  670.       Sound.play_buzzer
  671.     end
  672.   end
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # overwrite method: on_load_success
  676.   #--------------------------------------------------------------------------
  677.   def on_load_success
  678.     Sound.play_load
  679.     fadeout_all
  680.     $game_system.on_after_load
  681.     SceneManager.goto(Scene_Map)
  682.   end
  683.  
  684.   #--------------------------------------------------------------------------
  685.   # new method: on_action_save
  686.   #--------------------------------------------------------------------------
  687.   def on_action_save
  688.     @action_window.activate
  689.     if DataManager.save_game(@file_window.index)
  690.       on_save_success
  691.       refresh_windows
  692.     else
  693.       Sound.play_buzzer
  694.     end
  695.   end
  696.  
  697.   #--------------------------------------------------------------------------
  698.   # overwrite method: on_save_success
  699.   #--------------------------------------------------------------------------
  700.   def on_save_success; Sound.play_save; end
  701.  
  702.   #--------------------------------------------------------------------------
  703.   # new method: on_action_delete
  704.   #--------------------------------------------------------------------------
  705.   def on_action_delete
  706.     @action_window.activate
  707.     DataManager.delete_save_file(@file_window.index)
  708.     on_delete_success
  709.     refresh_windows
  710.   end
  711.  
  712.   #--------------------------------------------------------------------------
  713.   # new method: on_delete_success
  714.   #--------------------------------------------------------------------------
  715.   def on_delete_success
  716.     YEA::SAVE::DELETE_SOUND.play
  717.   end
  718.  
  719.   #--------------------------------------------------------------------------
  720.   # new method: refresh_windows
  721.   #--------------------------------------------------------------------------
  722.   def refresh_windows
  723.     @file_window.refresh
  724.     @action_window.refresh
  725.     @status_window.refresh
  726.   end
  727.  
  728. end # Scene_File
  729.  
  730. #==============================================================================
  731. # ?! Scene_Save
  732. #==============================================================================
  733.  
  734. class Scene_Save < Scene_File
  735.  
  736.   #--------------------------------------------------------------------------
  737.   # overwrite method: on_savefile_ok
  738.   #--------------------------------------------------------------------------
  739.   def on_savefile_ok; super; end
  740.  
  741.   #--------------------------------------------------------------------------
  742.   # overwrite method: on_save_success
  743.   #--------------------------------------------------------------------------
  744.   def on_save_success; super; end
  745.  
  746. end # help_window_text
  747.  
  748. #==============================================================================
  749. # ?! Scene_Load
  750. #==============================================================================
  751.  
  752. class Scene_Load < Scene_File
  753.  
  754.   #--------------------------------------------------------------------------
  755.   # overwrite method: on_savefile_ok
  756.   #--------------------------------------------------------------------------
  757.   def on_savefile_ok; super; end
  758.  
  759.   #--------------------------------------------------------------------------
  760.   # overwrite method: on_load_success
  761.   #--------------------------------------------------------------------------
  762.   def on_load_success; super; end
  763.  
  764. end # Scene_Load
  765.  
  766. #==============================================================================
  767. #
  768. # ?\ End of File
  769. #
  770. #==============================================================================





RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ 养肥系统 AceEngine Ace - 存档系统插件: 开始新游戏增强 v1.00
  4. # -- 最终更新: 2011.12.26
  5. # -- 等级: 普通人能够用的脚本
  6. # -- 要求插入脚本: YEA - Ace Save Engine v1.01+
  7. # -- 无节操的顺手翻译: 喵呜喵5
  8. #
  9. #==============================================================================
  10.  
  11. $imported = {} if $imported.nil?
  12. $imported["YEA-NewGame+"] = true
  13.  
  14. #==============================================================================
  15. # ▼ 更新日志
  16. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  17. # 2011.12.26 - 开始写并且写完了~#
  18. #==============================================================================
  19. # ▼ 介绍
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # 这脚本能够实现继承存档的功能,详细的说明太长懒得翻译
  22. #
  23. #==============================================================================
  24. # ▼ 使用方法
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. # 脚本扔到▼ Materials/素材 下 ▼ Main 以上
  27. # 记得保存,总之就是个没啥特殊用法的脚本啦
  28. #
  29. # -----------------------------------------------------------------------------
  30. # 物品备注 - 如果把下面的<no carry over>扔到对应物品的备注栏里
  31. # -----------------------------------------------------------------------------
  32. # <no carry over>
  33. #
  34. # 就不会被继承到新游戏中了
  35. #
  36. # -----------------------------------------------------------------------------
  37. # 武器备注 - 同上
  38. # -----------------------------------------------------------------------------
  39. # <no carry over>
  40. #
  41. # -----------------------------------------------------------------------------
  42. # 防具备注 - 同上
  43. # -----------------------------------------------------------------------------
  44. # <no carry over>
  45. #
  46. #==============================================================================
  47. # ▼ 注意
  48. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  49. # 这是VA脚本不是VX脚本#
  50. #
  51. # 这脚本还需要养肥引擎脚本Yanfly Engine Ace - Ace Save Engine v1.01+
  52. # 并且在编辑器中的位置必须比引擎脚本更下
  53. #
  54. #==============================================================================
  55.  
  56. module YEA
  57.   module NEW_GAME_PLUS
  58.  
  59.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  60.     # - 普通设置 -
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     # 帮助文字
  63.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  64.     NGP_SWITCH = 1      # 开关打开的时候存档将显示周目标志.
  65.     NGP_TEXT   = "可继承"   # 显示周目标志的文字.
  66.  
  67.     # 能够继承存档的时候帮助窗口的提示文字   
  68.     NGP_HELP   = "使用这个存档开始游戏."
  69.  
  70.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  71.     # - 需要继承的内容 -
  72.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  73.     # 看清楚了再设置
  74.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  75.     # 需要继承的开关
  76.     CARRY_OVER_SWITCHES = [14]
  77.  
  78.     # 需要继承的变量
  79.     CARRY_OVER_VARIABLES = [1,2]
  80.  
  81.     # 设置成 false 的话不继承角色信息
  82.     CARRY_OVER_ACTORS = true
  83.  
  84.     # 继承角色等级、继承角色装备、继承角色技能
  85.     # 上面那个角色信息不继承的话这下面三个也继承不了
  86.     CARRY_OVER_LEVELS = true
  87.     CARRY_OVER_EQUIPS = true
  88.     CARRY_OVER_SKILLS = true
  89.  
  90.     # 继承队伍成员
  91.     CARRY_OVER_PARTY_MEMBERS = false
  92.  
  93.     # 继承金钱、物品、道具、装备
  94.     CARRY_OVER_GOLD    = true
  95.     CARRY_OVER_ITEMS   = true
  96.     CARRY_OVER_WEAPONS = true
  97.     CARRY_OVER_ARMOURS = true
  98.  
  99.   end # 别理这行
  100. end # 也别理这行
  101.  
  102. #==============================================================================
  103. # ▼ 看不懂的话就别碰这以下的脚本了
  104. #==============================================================================
  105. #==============================================================================
  106. # ▼ Editting anything past this point may potentially result in causing
  107. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  108. # halitosis so edit at your own risk.
  109. #==============================================================================
  110.  
  111. if $imported["YEA-SaveEngine"]
  112.  
  113. module YEA
  114.   module NEW_GAME_PLUS
  115.     module_function
  116.     #--------------------------------------------------------------------------
  117.     # convert_integer_array
  118.     #--------------------------------------------------------------------------
  119.     def convert_integer_array(array)
  120.       result = []
  121.       array.each { |i|
  122.         case i
  123.         when Range; result |= i.to_a
  124.         when Integer; result |= [i]
  125.         end }
  126.       return result
  127.     end
  128.     #--------------------------------------------------------------------------
  129.     # converted_contants
  130.     #--------------------------------------------------------------------------
  131.     CARRY_OVER_SWITCHES = convert_integer_array(CARRY_OVER_SWITCHES)
  132.     CARRY_OVER_VARIABLES = convert_integer_array(CARRY_OVER_VARIABLES)
  133.   end # NEW_GAME_PLUS
  134.   module REGEXP
  135.   module BASEITEM
  136.  
  137.     NO_CARRY_OVER = /<(?:NO_CARRY_OVER|no carry over)>/i
  138.  
  139.   end # BASEITEM
  140.   end # REGEXP
  141. end # YEA
  142.  
  143. #==============================================================================
  144. # ■ DataManager
  145. #==============================================================================
  146.  
  147. module DataManager
  148.  
  149.   #--------------------------------------------------------------------------
  150.   # alias method: load_database
  151.   #--------------------------------------------------------------------------
  152.   class <<self; alias load_database_ngp load_database; end
  153.   def self.load_database
  154.     load_database_ngp
  155.     load_notetags_ngp
  156.   end
  157.  
  158.   #--------------------------------------------------------------------------
  159.   # new method: load_notetags_ngp
  160.   #--------------------------------------------------------------------------
  161.   def self.load_notetags_ngp
  162.     groups = [$data_items, $data_weapons, $data_armors]
  163.     for group in groups
  164.       for obj in group
  165.         next if obj.nil?
  166.         obj.load_notetags_ngp
  167.       end
  168.     end
  169.   end
  170.  
  171. end # DataManager
  172.  
  173. #==============================================================================
  174. # ■ RPG::BaseItem
  175. #==============================================================================
  176.  
  177. class RPG::BaseItem
  178.  
  179.   #--------------------------------------------------------------------------
  180.   # public instance variables
  181.   #--------------------------------------------------------------------------
  182.   attr_accessor :no_carry_over
  183.  
  184.   #--------------------------------------------------------------------------
  185.   # common cache: load_notetags_ngp
  186.   #--------------------------------------------------------------------------
  187.   def load_notetags_ngp
  188.     @no_carry_over = false
  189.     #---
  190.     self.note.split(/[\r\n]+/).each { |line|
  191.       case line
  192.       #---
  193.       when YEA::REGEXP::BASEITEM::NO_CARRY_OVER
  194.         @no_carry_over = true
  195.       end
  196.     } # self.note.split
  197.     #---
  198.   end
  199.  
  200. end # RPG::BaseItem
  201.  
  202. #==============================================================================
  203. # ■ Switch
  204. #==============================================================================
  205.  
  206. module Switch
  207.  
  208.   #--------------------------------------------------------------------------
  209.   # self.new_game_plus
  210.   #--------------------------------------------------------------------------
  211.   def self.new_game_plus
  212.     return $game_switches[YEA::NEW_GAME_PLUS::NGP_SWITCH]
  213.   end
  214.  
  215. end # Switch
  216.  
  217. #==============================================================================
  218. # ■ DataManager
  219. #==============================================================================
  220.  
  221. module DataManager
  222.  
  223.   #--------------------------------------------------------------------------
  224.   # new method: setup_new_game_plus
  225.   #--------------------------------------------------------------------------
  226.   def self.setup_new_game_plus(index)
  227.     create_new_game_plus_objects(index)
  228.     $game_map.setup($data_system.start_map_id)
  229.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  230.     $game_player.refresh
  231.     Graphics.frame_count = 0
  232.   end
  233.  
  234.   #--------------------------------------------------------------------------
  235.   # new method: create_new_game_plus_objects
  236.   #--------------------------------------------------------------------------
  237.   def self.create_new_game_plus_objects(index)
  238.     load_game_without_rescue(index)
  239.     ngp_reset_switches
  240.     ngp_reset_variables
  241.     ngp_reset_self_switches
  242.     ngp_reset_actors
  243.     ngp_reset_party
  244.   end
  245.  
  246.   #--------------------------------------------------------------------------
  247.   # new method: ngp_reset_switches
  248.   #--------------------------------------------------------------------------
  249.   def self.ngp_reset_switches
  250.     for i in 0...$data_system.switches.size
  251.       next if i <= 0
  252.       next if YEA::NEW_GAME_PLUS::CARRY_OVER_SWITCHES.include?(i)
  253.       $game_switches[i] = false
  254.     end
  255.   end
  256.  
  257.   #--------------------------------------------------------------------------
  258.   # new method: ngp_reset_variables
  259.   #--------------------------------------------------------------------------
  260.   def self.ngp_reset_variables
  261.     for i in 0...$data_system.variables.size
  262.       next if i <= 0
  263.       next if YEA::NEW_GAME_PLUS::CARRY_OVER_VARIABLES.include?(i)
  264.       $game_variables[i] = 0
  265.     end
  266.   end
  267.  
  268.   #--------------------------------------------------------------------------
  269.   # new method: ngp_reset_self_switches
  270.   #--------------------------------------------------------------------------
  271.   def self.ngp_reset_self_switches
  272.     $game_self_switches = Game_SelfSwitches.new
  273.   end
  274.  
  275.   #--------------------------------------------------------------------------
  276.   # new method: ngp_reset_actors
  277.   #--------------------------------------------------------------------------
  278.   def self.ngp_reset_actors
  279.     unless YEA::NEW_GAME_PLUS::CARRY_OVER_ACTORS
  280.       $game_actors = Game_Actors.new
  281.     else
  282.       #---
  283.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_LEVELS
  284.         for i in 0...$data_actors.size
  285.           actor = $game_actors[i]
  286.           next if actor.nil?
  287.           actor.new_game_plus_levels
  288.         end
  289.       end
  290.       #---
  291.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_EQUIPS
  292.         for i in 0...$data_actors.size
  293.           actor = $game_actors[i]
  294.           next if actor.nil?
  295.           actor.new_game_plus_equips
  296.         end
  297.       end
  298.       #---
  299.       unless YEA::NEW_GAME_PLUS::CARRY_OVER_SKILLS
  300.         for i in 0...$data_actors.size
  301.           actor = $game_actors[i]
  302.           next if actor.nil?
  303.           actor.new_game_plus_skills
  304.         end
  305.       end
  306.       #---
  307.     end
  308.   end
  309.  
  310.   #--------------------------------------------------------------------------
  311.   # new method: ngp_reset_party
  312.   #--------------------------------------------------------------------------
  313.   def self.ngp_reset_party
  314.     gold = 0
  315.     items = {}
  316.     members = []
  317.     #---
  318.     if YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
  319.       for member in $game_party.members
  320.         members.push(member.id)
  321.       end
  322.     end
  323.     #---
  324.     gold = $game_party.gold if YEA::NEW_GAME_PLUS::CARRY_OVER_GOLD
  325.     #---
  326.     if YEA::NEW_GAME_PLUS::CARRY_OVER_ITEMS
  327.       for item in $data_items
  328.         next if item.nil?
  329.         next if item.no_carry_over
  330.         items[item] = $game_party.item_number(item)
  331.       end
  332.     end
  333.     #---
  334.     if YEA::NEW_GAME_PLUS::CARRY_OVER_WEAPONS
  335.       for item in $data_weapons
  336.         next if item.nil?
  337.         next if item.no_carry_over
  338.         items[item] = $game_party.item_number(item)
  339.       end
  340.     end
  341.     #---
  342.     if YEA::NEW_GAME_PLUS::CARRY_OVER_ARMOURS
  343.       for item in $data_armors
  344.         next if item.nil?
  345.         next if item.no_carry_over
  346.         items[item] = $game_party.item_number(item)
  347.       end
  348.     end
  349.     #---
  350.     $game_party = Game_Party.new
  351.     unless YEA::NEW_GAME_PLUS::CARRY_OVER_PARTY_MEMBERS
  352.       $game_party.setup_starting_members
  353.     end
  354.     #---
  355.     for member_id in members
  356.       $game_party.add_actor(member_id)
  357.     end
  358.     $game_party.gain_gold(gold)
  359.     for key in items
  360.       item = key[0]
  361.       next if item.nil?
  362.       $game_party.gain_item(item, key[1])
  363.     end
  364.   end
  365.  
  366. end # DataManager
  367.  
  368. #==============================================================================
  369. # ■ Game_Actor
  370. #==============================================================================
  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.     @level = actor.initial_level
  380.     @exp = {}
  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. #==============================================================================
  407. # ■ Window_FileAction
  408. #==============================================================================
  409.  
  410. class Window_FileAction < Window_HorzCommand
  411.  
  412.   #--------------------------------------------------------------------------
  413.   # alias method: add_load_command
  414.   #--------------------------------------------------------------------------
  415.   alias add_load_command_ngp add_load_command
  416.   def add_load_command
  417.     if new_game_plus?
  418.       add_command(YEA::NEW_GAME_PLUS::NGP_TEXT, :new_game_plus)
  419.     else
  420.       add_load_command_ngp
  421.     end
  422.   end
  423.  
  424.   #--------------------------------------------------------------------------
  425.   # new method: new_game_plus?
  426.   #--------------------------------------------------------------------------
  427.   def new_game_plus?
  428.     return false if @header.nil?
  429.     return false if @header[:switches].nil?
  430.     return @header[:switches][YEA::NEW_GAME_PLUS::NGP_SWITCH]
  431.   end
  432.  
  433.   #--------------------------------------------------------------------------
  434.   # alias method: update_help
  435.   #--------------------------------------------------------------------------
  436.   alias update_help_ngp update_help
  437.   def update_help
  438.     case current_symbol
  439.     when :new_game_plus; @help_window.set_text(YEA::NEW_GAME_PLUS::NGP_HELP)
  440.     else; update_help_ngp
  441.     end
  442.   end
  443.  
  444. end # Window_FileAction
  445.  
  446. #==============================================================================
  447. # ■ Scene_File
  448. #==============================================================================
  449.  
  450. class Scene_File < Scene_MenuBase
  451.  
  452.   #--------------------------------------------------------------------------
  453.   # alias method: create_action_window
  454.   #--------------------------------------------------------------------------
  455.   alias create_action_window_ngp create_action_window
  456.   def create_action_window
  457.     create_action_window_ngp
  458.     @action_window.set_handler(:new_game_plus, method(:on_action_ngp))
  459.   end
  460.  
  461.   #--------------------------------------------------------------------------
  462.   # new method: on_action_ngp
  463.   #--------------------------------------------------------------------------
  464.   def on_action_ngp
  465.     Sound.play_load
  466.     DataManager.setup_new_game_plus(@file_window.index)
  467.     fadeout_all
  468.     $game_system.on_after_load
  469.     SceneManager.goto(Scene_Map)
  470.   end
  471.  
  472. end # Scene_File
  473.  
  474. end # $imported["YEA-SaveEngine"]
  475.  
  476. #==============================================================================
  477. #
  478. # ▼ End of File
  479. #
  480. #==============================================================================
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 07:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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