Package valorless.rarespawns.datamodels
Class SoulPowerInfo
java.lang.Object
valorless.rarespawns.datamodels.SoulPowerInfo
Immutable view of a Soul Power's metadata resolved from its annotation.
Instances are constructed by reading the SoulPowerInfo
annotation on a compiled Soul Power class returned by SoulPowerCompiler.getPower(String).
Values are normalized:
- cooldown is clamped to a minimum of 0 seconds
- chance is clamped to the 0..100 range
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported event trigger types for Soul Powers. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSoulPowerInfo(String id) Builds a SoulPowerInfo by reading the annotation declared on the power with the given ID. -
Method Summary
Modifier and TypeMethodDescriptionstatic SoulPowerInfogetAbilityInfo(String id) Convenience factory for creating a SoulPowerInfo for the given power ID.
-
Field Details
-
type
Trigger type for when a Soul Power activates. -
cooldown
Cooldown in seconds between activations. Never negative. -
chance
Percent chance [0..100] to activate when the trigger occurs. -
failCooldown
If true, apply cooldown even when the activation roll fails.
-
-
Constructor Details
-
SoulPowerInfo
Builds a SoulPowerInfo by reading the annotation declared on the power with the given ID.- Parameters:
id- the registered power ID used to locate the compiled power class
-
-
Method Details
-
getAbilityInfo
Convenience factory for creating a SoulPowerInfo for the given power ID.- Parameters:
id- the registered power ID- Returns:
- a new SoulPowerInfo representing the power's metadata
-