Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3497,6 +3497,21 @@ public void AddAhp(float amount, float limit = 75f, float decay = 1.2f, float ef
.ServerAddProcess(amount, limit, decay, efficacy, sustain, persistant);
}

/// <summary>
/// Adds a new <see cref="RegenerationProcess"/> to the player.
/// </summary>
/// <param name="starttime">The delay before regeneration starts (in seconds).</param>
/// <param name="rate">Health points regenerated per second.</param>
/// <param name="duration">Total duration of the regeneration (in seconds).</param>
/// <param name="speedMultiplier">How fast the regeneration progresses (default is 1.0).</param>
/// <param name="healthPointsMultiplier">Multiplier for HP amount being regenerated (default is 1.0).</param>
public void AddRegeneration(float starttime = 0f, float rate = 1f, float duration = 1f, float speedMultiplier = 1f, float healthPointsMultiplier = 1f)
{
AnimationCurve regenCurve = AnimationCurve.Constant(starttime, duration, rate);
UsableItemsController.GetHandler(ReferenceHub)
.ActiveRegenerations.Add(new RegenerationProcess(regenCurve, speedMultiplier, healthPointsMultiplier));
}

/// <summary>
/// Reconnects the player to the server. Can be used to redirect them to another server on a different port but same IP.
/// </summary>
Expand Down