#==============================================================================
# ■ VXAce-RGSS3-25 強くてニューゲーム [Ver.1.1.0] by Claimh
# 周回繼承腳本 繁體中文翻譯 by QQ蚊子湯
# [url]https://rpg.blue/home.php?mod=space&uid=2658226[/url] ←譯者空間 (誤譯的時候用www)
#------------------------------------------------------------------------------
# ・遊戲通關時可以繼承遊戲資料重新開始遊戲。
#------------------------------------------------------------------------------
#【繼承對象】
# $game_temp (Game_Temp) : ×
# $game_system (Game_System) : ○
# $game_timer (Game_Timer) : ×
# $game_message (Game_Message) : ×
# $game_switches (Game_Switches) : ○
# $game_variables (Game_Variables) : ○
# $game_self_switches (Game_SelfSwitches) : ×
# $game_actors (Game_Actors) : ○
# $game_party (Game_Party) : ○
# $game_troop (Game_Troop) : ×
# $game_map (Game_Map) : ×
# $game_player (Game_Player) : ×
#------------------------------------------------------------------------------
#【通關設定】
# $game_system.game_clear
#【是否為通關存檔】
# $game_system.game_clear?
#【取得通關次數】
# $game_system.clrd.count
#------------------------------------------------------------------------------
# (注) 寫著『需要:〇〇腳本』的項目沒有導入的情況設定true。
#==============================================================================
module Renewgame
# 強くてニューゲームロード時のSE
RENEW_SE = RPG::SE.new("Barrier")
#---------------------------------------------------------------------------
# ● システム情報(Game_System)引継ぎ設定
#---------------------------------------------------------------------------
# 是否繼承戰鬥回數
RENEW_BATTLE_CNT = true
# 是否繼承存檔回數
RENEW_SAVE_CNT = true
# 是否繼承遊戲時間
RENEW_TIME = true
# 用語辞典情報を引き継ぐ(需要:用語辞典腳本)
RENEW_DICTIONAY = true
# クエスト情報を引き継ぐ(需要:關卡系統腳本)
RENEW_QUEST = true
# 鍛冶情報を引き継ぐ(需要:鍛造屋腳本)
RENEW_BLACKSMITH = true
# ワールドマップ情報を引き継ぐ(需要:世界地圖腳本)
RENEW_WORLDMAP = true
# フィールドマップ情報を引き継ぐ(需要:區域地圖腳本)
RENEW_FIELDMAP = true
#---------------------------------------------------------------------------
# ● 遊戲開關(Game_Switches)的繼承設定
#---------------------------------------------------------------------------
# 繼承的遊戲開關ID號
RENEW_SW = [1, 10]
#---------------------------------------------------------------------------
# ● 遊戲變數(Game_Variables)的繼承設定
#---------------------------------------------------------------------------
# 繼承的遊戲變數ID號
RENEW_VAL = [1, 5]
#---------------------------------------------------------------------------
# ● 隊伍(Game_Party)的繼承設定
#---------------------------------------------------------------------------
# 什麼都不繼承 (此項目為true時,本大項內的都不需設定)
PT_NOT_RENEW = false
# 是否繼承金錢
RENEW_GOLD = true
# 是否繼承步數
RENEW_STEP = true
# 是否繼承道具(使用道具、貴重物品類)
RENEW_ITEM = true
# 不需要被繼承的道具ID號
NOT_RENEW_ITEMS = [5, 15]
# 是否繼承武器
RENEW_WEAPON = true
# 不需要被繼承的武器ID號
NOT_RENEW_WEAPONS = [20, 25]
# 是否繼承防具
RENEW_ARMOR = true
# 不需要被繼承的防具ID號
NOT_RENEW_ARMORS = [9, 23]
# 是否繼承關卡評價(需要:關卡系統腳本)
RENEW_QUEST_RANK = true
#---------------------------------------------------------------------------
# ● 角色(Game_Actor)的繼承設定
# 名稱、行走圖、臉圖不會被繼承
#---------------------------------------------------------------------------
# 什麼都不繼承 (此項目為true時,本大項內的都不需設定)
ACT_NOT_RENEW = false
# 不需要被繼承的角色ID號
NOT_RENEW_ACTORS = [2]
# 是否繼承職業
RENEW_CLASS = true
# 是否繼承等級(經驗值)
RENEW_LV = true
# 是否繼承稱號
RENEW_NICKNAME = true
# 是否繼承技能
RENEW_SKILL = true
# 不須要被繼承的技能ID號
NOT_RENEW_SKILLS = {
# 角色ID號 => [技能ID號, …], ← 譯者註:除了最後一項,不要忘了加這個逗號
0 => [22],
1 => [23]
}
# 是否繼承能力値 (事件增加額外能力類)
RENEW_PARAM = true
# 是否繼承装備品
RENEW_EQUIP = true
# 是否繼承熟練度(需要:熟練度系統腳本)
RENEW_ATTR_LV = true
##############################設定結束############################################
#--------------------------------------------------------------------------
# ● データチェック
#--------------------------------------------------------------------------
def self.chk_include?(ary, id)
return false if ary.nil?
ary.include?(id)
end
#--------------------------------------------------------------------------
# ● アクタースキル引き継ぎ可否判定
#--------------------------------------------------------------------------
def self.chk_skill(actor_id, skill_id)
return true if chk_include?(NOT_RENEW_SKILLS[0], skill_id)
return true if chk_include?(NOT_RENEW_SKILLS[actor_id], skill_id)
false
end
#--------------------------------------------------------------------------
# ● アイテム引き継ぎ
#--------------------------------------------------------------------------
def self.lose_items
flag = [RENEW_ITEM, RENEW_WEAPON, RENEW_ARMOR]
ary = [NOT_RENEW_ITEMS, NOT_RENEW_WEAPONS, NOT_RENEW_ARMORS]
flag.each_index do |i|
flag ? lose_select_items(pitems(i), ary) : $game_party.init_items(i)
end
end
#--------------------------------------------------------------------------
# ● partyアイテム
#--------------------------------------------------------------------------
def self.pitems(type)
case type
when 0; return $game_party.items
when 1; return $game_party.weapons
when 2; return $game_party.armors
end
end
#--------------------------------------------------------------------------
# ● 抽出アイテムを全部捨てる
#--------------------------------------------------------------------------
def self.lose_select_items(items, ary)
$game_party.lose_all_items(items.select {|item| ary.include?(item.id)}, true)
end
end
#==============================================================================
# ■ Renewgame::ClearData : クリア情報クラス
#==============================================================================
class Renewgame::ClearData
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :renew # 強くてニューゲーム発動フラグ
attr_reader :clear # クリア済みフラグ
attr_reader :count # クリア回数
attr_reader :time # クリア時間
attr_reader :lv_ave # 平均レベル
attr_reader :lv_max # 最大レベル
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
@renew = false
[url=home.php?mod=space&uid=350431]@Clear[/url] = false
@count = 0
[url=home.php?mod=space&uid=134219]@Time[/url] = [0]
@lv_ave = [0]
@lv_max = [0]
end
#--------------------------------------------------------------------------
# ● クリア設定
#--------------------------------------------------------------------------
def game_clear
@renew = true
@clear = true
@count += 1
members = $game_party.members
set_clear_time
@time[@count] -= @time[@count-1] if Renewgame::RENEW_TIME
@lv_ave[@count] = members.inject(0) {|r, a| r += a.level} / members.size
@lv_max[@count] = $game_party.highest_level
end
#--------------------------------------------------------------------------
# ● クリア時間設定
#--------------------------------------------------------------------------
def set_clear_time
@time[@count] = $game_system.playtime
end
#--------------------------------------------------------------------------
# ● クリアまでに費やした合計時間
#--------------------------------------------------------------------------
def played_time
return @time[@count] unless Renewgame::RENEW_TIME
@count.inject(0) {|r, i| r += @time[i+1]}
end
end
#==============================================================================
# ■ DataManager
#==============================================================================
class << DataManager
#--------------------------------------------------------------------------
# ● セーブヘッダの作成
#--------------------------------------------------------------------------
alias make_save_header_renew make_save_header
def make_save_header
header = make_save_header_renew
header[:game_clear] = $game_system.game_clear?
header[:regame] = $game_system.clrd.renew
header
end
end
#==============================================================================
# ■ Scene_Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_renew_window
end
#--------------------------------------------------------------------------
# ● 強くてニューゲーム発動ウィンドウ生成
#--------------------------------------------------------------------------
def create_renew_window
@renew_window = Window_RenewGame.new
@renew_window.set_handler(:renew_yes, method(:renew_yes))
@renew_window.set_handler(:cancel, method(:renew_no))
end
#--------------------------------------------------------------------------
# ● セーブファイル選択の更新
#--------------------------------------------------------------------------
def update_savefile_selection
return if @renew_window.active
super
end
#--------------------------------------------------------------------------
# ● セーブファイルの決定
#--------------------------------------------------------------------------
alias on_savefile_ok_renew on_savefile_ok
def on_savefile_ok
if renewgame?
Sound.play_ok
@renew_window.activate.open.index = 1
@help_window.set_text("クリア時のデータを引き継いで新しく始めますか?")
else
on_savefile_ok_renew
end
end
#--------------------------------------------------------------------------
# ● 強くてニューゲーム用セーブデータ?
#--------------------------------------------------------------------------
def renewgame?
header = DataManager.load_header(@index)
return false unless header
header[:regame]
end
#--------------------------------------------------------------------------
# ● 強くてニューゲーム時の処理
#--------------------------------------------------------------------------
def renew_yes
if DataManager.load_game(@index)
on_renew_success
else
@help_window.set_text(help_window_text)
Sound.play_buzzer
end
@renew_window.deactivate.close
end
#--------------------------------------------------------------------------
# ● 強くてニューゲーム成功時の処理
#--------------------------------------------------------------------------
def on_renew_success
Renewgame::RENEW_SE.play
DataManager.renew_game
$game_system.clrd.renew = false
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
#--------------------------------------------------------------------------
# ● 強くてニューゲーム時の処理
#--------------------------------------------------------------------------
def renew_no
@renew_window.deactivate.close
@help_window.set_text(help_window_text)
end
end
#==============================================================================
# ■ Window_RenewGame
#==============================================================================
class Window_RenewGame < Window_Command
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0)
update_placement
deactivate.openness = 0
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return 100
end
#--------------------------------------------------------------------------
# ● ウィンドウ位置の更新
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height - height) / 2
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command("はい", :renew_yes)
add_command("いいえ", :cancel)
end
end
module DataManager
#--------------------------------------------------------------------------
# ● 強くてニューゲーム
#--------------------------------------------------------------------------
def self.renew_game
renew_game_data
$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
end
#--------------------------------------------------------------------------
# ● 強くてニューゲーム時の各種ゲームオブジェクトのリセット
#--------------------------------------------------------------------------
def self.renew_game_data
$game_temp = Game_Temp.new
renew_game_system
$game_timer = Game_Timer.new
$game_message = Game_Message.new
renew_game_switches
renew_game_variables
$game_self_switches = Game_SelfSwitches.new
Renewgame::ACT_NOT_RENEW ? init_game_actors : renew_game_actors
Renewgame::PT_NOT_RENEW ? init_game_party : renew_game_party
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
end
#--------------------------------------------------------------------------
# ● Game_Switches初期化
#--------------------------------------------------------------------------
def self.init_game_switches
$game_switches = Game_Switches.new
end
#--------------------------------------------------------------------------
# ● Game_Variables初期化
#--------------------------------------------------------------------------
def self.init_game_variables
$game_variables = Game_Variables.new
end
#--------------------------------------------------------------------------
# ● Game_Actors初期化
#--------------------------------------------------------------------------
def self.init_game_actors
$game_actors = Game_Actors.new
end
#--------------------------------------------------------------------------
# ● Game_Party初期化
#--------------------------------------------------------------------------
def self.init_game_party
$game_party = Game_Party.new
end
#--------------------------------------------------------------------------
# ● Game_System引継ぎ
#--------------------------------------------------------------------------
def self.renew_game_system
$game_system.battle_count = 0 unless Renewgame::RENEW_BATTLE_CNT
$game_system.save_count = 0 unless Renewgame::RENEW_SAVE_CNT
$game_system.reset_playtime(Renewgame::RENEW_TIME)
$game_system.clrd.set_clear_time # セーブされていたplaytimeに補正
$game_system.dictionary.reset unless Renewgame::RENEW_DICTIONAY
$game_system.quest.reset unless Renewgame::RENEW_QUEST
$game_system.bs.reset_all unless Renewgame::RENEW_BLACKSMITH
$game_system.worldmap.reset unless Renewgame::RENEW_WORLDMAP
$game_system.init_fieldmap unless Renewgame::RENEW_FIELDMAP
#
$game_system.reset
end
#--------------------------------------------------------------------------
# ● Game_Switches引き継ぎ
#--------------------------------------------------------------------------
def self.renew_game_switches
ids = $game_switches.on_sw_ids.select {|id| Renewgame::RENEW_SW.include?(id)}
init_game_switches
ids.each {|id| $game_switches[id] = true}
end
#--------------------------------------------------------------------------
# ● Game_Variables引き継ぎ
#--------------------------------------------------------------------------
def self.renew_game_variables
vals = {}
Renewgame::RENEW_VAL.each {|id| vals[id] = $game_variables[id]}
init_game_variables
Renewgame::RENEW_VAL.each {|id| $game_variables[id] = vals[id]}
end
#--------------------------------------------------------------------------
# ● Game_Actors引き継ぎ
#--------------------------------------------------------------------------
def self.renew_game_actors
$game_actors.each {|a| renew_game_actor(a)}
end
#--------------------------------------------------------------------------
# ● Game_Actor引き継ぎ
#--------------------------------------------------------------------------
def self.renew_game_actor(actor)
if Renewgame::NOT_RENEW_ACTORS.include?(actor.id)
actor.setup(actor.id)
return
end
new_act = Game_Actor.new(actor.id)
unless Renewgame::RENEW_SKILL
actor.init_skills
else
skills = actor.skills.select {|skill| Renewgame.chk_skill(actor.id, skill.id)}
skills.each {|skill| actor.forget_skill(skill.id)}
end
actor.init_lv_exp unless Renewgame::RENEW_LV
actor.change_class(new_act.class_id) unless Renewgame::RENEW_CLASS
actor.nickname = new_act.nickname unless Renewgame::RENEW_NICKNAME
actor.clear_param_plus unless Renewgame::RENEW_PARAM
unless Renewgame::RENEW_EQUIP
actor.clear_equipments
actor.init_equips(actor.actor.equips)
end
actor.attr = ActorAttrList.new(actor.id) unless Renewgame::RENEW_ATTR_LV
#
actor.recover_all
end
#--------------------------------------------------------------------------
# ● Game_Party引き継ぎ
#--------------------------------------------------------------------------
def self.renew_game_party
$game_party.gold = 0 unless Renewgame::RENEW_GOLD
$game_party.steps = 0 unless Renewgame::RENEW_STEP
Renewgame.lose_items
$game_party.quest_rank = 1 unless Renewgame::RENEW_QUEST_RANK
end
end
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_writer :save_count # セーブ回数
attr_reader :clrd # クリア情報
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_renew initialize
def initialize
initialize_renew
@clrd = Renewgame::ClearData.new
end
#--------------------------------------------------------------------------
# ● クリア設定
#--------------------------------------------------------------------------
def game_clear
@clrd.game_clear
end
#--------------------------------------------------------------------------
# ● クリア設定
#--------------------------------------------------------------------------
def game_clear?
@clrd.clear
end
#--------------------------------------------------------------------------
# ● 変数リセット
#--------------------------------------------------------------------------
def reset
@save_disabled = false
@menu_disabled = false
@encounter_disabled = false
@formation_disabled = false
@window_tone = nil
@battle_bgm = nil
@battle_end_me = nil
@saved_bgm = nil
end
#--------------------------------------------------------------------------
# ● プレイ時間リセット
#--------------------------------------------------------------------------
def reset_playtime(load_reset=false)
@frames_on_save = 0 unless load_reset
Graphics.frame_count = @frames_on_save
end
end
class Game_Switches
#--------------------------------------------------------------------------
# ● ON状態のスイッチID取得
#--------------------------------------------------------------------------
def on_sw_ids
ids = []
@data.each_index {|i| ids.push(i) if self.[](i) }
ids
end
end
class Game_Actors
#--------------------------------------------------------------------------
# ● イテレータ
#--------------------------------------------------------------------------
def each
@data.select {|a| !a.nil?}.each {|actor| yield actor } if block_given?
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Level, EXP初期化
#--------------------------------------------------------------------------
def init_lv_exp
@level = actor.initial_level
@exp = {}
init_exp
end
end
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_writer :gold # 所持金
attr_writer :steps # 歩数
#--------------------------------------------------------------------------
# ● アイテムリストの初期化
#--------------------------------------------------------------------------
def init_items(type)
case type
when 0; @items = {}
when 1; @weapons = {}
when 2; @armors = {}
end
end
#--------------------------------------------------------------------------
# ● アイテムをすべて捨てる
# include_equip : 装備品も含める
#--------------------------------------------------------------------------
def lose_all_item(item, include_equip = false)
lose_item(item, max_item_number(item), include_equip)
end
#--------------------------------------------------------------------------
# ● アイテムリストをすべて捨てる
# include_equip : 装備品も含める
#--------------------------------------------------------------------------
def lose_all_items(items, include_equip = false)
items.each {|item| lose_all_item(item, include_equip)}
end
end
#==============================================================================
# ■ VXAce-RGSS3-25 強くてニューゲーム-opt2 [Ver.1.0.0] by Claimh
#------------------------------------------------------------------------------
# ・「セーブ画面-改2」のセーブ・ロード画面で
# クリアデータに☆を付けます。
#==============================================================================
#==============================================================================
# ■ Window_SaveInfo
#==============================================================================
class Window_SaveInfo < Window_Selectable
CLAER = "☆"
#--------------------------------------------------------------------------
# ● プレイ時間の描画
#--------------------------------------------------------------------------
#~ alias draw_playtime_renew draw_playtime
def draw_playtime(x, y, width)
draw_clear
draw_playtime_renew(x, y, width)
end
#--------------------------------------------------------------------------
# ● クリア情報描画
#--------------------------------------------------------------------------
def draw_clear
header = DataManager.load_header(@file_index)
return unless header
return unless header[:game_clear]
x = contents_width - text_size(@playtime).width - 30
draw_text(x, 0, 30, line_height, CLAER)
end
end