bad-end-collector/Scripts/_.27.rb
2024-05-18 13:05:37 -05:00

122 lines
No EOL
4.2 KiB
Ruby
Raw 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
RPGツクールVXAce用スクリプト素材
全滅時にコモンイベントを実施
2012年12月08日
tamuraさんは遊び足りない 製作
http://tamurarpgvx.blog137.fc2.com/
【概要】
戦闘で全滅したときに、ゲームオーバーに行かずにコモンイベントを実施します。
【導入方法】
スクリプトエディタを開き、左のリストの一番下、「ここに追加」と書いてある部分の
下の空欄を選び、右クリック、「挿入」を選ぶ。
出来た空欄に、「名前」の所でファイル名を入れておくといい。
右に空白の領域に、このテキストファイル全文をコピーして貼り付け。
【使い方】
・戦闘で全滅した際、ゲームスイッチ CALL_GAME_OVER_EX 番がだと、
 ゲームオーバーにならずに、コモンイベント STARTUP_COMMON を実施します。
 これらのスイッチ・コモンイベントを、下記 module TamuraGameOver のところで
 設定してください。
【注意事項・コモンイベントの作り方】
・まず「全回復」を実行してください。
マップに戻った瞬間にゲームオーバーになります。
・コモンイベントが一通り終わったら、イベントコマンドの「スクリプト」を使って、
SceneManager.call(Scene_Map)
と書かないと、マップに戻れずにフリーズします!
・おそらく「場所移動」を使う人が大半かと思われますが、上記の
SceneManager.call(Scene_Map) の後で場所移動を実行しないとフリーズします。
=end
module TamuraGameOver
#このスイッチがONの時に、ゲームオーバーコモンを呼び出す。
CALL_GAME_OVER_EX = 438
#この番号のコモンイベントを呼び出す。
STARTUP_COMMON = 36
end
#==============================================================================
# ■ BattleManager
#------------------------------------------------------------------------------
#  ゲームオーバーの呼び出しを変更。
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# ● 敗北の処理
#--------------------------------------------------------------------------
def self.process_defeat
$game_message.add(sprintf(Vocab::Defeat, $game_party.name))
wait_for_message
if @can_lose
revive_battle_members
replay_bgm_and_bgs
SceneManager.return
else
if $game_switches[TamuraGameOver::CALL_GAME_OVER_EX]
SceneManager.call(Scene_GameOverEx)
else
SceneManager.goto(Scene_Gameover)
end
end
battle_end(2)
return true
end
end
#==============================================================================
# ■ Scene_GameOverEx
#------------------------------------------------------------------------------
#  宝箱画面の処理を行うクラス。
#==============================================================================
class Scene_GameOverEx < Scene_Base
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
SceneManager.clear
$game_map.refresh
$game_message.visible = false
@menu_calling = false
create_all_windows
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
$game_map.update(true)
end
#--------------------------------------------------------------------------
# ● ウィンドウの作成・現在のイベントの中断・コモンイベント予約
#--------------------------------------------------------------------------
def create_all_windows
@message_window = Window_Message.new
$game_map.interpreter.clear
$game_temp.reserve_common_event(TamuraGameOver::STARTUP_COMMON) #開始コモンイベント
end
end