#============================================================================== # ■ RGSS3 バトラーアニメ原点変動 Ver1.00 by 星潟 #------------------------------------------------------------------------------ # アクター・エネミーのバトラーグラフィックにアニメーションが発生する際 # アクター・エネミー別にアニメーションの基準位置に応じて # アニメーション原点のY座標を変動させる事ができるようになります。 #============================================================================== # アクター・エネミーのメモ欄に設定 #------------------------------------------------------------------------------ # <アニメ原点変動:0,30> # # 基準位置:頭上のアニメーションの基準位置のY座標を+30する。 #------------------------------------------------------------------------------ # <アニメ原点変動:1,-30> # # 基準位置:中心のアニメーションの基準位置のY座標を-30する。 #------------------------------------------------------------------------------ # <アニメ原点変動:2,-15> # # 基準位置:足元のアニメーションの基準位置のY座標を-15する。 #============================================================================== module AnimationOXYCByBattler #アニメ原点変動の設定用キーワードを指定。 Word = "アニメ原点変動" end class Sprite_Base < Sprite #-------------------------------------------------------------------------- # アニメーションの原点設定 #-------------------------------------------------------------------------- alias set_animation_origin_ani_oxyc_by_battler set_animation_origin def set_animation_origin set_animation_origin_ani_oxyc_by_battler execute_ani_oxyc_by_battler end #-------------------------------------------------------------------------- # アニメーションの原点をバトラー依存で変更 #-------------------------------------------------------------------------- def execute_ani_oxyc_by_battler end end class Sprite_Battler < Sprite_Base #-------------------------------------------------------------------------- # アニメーションの原点をバトラー依存で変更 #-------------------------------------------------------------------------- def execute_ani_oxyc_by_battler return unless @animation && @battler case @animation.position when 0..2 @ani_oy += @battler.ani_oxyc[@animation.position] end end end class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # アニメーションの原点の変更値を取得 #-------------------------------------------------------------------------- def ani_oxyc actor.ani_oxyc end end class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # アニメーションの原点の変更値を取得 #-------------------------------------------------------------------------- def ani_oxyc enemy.ani_oxyc end end class RPG::BaseItem #-------------------------------------------------------------------------- # アニメーションの原点の変更値 #-------------------------------------------------------------------------- def ani_oxyc @ani_oxyc ||= create_ani_oxyc end #-------------------------------------------------------------------------- # アニメーションの原点の変更値を作成 #-------------------------------------------------------------------------- def create_ani_oxyc h = {} w = AnimationOXYCByBattler::Word note.each_line {|l| if /<#{w}[::](\d+),(\S+)>/ =~ l k = $1.to_i next if k < 0 or k > 2 h[$1.to_i] = $2.to_i end} 3.times {|i| h[i] ||= 0} h end end