rebf-gaiden/Scripts/_1_Ace.rb
2025-04-26 17:06:34 -05:00

218 lines
No EOL
9.3 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.

#==============================================================================
# RGSS3_テストプレー高速化Ace
# 2012/05/21公開
# C Winter (http://ccwinter.blog.fc2.com/)
#
# 歯車の城(http://members.jcom.home.ne.jp/cogwheel/)様で公開されている
# ショウ様のRGSS2スクリプト素材の移植スクリプトです。
#==============================================================================
#==============================================================================
# ■ 設定項目
#==============================================================================
module SpeedUp
SPEED_RATE = 3 # 倍速スピード
TEST = true # falseにすると通常プレイと同様の早送り形式になる
SWITCH_A = 0 # グラフィックを早送りにするスイッチ番号 0なら無効
SWITCH_B = 0 # ボタンによるSWITCH_Aの変更を可能にするスイッチ番号
# trueなら使用する falseなら使用しない
# 通常プレイ時 Xボタン入力中のグラフィック高速化
NOBATTLE_BUTTON = true #バトル中以外 いじらなくてもOK
INBATTLE_BUTTON = true #バトル中
# 通常プレイ時 SWITCH_Aがの間のグラフィック高速化
NOBATTLE_SWITCH = false #バトル中以外
INBATTLE_SWITCH = true #バトル中
end
#==============================================================================
# ■ Scene_Base
#==============================================================================
class Scene_Base
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias :update_basic_spd :update_basic
def update_basic
if Input.trigger?(:Z) &&
$game_switches[SpeedUp::SWITCH_B] && SpeedUp::SWITCH_A != 0
if !SceneManager.scene_is?(Scene_Battle) &&
(Graphics.test? || SpeedUp::NOBATTLE_SWITCH)
$game_switches[SpeedUp::SWITCH_A] = !$game_switches[SpeedUp::SWITCH_A]
elsif SceneManager.scene_is?(Scene_Battle) &&
(Graphics.test? || SpeedUp::INBATTLE_SWITCH)
$game_switches[SpeedUp::SWITCH_A] = !$game_switches[SpeedUp::SWITCH_A]
end
end
update_basic_spd
end
end
#==============================================================================
# ■ Graphics
#==============================================================================
class << Graphics
#--------------------------------------------------------------------------
# ● 早送り用のテスト判定
#--------------------------------------------------------------------------
def test?
$TEST && SpeedUp::TEST
end
#--------------------------------------------------------------------------
# ● バトル中以外でのグラフィックの早送りが可能かどうか
#--------------------------------------------------------------------------
def can_speedup?
a = (test? || SpeedUp::NOBATTLE_BUTTON) && Input.press?(:X)
b = (test? || SpeedUp::NOBATTLE_SWITCH) && $game_switches[SpeedUp::SWITCH_A]
return a ^ b
end
#--------------------------------------------------------------------------
# ● バトル中のグラフィックの早送りが可能かどうか
#--------------------------------------------------------------------------
def can_battle_speedup?
a = (test? || SpeedUp::INBATTLE_BUTTON) && Input.press?(:X)
b = (test? || SpeedUp::INBATTLE_SWITCH) && $game_switches[SpeedUp::SWITCH_A]
return a ^ b
end
#--------------------------------------------------------------------------
# ● 文章表示の高速化が可能かどうか
#--------------------------------------------------------------------------
def can_message_speedup?
test? && (Input.press?(:X) || $game_switches[SpeedUp::SWITCH_A])
end
#--------------------------------------------------------------------------
# ● 決定ボタンの入力が無くても文章送りが可能かどうか
#--------------------------------------------------------------------------
def can_message_skip?
test? && (Input.press?(:X) ^ $game_switches[SpeedUp::SWITCH_A])
end
#--------------------------------------------------------------------------
# ● 敵全滅コマンドが可能かどうか
#--------------------------------------------------------------------------
def can_all_enemy_kill?
$TEST && Input.trigger?(:Y) && !$game_troop.all_dead?
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias :update_spd :update
def update
# フレームカウントが SPEED の倍数でない時
if Graphics.frame_count % SpeedUp::SPEED_RATE > 0 &&
if $game_switches[253] == false
((can_speedup? && !SceneManager.scene_is?(Scene_Battle)) ||
(can_battle_speedup? && SceneManager.scene_is?(Scene_Battle)))
# グラフィックの更新をせず、カウントだけ加算する
end
Graphics.frame_count += 1
# フレームカウントが SPEED の倍数の時
else
# グラフィックの更新を行う
update_spd
end
end
#--------------------------------------------------------------------------
# ● ウェイト処理
#--------------------------------------------------------------------------
alias :wait_spd :wait
def wait(duration)
if can_speedup?
wait_spd(duration / SpeedUp::SPEED_RATE)
else
wait_spd(duration)
end
end
#--------------------------------------------------------------------------
# ● フェードイン処理
#--------------------------------------------------------------------------
alias :fadein_spd :fadein
def fadein(duration)
if can_speedup?
fadein_spd(duration / SpeedUp::SPEED_RATE)
else
fadein_spd(duration)
end
end
#--------------------------------------------------------------------------
# ● フェードアウト処理
#--------------------------------------------------------------------------
alias :fadeout_spd :fadeout
def fadeout(duration)
if can_speedup?
fadeout_spd(duration / SpeedUp::SPEED_RATE)
else
fadeout_spd(duration)
end
end
#--------------------------------------------------------------------------
# ● トランジション処理
#--------------------------------------------------------------------------
alias :transition_spd :transition
def transition(duration = 10, filename = "", vague = 40)
if can_speedup?
transition_spd(duration / SpeedUp::SPEED_RATE, filename, vague)
else
transition_spd(duration, filename, vague)
end
end
end
#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# ● 一文字出力後のウェイト
#--------------------------------------------------------------------------
def wait_for_one_character
update_show_fast
Fiber.yield unless @show_fast || @line_show_fast ||
Graphics.can_message_speedup?
end
#--------------------------------------------------------------------------
# ● 入力待ち処理
#--------------------------------------------------------------------------
def input_pause
self.pause = true
wait(10)
Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) ||
Graphics.can_message_skip?
Input.update
self.pause = false
end
end
#==============================================================================
# ■ Window_PartyCommand
#==============================================================================
class Window_PartyCommand < Window_Command
#--------------------------------------------------------------------------
# ● 決定やキャンセルなどのハンドリング処理
#--------------------------------------------------------------------------
alias :process_handling_spd :process_handling
def process_handling
process_handling_spd
SceneManager.scene.all_enemy_kill if self.active && Graphics.can_all_enemy_kill?
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 早送り判定
#--------------------------------------------------------------------------
def show_fast?
Input.press?(:A) || Input.press?(:C) || Graphics.can_battle_speedup?
end
#--------------------------------------------------------------------------
# ● 勝利コマンド
#--------------------------------------------------------------------------
def all_enemy_kill
Sound.play_ok
for enemy in $game_troop.members
enemy.hp -= 999999
enemy.perform_collapse_effect
end
end
end