#============================================================================== # ■統合ベーススクリプト拡張ユニットH for RGSS3 Ver1.23-β # □作成者 kure # # 身代わり発動時のアニメーション表現の拡張をサポートします。 # #============================================================================== p "統合ベーススクリプトH" #-------------------------------------------------------------------------- # ★ 設定項目(各設定の値を変更してください) #-------------------------------------------------------------------------- module KURE module Integrate #身代わりが発動時のアニメーション SUBSTITUTE_ANIMATION = 94 end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ★ 身代りを適用(汎用)(追加定義) #-------------------------------------------------------------------------- def apply_substitute_ex(attacker, target, item) return target if item.ignore_substitute > rand(100) rate = target.hp_rate * 100 #対象の残りHP(%)を取得 if attacker.opposite?(target) #拡張身代わりの設定 substitute_ex = target.friends_unit.movable_members.select{|battler| rate <= battler.substitute_rate(item) && battler != target} if substitute_ex != [] substitute_unit = substitute_ex.sample #拡張アニメーションを対象に表示 show_normal_animation([substitute_unit], KURE::Integrate::SUBSTITUTE_ANIMATION) @log_window.display_substitute(substitute_unit, target) return substitute_unit end #身代わり対象 substitute_ex2 = target.ad_counter[4].collect{|block| block[4] if rate <= block[1] && (block[0] == 1 || !item.certain?)} substitute_ex2 = substitute_ex2.select{|battler| battler && battler != target} if substitute_ex2 != [] substitute_unit = substitute_ex2.sample #拡張アニメーションを対象に表示 show_normal_animation([substitute_unit], KURE::Integrate::SUBSTITUTE_ANIMATION) @log_window.display_substitute(substitute_unit, target) return substitute_unit end end apply_substitute(target, item) end end