パッケージ mechanics.buff

クラス Buff

java.lang.Object
mechanics.buff.Buff
直系の既知のサブクラス:
ActiveCharacterBuff, SimpleBuff

public abstract class Buff extends Object
Abstract base class for all stat-modifying buffs in the simulation.

A buff is active for the time window [startTime, expirationTime). Subclasses implement applyStats(model.stats.StatsContainer, double) to write their concrete bonuses into a StatsContainer. Optional targeting filters allow a buff to be restricted to certain characters (exclude(java.lang.String...)) or elements (forElement(model.type.Element)).

  • フィールドの概要

    フィールド
    修飾子とタイプ
    フィールド
    説明
    protected Set<String>
     
    protected double
     
    protected String
     
    protected double
     
    protected Element
     
  • コンストラクタの概要

    コンストラクタ
    コンストラクタ
    説明
    Buff(String name)
    Creates a permanent buff that never expires (expiration set to Double.MAX_VALUE).
    Buff(String name, double duration, double currentTime)
    Creates a time-limited buff active from currentTime for duration seconds.
  • メソッドの概要

    修飾子とタイプ
    メソッド
    説明
    boolean
    appliesToCharacter(String charName, Element charElement)
    Returns true if this buff applies to a character with the given name and element.
    void
    apply(StatsContainer stats, double currentTime)
    Applies this buff's stat bonuses to stats if currentTime falls within the active window [startTime, expirationTime).
    protected abstract void
    applyStats(StatsContainer stats, double currentTime)
    Applies this buff's concrete stat modifications.
    exclude(String... names)
    Exclude specific characters from receiving this buff.
    Restrict this buff to characters with the given element.
    Returns the display name of this buff.
    boolean
    isExpired(double currentTime)
    Returns true if this buff has expired at the given simulation time.

    クラスから継承されたメソッド java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • フィールド詳細

    • name

      protected String name
    • expirationTime

      protected double expirationTime
    • startTime

      protected double startTime
    • excludeChars

      protected Set<String> excludeChars
    • targetElement

      protected Element targetElement
  • コンストラクタの詳細

    • Buff

      public Buff(String name, double duration, double currentTime)
      Creates a time-limited buff active from currentTime for duration seconds.
      パラメータ:
      name - display name used for logging and de-duplication
      duration - how long the buff lasts in simulation seconds
      currentTime - simulation time at which the buff starts
    • Buff

      public Buff(String name)
      Creates a permanent buff that never expires (expiration set to Double.MAX_VALUE).
      パラメータ:
      name - display name of the buff
  • メソッドの詳細

    • getName

      public String getName()
      Returns the display name of this buff.
      戻り値:
      buff name string
    • exclude

      public Buff exclude(String... names)
      Exclude specific characters from receiving this buff. Returns this for chaining.
    • forElement

      public Buff forElement(Element element)
      Restrict this buff to characters with the given element. Returns this for chaining.
    • appliesToCharacter

      public boolean appliesToCharacter(String charName, Element charElement)
      Returns true if this buff applies to a character with the given name and element.
    • apply

      public void apply(StatsContainer stats, double currentTime)
      Applies this buff's stat bonuses to stats if currentTime falls within the active window [startTime, expirationTime). Logs an informational message for Ineffa/Columbina when the buff is inactive.
      パラメータ:
      stats - the stats container to modify
      currentTime - current simulation time in seconds
    • isExpired

      public boolean isExpired(double currentTime)
      Returns true if this buff has expired at the given simulation time.
      パラメータ:
      currentTime - current simulation time in seconds
      戻り値:
      true when the buff window has closed
    • applyStats

      protected abstract void applyStats(StatsContainer stats, double currentTime)
      Applies this buff's concrete stat modifications. Called only when the buff is within its active time window.
      パラメータ:
      stats - the stats container to modify
      currentTime - current simulation time in seconds