Klasse RevivalService

java.lang.Object
de.delinkedde.mobarenareborn.ability.RevivalService

public final class RevivalService extends Object
Implements the healer revive passive.

When a participant of a running round is about to take lethal damage, this service looks for a healer-role player in the same session whose revive is off cooldown and within range. If one is found the fatal blow is intercepted: the rescued player is restored to a configured amount of health, granted a short Strength and Regeneration buff, and the mobs around them are knocked back. The healer's revive then enters its cooldown.

The triggering damage event is cancelled by the caller when tryRescue(Player, double) returns true. All thresholds, buffs and the cooldown are configurable under abilities.revive.

  • Konstruktordetails

    • RevivalService

      public RevivalService(@NotNull @NotNull ConfigManager config, @NotNull @NotNull SessionManager sessions, @NotNull @NotNull ClassRegistry classRegistry, @NotNull @NotNull MobScaler scaler)
      Parameter:
      config - the configuration manager
      sessions - the session manager
      classRegistry - the class registry, used to resolve a player's role
      scaler - the mob scaler, providing the arena-mob marker key
  • Methodendetails

    • tryRescue

      public boolean tryRescue(@NotNull @NotNull Player victim, double finalDamage)
      Attempts to rescue a player who is about to die.
      Parameter:
      victim - the player taking damage
      finalDamage - the final damage that will be applied
      Gibt zurück:
      true if the player was rescued and the damage should be cancelled
    • clear

      public void clear(@NotNull @NotNull UUID playerId)
      Clears any tracked cooldown for a player. Intended to be called when a player leaves.
      Parameter:
      playerId - the player id