パッケージ model.entity
クラス Weapon
java.lang.Object
model.entity.Weapon
- 直系の既知のサブクラス:
AlleyFlash,AmenomaKageuchi,Deathmatch,DragonsBane,FavoniusCodex,ProspectorShovel,SacrificialSword,SkywardBlade,SkywardSpine,TheCatch,WanderingEvenstar,WolfFang
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(String name, StatsContainer stats) Constructs a weapon with the given name and flat stat container. -
メソッドの概要
修飾子とタイプメソッド説明voidapplyPassive(StatsContainer stats, double currentTime) Applies the weapon's passive effect to the provided stats container.doubleReturns the weapon's base ATK value.getName()Returns the weapon's display name.getStats()Returns the weapon's flat stat container (base ATK, substat).getTeamBuffs(Character owner) Returns team-wide buffs provided by this weapon's passive to all party members.voidonAction(Character user, String key, CombatSimulator sim) Called by the simulator when the equipped character executes a named action (e.g.voidonDamage(Character user, AttackAction action, double currentTime, CombatSimulator sim) Called by the simulator when the equipped character deals damage.
-
コンストラクタの詳細
-
Weapon
Constructs a weapon with the given name and flat stat container.- パラメータ:
name- display name of the weaponstats- flat stats provided by the weapon (base ATK, substat, etc.)
-
-
メソッドの詳細
-
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
Returns the weapon's display name.- 戻り値:
- weapon name
-
applyPassive
Applies the weapon's passive effect to the provided stats container. Called during stat compilation byCharacter.getEffectiveStats(double)andCharacter.getStructuralStats(double). Default implementation is a no-op.- パラメータ:
stats- the stats container to mutate in-placecurrentTime- simulation time in seconds (for time-gated passives)
-
onAction
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 actionkey- action key stringsim- the active combat simulator
-
onDamage
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 damageaction- the attack action that triggered the damage eventcurrentTime- simulation time in seconds at the damage eventsim- the active combat simulator
-
getTeamBuffs
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
-