king-exit/Scripts/_.31.rb
2024-08-31 14:17:23 -05:00

146 lines
No EOL
5.7 KiB
Ruby
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

=begin
RGSS3
★ スタートコマンド拡張 ★
タイトルコマンドを増やし複数のマップからゲームを開始することができます。
おまけの追加などにどうぞ。
● 仕様 ●==========================================================
これはタイトル画面から複数のマップに飛ばすことを可能にするものです。
--------------------------------------------------------------------
これ自体にサウンドやギャラリーの機能はありません。
====================================================================
● 注意 ●==========================================================
「ゲーム内共有変数」との併用を前提条件にしたスクリプト素材です。
--------------------------------------------------------------------
最初からコマンドを増やした状態で開始し、その後も変更させない場合は、
「ゲーム内共有変数」は必要ありません。
====================================================================
ver1.00
Last Update : 2011/12/23
12/23 : RGSS2からの移植
ろかん   http://kaisou-ryouiki.sakura.ne.jp/
=end
#===========================================
# 設定箇所
#===========================================
module Rokan
module Game_Start_Command
# 判断に利用する変数番号
GSV = 20
DEF_LIST = {
#--------------------------------------------------------------------
# 追加コマンドを定義02は使用しないでください
#--------------------------------------------------------------------
# 0 => ニューゲーム
# 1 => コンティニュー
# 2 => シャットダウン
#--------------------------------------------------------------------
# 定義番号 => ["コマンド名", 開始マップID, マップX座標, マップY座標],
#--------------------------------------------------------------------
3 => ["ギャラリー", 4, 10, 13],
4 => ["サウンド", 3, 11, 10],
#--------------------------------------------------------------------
}
COMMAND_LIST = {
#--------------------------------------------------------------------
# 指定変数内容によるコマンド内容を設定
# 望むコマンドの順番を上で定義した番号をつかって表現してください
#--------------------------------------------------------------------
# 指定変数に格納されている数値 => [コマンドの順番],
#--------------------------------------------------------------------
0 => [0, 1, 2],
1 => [0, 1, 3, 2],
2 => [0, 1, 4, 2],
3 => [0, 1, 3, 4, 2],
#--------------------------------------------------------------------
}
end
end
#===========================================
# ここまで
#===========================================
$rsi ||= {}
$rsi["スタートコマンド拡張"] = true
module DataManager
#--------------------------------------------------------------------------
# ● インクルード Rokan::Game_Start_Command
#--------------------------------------------------------------------------
include Rokan::Game_Start_Command
#--------------------------------------------------------------------------
# ● 定義されたコマンドリストの取得
#--------------------------------------------------------------------------
def self.def_list
DEF_LIST
end
#--------------------------------------------------------------------------
# ● 定義されたコマンドリストの取得
#--------------------------------------------------------------------------
def self.command_list
COMMAND_LIST[$game_variables[GSV]]
end
#--------------------------------------------------------------------------
# ● 拡張コマンドのセットアップ
#--------------------------------------------------------------------------
def self.setup_ex_command(index)
create_game_objects
data = def_list[command_list[index]]
$game_party.setup_starting_members
$game_map.setup(data[1])
$game_player.moveto(data[2], data[3])
$game_player.refresh
Graphics.frame_count = 0
end
end
class Window_TitleCommand < Window_Command
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
DataManager.command_list.each{|i|
case i
when 0
add_command(Vocab::new_game, :new_game)
when 1
add_command(Vocab::continue, :continue, continue_enabled)
when 2
add_command(Vocab::shutdown, :shutdown)
else
add_command(DataManager.def_list[i][0], :ex_command)
end
}
end
end
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● コマンドウィンドウの作成
#--------------------------------------------------------------------------
alias _ex_command_create_command_window create_command_window
def create_command_window
_ex_command_create_command_window
@command_window.set_handler(:ex_command, method(:command_ex))
end
#--------------------------------------------------------------------------
# ● 拡張コマンド
#--------------------------------------------------------------------------
def command_ex
DataManager.setup_ex_command(@command_window.index)
close_command_window
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
end