Skip to content
Merged
13 changes: 10 additions & 3 deletions EXILED/Exiled.API/Extensions/RoleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class RoleExtensions
Team.FoundationForces or Team.Scientists => Side.Mtf,
Team.ChaosInsurgency or Team.ClassD => Side.ChaosInsurgency,
Team.OtherAlive => Side.Tutorial,
_ => Side.None,
_ => Side.None
};

/// <summary>
Expand All @@ -68,7 +68,7 @@ public static class RoleExtensions
RoleTypeId.Scp049 or RoleTypeId.Scp939 or RoleTypeId.Scp0492 or RoleTypeId.Scp079 or RoleTypeId.Scp096 or RoleTypeId.Scp106 or RoleTypeId.Scp173 or RoleTypeId.Scp3114 => Team.SCPs,
RoleTypeId.FacilityGuard or RoleTypeId.NtfCaptain or RoleTypeId.NtfPrivate or RoleTypeId.NtfSergeant or RoleTypeId.NtfSpecialist => Team.FoundationForces,
RoleTypeId.Tutorial => Team.OtherAlive,
_ => Team.Dead,
_ => Team.Dead
};

/// <summary>
Expand Down Expand Up @@ -113,7 +113,7 @@ public static bool TryGetRoleBase<T>(this RoleTypeId roleType, out T roleBase)
Team.ClassD or Team.ChaosInsurgency => LeadingTeam.ChaosInsurgency,
Team.FoundationForces or Team.Scientists => LeadingTeam.FacilityForces,
Team.SCPs => LeadingTeam.Anomalies,
_ => LeadingTeam.Draw,
_ => LeadingTeam.Draw
};

/// <summary>
Expand Down Expand Up @@ -168,5 +168,12 @@ public static Dictionary<AmmoType, ushort> GetStartingAmmo(this RoleTypeId roleT

return info.Ammo.ToDictionary(kvp => kvp.Key.GetAmmoType(), kvp => kvp.Value);
}

/// <summary>
/// Checks if the role is an SCP role.
/// </summary>
/// <param name="roleType">The <see cref="RoleTypeId"/>.</param>
/// <returns>A boolean which is true when the role is an SCP role.</returns>
public static bool IsScp(this RoleTypeId roleType) => roleType.GetTeam() == Team.SCPs;
}
}