| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 3 |
| 经验 | |
| 最后登录 | 2022-8-10 |
| 在线时间 | 271 小时 |
- 梦石
- 0
- 星屑
- 284
- 在线时间
- 271 小时
- 注册时间
- 2013-4-23
- 回帖
- 122
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 Sion 于 2014-4-8 18:10 编辑
有關VA的二周目方法我找了半天,沒幾個帖有中文介紹二周目的腳本或方法
太令人傷心吧
免得有好像有我一樣的事件廢,腳本廢,伸手黨,超級新手小白等等四處不停地問二周目的方法
我開一開帖把找到的分享和討論一下
(有錯出聲勿插,我只是分享下資料也不是偷別人的東西.....)
(原本是想開在[RPG Maker 技术讨论区]的可是那兒好想沒多少新人看....?所以發到這兒了)
先簡單,後複雜
方法一:关闭所有开关、独立开关,清理变量
(來源:http://rpg.blue/thread-289239-1-1.html 4樓)
通關後,问是否进入二周目
选是的话就关闭所有开关、独立开关还有清理变量
脚本:(在事件中使用)
[pre lang="ruby" line="1"]$game_self_switches.instance_eval { @data.clear }
$game_switches.instance_eval { @data.clear }
$game_variables.instance_eval { @data.clear }
[/pre]可能遇到的問題請看:http://rpg.blue/thread-276636-1-1.html
之后场所移动到某空白地图,
打开存档页面让玩家存档,
之后结束游戏
然后那个空白地图就设置一个自动事件,场所移动到初始地图
效果&合適對象:
直接在同一個存檔繼承二周目的方法,最方便快捷的方法
可是並非真正開新遊戲的二周目,可以說是假的方法
適合一些對二周目需求不大的游戲,或是懶人
方法二:创建N周目判定文件
(原教程:http://tieba.baidu.com/p/2201253419#30136627140l BY极光涵影)
首先把腳本中[DataManager]的[設定新游戲]部分改一改(約第99行)
原碼:
[pre lang="ruby" line="99"]def self.setup_new_game
create_game_objects
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
Graphics.frame_count = 0
end [/pre]
改為:
[pre lang="ruby" line="1"] def self.setup_new_game
if FileTest.exist?("FinishedA.rvdata2") #如果多周目就按照A B的排序方式自己向下建
create_game_objects
$game_party.setup_starting_members
$game_map.setup(3) #括号内的事二周目初始位置地图ID
$game_player.moveto(8, 6) #括号里面是新地图的初始位置XY坐标 自己调整
$game_player.refresh
Graphics.frame_count = 0
else
create_game_objects
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
Graphics.frame_count = 0
end
end[/pre]
在通关时的事件中加插下方的脚本[*1]
[pre lang="ruby" line="1"]file = File.open("FinishedA.rvdata2", "wb")
Marshal.dump($game_variables, file) #變量
file.close[/pre]
效果&合適對象:
當你在通关时的事件用了[*1]的腳本後,
腳本運行會做出一個叫"Finished(X).rvdata2"的檔案 [(X)為你自己設定的第N周目]
之後開新游戏時,會判定是否有N周目的文件,若存在则更改主角初始位置
在新地圖设置开关开启,达到二周目隐藏事件的效果
適合需要到變量繼承的遊戲,如果是一些事件式標題可以乘機在二周目改變樣式
方法三:通关次數变量
這個嘛……小的事實其實對這個方法看了也是一知半解不是完全明白_(:3」 ∠)_
看官請自行到有關原帖了解
(http://rpg.blue/thread-286862-1-1.html 3樓)
不過原理大約和方法二差不多,只是它是記錄通关次數变量的
之後。。。。
放上懶人期待的 Yanfly VA二周目腳本
對了其實這個是某VA整合版中的腳本
小的為了研究如何便用這東西把它意譯了
觸發這個腳本的方法已經找到....
大家眼殘看少一句必要的腳本要一起使用
YEA - Ace Save Engine v1.01+(簡單來說他自家的VA存檔強化腳本)
可是用了這個便不能用截图存档了~
Yanfly VA二周目原腳本:
[pre lang="ruby" line="1"]#==============================================================================
#
# ▼ 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]
意譯後:
[pre lang="ruby" line="1"]#==============================================================================
#
# ▼ Yanfly引擎ACE - 附加儲存引擎:New Game+ V1.00
# - 最後更新:2011.12.26
# - 等級:普通
# - 需要:YEA - Ace Save Engine v1.01+
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-NewGame+"] = true
#==============================================================================
# ▼ 更新
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.26 - 完成成品
#
#==============================================================================
# ▼ 簡介
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# New Game+ 是一個很好的腳本為您的遊戲增加重玩的要素。它可以讓玩家以不同的方式
# 重新體驗遊戲。功能為繼承物品,轉換成員,技能保留,保存變量,開關等。存在很多
# 選項來改變你的遊戲。
#
#==============================================================================
# ▼ 說明
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 要使用此腳本,打開你的腳本編輯器和複製/粘貼此腳本
# 低於▼場景 但在 ▼ Main 之上 ,記得保存。
#
# -----------------------------------------------------------------------------
# 物品 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.
#
# -----------------------------------------------------------------------------
# 武器 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.
#
# -----------------------------------------------------------------------------
# 裝備 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.
#
#==============================================================================
# ▼ 兼容性
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 這個腳本是 RPG Maker VX Ace 專用.這是極不可能的用在 RPG Maker VX
#
#
# 這個腳本需要 Yanfly Engine Ace - Ace Save Engine v1.01+
# 腳本必須放在腳本列表中 Ace Save 引擎之下.
#
#==============================================================================
module YEA
module NEW_GAME_PLUS
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# -常規設置 -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# 說明
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NGP_SWITCH = 203 # 如果開關ON,遊戲文件有NG +標誌。
NGP_TEXT = "周目" # Text 用來顯示新周目。
# 這是幫助窗口(提示的字樣?)的字句用於新周目上當有新周目時
# 選項是突出。(?)
NGP_HELP = "继承新存档."
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Carry Over 設置 -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# 這些設置調整是很關鍵的所以要仔細調整
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# 這個數組包含了所有的開關都你要繼承的,任何開關在這裡都不會將被設置為 false(關閉)。
#
CARRY_OVER_SWITCHES = [3, 6, 7,12,15,16,17,18]
# 這個數組包含了所有的變量都你要繼承的,任何開關在這裡都不會將被設置為0。
#
CARRY_OVER_VARIABLES = [1,2,3,4,5]
# 如果此設置為false,那麼角色的能力便會初始化(完全復位)
# 如果設置為true,角色的能力便會保持
#
CARRY_OVER_ACTORS = true
#如果你要繼承角色數值,可以限制或調整什麼樣的細節
#
#
CARRY_OVER_LEVELS = true
CARRY_OVER_EQUIPS = true
CARRY_OVER_SKILLS = true
# 如果此設置為false,那麼將恢復本來的隊伍設定
# 如果此設置為true, 那麼將保留通關時的隊伍
#
CARRY_OVER_PARTY_MEMBERS = true
# 如果其中任何一個設置為false,那麼相應的項目將不會被繼承
# 如果其中任何一個設置為true,那麼相應的項目將會被繼承
# (順序:金錢,物品,武器,裝備)
CARRY_OVER_GOLD = true
CARRY_OVER_ITEMS = true
CARRY_OVER_WEAPONS = true
CARRY_OVER_ARMOURS = true
end # NEW_GAME_PLUS
end # YEA
#==============================================================================
# ▼編輯下面任何東西,
# 可能會導致造成電腦受損,使用者大小便失禁,昏迷,爆炸的死亡,和/或口臭
# 請自行評估風險
#==============================================================================
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]
YEA - Ace Save Engine v1.01+(存檔強化腳本):
(如果要用上上面的腳本一定要用上這一個)
[pre lang="ruby" line="1"]#==============================================================================
#
# ?\ Yanfly Engine Ace - Ace Save Engine v1.03
# -- Last Updated: 2012.07.22
# -- Level: Normal
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-SaveEngine"] = true
#==============================================================================
# ?\ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.07.22 - Fixed: Location Drawing.
# 2012.01.23 - Anti-crash method added for removed maps.
# 2011.12.26 - Compatibility Update: New Game+
# 2011.12.26 - Started Script and Finished.
#
#==============================================================================
# ?\ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script provides a new save interface for the player. Along with a new
# interface, the player can also load and delete saves straight from the menu
# itself. This will in turn make the save command from the Main Menu always
# available, but the save option within the new save menu will be enabled
# depending on whether or not it is allowed or disallowed. From the interface,
# the player is given more information regarding the save file including the
# the location the player saved at, the amount of gold available, and any
# variables that you want to show the player as well.
#
#==============================================================================
# ?\ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ?\ Materials/ef?T but above ?\ Main. Remember to save.
#
# For first time installers, be warned that loading this script the first time
# may not display all information in the status window for save files made
# before the installation of this script. To remedy this, just load up the save
# and save the file again.
#
#==============================================================================
# ?\ 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.
#
#==============================================================================
module YEA
module SAVE
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Slot Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This section adjusts how the slot window appears on the left side of the
# screen. This also adjusts the maximum number of saves a player can make,
# the way the slot names appear, and the icons used.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MAX_FILES = 24 # Maximum saves a player can make. Default: 16
SLOT_NAME = "File %s" # How the file slots will be named.
# These are the icons
SAVE_ICON = 368 # Icon used to indicate a save is present.
EMPTY_ICON = 375 # Icon used to indicate an empty file.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Action Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This section adjusts how the action window appears, the sound effect
# played when deleting files, and what appears in the help window above.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ACTION_LOAD = "Load" # Text used for loading games.
ACTION_SAVE = "Save" # Text used for saving games.
ACTION_DELETE = "Delete" # Text used for deleting games.
DELETE_SOUND = RPG::SE.new("Collapse3", 100, 100) # Sound for deleting.
# These text settings adjust what displays in the help window.
SELECT_HELP = "Please select a file slot."
LOAD_HELP = "Loads the data from the saved game."
SAVE_HELP = "Saves the current progress in your game."
DELETE_HELP = "Deletes all data from this save file."
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Status Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This section adjusts how the status window appears in the middle of the
# screen (that displays the game's data) such as the total playtime, total
# times saved, total gold, the party's current location, and the variables
# to be displayed.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
EMPTY_TEXT = "No Save Data" # Text used when no save data is present.
PLAYTIME = "Playtime" # Text used for total playtime.
TOTAL_SAVE = "Total Saves: " # Text used to indicate total saves.
TOTAL_GOLD = "Total Gold: " # Text used to indicate total gold.
LOCATION = "Location: " # Text used to indicate current location.
# These variables will be shown in each of the two columns for those who
# would want to display more information than just what's shown. Input the
# variables into the arrays below to designate what data will be shown.
COLUMN1_VARIABLES = [1, 2, 3]
COLUMN2_VARIABLES = [4, 5, 6]
end # SAVE
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.
#==============================================================================
#==============================================================================
# ?! Icon
#==============================================================================
module Icon
#--------------------------------------------------------------------------
# self.save_icon
#--------------------------------------------------------------------------
def self.save_icon; return YEA::SAVE::SAVE_ICON; end
#--------------------------------------------------------------------------
# self.empty_icon
#--------------------------------------------------------------------------
def self.empty_icon; return YEA::SAVE::EMPTY_ICON; end
end # Icon
#==============================================================================
# ?! Numeric
#==============================================================================
class Numeric
#--------------------------------------------------------------------------
# new method: group_digits
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def group; return self.to_s; end
end # $imported["YEA-CoreEngine"]
end # Numeric
#==============================================================================
# ?! DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# overwrite method: savefile_max
#--------------------------------------------------------------------------
def self.savefile_max
return YEA::SAVE::MAX_FILES
end
#--------------------------------------------------------------------------
# overwrite method: self.make_save_header
#--------------------------------------------------------------------------
def self.make_save_header
header = {}
header[:characters] = $game_party.characters_for_savefile
header[:playtime_s] = $game_system.playtime_s
header[:system] = Marshal.load(Marshal.dump($game_system))
header[:timer] = Marshal.load(Marshal.dump($game_timer))
header[:message] = Marshal.load(Marshal.dump($game_message))
header[:switches] = Marshal.load(Marshal.dump($game_switches))
header[:variables] = Marshal.load(Marshal.dump($game_variables))
header[:self_switches] = Marshal.load(Marshal.dump($game_self_switches))
header[:actors] = Marshal.load(Marshal.dump($game_actors))
header[:party] = Marshal.load(Marshal.dump($game_party))
header[:troop] = Marshal.load(Marshal.dump($game_troop))
header[:map] = Marshal.load(Marshal.dump($game_map))
header[:player] = Marshal.load(Marshal.dump($game_player))
header
end
end # DataManager
#==============================================================================
# ?! Window_MenuCommand
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# overwrite method: save_enabled
#--------------------------------------------------------------------------
def save_enabled; return true; end
end # Window_MenuCommand
#==============================================================================
# ?! Window_FileList
#==============================================================================
class Window_FileList < Window_Selectable
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(dx, dy)
super(dx, dy, 128, Graphics.height - dy)
refresh
activate
select(SceneManager.scene.first_savefile_index)
end
#--------------------------------------------------------------------------
# item_max
#--------------------------------------------------------------------------
def item_max; return DataManager.savefile_max; end
#--------------------------------------------------------------------------
# current_item_enabled?
#--------------------------------------------------------------------------
def current_item_enabled?
header = DataManager.load_header(index)
return false if header.nil? && SceneManager.scene_is?(Scene_Load)
return true
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
create_contents
draw_all_items
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
header = DataManager.load_header(index)
enabled = !header.nil?
rect = item_rect(index)
rect.width -= 4
draw_icon(save_icon?(header), rect.x, rect.y, enabled)
change_color(normal_color, enabled)
text = sprintf(YEA::SAVE::SLOT_NAME, (index + 1).group)
draw_text(rect.x+24, rect.y, rect.width-24, line_height, text)
end
#--------------------------------------------------------------------------
# save_icon?
#--------------------------------------------------------------------------
def save_icon?(header)
return Icon.empty_icon if header.nil?
return Icon.save_icon
end
end # Window_FileList
#==============================================================================
# ?! Window_FileStatus
#==============================================================================
class Window_FileStatus < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(dx, dy, file_window)
super(dx, dy, Graphics.width - dx, Graphics.height - dy)
@file_window = file_window
@current_index = @file_window.index
refresh
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
return if @file_window.index < 0
return if @current_index == @file_window.index
@current_index = @file_window.index
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
reset_font_settings
@header = DataManager.load_header(@file_window.index)
if @header.nil?
draw_empty
else
draw_save_contents
end
end
#--------------------------------------------------------------------------
# draw_empty
#--------------------------------------------------------------------------
def draw_empty
colour = Color.new(0, 0, 0, translucent_alpha/2)
rect = Rect.new(0, 0, contents.width, contents.height)
contents.fill_rect(rect, colour)
text = YEA::SAVE::EMPTY_TEXT
change_color(system_color)
draw_text(rect, text, 1)
end
#--------------------------------------------------------------------------
# draw_save_slot
#--------------------------------------------------------------------------
def draw_save_slot(dx, dy, dw)
reset_font_settings
change_color(system_color)
text = sprintf(YEA::SAVE::SLOT_NAME, "")
draw_text(dx, dy, dw, line_height, text)
cx = text_size(text).width
change_color(normal_color)
draw_text(dx+cx, dy, dw-cx, line_height, (@file_window.index+1).group)
end
#--------------------------------------------------------------------------
# draw_save_playtime
#--------------------------------------------------------------------------
def draw_save_playtime(dx, dy, dw)
return if @header[:playtime_s].nil?
reset_font_settings
change_color(system_color)
draw_text(dx, dy, dw, line_height, YEA::SAVE::PLAYTIME, 0)
change_color(normal_color)
draw_text(dx, dy, dw, line_height, @header[:playtime_s], 2)
end
#--------------------------------------------------------------------------
# draw_save_total_saves
#--------------------------------------------------------------------------
def draw_save_total_saves(dx, dy, dw)
return if @header[:system].nil?
reset_font_settings
change_color(system_color)
text = YEA::SAVE::TOTAL_SAVE
draw_text(dx, dy, dw, line_height, text)
cx = text_size(text).width
change_color(normal_color)
draw_text(dx+cx, dy, dw-cx, line_height, @header[:system].save_count.group)
end
#--------------------------------------------------------------------------
# draw_save_gold
#--------------------------------------------------------------------------
def draw_save_gold(dx, dy, dw)
return if @header[:party].nil?
reset_font_settings
change_color(system_color)
draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)
text = Vocab::currency_unit
draw_text(dx, dy, dw, line_height, text, 2)
cx = text_size(text).width
change_color(normal_color)
text = @header[:party].gold.group
draw_text(dx, dy, dw-cx, line_height, text, 2)
end
#--------------------------------------------------------------------------
# draw_save_location
#--------------------------------------------------------------------------
def draw_save_location(dx, dy, dw)
return if @header[:map].nil?
reset_font_settings
change_color(system_color)
draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION)
change_color(normal_color)
cx = text_size(YEA::SAVE::LOCATION).width
return if $data_mapinfos[@header[:map].map_id].nil?
text = @header[:map].display_name
text = $data_mapinfos[@header[:map].map_id].name if text == ""
draw_text(dx+cx, dy, dw-cx, line_height, text)
end
#--------------------------------------------------------------------------
# draw_save_characters
#--------------------------------------------------------------------------
def draw_save_characters(dx, dy)
return if @header[:party].nil?
reset_font_settings
make_font_smaller
dw = (contents.width - dx) / @header[:party].max_battle_members
dx += dw/2
for member in @header[:party].battle_members
next if member.nil?
member = @header[:actors][member.id]
change_color(normal_color)
draw_actor_graphic(member, dx, dy)
text = member.name
draw_text(dx-dw/2, dy, dw, line_height, text, 1)
text = member.level.group
draw_text(dx-dw/2, dy-line_height, dw-4, line_height, text, 2)
cx = text_size(text).width
change_color(system_color)
text = Vocab::level_a
draw_text(dx-dw/2, dy-line_height, dw-cx-4, line_height, text, 2)
dx += dw
end
end
#--------------------------------------------------------------------------
# draw_save_column1
#--------------------------------------------------------------------------
def draw_save_column1(dx, dy, dw)
data = YEA::SAVE::COLUMN1_VARIABLES
draw_column_data(data, dx, dy, dw)
end
#--------------------------------------------------------------------------
# draw_save_column2
#--------------------------------------------------------------------------
def draw_save_column2(dx, dy, dw)
data = YEA::SAVE::COLUMN2_VARIABLES
draw_column_data(data, dx, dy, dw)
end
#--------------------------------------------------------------------------
# draw_column_data
#--------------------------------------------------------------------------
def draw_column_data(data, dx, dy, dw)
return if @header[:variables].nil?
reset_font_settings
for variable_id in data
next if $data_system.variables[variable_id].nil?
change_color(system_color)
name = $data_system.variables[variable_id]
draw_text(dx, dy, dw, line_height, name, 0)
value = @header[:variables][variable_id].group
change_color(normal_color)
draw_text(dx, dy, dw, line_height, value, 2)
dy += line_height
end
end
#--------------------------------------------------------------------------
# draw_save_contents
#--------------------------------------------------------------------------
def draw_save_contents
draw_save_slot(4, 0, contents.width/2-8)
draw_save_playtime(contents.width/2+4, 0, contents.width/2-8)
draw_save_total_saves(4, line_height, contents.width/2-8)
draw_save_gold(contents.width/2+4, line_height, contents.width/2-8)
draw_save_location(4, line_height*2, contents.width-8)
draw_save_characters(0, line_height*5 + line_height/3)
draw_save_column1(16, line_height*7, contents.width/2-48)
draw_save_column2(contents.width/2+16, line_height*7, contents.width/2-48)
end
end # Window_FileStatus
#==============================================================================
# ?! Window_FileAction
#==============================================================================
class Window_FileAction < Window_HorzCommand
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(dx, dy, file_window)
@file_window = file_window
super(dx, dy)
deactivate
unselect
end
#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; Graphics.width - 128; end
#--------------------------------------------------------------------------
# col_max
#--------------------------------------------------------------------------
def col_max; return 3; end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
return if @file_window.index < 0
return if @current_index == @file_window.index
@current_index = @file_window.index
refresh
end
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
@header = DataManager.load_header(@file_window.index)
add_load_command
add_save_command
add_delete_command
end
#--------------------------------------------------------------------------
# add_load_command
#--------------------------------------------------------------------------
def add_load_command
add_command(YEA::SAVE::ACTION_LOAD, :load, load_enabled?)
end
#--------------------------------------------------------------------------
# load_enabled?
#--------------------------------------------------------------------------
def load_enabled?
return false if @header.nil?
return true
end
#--------------------------------------------------------------------------
# add_save_command
#--------------------------------------------------------------------------
def add_save_command
add_command(YEA::SAVE::ACTION_SAVE, :save, save_enabled?)
end
#--------------------------------------------------------------------------
# save_enabled?
#--------------------------------------------------------------------------
def save_enabled?
return false if @header.nil? && SceneManager.scene_is?(Scene_Load)
return false if SceneManager.scene_is?(Scene_Load)
return false if $game_system.save_disabled
return true
end
#--------------------------------------------------------------------------
# add_delete_command
#--------------------------------------------------------------------------
def add_delete_command
add_command(YEA::SAVE::ACTION_DELETE, :delete, delete_enabled?)
end
#--------------------------------------------------------------------------
# delete_enabled?
#--------------------------------------------------------------------------
def delete_enabled?
return false if @header.nil?
return true
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
case current_symbol
when :load; @help_window.set_text(YEA::SAVE::LOAD_HELP)
when :save; @help_window.set_text(YEA::SAVE::SAVE_HELP)
when :delete; @help_window.set_text(YEA::SAVE::DELETE_HELP)
end
end
end # Window_FileAction
#==============================================================================
# ?! Scene_File
#==============================================================================
class Scene_File < Scene_MenuBase
#--------------------------------------------------------------------------
# overwrite method: start
#--------------------------------------------------------------------------
def start
super
create_all_windows
end
#--------------------------------------------------------------------------
# overwrite method: terminate
#--------------------------------------------------------------------------
def terminate
super
end
#--------------------------------------------------------------------------
# overwrite method: update
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# new method: create_all_windows
#--------------------------------------------------------------------------
def create_all_windows
create_help_window
create_file_window
create_action_window
create_status_window
end
#--------------------------------------------------------------------------
# overwrite method: create_help_window
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_Help.new
@help_window.set_text(YEA::SAVE::SELECT_HELP)
end
#--------------------------------------------------------------------------
# new method: create_file_window
#--------------------------------------------------------------------------
def create_file_window
wy = @help_window.height
@file_window = Window_FileList.new(0, wy)
@file_window.set_handler(:ok, method(:on_file_ok))
@file_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# new method: create_action_window
#--------------------------------------------------------------------------
def create_action_window
wx = @file_window.width
wy = @help_window.height
@action_window = Window_FileAction.new(wx, wy, @file_window)
@action_window.help_window = @help_window
@action_window.set_handler(:cancel, method(:on_action_cancel))
@action_window.set_handler(:load, method(:on_action_load))
@action_window.set_handler(:save, method(:on_action_save))
@action_window.set_handler(:delete, method(:on_action_delete))
end
#--------------------------------------------------------------------------
# new method: create_status_window
#--------------------------------------------------------------------------
def create_status_window
wx = @action_window.x
wy = @action_window.y + @action_window.height
@status_window = Window_FileStatus.new(wx, wy, @file_window)
end
#--------------------------------------------------------------------------
# new method: on_file_ok
#--------------------------------------------------------------------------
def on_file_ok
@action_window.activate
index = SceneManager.scene_is?(Scene_Load) ? 0 : 1
@action_window.select(index)
end
#--------------------------------------------------------------------------
# new method: on_action_cancel
#--------------------------------------------------------------------------
def on_action_cancel
@action_window.unselect
@file_window.activate
@help_window.set_text(YEA::SAVE::SELECT_HELP)
end
#--------------------------------------------------------------------------
# new method: on_action_load
#--------------------------------------------------------------------------
def on_action_load
if DataManager.load_game(@file_window.index)
on_load_success
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# overwrite method: on_load_success
#--------------------------------------------------------------------------
def on_load_success
Sound.play_load
fadeout_all
$game_system.on_after_load
SceneManager.goto(Scene_Map)
end
#--------------------------------------------------------------------------
# new method: on_action_save
#--------------------------------------------------------------------------
def on_action_save
@action_window.activate
if DataManager.save_game(@file_window.index)
on_save_success
refresh_windows
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# overwrite method: on_save_success
#--------------------------------------------------------------------------
def on_save_success; Sound.play_save; end
#--------------------------------------------------------------------------
# new method: on_action_delete
#--------------------------------------------------------------------------
def on_action_delete
@action_window.activate
DataManager.delete_save_file(@file_window.index)
on_delete_success
refresh_windows
end
#--------------------------------------------------------------------------
# new method: on_delete_success
#--------------------------------------------------------------------------
def on_delete_success
YEA::SAVE::DELETE_SOUND.play
end
#--------------------------------------------------------------------------
# new method: refresh_windows
#--------------------------------------------------------------------------
def refresh_windows
@file_window.refresh
@action_window.refresh
@status_window.refresh
end
end # Scene_File
#==============================================================================
# ?! Scene_Save
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# overwrite method: on_savefile_ok
#--------------------------------------------------------------------------
def on_savefile_ok; super; end
#--------------------------------------------------------------------------
# overwrite method: on_save_success
#--------------------------------------------------------------------------
def on_save_success; super; end
end # help_window_text
#==============================================================================
# ?! Scene_Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# overwrite method: on_savefile_ok
#--------------------------------------------------------------------------
def on_savefile_ok; super; end
#--------------------------------------------------------------------------
# overwrite method: on_load_success
#--------------------------------------------------------------------------
def on_load_success; super; end
end # Scene_Load
#==============================================================================
#
# ?\ End of File
#
#==============================================================================[/pre]
有需要或有問題者在下面發問
大神們發現上面有錯或有意見請出聲感謝<(_ _)> |
评分
-
查看全部评分
|