104 lines
No EOL
4.3 KiB
Ruby
104 lines
No EOL
4.3 KiB
Ruby
#==============================================================================
|
||
# ■ RGSS3 XPスタイルバトル 再行動演出 Ver1.00 by 星潟
|
||
#------------------------------------------------------------------------------
|
||
# アクターの「一定確率で再行動」の特徴は
|
||
# 発生したかどうかが非常に分かり辛いです。
|
||
#
|
||
# ももまるLabs様のXPスタイルバトルを導入した状態で
|
||
# このスクリプトを導入する事で、アクターが再行動を行える場合に
|
||
# ステート付与と同様のポップアップ及びアニメーションの表示が行える為
|
||
# 再行動の発生が視覚的に非常に分かりやすくなります。
|
||
#==============================================================================
|
||
module DUAL_ACT_POP
|
||
|
||
#連続行動発生時のポップアップ許可設定をします。
|
||
#trueでポップアップが有効、falseでポップアップが無効になります。
|
||
|
||
P_OK = true
|
||
|
||
#連続行動発生時にポップアップする文字列を設定します。
|
||
|
||
WORD = "連続行動!"
|
||
|
||
#連続行動発生時に該当者に表示するアニメーションIDを設定します。
|
||
#0以下を設定した場合は無効になります。
|
||
|
||
ANID = 81
|
||
|
||
end
|
||
class Game_Battler < Game_BattlerBase
|
||
attr_accessor :make_action_times_data
|
||
#--------------------------------------------------------------------------
|
||
# 行動回数設定
|
||
#--------------------------------------------------------------------------
|
||
alias make_action_times_repeat_seal make_action_times
|
||
def make_action_times
|
||
if !self.actor?#アクターではない場合は本来の処理
|
||
make_action_times_repeat_seal
|
||
else#アクターである場合
|
||
unless @make_action_times_data#行動回数キャッシュが存在しない場合
|
||
#本来の処理で行動回数を取得
|
||
@make_action_times_data = make_action_times_repeat_seal
|
||
#行動回数が1より多い時はポップアップとアニメーション処理を行う
|
||
if @make_action_times_data > 1
|
||
#ポップアップが有効な場合はポップアップを行う
|
||
popup_data.popup_dual_action(self) if DUAL_ACT_POP::P_OK
|
||
#アニメーションIDが0より大きい場合はアニメーションを行う
|
||
self.animation_id = DUAL_ACT_POP::ANID if DUAL_ACT_POP::ANID > 0
|
||
end
|
||
end
|
||
#行動回数のキャッシュを返す
|
||
@make_action_times_data
|
||
end
|
||
end
|
||
end
|
||
class Scene_Battle < Scene_Base
|
||
#--------------------------------------------------------------------------
|
||
# 戦闘開始時の処理
|
||
#--------------------------------------------------------------------------
|
||
alias battle_start_repeat_seal battle_start
|
||
def battle_start
|
||
#行動回数キャッシュを削除する
|
||
make_action_times_data_erase
|
||
#通常の処理を実行
|
||
battle_start_repeat_seal
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ターン開始時の処理
|
||
#--------------------------------------------------------------------------
|
||
alias turn_start_repeat_seal turn_start
|
||
def turn_start
|
||
#行動回数キャッシュを削除する
|
||
turn_start_repeat_seal
|
||
#通常の処理を実行
|
||
make_action_times_data_erase
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# 行動回数キャッシュ削除
|
||
#--------------------------------------------------------------------------
|
||
def make_action_times_data_erase
|
||
#メンバーが誰もいない時は処理しない
|
||
return if $game_party.all_members.size == 0
|
||
#各メンバーの行動回数キャッシュを削除する
|
||
$game_party.all_members.each do |actor|
|
||
actor.make_action_times_data = nil
|
||
end
|
||
end
|
||
end
|
||
class Popup_Data
|
||
#--------------------------------------------------------------------------
|
||
# 連続行動ポップアップ
|
||
#--------------------------------------------------------------------------
|
||
def popup_dual_action(target)
|
||
#XPスタイルバトルに倣ったポップアップを生成
|
||
refresh
|
||
@battler = target
|
||
number = target.make_action_times_data
|
||
return unless number > 1
|
||
@popup = DUAL_ACT_POP::WORD
|
||
type = :add_state
|
||
@type = LNX11::POPUP_TYPE[type]
|
||
@color = type
|
||
makeup
|
||
end
|
||
end |