Class SoulPowerInfo

java.lang.Object
valorless.rarespawns.datamodels.SoulPowerInfo

public class SoulPowerInfo extends Object
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

  • Field Details

    • type

      public final SoulPowerInfo.SoulPowerType type
      Trigger type for when a Soul Power activates.
    • cooldown

      public final Double cooldown
      Cooldown in seconds between activations. Never negative.
    • chance

      public final Double chance
      Percent chance [0..100] to activate when the trigger occurs.
    • failCooldown

      public final Boolean failCooldown
      If true, apply cooldown even when the activation roll fails.
  • Constructor Details

    • SoulPowerInfo

      public SoulPowerInfo(String id)
      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

      public static SoulPowerInfo getAbilityInfo(String id)
      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