Permanent
Creation

RPGツクールXP/VX用のRGSS素材です。
一部英語版対応です。 (A few materials can be used for English RPG MAKER XP/VX.)
競合率はルファーの独断と偏見なのでたまにハズレます。


#==============================================================================
# ■ 最終フラッシュorSE演奏でダメージ表示
#------------------------------------------------------------------------------
#  バトル画面で、バトラーや画面のフラッシュとダメージ表示のタイミングをピタリ
# 合わせます。
# (C) ルファー
# WebSite  https://tkoolerlufar.pages.dev/
#==============================================================================

=begin
  =対応RGSS
  1

  =他の素材との競合の可能性
  !.. きわめて低い

  =導入方法
  Scene_Battle 4 より下に新セクションを作成して、
  このプログラムをそこにコピーする

  =更新履歴
  2009/06/08 アニメーションの再生が終わるまで待つことがあるバグ修正
  2009/05/12 短いアニメーションでもタイミングを合わせるよう仕様変更
  2008/01/02 公開

  =再定義しているメソッド
  Game_Battler#initialize (エイリアス使用)
  Scene_Battle#update_phase4_step3 (エイリアス使用)
  Scene_Battle#update_phase4_step4 (エイリアス使用)

  =新規定義しているメソッド
  Game_Battler#active (プロパティ)
  Sprite_Battler#animation
  Sprite_Battler#effect?
=end
#----------------------------------------------------------------------------
# ◆ Game_Battler クラス
#----------------------------------------------------------------------------
class Game_Battler
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :active
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias lfr3_old_init initialize
  def initialize
    lfr3_old_init
    @active = false
  end
end
#----------------------------------------------------------------------------
# ◆ Sprite_Battler クラス
#----------------------------------------------------------------------------
class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # ○ アニメーションの開始
  #--------------------------------------------------------------------------
  def animation(animation, hit)
    super(animation, hit)
    @_animation_active = @battler.active
    @battler.active = false
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト表示中判定
  #--------------------------------------------------------------------------
  def effect?
    animation_last_timing = -1
    unless @_animation_active or @_animation_duration == 0
      for timing in @_animation.timings
        if (timing.condition == 0) or
           (timing.condition == 1 and  @_animation_hit) or
           (timing.condition == 2 and !@_animation_hit)
          animation_last_timing = [animation_last_timing, timing.frame].max
        end
      end
    end
    animation_last_duration = animation_last_timing == -1 ? 0 :
      @_animation.frame_max - animation_last_timing
    return(
      @_whiten_duration > 0 or
      @_appear_duration > 0 or
      @_escape_duration > 0 or
      @_collapse_duration > 0 or
      @_damage_duration > 0 or
      @_animation_duration > animation_last_duration
    )
  end
end
#----------------------------------------------------------------------------
# ■ Scene_Battle クラス
#----------------------------------------------------------------------------
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  #--------------------------------------------------------------------------
  alias lfr3_old_udp4s3 update_phase4_step3
  def update_phase4_step3
    @active_battler.active = true if (1 .. 999).include?(@animation1_id)
    lfr3_old_udp4s3
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  #--------------------------------------------------------------------------
  alias lfr3_old_udp4s4 update_phase4_step4
  def update_phase4_step4
    lfr3_old_udp4s4
    if @animation1_id | @animation2_id != 0
      @wait_count = 0
    end
  end
end

戻る