lunariafantasia/Scripts/_.27.rb
2024-01-12 03:12:38 -06:00

67 lines
No EOL
2.6 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

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.

module FAKEREAL
BATTLE_END = 82
BATTLE_CONTINUE = 78
end
#==============================================================================
# ■ BattleManager
#------------------------------------------------------------------------------
#  戦闘の進行を管理するモジュールです。
#==============================================================================
=begin
module BattleManager
#--------------------------------------------------------------------------
# ● 勝敗判定 ※再定義
#--------------------------------------------------------------------------
def self.judge_win_loss
if @phase
return process_abort if $game_party.members.empty?
return process_defeat if $game_party.all_dead?
return process_victory if $game_troop.all_dead? || $game_switches[FAKEREAL::BATTLE_END]
return process_abort if aborting?
end
return false
end
end
=end
class << BattleManager
#--------------------------------------------------------------------------
# ● 戦闘終了
# result : 結果0:勝利 1:逃走 2:敗北)
#--------------------------------------------------------------------------
alias flag_end_battle_end battle_end
def battle_end(result)
$game_switches[FAKEREAL::BATTLE_END] = false
flag_end_battle_end(result)
end
end
#==============================================================================
# ■ Game_Troop
#------------------------------------------------------------------------------
#  敵グループおよび戦闘に関するデータを扱うクラスです。バトルイベントの処理も
# 行います。このクラスのインスタンスは $game_troop で参照されます。
#==============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ● 全滅判定
#--------------------------------------------------------------------------
def all_dead?
(super && !battle_continue_flag?) || battle_end_flag?
end
#--------------------------------------------------------------------------
# 全滅判定
#--------------------------------------------------------------------------
def battle_end_flag?
$game_switches[FAKEREAL::BATTLE_END]
end
#--------------------------------------------------------------------------
# 戦闘一時的に継続判定
#--------------------------------------------------------------------------
def battle_continue_flag?
$game_switches[FAKEREAL::BATTLE_CONTINUE]
end
end