パッケージ simulation.action

クラス AttackAction

java.lang.Object
simulation.action.AttackAction

public class AttackAction extends Object
Describes a single discrete damage-dealing action performed by a character. Instances are passed to CombatSimulator.performAction(String, AttackAction) and consumed by DamageCalculator to produce a final damage value.

Key responsibilities:

  • Carries the talent motion value (damagePercent), scaling stat, element, and ActionType needed by the damage formula.
  • Specifies ICD group and gauge units for elemental aura application.
  • Controls animation duration so that advanceTime correctly consumes cast time after each action.
  • Supports custom Lunar mechanics via isLunarConsidered and lunarReactionType.
  • コンストラクタの詳細

    • AttackAction

      public AttackAction(String name, double damagePercent, Element element, StatType scalingStat)
      Minimal constructor. Uses 0.5 s animation, no bonus stat, no snapshot, ActionType.OTHER.
      パラメータ:
      name - display name of the action
      damagePercent - talent multiplier as a decimal (e.g. 7.21 for 721%)
      element - elemental infusion of the hit
      scalingStat - stat used as the base for scaling (usually BASE_ATK)
    • AttackAction

      public AttackAction(String name, double damagePercent, Element element, StatType scalingStat, StatType bonusStat)
      Constructor with bonus stat override. Uses 0.5 s animation, no snapshot, ActionType.OTHER.
      パラメータ:
      name - display name of the action
      damagePercent - talent multiplier as a decimal
      element - elemental infusion of the hit
      scalingStat - base scaling stat
      bonusStat - additional DMG bonus stat to include (e.g. BURST_DMG_BONUS)
    • AttackAction

      public AttackAction(String name, double damagePercent, Element element, StatType scalingStat, StatType bonusStat, double duration)
      Constructor with bonus stat and custom animation duration. No snapshot, ActionType.OTHER.
      パラメータ:
      name - display name of the action
      damagePercent - talent multiplier as a decimal
      element - elemental infusion of the hit
      scalingStat - base scaling stat
      bonusStat - additional DMG bonus stat
      duration - animation duration in seconds
    • AttackAction

      public AttackAction(String name, double damagePercent, Element element, StatType scalingStat, StatType bonusStat, double duration, boolean useSnapshot)
      Constructor with snapshot control. Uses ActionType.OTHER.
      パラメータ:
      name - display name of the action
      damagePercent - talent multiplier as a decimal
      element - elemental infusion of the hit
      scalingStat - base scaling stat
      bonusStat - additional DMG bonus stat
      duration - animation duration in seconds
      useSnapshot - if true, stats are snapshotted at cast time rather than re-evaluated at damage time
    • AttackAction

      public AttackAction(String name, double damagePercent, Element element, StatType scalingStat, StatType bonusStat, double duration, ActionType actionType)
      Constructor with explicit ActionType. No snapshot.
      パラメータ:
      name - display name of the action
      damagePercent - talent multiplier as a decimal
      element - elemental infusion of the hit
      scalingStat - base scaling stat
      bonusStat - additional DMG bonus stat
      duration - animation duration in seconds
      actionType - the ability category (NORMAL, SKILL, BURST, etc.)
    • AttackAction

      public AttackAction(String name, double damagePercent, Element element, StatType scalingStat, StatType bonusStat, double duration, boolean useSnapshot, ActionType actionType)
      Full constructor used internally by all shorter overloads. Initializes ICD to ICDType.Standard / ICDTag.None with 1.0 GU.
      パラメータ:
      name - display name of the action
      damagePercent - talent multiplier as a decimal
      element - elemental infusion of the hit
      scalingStat - base scaling stat
      bonusStat - additional DMG bonus stat
      duration - animation duration in seconds
      useSnapshot - whether stats are snapshotted at cast time
      actionType - the ability category
  • メソッドの詳細

    • setAnimationDuration

      public void setAnimationDuration(double duration)
      Overrides the animation duration for this action. The simulator advances time by this value after the action resolves, factoring in ATK SPD for NORMAL / CHARGE actions.
      パラメータ:
      duration - animation duration in seconds
    • setLunarConsidered

      public void setLunarConsidered(boolean b)
      Marks whether this action participates in the custom Lunar damage system. When true, the simulator may fire a synthetic ReactionResult for Lunar-specific hooks before normal damage calculation.
      パラメータ:
      b - true to enable Lunar consideration
    • isLunarConsidered

      public boolean isLunarConsidered()
      Returns whether this action is considered part of the Lunar damage system.
      戻り値:
      true if Lunar hooks are active for this action
    • setLunarReactionType

      public void setLunarReactionType(String type)
      Sets the Lunar reaction sub-type (e.g. "Charged", "Bloom", "Crystallize") and implicitly enables isLunarConsidered. This causes the simulator to notify reaction listeners with a synthetic "Lunar-<type>" result before the normal damage step.
      パラメータ:
      type - the Lunar reaction sub-type string, or null to clear
    • getLunarReactionType

      public String getLunarReactionType()
      Returns the Lunar reaction sub-type for this action, or null if none.
      戻り値:
      the Lunar reaction type string
    • addBonusStat

      public void addBonusStat(StatType type, double value)
      Adds an extra per-action stat bonus that is applied only when this action is calculated. Useful for constellation or passive bonuses scoped to a specific hit. Multiple calls for the same StatType accumulate additively.
      パラメータ:
      type - the stat to modify
      value - the additive amount to add
    • getExtraBonuses

      public Map<StatType,Double> getExtraBonuses()
      Returns the map of per-action extra stat bonuses set via addBonusStat(model.type.StatType, double).
      戻り値:
      an unmodifiable view of the extra bonus map
    • setCountsAsBurstDmg

      public void setCountsAsBurstDmg(boolean countsAsBurstDmg)
      Marks this action as counting as Burst damage for weapon / artifact interactions that specifically trigger on Burst hits (e.g. The Catch).
      パラメータ:
      countsAsBurstDmg - true to enable Burst damage classification
    • isCountsAsBurstDmg

      public boolean isCountsAsBurstDmg()
      Returns whether this action is classified as Burst damage for bonus interactions.
      戻り値:
      true if this action counts as Burst damage
    • setCountsAsSkillDmg

      public void setCountsAsSkillDmg(boolean countsAsSkillDmg)
      Marks this action as counting as Skill damage for weapon / artifact interactions that specifically trigger on Skill hits (e.g. Wolf-Fang).
      パラメータ:
      countsAsSkillDmg - true to enable Skill damage classification
    • isCountsAsSkillDmg

      public boolean isCountsAsSkillDmg()
      Returns whether this action is classified as Skill damage for bonus interactions.
      戻り値:
      true if this action counts as Skill damage
    • setICD

      public void setICD(ICDType type, ICDTag tag, double gauge)
      Sets the ICD parameters for elemental application tracking. Calls to ICDManager use these values to determine whether this hit actually applies an elemental gauge to the enemy.
      パラメータ:
      type - the ICDType (e.g. Standard 2.5 s / 3-hit rule)
      tag - the ICDTag grouping tag that separates independent ICD sequences
      gauge - the gauge units (GU) applied on a successful element application
    • getICDType

      public ICDType getICDType()
      Returns the ICD type used to evaluate element application eligibility.
      戻り値:
      the ICDType
    • getICDTag

      public ICDTag getICDTag()
      Returns the ICD tag used to group hits into independent ICD sequences.
      戻り値:
      the ICDTag
    • getGaugeUnits

      public double getGaugeUnits()
      Returns the elemental gauge units applied by this hit when ICD permits.
      戻り値:
      gauge units (GU)
    • isUseSnapshot

      public boolean isUseSnapshot()
      Returns whether this action uses snapshotted stats from cast time. When true, buffs that expire before the hit still contribute.
      戻り値:
      true if stats are snapshotted at cast time
    • getAnimationDuration

      public double getAnimationDuration()
      Returns the animation duration used to advance simulation time after the action.
      戻り値:
      animation duration in seconds
    • getName

      public String getName()
      Returns the display name of this action (e.g. "Musou no Hitotachi").
      戻り値:
      action name
    • getDamagePercent

      public double getDamagePercent()
      Returns the talent multiplier as a decimal (e.g. 7.21 represents 721%).
      戻り値:
      damage percent / motion value
    • getElement

      public Element getElement()
      Returns the element of this hit, used for aura application and reaction checks.
      戻り値:
      hit element
    • getScalingStat

      public StatType getScalingStat()
      Returns the primary stat this action scales from (e.g. BASE_ATK).
      戻り値:
      the scaling StatType
    • getBonusStat

      public StatType getBonusStat()
      Returns the secondary DMG bonus stat specific to this action's ability type (e.g. BURST_DMG_BONUS), or null if none.
      戻り値:
      the bonus StatType, or null
    • getElementType

      public StatType getElementType()
      推奨されていません。
      Use getElement() instead.
      Deprecated compatibility method. Always returns null.
      戻り値:
      null
    • getActionType

      public ActionType getActionType()
      Returns the ability category of this action (NORMAL, SKILL, BURST, etc.).
      戻り値:
      the ActionType
    • getMotionValue

      public double getMotionValue()
      推奨されていません。
      Use getDamagePercent() instead.
      Compatibility alias for getDamagePercent().
      戻り値:
      the damage percent / motion value
    • getScalingStatValue

      public double getScalingStatValue(StatsContainer stats)
      Resolves the numeric value of the scaling stat from the provided StatsContainer. Handles ATK, HP, and DEF stat families; falls back to total ATK for unknown stats.
      パラメータ:
      stats - the stat container to resolve from
      戻り値:
      the resolved numeric stat value
    • setDefenseIgnore

      public void setDefenseIgnore(double val)
      Sets the defense ignore fraction for this action (range 0.0–1.0). Used for constellation effects such as Raiden C2.
      パラメータ:
      val - defense ignore value (0.0 = none, 1.0 = full ignore)
    • getDefenseIgnore

      public double getDefenseIgnore()
      Returns the defense ignore fraction applied during damage calculation.
      戻り値:
      defense ignore value (0.0–1.0)
    • setDebugFormula

      public void setDebugFormula(String debugFormula)
      Stores a human-readable formula string used in HTML report tooltips and debug logs.
      パラメータ:
      debugFormula - the formula string to attach
    • getDebugFormula

      public String getDebugFormula()
      Returns the debug formula string for this action, or null if not set.
      戻り値:
      debug formula string