220 lines
No EOL
9.6 KiB
Ruby
220 lines
No EOL
9.6 KiB
Ruby
#==============================================================================
|
||
# ◆ Teleport_VXA Ver.1.0.0(2012/01/30)
|
||
#------------------------------------------------------------------------------
|
||
# 一度行ったことのある町へ瞬間移動するスキルやアイテムの処理を行います。
|
||
#==============================================================================
|
||
|
||
=begin
|
||
|
||
◆ 使用方法
|
||
|
||
* テレポートのスキル(またはアイテム)を作成します。
|
||
効果範囲は[なし]、使用可能時は[メニューのみ]とします。
|
||
メモ欄には <TELEPORT> と入力して下さい。
|
||
(テレポートの識別用文字列を変更した場合はその文字列を入力して下さい)
|
||
|
||
* 以下の設定で テレポート位置のデータテーブルとテレポート使用可能判定スイッチ
|
||
を設定します。
|
||
|
||
=end
|
||
|
||
#==============================================================================
|
||
# ◎ ユーザー設定
|
||
#==============================================================================
|
||
|
||
=begin
|
||
|
||
◆ 以下、定数と明記された内容を設定することができます。
|
||
|
||
○ 定数(テレポート位置のデータテーブル)
|
||
[スイッチ ID、テレポート先の名前、マップ ID、X 座標、Y 座標] を設定します。
|
||
ここで指定したスイッチIDが ON の時、その位置へのテレポートが可能になります。
|
||
|
||
○ 定数(テレポート使用可能判定スイッチ)
|
||
ここで指定したスイッチが ON の時、テレポートのスキル(またはアイテム)が使用
|
||
可能になります。
|
||
|
||
○ 定数(おまけ)
|
||
おまけで追加した定数です。お好みで設定して下さい。
|
||
|
||
* テレポートの識別用文字列
|
||
ここで指定した文字列がメモ欄に含まれている時、テレポートのスキル(または
|
||
アイテム)として識別されます。
|
||
|
||
* 発動時の SE
|
||
[SE の名前、ボリューム、ピッチ] を設定します。(指定しない場合は [])
|
||
ここで指定した SE がテレポート発動時に流れます。
|
||
|
||
=end
|
||
|
||
#--------------------------------------------------------------------------
|
||
# ○ 定数(テレポート位置のデータテーブル)
|
||
#--------------------------------------------------------------------------
|
||
TELEPORT_PLACES =
|
||
[
|
||
[237, "Florite's house", 130, 18, 7],
|
||
[238, "Florite's house", 16, 13, 7],
|
||
[239, "Florite's house", 80, 18, 7],
|
||
[240, "Home", 116, 9, 11],
|
||
[241, "Teachers Lab", 153, 9, 10],
|
||
[303, "Third-class Res Area", 17, 34, 25],
|
||
[304, "Warehouse District 1", 19, 21, 18],
|
||
[305, "Warehouse District 2", 19, 55, 27],
|
||
[306, "Wharf", 11, 10, 28],
|
||
[308, "Farm", 59, 12, 26],
|
||
[309, "Construction Site", 62, 23, 21],
|
||
[310, "Undeveloped Area", 63, 9, 27],
|
||
[311, "Secret Base", 63, 44, 10],
|
||
[313, "Central Square", 18, 23, 34],
|
||
[314, "Shopping District", 39, 28, 27],
|
||
[315, "Alley", 39, 33, 5],
|
||
[316, "Castle Gate", 77, 15, 17],
|
||
[320, "????", 37, 8, 32],
|
||
[321, "Pleasure Quarter", 37, 58, 32],
|
||
[323, "Toy Shop", 37, 14, 22],
|
||
[339, "Toy Shop", 37, 9, 23],
|
||
[338, "Recollection Room", 38, 21, 8],
|
||
[324, "???", 37, 8, 42],
|
||
[325, "AV Studio", 37, 8, 42],
|
||
[326, "Annamaras", 37, 8, 32],
|
||
[327, "AV Film Office", 37, 8, 42],
|
||
[328, "Hotel", 37, 34, 17],
|
||
[329, "Exclusive Res District", 40, 22, 40],
|
||
[331, "House of Merith", 60, 14, 18],
|
||
[332, "City Hall", 56, 11, 35],
|
||
[334, "Casino", 37, 39, 37],
|
||
[335, "VIP Room", 176, 14, 15],
|
||
[336, "Slums", 6, 25, 27],
|
||
[337, "Guild", 20, 23, 25],
|
||
[341, "バトルテスト用", 55, 22, 12],
|
||
[342, "各種テスト用マップ", 257, 14, 11],
|
||
]
|
||
#--------------------------------------------------------------------------
|
||
# ○ 定数(テレポート使用可能判定スイッチ)
|
||
#--------------------------------------------------------------------------
|
||
TELEPORT_SWITCH = 11
|
||
#--------------------------------------------------------------------------
|
||
# ○ 定数(おまけ)
|
||
#--------------------------------------------------------------------------
|
||
TELEPORT_SIGNATURE = "<TELEPORT>" # テレポートの識別用文字列
|
||
TELEPORT_SE = ["Teleport", 80, 100] # 発動時の SE
|
||
|
||
|
||
#/////////////////////////////////////////////////////////////////////////////#
|
||
# #
|
||
# 下記のスクリプトを変更する必要はありません。 #
|
||
# #
|
||
#/////////////////////////////////////////////////////////////////////////////#
|
||
|
||
|
||
#==============================================================================
|
||
# ■ Window_Teleport(新規定義)
|
||
#------------------------------------------------------------------------------
|
||
# テレポート位置を選択するウィンドウです。
|
||
#==============================================================================
|
||
|
||
class Window_Teleport < Window_Command
|
||
#--------------------------------------------------------------------------
|
||
# ● オブジェクト初期化
|
||
#--------------------------------------------------------------------------
|
||
def initialize
|
||
super(0, 0)
|
||
hide
|
||
deactivate
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● ウィンドウ幅の取得
|
||
#--------------------------------------------------------------------------
|
||
def window_width
|
||
return 240
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● ウィンドウ高さの取得
|
||
#--------------------------------------------------------------------------
|
||
def window_height
|
||
Graphics.height
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● コマンドリストの作成
|
||
#--------------------------------------------------------------------------
|
||
def make_command_list
|
||
TELEPORT_PLACES.each do |place|
|
||
if $game_switches[place[0]]
|
||
add_command(place[1], :teleport, true, place)
|
||
end
|
||
end
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Scene_ItemBase
|
||
#------------------------------------------------------------------------------
|
||
# アイテム画面とスキル画面の共通処理を行うクラスです。
|
||
#==============================================================================
|
||
|
||
class Scene_ItemBase
|
||
alias dstlp_start start
|
||
#--------------------------------------------------------------------------
|
||
# ○ 開始処理(追加定義)
|
||
#--------------------------------------------------------------------------
|
||
def start
|
||
dstlp_start
|
||
@teleport_window = Window_Teleport.new
|
||
@teleport_window.set_handler(:teleport, method(:on_teleport))
|
||
@teleport_window.set_handler(:cancel, method(:on_teleport_cancel))
|
||
end
|
||
alias dstlp_determine_item determine_item
|
||
#--------------------------------------------------------------------------
|
||
# ○ アイテムの決定(追加定義)
|
||
#--------------------------------------------------------------------------
|
||
def determine_item
|
||
if item.note.include?(TELEPORT_SIGNATURE)
|
||
show_sub_window(@teleport_window)
|
||
else
|
||
dstlp_determine_item
|
||
end
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● テレポートコマンド[決定]
|
||
#--------------------------------------------------------------------------
|
||
def on_teleport
|
||
place = @teleport_window.current_ext
|
||
$game_player.reserve_transfer(place[2], place[3], place[4])
|
||
se = TELEPORT_SE # 定数の代入
|
||
RPG::SE.new(se[0], se[1], se[2]).play unless se.empty? # SE の演奏
|
||
SceneManager.goto(Scene_Map)
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● テレポートコマンド[キャンセル]
|
||
#--------------------------------------------------------------------------
|
||
def on_teleport_cancel
|
||
hide_sub_window(@teleport_window)
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Game_BattlerBase
|
||
#------------------------------------------------------------------------------
|
||
# バトラーを扱う基本のクラスです。主に能力値計算のメソッドを含んでいます。こ
|
||
# のクラスは Game_Battler クラスのスーパークラスとして使用されます。
|
||
#==============================================================================
|
||
|
||
class Game_BattlerBase
|
||
alias dstlp_usable_item_conditions_met? usable_item_conditions_met?
|
||
#--------------------------------------------------------------------------
|
||
# ○ スキル/アイテムの共通使用可能条件チェック(追加定義)
|
||
#--------------------------------------------------------------------------
|
||
def usable_item_conditions_met?(item)
|
||
if item.note.include?(TELEPORT_SIGNATURE) && $game_switches[TELEPORT_SWITCH] == false
|
||
false
|
||
else
|
||
dstlp_usable_item_conditions_met?(item)
|
||
end
|
||
end
|
||
end
|
||
|
||
#/////////////////////////////////////////////////////////////////////////////#
|
||
# 製作者:SOLA@DEEP SEASONS #
|
||
# 配布元:http://deepseasons.seesaa.net/ #
|
||
# 作成日:2012/01/30 #
|
||
#/////////////////////////////////////////////////////////////////////////////# |