パッケージ mechanics.buff
クラス Buff
java.lang.Object
mechanics.buff.Buff
- 直系の既知のサブクラス:
ActiveCharacterBuff,SimpleBuff
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)).
-
フィールドの概要
フィールド -
コンストラクタの概要
コンストラクタコンストラクタ説明Creates a permanent buff that never expires (expiration set toDouble.MAX_VALUE).Creates a time-limited buff active fromcurrentTimefordurationseconds. -
メソッドの概要
修飾子とタイプメソッド説明booleanappliesToCharacter(String charName, Element charElement) Returns true if this buff applies to a character with the given name and element.voidapply(StatsContainer stats, double currentTime) Applies this buff's stat bonuses tostatsifcurrentTimefalls within the active window[startTime, expirationTime).protected abstract voidapplyStats(StatsContainer stats, double currentTime) Applies this buff's concrete stat modifications.Exclude specific characters from receiving this buff.forElement(Element element) Restrict this buff to characters with the given element.getName()Returns the display name of this buff.booleanisExpired(double currentTime) Returnstrueif this buff has expired at the given simulation time.
-
フィールド詳細
-
name
-
expirationTime
protected double expirationTime -
startTime
protected double startTime -
excludeChars
-
targetElement
-
-
コンストラクタの詳細
-
Buff
Creates a time-limited buff active fromcurrentTimefordurationseconds.- パラメータ:
name- display name used for logging and de-duplicationduration- how long the buff lasts in simulation secondscurrentTime- simulation time at which the buff starts
-
Buff
Creates a permanent buff that never expires (expiration set toDouble.MAX_VALUE).- パラメータ:
name- display name of the buff
-
-
メソッドの詳細
-
getName
Returns the display name of this buff.- 戻り値:
- buff name string
-
exclude
Exclude specific characters from receiving this buff. Returns this for chaining. -
forElement
Restrict this buff to characters with the given element. Returns this for chaining. -
appliesToCharacter
Returns true if this buff applies to a character with the given name and element. -
apply
Applies this buff's stat bonuses tostatsifcurrentTimefalls within the active window[startTime, expirationTime). Logs an informational message for Ineffa/Columbina when the buff is inactive.- パラメータ:
stats- the stats container to modifycurrentTime- current simulation time in seconds
-
isExpired
public boolean isExpired(double currentTime) Returnstrueif this buff has expired at the given simulation time.- パラメータ:
currentTime- current simulation time in seconds- 戻り値:
truewhen the buff window has closed
-
applyStats
Applies this buff's concrete stat modifications. Called only when the buff is within its active time window.- パラメータ:
stats- the stats container to modifycurrentTime- current simulation time in seconds
-