diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs
index b32a0366..d58359eb 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs
@@ -1,7 +1,9 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using PlayerRoles;
using PlayerStatsSystem;
using System;
+using UnityEngine;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -16,11 +18,20 @@ public class PlayerDeathEventArgs : EventArgs, IPlayerEvent
/// The player who died.
/// The player who caused the death.
/// The damage that caused the death.
- public PlayerDeathEventArgs(ReferenceHub player, ReferenceHub? attacker, DamageHandlerBase damageHandler)
+ /// The previous role of the player before death.
+ /// The previous world position of the player before death.
+ /// The previous velocity of the player before death.
+ /// The previous world rotation of the players camera before death.
+ public PlayerDeathEventArgs(ReferenceHub player, ReferenceHub? attacker, DamageHandlerBase damageHandler,
+ RoleTypeId oldRole, Vector3 oldPosition, Vector3 oldVelocity, Quaternion oldCameraRotation)
{
Player = Player.Get(player);
Attacker = Player.Get(attacker);
DamageHandler = damageHandler;
+ OldRole = oldRole;
+ OldPosition = oldPosition;
+ OldVelocity = oldVelocity;
+ OldCameraRotation = oldCameraRotation;
}
///
@@ -37,4 +48,24 @@ public PlayerDeathEventArgs(ReferenceHub player, ReferenceHub? attacker, DamageH
/// Gets the damage that caused the death.
///
public DamageHandlerBase DamageHandler { get; }
+
+ ///
+ /// Gets the role of the before they had died.
+ ///
+ public RoleTypeId OldRole { get; }
+
+ ///
+ /// Gets the player's position before they died.
+ ///
+ public Vector3 OldPosition { get; }
+
+ ///
+ /// Gets the player's velocity before they died.
+ ///
+ public Vector3 OldVelocity { get; }
+
+ ///
+ /// Gets the player's camera rotation before they died.
+ ///
+ public Quaternion OldCameraRotation { get; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs
index b6f17fd0..9dd3ff9e 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs
@@ -15,10 +15,12 @@ public class PlayerDroppedItemEventArgs : EventArgs, IPlayerEvent, IPickupEvent
///
/// The player who dropped the item.
/// The item pickup.
- public PlayerDroppedItemEventArgs(ReferenceHub player, ItemPickupBase pickup)
+ /// Whether the item will be thrown.
+ public PlayerDroppedItemEventArgs(ReferenceHub player, ItemPickupBase pickup, bool isThrowing)
{
Player = Player.Get(player);
Pickup = Pickup.Get(pickup);
+ Throw = isThrowing;
}
///
@@ -30,4 +32,9 @@ public PlayerDroppedItemEventArgs(ReferenceHub player, ItemPickupBase pickup)
/// Gets the item pickup.
///
public Pickup Pickup { get; }
+
+ ///
+ /// Gets or sets whether the will be thrown by the .
+ ///
+ public bool Throw { get; set; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs
index 3ae57892..dc5f3e4d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs
@@ -15,11 +15,13 @@ public class PlayerDroppingItemEventArgs : EventArgs, ICancellableEvent, IItemEv
///
/// The player who is dropping the item.
/// The item being dropped.
- public PlayerDroppingItemEventArgs(ReferenceHub player, ItemBase item)
+ /// Whether the item will be thrown.
+ public PlayerDroppingItemEventArgs(ReferenceHub player, ItemBase item, bool isThrowing)
{
IsAllowed = true;
Player = Player.Get(player);
Item = Item.Get(item);
+ Throw = isThrowing;
}
///
@@ -32,6 +34,11 @@ public PlayerDroppingItemEventArgs(ReferenceHub player, ItemBase item)
///
public Item Item { get; }
+ ///
+ /// Gets or sets whether the will be thrown by the .
+ ///
+ public bool Throw { get; set; }
+
///
public bool IsAllowed { get; set; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs
index 344c74a2..e4385b58 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs
@@ -14,11 +14,13 @@ public class PlayerPlacedBloodEventArgs : EventArgs, IPlayerEvent
/// Initializes a new instance of the class.
///
/// The player whose blood it is.
+ /// The player that attacked.
/// Position at which blood has been spawned.
/// Position where the blood decal raycast will start for it to be properly attached to surface.
- public PlayerPlacedBloodEventArgs(ReferenceHub player, Vector3 hitPosition, Vector3 startRaycast)
+ public PlayerPlacedBloodEventArgs(ReferenceHub player, ReferenceHub attacker, Vector3 hitPosition, Vector3 startRaycast)
{
Player = Player.Get(player);
+ Attacker = Player.Get(attacker);
HitPosition = hitPosition;
RaycastStart = startRaycast;
}
@@ -28,6 +30,11 @@ public PlayerPlacedBloodEventArgs(ReferenceHub player, Vector3 hitPosition, Vect
///
public Player Player { get; }
+ ///
+ /// Gets the player that attacked the .
+ ///
+ public Player Attacker { get; }
+
///
/// Gets the position at which blood has been spawned.
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs
index 26bcf50d..cf28fff4 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs
@@ -14,12 +14,14 @@ public class PlayerPlacingBloodEventArgs : EventArgs, IPlayerEvent, ICancellable
/// Initializes a new instance of the class.
///
/// The player whose blood it is.
+ /// The player that attacked.
/// Position at which is blood being placed.
/// Position where the blood decal raycast will start for it to be properly attached to surface.
- public PlayerPlacingBloodEventArgs(ReferenceHub player, Vector3 hitPosition, Vector3 startRaycast)
+ public PlayerPlacingBloodEventArgs(ReferenceHub player, ReferenceHub attacker, Vector3 hitPosition, Vector3 startRaycast)
{
IsAllowed = true;
Player = Player.Get(player);
+ Attacker = Player.Get(attacker);
HitPosition = hitPosition;
RaycastStart = startRaycast;
}
@@ -29,6 +31,11 @@ public PlayerPlacingBloodEventArgs(ReferenceHub player, Vector3 hitPosition, Vec
///
public Player Player { get; }
+ ///
+ /// Gets the player that attacked the .
+ ///
+ public Player Attacker { get; }
+
///
/// Gets the position at which is blood being placed.
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs
index 57794b3f..9cb18a10 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs
@@ -15,11 +15,13 @@ public class PlayerUnlockingGeneratorEventArgs : EventArgs, IPlayerEvent, IGener
///
/// The player who is unlocking the generator.
/// The generator that the player is unlocking.
- public PlayerUnlockingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ /// Whether the generator can be opened.
+ public PlayerUnlockingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator, bool canOpen)
{
Player = Player.Get(player);
Generator = Generator.Get(generator);
IsAllowed = true;
+ CanOpen = canOpen;
}
///
@@ -30,7 +32,14 @@ public PlayerUnlockingGeneratorEventArgs(ReferenceHub player, Scp079Generator ge
///
public Generator Generator { get; }
- ///
+ ///
+ /// Gets whether the player can open the generator.
+ ///
+ public bool CanOpen { get; set; }
+
+ ///
+ /// Gets whether this event is allowed. Not allowing this event will not unlock the generator and no denied animation is played.
+ ///
public bool IsAllowed { get; set; }
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079PingedEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079PingedEventArgs.cs
new file mode 100644
index 00000000..19b49334
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079PingedEventArgs.cs
@@ -0,0 +1,48 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Enums;
+using LabApi.Features.Wrappers;
+using System;
+using UnityEngine;
+
+namespace LabApi.Events.Arguments.Scp079Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp079PingedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-079 player instance.
+ /// The world position of the ping.
+ /// Normal vector for the ping.
+ /// The index of the ping type.
+ public Scp079PingedEventArgs(ReferenceHub player, Vector3 position, Vector3 normal, byte index)
+ {
+ Player = Player.Get(player);
+ Position = position;
+ Normal = normal;
+ PingType = (Scp079PingType)index;
+ }
+
+ ///
+ /// Gets the SCP-079 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the world ping position.
+ ///
+ public Vector3 Position { get; }
+
+ ///
+ /// Gets the ping normal vector.
+ ///
+ public Vector3 Normal { get; }
+
+ ///
+ /// Gets the type of the ping used the icon.
+ ///
+ public Scp079PingType PingType { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079PingingEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079PingingEventArgs.cs
new file mode 100644
index 00000000..f27502db
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079PingingEventArgs.cs
@@ -0,0 +1,52 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Enums;
+using LabApi.Features.Wrappers;
+using System;
+using UnityEngine;
+
+namespace LabApi.Events.Arguments.Scp079Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp079PingingEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-079 player instance.
+ /// The world position of the ping.
+ /// Normal vector for the ping.
+ /// The index of the ping type.
+ public Scp079PingingEventArgs(ReferenceHub player, Vector3 position, Vector3 normal, byte index)
+ {
+ Player = Player.Get(player);
+ Position = position;
+ Normal = normal;
+ PingType = (Scp079PingType)index;
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the SCP-079 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets the world ping position.
+ ///
+ public Vector3 Position { get; set; }
+
+ ///
+ /// Gets or sets the ping normal vector.
+ ///
+ public Vector3 Normal { get; set; }
+
+ ///
+ /// Gets or sets the type of the ping used the icon.
+ ///
+ public Scp079PingType PingType { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs
new file mode 100644
index 00000000..4ddd004b
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs
@@ -0,0 +1,23 @@
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Contains the arguments for the event.
+///
+public class RoundEndingConditionsCheckEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Whether the round end conditions are met
+ public RoundEndingConditionsCheckEventArgs(bool canEnd)
+ {
+ CanEnd = canEnd;
+ }
+
+ ///
+ /// Gets or sets whether the round end conditions are met.
+ ///
+ public bool CanEnd { get; set; }
+}
diff --git a/LabApi/Events/Handlers/Scp079Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp079Events.EventHandlers.cs
index d3820f8e..43b2097e 100644
--- a/LabApi/Events/Handlers/Scp079Events.EventHandlers.cs
+++ b/LabApi/Events/Handlers/Scp079Events.EventHandlers.cs
@@ -116,4 +116,14 @@ public static partial class Scp079Events
/// Gets called when SCP-079 has used a tesla.
///
public static event LabEventHandler? UsedTesla;
+
+ ///
+ /// Gets called when SCP-079 is using ping ability.
+ ///
+ public static event LabEventHandler? Pinging;
+
+ ///
+ /// Gets called when SCP-079 used ping ability.
+ ///
+ public static event LabEventHandler? Pinged;
}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs b/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs
index ef5066ec..7c8ea582 100644
--- a/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs
+++ b/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs
@@ -17,6 +17,11 @@ public static partial class ServerEvents
///
public static event LabEventHandler? RoundRestarted;
+ ///
+ /// Gets called when round end conditions are checked.
+ ///
+ public static event LabEventHandler? RoundEndingConditionsCheck;
+
///
/// Gets called when the round is ending.
///
diff --git a/LabApi/Features/Enums/Scp079PingType.cs b/LabApi/Features/Enums/Scp079PingType.cs
new file mode 100644
index 00000000..9060ef6d
--- /dev/null
+++ b/LabApi/Features/Enums/Scp079PingType.cs
@@ -0,0 +1,44 @@
+using LabApi.Features.Wrappers;
+
+namespace LabApi.Features.Enums;
+
+///
+/// Enum used for type of the ping.
+///
+public enum Scp079PingType : byte
+{
+ ///
+ /// ping.
+ ///
+ Generator = 0,
+
+ ///
+ /// and pings.
+ ///
+ Projectile = 1,
+
+ ///
+ /// Micro-HID ping.
+ ///
+ MicroHid = 2,
+
+ ///
+ /// human role ping.
+ ///
+ Human = 3,
+
+ ///
+ /// ping.
+ ///
+ Elevator = 4,
+
+ ///
+ /// ping.
+ ///
+ Door = 5,
+
+ ///
+ /// Default "i" icon ping.
+ ///
+ Default = 6,
+}
diff --git a/LabApi/Features/Wrappers/Facility/Doors/Door.cs b/LabApi/Features/Wrappers/Facility/Doors/Door.cs
index 14bddcb2..6e2c6ff5 100644
--- a/LabApi/Features/Wrappers/Facility/Doors/Door.cs
+++ b/LabApi/Features/Wrappers/Facility/Doors/Door.cs
@@ -1,5 +1,4 @@
using Generators;
-using Hazards;
using Interactables.Interobjects;
using Interactables.Interobjects.DoorUtils;
using LabApi.Features.Enums;
@@ -143,7 +142,7 @@ internal virtual void OnRemove()
///
/// Gets the rooms which have this door.
///
- public RoomIdentifier[] Rooms => Base.Rooms;
+ public Room[] Rooms => Base.Rooms.Select(Room.Get).ToArray();
///
/// Gets the zone in which this door is.
diff --git a/LabApi/Features/Wrappers/Items/Item.cs b/LabApi/Features/Wrappers/Items/Item.cs
index c0c32280..6cb82c72 100644
--- a/LabApi/Features/Wrappers/Items/Item.cs
+++ b/LabApi/Features/Wrappers/Items/Item.cs
@@ -65,6 +65,8 @@ internal static void Initialize()
Register(x => new BodyArmorItem(x));
Register(x => new ThrowableItem(x));
Register(x => new KeycardItem(x));
+ Register(x => new KeycardItem(x));
+ Register(x => new KeycardItem(x));
Register(x => new MicroHIDItem(x));
}
diff --git a/LabApi/Features/Wrappers/Items/KeycardItem.cs b/LabApi/Features/Wrappers/Items/KeycardItem.cs
index cd605b66..f6ba7f73 100644
--- a/LabApi/Features/Wrappers/Items/KeycardItem.cs
+++ b/LabApi/Features/Wrappers/Items/KeycardItem.cs
@@ -51,6 +51,16 @@ internal override void OnRemove()
///
public new BaseKeycardItem Base { get; }
+ ///
+ /// Gets the of the keycard.
+ ///
+ public DoorPermissionFlags Permissions => Base.GetPermissions(null);
+
+ ///
+ /// Gets the of the keycard which represent the tiers shown on the keycard.
+ ///
+ public KeycardLevels Levels => new KeycardLevels(Permissions);
+
#region Custom Keycards
///
@@ -140,8 +150,8 @@ internal override void OnRemove()
if (detailBase is not ICustomizableDetail customizableDetail)
continue;
- customizableDetail.SetArguments(new ArraySegment