Skip to content

Commit

Permalink
feat: Add and remove influence (#330)
Browse files Browse the repository at this point in the history
* Add and remove influence

* Added set and get influence

* inline

---------

Co-authored-by: VALERA771 <[email protected]>
  • Loading branch information
Bonjemus and VALERA771 authored Dec 30, 2024
1 parent 607e85d commit c6cd7da
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions EXILED/Exiled.API/Features/Respawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,34 @@ public static bool SetTokens(SpawnableFaction spawnableFaction, int amount)
return false;
}

/// <summary>
/// Grants influence to a given <see cref="Faction"/>'s <see cref="ILimitedWave"/>s.
/// </summary>
/// <param name="faction">The <see cref="Faction"/> to whose <see cref="ILimitedWave"/>s to grant influence.</param>
/// <param name="amount">The amount of influence to grant.</param>
public static void GrantInfluence(Faction faction, int amount) => FactionInfluenceManager.Add(faction, amount);

/// <summary>
/// Removes influence from a given <see cref="Faction"/>'s <see cref="ILimitedWave"/>s.
/// </summary>
/// <param name="faction">The <see cref="Faction"/> from whose <see cref="ILimitedWave"/>s to remove influence.</param>
/// <param name="amount">The amount of influence to remove.</param>
public static void RemoveInfluence(Faction faction, int amount) => FactionInfluenceManager.Remove(faction, amount);

/// <summary>
/// Get influence to a given <see cref="Faction"/>.
/// </summary>
/// <param name="faction">The <see cref="Faction"/> to get influence.</param>
/// <returns>Get the faction influence..</returns>
public static float GetInfluence(Faction faction) => FactionInfluenceManager.Get(faction);

/// <summary>
/// Set influence to a given <see cref="Faction"/>.
/// </summary>
/// <param name="faction">The <see cref="Faction"/> to set influence.</param>
/// <param name="influence">The amount of influence to set.</param>
public static void SetInfluence(Faction faction, float influence) => FactionInfluenceManager.Set(faction, influence);

/// <summary>
/// Starts the spawn sequence of the given <see cref="Faction"/>.
/// </summary>
Expand Down

0 comments on commit c6cd7da

Please sign in to comment.