Skip to content

Commit

Permalink
Merge branch 'dev' into Fix-OnWaitingForPlayersBeingCalledTooEarly
Browse files Browse the repository at this point in the history
  • Loading branch information
louis1706 committed Jan 20, 2025
2 parents 96328e2 + 806bab5 commit e2d6805
Show file tree
Hide file tree
Showing 130 changed files with 5,111 additions and 784 deletions.
2 changes: 1 addition & 1 deletion EXILED/EXILED.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<PropertyGroup>
<!-- This is the global version and is used for all projects that don't have a version -->
<Version Condition="$(Version) == ''">9.0.0</Version>
<Version Condition="$(Version) == ''">9.4.0</Version>
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
<PublicBeta>false</PublicBeta>

Expand Down
15 changes: 15 additions & 0 deletions EXILED/Exiled.API/Enums/DamageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,20 @@ public enum DamageType
/// Damage caused by the marshmallow man.
/// </summary>
Marshmallow,

/// <summary>
/// Damage caused by <see cref="RoleTypeId.Flamingo"/> ,<see cref="RoleTypeId.AlphaFlamingo"/> or <see cref="RoleTypeId.ZombieFlamingo"/>.
/// </summary>
Scp1507,

/// <summary>
/// Damage caused by Scp956 the pinata.
/// </summary>
Scp956,

/// <summary>
/// Damage caused by <see cref="ItemType.Snowball"/>.
/// </summary>
SnowBall,
}
}
3 changes: 3 additions & 0 deletions EXILED/Exiled.API/Enums/DoorType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Exiled.API.Enums
{
using System;

using Exiled.API.Features.Doors;
using Interactables.Interobjects;

Expand Down Expand Up @@ -200,6 +202,7 @@ public enum DoorType
/// <summary>
/// Represents the NUKE_ARMORY door.
/// </summary>
[Obsolete("This Door has been removed from the game.")]
NukeArmory,

/// <summary>
Expand Down
24 changes: 24 additions & 0 deletions EXILED/Exiled.API/Enums/EffectType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,29 @@ public enum EffectType
/// <see cref="CustomPlayerEffects.Blurred"/>.
/// </summary>
Blurred,

/// <summary>
/// Makes you a flamingo.
/// </summary>
[Obsolete("Only availaible for Christmas and AprilFools.")]
BecomingFlamingo,

/// <summary>
/// Makes you a Child after eating Cake.
/// </summary>
[Obsolete("Only availaible for Christmas and AprilFools.")]
Scp559,

/// <summary>
/// Scp956 found you.
/// </summary>
[Obsolete("Only availaible for Christmas and AprilFools.")]
Scp956Target,

/// <summary>
/// you are snowed.
/// </summary>
[Obsolete("Only availaible for Christmas and AprilFools.")]
Snowed,
}
}
63 changes: 63 additions & 0 deletions EXILED/Exiled.API/Enums/LockerType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Exiled.API.Enums
{
using System;

/// <summary>
/// Unique identifier for different types of <see cref="Features.Lockers.Locker"/>s.
/// </summary>
Expand All @@ -15,6 +17,7 @@ public enum LockerType
/// <summary>
/// The pedestal used by SCP items.
/// </summary>
[Obsolete("This value is not used.")]
Pedestal,

/// <summary>
Expand Down Expand Up @@ -46,5 +49,65 @@ public enum LockerType
/// Unknow type of locker.
/// </summary>
Unknow,

/// <summary>
/// MircoHid pedestal.
/// </summary>
MicroHid,

/// <summary>
/// Experimental weapon locker.
/// </summary>
ExperimentalWeapon,

/// <summary>
/// SCP-500 pedestal.
/// </summary>
Scp500Pedestal,

/// <summary>
/// SCP-207? (Anti SCP-207) pedestal.
/// </summary>
AntiScp207Pedestal,

/// <summary>
/// SCP-207 pedestal.
/// </summary>
Scp207Pedestal,

/// <summary>
/// SCP-268 pedestal.
/// </summary>
Scp268Pedestal,

/// <summary>
/// SCP-1344 pedestal.
/// </summary>
Scp1344Pedestal,

/// <summary>
/// SCP-018 pedestal.
/// </summary>
Scp018Pedestal,

/// <summary>
/// SCP-1576 pedestal.
/// </summary>
Scp1576Pedestal,

/// <summary>
/// SCP-244 pedestal.
/// </summary>
Scp244Pedestal,

/// <summary>
/// SCP-2176 pedestal.
/// </summary>
Scp2176Pedestal,

/// <summary>
/// SCP-1853 pedestal.
/// </summary>
Scp1853Pedestal,
}
}
46 changes: 46 additions & 0 deletions EXILED/Exiled.API/Enums/ObjectiveType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// -----------------------------------------------------------------------
// <copyright file="ObjectiveType.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
/// <summary>
/// An enum representing the different types of objectives.
/// </summary>
/// <seealso cref="Exiled.API.Features.Objectives.Objective" />
public enum ObjectiveType
{
/// <summary>
/// Unknown objective.
/// </summary>
None,

/// <summary>
/// Objective that is completed when SCP item is picked up.
/// </summary>
ScpItemPickup,

/// <summary>
/// Objective that is completed when enemy military is damaged.
/// </summary>
HumanDamage,

/// <summary>
/// Objective that is completed when enemy military is killed.
/// </summary>
HumanKill,

/// <summary>
/// Objective that is completed when generator is activated.
/// </summary>
GeneratorActivation,

/// <summary>
/// Objective that is completed when player escapes.
/// </summary>
Escape,
}
}
47 changes: 47 additions & 0 deletions EXILED/Exiled.API/Enums/Scp939VisibilityStates.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// -----------------------------------------------------------------------
// <copyright file="Scp939VisibilityStates.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
using Features.Roles;

/// <summary>
/// Unique identifier for a <see cref="Scp939Role"/>.
/// </summary>
public enum Scp939VisibilityState
{
/// <summary>
/// SCP-939 doesnt see an other player, by default FPC role logic.
/// </summary>
None,

/// <summary>
/// SCP-939 doesnt see an player, by basic SCP-939 logic.
/// </summary>
NotSeen,

/// <summary>
/// SCP-939 sees an other player, who is teammate SCP.
/// </summary>
SeenAsScp,

/// <summary>
/// SCP-939 sees an other player due the Alpha Warhead detonation.
/// </summary>
SeenByDetonation,

/// <summary>
/// SCP-939 sees an other player, due the base-game vision range logic.
/// </summary>
SeenByRange,

/// <summary>
/// SCP-939 sees an other player for a while, after it's out of range.
/// </summary>
SeenByLastTime,
}
}
1 change: 1 addition & 0 deletions EXILED/Exiled.API/Enums/SpawnLocationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public enum SpawnLocationType
/// <summary>
/// Inside the Nuke armory.
/// </summary>
[Obsolete("This Location has been removed from the game.")]
InsideNukeArmory,

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions EXILED/Exiled.API/Enums/SpawnReason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,10 @@ public enum SpawnReason : byte // TOTO: Remove this file and use Basegame
/// The user will be destroyed.
/// </summary>
Destroyed,

/// <summary>
/// The user has been spawn by the usage of an Item.
/// </summary>
ItemUsage,
}
}
1 change: 0 additions & 1 deletion EXILED/Exiled.API/Exiled.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopVersion)" IncludeAssets="All" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Lib.Harmony" Version="$(HarmonyVersion)" />
</ItemGroup>

Expand Down
16 changes: 16 additions & 0 deletions EXILED/Exiled.API/Extensions/BitwiseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,21 @@ public static T ModifyFlags<T>(this T flags, bool value, params T[] changeFlags)

return (T)Enum.ToObject(typeof(T), currentValue);
}

/// <summary>
/// Checks if flag has specified value.
/// </summary>
/// <param name="flag">Flag to check.</param>
/// <param name="value">Value to check in flag.</param>
/// <typeparam name="T">The type of the enum.</typeparam>
/// <returns><see langword="true"/> if value is presented in flag. Otherwise, <see langword="false"/>.</returns>
public static bool HasFlagFast<T>(this T flag, T value)
where T : Enum
{
long flagValue = Convert.ToInt64(flag);
long valueValue = Convert.ToInt64(value);

return (flagValue & valueValue) == valueValue;
}
}
}
7 changes: 7 additions & 0 deletions EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Exiled.API.Extensions
using Enums;

using Features;
using PlayerRoles.PlayableScps.Scp1507;
using PlayerRoles.PlayableScps.Scp3114;
using PlayerStatsSystem;

Expand Down Expand Up @@ -180,6 +181,12 @@ public static DamageType GetDamageType(DamageHandlerBase damageHandlerBase)
return DamageType.MicroHid;
case DisruptorDamageHandler:
return DamageType.ParticleDisruptor;
case Scp1507DamageHandler:
return DamageType.Scp1507;
case Scp956DamageHandler:
return DamageType.Scp956;
case SnowballDamageHandler:
return DamageType.SnowBall;
case Scp049DamageHandler scp049DamageHandler:
return scp049DamageHandler.DamageSubType switch
{
Expand Down
10 changes: 7 additions & 3 deletions EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ public static class EffectTypeExtension
{ EffectType.AntiScp207, typeof(AntiScp207) },
{ EffectType.Scanned, typeof(Scanned) },
{ EffectType.SilentWalk, typeof(SilentWalk) },
#pragma warning disable CS0618
{ EffectType.Marshmallow, typeof(MarshmallowEffect) },
#pragma warning restore CS0618
{ EffectType.Strangled, typeof(Strangled) },
{ EffectType.Ghostly, typeof(Ghostly) },
{ EffectType.FogControl, typeof(FogControl) },
Expand All @@ -78,6 +75,13 @@ public static class EffectTypeExtension
{ EffectType.SeveredEyes, typeof(SeveredEyes) },
{ EffectType.PitDeath, typeof(PitDeath) },
{ EffectType.Blurred, typeof(Blurred) },
#pragma warning disable CS0618
{ EffectType.Marshmallow, typeof(MarshmallowEffect) },
{ EffectType.BecomingFlamingo, typeof(BecomingFlamingo) },
{ EffectType.Scp559, typeof(Scp559Effect) },
{ EffectType.Scp956Target, typeof(Scp956Target) },
{ EffectType.Snowed, typeof(Snowed) },
#pragma warning restore CS0618
});

/// <summary>
Expand Down
15 changes: 13 additions & 2 deletions EXILED/Exiled.API/Extensions/LockerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,25 @@ public static class LockerExtensions
/// </summary>
/// <param name="name">The name to check.</param>
/// <returns>The corresponding <see cref="LockerType"/>.</returns>
public static LockerType GetLockerTypeByName(this string name) => name.Replace("(Clone)", string.Empty) switch
public static LockerType GetLockerTypeByName(this string name) => name.Split('(')[0].Trim() switch
{
"Scp500PedestalStructure Variant" => LockerType.Pedestal,
"Scp500PedestalStructure Variant" => LockerType.Scp500Pedestal,
"AntiScp207PedestalStructure Variant" => LockerType.AntiScp207Pedestal,
"Scp207PedestalStructure Variant" => LockerType.Scp207Pedestal,
"Experimental Weapon Locker" => LockerType.ExperimentalWeapon,
"Scp1344PedestalStructure Variant" => LockerType.Scp1344Pedestal,
"Scp1576PedestalStructure Variant" => LockerType.Scp1576Pedestal,
"Scp2176PedestalStructure Variant" => LockerType.Scp2176Pedestal,
"Scp1853PedestalStructure Variant" => LockerType.Scp1853Pedestal,
"Scp268PedestalStructure Variant" => LockerType.Scp268Pedestal,
"Scp244PedestalStructure Variant" => LockerType.Scp244Pedestal,
"Scp018PedestalStructure Variant" => LockerType.Scp018Pedestal,
"LargeGunLockerStructure" => LockerType.LargeGun,
"RifleRackStructure" => LockerType.RifleRack,
"MiscLocker" => LockerType.Misc,
"RegularMedkitStructure" => LockerType.Medkit,
"AdrenalineMedkitStructure" => LockerType.Adrenaline,
"MicroHIDpedestal" => LockerType.MicroHid,
_ => LockerType.Unknow,
};
}
Expand Down
Loading

0 comments on commit e2d6805

Please sign in to comment.