パッケージ model.entity

クラス Weapon

java.lang.Object
model.entity.Weapon
直系の既知のサブクラス:
AlleyFlash, AmenomaKageuchi, Deathmatch, DragonsBane, FavoniusCodex, ProspectorShovel, SacrificialSword, SkywardBlade, SkywardSpine, TheCatch, WanderingEvenstar, WolfFang

public class Weapon extends Object
Represents a weapon that can be equipped on a Character.

A weapon contributes flat stats (base ATK, substat) via getStats(), and may additionally modify stats through applyPassive(model.stats.StatsContainer, double) and react to simulation events via onAction(model.entity.Character, java.lang.String, simulation.CombatSimulator), onDamage(model.entity.Character, simulation.action.AttackAction, double, simulation.CombatSimulator), and getTeamBuffs(model.entity.Character).

The default implementations of all hook methods are no-ops. Specific weapons should subclass Weapon and override only the relevant hooks.

  • コンストラクタの詳細

    • Weapon

      public Weapon(String name, StatsContainer stats)
      Constructs a weapon with the given name and flat stat container.
      パラメータ:
      name - display name of the weapon
      stats - flat stats provided by the weapon (base ATK, substat, etc.)
  • メソッドの詳細

    • getStats

      public StatsContainer getStats()
      Returns the weapon's flat stat container (base ATK, substat).
      戻り値:
      stats container
    • getBaseAtk

      public double getBaseAtk()
      Returns the weapon's base ATK value.
      戻り値:
      base ATK
    • getName

      public String getName()
      Returns the weapon's display name.
      戻り値:
      weapon name
    • applyPassive

      public void applyPassive(StatsContainer stats, double currentTime)
      Applies the weapon's passive effect to the provided stats container. Called during stat compilation by Character.getEffectiveStats(double) and Character.getStructuralStats(double). Default implementation is a no-op.
      パラメータ:
      stats - the stats container to mutate in-place
      currentTime - simulation time in seconds (for time-gated passives)
    • onAction

      public void onAction(Character user, String key, CombatSimulator sim)
      Called by the simulator when the equipped character executes a named action (e.g. "E", "Q"). Use this hook to implement proc-based weapon passives that trigger on specific actions. Default implementation is a no-op.
      パラメータ:
      user - action key string identifying the action
      key - action key string
      sim - the active combat simulator
    • onDamage

      public void onDamage(Character user, AttackAction action, double currentTime, CombatSimulator sim)
      Called by the simulator when the equipped character deals damage. Use this hook to implement on-hit weapon passives. Default implementation is a no-op.
      パラメータ:
      user - the character who dealt the damage
      action - the attack action that triggered the damage event
      currentTime - simulation time in seconds at the damage event
      sim - the active combat simulator
    • getTeamBuffs

      public List<Buff> getTeamBuffs(Character owner)
      Returns team-wide buffs provided by this weapon's passive to all party members. Called when team buffs are compiled for other characters. Default implementation returns an empty list.
      パラメータ:
      owner - the character who has this weapon equipped
      戻り値:
      list of team buffs, never null