Klasse RevivalService
java.lang.Object
de.delinkedde.mobarenareborn.ability.RevivalService
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.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRevivalService(@NotNull ConfigManager config, @NotNull SessionManager sessions, @NotNull ClassRegistry classRegistry, @NotNull MobScaler scaler) -
Methodenübersicht
-
Konstruktordetails
-
RevivalService
public RevivalService(@NotNull @NotNull ConfigManager config, @NotNull @NotNull SessionManager sessions, @NotNull @NotNull ClassRegistry classRegistry, @NotNull @NotNull MobScaler scaler) - Parameter:
config- the configuration managersessions- the session managerclassRegistry- the class registry, used to resolve a player's rolescaler- the mob scaler, providing the arena-mob marker key
-
-
Methodendetails
-
tryRescue
Attempts to rescue a player who is about to die.- Parameter:
victim- the player taking damagefinalDamage- the final damage that will be applied- Gibt zurück:
trueif the player was rescued and the damage should be cancelled
-
clear
Clears any tracked cooldown for a player. Intended to be called when a player leaves.- Parameter:
playerId- the player id
-